Scaling factors for acceleration, velocity, and position: A = rev/s^2 * 8 V = rev/s * 32212 P = rev * 2000 ` absolute position D = rev * 2000 ` relative distance move G ` start move TWAIT ` wait for end of trajectory Input signals: IF UAI==1 UEO = 1 IF (UBI==1) ` do first kind of move ENDIF IF (UCI==1) ` do second kind of move ENDIF IF (UDI==1) ` do third kind of move ENDIF ENDIF To search for index pulse (once per revolution) V = 1000 ` some slow positive velocity D = 2000 ` one revolution is most we should have to turn G WHILE Bt ` while our trajectory is running IF Bi ` limit triggered? O=0 ` set origin to zero (or some other constant) S ` stop ENDIF LOOP