L6470 stall detection function

Discuss everything related to Arduino - Open-source electronic prototyping platform allowing to create interactive electronic objects.
arduinonewbie
Posts: 1
Joined: Wed Jan 29, 2014 9:21 am

L6470 stall detection function

Postby arduinonewbie » Wed Jan 29, 2014 9:25 am

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!
abhimanyu
Posts: 94
Joined: Tue Oct 18, 2011 9:49 pm

Re: L6470 stall detection function

Postby abhimanyu » Sat Feb 01, 2014 8:45 pm

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

Also,
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

Return to “Arduino”

Who is online

Users browsing this forum: No registered users and 1 guest