Use the xor capability of the display to animate the glyphs, which
reduces the number of glyphs needed from 4 to 2. This should make it
easier to add future animations if desired.
Suggested by @marcio-ao.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Based on replies from Issue 652 (https://github.com/KevinOConnor/klipper/issues/652) only Extruder, Bed and Fan icons are changed. Feedrate icon stays untouched.
Signed-off-by: Alexander Fadeev <alfsoft@gmail.com>
The max_accel_to_decel variable must not be greater than the max_accel
variable. Make sure to check this when M204 changes max_accel.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Don't require (or permit) the user to specify a stepper_z
position_endstop when using the probe:z_virtual_offset mechanism. In
that case the position_endstop should always equal the probe's
z_offset - so no need to have the user specify it.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Remove the code to calculate and track the z_offset via
position_endstop updates. It's simpler to always save and restore the
calculated z_adjust.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Don't require the config file to specify manual probing. Instead,
allow the user to select manual probing on each ProbePointsHelper
invocation.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Now that all the callers of ProbePointsHelper take a cartesian
coordinate for the probe locations, it's possible to perform averaging
of multi-sample probes within the class. This simplifies the callers.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Only call cmd_NEXT() for manual probing. This simplifies the code as
the automatic probing and manual probing have slightly different
probing mechanisms.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Now that all users of ProbePointsHelper use the same
get_probed_position() code, it is possible to implement that locally
within the ProbePointsHelper class.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
It's possible (and a little simpler) to use cartesian coordinates when
calculating a stable position.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Configure the tmc2208 during the 'connect' phase so that a problem
during configuration is properly raised as a config error. Catch
errors during DUMP_TMC and raise them as g-code errors.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Don't log a heater verification error if that error is due to the
printer being shutdown for some other reason. Those spurious error
reports can be confusing.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
No need to report an error if the M73 is not between 0 and 100 - just
display the nearest valid value.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Support using SAVE_CONFIG to store the results of DELTA_CALIBRATE to
the printer config file. Store the low level probe measurements in
the config as well.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Move the "stable position" logic from the delta.py kinematics code to
the delta_calibrate.py calibration code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Add support for writing back the main printer config file with
additional calibration data stored in it.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Add write_glyph() support to hd44780.py. Update uc1701.py and
st7920.py to support writing single character glyphs via
write_glyph().
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Move the st7920 icon rendering optimizations from display.py to
st7920.py. This simplifies the code for other displays.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
It isn't necessary to use the st7920's xor capabilities when drawing
the bed heating animations. This makes it easier to use the icons for
other displays.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Add a command that will turn off all heaters in the printer. Run this
command in the default idle_timeout action.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
If an arm is nearly parallel to the bed then that tower's carriage may
have a velocity up to 3 times greater than the toolhead's maximum
velocity (relative to the print). Take that into account when
calculating the stepper's maximum halt velocity.
This fixes some rare "No next step" shutdowns on delta printers.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Commit 4573932f allowed move.end_pos to differ from the requested end
position - the toolhead class should use the updated position when
storing its commanded position.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
It's possible that a g-code transform class may make an extrude only
move appear as a kinematic move due to limitations of double precision
math. Handle this by checking for an inconsequential move distance
instead of checking for a move distance of exactly zero.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Log the details of the MCU prior to attempting to configure the MCU.
This way, the log contains the MCU information even if a configuration
error occurs.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Change the name of the config registration method and pass an explicit
reference to the callback to the new method. This makes the
relationship between mcu registration and build_config() more clear in
the calling code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The gcode.run_script() code can pause which can result in the menu
code being called reentrant - avoid that by queuing the gcode commands
within the menu code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Call lift-z prior to the first move. This prevents the nozzle from hitting the build surface in situations that home the nozzle off and below the bed.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Rework the code to use set_register() with the string name of the
desired register to set. Add a get_register() method.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Resolves issue where M117 is not correctly executed when the message begins with numeric or special character.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Only check the probe's z_offset against the stepper_z endstop position if the probe is used as a virtual endstop.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This can be flashed to e.g. the duet wifi using bossac. It requires a
later version as is currently included in the klipper repo (1.8
vs. 1.2). Comms are currently via UART0 only, USB serial is still TBD
Signed-off-by: Florian Heilmann <Florian.Heilmann@gmx.net>
Periodically check if other events need to run - this prevents the
virtual_sdcard processing from starving other events.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Add initial support for commands that will forcibly move a stepper
(without updating the kinematic classes with the new position).
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Don't pass pin_type to lookup_pin() - instead, if a pin can be
inverted or can have a pullup, then the caller must explicitly specify
that when calling lookup_pin(). This simplifies the code for the
cases where it is not valid to invert or pullup.
Explicitly pass the pin_type to setup_pin() and have ppins.setup_pin()
apply default pullup and invert flags.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Make sure to use is_init=True when sending query_thermocouple -
otherwise, the config CRC is likely to mismatch on every connection.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Raising an error from the background message reception thread isn't
well defined. Instead, on a temperature fault, invoke a printer
shutdown.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Those chips that require an spi init sequence can generate the message
directly in the chip specific class.
Also, don't send an spi init message for chips that are read-only.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The MAX6675 chip has a different read sequence than the MAX31855 chip.
Signed-off-by: Ricardo Amézquita <ramezquitao@cihologramas.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Move the "motor_off_timeout" tracking to a new module in the extras/
directory. This makes it easier to customize the idle timeout
behavior.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The junction_deviation configuration parameter has a number of quirks
that make it difficult to configure. Replace it with a
"square_corner_velocity" configuration parameter.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
It's rare to have all the Z stepper locations directly under the
printable surface, so using z_positions for points is not a good
default.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Allocate the stepper_kinematics directly in mcu.py - that way the
kinematic classes don't have to interact with the chelper code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Move extruder.py, cartesian.py, corexy.py, and delta.py to a new
kinematics/ sub-directory. This is intended to make adding new
kinematics a little easier.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
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>