Commit Graph

344 Commits

Author SHA1 Message Date
Guðni Már Gilbert 5295bfa040 Remove dead macro timer02_set_pwm0
It looks like it was removed here
https://github.com/prusa3d/Prusa-Firmware/pull/1979
4 years ago

No change in memory
2023-07-14 14:28:14 +02:00
3d-gussner bf8fd7ed90 Add max_overshoot_pi_autotune value
Prepare for REVO 60W
2023-06-07 12:50:56 +02:00
Guðni Már Gilbert 0cf0d40a2e Remove checkAllHotends() 2023-04-22 15:15:21 +00:00
Guðni Már Gilbert c7f0ee13be Missed these macros disable_e1/2 2023-04-22 15:15:21 +00:00
Guðni Már Gilbert c14332bfb2 Combine two ifdefs 2023-04-22 15:15:21 +00:00
Guðni Már Gilbert 327b5b230b Remove soft_pwm_1 and soft_pwm_2 2023-04-22 15:15:21 +00:00
Guðni Már Gilbert fcabcd2804 Remove TEMP_SENSOR_1 and TEMP_SENSOR_2
Hopefully I didn't miss anything
2023-04-22 15:15:21 +00:00
Guðni Már Gilbert f539b40611 Remove more EXTRUDERS > 1 code 2023-04-22 15:15:21 +00:00
Guðni Már Gilbert ccabf1fa31 Remove random //-// comments 2023-04-22 13:39:08 +00:00
Alex Voinea 2dcaae80d5
Merge pull request #4027 from gudnimg/minor-optimisation-gudni
Many minor optimisations for 3.13/3.14
2023-04-17 21:27:48 +02:00
Alex Voinea f6135f2ed1 Enable Analog IR sensor again 2023-04-16 13:58:18 +00:00
Guðni Már Gilbert d175dba669 optimisation: use expired_cont is specific places
!variable.running() || variable.expired()
is equal to
variable.expired_cont()

The latter required less flash memory

Change in memory:
Flash: -28 bytes
SRAM: 0 bytes
2023-04-15 13:45:09 +00:00
Alex Voinea f388d8abb6
postponed kill() message with softReset 2023-04-13 10:57:00 +02:00
Yuri D'Elia a8f219259a TM: Split default model parameters into a separate header
Preparation to support multiple default model parameter sets
2023-02-17 15:01:59 +01:00
Yuri D'Elia d1ff728e4f TM: future-proofing for incompatible model upgrades
Introduce a model version. This is initialized at "1" and doesn't
require any upgrade/downgrade checks since it's currently
retro-compatible.
2023-02-17 15:01:59 +01:00
Yuri D'Elia ddf5147f9f TM: Optimize temp_model_set_lag
Save about 20 bytes by rewriting the sample count check
2023-02-17 15:01:59 +01:00
Yuri D'Elia b676d395e3 TM: Handle L/TEMP_MODEL_LAG 2023-02-17 15:01:59 +01:00
Yuri D'Elia 0bf6a5bc4b TM: Handle UV (PTC loss)
Model UV as power-invariant, so that scaling P doesn't change the
intercept location (that is, the zero point remains at the same
temperature even for more powerful heaters).

NOTE: It's not clear to me whether this is generally true (couldn't
find a datasheet from the same heater in diffent power variants
showing the efficiency loss)
2023-02-17 15:01:59 +01:00
Yuri D'Elia ba96c8d457 TM: Handle D/TEMP_MODEL_fS 2023-02-17 15:01:59 +01:00
Yuri D'Elia eb88b720ac TM: Handle UVDL set/load/report/upgrade
- Expose TEMP_MODEL_fS and TEMP_MODEL_LAG as D and L respectively,
  initializing the default values based on the previous hard-coded
  values.
- Always round L to the effective sample lag to future-proof model
  upgrades or changes (the stored value _is_ the effective value).
- Introduce UV as a new linear term for PTC heaters, defaulting
  to an identity for model backward-compatibility.
2023-02-17 15:01:59 +01:00
Guðni Már Gilbert d66e2b66c2 Cleanup: use setTargetHotend consistently for one extruder
Main changes:
* setAllTargetHotends() is removed
* setTargetHotendSafe() is removed
* Extruder parameter on setTargetHotend() is dropped

Change in memory:
Flash: -192 bytes
SRAM: 0 bytes
2023-02-01 08:28:23 +01:00
Yuri D'Elia e39f2d132e TM: Check for PC parameters more carefully 2023-01-27 14:57:59 +01:00
Guðni Már Gilbert 79a10868fe cleanup: FILWIDTH_PIN doesn't exist
raw_filwidth_value variable is never used
2023-01-24 19:41:45 +00:00
Yuri D'Elia 4f177f0b38 TM: Fan measuring state reset unification
Add resetFanCheck() to reset the fan measuring state as it's needed in
several places and save some flash space.
2023-01-16 08:43:36 +01:00
Yuri D'Elia 204df90d6d TM: Set the cal status bit when running `M310 A` directly
Running `M310 A` should set the TM calibration bit status if the
autotune procedure was successful.

