Page 1 of 1

L6470 stall detection function

Posted: Wed Jan 29, 2014 9:25 am
by arduinonewbie
I have a sparkfun l6470 stepper motor driver that is connected to an arduino uno. I understand that the l6470 driver has a stall detection function. This is the part that I am unsure of.
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!

Re: L6470 stall detection function

Posted: Sat Feb 01, 2014 8:45 pm
by abhimanyu
Following excerpt from the L6470 Datasheet may be of help:
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