Commit Graph

126 Commits

Author SHA1 Message Date
Yuri D'Elia 47db75d5fd Fix overflow and infloop with LA15 and low step rates
When calculating the advance tick interval, be sure to check for integer
overflow. Very low step rates can result in values exceeding uint16_t
causing premature LA tick delivery.

An overflow resulting in zero would also block in an infinite loop
within advance_spread().

Even though such rates are worthless in terms of compensation and often
result in 0 extra ticks as well, do not disable LA for the block (as
doing so would reset the count for short segments) and do not check for
zero in multiple paces either.

Saturate the interval instead, delaying any further tick to the next
block.
2020-02-02 22:49:39 +01:00
Yuri D'Elia 0702e0de6e Use world2machine instead of repeating code 2020-01-26 17:46:50 +01:00
Yuri D'Elia bab756699f Fix incorrect usage of plan_set_e_position() in G92 E*
To maintain an accurate step count (which is required for correct
position recovery), any call to plan_set_position&co needs to be done
synchronously and from a halted state.

However, G92 E* is currently special-cased to skip the sync (likely to
avoid the associated performance cost), causing an incorrect E step
count and position to be set. This breaks absolute position recovery,
miscalculation of the LA factor and possibly other weird issues.

We rewrite the handling of G92 to always sync but still special-case the
frequent "G92 E0" for performance by using a free bit in the block flags.

To avoid a sync, we relay the request for reset first to the planner
which clears its internal state and then relays the request to the final
stepper isr.
2020-01-14 20:24:14 +01:00
Yuri D'Elia 5122f79a39 Merge remote-tracking branch 'upstream/MK3' into MK3_LA15 2019-12-04 17:27:23 +01:00
Yuri D'Elia 17176c1df2 Save/restore the default feedrate correctly
Since the global feedrate can be similarly modified for moves ahead of
time, save the original feedrate in the planner as we do for
gcode_target.

This avoids having to undo feedmultiply (and machine limits!) from
"nominal_speed" as previously done.

Thanks @leptun
2019-11-28 17:16:37 +01:00
Yuri D'Elia 4268c2fdae Fix recovery from relative/chunked moves
When starting to replay existing USB/SD commands from a recovery state,
an immediate relative move needs to compensate for a previously
interrupted move. This is almost the norm for the E axis.

Instead of saving the relative status of the move (which needs to
account for the world2machine conversion and is not always available on
a chunked move split by MBL) save directly the calculated target
position for the move in the original plan, which is easy to replay.
2019-11-28 16:42:35 +01:00
Yuri D'Elia 0f6b9b4051 Unroll the stack in restore_print_from_ram_and_continue
While handling moves in a recursive plan, such a filament check,
ensure restore_print_from_ram_and_continue unwinds the stack by
aborting early from any call that waits on the planner.

