Commit Graph

1270 Commits

Author SHA1 Message Date
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