Commit Graph

171 Commits

Author SHA1 Message Date
Kevin O'Connor bc80ed4e88 mcu: Detect if the communication channel to the firmware is lost
Detect a comms loss and report it to the user.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-11-30 21:20:09 -05:00
Kevin O'Connor 5ebe8ce025 gcode: Don't dump the message log directly from set_printer_ready()
The set_printer_ready() method can be called from a background thread.
Have the main Printer class call a new dump_debug() method in the main
thread on a shutdown event.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-11-30 21:20:09 -05:00
Kevin O'Connor 524e0290bc klippy: Improve error reporting during connect
Catch exceptions during the connect phase and report them via the
gcode interface to the user.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-11-30 21:19:44 -05:00
Kevin O'Connor dbdf1e137e gcode: Support reading from gcode input before mcu is ready
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-11-30 21:19:43 -05:00
Kevin O'Connor 7e7e607e3f klippy: Create the /tmp/printer pseudo tty before opening config file
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-11-30 21:19:43 -05:00
Kevin O'Connor 5d805ba550 klippy: Run the MCU connect code within the reactor
Setup the reactor and run the MCU connection code as a timer within
the reactor.  The connection code will make use of reactor greenlets
so that it can wait for events during the connection phase.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-11-29 21:54:45 -05:00
Kevin O'Connor d161d66741 mcu: Handle adc initialization entirely in mcu code
Don't expose the ADC initialization to the gcode and heater code -
instead, register a callback within the MCU_adc class and call it
directly from the MCU class after configuration completes.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-11-29 18:21:56 -05:00
Kevin O'Connor 9755182adf homing: Check homing distance to verify endstop trigger after retract
Instead of checking the endstop trigger directly after a retract move,
verify some distance is traveled during the following homing
operation.  This reduces the amount of synchronization between mcu and
host during homing.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-11-28 11:23:26 -05:00
Kevin O'Connor e0aa067cc9 homing: Check for timeout during homing operation
Should a homing move complete without hitting the endstop, then
disable motors, disable the endstop checking, and report the error to
the user.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-11-18 14:17:53 -05:00
Kevin O'Connor 781cf608d7 homing: Create Homing class from gcode
Create the Homing class in the gcode handler instead of in the
kinematic classes.  This will make it easier to pass error messages
back to the user.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-11-18 14:04:09 -05:00
Kevin O'Connor 9e1059afb4 homing: Create QueryEndstops class from gcode
Create the QueryEndstops in the gcode handler instead of in the
kinematic classes.  This simplifies the gcode handler as it can
directly register its response callback.

Also, store the stepper name in the stepper class.  Also, propagate
the print_time of the query request to the mcu_endstop class.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-11-18 14:04:09 -05:00
Kevin O'Connor 3809e4c055 gcode: Reset current position after an endstop error
If the printer is commanded to an invalid location, reset the current
position to the last successfully commanded position.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-10-11 15:10:19 -04:00
Kevin O'Connor b53da365a1 cartesian: Enforce endstop min and max boundaries
Verify that each move command is within range of the configured
minimum and maximum for each axis.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-09-30 21:36:51 -04:00
Kevin O'Connor e9505697fb gcode: Keep a log of incoming gcode data and report it on a shutdown
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-09-30 21:27:46 -04:00
Kevin O'Connor 0685802cb8 homing: Support querying the current status of endstops
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-09-22 11:29:27 -04:00
Kevin O'Connor a7b81dc05c toolhead: Force a firmware shutdown on an unhandled exception
Check for unhandled exceptions and force the MCU to shutdown in that
case.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-09-22 11:15:17 -04:00
Kevin O'Connor 92f81d51f4 homing: Move low-level coordinate manipulation to kinematic class
Rework the code so that the kinematic class (currently just
cartesian.py) has more control over the homing process.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-07-25 23:47:30 -04:00
Kevin O'Connor e9c03f2e4a gcode: Error on G20 (set units to inches) command
Respond with an error to a G20 command (instead of effectively
ignoring the command).

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-07-25 22:46:11 -04:00
Kevin O'Connor af99ab1645 extruder: Create a new class and python file to track the printer extruder
Create a new python file (extruder.py) to control the extruder heater
and stepper motors.  This separates the extruder control logic from
the cartesian robot code - making it easier to customize both the
kinematic control of the robot as well as the extruder.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-07-10 22:49:02 -04:00
Kevin O'Connor 20ae4e5d98 cartesian: Rename CartKinematics class to ToolHead
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-07-10 22:47:13 -04:00
Kevin O'Connor f582a36e4d Initial commit of source code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-05-25 11:37:40 -04:00