Commit Graph

1022 Commits

Author SHA1 Message Date
Florian Heilmann 10987003b0
safe_z_home: Make sure X and Y are homed before homing Z (#3153)
In it's current behavior, safe_z_home will attempt to home Z if it thinks the toolhead is above the z endstop even if the motors have since been disabled and the toolhead was moved to another position

Signed-off-by: Florian Heilmann <Florian.Heilmann@gmx.net>
2020-08-05 11:52:23 -04:00
Arksine 3143e31aca temperature_sensor: report min/max measured temp via get_status
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-08-01 15:56:51 -04:00
Arksine d37374974d filament_switch_sensor: report "enabled" state via get_status
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-08-01 15:56:51 -04:00
Kevin O'Connor 1f7c3fc8ec gcode: Report the final print_time in debuginput mode
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-07-30 12:53:59 -04:00
Arksine 4795c0896d bed_mesh: Move profile management to its own class
This streamlines the BedMeshCalibrate class, making it only resposible for configuring and executing the calibration procedure.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-07-25 12:05:29 -04:00
Arksine dbec03abd9 bed_mesh: track the probed_matrix and mesh_params exclusively in the ZMesh class
Rather than have multiple classes keep a reference to these items, keep them in the z_mesh.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-07-25 12:05:29 -04:00
Arksine 41eedda5d6 bed_mesh: differentiate between "mesh_config" and "mesh_params"
This fixes an issue where a new profile is not properly saved after a restart.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-07-25 12:05:29 -04:00
Arksine 7c8b60b40e bed_mesh: round x and y positions received via the finalize callback
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>

Update bed_mesh.py
2020-07-25 12:05:29 -04:00
Arksine 6458def588 bed_mesh: add get_status() method
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-07-25 12:05:29 -04:00
Kevin O'Connor db05938a5f servo: Set initial value via mcu_servo.setup_start_value()
Using the setup_start_value() method avoids the PWM output line
transitioning to an intermediate state prior to setting the initial
value.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-07-25 11:39:39 -04:00
Kevin O'Connor 428a8d4881 servo: Remove servo ENABLE parameter
Allow one to disable servos via `SET_SERVO WIDTH=0` instead of using
an explicit ENABLE parameter.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-07-25 11:39:39 -04:00
combolek 3835654116
lm75: Added support for LM75/LM75A I2C connected temperature sensors (#3101)
Signed-off-by: Boleslaw Ciesielski <combolek@users.noreply.github.com>
2020-07-19 20:18:54 -04:00
Iakabos b0901daa85
display: Add configuration options for OLED displays (#3084)
Add user-configurable contrast, vcomh (affects "smearing"), and invert options for SSD1306/SH1106 type OLED displays.

Signed-off-by:  James Esau <james_esau@hotmail.com>
2020-07-19 20:18:08 -04:00
Kevin O'Connor af981432f0 thermistor: Add in definition for "SliceEngineering 450" thermistor
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-07-11 12:50:58 -04:00
Kevin O'Connor 3a57608642 fan: Separate out the part cooling fan code from the generic fan code
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-07-05 21:04:04 -04:00
Dmitry Butyugin 4bdc11a8b3
input_shaper: Initial support of input shaping (#3032)
Input shaping can help to reduce printer vibrations due to resonances
and eliminate or reduce ghosting in prints.

Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
2020-07-05 20:54:38 -04:00
Kevin O'Connor c6b652044d stepper: Make sure to reload trapq in set_stepper_kinematics()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-06-30 20:20:16 -04:00
Arksine a342770ac5 pause_resume: Add CANCEL_PRINT gcode
Register API endpoints for "pause_resume/pause", "pause_resume/resume" and "pause_resume/cancel".

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-06-24 19:07:33 -04:00
Arksine a31dd0ff0e query_endstops: register "query_endstops/status" endpoint
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-06-24 19:07:33 -04:00
Denis Ignatenko b3298d8992
hall_filament_width_sensor: Added width logging (#2981)
Signed-off-by: Denis Ignatenko deniss979@gmail.com
2020-06-16 13:36:49 -04:00
Arksine 4c571ea9ac bme280: fix reported measured time
This allows the bme280 to correctly work with the temperature_fan module.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-06-16 09:53:10 -04:00
Kevin O'Connor 65ae08ef21 menu_keys: Add a register_button() helper method
Use a helper method to register each button handler.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-06-15 17:23:34 -04:00
Kevin O'Connor 8d9566b945 menu_keys: Reschedule long-click timer on each click
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-06-15 17:23:34 -04:00
Kevin O'Connor 7d8ade74e8 menu_keys: Move button handling from menu.py to new file menu_keys.py
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-06-15 17:23:34 -04:00
Kevin O'Connor 0e9aa76066 uc1701: Update bus import to "from .. import bus"
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-06-15 17:15:53 -04:00
Kevin O'Connor f931da1b87 extras: Use "from . import module" for relative imports
Use alternate import syntax to improve Python3 compatibility.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-06-15 17:15:53 -04:00
Kevin O'Connor 6edc2946db sx1509: Improve Python3 compatibility
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-06-15 17:15:53 -04:00
Kevin O'Connor 4b231470ed delta_calibrate: Improve Python3 compatibility
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-06-15 17:15:53 -04:00
Kevin O'Connor 8c96e9dd11 bed_mesh: Improve Python3 compatibility
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-06-15 17:15:53 -04:00
Kevin O'Connor f5cdfad333 mcu: Avoid using "async" for variables as it conflicts with Python3
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-06-15 17:15:53 -04:00
Kevin O'Connor c4de0bba50 pid_calibrate: Avoid internal error on a shutdown
If a shutdown occurs during a PID_CALIBRATE command (eg, due to a
heater problem) then exit cleanly instead of throwing an internal
error.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-06-14 11:34:04 -04:00
Kevin O'Connor 519c3ad5ee uc1701: Optimize swizzle_bits() code
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-06-12 09:37:37 -04:00
Kevin O'Connor 9465618adb display: Rework write_graphics() to take one character cell at a time
Change write_graphics() from taking one pixel row of n characters to
taking all the rows and columns for one character cell.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-06-11 00:18:23 -04:00
Kevin O'Connor 467e8e6f40 display: Default DISPLAY=display in SET_DISPLAY_GROUP command
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-06-09 12:19:53 -04:00
Florian Heilmann 68fcbe2a62
display: add SET_DISPLAY_GROUP command (#2969)
Signed-off-by: Florian Heilmann <Florian.Heilmann@gmx.net>
2020-06-09 12:07:25 -04:00
Florian Heilmann f28c3319ed
uc1701: Fix for glyph rendering on uc1701 display (#2966)
Signed-off-by: Florian Heilmann <Florian.Heilmann@gmx.net>
2020-06-09 08:20:48 -04:00
Kevin O'Connor cf9627cc05 display: Use animated heated bed icons on default hd44780 display
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-06-09 08:09:59 -04:00
Kevin O'Connor 7713986ae1 display: Make hd44780 glyphs configurable
Allow the 20x4 hd44780 screen glyphs to be customizable from the
config file.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-06-09 08:09:59 -04:00
Kevin O'Connor 1a7e4e51b3 display: Use '.' and '*' in display_glyph description
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-06-08 21:40:42 -04:00
Kevin O'Connor d94dd8e9fd docs: Note changes to glyph names
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-06-08 16:55:09 -04:00
Florian Heilmann 3dcac1308e display: Move glyph definition to printer config
This commit allows to modify the icons (or glyphs) in the displays that
support it. Existing icons can be modified and new icons can be added via
a [display_glyph] section in the config.

Signed-off-by: Florian Heilmann <Florian.Heilmann@gmx.net>
2020-06-08 16:40:45 -04:00
Kevin O'Connor 12e3b9fa7b hall_filament_width_sensor: Fix whitespace errors
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-06-06 14:52:56 -04:00
Kevin O'Connor 739e6e7396 extruder_stepper: Don't directly access extruder member variables
Rework extruder.get_trapq() into extruder.sync_stepper() so that
extruder_stepper.py does not need to directly access the extruder
internals.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-06-06 14:41:15 -04:00
theophile 518fe023b4
extruder_stepper: Support changing synced extruder on the fly (#2824)
Signed-off-by: Christopher Meredith <chmeredith@gmail.com>
2020-06-06 14:30:58 -04:00
matpab 967fe1c01c
HallFilamentWidthSensor: Use current width instead of nomal width while delay is not over (#2907)
Option for using the current diameter instead of nominal while the first measurement isn't in place

Signed-off-by: Matthias Pabel <matthias.pabel@hs-augsburg.de>
2020-06-06 14:19:00 -04:00
Kevin O'Connor 5d26c2a08e gcode_arcs: Add back in support for E moves in absolute extrude mode
This reverts commit 43fa41c1af.

The above commit disabled absolute extrude moves because it was
unclear if the code would work properly when an M221 extrude factor or
G92 offset was in use.  However, since the calculation is done
relative to the raw E position and is sent as a raw E position to
gcode.cmd_G1() these modes should not matter.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-06-04 15:25:17 -04:00
Kevin O'Connor 2a66286d1c display: Do not show time remaining in default 16x4 display
The time remaining estimation is wildy inaccurate.  Only show the time
elapsed.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-06-04 15:02:18 -04:00
Kevin O'Connor 1ab41cf41d gcode: Make it clear that gcode.get_status() can be called without eventtime
Make it clear that gcode.get_status() to be called without an
eventtime by defaulting eventtime=None.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-05-26 14:59:15 -04:00
Kevin O'Connor ceaf818a11 tuning_tower: Minor optimization
Store a reference to the gcode class in self.code.  Obtain the
z_offset once and use for both the oldval and newval calculation.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-05-26 14:56:52 -04:00
Kevin O'Connor 04532448bc tuning_tower: Remove max(0, z) check
Commit 9530373c introduced a minimum value of zero for the g-code z
position.  Unfortunately, that would likely cause the tuning tower to
not emit a command at the start of a test because the initial dummy z
position is set to a negative value.  The minimum bound should not be
needed so remove it.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-05-26 14:46:15 -04:00
Kevin O'Connor 686d557863 tmc5160: Change the default for the pwm_freq field to zero
The tmc5160 spec shows a default of zero, so use that same default for
Klipper.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-05-24 23:58:48 -04:00
Adrian Keet b267178370 controller_fan: Add fan_speed parameter.
This gives it parity with heater_fan.  Also change the default speed from
max_power to 1.0, since it is already scaled by max_power in set_speed.

Signed-off-by: Adrian Keet <arkeet@gmail.com>
2020-05-24 11:46:46 -04:00
Rubens Panfili 9530373ccb
tuning_tower: compensate z-offset (#2881)
Signed-off-by: Rubens Panfili <rubens.panfili@gmail.com>
2020-05-24 11:33:09 -04:00
Denis Ignatenko 9270cabb74
hall_filament_width_sensor: fix overflow issue on 12 bit adc (#2902)
Signed-off-by: Denis Ignatenko <deniss979@gmail.com>
2020-05-21 13:59:09 -04:00
Denis Ignatenko 1d2746f167
hall_filament_width_sensor: Increasing measure stability (#2836)
Signed-off-by: Denis Ignatenko <deniss979@gmail.com>
2020-05-18 17:14:24 -04:00
fess c9daefd97f z_tilt: retries, fix extra retry bug.
round to only 6 decimal places of precision.  prevents doing extra retry
from small variations due to floating point math.

Signed-off-by: John "Fess" Fessenden <fess@fess.org>
2020-05-18 14:55:25 -04:00
fess 7b0e6725ca z_tilt: retries fixup err message
print retries status before erroring on increase

Signed-off-by: John "Fess" Fessenden <fess@fess.org>
2020-05-18 14:55:25 -04:00
Kevin O'Connor 20a27c697f bltouch: Add "probe in touch mode" option
Signed-off-by: Mike Stiemke <fandjango@gmx.de>
2020-05-11 12:46:25 -04:00
Kevin O'Connor 703490da1c bltouch: Simplify handling of command timing
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>
2020-05-11 12:46:25 -04:00
Nathan Plamondon c402b275c3
bed_mesh: Fix typo (#2849)
Signed-off-by: Nate Plamondon <nplamondon@gmail.com>
2020-05-11 12:30:57 -04:00
Kevin O'Connor 787ed452c2 klippy: Rename try_load_module() to load_object()
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>
2020-05-08 11:05:14 -04:00
Kevin O'Connor 2d4b520260 gcode: Move "ok" tracking to GCodeCommand class
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-05-05 11:08:12 -04:00
Kevin O'Connor a68bb935df menu: Use new GCodeCommand wrappers
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-05-05 11:08:12 -04:00
Kevin O'Connor 1fd76b7393 manual_stepper: Use new GCodeCommand wrappers
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-05-05 11:08:12 -04:00
Kevin O'Connor 821df4e994 dotstar: Use new GCodeCommand wrappers
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-05-05 11:08:12 -04:00
Kevin O'Connor a7ca0e1670 delayed_gcode: Use new GCodeCommand wrappers
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-05-05 11:08:12 -04:00
Kevin O'Connor e9e0c374d6 temperature_fan: Use new GCodeCommand wrappers
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-05-05 11:08:12 -04:00
Kevin O'Connor a11535fc86 servo: Use new GCodeCommand wrappers
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-05-05 11:08:12 -04:00
Kevin O'Connor 53093a7a15 output_pin: Use new GCodeCommand wrappers
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-05-05 11:08:12 -04:00
Kevin O'Connor 3c4091548e tmc5160: Use new GCodeCommand wrappers
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-05-05 11:08:12 -04:00
Kevin O'Connor d759cc60d3 tmc2130: Use new GCodeCommand wrappers
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-05-05 11:08:12 -04:00
Kevin O'Connor 3e64093b81 tmc2660: Use new GCodeCommand wrappers
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-05-05 11:08:12 -04:00
Kevin O'Connor 8b8f591a05 tmc: Use new GCodeCommand wrappers
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-05-05 11:08:12 -04:00
Kevin O'Connor 0fd12609a6 neopixel: Use new GCodeCommand wrappers
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-05-05 11:08:12 -04:00
Kevin O'Connor 310d583413 gcode_button: Use new GCodeCommand wrappers
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-05-05 11:08:12 -04:00
Kevin O'Connor 1e992f9d16 filament_switch_sensor: Use new GCodeCommand wrappers
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-05-05 11:08:12 -04:00
Kevin O'Connor 02ee379f82 pause_resume: Use new GCodeCommand wrappers
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-05-05 11:08:12 -04:00
Kevin O'Connor 3e6f2206b3 hall_filament_width_sensor: Use new GCodeCommand wrappers
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-05-05 11:08:12 -04:00
Kevin O'Connor e5c512c8d5 bed_tilt: Use new GCodeCommand wrappers
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-05-05 11:08:12 -04:00
Kevin O'Connor f2688dbb33 bed_screws: Use new GCodeCommand wrappers
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-05-05 11:08:12 -04:00
Kevin O'Connor 0197fec202 delta_calibrate: Use new GCodeCommand wrappers
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-05-05 11:08:12 -04:00
Kevin O'Connor b24465976e heater_bed: Use new GCodeCommand wrappers
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-05-05 11:08:12 -04:00
Kevin O'Connor 95919d1256 screws_tilt_adjust: Use new GCodeCommand wrappers
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-05-05 11:08:12 -04:00
Kevin O'Connor 203568b909 bltouch: Use new GCodeCommand wrappers
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-05-05 11:08:12 -04:00
Kevin O'Connor 4fd5090253 tuning_tower: Use new GCodeCommand wrappers
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-05-05 11:08:12 -04:00
Kevin O'Connor 7232014657 query_endstops: Use new GCodeCommand wrappers
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-05-05 11:08:12 -04:00
Kevin O'Connor d04476c82e fan: Use new GCodeCommand wrappers
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-05-05 11:08:11 -04:00
Kevin O'Connor 33c6667881 stepper_enable: Use new GCodeCommand wrappers
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-05-05 11:08:11 -04:00
Kevin O'Connor a79096efdf pid_calibrate: Use new GCodeCommand wrappers
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-05-05 11:08:11 -04:00
Kevin O'Connor 12b20c6e77 safe_z_home: Use new GCodeCommand wrappers
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-05-05 11:08:11 -04:00
Kevin O'Connor 947569d347 endstop_phase: Use new GCodeCommand wrappers
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-05-05 11:08:11 -04:00
Kevin O'Connor 153c1cbe60 homing_override: Use new GCodeCommand wrappers
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-05-05 11:08:11 -04:00
Kevin O'Connor 1f64ca4fd9 query_adc: Use new GCodeCommand wrappers
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-05-05 11:08:11 -04:00
Kevin O'Connor a13e681b2e gcode_macro: Use new GCodeCommand wrappers
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-05-05 11:08:11 -04:00
Kevin O'Connor fb16e8810b idle_timeout: Use new GCodeCommand wrappers
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-05-05 11:08:11 -04:00
Kevin O'Connor 1d2bb5a412 tsl1401cl_filament_width_sensor: Use new GCodeCommand wrappers
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-05-05 11:08:11 -04:00
Kevin O'Connor 19abe2b974 force_move: Use new GCodeCommand wrappers
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-05-05 11:08:11 -04:00
Kevin O'Connor 57ca91a875 quad_gantry_level: Use new GCodeCommand wrappers
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-05-05 11:08:11 -04:00
Kevin O'Connor d4adeda76b manual_probe: Use new GCodeCommand wrappers
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-05-05 11:08:11 -04:00
Kevin O'Connor dce46ea053 z_tilt: Use new GCodeCommand wrappers
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-05-05 11:08:11 -04:00
Kevin O'Connor ff6c11e827 probe: Use new GCodeCommand wrappers
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-05-05 11:08:11 -04:00
Kevin O'Connor 1746148a45 firmware_retraction: Use new GCodeCommand wrappers
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-05-05 11:08:11 -04:00
Kevin O'Connor 5fe5e21508 heaters: Use new GCodeCommand wrappers
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-05-05 11:08:11 -04:00
Kevin O'Connor b0d9a82718 virtual_sdcard: Use new GCodeCommand wrappers
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-05-05 11:08:11 -04:00
Kevin O'Connor 48ebb6959d skew_correction: Use new GCodeCommand wrappers
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-05-05 11:08:11 -04:00
Kevin O'Connor 433c8c937a respond: Use new GCodeCommand wrappers
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-05-05 11:08:11 -04:00
Kevin O'Connor 5a0b9d1ce8 display_status: Use new GCodeCommand wrappers
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-05-05 11:08:11 -04:00
Kevin O'Connor 98c9a991a3 bed_mesh: Use new GCodeCommand wrappers
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-05-05 11:08:11 -04:00
Kevin O'Connor c0796bc42d gcode_arcs: Use new GCodeCommand wrappers
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-05-05 11:08:11 -04:00
Kevin O'Connor ddb8311890 gcode: Create new wrapper class for gcode command parameters
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>
2020-05-05 11:08:11 -04:00
Lucio Tarantino dac42efbd9
htu21d: Support for HTI21D family sensor on I2C bus (#2803)
Signed-off-by: Lucio Tarantino <lucio.tarantino@gmail.com>
2020-05-03 18:47:24 -04:00
Janne Grunau 0aa78ec76e
linux: Adapt servo0 channels for beagleboard kernel 4.14.108-ti (#2746)
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>
2020-05-03 11:24:42 -04:00
Kevin O'Connor ced389f4f6 pid_calibrate: Fix module import
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-04-25 14:49:50 -04:00
Kevin O'Connor 17123889f6 heaters: Make heater.py an "extras" module
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>
2020-04-25 14:26:45 -04:00
Kevin O'Connor d858498a53 heater: Move M105 command handling from gcode.py to heater.py
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-04-25 14:26:28 -04:00
Kevin O'Connor 86a99cf38e gcode_button: Simplify script execution
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>
2020-04-25 12:11:49 -04:00
Kevin O'Connor c590bf7643 probe: Rename probe_prepare/finalize to probe_prepare/finish
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>
2020-04-25 12:01:52 -04:00
Kevin O'Connor 64031ab3d7 gcode: Rename respond() to respond_raw()
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>
2020-04-24 15:54:18 -04:00
Kevin O'Connor 568a0da50e virtual_sdcard: No need to call gcode.respond_error() on disk error
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>
2020-04-24 14:54:13 -04:00
Kevin O'Connor 9730be8e17 respond: Simplify M118 handling
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>
2020-04-24 10:11:37 -04:00
Kevin O'Connor 3990d997de z_tilt: Raise a gcode.error() instead of directly calling respond_error()
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>
2020-04-24 10:10:33 -04:00
Kevin O'Connor 43fa41c1af gcode_arcs: Disable E moves in absolute extrude mode
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>
2020-04-23 10:05:05 -04:00
Kevin O'Connor fc627ec470 gcode_arcs: Minor cleanup of planArc()
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>
2020-04-22 17:58:10 -04:00
Kevin O'Connor 402110f655 gcode_arcs: Fix Z moves and E moves
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>
2020-04-22 16:30:02 -04:00
Kevin O'Connor ff28f33967 gcode_arcs: Simplify parameter parsing
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>
2020-04-22 16:19:15 -04:00
Kevin O'Connor 120331f49a safe_z_home: Simplify check for axes to home
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-04-22 11:55:25 -04:00
Kevin O'Connor 0ae20421d1 neopixel: Allow host software to configure neopixel timing
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-04-15 13:29:43 -04:00
Piotr Usewicz 939b575b01
bed_mesh: Fix typo (#2692)
Signed-off-by: Piotr Usewicz <piotr@layer22.com>
2020-04-14 22:09:28 -04:00
Kevin O'Connor a028aeaf78 Revert "bltouch: No need to pause the toolhead for PWM off commands"
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>
2020-04-04 18:51:53 -04:00
Kevin O'Connor 5c8d15bbee bltouch: No need to pause the toolhead for PWM off commands
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-04-02 08:25:22 -04:00
Kevin O'Connor 9f2a025762 bltouch: Don't assume reset will do a pin_up in test_sensor()
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>
2020-04-02 08:25:22 -04:00
Kevin O'Connor 2b916e79c7 bltouch: Call sync_print_time() on multi_probe_end()
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>
2020-04-02 08:25:22 -04:00
Kevin O'Connor 5e207d2baa bltouch: Apply reset command for a full second on a raise_probe() failure
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>
2020-04-02 08:25:22 -04:00
Kevin O'Connor 3646cc0140 bltouch: Separate out pin_up_not_triggered case in raise_probe()
Simplify raise_probe() by separating out the pin_up_not_triggered
case.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-04-02 08:25:22 -04:00
Kevin O'Connor 87bfa06b9e bltouch: Don't raise an error in verify_state()
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>
2020-04-02 08:25:22 -04:00
Jeremy Briffaut 6be552f6e6 Allow manual_stepper to run in parallel than an other stepper
Signed-off-by: Jeremy Briffaut <kakou@kakou.org>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-03-23 14:43:34 -04:00
Kevin O'Connor 6b7e917a8e statistics: Exit loop as soon as MemAvailable found
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-03-22 22:04:40 -04:00
Kevin O'Connor 6aae62542c statistics: Add system stats
Report os load, process cpu time, and system available memory to each
statistics report.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-03-22 20:02:51 -04:00
Kevin O'Connor d3a7d992aa display: Remove unused self.lcd_type variable
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-03-21 12:12:29 -04:00
kakou-fr 961f68629a
manual_stepper: Fix sensorless endstop for manual_stepper (#2621)
Signed-off-by: Jeremy Briffaut <kakou@kakou.org>
2020-03-20 21:11:36 -04:00
Kevin O'Connor 5e39d346ed display: Use the active extruder in the default 16x4 screen layout
Change the default layout to show the active extruder (not always the
first extruder).

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-03-13 21:50:38 -04:00
Kevin O'Connor f2dd4b001d display: Use a separate display group for 16x4 multiple extruders
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-03-13 21:46:36 -04:00
Kevin O'Connor 986e9c884a display: Fix percent progress rendering on 16x4 multi-extruder layout
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-03-08 17:55:53 -04:00
Arksine aa7d24b0af display: add support for multiple displays
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-03-08 17:38:24 -04:00
Kevin O'Connor 6d5ce309a5 menu: Remove the "test" menu from the default menu
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>
2020-03-08 17:38:24 -04:00
Kevin O'Connor d39c4fe628 menu: Disable support for "deck" and "card" menu items
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>
2020-03-08 17:38:24 -04:00
Kevin O'Connor 2cf03ffa23 display: Replace hard-coded display with new config based display
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>
2020-03-08 17:38:21 -04:00
Kevin O'Connor 5acc181624 display_status: Separate out M73 and M117 handling to new module
Move M73 and M117 handling from display.py to a new display_status.py
module.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-03-08 17:36:14 -04:00
Kevin O'Connor a61d483e21 tmc_uart: Use nominal mcu frequency in baud calculation
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-03-06 16:29:18 -05:00
Kevin O'Connor a074af7c87 adc_temperature: Add builtin definition for PT1000 sensors
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-03-05 11:46:01 -05:00
Kevin O'Connor d6c2e24f4c tmc5160: Support setting GLOBALSCALER to fine tune current selection
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-03-04 19:40:32 -05:00
David Smith c0f72a2c38
safe_z_home: Support note_z_not_homed() in kinematics (#2500)
Signed-off-by: David Smith <davidosmith@gmail.com>
2020-03-01 23:00:41 -05:00
Denis Ignatenko f84542cd20
hall_filament_width_sensor: Added virtual runout sensor (#2535)
Signed-off-by: Denis Ignatenko deniss979@gmail.com
2020-03-01 22:05:12 -05:00
Kevin O'Connor c197fdb03d heater: Fix misspelling of Celsius
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-02-27 11:31:51 -05:00
FanDjango 16ecf15a91
bltouch: BTLOUCH V3.0/V3.1 Enable 5V/OD mode set commands (#2540)
Signed-off-by: Mike Stiemke <fandjango@gmx.de>
2020-02-23 22:32:07 -05:00
Kevin O'Connor 245917bf03 mcu: Introduce new lookup_query_command() command wrapper
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>
2020-02-20 13:24:53 -05:00
Kevin O'Connor 332038ea01 serialhdl: Convert queries to use new notify message ack system
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>
2020-02-20 12:01:21 -05:00
Kevin O'Connor e03f75e758 tmc: Revert incorrect changes to TPWMTHRS setting
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>
2020-02-20 11:41:35 -05:00
Kevin O'Connor 15f21be5ec manual_stepper: Support ignoring errors on STOP_ON_ENDSTOP
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-02-19 13:38:22 -05:00
Kevin O'Connor 804f95ebe4 homing: Don't raise a TimeoutError from home_wait()
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>
2020-02-19 12:20:00 -05:00
Kevin O'Connor fbbbbc85cf homing: Replace notify callback with a completion
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>
2020-02-19 11:45:44 -05:00
Kevin O'Connor 29c6c89327 probe: Don't allow errors to propagate from "gcode:command_error" event
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-02-18 11:47:04 -05:00
Christian S aa0a889b04
menu: Set speed for move actions (#2520)
Signed-off-by: Christian Schnellrieder <schnellrieder.cs@gmail.com>
2020-02-17 20:52:54 -05:00
Kevin O'Connor 5304c4141c filament_switch_sensor: Query "printing" status instead of tracking it
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>
2020-02-17 17:07:54 -05:00
Kevin O'Connor b6368173cf filament_switch_sensor: Collapse event disable flags
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>
2020-02-17 16:57:27 -05:00
Kevin O'Connor 6716007420 filament_switch_sensor: Minor optimization to note_filament_present()
Avoid calling into the OS to obtain the system time if the filament
state hasn't changed.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-02-17 16:51:00 -05:00
Arksine 718da75910 filament_switch_sensor: Add a get_status() method
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-02-17 16:48:43 -05:00
Arksine 9415071482 filament_switch_sensor: Execute events using reactor callbacks
This removes the possibility of re-entry to callers of  note_filament_present().

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-02-17 16:48:43 -05:00
Arksine 740c0ae636 filament_switch_sensor: Replace BaseSensor with RunoutHelper
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>
2020-02-17 16:48:43 -05:00
FanDjango 086c131bbf bltouch: Add support for stow_on_each_sample
Signed-off-by: Mike Stiemke <fandjango@gmx.de>
2020-02-15 17:58:56 -05:00
Kevin O'Connor 1dd952ac65 probe: Add multi_probe_begin() / multi_probe_end() callbacks
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>
2020-02-15 17:52:44 -05:00
Kevin O'Connor 1aa11fed8c homing: Add a "home_rails_begin" event notifier
Also, rename the "homed_rails" event to "home_rails_end".

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-02-15 17:52:44 -05:00
Kevin O'Connor feb15eaf2e homing: Merge home_prepare()/home_finalize() into move_begin/move_end events
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>
2020-02-15 17:52:44 -05:00
Arksine b23346a521 bme280: handle read timeout exceptions
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-02-14 17:25:08 -05:00
test3210-d 9a65a4569b hall_filament_width_sensor: Add new filament sensor
Signed-off-by: Denis Ignatenko <deniss979@gmail.com>
2020-02-14 13:14:34 -05:00
Kevin O'Connor 9818055ac3 gcode_macro: Support overriding of builtin g-code commands
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-02-12 20:42:03 -05:00
Kevin O'Connor 0cfab84e1a gcode: Return previous handler from register_command(cmd, None)
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>
2020-02-12 20:19:18 -05:00
Kevin O'Connor 512ad4b3a4 query_endstops: Add get_status() method that reports the last query state
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-02-12 19:32:48 -05:00
FanDjango cb042e749d
homing_heaters: Turn off heaters during homing/probing (#2486)
Signed-off-by: Mike Stiemke <fandjango@gmx.de>
2020-02-12 10:08:30 -05:00
David Smith 596f5e3e3a
stepper_enable: Add SET_STEPPER_ENABLE gcode command (#2463)
Signed-off-by: David Smith <davidosmith@gmail.com>
2020-02-10 22:34:11 -05:00
Kevin O'Connor 7d76067ff9 tmc: Fix typo preventing stealthchop threshold from being set
Fix typo introduced in commit 67b28522.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-02-09 15:38:47 -05:00
David Smith b6779cc019
delayed_gcode: Fix definition reference for UPDATE_DELAYED_GCODE (#2465)
Signed-off-by: David Smith <davidosmith@gmail.com>
2020-02-03 15:32:44 -05:00
Kevin O'Connor 68e59528a4 endstop_phase: Query the stepper step_distance from the stepper object
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>
2020-02-01 21:58:14 -05:00
Kevin O'Connor 67b2852249 tmc: Query the stepper step_distance from the stepper object
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>
2020-02-01 21:58:11 -05:00
Kevin O'Connor c36fe76d69 probe: Add support for configuring lift_speed
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-01-31 15:47:06 -05:00
Kevin O'Connor ef4710c6e0 hd44780: Increase timeout to 40us
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>
2020-01-24 00:04:31 -05:00
Kevin O'Connor 8ed0f7c5c3 kinematics: Remove support for identifying Z steppers
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>
2020-01-23 20:47:01 -05:00
Arksine 774371d78d bme280: initial implementation of BME280 environmental sensor
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-01-13 22:29:50 -05:00
Arksine 97b4eff424 bed_mesh: detect incompatible mesh profiles
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-01-09 14:14:13 -05:00
Arksine 8013699c45 bed_mesh: refactor print_generated_points()
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-01-09 14:14:13 -05:00
Arksine 2a2191d201 bed_mesh: fix LOAD_PROFILE
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-01-09 14:14:13 -05:00
Arksine 13d16afa0c bed_mesh: Allow the default profile to be removed
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-01-09 14:14:13 -05:00
Arksine 2c877e1729 bed_mesh: improve interpolation checks
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>
2020-01-09 14:14:13 -05:00
Arksine a69de2be93 bed_mesh: Move BED_MESH_MAP to Bedmesh class
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>
2020-01-09 14:14:13 -05:00
Arksine fe929e4696 bed_mesh: Add x,y offsets to min/max points in probe_finalize
This eliminates the need for the "mesh_params" dict to have references to the x and y offsets.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-01-09 14:14:13 -05:00
Arksine 5b20ac416c bed_mesh: refactoring
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>
2020-01-09 14:14:13 -05:00
Arksine 74892a7702 bed_mesh: improve logging of generated points
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>
2020-01-09 14:14:13 -05:00
Arksine 914f701256 bed_mesh: add xy offsets to generated points
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>
2020-01-09 14:14:13 -05:00
Arksine ec58b23f3b ProbePointsHelper: Optionally add xy offsets to probe points
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-01-09 14:14:13 -05:00
Kevin O'Connor 9aab58605b tuning_tower: Support tuning of traditional g-code commands
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-01-07 19:21:54 -05:00
Kevin O'Connor a56484c98b delta_calibrate: Add support for manually entering a nozzle Z height
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-01-06 11:49:41 -05:00
Kevin O'Connor 97d976fc53 stepper: Track if using units of radians instead of millimeters
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>
2020-01-06 11:49:41 -05:00
Kevin O'Connor 27e6b533bc delta: Move low-level delta calibration to delta.py
Move the linear delta specific calibration code from
delta_calibrate.py to delta.py.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-01-06 11:41:09 -05:00
Kevin O'Connor fdfa26edd6 delta_calibrate: Move stable position conversion to its own class
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-01-06 11:41:09 -05:00
Simo Apell 90bc1679a2 extruder_stepper: Initial support for synchronized extruder steppers
Signed-off-by: Simo Apell <simo.apell@live.fi>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-01-06 11:03:05 -05:00
Kevin O'Connor e576571340 fan: Do not flush look-ahead queue on fan speed change
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-01-03 18:13:57 -05:00
Kevin O'Connor 4b6a65c1e0 heater: Do not flush look-ahead queue on a heater temperature update
The print_time parameter of heater.set_temp() is not currently used
and it isn't necessary to flush the look-ahead queue just get the
print_time.  Remove the parameter from heater.set_temp() to avoid
flushing the look-ahead queue.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-01-03 18:13:57 -05:00
Daniel Kucera efc3335911 gcode_arcs: use correct current position from gcode
Signed-off-by: Daniel Kucera <github@danman.eu>
2019-12-18 12:42:40 -05:00
Kevin O'Connor 0a86190bae display: Revert "display: Add ST7567 display support (#1540)"
This reverts commit 1b92af6078.

The standard "uc1701" lcd_type can now be used in place of the custom
"st7567" lcd_type.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-12-18 12:30:20 -05:00
Kevin O'Connor 9654816abf heater_bed: Move M140/M190 commands from gcode.py to heater_bed.py
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-12-16 20:02:48 -05:00
Kevin O'Connor 0e2d1a190e gcode: Rename bg_temp() to wait_for_temperature()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-12-16 19:21:37 -05:00
Kevin O'Connor 665323eb29 heater: Use printer.command_error() instead of internal heater.error()
Use the more standard command_error to report invalid temperature
requests.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-12-16 19:16:58 -05:00
Kevin O'Connor 254789f4c5 neopixel: Add support for delaying updates in SET_LED command
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-12-15 23:24:17 -05:00
Simon Kühling b1bbe97576 temperature_sensor: Add get_status() function
Provide printer.<sensor-config-name>.temperature variable to gcode macro
environment

Signed-off-by: Simon Kühling <mail@simonkuehling.de>
2019-12-13 10:45:04 -05:00
Kevin O'Connor 72161d0405 tuning_tower: Fix typo causing tuning tower to break when homing
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-12-04 20:11:54 -05:00
Petri Honkala 98d1fee8ad tmc5160: PWMCONF is write only
Signed-off-by: Petri Honkala <cruwaller@gmail.com>
2019-12-04 09:20:39 -05:00
Petri Honkala 99a74d9f07 tmc2130: use local variable instead of global Registers in MCU_TMC_SPI
Signed-off-by: Petri Honkala <cruwaller@gmail.com>
2019-12-03 12:06:37 -05:00
Kevin O'Connor e310e5f0e8 uc1701: Add a delay after reset toggle (for displays using ResetHelper)
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-12-03 11:13:54 -05:00
Kevin O'Connor a8ad1ae726 screws_tilt_adjust: Remove check for probe printer object
The probe object may not have be instantiated when the
screws_tilt_adjust object is instantiated.  Just remove the check.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-12-02 20:06:04 -05:00
Kevin O'Connor 2d97e0e218 uc1701: Add support for rst_pin
Add support for an optional uc1701 rst_pin.  Use the same reset pin
code handling with the SSD1306 code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-12-02 10:25:30 -05:00
Kevin O'Connor 2e7f38eadd hd44780: Use two separate text framebuffers
There is concern that some lcd boards that emulate the hd44780 don't
support text updates that wrap the two text framebuffers.  Update the
code to treat the two text areas as two separate framebuffers.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-12-01 19:18:52 -05:00
Matt Baker 8d93d1a8ef uc1701: add config option for sh1106 type with up to 132 columns.
Signed-off-by: Matt Baker <baker.matt.j@gmail.com>
2019-11-26 19:40:39 -05:00
Kevin O'Connor 3683273936 toolhead: Report which axes are homed via get_status()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-24 20:21:13 -05:00
Justin Schuh 93f1e6dd86 FAN: Kick start fan when the increase is more than 50% (#2085)
Large increases in fan speed can suffer from acceleration lag, so this
change kick starts the fan for a change of 50% or more in the same way
that starting the fan from 0% does.

Signed-off-by: Justin Schuh <code@justinschuh.com>
2019-11-24 18:37:30 -05:00
Kevin O'Connor 05472bb8a3 virtual_sdcard: Don't wait for M25 in an SD gcode file
If an M25 is in a gcode file that is being printed from virtual SD, it
would cause a permanent hang.  Detect that case and don't wait for
those M25 commands.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-24 14:30:26 -05:00
Kevin O'Connor ade65b90af force_move: Make sure to flush step generation queue after each move
Add toolhead.note_kinematic_activity() call and use it to force the
step generation to be flushed.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-24 11:55:30 -05:00
Kevin O'Connor 00fd6223ed tuning_tower: Report start of tuning test on g-code console
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-21 13:44:02 -05:00
Kevin O'Connor 2843c85019 toolhead: Rename _full_flush() to flush_step_generation() and use globally
Update code that modifies the low-level kinematics handlers to first
call toolhead.flush_step_generation().

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-21 13:17:45 -05:00
Florian Heilmann b0a158c271 tmc2130: Do not error if run current below hold current (#2190)
Signed-off-by: Florian Heilmann <Florian.Heilmann@gmx.net>
2019-11-21 11:09:39 -05:00
Kevin O'Connor 8efa5e2db4 stepper_enable: Raise an error on bad lookup_enable() call
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-14 18:05:32 -05:00
Kevin O'Connor 18b0749163 bltouch: No need to call get/set_commanded_position()
Now that the homing code does not call set_commanded_position(), it is
no longer necessary to save/restore the position in the bltouch code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-13 19:35:26 -05:00
Kevin O'Connor eed371e924 endstop_phase: Use set_tag_position() instead of set_commanded_position()
Use the new get/set_tag_position() calls to avoid altering the
low-level kinematic position.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-13 19:00:23 -05:00
Kevin O'Connor 224574da4a stepper: Add get/set_tag_position() and convert calc_position()
Rename calc_position() to calc_tag_position() and have it calculate
the value of the position from the last stepper set_tag_position()
call.  This enables the calc_tag_position() code to be more flexible
as it can be run with arbitrary positions.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-13 19:00:17 -05:00
Kevin O'Connor e0e2f15498 fan: Move M106/M107 commands from gcode.py to fan.py
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-13 11:30:42 -05:00
Kevin O'Connor 6116a5d48f stepper_enable: Remove ability to use a list of pins in enable_pin
Now that the tmc drivers perform automatic soft stepper enabling,
there is no need to be able to list multiple pins in the enable_pin
config setting.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-12 18:45:31 -05:00
Kevin O'Connor 77dff35fae tmc: Remove virtual_enable support and replace with automatic support
Automatically detect if the stepper has a dedicated enable line.  If
it does not, then automatically enable virtual enable support.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-12 18:45:31 -05:00
Kevin O'Connor a4995c61c9 stepper: Remove add_to_endstop() method
Now that the PrinterStepper and MCU_stepper classes have been merged,
there is no need for the add_to_endstop() method.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-12 17:32:18 -05:00
Kevin O'Connor 4ca190d393 stepper: Move MCU_stepper from mcu.py to stepper.py
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-12 17:32:18 -05:00
Kevin O'Connor 0e30b862c7 stepper_enable: Move enable tracking from stepper.py to stepper_enable.py
Move the enable line tracking out of the main stepper.py code.  This
simplifies the main kinematic code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-12 17:32:18 -05:00
Kevin O'Connor bfb34e0701 stepper_enable: Move motor_off() logic to stepper_enable.py
Directly disable all the stepper motors on a global motor_off() from
the StepperEnable() class in stepper_enable.py.  This simplifies the
toolhead and kinematic classes.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-12 17:32:18 -05:00
Kevin O'Connor f50e054bd0 stepper_enable: Add new extras module for stepper enable line tracking
Move the M18/M84 command handling from gcode.py to new stepper_enable
module.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-10 11:55:53 -05:00
Kevin O'Connor 0bfb655f66 query_adc: Add a new module to help query and debug analog pins
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-07 19:28:27 -05:00
Kevin O'Connor 124ba12485 buttons: Only call into main thread on an adc button change
Determine the selected button (and if it has changed) in the
background thread first.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-07 18:49:56 -05:00
Kevin O'Connor 196a69c613 buttons: No need to check for None on min_value/max_value
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-07 18:42:55 -05:00
Kevin O'Connor d40f951d6f buttons: Remove MCU_ADC_buttons debug capability
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-07 18:32:26 -05:00
Kevin O'Connor ed610a6600 extruder: Consistently use "extruder" for the primary extruder
No longer allow the primary extruder to be named "extruder0".  This
avoids internal and external confusion between the printer objects and
config section names.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-07 16:28:47 -05:00
Kevin O'Connor 86121ff79e toolhead: Calculate and store axes_r in move class
Calculate the ratio of axis distance to total move distance (axis_d /
move_d) and store in a new member variable axes_r.  This avoids
needing to recalculate the value in other code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-06 15:51:51 -05:00
Kevin O'Connor 1acaaa98c2 trapq: Remove move_fill()
Now that all callers use the trapq system to queue moves, it is no
longer necessary to individually allocate and fill a 'struct move'.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-06 15:51:51 -05:00
Kevin O'Connor bd3c8920f6 mcu: Remove set_ignore_move()
Update callers of set_ignore_move() to use the trapq system to set a
stepper to ignore moves.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-06 15:51:51 -05:00
Kevin O'Connor ef53ded6bc force_move: Convert step generation to use trapq system
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-06 15:51:51 -05:00