Want to get rid of the Limit Switches? Homing using the Encoder Deviation
Limit switches require a lot of wiring, and are subject to wearout. With sensOstep PANdrives or modules using an external encoder the homing you can implement the homing with the following TMCL routine.
VECT 21, DeviationIrq //Define Interrupt on Encoder Deviation EI 21 //Activate Interrupt EI 255 SAP 212, 0, 5000 //max. Encoder-deviation ROR 0, 1000 //Start Motor Loop: //Empty Main Loop JA Loop DeviationIrq: //Interrupt Service Routine Motor is already haltet then SAP 0, 0, 0 //Set Position to 0 (homing) SAP 1, 0, 0 SAP 209, 0, 0 RETI
Drive the motor with a low current towards a mechanical reference position. As soon as it contacts the reference position, it is stopped. The encoder deviation will go up and trigger an interrupt.
As soon as the drives are stopped the interrupt service routine resets the position counter to zero.
Tested with a PD-1140 with integrated sensOstep Encoder
August 5, 2015 / Jonas P. Proeger / 0