Commit Graph

64 Commits

Author SHA1 Message Date
Yuri D'Elia
c1051e046c Remove private declaration 2022-07-25 17:30:22 +02:00
Yuri D'Elia
0933f01a7f temperature: Do not expose check_min/max_temp 2022-07-25 17:30:22 +02:00
Yuri D'Elia
c6d0494cbc Split temperature management into it's own ISR
Use a new low-priority "temp_mgr_isr" running at constant rate for
temperature management.

This is done so that the temperatures are sampled at a constant
independent interval *and* with reduced jitter. Likewise for actual
PID management.

This will require further adjustment for the min/max/runaway display,
which cannot be done directly into this function anymore (the code will
need to disable heaters but flag for display to be handled in
manage_heaters).
2022-07-25 17:30:21 +02:00
Yuri D'Elia
2ca16a06cd Rename tp_init to soft_pwm_init for consistency 2022-07-25 17:30:21 +02:00
Yuri D'Elia
383319dbac Rename temperature_isr to soft_pwm_isr 2022-07-25 17:30:21 +02:00
Yuri D'Elia
f8de274db3 Split fan checks out of temperature.cpp 2022-07-18 17:53:27 +02:00
Guðni Már Gilbert
c62c412cc3 Remove unused setting PID_ADD_EXTRUSION_RATE
Even if the setting was turned on, it doesn't do anything useful.
2022-03-30 19:03:41 +01:00
Guðni Már Gilbert
9bf45773f9 Merge remote-tracking branch 'upstream/MK3' into rebase-testing-ground-v2 2022-01-30 11:43:16 +00:00
Guðni Már Gilbert
66782e9c9d setTargetHotend expect an uint8_t, not int for second parameter
also change _usb_timer to ShortTimer

Saves 28 bytes of Flash and 1 byte of SRAM
2022-01-30 11:39:24 +00:00
Voinea Dragos
a5cd99a917 Disable unimplemented PID_ADD_EXTRUSION_RATE 2022-01-30 11:22:44 +00:00
DRracer
0be90dc5d1
Merge pull request #3320 from prusa3d/MK3_3.10.1
Merge MK3_3.10.1 into MK3 after release
2021-12-17 14:02:13 +01:00
Yuri D'Elia
320835a1b7 Do not cancel wait-for-temperature loops in disable_heaters()
Partially revert previous change: cancelling a single loop would often
advance the gcode stream to the next wait-for loop if executed at the
beginning of an SD print, implicitly turning off the flag again.

Cancel the loop directly in UnconditionalStop() which stops the command
queue as well in an atomic way, handling this correctly.
2021-12-10 01:46:20 +01:00
Yuri D'Elia
a3915b57b9 Improve temp_runaway_stop robustness
Remove most of the duplicated code inside temp_runaway_stop(),
making it identical to the other temperature handlers.

Move the lower-level functions required to stop the entirety of the
machine into UnconditionalStop(). Reuse this function inside
lcd_print_stop().

Set the LCD alert message before calling Stop(), as done in other safety
handlers, so that the error is visible while the printer is stopping.

