Commit Graph

119 Commits

Author SHA1 Message Date
Kevin O'Connor 1e1364c3d4 mcu: Store the stepper position in the mcu_stepper class
Move the storage of the stepper location from the kinematic classes to
the low-level mcu_stepper class.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-11-19 11:34:42 -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 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 7ef8c0442a mcu: Remove support for DummyMCU class
It's easier to test with the file output mechanism and the DummyMCU
code has grown stale.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-11-16 12:09:26 -05:00
Kevin O'Connor 9ad8153d33 stepper: Reset the next step time on a stepper stop
Automatically reset the next step time to zero on a stepper_stop()
call.  This makes the host code simpler as it no longer needs to
schedule an explicit reset_step_clock command on the step after a
homing operation.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-11-14 13:10:14 -05:00
Kevin O'Connor 941427554a delta: Initial support for linear delta kinematics
This adds support for delta based robots.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-11-14 12:35:36 -05:00
Kevin O'Connor 7554c7f694 stepcompress: Do all step rounding in C code
Commits f0cefebf and 8f331f08 changed the way the code determined what
steps to take on fractional steps.  Unfortunately, it was possible in
some situations for the C code to round differently from the python
code which could result in warnings and lost steps.

Change the code so that all fractional step handling is done in the C
code.  Implementing the step rounding logic in one location avoids any
conflicts.

In order to efficiently handle the step rounding in the C code, the C
code has also been extended to directly send the "set_next_step_dir"
command.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-11-13 18:29:45 -05:00
Kevin O'Connor 5e6127869a mcu: Do not invert the direction of pullup pins by default
A pullup setting on an input pin (ie, '^') should enable the hardware
pullup resistor, but it should not invert the trigger level (ie, it
should remain trigger on high).  Those that need to change the trigger
level (ie, trigger on low) must now do that explicitly (ie, '^!').
This makes the code match what other firmwares do.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-11-08 09:29:38 -05:00
Kevin O'Connor 2b7ab290b8 mcu: Remove python checks for stepcompress integer overflow
Now that the C code checks for overflow, it is no longer necessary for
the python code to check.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-11-02 13:22:35 -04:00
Kevin O'Connor ee56b14faa mcu: Fix endstop query timeout checking
Commit 0685802c changed the query endstop timeout to use host time
instead of the mcu clock.  However, it is possible for an endstop
homing request to be in the future which makes using the host time
inappropriate.  Revert back to using the mcu clock to determine when
to send an endstop query.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-10-11 00:21:24 -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 1bbcb51066 mcu: Write initial config commands when in file output mode
When doing serial file output debugging, write the config commands as
they are often useful to inspect.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-09-10 20:26:52 -04:00
Kevin O'Connor c5f50e73c2 mcu: Consistently use mcu_freq variable name (instead of clock_freq)
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-08-25 12:09:37 -04:00
Kevin O'Connor 7276c7085a mcu: Internally store _print_start_time instead of _print_start_clock
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-08-25 12:07:08 -04:00
Kevin O'Connor e52113a319 mcu: convert stepper, endstop, and digital_out to take mcu_time
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-08-24 16:42:25 -04:00
Kevin O'Connor 11ecac626d mcu: Convert PWM and ADC objects to take mcu_time instead of clock
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-08-24 15:16:02 -04:00
Kevin O'Connor 654546e338 stepper: Support stepper phase adjustments when homing
Add support for enhancing the precision of endstop switches by also
inspecting the phase of the stepper motor when the endstop triggers.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-07-28 11:22:28 -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