A bouncing button can generate a lot of pending G-code
Each G-Code command will lock on the G-Code mutex
Decrease pressure by ignoring empty G-Code requests
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
This updates the outdated CanBoot flash_can.py with the latest
version of Katapult flashtool.py, which should be fully backwards
compatible.
Signed-off-by: Robert Schiele <rschiele@gmail.com>
Allow specifying only one unnamed accelerometer in the configuration file, which becomes the default.
Signed-off-by: Maksim Bolgov <maksim8024@gmail.com>
Race conditions exist when `M221 S100` commands are sent outside the
timer, while the sensor is active. This intermittently prevents the flow
multiplier resetting to 100% when either flow compensation or the width
sensor are changed to disabled.
We can avoid this by moving the diable actions, including the `M221 S100`
commands, inside the timer loop and only using `M221` outside the timer
while the sensor is disabled.
Signed-off-by: Ben Lye ben@lye.co.nz
Keeps the width sensor state in sync with the associated runout sensor and
normalizes the output when the width sensor is disabled.
When the width sensor was disabled the associated filament sensor remained
enabled but was no longer updated so would be 'stuck' in the last state it
was in before the width sensor was disabled.
The toggle switch and readings in the web interface could also be out of sync
with the actual sensor and filament states, misleading the user.
Now, when the width sensor is disabled:
- The filament sensor is disabled
- The reported filament state is 'present'
- The reported filament diameter is the nominal diameter
When the width sensor is enabled:
- The filament sensor is enabled
- The reported filament state is the derived state
- The reported filament diameter is the measured value
Finally, `min_diameter` is now used to determine the runout state rather than
a fixed value of `0.5`.
Signed-off-by: Ben Lye ben@lye.co.nz
Adds two checks to prevent config settings which could lead to div-by-zero errors in specific circumstances:
- `raw_dia1` and `raw_dia2` must be different to prevent a possible exception in `adc2_callback`
- `max_difference` must be less than `default_nominal_filament_diameter` to prevent a possible exception in `extrude_factor_update_event`
Doc is also updated.
Signed-off-by: Ben Lye ben@lye.co.nz
Adds a toggle to enable or disable flow compensation based on the
filament width sensor readings without disabling the sensor entirely.
Useful on printers where the hall effect sensor is too inaccurate to
helpfully adjust the extrusion multiplier, but is good enough to act as
a filament runout sensor.
The new setting defaults to true to preserve the existing sensor
behavior.
Existing width sensor G-Code commands are updated to optionally enable
and disable flow compensation and to show the state of the sensor and
command outputs are normalized.
Also includes updates to the relevant doc pages.
Signed-off-by: Ben Lye ben@lye.co.nz
Don't calculate the nozzle/bed contact position from the descent
movement. Instead, obtain the data during the lifting movement and
determine the contact point by analyzing where the nozzle separates
from the bed.
This improves the precision and repeatability of the "tap" results.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Perform lifting at the end of EddyTap.run_probe(). This is in
preparation for performing tap analysis during retraction.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Add a new EddyParameterHelper to override ProbeParameterHelper.
Only use the printer.cfg lift_speed, samples, sample_retract_dist,
samples_result, samples_tolerance, and samples_tolerance_retries
settings for normal probe operations. Don't use these defaults when
using a "METHOD" set to "scan", "rapid_scan", or "tap". Each of these
probing mechanisms is distinct and it's unlikely a user could
meaningfully set a default for all of them.
Don't set sample_retract_dist when using "scan" and "rapid_scan"
modes.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Theoretically a "tap" probe should detect the exact point that the
nozzle contacts the bed. In practice, however, there can be a
systemic bias that one may wish to account for. This bias may be due
to backlash, thermal expansion, a detection bias, or similar issues.
Add a new tap_z_offset config parameter to allow users to specify an
offset.
Also, update the Z_OFFSET_APPLY_PROBE command to support modifying
this value.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The config option 'z_offset' name is confusing as its behavior is
notably different from how other probe hardware uses 'z_offset'.
Rename to 'descend_z' to make its behavior more clear.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Add a new create_probe_result() helper function that can generate a
ProbeResult using a toolhead position and a set of probe offsets.
Use this helper in other modules.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
compatibility fix for newer avr-libc - define stack pointer
add missing avr/io.h include to adc.c
add missing avr/io.h include to spi.c
Signed-off-by: Nicolás Méndez <9phhsyrbm@relay.firefox.com>
Use a different method of setting the hardware pwm registers so that
the actual cycle_time is much closer to the requested cycle_time.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
There is no need for elaborate math scaling of the cycle_time value to
the local clock ticks. Just hardcode a scale of 16, which simplifies
the math calculations.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
If the config parameter "max_power" is less than 0.05, the heaters will never start heating. Added PWM threshold scaling with "max_power" value.
Signed-off-by: Maksim Bolgov <maksim8024@gmail.com>
If a greenlet is created from a greenlet then it seems the Python
interpreter will increment its call depth counter and that can
eventually lead to a RecursionError exception being raised.
To avoid this issue, switch back to the main run() instance if a new
greenlet needs to be created.
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
When delaying response registration, don't warn about any of these
messages that arrive prior to the aactual response registration.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Rename mcu.register_response() to mcu.register_serial_response and
validate the message response format.
Only register the callbacks after the mcu has been initialized. This
avoids invoking callbacks with data from a previous sessions, which
could lead to internal errors.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Commit 1473b79a moved the deprecate mesage generation to the
PrinterConfig() class, but failed to use the proper variable name for
'section'.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>