Instead of passing a dictionary to the command handlers, create a
wrapper class and pass that class to the command handlers. This can
simplify the command handler code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Avoid using doubles as flags when generating steps during "lead up to
stepper activity". Instead, explicitly track how many inactive move
entries are skipped and only generate steps for those entries.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Don't assume the times passed to itersolve_gen_steps_range() are
contained within the move. It's possible the checks in
itersolve_generate_steps() may round to different values when
converting the times to a relative move time.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The beagleboard TI kernel 4.14 and 4.19 contain a commit which change
the device names ("pwm: Create device class for pwm channels") from
pwmN to pwm-${chip}:N. This commit was never merged into the upstream
kernel.
Decrease the number of pwm channels to a more reasonable 16. Increase
the number of pwm chips to 8 since the replicape servo pwm outputs are
on pwmchip4.
Update replicape code to detect appropriate channel.
Signed-off-by: Janne Grunau <janne-gh@jannau.net>
Add a 50ms delay from the initial clock measurement to the first
get_clock query. Disable the prediction_variance filter on each
get_clock query so that none of those measurements are ignored.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The heater logic is an independent module that does not need to be
treated as part of the "core" klipper code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
It's no longer necessary to queue gcode scripts - gcode.run_script()
now does that automatically.
Also, make release_gcode config optional.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The probe_finalize() name is used for callbacks in both the
PrinterProbe and ProbePointsHelper classes. Rename the PrinterProbe
callback to avoid confusion.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Rename the method to make it more clear that it is a low-level call
that should be rarely used.
Also, change gcode_button.py, hall_filament_width_sensor.py, and
tsl1401cl_filament_width_sensor.py to use respond_info() instead of
respond_raw().
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Report low-level disk errors via the log and use the normal sdcard
mechanism to report end of sdcard print to gcode users.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
It's important to raise an error (instead of calling respond_error() )
so that a G20 will stop a virtual_sdcard print.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
No need to check for '#original' in params - it's always there.
Properly handle a lower case m118 command. Don't register a help text
for the legacy M118 g-code command.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Raising an error (instead of reporting an error) is important as only
a raised error will stop a print from virtual_sdcard.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Commit 402110f6 didn't actually fix absolute extrude mode. For now,
report an error if an extrude move is requested in absolute extrude
mode.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Fix linear_travel optimization. Use "2*pi" instead of "radians(360)".
Always emit at least one segment and always end at the final target
coordinates.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Fix Z moves so that the movement is spaced out among the arc movements.
Fix extrude moves when in absolute extrude mode.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Use the normal gcode.get_float() mechanism for extracting parameters
from the g-code command.
Don't register descriptions for the G2/G3 commands as the convention
is to only use descriptions for "extended g-code commands".
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This reverts commit 5c8d15bbee.
The lower_probe() code was already manually optimizing the timing of
the pwm disable, and that conflicted with the optimization in commit
5c8d15bb.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Fysetc Cheetah v1.2 boards require a special sequence to reset reliably.
This sequence works for me in all cases. Simpler sequences without
double reset did not work correctly. This is likely because of a weird
stateful circuitry for toggling the bootloader state.
Cheetah boards use RTS to configure bootloader triggering. By default,
pySerial sets RTS on connect, which unfortunately configures the board
to start the bootloader on reset.
Add a toggle for the RTS state to allow users to workaround. The RTS state
is set before the serial connection is opened, so there are no glitches.
Addresses #2026.
Signed-off-by: Grigori Goronzy <greg@chown.ath.cx>
Some clones don't raise the pin on a reset and the ANTClabs BL-Touch
sometimes doesn't raise the pin either.
Rework the (infrequently called) sensor test code to always issue a
pin_up command before the touch command. Also, perform a reset and
retry if the sensor test fails.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Be sure to fully raise the probe prior to starting any future toolhead
movements in the multi_probe_end() case.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
If an error is found during the pin_up_not_triggered check, then apply
the reset command for a full second (instead of just 100ms). This
gives the bltouch more time to check its internal state.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Return the triggered state from verify_state() and update the callers
to raise the error (if needed).
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Some stepper motor drivers do not respond well to rapid "step +
direction change + step" events. In particular, it is believed this
can cause "over current" events on the tmc2208 drivers when they are
in "stealthchop" mode. Detect these events and remove them from the
generated step times.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
It is likely only developers will be interested in testing the menu
system, so no need to have it in the default menu.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Disable support for customizing the main lcd display content via the
menu system. Advise users to use the new display_data config sections
as a replacement.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Introduce a new config based system for specifying the on-screen
contents of an lcd screen. The default screen configuration (found in
klippy/extras/display/display.cfg) is the same as the previous
hard-coded display, so this should not change behavior for existing
users.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Some stepper motor drivers do not respond well to rapid "step +
direction change + step" events. In particular, it is believed this
can cause "over current" events on the tmc2208 drivers when they are
in "stealthchop" mode. Detect these events and remove them from the
generated step times.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>