Commit graph

82 commits

Author SHA1 Message Date
Scott Lahteine 85512e9372 Drop FORCE_INLINE from temperature.h
`FORCE_INLINE` seems to have no effect on code generation with standard
optimization.
2016-05-30 17:06:50 -07:00
Scott Lahteine 78fb02a5ad Apply static to Temperature class 2016-05-30 16:50:51 -07:00
Scott Lahteine 0e55c06f7d Rename CORE_AXIS_3 to NORMAL_AXIS 2016-05-23 13:58:40 -07:00
Scott Lahteine 5172d4ba40 COREYZ stepper, planner, endstop, babysteps 2016-05-23 13:58:40 -07:00
Scott Lahteine 6b13c430ae The TRReset state is not needed with fall-through 2016-05-08 17:01:46 -07:00
Scott Lahteine b65ea98d6b Localize babystepping in the Temperature class
So that `ultralcd.cpp` doesn’t need to worry about the details.
2016-05-05 15:00:31 -07:00
esenapaj 1a97442d19 Follow-up the PR #3643(Temperature singleton)
Follow-up the PR #3643(Temperature singleton)

・Change from fanSpeedSoftPwm[0] to thermalManager.fanSpeedSoftPwm[0] in planner.cpp
It fix compilation error when FAN_SOFT_PWM is enabled.

・Remove declaration of setExtruderAutoFanState() in temperature.h
Because that function was abolished.

・Change from babystepsTodo to thermalManager.babystepsTodo in ultralcd.cpp
It fix compilation errors when BABYSTEPPING is enabled.
2016-05-05 18:01:39 +09:00
Scott Lahteine 084f6b5b44 Temperature singleton class 2016-05-04 19:42:12 -07:00
Scott Lahteine 60c6efb75c Merge pull request #3653 from thinkyhead/rc_bed_temp_watch_merge
Introduce temp watch protection for the bed
2016-05-01 13:58:28 -07:00
gralco 908229dbb3 Introduce temp watch protection for the bed
When setting the bed temp via M140/M190 if the thermistor does not read an increase of WATCH_BED_TEMP_INCREASE degrees by WATCH_BED_TEMP_PERIOD seconds then it will throw "Error:Heating failed, system stopped! Heater_ID: bed" and call the kill() function.

Conflicts:
	Marlin/Configuration_adv.h
2016-05-01 13:12:51 -07:00
Scott Lahteine 96f51f400f Planner singleton class 2016-04-30 17:26:50 -07:00
Scott Lahteine ba66336503 Output error for disabled M303 2016-04-18 19:03:45 -07:00
Scott Lahteine d4a848c72a Fix broken PID_PARAMS_PER_EXTRUDER
As noted by @FalloutBe in #3519
2016-04-16 19:19:40 -07:00
esenapaj f9e1a0ee6c suppress warnings 2016-04-04 06:48:53 +09:00
Scott Lahteine 1a79b13b7a FILAMENT_SENSOR -> FILAMENT_WIDTH_SENSOR 2016-03-29 20:54:31 -07:00
Scott Lahteine 0da744b7b0 Further cleanup of comments, partial Doxygen-style
Following up on #3231
2016-03-25 00:45:56 -07:00
jbrazio 5e5d250832 Added gplv3 header to all Marlin files 2016-03-24 18:01:20 +00:00
Scott Lahteine 04fa9d4f47 Make Autotune options into Menu Edit Items 2016-03-24 02:00:08 -07:00
WPBack e3f583a3be Fixes for PID AutoTune from menu
Fixes for #3189

