Don't issue a get_config command after building the config as the
built config may contain time sensitive initialization commands.
Instead, send the config and init commands immediately after invoking
the build_config() callbacks. This avoids some rare "timer too close"
errors during configuration.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Switch the host code from the CLOCK_MONOTONIC clock to the Linux
specific CLOCK_MONOTONIC_RAW clock. It's common for ntp to slew the
CLOCK_MONOTONIC clock to account for drift, and that can break the
host's ability to make accurate predictions of the micro-controller
clock. This could lead to "move queue empty" errors. The
CLOCK_MONOTONIC_RAW clock is not slewed and thus should not have this
problem.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Add M117 and M73 to the list of supported G-Codes.
Also, remove M117 from the list of commands reported by the HELP
command as that command is typically only used to list "extended
g-code" commands.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Add generic temperature smoothing to the Heater class. This is useful
to avoid min_extrude_temp and verify_heater errors due to measurement
noise.
Rename the pid_deriv_time config option to smooth_time so that the
smoothing amount need only be specified once.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Extend the ADC out of range check so that it is possible to sample
multiple times before going into a shutdown state. This reduces the
chance that measurement noise will cause an error. In an actual over
temperature (or under temperature event) it is expected that the
sensor will consistently report the problem, so extra checks for an
additional second or two should not substantially increase risk.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Add mcu support for periodically polling for a button press. Add host
code support for registering buttons and invoking callbacks for them.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Add the ability to register callbacks - both asynchronous (ie, from
another thread) and synchronous.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Add an ability to run a series of g-code commands from a reactor
callback that isn't part of the normal g-code command processing.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Font from fntcol16.zip package:
ftp://ftp.simtel.net/pub/simtelnet/msdos/screen/fntcol16.zip
(c) Joseph Gil
Font is public domain
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Update the target temperature during the pid calibration. This gives
additional feedback to the user and it makes it less likely that a
verify_heater error will be raised during calibration.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Move the display code into its own directory. This is in preparation
for splitting it up into its own modules.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
When M117 is followed by an empty string, the display will reset to
Klipper's default.
Internal modules may look up the display and directly call
set_message(), with a timeout if desired.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
- Add M73 support for HD44780
- Include HD44780 USB and SD glyphs to differentiate progress type
- Fix bug that prevented M73 from updated when virtual_sd is enabled
- Add 5 second timeout to reset display when not Printing
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
It appears the st7920 requires a longer delay when switching from
command to data mode (and vice-versa). Slower MCUs don't show a
problem because the klipper command processing time results in a
sufficient delay. However, some of the faster MCUs can process
klipper commands fast enough that the next st7920 transfer is sent too
fast. Add an additional delay to account for this.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The different uses of get_position() can be confusing, so choose a
different name for the ProbePointsHelper callback.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Move the trilateration algorithm to mathutil.py. It may be useful
outside of delta kinematics, and it complicates the delta code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Add support for an itersolve_set_position() function that sets a
stepper position from a cartesian coordinate. This eliminates the
need for both the python and C code to be able to translate from a
cartesian coordinate to a stepper position.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Calculating the cartesian position from the stepper positions can be
complex and cpu intensive, so rename it to calc_position() to be more
descriptive.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
After a probe operation, homing_move() will already have recalculated
the toolhead position. The get_position() method can be slow, so use
the already calculated position.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Update the code to use the term "rail" when dealing with a motor
controlled "axis". A rail has a series of steppers and endstops that
control that motor controlled "axis".
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Add additional wrapper functions so that no outside callers need to
peak into the member variables of PrinterStepper.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>