P2 Taqoz V2.8: Linear Movement of 4 Step Motors
Hi,
perhaps this might be interesting, if you want up to 4 axis of step motors moving in parallel. It is intended to be used with step drivers, which need a direction and a step signal like A4988 or (better) TMC2209 as described here: https://forums.parallax.com/discussion/176017/tmc2209-cnc-shield-p2-a-nice-combination-to-control-step-motors#latest
This driver uses local variables as described here: https://forums.parallax.com/discussion/174970/p2-taqoz-v2-8-lutlongs-value-type-variables-locals-now-faster#latest
The driver is coded in Forth, no assembler, and capable of 18_000 clocks per step = 200_000_000/18_000 = 11_000 steps per second for each of the 4 motors in parallel. Linear movement of 4 axis in parallel is done like this:
- The axis with the maximum of steps in that movement is found as the leading axis. It gets assigned the fixed step-time.
- For each of the other axis, which have lower distance to travel, their time per step is precalculated in a way, that they will arrive at the same time.
- To achieve acceleration and deceleration nearby the start and the destination, a factor for the step time is calculated and applied for each axis.
Acceleration/deceleration is defined by 2 constants
accel# is (not exactly) the number of steps until full speed is reached.
minDist# defines the speed at start.
In my setup right now a minimum of 12_000 clocks per step would be possible, before some resonance is starting at one axis. So this driver leaves some sort of safety factor for the speed....
Have fun!
Christof