Microstepping
Forums:
Was wondering if someone could provide an example of microstepping with the Python API?
Thanks,
Cary
- Log in to post comments

Was wondering if someone could provide an example of microstepping with the Python API?
Thanks,
Cary
piborg
Mon, 11/17/2014 - 16:01
Permalink
Microstepping with PicoBorg Reverse
To perform smaller steps you want to change the sequence to produce small changes per step instead of full ones.
If we start with the
pbrStepper.py
example provided we can build a microstepping sequence using sine and cosine.Firstly we need to add the
math
library to the imports:Next we remove the old stepping sequence (line 10):
We should add the voltages for driving the stepper in its place, and a microstep count.
The voltages need to be the voltage actually connected to the PicoBorg Reverse, and the voltage the stepper is meant to work at:
Next we calculate the maximum power output using the voltages:
Now we work out how the sine and cosine values for each position:
Finally we work out the final power and add the step to the sequence:
The rest of the code should then work normally.