Commit Graph

1667 Commits

Author SHA1 Message Date
Kevin O'Connor 080ee0b512 kin_extruder: Apply pressure advance in kin_extruder.c
Implement the pressure advance calculations while performing the
definitive integral calculations.  This simplifies both the
extruder.py and kin_extruder.c code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-12-08 20:41:35 -05:00
Kevin O'Connor 730a6d868b kin_extruder: Move integration code from trapq.c to kin_extruder.c
Move the code that calculates the definitive integral to the
kin_extruder.c file.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-12-08 18:30:42 -05:00
Kevin O'Connor 139274f0bb mathutil: Propagate errors from background_coordinate_descent()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-12-05 14:48:52 -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 988ee5754e itersolve: Fix potential backwards time in itersolve_gen_steps_range()
Make sure that a newly choosen "high" bound is always greater than the
"low" bound.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-12-02 23:56:42 -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 8e87ab0939 gcode: Remove support for "G4 S1" style commands
The S parameter is not a standard and was not commonly used.  The P
parameter (delay specified in milliseconds) is the commonly accepted
g-code mechanism for dwelling.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-12-02 19:31:20 -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
Kevin O'Connor 282af0220e toolhead: Report the current extruder from the get_status() method
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 89d1ab7c04 extruder: Remove support for lookahead() method
Now that the extruder lookahead method is no longer used it can be
removed from the toolhead and extruder classes.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-21 13:18:21 -05:00
Kevin O'Connor 5f5896ad71 extruder: Add support for instantaneous corner velocity
Add mechanism to perform look-ahead between moves with different
extrusion ratios.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-21 13:18:21 -05:00
Kevin O'Connor 6d0c55b6c1 extruder: Initial support for "smoothed pressure advance"
Support averaging the extruder position over a time range to "smooth
out" the velocity changes that occur during pressure advance.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-21 13:18:19 -05:00
Kevin O'Connor da06e185fb trapq: Add trapq_find_move() function
Add support for finding a move by time in the trapezoidal velocity
move list.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-21 13:17:45 -05:00
Kevin O'Connor a28b29993a trapq: Add code to calculate definitive integral
Support calculating the definitive integral of a cartesian axis
position over a time range of the movement queue.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-21 13:17:45 -05:00
Kevin O'Connor d00023f3bb toolhead: Support step generation in lead up to and after stepper activity
Add support for kinematic functions that calculate step times based on
a range of the motion queue.  This requires adding additional pause
times when fully flushing the motion queue.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-21 13:17:45 -05:00
Kevin O'Connor 56cd39f038 itersolve: Support step generation in lead up to and after stepper activity
Add support for generating steps from kinematic functions that
calculate step times based on a range of the motion queue.  It
requires scanning for step generation during the lead up to stepper
activity (when the stepper would nominally be idle).  And it requires
scanning for step generation just after a stepper has nominally become
idle.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-21 13:17:45 -05:00
Kevin O'Connor 4dbe795ac2 trapq: Implement sentinel nodes on the trapq list
Use sentinels to make list traversal code simpler.  Also add in null
moves so that there are no time gaps in the list.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-21 13:17:45 -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
Kevin O'Connor 7c80e8d533 toolhead: No need to transition to Flushed state before entering Drip state
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 d38aed0773 cartesian: Report dual_carriage_rails from get_steppers()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-15 12:32:04 -05:00
Kevin O'Connor e1919e3731 toolhead: Don't report buffer_time stat during homing
The buffer_time info is misleading during a homing operation - just
report zero instead.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-15 12:21:23 -05:00
Kevin O'Connor 503891cd0e toolhead: Don't call _process_moves() if no moves present
Don't transition to the normal movement state if there aren't any
moves actually ready to be processed.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-15 11:55:15 -05:00
Petri Honkala dd529d7ad1 msgproto: unresolved symbol fixed
Signed-off-by: Petri Honkala <cruwaller@gmail.com>
2019-11-15 11:36:54 -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 d39142139e stepper: Remove set_commanded_position() call
Now that the only caller to set_commanded_position() is
set_position(), remove the set_commanded_position() method and pass
the set_position() call directly to the itersolve.c code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-13 19:35:26 -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 9396431c6b stepper: Do not call itersolve_set_commanded_pos() after homing
Now that the homing code does not use get_commanded_position(), it is
no longer necessary to alter the low-level commanded position after a
homing move.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-13 19:35:26 -05:00
Kevin O'Connor fa433c7f04 homing: Use get/set_tag_position() to determine probed position
Don't rely on get_commanded_position() to determine the final probe
point.

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 0a39c339c7 gcode: Remove explicit active extruder tracking
There's no need to have special logic in gcode.py to track the active
extruder.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-13 11:02:26 -05:00
Kevin O'Connor e532b75e21 mcu: Minor simplification to default reset detection
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-12 22:15:04 -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 78153ca4c3 stepper: Merge PrinterStepper and MCU_stepper classes
There's no need to track the two classes separately - just combine
them.

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 0204de46a6 stepper: Simplify PrinterRail init
Use add_extra_stepper() during class init.

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 bdc7383e51 itersolve: Improve numerical stability of itersolve_generate_steps() loop
Minor rework of the loop to reduce the chance that numerical stability
could cause an infinite loop.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-08 14:17:35 -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 2d5c761101 toolhead: Clear any pending pauses when a shutdown occurs
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-07 18:06:46 -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 32f61b01e9 trapq: Use C99 method for declaring struct members in trapq_append()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-07 11:32:53 -05:00
Kevin O'Connor f63f68bbbb chelper: Report an error if the C host code does not compile
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-07 11:32:20 -05:00
Kevin O'Connor 5500538fc5 toolhead: Rename register_move_handler() to register_step_generator()
Rename the function so it is more clear what the step generation code
path is.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-07 10:59:35 -05:00
Kevin O'Connor 2981bd601b extruder: Treat extrude with Z only movement to be an "extrude only" move
Do not apply max_extrude_cross_section check, and do apply
extrude_only_xxx checks to Z only moves that also extrude.  Some
printer start scripts will prime the extruder while moving the Z.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-07 09:45:36 -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 257058981e toolhead: Simplify set_junction() code
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-06 15:51:51 -05:00
Kevin O'Connor 076a66f791 trapq: Use separate 'move' entries for accel, cruise, and decel phases
Only track a single acceleration movement in a 'struct move' instance.
Break the classic trapezoid movement (accel, cruise, decel) into three
separate movements.  This simplifies the calculation logic.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-06 15:51:51 -05:00
Kevin O'Connor 7ca86f1723 toolhead: Flush trapezoid velocity queue in batches
Load all items from the look-ahead queue into the trapezoid velocity
queue, and then flush that queue by time.  This prevents the host cpu
from being starved on very long moves (which may require a large
number of steps to be generated).  It also improves the overall
performance.