This currently only handles G1 moves, but hard-coded behavior that can
trigger recursive behavior (such as filament change) will probably have
to be checked too.
2019-11-28 15:57:20 +01:00
DRracer a7c2aec04c Code size reduced by almost 5KB 2019-08-21 09:59:51 +02:00
Yuri D'Elia 0239f4bce1 Update/compute advance steps inside calculate_trapezoid_for_block
Do not store the block e_D ratio, store directly the computed
compression factor so that we can recompute the advance steps
quickly and update them in sync with the acceleration rates.
2019-06-05 20:25:26 +02:00
Yuri D'Elia dc436b71fe Fix position_float after a quickStop condition 2019-06-05 20:25:05 +02:00
Yuri D'Elia fa454f61e4 Drop unused "speed_lookup_table.h" from planner.cpp 2019-06-05 20:24:58 +02:00
Yuri D'Elia fa7c0fb2c9 Avoid triggering LA during a Z-priming move
When recovering from a pause, the nozzle is often primed while
being lowered. If LA is triggered under such a move, the pressure
advance will be wasted.
2019-06-03 17:32:51 +02:00
Yuri D'Elia 51d6904dad Multiply the step rate when grouping advance steps 2019-05-27 14:44:09 +02:00
Yuri D'Elia ab478ec281 Save another 144b by avoiding a calc_timer copy 2019-05-26 16:42:03 +02:00
Yuri D'Elia 294bf4068d Improve debug messages 2019-05-24 17:08:32 +02:00
Yuri D'Elia 53b77bab36 Do not operate on the prev block when already in use 2019-05-24 17:08:32 +02:00
Yuri D'Elia 942c38c18b Minor reformatting 2019-05-24 17:08:32 +02:00
Yuri D'Elia a2fa8e5313 Rewrite the advance_isr scheduler 2019-05-24 17:08:32 +02:00
Yuri D'Elia 9425b6b07a Planner: do not recalculate max_adv_steps, since it doesn't change 2019-05-24 17:08:32 +02:00
Yuri D'Elia 2c8e04bd5f Planner: use the correct block when updating LA factors 2019-05-24 17:08:32 +02:00
Yuri D'Elia 124540a06f Adapt LA changes to ConfigurationStore 2019-05-24 17:08:32 +02:00
Yuri D'Elia 45563bfdd3 Formatting sanity 2019-05-24 17:08:32 +02:00
Yuri D'Elia eeea2725cb Partial LA15 support 2019-05-24 17:08:32 +02:00
Ondrej Tuma b7fe43bf68 Deleted bad cols/rows definitions for translation. 2019-05-07 12:52:23 +02:00
PavelSindler 1ba046395e fan measurements fix: keep fanSpeedSoftPwm = 255 during measurements, selftest changes 2019-02-06 12:37:18 +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 283e33dd69 Lang - text " cold extrusion prevented" removed from dictionary 2018-11-22 17:44:53 +01:00
Marek Bel 1585dc66b0 Merge remote-tracking branch 'prusa3d/MK3_dev' into simplify_EEPROM_M500
Known limitation: Unable to compile.
2018-10-08 15:58:49 +02:00
Marek Bel c38fef281d Use cs.max_feedrate_silent, cs.max_acceleration_units_per_sq_second_silent from ConfigurationStore. 2018-09-24 17:33:58 +02:00
Marek Bel ac7c062161 Use cs.max_jerk from ConfigurationStore. 2018-09-24 16:35:33 +02:00
Marek Bel bb66bfe6a7 Use cs.minsegmenttime from ConfigurationStore. 2018-09-24 16:22:50 +02:00
Marek Bel 10428b30d9 Use cs.mintravelfeedrate from ConfigurationStore. 2018-09-24 16:01:58 +02:00
Marek Bel 26e2fd1c76 Use cs.minimumfeedrate from ConfigurationStore. 2018-09-24 15:57:24 +02:00
Marek Bel b8fefceb4d Use cs.retract_acceleration from ConfigurationStore. 2018-09-24 15:53:35 +02:00
Marek Bel 7dbe0afdc4 Use cs.acceleration from ConfigurationStore. 2018-09-24 15:47:36 +02:00
Marek Bel cee51cf9c3 Use cs.max_acceleration_units_per_sq_second_normal from ConfigurationStore. 2018-09-24 15:40:35 +02:00
Marek Bel 02becb5e6a Use cs.max_feedrate_normal from ConfigurationStore. 2018-09-24 15:09:19 +02:00
Marek Bel 3f28632443 Use cs.axis_steps_per_unit from ConfigurationStore. 2018-09-24 14:54:41 +02:00
PavelSindler ceb49d1262 finda filament runout: initial version 2018-08-27 04:21:43 +02:00
Robert Pelnar 896734c06b Display '!' instead of 'FR' on status screen when feedrate or acceleration limit reached. 2018-07-23 14:30:41 +02:00
Robert Pelnar 2ce210a8bb TMC2130 feedrate and acceleration limitation - separate profiles for normal and stealth mode 2018-07-19 18:56:01 +02:00
Robert Pelnar c3e28b490c TMC2130 old style limits removed
+menu draw_edit fix
2018-07-19 17:42:59 +02:00
Robert Pelnar 268d2634f0 LCD menu optimalization - lcd and menu
removed unused code and conditional translation
2018-07-16 02:13:52 +02:00
Robert Pelnar 68a5a4b74e FEEDRATE_LIMIT fix 2018-07-12 23:51:15 +02:00
Robert Pelnar 007717bfd2 Disabled TMC2130 feedrate and acceleration limits (should be properly limited with M201-M203) 2018-07-12 19:04:44 +02:00
Robert Pelnar bd587faab9 New ML support - migration - replaced source, removed original ML support files (backup) 2018-05-22 03:20:03 +02:00
bubnikv 11e7eb27ee Merge remote-tracking branch 'remotes/origin/M221_fix' into MK3_fast_dbg 2018-03-05 19:13:07 +01:00
bubnikv ba49c21f17 Unified the volumetric_multiplier with extrusion_multiply to improve
numeric accuracy and to reduce compuatitonal load. With this commit,
the numeric rounding is fixed not only for the M221 G-code
(as implemented by the preceding commit), but also for the volumetric
extrusion in general.