Setting a temp is still missing
2016-03-24 01:47:30 -07:00
WPBack 3b3e8a02b5 Initial implementation of PID Autotune Menu Items
Adds the parameter U to M303. If U1 is included , it will use the
PID-values from the auto-tune.
2016-03-24 01:46:37 -07:00
Scott Lahteine 0c7f7ebcfb Styling adjustments (PR#2668 & PR#2670)
Keep "astyled" reformatting
2015-10-03 22:02:45 -05:00
Scott Lahteine 51e89a269c Overridable Options - Part 9 (PR#2561)
Apply `ENABLED` / `DISABLED` macros to temperature-related files.
2015-07-31 01:05:55 -05:00
AnHardt 9b0fa9c309 Changed dependency of start_watching_heater() in setTargetHotend() to THERMAL_PROTECTION_HOTENDS 2015-05-21 21:07:37 +02:00
AnHardt bc0764894a Shift call of start_watching_heater() into setTargetHotend()
to warrant watching is set or reset.

Make setTargetBed() in _lcd_preheat() dependant of TEMP_SENSOR_BED.
Use disable_all_heaters() in lcd_cooldown() and abort_on_endstop_hit.
2015-05-21 20:36:11 +02:00
Scott Lahteine 2445ae3d3a Combine thermal runaway and watch-period
- Make thermal protection for all hotends and/or bed into simple
switches
- Now enable `WATCH_TEMP_PERIOD` when `THERMAL_PROTECTION_HOTENDS` is
enabled
- Move detailed thermal parameters to `Configuration_adv.h`
- Add sanity checks to warn about old configurations
- Change `WATCH_TEMP_PERIOD` to seconds instead of milliseconds
2015-05-10 22:52:01 -07:00
Scott Lahteine 9b3d4380d3 Only watch the heater that was set 2015-05-10 20:26:45 -07:00
Scott Lahteine 54deb9eea3 Enable WATCH_TEMP_PERIOD by default 2015-05-08 22:36:02 -07:00
Scott Lahteine 09d60e0128 Naming and code comments 2015-04-13 17:17:36 -07:00
Scott Lahteine 4c7af484f8 Merge pull request #1787 from thinkyhead/fixup_tr
Fix: thermal_runaway_protection triggered by target temperature increase
2015-04-03 20:06:56 -07:00
Scott Lahteine c747becec1 Merge pull request #1796 from thinkyhead/pidbed_temp_eeprom
Add PIDTEMPBED to EEPROM
2015-04-03 20:03:38 -07:00
Scott Lahteine 713953d8c1 Upstream commits, allow no extruder in M105 2015-04-03 19:16:38 -07:00
Scott Lahteine 424d5495e4 Add PIDTEMPBED to EEPROM 2015-04-03 16:38:05 -07:00
Scott Lahteine 0e8182bbf2 Additional pin tests, cleanup 2015-04-03 15:31:35 -07:00
Scott Lahteine e96df67630 Clarify thermal_runaway_protection
- Add comments documenting `thermal_runaway_protection`
- Add an enum for the thermal runaway states
- Add macros for temperature helper functions
- Fix a glitch with the z probe sled in homeaxis
2015-04-02 05:10:14 -07:00
AnHardt 7b2550a604 Times can't be negative.
cardreader.cpp needs temperature.h for autotempShutdown() when
AUTOTEMP is defined but warns about unused variables.
Unpublished variables by putting them in to temperature.cpp.
2015-03-30 01:58:46 +02:00
Scott Lahteine fe29bdd72b Also fix temperature externs 2015-03-27 16:26:07 -07:00
Scott Lahteine 9c9726d469 Cleanup of temperature code
- Reduce calls to millis()
- General cleanup of manage_heaters
- General cleanup of pid autotune
- Formatting here & there
- Macros to clean up and shrink ISR code (reduced by ~364 lines)
2015-02-24 04:46:11 -08:00
MagoKimbra 986e723eeb Add 4th extruder 2015-01-24 13:37:58 +01:00
grob6000 bf2c923db5 Make multiple PID parameters a config option
* Adds config parameter `PID_PARAMS_PER_EXTRUDER` - allows single PID
parameters to be used where this would be preferable (e.g. dual
identical extruders)
* When disabled, will use `float Kp, Ki, Kd, Kc;` as before.
Preprocessor macros used to switch between.
* ultralcd.cpp defines extra menus for extra parameters only where
required
* M301 reports `e:xx` only if independent pid parameters enabled
* EEPROM structure still leaves space for 3 extruders worth, when undef
will save single parameter to all extruder positions, but only read the
first
* Switching off saves approx 330 B with no LCD enabled, 2634B with LCD
(RRD) enabled: this is significant.
* LCD modifications should be tested.
2015-01-11 13:50:17 +11:00
grob6000 37c7e8300f Independent PID parameters for each extruder
* Variables Kp, Ki, Kd, Kc now arrays of size EXTRUDERS
* M301 gains (optional, default=0) E parameter to define which
extruder's settings to modify. Tested, works with Repetier Host's EEPROM
config window, albeit only reads/updates settings for E0.
* All Kp, Ki, Kd, Kc parameters saved in EEPROM (version now v14), up to
3 extruders supported (same as Marlin in general)
2015-01-10 16:35:12 +11:00
Greg Rebholz 7ecb7cbd46 Added "auto fan" checks to PID_autotune 2014-12-23 23:50:00 -05:00
Denis Chertykov b086394178 Fix syntax errors in #ifdef. 2014-12-20 19:33:43 +03:00
Filip Mulier 85649a4549 Real-time filament diameter measurement and control
This feature allows the printer to read the filament diameter
automatically and adjust the printer in real time.  Added code to read
an analog voltage that represents a filament diameter measurement.  This
measurement is delayed in a ring buffer to compensate for sensors that
are a distance away from the extruder.  The measurement is used to
adjust the volumetric_multiplier for the extruder.  Some additional g
codes (M404, M405, M406, M407) are used to set parameters and turn
on/off the control. g code M221 is updated.  Pins for RAMPS1.4, RAMBO,
and Printrboard are identified for analog input.  The configuration file
is updated with relevant user parameters.
2014-08-06 19:30:57 -05:00
alexborro 43c298a7a9 Add "Thermal Runaway Protection" feature
This is a feature to protect your printer from burn up in flames if it
has a thermistor coming off place (this happened to a friend of mine
recently and motivated me writing this feature).

The issue: If a thermistor come off, it will read a lower temperature
than actual. The system will turn the heater on forever, burning up the
filament and anything
else around.

After the temperature reaches the target for the first time, this
feature will start measuring for how long the current temperature stays
below the target minus _HYSTERESIS (set_temperature -
THERMAL_RUNAWAY_PROTECTION_HYSTERESIS).

If it stays longer than _PERIOD, it means the thermistor temperature
cannot catch up with the target, so something *may be* wrong. Then, to
be on the safe side, the system will he halt.

Bear in mind the count down will just start AFTER the first time the
thermistor temperature is over the target, so you will have no problem
if your extruder heater takes 2 minutes to hit the target on heating.
2014-06-30 15:22:49 -03:00
Cylindric d819c55395 Various typo fixes - only in comments, no code changes. 2014-02-25 09:52:58 +00:00
Alex Borro 5c44f6c434 Bed Heater monitoring in Controller Fan
In some cases the Bed Heater FET heats up more then stepper drivers, so
this change add the bed monitoring to the controller fan. As soon as the
bed heater is turned on, the controller fan will run as well.
2013-11-27 23:23:06 -02:00
Alex Borro dd3086d3f2 Show Temperature ADC values
If "SHOW_TEMP_ADC_VALUES" is defined in Configuration_adv.h, the M105
command will present, after tradicional temperatures, the ADC value read
from temp sensors. This is great for adjusting thermistor tables with
thermocouple.

From Pronterface you can see the ADC value and compare with a
thermocouple reading.. then you just need to create your own thermistor
table.

Since this merge doesnt change the original information, it doesnt mess
with PC software parsing (tested under Pronterface and Repetier-Host).
2013-10-12 10:41:23 -03:00
bkubicek d147a057ac Add the socalled "Babystepping" feature.
It is a realtime control over the head position via the LCD menu system that works _while_ printing.
Using it, one can e.g. tune the z-position in realtime, while printing the first layer.
Also, lost steps can be manually added/removed, but thats not the prime feature.
Stuff is placed into the Tune->Babystep *

It is not possible to have realtime control via gcode sending due to the buffering, so I did not include a gcode yet. However, it could be added, but it movements will not be realtime then.

Historically, a very similar thing was implemented for the "Kaamermaker" project, while Joris was babysitting his offspring, hence the name.

say goodby to fuddling around with the z-axis.
2013-10-06 21:14:51 +02:00
Scott Lahteine 5dabc95409 Apply all changes from latest Marlin_V1
Diffed and merged, preserving my updates
2013-06-06 15:49:25 -07:00
Simon Oliver 93f0463b21 Allow Edit menu to call fn after edit; Fix PID Ki and Kd display in menus; Actually use changed PID and Max Accel values
Add new 'callback' edit-menu types that call a function after the edit is done. Use this to display and edit Ki and Kd correctly (removing the scaling first and reapplying it after). Also use it to reset maximum stepwise acceleration rates, after updating mm/s^2 rates via menus. (Previously, changes did nothing to affect planner unless saved back to EEPROM, and the machine reset).

Add calls to updatePID() so that PID loop uses updated values whether set by gcode (it already did this), or by restoring defaults, or loading from EEPROM (it didn't do those last two). Similarly, update the maximum step/s^2 accel rates when the mm/s^2 values are changed - whether by menu edits, restore defaults, or EEPROM read.

Refactor the acceleration rate update logic, and the PID scaling logic, into new functions that can be called from wherever, including the callbacks.

Add menu items to allow the z jerk and e jerk to be viewed/edited in the Control->Motion menu, as per xy jerk.

Conflicts:
	Marlin/language.h
2013-04-12 13:31:30 +02:00