Vex 3 axis CNC machine program acting unexpectedly

Yes, the slop is going to be an issue, but I don’t think the error will accumulate over time, if they use absolute target position with spinToPosition(), and don’t reset motors or use relative targeting with spinFor().

Then final error after each step is going to be the same (within the bounds) based on the internal motor PID exit condition and mechanical slop of the system.

I believe that the unpredictability that @DietMilk is experiencing is due to the velocities that are set depending on the size of each step.

I think you can safely set constant velocity around 30-50% of the maximum and let V5 motor’s built-in PID algorithm, which is invoked by spinFor() and spinToPosition() type of functions, to control the exact way it moves.

Then, if you get it to work reasonably well, you could try to switch to your own custom PID algorithm and experiment with coefficients to get best accuracy and performance. V5 motors use default PID coefficients that are good enough for many various modes but are not optimal for any specific one (except for the hypothetical average case).

Edit: I guess, I have to add for extra clarity that V5 built-in PID has exit condition that may not necessarily stop at the exact target:

If this wasn’t the case then it wouldn’t make any difference in using relative or absolute targeting with spinFor() or spinToPosition().