When my stepper motor stalls, i want it to stop and go back to its home position.
Is it possible to work that way?
Thanks in advance!
Datasheet - Page 35/70 Section 7.2 Sensorless stall detection
When a stall event occurs, the respective flag (STEP_LOSS_A or STEP_LOSS_B) is forced low until a GetStaus command or a system reset occurs
Datasheet - Page 46/70 Section 9.1.18 STALL_TH
The STALL_TH register contains the stall detection threshold value (see Section 7.2). The available range is from 31.25 mA to 4 A with a resolution of 31.25 mA.
Assuming you are following SparkFun's GitHub repository:
You may call something like this in your code:
Code: Select all
if (dSPIN_GetParam(dSPIN_STALL_TH) >= 0x5F) //For setting the stall current value at 3A (max). See Table on Page 47/70
// do something - bring motor to neutral position
Who is online
Users browsing this forum: No registered users and 2 guests