Commit Graph

439 Commits

Author SHA1 Message Date
Kevin O'Connor 34209e6189 heater_bed: Wrap lines to 80 columns
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-26 11:20:01 -05:00
Kevin O'Connor adf6040e9e gcode: Use an event to handle restart request actions
Instead of directly turning off motors, heaters, and fans from
gcode.py, raise a new event and allow the heater, fan, and toolhead to
handle the event as needed.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-25 21:26:27 -05:00
Kevin O'Connor bb4fab5570 heater: Rename add_sensor() to add_sensor_factory()
Signed-off-by: Douglas Hammond <wizhippo@gmail.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-25 20:34:12 -05:00
Arksine f7d8854587 bed_mesh: simplify configuration
The 'bed_shape' option has been removed.  The user will enter a 'bed_radius' if they have a round be, otherwise they should enter 'min_point' and 'max_point'.  When the bed is round the user should supply a 'round_probe_count' option, otherwise just 'probe_count'.

Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2019-02-25 13:34:14 -05:00
Arksine 7694c3e1b8 bed_mesh: fix get_position()
Fix a bug where the fade factor is calculated incorrectly when get_position() is called.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2019-02-25 13:34:14 -05:00
Arksine f308171be4 bed_mesh: refactor fade_target
Offset the entire mesh by the fade target amount rather than offset each z lookup.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2019-02-25 13:34:14 -05:00
Rui Caridade 749beb731c probe: Set z min value in probe_accuracy to z_offset. (#1314)
Signed-off-by: Rui Caridade <rui.mcbc@gmail.com>
2019-02-25 12:52:54 -05:00
Kevin O'Connor 80c8bd8b4d bed_screws: Add a helper tool for leveling bed screws
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-24 00:49:47 -05:00
Kevin O'Connor 5bc47d9416 tmc2130: Use FieldHelper() to set/get driver fields
Use the field helper to simplify the bit manipulation in the driver.
This also enables the extended DUMP_TMC output.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-21 11:35:58 -05:00
Kevin O'Connor b260eb9168 gcode: Raise a config error on invalid register_command()
Raise a printer.config_error() on an invalid register_command() call.
This error is easier to handle for the vast majority of callers.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-18 18:04:42 -05:00
Rui Caridade 276d5a1436 probe: Add PROBE_ACCURACY command
Implementation of "PROBE_ACCURACY" to measure the maximum, minimum,
average and standard deviation of a probe.

Signed-off-by: Rui Caridade <rui.mcbc@gmail.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-18 00:36:28 -05:00
Kevin O'Connor cc4ecef88b mcp4018: Add initial support for the mcp4018 digipot
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-16 08:16:37 -05:00
nopbit 0f674ef407 tsl1401cl_filament_width_sensor: Filament Width Sensor Support (#1132)
Support added for filament diameter sensor. Sample configuration parameters added to example-extras.cfg.

Signed-off-by: Mustafa YILDIZ <mydiz@hotmail.com>
2019-02-14 10:13:48 -05:00
KevinOConnor c6d1d1bd8c
Merge pull request #1242 from john--/pr_generic_heater
Generic Heater Support
2019-02-14 10:08:26 -05:00
John Jardine 6316b2c1b6 Generic Heater Support
Adds the ability to register a custom/generic heater through a new extra called heater_generic.
This takes a gcode_id that is reported by M105. Adds a new command to set the temperature for any heater using the syntax:
SET_HEATER_TEMPERATURE HEATER=<heater_name> TARGET=<target_temp>

Signed-off-by: John Jardine <john@gprime.net>
2019-02-14 01:15:11 +00:00
Kevin O'Connor 98ed462865 spi_software: Implementation of software spi
Signed-off-by: Matt Janus <FragginRight@variabl.es>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-13 11:52:20 -05:00
Kevin O'Connor 2d7c3a84ee manual_stepper: Add an "extras" module for manually controlling a stepper
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-12 13:38:13 -05:00
Kevin O'Connor b0b9fc6f4a probe: Use manual_probe helper when performing manual probes
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-12 13:20:32 -05:00
Kevin O'Connor 35ea4a137d probe: Add PROBE_CALIBRATE command
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-12 13:20:32 -05:00
Kevin O'Connor d14a53e160 manual_probe: Add a helper script for performing manual Z probing
Add MANUAL_PROBE and Z_ENDSTOP_CALIBRATE commands.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-12 13:20:32 -05:00
Kevin O'Connor f1c804907c virtual_sdcard: Don't list files starting with a '.'
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-08 11:48:53 -05:00
Arksine 9766d62ad3 pause_resume: fixes
- When using absolute extrusion the gcode position e-axis position is now captured on PAUSE and restored in RESUME with a call to the G92 handler.
- Add a get_status() function that returns a dictionary with an 'is_paused' key.
- Do not allow consective calls to PAUSE or RESUME to exectue.  Also do not allow a RESUME to executed without a previous PAUSE.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2019-02-08 10:53:59 -05:00
Kevin O'Connor 4c48c1e8e4 bltouch: Issue just a pin_up command on a normal raise probe attempt
In the normal case, a regular pin_up command should be sufficient to
raise the probe.  (Should the regular pin_up fail, the code can issue
a "reset" command during the retry.)

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-04 18:03:07 -05:00
Kevin O'Connor 345a5f4e1f bltouch: Increase default pin_move_time from 200ms to 675ms
Use the same pin move time that Marlin uses.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-04 18:02:53 -05:00
Kevin O'Connor cd8678aa6d spi_temperature: Fix order of init
Commit c3efcd9c moved the config_spi setup to a build_config callback.
It's also necessary to move the config_thermocouple to a build_config
callback as well.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-04 09:30:26 -05:00
Kevin O'Connor d088a7ca72 tmc2130: Share config reading helpers with tmc2208.py code
Add helper function for reading current, microsteps, and stealthchop
settings from the config file.  Use these helpers in both the tmc2130
and tmc2208 modules.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-03 17:39:07 -05:00
Kevin O'Connor 0920a518ce tmc2208: Rename self.field_helper to self.fields
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-03 17:15:43 -05:00
Kevin O'Connor 30b6414295 tmc2208: move local set_field/get_field helpers to FieldHelper class
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>
2019-02-03 14:07:27 -05:00
Kevin O'Connor 17a17c5b77 tmc2208: Add helper for setting fields from the config file
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-03 13:03:44 -05:00
Kevin O'Connor 83001959f1 tmc2208: Use field definitions during driver init
Reduce the amount of bit manipulations by using the FieldHelper class.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-03 12:22:12 -05:00
Dmitry Frolov 51f14b9c8c tmc2208: Add register field formatters
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Signed-off-by: Dmitry Frolov <dmitry.frolov@gmail.com>
2019-02-03 11:19:36 -05:00
Kevin O'Connor 955fdcaa0c tmc2130: Convert field helper into a class
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-03 11:11:15 -05:00
Arksine cdcc320710 bed_mesh: add support for round beds
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2019-02-02 23:29:00 -05:00
Arksine 542f941f07 bed_mesh: log when fade completes.
- Also simplify the math for the mesh x and y multipliers.

Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2019-02-02 23:29:00 -05:00
lorf 54683c9535 tmc2208: Decode register fields in DUMP_TMC (#1156)
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>
2019-02-02 19:46:27 -05:00
Kevin O'Connor 3b6ddb08a1 bltouch: Don't error on startup if the bltouch is in an error state
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>
2019-01-31 09:43:35 -05:00
Kevin O'Connor a5d3d161d3 bltouch: Retry reset/pin_up if the raise probe attempt fails
There's no harm in retrying the attempt if it appears to have failed
for some reason.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-31 09:43:29 -05:00
Samori Gorse 04c6e1f646 idle_timeout: Added a missing logging import
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>
2019-01-29 11:18:44 -05:00
Arksine 7605752dc2 pause_resume: initial implementation of pause/resume functionality for Klipper
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>
2019-01-28 11:23:52 -05:00
Arksine e69742df8f virtual_sdcard: prepare for pause_resume implementation
- 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>
2019-01-28 11:23:52 -05:00
Kevin O'Connor 7327394c50 adc_temperature: Add support for linear interpolation of resistances
Add support for performing linear interpolation between a set of
measured temperature/resistance pairs.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-21 21:28:25 -05:00
Kevin O'Connor fc946c796c adc_temperature: Split linear interpolation code into its own class
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-21 20:27:41 -05:00
Kevin O'Connor 99980817c3 adc_temperature: Move PrinterADCtoTemperature to adc_temperature.py
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>
2019-01-21 20:24:51 -05:00
Kevin O'Connor 0c4fc64ef8 thermistor: Separate thermistor configuration from basic ADC callback logic
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-21 18:38:12 -05:00
Kevin O'Connor 5a6a429bc0 bltouch: Take into account clock skew when calculating command duration
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>
2019-01-21 09:56:08 -05:00
Kevin O'Connor 8a97bc592b bltouch: Add a pin_up_touch_mode_reports_triggered config option
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>
2019-01-21 09:52:11 -05:00
Kevin O'Connor 56141c21d7 bltouch: Raise probe on startup
Send a pin_up command during startup and try to verify that the probe
actually raises.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-21 09:52:11 -05:00
Kevin O'Connor e36122797b bltouch: Attempt to verify that the probe raises after each probe attempt
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>
2019-01-21 09:52:11 -05:00
Kevin O'Connor 99f96f2832 bltouch: Use pin_down mode for probing
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>
2019-01-21 09:52:11 -05:00
Kevin O'Connor 04f5baa182 bltouch: Simplify time keeping of scheduled events
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>
2019-01-21 09:52:11 -05:00
Kevin O'Connor 26e818d900 bltouch: Verify probe always deploys during a homing operation
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>
2019-01-21 09:52:11 -05:00
Kevin O'Connor 293366d033 thermistor: Breakout thermistor math to its own class
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>
2019-01-20 18:51:00 -05:00
Master92 a27838bc05 controller_fan: Add support for a fan cooling the controller-board (#1070)
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>
2019-01-10 12:12:15 -05:00
Kevin O'Connor 2c31fd8313 tmc2208: Check for debugging mode before checking for a retransmit
Allow the tmc2208 code to be run from regression test cases.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-10 09:55:54 -05:00
Kevin O'Connor bf647749dd menu: Don't peek into printer.objects member variable
Use the printer.lookup_objects() method to get the list of available
printer objects.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-08 12:03:46 -05:00
Kevin O'Connor 857e7ed5f1 klippy: Convert printer_state("connect") to an event handler
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>
2019-01-08 11:09:55 -05:00
Kevin O'Connor 797367b9f5 klippy: Convert printer_state("ready") to an event handler
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>
2019-01-08 10:59:43 -05:00
Kevin O'Connor fb7fe282c8 klippy: Convert printer_state("shutdown") to an event handler
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>
2019-01-08 10:59:43 -05:00
Petri Honkala b2d5a8e65b z_tilt: unresolved reference fixed
Signed-off-by: Petri Honkala <cruwaller@gmail.com>
2019-01-08 08:44:25 -05:00
Janar Sööt 3a4a1d678e menu: allow empty command gcode if action is present
Signed-off-by: Janar Sööt <janar.soot@gmail.com>
2019-01-07 21:39:50 -05:00
Janar Sööt 0cbe851777 menu: enhancements
- 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>
2019-01-07 21:39:50 -05:00
Janar Sööt 005cbe157a menu: allow names in card content and simplify define single card decks
Signed-off-by: Janar Sööt <janar.soot@gmail.com>
2019-01-07 21:38:53 -05:00
Janar Sööt b9cccc5959 menu: support for click button long press
- 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>
2019-01-07 21:38:45 -05:00
Kevin O'Connor e26d1a3567 i2ccmds: Pass the i2c address as a 7-bit number (0-127)
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>
2019-01-07 20:00:44 -05:00
Master92 6ccc0732c1 menu: Fix filament loading and unloading feature (#1082)
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>
2019-01-07 10:25:19 -05:00
Paulo Drugos ffbb4198c1 menu: Correction for the resume option appears when the toolhead is not printing (#1077)
Signed-off-by: Paulo Drugos paulodrugos@gmail.com
2019-01-05 19:11:03 -05:00
Kevin O'Connor c3efcd9c8d bus: Set all SPI CS pins high before first config_spi message
If an SPI device is shared among many devices, then all the device's
CS pins should be set high prior to setting up the clk pin.
(Otherwise, there's a chance a device could interpret the clk pin
setup as part of a transmission.)

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-04 22:26:34 -05:00
Kevin O'Connor 7fe14f05e6 thermistor: Avoid divide by zero error if min_temp=-273.15
Reported by @TheGuv.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-04 12:47:37 -05:00
Kevin O'Connor c2086796bf mcp4728: Add initial support for the mcp4728 i2c dac chip
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-02 18:17:56 -05:00
Alec B. Plumb 59e9b6562f respond: An extra for sending messages to the printer host. (#1053)
I have made one change to `gcode.py` to support quoted parameter
values.

I have added support for the basic `M118` command (see
https://reprap.org/wiki/G-code#M118:_Echo_message_on_host). I have
also added a `RESPOND` command that takes extended parameters.
`ECHO` might be a better name than `RESPOND` but is already defined
in `gcode.py`.

Signed-off-by: Alec B. Plumb <alec@etherwalker.com>
2019-01-02 17:45:35 -05:00
john-- f6c9150349 heater: take a gcode_id when setting up a heater (#1028)
Allow an arbitrary gcode_id to be supplied during heater setup. This allows future extras to register additional IDs beyond B, and T#.

Signed-off-by: John Jardine <john@gprime.net>
2019-01-02 17:44:02 -05:00
Kevin O'Connor 1be24b8fc7 bus: Don't raise a "duplicate pin" warning on None pins
If "None" is used for an spi cs pin, then it should not reserve "None"
for other uses.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-02 17:37:39 -05:00
Kevin O'Connor 68ebde0d86 display: Fix handling of M117 command if lowercase 'm' is used
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-02 17:34:56 -05:00
Petri Honkala e4e0fec681 tmc2660: error and whitespace fixes
- redundant parentheses removed
	- parameter reference fixed
	- raise error fixed

Signed-off-by: Petri Honkala <cruwaller@gmail.com>
2018-12-27 11:44:41 -05:00
Petri Honkala f99002df4f tmc2208: error raise fixed for rx/tx mcu check
Signed-off-by: Petri Honkala <cruwaller@gmail.com>
2018-12-27 11:44:41 -05:00
Kevin O'Connor d0f09727a9 bltouch: Issue both a "reset" and a "pin_up" after a successful probe
Not all BLTouch clones raise the pin on a "reset" request, so
explicitly send a "pin_up" command.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-12-16 11:06:46 -05:00
Kevin O'Connor ccc25a03d5 bltouch: Add a config option to disable the bltouch sensor test
It appears some bltouch "clones" do not report the probe as triggered
when put in "touch mode" while the pin is raised.  Add a config option
to allow users to disable the test.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-12-16 11:06:41 -05:00
Kevin O'Connor ce064e6e2d bltouch: Always make sure to check the endstop at least every 1ms
Some of the bltouch implementations may only respond to a probe event
with a 5ms pulse.  Make sure to check the signal pin at least every
millisecond to ensure no signal is lost.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-12-16 11:06:27 -05:00
Kevin O'Connor 76b57ba05a bltouch: Fix typo in pin_move_time parsing
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-12-04 11:43:04 -05:00
Kevin O'Connor 44aa5def73 bltouch: Allow the pin_move_time to be configured
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-12-04 10:34:54 -05:00
Kevin O'Connor e0b2d7c51d bltouch: Add a BLTOUCH_DEBUG command
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-12-03 22:52:32 -05:00
Kevin O'Connor aac92ffb91 bltouch: Fix bug - must restore stepper position after homing
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-12-01 22:09:06 -05:00
Arksine cf6a56cebf bed_mesh: Introduce fade_target option
To deal potential z scaling when fade is enabled, a fade_target option has been introduced.  This option may either be set to 0.0 or any z position within the range of the mesh.  A value of 0.0 will result in previous behavior, where z adjustment phases out until no further adjustment is added.  A non-zero value will phase out adjustment until the target has been reached, after which the rest of the print will be offset along the z axis by the fade_target.  By default the fade_target will be calculated as an average of the mesh.

Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2018-11-30 11:37:21 -05:00
Arksine 35f41b7402 bed_mesh: Disable z-adjustment fade by default.
Due to various potential issues with fading out z-adjustment, it is better to disable by default and allow users to opt-in.

Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2018-11-30 11:37:21 -05:00
Kevin O'Connor 824e55d75a bltouch: Add initial support for a bltouch "extras" module
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-30 11:34:20 -05:00
Kevin O'Connor a726c58671 mcp4451: Minor update - remove unnecessary mcu import
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-24 00:36:49 -05:00
Kevin O'Connor 147d805231 mcp4451: Use bus.py helper code for i2c
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-24 00:33:22 -05:00
Kevin O'Connor e5150fe187 uc1701: Add support for SSD1306 in i2c mode
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-23 22:04:06 -05:00
Kevin O'Connor d2aa78c16a uc1701: Cache icons and fonts in byte display order
This reduces the amount of bit manipulaton needed during screen
updates.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-21 20:45:53 -05:00
Kevin O'Connor 065a8eb826 uc1701: Wrap code to 80 columns
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-21 20:45:53 -05:00
Kevin O'Connor a79d87ca8e uc1701: Add all_framebuffers to reduce vram indexing in the code
Add a self.all_framebuffers variable and change self.vram to only
contain the new display data.  This allows the main code to access the
self.vram member variable without the need to index for current/old
data.  (It also updates the code to match the latest st7920 and
hd44780 code.)

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-21 20:45:53 -05:00
Kevin O'Connor e231ac7422 uc1701: Add support for SSD1306 displays
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-21 20:45:53 -05:00
Kevin O'Connor a00d7b418f display: Add a get_dimensions() method to lcd chip classes
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-21 20:45:53 -05:00
Kevin O'Connor 9ba94ded9e tmc2660: Use bus.py helper code for spi
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-21 12:12:31 -05:00
Kevin O'Connor 1c71ea27e0 uc1701: Use bus.py helper code for spi
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-21 12:12:31 -05:00
Kevin O'Connor 5bb0bd755d tmc2130: Use bus.py helper code for spi
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-21 12:12:31 -05:00
Kevin O'Connor ab6a8ec76e ad5206: Use bus.py helper code for spi
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-21 12:12:31 -05:00
Kevin O'Connor be58c7f8ec replicape: Use bus.py helper code for spi
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-21 12:12:31 -05:00
Kevin O'Connor 7cadd8d3f4 spi_temperature: Use bus.py helper code for spi
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-21 12:12:31 -05:00
Kevin O'Connor 58890e32a2 bus: Add klippy/extras/bus.py module with SPI bus helper code
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-21 12:12:31 -05:00
Kevin O'Connor f3c4deb1ab lpc176x: Convert i2c code to use standard i2ccmds.c
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-14 10:23:56 -05:00
Jiri Dobry e541466591 servo: This patch create ability to enable/disable attached servo. (#880)
Cheap mechanical servos have small flickering. When this servo stay on one position, this flickering slowly destroy internal potentiometer and make servo unusable. Many mechanisms need servo only to change position. Therefore I create this minor path to enable/disable servo. It stop pulses for this servo, that's all.

Corresponding G-code is:
SET_SERVO SERVO=config_name [WIDTH=] [ENABLE=<0|1>]
SET_SERVO SERVO=config_name [ANGLE=] [ENABLE=<0|1>]

For example:
SET_SERVO SERVO=touch ANGLE=80 ENABLE=1 ; enable servo and set position
G4 P200 ; wait 200ms
SET_SERVO SERVO=touch ENABLE=0 ; disable servo

This patch add one option to servo configuration:
enable: <False/True> # default True

It not have impact to user code existing already because it is optional parameter and default value is same as original behavior.

Signed-off-by: Jiri Dobry <jdobry@centrum.cz>
2018-11-14 09:38:09 -05:00
James b45ccfea97 display: FR icon changed to "Feed Rate" (#860)
Signed-off-by: James Wood <j@j-w.co>
2018-11-13 10:14:01 -05:00
Lucas Fink f6c2e8b4eb bed_mesh: Fix some fragile identity comparisons
Signed-off-by: Lucas Fink <software@lfcode.ca>
2018-10-31 16:02:45 -04:00
Florian Heilmann b98e12c19a sx1509: Relax restrictions on SX1509 pins (#836)
This allows SX1509 pins to be used as temperature fans and heater fans. Heaters are still disallowed.

Signed-off-by: Florian Heilmann <Florian.Heilmann@gmx.net>
2018-10-30 18:08:12 -04:00
Florian Heilmann 3328ade194 tmc2660: Fix typo in TMC2660 extra (#830)
Signed-off-by: Florian Heilmann <Florian.Heilmann@gmx.net>
2018-10-29 12:44:45 -04:00
Florian Heilmann 90bc3be6a0 Add DUMP_TMC capabilities to the TMC2660 extra
Signed-off-by: Florian Heilmann <Florian.Heilmann@gmx.net>
2018-10-28 18:45:49 -04:00
Florian Heilmann 4372d1812c Implement idle event support in the TMC2660 extra
Signed-off-by: Florian Heilmann <Florian.Heilmann@gmx.net>
2018-10-28 18:45:49 -04:00
Kevin O'Connor d25e02144c idle_timeout: Add printing/ready/idle tracking
Internally track the overall printer state.  Generate events on state
transitions.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-28 18:39:45 -04:00
Kevin O'Connor a5e55c2acc gcode: process_batch() should execute commands atomically
Update the process_batch() method so that it will not interleave
commands read from the input fd with the batched commands.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-28 18:39:45 -04:00
Kevin O'Connor 4f89251f03 sx1509: Raise an error if a pin max_duration is not zero
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-27 12:22:23 -04:00
Florian Heilmann f57c29442c Add SX1509 extra
Signed-off-by: Florian Heilmann <Florian.Heilmann@gmx.net>
2018-10-27 10:34:28 -04:00
Florian Heilmann b6bf455155 tmc2660: Add endstop phase detection functionality to TMC2660 extra (#816)
Signed-off-by: Florian Heilmann <Florian.Heilmann@gmx.net>
2018-10-24 16:01:12 -04:00
Kevin O'Connor e4bb90a1ca bed_mesh: Do not automatically run G28 on BED_MESH_CALIBRATE / BED_MESH_MAP
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-22 11:26:01 -04:00
Kevin O'Connor f382762962 bed_tilt: Do not automatically run G28 on BED_TILT_CALIBRATE
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-22 11:26:01 -04:00
Kevin O'Connor 925562cfb1 delta_calibrate: Do not automatically run G28 on DELTA_CALIBRATE
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-22 11:26:01 -04:00
Kevin O'Connor 7efbc021a5 pid_calibrate: Add some comments on the calibration methodology
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-19 22:40:11 -04:00
Kevin O'Connor 29e0996858 display: Check for M117 inside of draw_status()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-18 20:43:43 -04:00
Kevin O'Connor 1e71909d02 endstop_phase: Add support for an ENDSTOP_PHASE_CALIBRATE command
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-16 13:09:49 -04:00
Kevin O'Connor def524bdf4 endstop_phase: Add support for detecting phase via TMC stepper drivers
The Trinamic stepper motor drivers are capable of reporting the
stepper phase - add support for using that capability to the
enddstop_phases module.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-16 13:09:23 -04:00
Kevin O'Connor a2df01b88e endstop_phase: Move endstop phase homing code to new "extras" module
Move the endstop phase tracking code from stepper.py to a new
extras/endstop_phase.py module.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-16 13:09:23 -04:00
Kevin O'Connor fedf90680e homing: Pass printer instead of toolhead object to Homing class
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-16 13:09:23 -04:00
Kevin O'Connor 368703fd78 delta_calibrate: Perform coordinate descent in a background process
Run the coordinate descent in a background process so that the main
thread does not block.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-15 19:01:19 -04:00
Kevin O'Connor d4bf51231a homing: Implement second home from homing.py
Move the logic for performing the second home from the kinematics
classes to the generic homing code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-10 12:14:27 -04:00
Kevin O'Connor 1146d228fa servo: Wrap lines to 80 columns
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-10 12:14:27 -04:00
alfsoft 909eef3978 display: Corrected Fan icon graphics (#753)
Added new Copyright string, corrected Fan icon graphics

Signed-off-by: Alexander Fadeev <alfsoft@gmail.com>
2018-10-07 13:38:11 -04:00
Chris Whiteford c5d94a74a5 servo: Adding support for startup value for servos (#676)
Signed-off-by: Chris Whiteford <github@chrisandtennille.com>
2018-10-05 14:35:38 -04:00
Kevin O'Connor 97927172f1 st7920: Use display xor capability when animating glyphs
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>
2018-10-04 13:49:00 -04:00
alfsoft 630989c0fe display: Change Extruder, Bed and Fan icons design (#740)
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>
2018-10-04 13:25:29 -04:00
Arksine d29eb731a9 bed_mesh: save mesh state to 'default' profile after calibration
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2018-10-04 12:53:03 -04:00
Arksine b261d31ec5 bed_mesh: Add ability to save mesh state to persistent memory
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2018-10-02 16:26:35 -04:00
Arksine 144868c600 bed_mesh: Extend BED_MESH_MAP to provide more information
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2018-10-02 16:26:35 -04:00
Kevin O'Connor 5c267e4f69 docs: Update Features.md document with tmc2660 support
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-02 14:07:33 -04:00
Janar Sööt 50d1ad9019 menu.cfg: add fan glyph to __screen2004_static & __screen2004_input
Signed-off-by: Janar Sööt <janar.soot@gmail.com>
2018-10-02 12:49:12 -04:00
Janar Sööt b2691d4730 hd44780: new text glyph - fan
Signed-off-by: Janar Sööt <janar.soot@gmail.com>
2018-10-02 12:49:12 -04:00
Kevin O'Connor 820dd0b5e3 display: Don't error if M73 is missing a P parameter
Try to avoid raising an error on an M73 command.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-01 12:31:31 -04:00
Kevin O'Connor f49f298003 probe: Merge ProbeVirtualEndstop and ProbeEndstopWrapper wrapper classes
No need to have two wrappers around the mcu_endstop class.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-01 11:14:23 -04:00
Kevin O'Connor c5d4e14298 probe: Infer position_endstop when using probe:z_virtual_offset
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>
2018-10-01 11:12:30 -04:00
Kevin O'Connor a9a0bb87fa probe: Verify the toolhead moves at least some distance on a probe
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-01 11:12:30 -04:00
Kevin O'Connor 43f2eac239 z_tilt: Wrap lines to 80 columns
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-01 11:12:30 -04:00
Kevin O'Connor c3550158bb z_tilt: Take into account probe xy offset when calculating z_adjust
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-01 11:12:30 -04:00
Kevin O'Connor 19d18c2bc1 bed_tilt: Take into account probe xy offset when calculating z_adjust
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-01 11:12:30 -04:00
Kevin O'Connor 348a41c325 bed_tilt: Remove special probe:z_virtual_endstop handling
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>
2018-10-01 11:12:30 -04:00
Kevin O'Connor 33887b8c39 probe: Support manual probing at runtime
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>
2018-10-01 11:12:30 -04:00
Kevin O'Connor 0e9b8abde2 probe: Perform multi-sample averaging in ProbePointsHelper class
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>
2018-10-01 11:12:30 -04:00
Kevin O'Connor e5ef15ad0f probe: Separate out manual probing from automatic probing code
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>
2018-10-01 11:12:30 -04:00
Kevin O'Connor cb3fede19a probe: Move move_next() method within ProbePointsHelper class
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-01 11:12:30 -04:00
Kevin O'Connor 8e7eac9b08 probe: Implement ProbePointsHelper get_probed_position() locally
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>
2018-10-01 11:12:30 -04:00
Kevin O'Connor ae4eb35a70 delta_calibrate: Use kin.calc_position() in get_probed_position() callback
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>
2018-10-01 11:12:30 -04:00
Kevin O'Connor de7c1f76db gcode_macro: Provide more information on a formatting error
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-30 12:43:54 -04:00