With the batch flushing logic in place, it is no longer necessary to
split homing moves up.

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 797dcfcb12 itersolve: Remove unused gen_steps()
Eliminate the old gen_steps() call now that all callers have been
converted to the newer trapq based generate_steps().

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 befd263260 toolhead: Remove kinematic move() call
Now that all kinematics use the trapq system, there is no need to call
into the kinematics on each g-code move.

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
Kevin O'Connor e6f713f1ce manual_stepper: Convert step generation to use trapq system
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-06 15:51:51 -05:00
Kevin O'Connor 9845d0d103 extruder: Convert step generation to use trapq system
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-06 15:51:51 -05:00
Kevin O'Connor 746b928c8b winch: Convert step generation to use trapq system
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-06 15:51:51 -05:00
Kevin O'Connor 4b5cbc18a4 polar: Convert step generation to use trapq system
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-06 15:51:51 -05:00
Kevin O'Connor 351b565728 delta: Convert step generation to use trapq system
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-06 15:51:51 -05:00
Kevin O'Connor b792e0fdd1 corexy: Convert step generation to use trapq system
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-06 15:51:51 -05:00
Kevin O'Connor 7afac2b3af cartesian: Convert step generation to use trapq system
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-06 15:51:51 -05:00
Kevin O'Connor f3ef9c1889 itersolve: Add support for generating steps from a trapq
Support associating a stepper_kinematics with a trapq.  Support
generating steps from a time range on the given trapq.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-06 15:51:51 -05:00
Kevin O'Connor d3afe4f1d8 trapq: Initial support for building a queue of trapezoidal velocity moves
Add support for building a list of moves in the trapq.c code.  Update
the toolhead code so that moves generated from the look-ahead code are
added to that list.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-06 15:51:51 -05:00
Kevin O'Connor c06f6943a6 list: Add additional list helper functions
Add list_is_first, list_is_last, list_last_entry, and list_prev_entry
helper functions.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-06 15:51:51 -05:00
Kevin O'Connor fdbdb3c707 trapq: Add new trapq.c file with code for trapezoidal velocity handling
Move the "struct move" code from itersolve.c to new file trapq.c.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-06 15:51:51 -05:00
Kevin O'Connor 374eb98765 polar: Implement bed angle wrapping adjustments in chelper code
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-06 15:51:51 -05:00
Kevin O'Connor 92993c062b itersolve: Rename calc_position to calc_position_cb
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-06 15:51:51 -05:00
Kevin O'Connor 9945cc0f46 itersolve: Fix possible infinite loop in itersolve_gen_steps()
If the kinematic position calculation function had an error in it (if
it produces sudden position changes) then it could lead to an infinite
loop in itersolve_gen_steps().

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-06 15:51:51 -05:00
Kevin O'Connor 5eb5841eaf mcu: Contact and identify all the mcus prior to configuring them
Break up the connect phase into two phases - mcu_identify and connect.
The first phase will contact all the micro-controllers and obtain the
"identify" data dictionaries for them.  Once all the micro-controllers
have been contacted, then they can be configured.  This fixes an issue
with FIRMWARE_RESTART not working correctly on multi-mcu setups that
use restart_method=command.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-06 10:35:24 -05:00
Kevin O'Connor 430ad0b658 virtual_sdcard: Only return from M25 after print confirmed paused
Wait in the M25 command handler until the work_handler() background
timer fully exits.  This ensures that subsequent g-code commands (such
as M27 or M24) will correctly report a paused state.

