I'm running an "embedded" TMCL program on a PANdrive PD-140-42-SE. After power on the program is supposed to slowly turn to the end of the system (no switch possible, I'm using StallGuard). Afterwards it's supposed to turn back 63900 steps after which I'm stetting this point as 0 position.
Oddly enough the corresponding GAP command for the current position will return different values for the axis position, often somewhere in between (-10000 to -30000). Especially if the system is powered on "in between" and not at the lower end. Sometimes it's working correctly.
Am I missing something? (Shortened code below, system init removed)
- Code: Select all
SAP 140, 0, 5 // 32 Steps
SAP 204, 0, 10 // freewheel time, 0 to disable
SAP 203, 0, 2048 //Disable Mixed Decay
SAP 5, 0, 700 //Set Acceleration
SAP 4, 0, 1000 //Set maximum Velocity
SAP 205, 0, 5 //Turn on Stall Detection
// move to end
SAP 205, 0, 0 // turn off stall detection
SAP 203, 0, -1 // mixed decay
MVP REL, 0, -63900
WAIT POS, 0, 0
SAP 1, 0, 0
I've also tried some delay (instead of and after WAIT POS) but it doesn't seem to have any effect. If I issue a MVP ABS 0, 0 after the SAP it's crashing violently into the lower barrier of the system.
