firmata/ConfigurableFirmata

Stepper motor library homing/limit capability

Closed this issue · 1 comments

From @FineLineAutomation on March 23, 2014 20:5

I have been looking over the stepper motor library and was wondering if there was a way to stop a motor movement based on on a digital input going low. I have 2 use cases:

  1. Using a stepper for position control you get to the end of physical motion and would like to put a limit switch in place that can stop the stepper.
  2. Performing a homing operation on a stepper controlled motion axis with

I could always perform #2 by bit banging everything from the PC, but would prefer to use a higher level command if necessary.

I also thought about just doing it in hardware and just having the limit switch trip the enable pin on the Big Easy driver I am using, but you would need some way to manually control re-enable that pin to get it to move off the switch.

Copied from original issue: firmata/arduino#124

There is currently no way to do this. However it makes me think it may be beneficial to add a 'stop' command to the stepper implementation. Then you could watch a digital input. Depending on the step speed you could potentially get one additional step by the time the digital input changes.