Removed the old FILAMENT_SENSOR code, which served the purpose
to modulate the volumetric multiplayer in real time depending
on the measured filament diameter. This feature will certainly not be
used by Prusa Research in the near future as we know of no sensor,
which would offer sufficient accuracy for a reasonable price.
2018-02-21 11:25:21 +01:00
bubnikv ee5949c56e Fix of a loss in precission when the extruder multiplier is set
with M221. For 50um layers, the precision loss leads to holes
in the print.
2018-02-20 15:30:18 +01:00
bubnikv 9652cf2d5b Merge branch 'MK3' into MK3_fast_dbg 2018-02-02 20:51:57 +01:00
bubnikv 9379430f8c A bit of documentation. 2018-02-02 20:45:45 +01:00
bubnikv 160cdccae1 Merge remote-tracking branch 'remotes/origin/MK3_stepper_blocking' into MK3_fast_dbg 2018-01-20 17:31:26 +01:00
bubnikv 5deee8f42c Merge remote-tracking branch 'remotes/upstream/MK3' into MK3_stepper_lowres 2018-01-20 17:24:12 +01:00
bubnikv 815dfcb14b Implemented a stepper timer reset after a long blocking cli()
or DISABLE_STEPPER_DRIVER_INTERRUPT().
If this is not done, the stepper interrupt would likely overflow,
leading to a maximum 32ms delay before the stepper interrupt wakes up.
In addition, the stepper timer overflow error would be reported
by the debug builds.
2018-01-20 15:39:21 +01:00
bubnikv 17a8e2db01 Documented the interrupt blocking by a main thread by its maximum time.
Added a debug output to serial line on stepper timer overflow.
2018-01-20 14:58:30 +01:00
Robert Pelnar 9aedaa8fe7 build 146
hard limits
fsensor overflow fix
2018-01-14 23:59:43 +01:00
bubnikv 7a972fd9b0 Split the stepper ISR routine into multiple inline functions,
added an optimized DDA routine for moves with less than 32767 ticks.
2018-01-14 22:37:07 +01:00
bubnikv 30b06488ca Redefined the DDA step and accumulator values to unions to support
access to the low / high words of the 32bit values.
This is a prerequisity for an optimized 16bit only DDA
in case the number of step is lower than 32767.
2018-01-14 17:01:04 +01:00
Robert Pelnar 124a3e6da8 Stealth mode limits + END_FILE_SECTION=10000 2017-12-11 16:17:36 +01:00
Robert Pelnar 995801c967 Silent mode limits
+ cannot compile "END_FILE_SECTION"
2017-12-09 14:41:50 +01:00
PavelSindler 4d9780a3c6 Merged lin adv. fix from MK2 2017-11-14 13:57:32 +01:00
Robert Pelnar 480838a0a1 Fixed homing (mbl and babystep - crashdetection recovery work fine now). 2017-09-23 16:35:01 +02:00
bubnikv 72ab17f585 Further fixes of the power panic and g-code & planner queues. 2017-09-22 13:44:10 +02:00
bubnikv 582a6270b0 Fix of a power panic print stop. 2017-09-21 17:50:39 +02:00
Robert Pelnar e34d816004 Recover print 2017-09-20 16:04:02 +02:00
Robert Pelnar 2c3387e71d Recover print - simple solution 2017-09-19 21:38:47 +02:00
Robert Pelnar c4e9e624f5 cmd queue and planner - functions for calculating sd position:
cmdqueue_calc_sd_length
planner_calc_sd_length
2017-09-18 19:36:18 +02:00
michalprusa 06fe85e9ee Linear Advance 2017-07-07 01:58:02 +02:00
XPila 78f7923ab2 Merge pull request #10 from XPila/MK3
Changed jerks, disabled oversampling, debug code, commands for seting…
2017-07-06 13:07:37 +02:00
Robert Pelnar 2b24e9ceb3 Changed jerks, disabled oversampling, debug code, commands for seting pwm_ampl and pwm_grad (M917, M918), changed configuration files 2017-07-06 13:06:07 +02:00
PavelSindler 16fffed52d current feedrate and fan speed stored to eeprom in power panic, number of blocks (linear movements) in planner serve for counting SD card recover position, print fan speed error limit prolonged to 15s 2017-07-05 15:04:43 +02:00
bubnikv 163db2f362 Fixed a bug in the optimized fixed point planner. 2016-09-01 13:31:50 +02:00
bubnikv 29cb4b2b5d Removed the non-working pressure advance feature.
Improved accuracy of diagonal moves by oversampling the path discretization.
Accelerated the planner by rewriting time critical routines from floating
point to fixed point arithmetics.
2016-09-01 13:09:56 +02:00
michalprusa 307d17422d 3.0.6 sync 2016-08-11 10:42:53 +02:00
michalprusa 30f0528aba Initial commit 2016-07-22 15:28:01 +02:00