This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DRV8711: DRV8711 STALL Detection issue

Part Number: DRV8711
Other Parts Discussed in Thread: TM4C1294NCPDT, , DRV8889-Q1

Hi.,

I am using TM4C1294NCPDT Microcontroller, and using DRV8711 for controlling stepper motor. We command the  motor for moving one position to another position.In that 2nd position there is mechanical stopper for stop the motor. So i decided to create interrupt for STALL pin,whenever motor reaches the mechanical stopper,the STALL need tobe detected.But its not coming into the interrupt function.

Kindly check if i missing any initialization for STALL detection

SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOC); 

GPIOPinTypeGPIOInput(GPIO_PORTC_BASE, GPIO_PIN_7); 

GPIOPadConfigSet(GPIO_PORTC_BASE, (GPIO_PIN_7), GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD_WPU); 
GPIOIntRegister(GPIO_PORTC_BASE, Motor_GPIOIntHandler); 
GPIOIntTypeSet(GPIO_PORTC_BASE, GPIO_PIN_7,GPIO_BOTH_EDGES);
GPIOIntEnable(GPIO_PORTC_BASE, GPIO_INT_PIN_7);
IntEnable(INT_GPIOC);

Interrupt Function:

void Motor_GPIOIntHandler (void)
{
GPIOIntClear(GPIO_PORTC_BASE,GPIO_PIN_7);
uint32_t ui32Stall;
ui32Stall = GPIOPinRead(GPIO_PORTC_BASE,GPIO_PIN_7);

// if(GPIOPinRead(GPIO_PORTC_BASE,GPIO_PIN_7))
if(((ui32Stall & GPIO_PIN_7)>>7))

{

Stall_Ctrl++;

if((Stall_Ctrl>0) && (STALL_Set_Flag==1))
{
Stall_Ctrl =0;
Motor.Stall = 0;
STALL_Set_Flag = false;

}

}
else
{

Motor.Stall = 1;
}

}

DRV Configuration:

Torque Register

Address  = 0x01;

TORQUE   = 0xB4;

SAMPLTH  = 0x01;

STALL Register:

Address   = 0x05;

SDTHR     = 0xC8;

SDCNT     = 0x02;

VDIV      = 0x03;

  • Hello,

    A have a few questions and then some debug suggestions.

    1)  What microstepping mode are you using?  This is in the CTRL register.

    2)  Have you configured the EXSTALL bit = 0?  This selects internal stall and will toggle the STALLn pin as you desire.

    If you have done all this, you might need to play with the SDTHR, VDIV, and SDCNT values as described in section 8.2.2.5 of the datasheet.

    Finally, you can configure the EXSTALL bit = 1 and scope the associated BEMF pin to see what level you are getting during running and stall conditions.  This is a sanity check to see if the BEMF monitoring is working at all before setting for internal stall.

    Regards,

    Ryan

  • Thank you Ryan.

    What microstepping mode are you using?  This is in the CTRL register

    I am using 0010-1/4 Micro stepping in this control register.

    Have you configured the EXSTALL bit = 0? 

    The EXSTALL bit =0x00;

    Yes I tried all this SDTHR, VDIV, and SDCNT values in given datasheet.

    But STALL not detected when motor rreach the mechanical stopper. Interrupt also not generated when the stopping occurs.

    I have a doubt please check the initialization part,is this correct?

    Kindly give me the solution for STALL detection.

    Thank you

  • Hi.,

    Please reply as soon as possible.

    Thanks in advance

  • Tom,

    "Finally, you can configure the EXSTALL bit = 1 and scope the associated BEMF pin to see what level you are getting during running and stall conditions.  This is a sanity check to see if the BEMF monitoring is working at all before setting for internal stall."

    Can you try this?  Really need to see what the BEMF of the motor looks like during running and stall.

    BTW, if you motor current requirements are not too high...we have the DRV8889-Q1 which has a stall algorithm that may work better for your motor.

    Regards,

    Ryan