This also avoids other temporary status messages to appear before
the real issue is shown and/or STEALING the first CRITICAL alert
level before we do.
2021-12-07 19:25:34 +01:00
Guðni Már Gilbert
31c8e4bc4c * Remove redundant externs already included with temperature.h
* Add ifdefs in Dcodes.cpp when using extern variables
2021-07-20 09:12:14 +02:00
Yuri D'Elia
28e9c814fc Remove code duplication for babystep insertion 2021-02-25 16:44:16 +01:00
Alex Voinea
a95feb56d9
ALTFAN override 2020-07-20 19:35:25 +03:00
Marek Bel
23cc22bc22 Move has_temperature_compensation() into temperature.cpp.
No change in FLASH usage.
2020-06-16 00:41:21 +02:00
Alex Voinea
751f810dd7
ALTFAN implementation (#2692)
* ALTFAN implementation

* Use CRITICAL_SECTION macros

* Use uint16_t instead of unsigned int

* Add forgotten CRITICAL_SECTION

* Documentation
2020-06-01 17:58:15 +02:00
DRracer
67e9b4c096
IR fsensor fixes (#2632)
* MK3S IR sensor detection and safe operational range fix
* debug, change of fsensor_IR_check behavior
* more doc + disable debug print voltage
* fix displaying MSG_04_OR_NEWER and MSG_03.... kudos to @ovariludovit
* better handling of fsensor not responding scenario
2020-04-28 10:20:21 +02:00
DRracer
65228a046e
Merge pull request #2520 from MRprusa3d/PFW-x001bPR
FS PCB auto-detect
2020-03-26 17:36:18 +01:00
D.R.racer
34ac2917ae fix. warning "Macro expansion producing 'defined' has undefined
behavior"
update screen layout comments
2020-03-26 14:40:47 +01:00
MRprusa3d
f09323a78f heaters-checking update 2020-03-03 14:57:45 +01:00
Alex Voinea
b05ee33fc9
Merge branch 'MK3' into MK3_BED_LEVELING_PWM 2020-01-07 07:58:32 +02:00
MRprusa3d
6e2793566c
Merge branch 'MK3' into PFW-943 2019-11-18 14:43:46 +01:00
leptun
7650e2b60c Handle disable_heater() 2019-10-06 12:43:03 +03:00
leptun
fd01942db8 FAN Error fix - Initial 2019-09-19 20:48:59 +03:00
MRprusa3d
0e1d559f03
Merge branch 'MK3' into PFW-943 2019-09-16 15:29:28 +02:00
MRprusa3d
011468598e IR sensor gen. II
disconnected PCB detection
2019-09-16 00:43:37 +02:00
Marek Bel
269aef1696 Remove unused code guarded by WATCH_TEMP_PERIOD macro as most of the functionality is duplicate to what is implemented in temp_runaway_check(). This will release us from porting setWatch() to unified preheat menu and maintaining it. 2019-08-27 20:05:10 +02:00
Marek Bel
f0727214ed Document 2019-07-15 19:15:15 +02:00
DRracer
83578c3389 documentation + minor code cleanup based on code review 2019-06-06 15:50:13 +02:00
DRracer
6755791778 Fix repeated fan error checking 2019-05-31 11:29:11 +02:00
Ondrej Tuma
63235625ab pause printer by flag 2019-05-23 13:13:11 +02:00
Marek Bel
4100bd33a7 Fix Dcodes compilation errors and warnings. 2019-03-19 13:53:58 +01:00
PavelSindler
f9298b37b8 fan check hotfix (selftest, measuring RPM, fan errors) 2019-02-05 04:02:38 +01:00
Robert Pelnar
eea755496b Conditional translation for SYSTEM_TIMER_2 because we want to have posibility to switch between old/new implementation.
Timing functions (millis, micros and delay) replaced in whole source, defined in Marlin.h.
This commit enables original implementation (SYSTEM_TIMER_2 undefined)
Verified with passed complete wizard process.
2019-01-27 22:48:51 +01:00
Robert Pelnar
c4d5b58c37 Merge remote-tracking branch 'upstream/MK3' into MK3-bed_fast_pwm
# Conflicts:
#	Firmware/temperature.cpp
resolved
2019-01-23 17:04:41 +01:00
Robert Pelnar
0963c889f0 Fast PWM for bed - timer2 used as system timer 2019-01-21 17:57:07 +01:00
MRprusa3d
d7ac459da7 PID / manage_heater
build-warnings elimination
2019-01-20 01:23:15 +01:00
MRprusa3d
d9f8e4eb9e PID / manage_heater
PSD regulator improvement
2019-01-17 02:57:08 +01:00
Marek Bel
20ba2b1c79 Use cs.bedKp, cs.bedKi and cs.bedKd from ConfigurationStore. 2018-09-24 16:57:48 +02:00
Marek Bel
54bcc8aa52 Use cs.Kp, cs.Ki and cs.Kd from ConfigurationStore. 2018-09-24 16:54:50 +02:00
Marek Bel
98ba79e518 Fix out of array bounds access.
Manifested as compiler warnings:

In file included from sketch/Marlin_main.cpp:67:0:
sketch/temperature.h: In function 'bool gcode_M45(bool, int8_t)':
sketch/temperature.h:142:30: warning: array subscript is above array bounds [-Warray-bounds]
   target_temperature[extruder] = celsius;
                              ^
sketch/temperature.h:142:30: warning: array subscript is above array bounds [-Warray-bounds]
   target_temperature[extruder] = celsius;
                              ^
sketch/temperature.h: In function 'void long_pause()':
sketch/temperature.h:142:30: warning: array subscript is above array bounds [-Warray-bounds]
   target_temperature[extruder] = celsius;
                              ^
sketch/temperature.h:142:30: warning: array subscript is above array bounds [-Warray-bounds]
   target_temperature[extruder] = celsius;
                              ^
sketch/temperature.h: In function 'void process_commands()':
sketch/temperature.h:142:30: warning: array subscript is above array bounds [-Warray-bounds]
   target_temperature[extruder] = celsius;
                              ^
sketch/temperature.h:142:30: warning: array subscript is above array bounds [-Warray-bounds]
   target_temperature[extruder] = celsius;
                              ^
2018-07-25 12:52:02 +02:00
Marek Bel
88cce94cf9 Revert "Revert "Save 80B of flash and 8B of RAM and fix compiler warning:""
This reverts commit 77426b563a.
2018-07-23 13:35:38 +02:00
PavelSindler
77426b563a
Revert "Save 80B of flash and 8B of RAM and fix compiler warning:" 2018-07-17 11:28:44 +02:00
Marek Bel
ee366ce3b5 Fix compiler warnings:
In file included from sketch/ConfigurationStore.cpp:3:0:
sketch/temperature.h:193:14: warning: 'temp_runaway_status' defined but not used [-Wunused-variable]
 static float temp_runaway_status[4];
              ^
sketch/temperature.h:194:14: warning: 'temp_runaway_target' defined but not used [-Wunused-variable]
 static float temp_runaway_target[4];
              ^
sketch/temperature.h:195:14: warning: 'temp_runaway_timer' defined but not used [-Wunused-variable]
 static float temp_runaway_timer[4];
              ^
sketch/temperature.h:196:12: warning: 'temp_runaway_error_counter' defined but not used [-Wunused-variable]
 static int temp_runaway_error_counter[4];
2018-07-13 19:18:54 +02:00
Robert Pelnar
ac1a56b493 Merge branch 'MK25' into MK3 2018-03-13 20:43:19 +01:00
Robert Pelnar
65a91b366d New XYZ calibration with image processing 2018-03-13 12:55:35 +01:00
Robert Pelnar
a6f900fd3c Merge remote-tracking branch 'upstream/MK25' into MK25
# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
2018-03-06 15:11:50 +01:00
Robert Pelnar
c5175e97ec Pinout, conditional translation and variant file for MK2 2018-02-21 15:19:34 +01:00