Always disable the PWM after each command sent. Automatically trim
the command duration so the PWM disable doesn't increase the total
pulse time (when the duration is 200ms or greater).
Track the ideal command end time separately from the pwm transmit time
and only delay toolhead moves to this ideal time.
Update verify_state() to automatically schedule the check using the
time of the last sent command.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Rename try_load_module() so that it uses consistent naming for
"printer objects". Change the function to raise an error by default
if the specified module does not exist.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
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>
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>
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>
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>
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>
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>
Use new mcu.lookup_query_command() for all commands that query
information from the micro-controller.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Convert standard queries to use the acknowledgments of the sent
command to determine if the response was received or not. This also
controls command retransmissions (should the response have been lost).
The tmc_uart.py will continue to use the old mechanism as the tmcuart
responses are not sent synchronously with the query command.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
It's not valid to set the TPWMTHRS in a "klippy:connect" event handler
because the TMCVirtualPinHelper and TMCCommandHelper classes were
expecting that field to be set during the config reading phase.
Revert "tmc: Fix typo preventing stealthchop threshold from being set"
This reverts commit 7d76067ff9.
Revert "tmc: Query the stepper step_distance from the stepper object"
This reverts commit 67b2852249.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Change home_wait() to return if the homing operation completed
succesfully or not. This simplifies the callers.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Update the endstop code to return its trigger completion object during
home_start(). Update the toolhead class to take a completion object
(instead of creating its own). This reduces the number of
intermediate callbacks needed during a homing operation.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
It's simpler to query the "printing" status from the idle_timeout
module on an event than it is to track changes to the printing status.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Introduce min_event_systime and rework the previous start_time,
last_event_time, and event_running flags into this one state tracking
variable.
This also makes a minor change to the behavior of the event_delay - it
is now calculated from the time the command completes execution
(instead of from when the event is first detected). This may make a
difference if there is a long running g-code command occurring during
the detection event.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Rather than inherit from the BaseSensor, filament sensor implementatons
may instantiate the RunoutHelper and update the filament state via its
note_filament_present method.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Add support for notifying the low-level probing handlers that a
multiple probe sequence is occurring. This is in preparation for the
bltouch code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Collapse the "homing:move_begin", "homing:move_end", home_prepare(),
and home_finalize() into two new events: "homing:homing_move_begin"
and "homing:homing_move_end". This simplifies the homing code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
When overriding a g-code command, allow the caller to obtain the
previous command handler. Use this feature in homing_override and
safe_z_home.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Don't obtain the step_distance from the config, instead obtain
step_distance from the instantiated stepper object.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Don't obtain the step_distance from the config, instead obtain
step_distance from the instantiated stepper object.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
There have been several reports that increasing the delay from 37us to
40us eliminates screen corruption on some clone hd44780 displays.
Increase the timeout value so that the standard code works on these
displays.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The caller can now determine which steppers are connected to cartesian
Z movement via the new stepper.is_active_axis() method. It is
therefore no longer necessary for the kinematic code to identify these
steppers.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Move interpolation checks to _init_mesh_params() so they can be done whle the config is being parsed. Do not allow a probe_count higher than 6 for lagrange interpolation, as this typically leads to oscillation.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Don't force probing when BED_MESH_MAP is executed, output the existing mesh. If the user wants to probe each time before a map they can do so with a gcode_macro.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Renamed some variables in set_mesh() previous called "mesh_min" and "mesh_max" to alleviate confusion with the config options.
Renamed several attributes for clarity. The "calibrate" attribute is now bmc, "probe_params" is now "mesh_params", "probed_z_table" is now "probed_matrix", "mesh_z_table" is now "mesh_matrix".
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Points are now logged after the printer is ready. The formatting is improved, printing out the point index, and its corresponding automatic and manual points.
BED_MESH_OUTPUT now includes a PGP parameter, if PGP=1 the generated points are printed to the terminal.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Rename min_point, max_point, and bed_radius to mesh_min, mesh_max, and mesh_radius respectively. Add "mesh_origin" option, that allows round beds to specificy the center of the mesh.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
The STEPPER_BUZZ command needs to know if the axis is using radians
instead of millimeters so that it can move a more appropriate
distance.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>