Partially addresses #3891 and #3890, since running `M310 A F0` should
*still* count as valid calibration data and is not something that can be
replicated by using the LCD (which enforces self-test).
2023-01-16 07:32:57 +01:00
Yuri D'Elia 7a6d588d97 TM: Mark more internal functions as static 2023-01-02 10:52:07 +01:00
Yuri D'Elia 50209815ea TM: Also clear the status flags when disabling the model
Disabling the model during a warn/error condition will also stop
updating the warning/error flag, keeping the printer in an error state.

Clear all flags as well when changing model settings.
2023-01-02 10:52:07 +01:00
3d-gussner 0bcb4ab59d
Merge pull request #3822 from wavexx/tm_partial_lock
MK3: TM: Prevent lockout on invalid model values
2022-12-20 14:13:56 +01:00
3d-gussner 65f5b9e53d
Merge pull request #3818 from wavexx/tm_default_state
TM: Provide full defaults for model data and enable it by default
2022-12-20 07:08:25 +01:00
Yuri D'Elia c0f96e062b TM: Force initialization after reset 2022-12-19 18:08:01 +01:00
Yuri D'Elia 0972ef70d0 Use menu_set_block() in ThermalStop()
Set a menu block for fatal thermal errors instead of abusing
lcd_return_to_status() to kick the user out of the menus.

This now allows a thermal model error to be recoverable through menu
access.
2022-12-17 16:42:22 +01:00
Yuri D'Elia 365f845c99 TM: correctly mark repeated anomalies 2022-12-17 16:33:42 +01:00
Yuri D'Elia c05ac535be TM: reset fan measuring state when changing speed
Ensure that fan checks are reset and use the new speed at each step of
the calibration.

This also gives extra time to the fan to ramp-up from a cold start,
when a fancheck could previously start right *after* the speed change.

Should fix #3791
2022-12-16 15:30:30 +01:00
Yuri D'Elia 36575a4f83 Restore the previous model state when performing a nozzle change
Do not force-enable the model if it was previously disabled.
2022-12-12 20:17:56 +01:00
Yuri D'Elia 249be543fc TM: Restore all original values if autotune fails
- Ensures repeated autotune attempts with self-check can't succeed due
  to different starting conditions.
- Allows for a simpler workflow during selftest and wizard if autotune
  fails.
2022-12-12 17:52:48 +01:00
Yuri D'Elia 2051809e2f TM: Store only the last autotune result state
- Remove tm::valid and temp_model_valid as it's a duplicate of the
  calibrated() state.
- Add temp_model_autotune_result() for future use.
2022-12-12 17:52:48 +01:00
Yuri D'Elia 324e501b18 TM: Set default resistance levels for MK3/MK3S
Provide average calibrated values for all fan levels for MK3/MK3S
variants and enable the model by default.

This ensures the calibration step is not skipped unless explicitly
disabled.

Force-clear fan values during autotune to restore the previous
calibration behavior, as fan resistance levels can be too big and
prevent the autotune-with-selfcheck to fail.
2022-12-12 17:52:48 +01:00
Yuri D'Elia 877c0bd35c Fix potential buffer overflow in LCD messages 2022-12-12 17:52:48 +01:00
Yuri D'Elia e2f1bfe506 TM: Remove unnecessary display comments
Favor code readability
2022-12-12 17:52:48 +01:00
3d-gussner fd6da0e766 Fix typo
Add lcd_setatatus_serial to output lcd status message and serial at the same time
2022-11-02 10:09:32 +01:00
3d-gussner 072b3f8300 Temp Model cal. menu 2022-10-26 13:34:27 +02:00
3d-gussner f2fe9a51ee rename `Extruder fan` to `Hotend fan` 2022-10-17 13:49:18 +02:00
Alex Voinea 629fc9d0f1
Merge pull request #3638 from wavexx/tm_cal_click
TM: Consume LCD click after calibration
2022-10-06 14:29:40 +02:00
Yuri D'Elia 1d3ee1caba build: Add Configuration_var.h as a configuration wrapper
Instead of including Configuration_prusa.h directly, include
Configuration_var which then includes the proper variant file though a
preprocessor macro.

This allows to keep the existing build system intact, but also redefine
at compile time the final header without having to make copies on the
file system.
2022-10-05 01:26:26 +02:00
Yuri D'Elia 31ea48246a TM: Consume LCD click after calibration
Consume any pending LCD click after the temperature model calibration.
Since we're already in the status menu, the usual consume action is not
done automatically here.
2022-09-30 12:24:54 +02:00
3d-gussner 74e15ac233 Rename EN_ONLY to EN_FARM
remove DEBUG/DEVEL/ALPHA/BETA lcd warning
2022-09-29 16:39:02 +02:00
Alex Voinea 43db24e4fe IR_sensor_analog voltage readings 2022-09-16 10:08:39 +02:00
Alex Voinea 45e43137a5 Filament sensor refactoring initial 2022-09-16 10:07:49 +02:00
3d-gussner ee6821eb0e Add missing MSG_ c= r= 2022-09-14 11:33:24 +02:00
Yuri D'Elia 9dbee61b74 TM: Remove an unnecessary fabsf call
Ironically gcc was stripping that one for us already.
2022-09-02 15:59:29 +02:00