I would like to write a script in the TMCL Host/PC script environment to operate a stepper motor.
I have a TMC5160-EVAL-KIT, which includes the USB to PC board (Landungsbruecke?), an interconnecting board, and the TMC5160 eval driver board.
I have a 23 frame stepper and an optical switch wired to the L reference switch.
What I would like to do is rotate the motor until the switch changes from 5V to 0V, stop the motor, change the direction and rotate again until the same switch changes from 5V to 0V again.
And then repeat this cycle.
I'm getting inconsistent results. When I run in direct mode, things seem to work, but in the Host/PC script environment nothing happens.
SCRIPT:
#module 1 "COM6/USB/id1/LandungsbrueckeV3" "[LandungsbrueckeV3]"
SAP 4, 0, 10000, 1 //Set the maximum speed
SAP 1, 0, 0, 1 //set Actual position : TMC5160
Loop:
MVP ABS, 0, 150000, 1 //Move to position 150000
WAIT POS, 0, 0, 1
WAIT TICKS, 0, 200
MVP ABS, 0, 0, 1 //Move back to position 0
WAIT POS, 0, 0, 1
WAIT TICKS, 0, 100
Any help would be appreciated.