Reported by @foosel.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-10-31 11:36:35 -04:00
Kevin O'Connor 40e2c64c82 clocksync: Fix typo in pause() call at connect time
The initial clock measurement wasn't properly implementing a small
delay between clock queries.  Fix the pause() call so there is a small
delay between queries.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-10-31 11:36:35 -04:00
Kevin O'Connor 0ba5819370 tmc_uart: Don't try to configure analog pins to -1 value
Commit 6f5f2a3b incorrectly altered the analog mux pin config.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-10-26 11:33:30 -04:00
Kevin O'Connor 6f5f2a3bc7 tmc_uart: Make sure to set analog mux pins after a restart
Don't assume the analog mux pins are in a low state at startup.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-10-24 22:00:58 -04:00
Arksine dd12c981ef temperature_fan: add get_status() function
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2019-10-22 22:10:13 -04:00
Arksine d85b395a9c bed_mesh: fix error reporting
Fix invalid string formatting in the parse_pair() helper.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2019-10-22 22:09:33 -04:00
Geoff Shannon 789659599c adc_temperature: add support for AD849x thermocouple amplifiers (#1994)
Signed-off-by: Geoff Shannon <geoffpshannon@gmail.com>
2019-10-10 20:11:34 -04:00
Kevin O'Connor 6d7d079bab tuning_tower: Only cancel tuning tower test if extrude at notably lower z
Some print start scripts may extrude at a position slightly higher
than the first z layer height.  Tweak the backwards z test to reduce
the chance of the tuning test ending prematurely.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-10-04 20:10:12 -04:00
Master92 2b553a8108 safe_z_home: Fix unintended change in default behavior
PR #1970 introduced a new parameter, controlling the default behavior of the safe_z_home-module. To avoid unexpected changes, the default of the move_to_previous is now defaulted to False.

Signed-off-by: Nils Friedchen <Nils.Friedchen@googlemail.com>
2019-10-03 18:06:08 -04:00
Jason S. McMullan 7605244fa0 safe_z_home: Fix issue where 'home_xy_position: 0,0' did not position at 0,0
If '[stepper_x]' and/or '[stepper_y]' have a 'position_min' that is
non-zero, and '[safe_z_home] home_xy_position' is '0,0'; then the 'G28'
command will _not_ move to '0,0'; but stay at 'position_min' during the
Z endstop test.

This fix corrects this issue.

Signed-off-by: Jason S. McMullan <jason.mcmullan@gmail.com>
2019-10-03 18:05:21 -04:00
Nicholas Seckar 004edb9613 fan: Add off_below option for fans (#1897)
Below off_below the fan will be turned off. When configured correctly this
can prevent stalling, which may lead to overheating and failed fans. To
simplify calibration and use of this setting, off_below is applied in the
input duty cycle domain, prior to any scaling due to e.g. max_power.

Signed-off-by: Nicholas Seckar <nseckar@gmail.com>
2019-10-03 17:59:03 -04:00
Kevin O'Connor 698159921f tuning_tower: Tool for tuning parameters based on print Z height
This adds a testing tool that can run a command on each Z layer of a
print.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-10-01 14:46:24 -04:00
Julien Lirochon 0c247e55e6 probe: Add range to probe accuracy results (#2015)
Signed-off-by: Julien Lirochon <julien@lirochon.net>
2019-09-29 16:56:46 -04:00
Kevin O'Connor 9fcd3e75cd toolhead: Fix velocity jumps in accel_to_decel lookahead processing
When reducing the maximum speed due to the max_accel_to_decel setting,
move velocity limits must still be propagated.  Otherwise, the
trapezoid move planner may produce moves with velocity jumps.

Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-09-26 11:10:36 -04:00
Petri Honkala f8f0c3f142 z-tilt: Unresolved symbol fixed
Signed-off-by: Petri Honkala <cruwaller@gmail.com>
2019-09-24 12:17:03 -04:00
Piotr Usewicz a92bdf1d54 gcode_arcs: Use is operator for Null comparison (#1989)
Signed-off-by: Piotr Usewicz <piotr@layer22.com>
2019-09-23 16:49:52 -04:00
Piotr Usewicz 6b2b8f31ee gcode_arcs: Remove unused variables (#1988)
Signed-off-by: Piotr Usewicz <piotr@layer22.com>
2019-09-23 16:49:17 -04:00
achmed20 fce98c5519 gcode_arcs: use z-height defined in f2/3 code, if present
Signed-off-by: Aleksej Vasiljkovic <achmed21@gmail.com>
2019-09-18 11:57:16 -04:00
Kevin O'Connor 8c69e1bcfe gcode: Allow M105 to produce output if called from a macro
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-09-18 09:58:16 -04:00
Master92 3a37d4a208 safe_z_home: Hop only if necessary and add option to move xy back
Once a hop is performed, it will only be re-issued if the z-axis has been
moved in the meantime. Usually it is only moved by a z-homing so doing so
will cause safe_z_home to do the hop on the next homing action.

When z-axis is homed, x and y positions are known. When setting this
boolean option, these are set back to their last positions.

Whenever a hop is specified it is re-issued after the Z axis has been
homed. This is especially necessary when a pressure-based probe is used.
Also, the module decides if a hop is necessary, based on either a known
Z position or a flag that is set whenever the motors are disabled.

Signed-off-by: Nils Friedchen <Nils.Friedchen@googlemail.com>
2019-09-18 09:37:33 -04:00
John Jardine 020ca5ac2c samd_sercom: fix pin enumeration error when mcu is specified
Previously, when a sercom pin specified the mcu (myname:PIN), it would result in a pin enumeration error.

Signed-off-by: John Jardine <john@gprime.net>
2019-09-17 13:28:57 -04:00
Master92 fd2f17f847 controller_fan: Replace else followed by single if with elif
Signed-off-by: Nils Friedchen <Nils.Friedchen@googlemail.com>
2019-09-17 11:52:03 -04:00
Master92 4e09cacece controller_fan: Use keyword arguments to improve readability
Signed-off-by: Nils Friedchen <Nils.Friedchen@googlemail.com>
2019-09-17 11:52:03 -04:00
Master92 4fab93a8b0 controller_fan: Use snake-case for all variables and function-names
Signed-off-by: Nils Friedchen <Nils.Friedchen@googlemail.com>
2019-09-17 11:52:03 -04:00
Master92 6333dc2069 controller_fan: Use _ to declare discarded return value
Signed-off-by: Nils Friedchen <Nils.Friedchen@googlemail.com>
2019-09-17 11:52:03 -04:00
Master92 6250157397 controller_fan: Declare instance-attribute in __init__
Signed-off-by: Nils Friedchen <Nils.Friedchen@googlemail.com>
2019-09-17 11:52:03 -04:00
Kevin O'Connor 43103929e3 temperature_fan: Allow min_speed to be set to zero
Reported by @meteyou.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-09-14 15:35:09 -04:00
Kevin O'Connor 63311b2348 bltouch: Improve handling of low pin_move_time configuration
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-09-14 15:16:26 -04:00
Aleksej Vasiljkovic 7d8c70363a gcode_arcs: Add support for G2/G3 commands
R Still missing, also might be somewhat dirty since code is converted
into G1 commands.

Signed-off-by: Aleksej Vasiljkovic <achmed21@gmail.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-09-13 11:57:54 -04:00
Arksine 49779f13a2 filament_switch_sensor: Add a delay between dispatch of pause and execution of pause gcode
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2019-09-08 20:42:43 -04:00
Julien Lirochon 12feb6d7fb configfile: Fix the exception raised when an included file is missing (#1931)
Signed-off-by: Julien Lirochon <julien@lirochon.net>
2019-09-01 18:28:18 -04:00
Kevin O'Connor 05edd556c3 toolhead: Fix homing moves not apply kinematic acceleration limits
During a "drip feed" move, both the move's maximum speed and maximum
acceleration may be limited by the kinematics.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-09-01 18:21:05 -04:00
Kevin O'Connor 296ab7d402 klippy: Warn if starting klippy with logging disabled
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-09-01 18:09:20 -04:00
Kevin O'Connor 1b454c0943 mcu: Prevent "math domain errors" in stats calculation
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-08-30 13:57:07 -04:00
Kevin O'Connor a67451fa36 console: Update for PinResolver changes
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-08-19 23:52:02 -04:00
Kevin O'Connor b4280fdfe0 board_pins: Improve config error checking
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-08-19 21:58:11 -04:00
Kevin O'Connor bfbcb90751 board_pins: Add a new "extras" module to support per-board pin aliases
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-08-19 12:57:59 -04:00
Kevin O'Connor 395429be14 pins: Move reserved pin handling into PinResolver class
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-08-19 12:57:59 -04:00
Kevin O'Connor a482ddf582 tmc2209: Add support for sensorless homing
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-08-19 12:05:09 -04:00
Kevin O'Connor 96fdb6ef36 uc1701: Add support for a reset line on SSD1306 displays
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-08-17 22:14:02 -04:00
Kevin O'Connor 05bb5484b4 bus: Add MCU_bus_digital_out helper class
Add a helper class for tracking gpio outputs that are synchronized to
bus updates on a particular command queue.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-08-17 22:14:02 -04:00
Kevin O'Connor a3980cebcc neopixel: Add support for WS2811 RGB pixel color order
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-08-09 20:58:49 -04:00
Florian Heilmann 3d38211b8a extra: Add Safe Z home extra
Signed-off-by: Florian Heilmann <Florian.Heilmann@gmx.net>
2019-08-09 20:49:17 -04:00
Florian Heilmann f958542ebb kinematics: Add get_status() method to kinematics
Signed-off-by: Florian Heilmann <Florian.Heilmann@gmx.net>
2019-08-09 20:49:17 -04:00
Kevin O'Connor 8c5fc1688a pins: Add arduino aliases for Adafruit Grand Central board
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-08-09 20:15:40 -04:00
Kevin O'Connor f6d1ab2ea2 neopixel: Rework timing so that it works on AVR micro-controllers
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-08-07 15:37:05 -04:00
Kevin O'Connor 9445e1d555 dotstar: Allow any number of chips to be daisy chained
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-08-06 22:49:05 -04:00
Kevin O'Connor 115b888106 neopixel: Use low priority for LED updates
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-08-06 22:25:26 -04:00
Kevin O'Connor 4c09d8bf02 dotstar: Initial support for "dotstar" LEDs
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-08-06 19:44:32 -04:00
Kevin O'Connor c2a08962b7 spicmds: Rework spi config commands
Rework the spi_config commands so that bus configuration and shutdown
message configuration is done separately from the main "config_spi"
command.  This makes the spi configuration more flexible.  It's now
possible to use software spi without a CS pin.  It's now possible to
define multiple SPI messages to send on a shutdown event.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-08-06 18:56:53 -04:00
Kevin O'Connor c356e8362d tmc_uart: Make sure address is at least 0
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-07-31 13:13:27 -04:00
Kevin O'Connor a730aec8bc tmc_uart: Add support for configuring the uart address on tmc2209 chips
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-07-31 13:02:27 -04:00
fess 79cec9ba5c menu: use MOVE=1 for offset_z menu
use SET_GCODE_OFFSET's MOVE=1 parameter in the z offset menu.
Less confusing for people who think nothing happened.

Signed-off-by: John "Fess" Fessenden <fess@fess.org>
2019-07-31 11:17:31 -04:00
Kevin O'Connor a878831d5e mcp4728: Update to better match printrbot revf requirements
Reported by @Grumps49.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-07-26 11:02:56 -04:00
Kevin O'Connor 46041f5411 neopixel: Add support for daisy-chained chips
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-07-23 21:59:38 -04:00
Kevin O'Connor abf3fa4b71 neopixel: Add support for setting a default color at startup
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-07-23 21:59:38 -04:00
Kevin O'Connor 1fcfff2ac6 tmc_uart: Remove references to the TMC2208 in the generic UART code
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-07-21 09:39:07 -04:00
Kevin O'Connor bf23302918 toolhead: No need to build entire look-ahead queue before homing
It's not necessary to fully build up the look-ahead queue prior to
starting a "drip move" homing operation.  Instead, allow the
look-ahead queue to flush normally.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-07-18 10:50:04 -04:00
Kevin O'Connor e3c5638147 neopixel: Warn that the neopixel isn't currently supported on AVR
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-07-17 16:54:47 -04:00
Kevin O'Connor d5cc2a7b7b neopixel: Improve timing of gpio bit-banging
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-07-17 16:36:28 -04:00
Kevin O'Connor be2d0abbab neopixel: Optimize the update loop
Optimize the transmit code so it can run on some slower ARM cpus.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-07-12 23:39:00 -04:00
Kevin O'Connor b7bc96c3b2 neopixel: Add initial support for "neopixel" leds
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-07-12 21:44:01 -04:00
Kevin O'Connor 977d0cf711 toolhead: Delay calculating homing print_time until ready to move
If the homing move is exceptionally long, it could take a long time
for the host to process the look-ahead queue.  Delay the print_time
calculation until moves are ready to be sent.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-07-12 13:52:33 -04:00
Kevin O'Connor bc78bc4864 replicape: Try to detect shift register spi on spidev2.1
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-07-12 11:39:14 -04:00
Kevin O'Connor 28aa2f507a endstop: Rename mcu end_stop commands to endstop
Rename the commands.

The main reason for this change is to force a micro-controller code
updated (due to important bugfix in 7fefe52d).

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-07-12 08:10:53 -04:00
Kevin O'Connor 0343d0c73a firmware_retract: Remove z_hop support
The current z_hop support did not work correctly with common slicers
that change Z height between retract and unretract, and it did not
work correctly with slicers that issue a retract at the end of a print
and then at the beginning of the next print.

The z_hop support is therefore being removed until these issues can be
fixed.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-07-10 19:25:56 -04:00
Kevin O'Connor 364c22fe84 probe: Rework the PROBE_ACCURACY command parameters
Don't default to a Z location of 10, as that could cause damage if the
probe's z_offset is greater than 10.  Instead, use the "retract
distance" method that is used for normal multi-sample probing.

Update the PROBE_ACCURACY command parameter names to use the same
parameter names as the PROBE command.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-07-10 15:21:09 -04:00
Kevin O'Connor c3fe3d0d2c stepcompress: Remove no longer needed stepcompress_set_homing()
Now that homing is implemented via "drip moves", it is no longer
necessary for the stepcompress code to have special homing logic.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-07-10 10:43:20 -04:00
Kevin O'Connor 07e8925e08 toolhead: Remove no longer needed reset_print_time()
Now that homing is implemented via "drip moves", it is no longer
necessary to move the print_time backwards.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-07-10 10:43:20 -04:00
Kevin O'Connor dd34768e3a homing: Remove no longer needed homing time delay code
Now that homing is implemented via "drip moves", it is no longer
necessary to round the homing speed and it is no longer necessary to
add a delay for cpu processing time.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-07-10 10:43:20 -04:00
Kevin O'Connor 43064d197d homing: Implement homing via new toolhead "drip" movement
Rework the low-level implementation of homing movement.  The existing
mechanism buffers all homing movement into the micro-controller prior
to starting the home.  Replace with a system that buffers all movement
into the host look-ahead buffer and then "drip feed" those moves to
the micro-controllers.  Then clear the host look-ahead buffer when all
endstops trigger.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-07-10 10:43:20 -04:00
Kevin O'Connor d6cce8a557 toolhead: Change the code to use more explicit state transitions
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-07-10 10:43:20 -04:00
Kevin O'Connor 84be96aeff mcu: Rework home_wait() to use a reactor completion
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-07-10 10:43:20 -04:00
Kevin O'Connor 4f6982c4d0 serialhdl: Update SendWithRetry to use reactor completions
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-07-10 10:43:20 -04:00
Kevin O'Connor 233da97b19 reactor: Add support for "completions"
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-07-10 10:43:20 -04:00
Kevin O'Connor e148dbe52a mcu: Use regular send_with_response() for query_endstop()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-07-10 10:43:20 -04:00
Kevin O'Connor a116fa9054 serialhdl: Use register_response() for both registering and unregistering
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-07-10 10:43:20 -04:00
Kevin O'Connor b2c778b931 mcu: Integrate query_endstop_wait() into query_endstop()
There is no need to have two separate calls to query an endstop.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-07-10 10:43:20 -04:00
Arksine d4d8bf795b filament_switch_sensor: add SET_FILAMENT_SENSOR gcode
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2019-07-10 09:57:46 -04:00
Arksine 856b22b387 filament_switch_sensor: postfix M400 to script
Finish Moves needs be a hard requirement for the event gcodes, as it eliminates the possiblility of an event firing while the gcode is executing.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2019-07-10 09:57:46 -04:00
Arksine 893c98ed1b filament_switch_sensor: remove stale _hande_ready call in the BaseSensor
The toolhead attribute is no longer required by the BaseSensor class

Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2019-07-10 09:57:46 -04:00
Arksine 0f1d42466b buttons: initialize mcu buttons based on inverted state
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2019-07-05 20:01:07 -04:00
Arksine 314b9654c6 delayed_gcode: initial implementation
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2019-07-01 11:09:30 -04:00
Janar Sööt ec34d78d5e gcode_macro: add iterator to status wrapper
It really helps to see a snapshot of available printer variables when building menus and macros. The list of variables always depends on what printer config you have.

Signed-off-by: Janar Sööt <janar.soot@gmail.com>
2019-07-01 10:59:13 -04:00
Arksine 0c379d060f skew_correction: add SKEW_PROFILE gcode
Add profile managment similar to that of bed_mesh.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2019-06-29 10:58:46 -04:00
Arksine 026752e399 skew_correction: Add SET_SKEW gcode
This moves skew_correction configuration out of printer.cfg.   It is now dynamically set by the SET_SKEW gcode.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2019-06-29 10:58:46 -04:00
Kevin O'Connor 4df78cd843 tmc: Configure "intpol" field from TMCMicrostepHelper
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-28 16:59:26 -04:00
Kevin O'Connor a2e550d1cd stepper: Add support for providing a list of pins to enable
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-28 16:59:26 -04:00
Kevin O'Connor 7702f0a027 tmc: Add support for virtual enable pins
Add support for enabling the stepper via the communication channel.
This improves support for boards with a shared enable line.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-28 16:59:26 -04:00
Kevin O'Connor 041831f93a tmc_uart: Hold a mutex during MCU_TMC_uart get/set_register()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-28 16:59:26 -04:00
Kevin O'Connor 844dca9c6e tmc2660: Hold a mutex during MCU_TMC2660_SPI get/set_register()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-28 16:59:26 -04:00
Kevin O'Connor 1f3b74d2f7 tmc2130: Hold a mutex during MCU_TMC_SPI get/set_register()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-28 16:59:26 -04:00
Arksine 35a45e2446 pause_resume: add CLEAR_PAUSE gcode
Allow the user to clear the pause state without restoring  position.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2019-06-28 12:44:49 -04:00
Kevin O'Connor 505e96b7ed klippy: Only set the run_result if it hasn't already been set
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-28 10:21:50 -04:00
Kevin O'Connor e5f74a64ed polar: Add initial support for multiple bed rotations
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-28 10:00:40 -04:00
Arksine b37222e3a1 skew_correction: initial implementation
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2019-06-26 20:16:35 -04:00
Arksine 2d7f32584f gcode: Add support for stacked transforms
Add method from pull request #1243 to support stacked transforms.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2019-06-26 20:16:35 -04:00
Kevin O'Connor 9855354c75 tmc_uart: Use print_time=None as default (not print_time=0)
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-25 18:27:59 -04:00
Kevin O'Connor 4aeb7d38a7 sx1509: Minor cleanup - don't default print_time to 0
It's not valid to use a print_time=0, and it isn't actually used in
the sx1509 code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-25 18:19:05 -04:00
Kevin O'Connor 6ec7dee07d tmc: It's not valid to schedule messages with print_time=0
A print_time of zero may translate to a negative clock on a secondary
micro-controller, which would cause an internal error.  Change the
code to pass a real print_time or None if it is not needed.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-25 18:19:05 -04:00
Kevin O'Connor 52b5ca182c tmc: Simplify internal DUMP_TMC interface
Only the tmc2208 driver needs special read register translation logic.
Rework the code so a default implementation is available for all the
other drivers.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-25 11:40:15 -04:00
Kevin O'Connor 4fb4a13fd7 endstop_phase: Add tmc2209 and tmc5160 to list of tmc drivers
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-23 11:27:18 -04:00
Stephan Oelze ec9fad758a tmc2209: Initial support for tmc2209 stepper driver
Signed-off-by: Stephan Oelze <stephan.oelze@gmail.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-23 11:26:20 -04:00
Kevin O'Connor 80194a7e18 endstop_phase: Fix endstop_phase on trinamic drivers that aren't inverted
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-21 22:56:16 -04:00
Kevin O'Connor 0b02d7a1f2 tmc_uart: Support print_time in set_register()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-21 21:47:37 -04:00
Kevin O'Connor 9feb05ce41 mcu: Support minclock in send_with_response() requests
Enhance send_with_response() so that it supports queries with a
minclock.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-21 21:42:20 -04:00
Kevin O'Connor e202a8802b mcu: Move SerialCommand from serialhdl.py to mcu.py
Move the serial command wrapper class from serialhdl.py to mcu.py.
This will allow that class to better support higher level
functionality.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-21 21:42:20 -04:00
Kevin O'Connor cc3666aa78 serialhdl: Introduce SerialReader.send_with_response()
Introduce a main send_with_response() helper function and use it
during identify and the setup of clocksync.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-21 21:42:20 -04:00
Kevin O'Connor d98bbc772c serialhdl: Eventually timeout connect attempt
If the serial connection has not been successful after 2.5 minutes
then report an error.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-21 21:42:20 -04:00
Kevin O'Connor ebb375fee9 serialhdl: Use send_with_response() to query identify data
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-21 18:48:33 -04:00
Kevin O'Connor 461ed4cb80 serialhdl: Add a get_msgparser() method
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-21 18:14:00 -04:00
Kevin O'Connor 647f1ee2e0 serialhdl: Rename register_callback() to register_response()
Rename the method and use that name in the mcu class as well.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-21 18:14:00 -04:00
Alec B. Plumb daadb36cb4 gcode_button: Execute gcode when a button is pressed or released (#1745)
An extra to execute gcode when a hardware button is pressed or released. Uses the jinja2 templating system.

Inspired by pull request #545 from Miguel Moitinho miguel@moitinho.net and pull request #1098 from Paulo Drugos paulodrugos@gmail.com

Signed-off-by: Alec Plumb <alec@etherwalker.com>
2019-06-21 18:06:31 -04:00
Kevin O'Connor 83e6c01ada probe: Allow probe parameters to be specified as g-code parameters
Add PROBE_SPEED, SAMPLES, SAMPLE_RETRACT_DIST, SAMPLES_TOLERANCE,
SAMPLES_TOLERANCE_RETRIES, and SAMPLES_RESULT parameters to the PROBE
command (and to commands that indirectly invoke a probe).

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-21 14:44:28 -04:00
Kevin O'Connor c92aca74b5 probe: Add support for samples_tolerance
Add a check on the maximum Z distance between probe samples.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-21 14:06:20 -04:00
Kevin O'Connor f6e9db2d05 toolhead: Just warn if M204 doesn't contain valid S, P, or T
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-21 12:53:47 -04:00
Kevin O'Connor 98915fb1d0 probe: Always return just x,y,z from _probe()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-21 11:04:55 -04:00
Kevin O'Connor 077c6f7e5e reactor: Fix some corner cases with self._next_timer handling
Make sure to update self._next_timer on greenlet start/stop.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-19 21:12:34 -04:00
Kevin O'Connor 0173bb3f71 tmc_uart: Move UART code from tmc2208.py to new file tmc_uart.py
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-18 18:06:05 -04:00
Kevin O'Connor 3f79831485 tmc2208: Make sure each analog mux config is unique
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-18 17:58:20 -04:00
Kevin O'Connor 274857357e tmc: Retry register init during connect
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-18 17:54:02 -04:00
Kevin O'Connor cfdb60ca23 tmc2660: Set SDOFF=0 before accessing DRVCTRL
Make sure to configure DRVCONF with SDOFF=0 prior to writing DRVCTRL
as that field controls access to that register.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-18 15:19:05 -04:00
Kevin O'Connor 587db5c315 tmc2660: Don't allow configuration of DEDGE
Setting DEDGE would just break the code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-18 13:24:54 -04:00
fess 49c36f868b z_tilt: Support retries
Support retrying Z_TILT_ADJUST a configurable number of times
to a configurable tolerance both in the config or as parameters.

- By default keeps original behavior of no retries.
- Adds parameters RETRIES and RETRY_TOLERANCE to QUAD_GANTRY_LEVEL gcode.
- adds config options retries and retry_tolerance to uad_gantry_level]
- issues an error if we are getting worse intead of approaching tolerance
- issues an error if retries were requested but we did not reach the tolerance
in the specified number of retries

the minimum change should  be a single z step for those
probing 2 points for 2 stepper motors and 3 for 3 stepper motors.

at one point it was suggested to use the amount of z adjustment instead of the
range of the probed points as a trigger for retry. I've chosen not to do this.
using z adustment in these cases means the minimum unit of change is related to
the angle created by the probed points  and the distance to stepper motor and
can be more than a couple steps which is rather unintuitive.

for the case when someone is using more probed points than z steppers the
probed points range will have some fixed minimum value that can't be reduced
which is also unintuitive but that case should idealy be the rarer case, and
the user can learn to set a higher tolerance that matches their probing setup.

Signed-off-by: John "Fess" Fessenden <fess@fess.org>
2019-06-18 12:12:25 -04:00
fess bd40690bd1 quad_gantry_level: Support retries
Support retrying QUAD_GANTRY_LEVEL a configurable number of times
to a configurable tolerance both in the config or as parameters.

- By default keeps original behavior of no retries.
- Adds parameters RETRIES and RETRY_TOLERANCE to QUAD_GANTRY_LEVEL gcode.
- adds config options retries and retry_tolerance to `[quad_gantry_level]`
- issues an error if we are getting worse intead of approaching tolerance
- issues an error if retries were requested but we did not reach the tolerance
in the specified number of retries

Signed-off-by: John "Fess" Fessenden <fess@fess.org>
2019-06-18 12:12:25 -04:00
fess 4681775219 z_tilt: Add RetryHelper
add RetryHelper class in prep for implementing retries for both z_tilt
and quad_gantry_level

Signed-off-by: John "Fess" Fessenden <fess@fess.org>
2019-06-18 12:12:25 -04:00
Kevin O'Connor bdf5898891 probe: Allow retries from ProbePointsHelper
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-18 12:12:25 -04:00
Kevin O'Connor 20d0bb8354 config: Update tmc5160 block in example-extras.cfg
List all the configurable parameters in the tmc5160 example block and
use similar wording as the other tmc drivers.

Also, don't allow DEDGE to be configured as it would just break the
current code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-18 09:41:27 -04:00
Kevin O'Connor 494a5b732d quad_gantry_level: Use new ZAdjustHelper
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-17 11:17:47 -04:00
Kevin O'Connor 20851ab3e9 z_tilt: Separate z adjustment code to new ZAdjustHelper class
Introduce a new class to perform the low-level Z stepper adjustments.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-17 11:17:47 -04:00
Kevin O'Connor f6864da58b tmc2208: Add support for using an analog mux to access TMC uarts
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-12 22:14:41 -04:00
Kevin O'Connor 88fe2787a9 tmc2208: Separate low-level bit-banging code from MCU_TMC_uart class
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-12 22:06:54 -04:00
Kevin O'Connor 47901e57c9 verify_heater: Don't raise a heater error if the heater is off
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-12 22:06:54 -04:00
Kevin O'Connor 82b58e46a7 temperature_fan: Remove executable flag from temperature_fan.py
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-10 14:30:48 -04:00
Kevin O'Connor b21a22d744 tmc: Move common TMC stepper driver code to new file tmc.py
Move common code from tmc2130.py to tmc.py.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-10 14:29:35 -04:00
Kevin O'Connor 10c0da9a6c tmc2130: Rework remaining config helpers to use mcu_tmc interface
Introduce TMCMicrostepHelper and TMCStealthchopHelper helper code that
uses the mcu_tmc interface.  Update the callers to use these new
helpers.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-10 14:18:58 -04:00
Kevin O'Connor 7f34264101 tmc2130: Move TMC virtual endstop code into a new TMCEndstopHelper class
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-10 14:18:58 -04:00
Kevin O'Connor 35edc4d63c tmc2660: Move current setting code to its own helper class
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-10 14:18:58 -04:00
Kevin O'Connor b2729f38a6 tmc5160: Move current setting code to its own helper class
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-10 14:18:58 -04:00
Kevin O'Connor 110bbb3843 tmc2130: Move current setting code to its own helper class
Concentrate the current setting code into its own TMCCurrentHelper
class.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-10 14:18:58 -04:00
Kevin O'Connor 6abe132cf0 tmc2130: Transmit register initialization during connect callback
Perform the register initialization directly from TMCCommandHelper and
perform it during the "connect" phase.  This unifies the register
setup for the TMC2130, TMC2208, TMC2660, and TMC5160.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-10 14:18:58 -04:00
Kevin O'Connor 6947548c17 tmc2660: Use TMCCommandHelper
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-10 14:18:58 -04:00
Kevin O'Connor c76428bd01 tmc5160: Use TMCCommandHelper
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-10 14:18:58 -04:00
Kevin O'Connor 1bdd51d575 tmc2208: Use TMCCommandHelper
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-10 14:18:58 -04:00
Kevin O'Connor 395c845ca1 tmc2130: Factor out g-code command handlers to their own class
Create a TMCCommandHelper class that implements INIT_TMC,
SET_TMC_FIELD, and DUMP_TMC.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-10 14:18:58 -04:00
Kevin O'Connor 6a7ddb6bf0 tmc2208: Move get/set_register functions to new MCU_TMC_uart class
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-10 14:18:58 -04:00
Kevin O'Connor ab710cd4de tmc2660: Move get/set_register functions to new MCU_TMC2660_SPI class
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-10 14:18:58 -04:00
Kevin O'Connor a122d113e8 tmc5160: Use tmc2130.MCU_TMC_SPI for low-level get/set_register access
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-10 14:18:58 -04:00
Kevin O'Connor 3becc6cf54 tmc2130: Move low-level get/set_register functions to new MCU_TMC_SPI class
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-10 14:18:58 -04:00
Kevin O'Connor 9ce98fd769 tmc2660: Define get_register() method
Use a get_register() method instead of get_response().  This makes the
tmc2660 class more similar to other TMC drivers.  It also enables
DUMP_TMC to dump all the readable content.

Also, use the tmc2130.get_config_microsteps() helper.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-10 14:18:58 -04:00
Kevin O'Connor 2b0251ee99 tmc5160: Rename registers to Registers and fields to Fields
Minor change to the code so that it is more similar to the other tmc
drivers.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-10 14:18:58 -04:00
Kevin O'Connor 5de9f74525 test: Add test cases for tmc drivers
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-10 14:18:58 -04:00
Kevin O'Connor 97840f9851 serialhdl: Use reactor mutex in send_with_response()
Reduce the delay in send_with_response() by introducing a reactor
mutex to wake the main thread when the response is obtained.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-09 19:12:24 -04:00
Kevin O'Connor 30d2ae8f9f gcode: Eliminate the process_batch() method
Allow the callers of process_batch() to directly inspect the gcode
mutex.  Those callers can then directly invoke run_script().

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-09 18:44:44 -04:00
Kevin O'Connor 962f7b98bd gcode: Convert input handling to use a reactor mutex
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-09 18:44:44 -04:00
Kevin O'Connor afc10400e3 reactor: Be explicit on which handlers are timer_handler vs file_handler
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-09 18:44:44 -04:00
Kevin O'Connor 0546c18d27 reactor: Add support for mutexes
Add a mutex object that implements simple queing mutual exclusion for
greenlets.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-09 12:55:56 -04:00
Kevin O'Connor 61fc57e659 toolhead: Commands should still pause even when sync_print_time
If commands are slowly fed to the printer it could cause the number of
queued commands to grow without bound.  Be sure to pause the incoming
command stream even if the lookahead queue is empty.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-09 12:35:54 -04:00
Kevin O'Connor d7754a8f93 homing_override: Pass params to template evaluation
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-09 11:14:31 -04:00
Kevin O'Connor 8b00580884 gcode_macro: Parse variable_X parameters using ast.literal_eval()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-07 19:33:31 -04:00
Kevin O'Connor 01f3b50e73 idle_timeout: Fix typo causing get_status() to fail
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-07 12:30:42 -04:00
Kevin O'Connor f1c6d04376 filament_switch_sensor: Use template evaluation on gcode
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-07 11:38:43 -04:00
Kevin O'Connor d0be48da74 filament_runout_sensor: Auto load pause_resume module if pause_on_runout enabled
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-07 11:38:43 -04:00
Kevin O'Connor 3f4190c792 idle_timeout: Use template evaluation on gcode
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-07 11:38:43 -04:00
Kevin O'Connor e60ee861f8 extruder: Use template evaluation on gcode
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-07 11:38:43 -04:00
Kevin O'Connor 27ca159285 gcode_macro: Add a default parameter to load_template
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-07 10:51:57 -04:00
Kevin O'Connor cacb6f4378 klippy: Provide global access to a printer.command_error exception class
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-06 10:22:14 -04:00
Kevin O'Connor 49a3083d6a manual_probe: Add extra checks to catch manual probe not finishing correctly
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-06 10:08:58 -04:00
Kevin O'Connor 40f73dd7f4 probe: Check for toolhead movement during activate/deactivate_gcode scripts
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-06 10:08:58 -04:00
Kevin O'Connor df80d96ae6 manual_probe: No need to re-raise an EndstopError
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-06 10:08:58 -04:00
Kevin O'Connor b8c7eb40c5 bed_screws: No need to re-raise an EndstopError
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-06 10:08:58 -04:00
Kevin O'Connor 1fd490ddf9 probe: No need to re-raise an EndstopError
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-06 10:08:58 -04:00
Kevin O'Connor 67964e71f1 homing: Catch the more generic CommandError during homing
Allow the low-level homing code to raise either a gcode.error or an
EndstopError during a fault.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-06 10:08:58 -04:00
Kevin O'Connor e9935e1a41 gcode: No need to re-raise an EndstopError
Now that EndstopError and gcode.error use the same underlying
Exception object, it is no longer necessary to translate an error.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-06 10:08:58 -04:00
Kevin O'Connor 945a84c0ea gcode: Use the same underlying error object for homing and gcode errors
Introduce a homing.CommandError and use that as the basis for both
gcode and EndstopError exceptions.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-06 10:08:58 -04:00
Kevin O'Connor 15011012e5 probe: Simplify ProbePointsHelper start and end tracking
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-06 10:08:58 -04:00
Kevin O'Connor bbc8637ed6 probe: Be sure to call gcode.reset_last_position() after any manual move
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-06 10:08:58 -04:00
Kevin O'Connor 74cc005ff3 probe: Unify mean and median code between run_probe() and PROBE_ACCURACY
Factor out _calc_mean() and _calc_median() functions and call from
both run_probe() and cmd_PROBE_ACCURACY().

This also fixes a subtle error in the run_probe() median function - on
some kinematics the x and y position can change on a z move so the x
and y should be taken from the z probe values actually used.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-06 10:08:58 -04:00
Kevin O'Connor 2b8dca5dbf probe: Move multi-sampling capability from ProbePointsHelper to Probe
This changes the config file so that the configuration of
multi-samples is now done in the [probe] (and [bltouch]) section
instead of the various delta, bed_mesh, z_tilt, etc. config sections.

With this change, PROBE and PROBE_CALIBRATE commands now also utilize
multi-sampling.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-06 10:08:58 -04:00
Len Trigg 5989f7a8a6 firmware_retraction: Implementation of tuneable G10/G11 firmware retraction (#1617)
This supports getting and setting of retraction parameters without
having to restart klippy.

Signed-off-by: Len Trigg <lenbok@gmail.com>
2019-06-06 09:10:09 -04:00
Kevin O'Connor d065787afc gcode_macro: Add support "x in printer" to templates
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-04 12:41:28 -04:00
Kevin O'Connor 1c09a0935f idle_timeout: Add a get_status() method
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-04 12:35:50 -04:00
Kevin O'Connor 0bb714edd7 menu: Remove customized get_status overrides
Now that the extruder, display, heater_fan, output_pin, and servo
classes have get_status() methods, it is no longer necessary to
override them in the menu code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-04 11:55:40 -04:00
Janar Sööt df765b33dc display: add get_status method
Signed-off-by: Janar Sööt <janar.soot@gmail.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-04 11:51:46 -04:00
Janar Sööt 9155886c21 extruder: add get_status method
Signed-off-by: Janar Sööt <janar.soot@gmail.com>
2019-06-04 11:44:57 -04:00
Janar Sööt 94f5fb3553 servo: add get_status method
Signed-off-by: Janar Sööt <janar.soot@gmail.com>
2019-06-04 11:44:50 -04:00
Janar Sööt efecc96427 output_pin: add get_status method
Signed-off-by: Janar Sööt <janar.soot@gmail.com>
2019-06-04 11:44:35 -04:00
Janar Sööt e519ab2031 heater_fan: add get_status method
Signed-off-by: Janar Sööt <janar.soot@gmail.com>
2019-06-04 11:43:34 -04:00
Kevin O'Connor a68f577adf gcode_macro: Add support for SET_GCODE_VARIABLE command
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-04 09:50:30 -04:00
Kevin O'Connor 6e88320d62 gcode: "gcode_position" and toolhead "position" as get_status() named tuple
Add "gcode_position" named tuple to gcode.get_status(). Add a
"position" named tuple to toolhead.get_status().

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-04 09:50:30 -04:00
Kevin O'Connor 4ccc218b06 gcode: Add action_x() callables to get_status()
Add action_respond_info(), action_respond_error(), and
action_emergency_stop() callables to the get_status() return
dictionary.  This allows gcode macros to directly invoke these
actions.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-04 09:50:30 -04:00
Kevin O'Connor ac8f6dfe20 gcode_macro: Rename "status" helper to "printer"
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-04 09:50:30 -04:00
Arksine a238ec6f98 idle_timeout: Add SET_IDLE_TIMEOUT gcode
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2019-06-04 09:46:26 -04:00
Kevin O'Connor fe1c57b098 bed_screws: Be sure to call gcode.reset_last_position() after any manual move
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-03 13:43:49 -04:00
Arksine 05a04d5d3d pause_resume: Use Octoprint's "paused" and "resumed" action commands.
These action commands prevent Octoprint from sending extra gcodes that can interfere with Klipper's pause/resume control.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2019-06-02 19:19:32 -04:00
Arksine ca8233e6d5 pause_resume: use new save/restore gcodes to handle state
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2019-06-02 19:19:32 -04:00
Kevin O'Connor 89650a1e60 adc_temperature: Minor comment update
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-02 17:12:55 -04:00
Artem Belevich 72100bc1f2 tmc2130: Check field name validity. (#1697)
This avoids crashing Klipper if user entered invalid field name.

Signed-off-by: Artem Belevich <artemb@gmail.com>
2019-06-02 11:41:15 -04:00
Kevin O'Connor f96239019a mcu: Support a start value for soft pwm pins
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-02 10:59:33 -04:00
Kevin O'Connor 3e1c42da80 thermistor: Add support for printers with an "inline_resistor"
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-02 10:59:23 -04:00
Kevin O'Connor 02eeb72713 manual_probe: Verify no XY moves since start of manual probe
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-05-31 10:24:52 -04:00
Kevin O'Connor c54b8da530 gcode: Add support for SAVE_GCODE_STATE and RESTORE_GCODE_STATE commands
Add commands to save and restore the current g-code state.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-05-31 10:23:56 -04:00
Kevin O'Connor 6903ab87ca tmc2130: Add support for two's complement signed fields to FieldHelper
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-05-29 09:33:51 -04:00
Kevin O'Connor 2cff3291c0 gcode: Rename absolutecoord/extrude to absolute_coord/_extrude
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-05-26 21:00:15 -04:00
Kevin O'Connor 862b97ce8f gcode: Fix SET_GCODE_OFFSET MOVE_SPEED parameter
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-05-26 20:04:50 -04:00
Kevin O'Connor 423bbada84 gcode: Minor code change to M206 to make the math similar to SET_GCODE_OFFSET
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-05-26 12:37:14 -04:00
Kevin O'Connor d6b69938ab gcode: Don't apply the SET_GCODE_OFFSET to the next g-code command
The SET_GCODE_OFFSET command could cause unwanted behavior when an
offset is applied to the following g-code command.  (In particular,
when the following command is an extrude only move - as in
issue #1289.)

Don't apply the offset immediately.  Instead, add support for a MOVE=1
parameter which will schedule a move to apply the given offset.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-05-26 11:19:15 -04:00
Kevin O'Connor 7702cc2972 bltouch: Update command timing
Prior to the BLTouch v3, the recommended command times were 700us
(pin_down), 1200us (touch_mode), 1500us (pin_up), 1800us (self_test),
and 2200us (reset).  However, the recommended Marlin timing (via servo
"angles") was 647.111, 1162.667, 1472, 1781.333, and 2193.778us.

As of the BLTouch v3, the recommended times are now 650, 1165, 1475,
1780, and 2190us.  The v3 continues to recommended Marlin timings of
647.111, 1162.667, 1472, 1781.333, and 2193.778us.

Update Klipper to use the new BL-Touch v3 recommended timing.  The new
timings are required for the BL-Touch v3 and they are closer to what
the Marlin firmware has historically used.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-05-26 11:09:32 -04:00
Kevin O'Connor 8532e2123e gpiocmds: Specify soft pwm duration in clock ticks
Improve the precision of soft pwm pulses by allowing the host to
directly specify the clock duration of the pulse.  This improvement in
precision may be noticeable when controller servos (and bltouch).

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-05-26 11:09:32 -04:00
Kevin O'Connor 8cd8cb492e buttons: Minor code movement
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-05-26 00:18:48 -04:00
Kevin O'Connor 772ad53e20 manual_probe: Make sure the nozzle has moved during a manual probe
Make sure the TESTZ procedure is followed prior to accepting a manual
probe.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-05-24 22:54:35 -04:00
Kevin O'Connor 7792b0f2bb gcode: Store internal speed in mm/s
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-05-24 19:37:08 -04:00