- Joined
- Dec 17, 2012
- Messages
- 630
You are going to be working like:
Get a couple pulses from the encoder (you need at least two to get a direction)
Move x number of steps (variable to the movement resolution) and possibly check limit switches between steps
Wait for more pulses to handle.
The number of steps you are servicing with the pulse is the tunable parameter. As an example, you can put it in inchworm mode and have to turn 10 full revolutions to get a step or in hyper-drive and move thousands of steps per pulse.
You need to allow yourself time to see and react to the movement. You are the control loop. If you lose pulses on the encoder, no biggie. In fact, you might want to wait a few pulses before moving just as a debounce.
The only acceleration was about the original idea of linking the speed of the encoder to the rate of movement. In this case, I think that would be problematic and require much more overhead.
Get a couple pulses from the encoder (you need at least two to get a direction)
Move x number of steps (variable to the movement resolution) and possibly check limit switches between steps
Wait for more pulses to handle.
The number of steps you are servicing with the pulse is the tunable parameter. As an example, you can put it in inchworm mode and have to turn 10 full revolutions to get a step or in hyper-drive and move thousands of steps per pulse.
You need to allow yourself time to see and react to the movement. You are the control loop. If you lose pulses on the encoder, no biggie. In fact, you might want to wait a few pulses before moving just as a debounce.
The only acceleration was about the original idea of linking the speed of the encoder to the rate of movement. In this case, I think that would be problematic and require much more overhead.