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.

DRV8834: Output waveform issue

Part Number: DRV8834

Hello Team,

I am facing the following issue with DRV8834

We are driving a stepper motor with it,

The inputs are :

Indexer Mode with M0, M1 = 0

STEP pulses: 15 PWM pulses, 208Hz frequency,

VM = 3.7 ~ 4.2V

Enable pins driven low during the PWM inputs.

Schematic :

I measured the output waveform across Aout1 and Aout2 and i found one spike after all counts it makes an extra count for my stepper motor.

  

Please suggest a way to remove this spike.

Your time is highly appreciated.

Please let me know if you need any other information.

  • MIT,

    Adecay and Bdecay pin is connected to ground by 51kohm resistor. So, the decay mode should be slow decay (both low side FETs are on). That can make the winding current slowly drop to zero. But, if Enable pins turns off the low side FET, the winding current will go through the high side FET's body diode and push the xOUT high. That is what you see in your waveform.

    To avoid this issue, you could hold enable signal a little bit longer until the winding current drops. Or, would you try mix or fast decay to make the winding current drop faster? So, you won't need to hold the enable signal too long.

  • Hi Wang,

    Thank you for your valuable reply, I appreciate your time.

    My further questions are,

    1) Can the spike in the waveform be a possible reason to miss steps of stepper motor in my application?

    2) Also if we keep the same firmware and same hardware with different-different motors then the results vary(means in some cases we are getting steps missing problem and in some case we are not), is it because of different motors?

    3) If we use a simple MOSFET circuit then there is no problem. please find this circuit below:

    In the DRV8834 circuit,

    We don't need the mix decay mode as we require the same speed to run a stepper motor.So kindly suggest the resistor values to use fast decay mode suitable to our stepper motor. 

    Please find the attached stepper motor datasheet and kindly verify our schematic according to the same.

    The major parameters are:

    VM = 3.7 ~ 4.2V

    Operating voltage = 3.6V

    Inductance per phase = 2.7mH

    Resistance per phase = 7.5 E

    Power consumption = 3.46W

    I appreciate your valuable help.

  • Please find the motor 20DAM20D10-K (PS)_C.PDFdatasheet here.

  • Hi wang,

    Here are some more observations as per your suggestion. 

    - We added more time for Enable/disble pin around 100 ms but still we are getting spike after 100 ms of time.

    - Then we tried to keep Enable/disable pin as low and checked Waveforms , we found that spike is still there. Please check below image for your reference.

      

    I didn't do any changes in hardware side right now. I have added code for your reference. Please suggest to me what I can do for next.

    stepper_motor.c
    void StepperMotor_Handler(void)
    {     
        switch(s_motor_state & s_motor_state_mask)
        {        
            case MOTOR_UP_MODE:
            {                        
                // Motor Wake-up
                HAL_GPIO_WritePin(SLEEP_PIN_GPIO_Port, SLEEP_PIN_Pin, GPIO_PIN_SET);
             
                HAL_Delay(100);            // 1 ms Delay - Actual
              
                // Direction Setting
                HAL_GPIO_WritePin(DIR_PIN_GPIO_Port, DIR_PIN_Pin, GPIO_PIN_SET);
                
                // Start the Timer
                HAL_TIM_Base_Start_IT(&htim9);
                            
                HAL_GPIO_WritePin(STEP_PIN_GPIO_Port, STEP_PIN_Pin, GPIO_PIN_SET);
                
                s_motor_state = MOTOR_IDLE;
            }
            break;
            
            case MOTOR_DOWN_MODE:
            {
                // Motor Wake-up
                HAL_GPIO_WritePin(SLEEP_PIN_GPIO_Port, SLEEP_PIN_Pin, GPIO_PIN_SET);
             
                HAL_Delay(100);            // 1 ms Delay
                
                // Direction Setting
                HAL_GPIO_WritePin(DIR_PIN_GPIO_Port, DIR_PIN_Pin, GPIO_PIN_RESET);
                
                // Start the Timer
                HAL_TIM_Base_Start_IT(&htim9);
                
                HAL_GPIO_WritePin(STEP_PIN_GPIO_Port, STEP_PIN_Pin, GPIO_PIN_SET);
    
                s_motor_state = MOTOR_IDLE;
            }
            break;
            
            case MOTOR_STOP:
            {          
                s_motor_state = MOTOR_IDLE;
            }
            break;
            
            case MOTOR_RESET:
            {   
                // Reset the motor at moderate Speed
                ConfigAapDisp_Timer(MOTOR_RESET_SPEED);
              
                // Wake-up Motor Driver Chip from Sleep
                HAL_GPIO_WritePin(SLEEP_PIN_GPIO_Port, SLEEP_PIN_Pin, GPIO_PIN_SET);
                HAL_Delay(2000);            // 2 ms Delay
                
                /* =========== Added By Nipam ============ */
                steps = RESETSTEPS;
                /* ======================================= */
        
                // DIR Pin Set -- Motor UP Direction -- Aspense
                HAL_GPIO_WritePin(DIR_PIN_GPIO_Port, DIR_PIN_Pin, GPIO_PIN_SET);      
                HAL_TIM_Base_Start_IT(&htim9);
    
                // Wait until either Limit Switch detected or steps value reach to Zero            
                while((HAL_GPIO_ReadPin(LIMIT_SW_PIN_GPIO_Port, LIMIT_SW_PIN_Pin)) && (steps > 0));
                
                HAL_GPIO_WritePin(GPIOC, ENDS_PIN_Pin, GPIO_PIN_SET);            
                
                // DIR Pin Reset -- Motor DOWN Direction -- Dispense
                HAL_GPIO_WritePin(DIR_PIN_GPIO_Port, DIR_PIN_Pin, GPIO_PIN_RESET);
                
                HAL_GPIO_WritePin(GPIOC, ENDS_PIN_Pin, GPIO_PIN_RESET);
                
                HAL_TIM_Base_Start_IT(&htim9);
                
                steps = HOMESTEPS; 
    
                // Wait until steps value reach to Zero
                while(steps);
    
                // Stop Timer
                HAL_TIM_Base_Stop_IT(&htim9);
    
                // Put Motor Driver Chip to Sleep
                HAL_GPIO_WritePin(SLEEP_PIN_GPIO_Port, SLEEP_PIN_Pin, GPIO_PIN_RESET);
                HAL_Delay(2000);            // 2 ms Delay
                
                //HAL_GPIO_WritePin(GPIOC, ENDS_PIN_Pin, GPIO_PIN_SET);     // commented on 23/09
                HAL_GPIO_WritePin(GPIOC, ENDS_PIN_Pin, GPIO_PIN_RESET);
            }
            break;
            
            /* do nothing and let the other routines work */
            case MOTOR_IDLE:
            {
                
            }
            break;
        }
    }
    
    void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
    {
        if((htim == &htim9))
        {
            // Toggle Step Pin
            HAL_GPIO_TogglePin(STEP_PIN_GPIO_Port, STEP_PIN_Pin);
                            
            if(steps == 0)
            {
                HAL_TIM_Base_Stop_IT(&htim9);
                
                HAL_GPIO_WritePin(STEP_PIN_GPIO_Port, STEP_PIN_Pin, GPIO_PIN_RESET);
                                        
                HAL_GPIO_WritePin(SLEEP_PIN_GPIO_Port, SLEEP_PIN_Pin, GPIO_PIN_RESET);
              
                s_motor_state = MOTOR_IDLE;
            }
            else
            {
                steps--;
            }
        }
    }

    It would be highly appreciated.

    Thanks,

    Mit

  • Hi Wang,

    Adding some more observations:

    We have configured the EN pin low and SLEEP pin high by default at the initiation of code as shown below:

    HAL_GPIO_WritePin(GPIOC, ENDS_PIN_Pin, GPIO_PIN_RESET);
    HAL_GPIO_WritePin(SLEEP_PIN_GPIO_Port, SLEEP_PIN_Pin, GPIO_PIN_SET);

    By doing it the spike is removed and we are not getting problem of missing steps now but the motor is getting very hot and consuming more power.

    Our application is based on battery so it is also needed to reduce power consumption so please suggest regarding the same.

    Kind regards,

    Mit

  • MIT,

    "We added more time for Enable/disble pin around 100 ms but still we are getting spike after 100 ms of time."

    If DRV8834 is kept in slow decay (ADECAY and BDECAY) at end of step, we should not see the spike because two low side FETs are on.

    Please monitor the STEP pin, Enable pin, ADECAY pin and AOUTx on same scope picture.

  • Wang,

    Thank you for the inputs.

    Please give inputs on the power consumption issue as well as it resolves my steps missing an issue and we are stuck badly.

  • MIT,

    CONFIG pin is connected to VINT: Logic high to put the device in indexer mode. In indexer mode, ENABLE pin Logic low enables all outputs.

    Is the above setting what you want? In indexer mode, ENABLE pin Logic low enables all outputs. That give inputs the power consumption. If we want to reduce the input current, we should set enable pin high or pull nSLEEP pin low.

    "To avoid this issue, you could hold enable signal a little bit longer until the winding current drops." I mean hold enable pin logic low a little bit longer after STEP pulse is finished. But, in your 2nd waveform, I saw more STEP pulses. That may not give slow decay after STEP pulses.

  • Hi Wang,

    Thank you for your response.

    We held the enable pin low a little longer after the step pulses but the spike is now coming when i pull enable high.

    The sleep pin is high continuously during this.

    Please find waveform for your reference.

    Please help us on this.

    We will share the waveforms of  STEP pin, Enable pin, ADECAY pin and AOUTx soon.

    Regards,

    Mit

  • MIT,

    When we stop sending the step signal to the motor drive and let the winding current to decay, the winding current won't quickly drop with slow decay mode (both low side FET is on). When all FET's are off, the winding inductor energy needs sending back to input capacitors. That is why you see the output voltage is up. It should be just one body diode voltage higher than the input voltage.

    In such case, we typically add enough input capacitance (100uF or 200uF) to absorb this energy.

  • Wang,

    Thank you for your reply.

    I did add 100uF capacitor at the VM, but the spike is still there.

    At this time the Adecay pin is connected with ground through 51K

    Please let me know if you require any more info.

    Regards,

    Mit

  • MIT,

    If the winding current is not zero, the OUTx will be always one forward body diode voltage higher than VM. It is normal to me.

    Adding the more input capacitance just keep the VM voltage not been pushed to too high to damage the IC.

  • MIT,

    Our senior engineer also looked this post and pointed to me the waveform showed the voltage going negative. So, when you do the measurement, you may put probe's ground reference on one side of the output.  That could show two body diode voltage difference between normal output voltage and the overshoot voltage after you stop the motor. 

  • Wang,

    Thank you for your input.

    Yes we do measure the output waveform between Aout1 and Aout2.

    Do you suggest that we need to take the DSO's ground reference to PCB's ground instead of Aout2?

    Best Regards,

    Mit shah

  • MIT,

    It is OK to use AOUT2 as reference. To me, I just think the PCB's ground or IC ground is a good reference when we discuss the over voltage issue.