Move these helper functions to the FieldHelper class so that they can
be used by other Trinamic drivers.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Report values of TMC2208 register fields in DUMP_TMC command to help in
tuning and diagnostics.
This also adds functions to refer to register fields by name for TMC drivers
and register mappings for TMC2208.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Signed-off-by: Dmitry Frolov <dmitry.frolov@gmail.com>
Stopping the connect sequence can make it difficult to get the bltouch
out of an error state. Allow the connect to proceed, ideally if the
bltouch stays in an error state it will be detected during the first
probe attempt.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
I noticed Octoprint was disconnecting after a while, and after reading the logs, I came across this error:
```
Unhandled exception during run
Traceback (most recent call last):
File "/home/pi/klipper/klippy/klippy.py", line 171, in run
self.reactor.run()
File "/home/pi/klipper/klippy/reactor.py", line 176, in run
g_next.switch()
File "/home/pi/klipper/klippy/reactor.py", line 203, in _dispatch_loop
timeout = self._check_timers(eventtime)
File "/home/pi/klipper/klippy/reactor.py", line 82, in _check_timers
t.waketime = t.callback(eventtime)
File "/home/pi/klipper/klippy/extras/idle_timeout.py", line 62, in timeout_handler
return self.check_idle_timeout(eventtime)
File "/home/pi/klipper/klippy/extras/idle_timeout.py", line 59, in check_idle_timeout
return self.transition_idle_state(eventtime)
File "/home/pi/klipper/klippy/extras/idle_timeout.py", line 35, in transition_idle_state
logging.exception("idle timeout gcode execution")
NameError: global name 'logging' is not defined
```
I therefore added the missing import.
Signed-off-by: Samori Gorse <samori.gorse+github@gmail.com>
This module adds PAUSE and RESUME gcodes that can programatically determine if the gcode is printing from virtual sd or over the serial connection. It also captures the current toolhead position and gcode feedrate on pause, and recovers that position and feedrate on resume.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
- Add is_active() member function to return the active printing status of the virtual sdcard
- M27 now reports current file position when file has been opened. See http://marlinfw.org/docs/gcode/M027.html
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Add support for performing linear interpolation between a set of
measured temperature/resistance pairs.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Move the low-level PrinterADCtoTemperature() class from thermistor.py
to adc_temperature.py and use it from the Linear() class.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
We want the duration of each command to be an exact multiple of
SIGNAL_PERIOD. The durations might not be exact if the bltouch is on
a secondary mcu. Account for this in send_cmd().
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Rework the undocumented test_sensor_pin config option into a
pin_up_touch_mode_reports_triggered option and document it.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Query the bltouch state during the pin_up command to try and verify
that the probe does actually retract. This may be useful to detect if
the bltouch enters into an "error" state.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The BLTouch is more accurate when probing in "pin_down" mode than
"touch_mode" (at least on some hardware). Rework the code to use that
mode.
When probing in pin_down mode, the BLTouch can go into an error state
if a pin_up is not sent immediately after a touch signal. Rework the
pin_up code to reduce the time it takes to transmit the command.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Introduce a sync_print_time() method and update send_cmd() to track
the duration of bltouch commands.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Verify that there is always some movement during a probing operation.
This is normally done by the homing.py code (via its verify_movement
check), but that check may not be enabled when z_virtual_endstop is
used. So, always enable the check in the bltouch.py code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Separate the thermistor math from the heater temperature callback
system. This may make it easier for debugging.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Only update the status message with the first error report.
Subsequent errors are often the result of the first error and
reporting the last error can be misleading.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Make sure to not query the given endstop until after the start of the
requested operation. This ensures that the operation has started
prior to querying the status of that operation.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Make sure the endstop checking is started prior to any movement. This
helps ensure the verify_movement check is accurate.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Whenever a stepper driver or a heater becomes active, it is desirable to turn on a fan cooling the associated parts on the controller board. This module implements such a fan that turns on whenever a stepper or specified heater turns on, decelerates to a configurable speed when all of the watched parts turn off, and returns to an off-speed, when a user-defined timeout is met.
Signed-off-by: Nils Friedchen <Nils.Friedchen@googlemail.com>
Convert all users of the printer_state("connect") handler to register
a "klippy:connect" event handler instead.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Convert all users of the printer_state("ready") handler to register a
"klippy:ready" event handler instead.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Convert all users of the printer_state("disconnect") handler to
register a "klippy:disconnect" event handler instead.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Convert all users of the printer_state("shutdown") handler to register
a "klippy:shutdown" event handler instead.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
- changes that make easier to use menu as module UI
- new helper method for delayed callbacks
- method for getting the menu instance from display
- new action for sending menu:action events
- allow_without_selection option for cards
Signed-off-by: Janar Sööt <janar.soot@gmail.com>
- long press with timer (button release is not needed anymore)
- initial support for edit mode long press gcode
Signed-off-by: Janar Sööt <janar.soot@gmail.com>
The sam3 i2c code and the linux code use a 7-bit i2c address, while
the avr, lpc176x, and samd21 i2c code uses an 8-bit address with the
least significant bit always zero. A similar issue occurred in the
host code (sx1509.py and replicape.py use 7-bit addresses while
uc1701.py and mcp4451.py use 8-bit addresses).
Consistently use 7-bit addresses in all the code. This breaks
compatibility between host and mcu software, so make a change to the
config_i2c command to force users to synchronize software updates.
This also breaks common Smoothieboard configs, so update the mcp4451
code to validate the i2c_address.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
As discussed in #1057, the default loading- and unloading procedure does
not behave as expected. Setting the extruder to relative mode fixes this.
Signed-off-by: Nils Friedchen <Nils.Friedchen@googlemail.com>