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.

DRV8412 EVM Mode 4 is working unexpected.

Other Parts Discussed in Thread: DRV8412, DRV8412DDWEVM, TMS320F28335

Hi there,

Here is my configuration. M0M1M2 = HHL, PWM_C is connected to C2000 MCU. PWM_D is connected to ground.

Duty cycle = 1/65535, motor spins at a speed of A.

Duty cycle ≈ 17000/65535, motor stands still.

Duty cycle = 34000/65535, motor spins in the other direction with a speed nearly same as A.

Duty cycle = 65000/65535, motor spins at a fasted speed.

How is this possible?

Pls anybody help me, any opinion is greatly appreciated.

Best Regards,

Fang

  • Hi Fang,

    Can you provide more information?

    1) Are you using the DRV8412-C2-KIT, or another EVM?
    2) What type of motor are you driving?
    3) Please provide a schematic of the connections
    4) Please provide scope captures of the PWM duty cycle input and outputs (PWM_C, OUT_C, OUT_D). If not possible, please measure the frequency and duty cycle of both the input and outputs.
    5) How are you changing the duty cycle? (using a GUI or some other method) 

    We have not seen this behavior with the DRV8412. This could be a connection, code, or EVM issue. The information above will allow us to isolate the problem.

    Thank you.

  • Hi Milan,

    Thanks for your response. Here is the answer

    1) DRV8412DDWEVM

    2) brushed dc motors

    3) I'm using TMS320F28335 board (not from TI, but it's working correctly) and DRV8412 EVM. And the connection between them is very simple, i.e., only one pair of wire is used, one of them for PWM and the other one for GND.

    4) Sorry I don't have the captures but I checked the frequency by connecting PWM to QEP terminal on the same board (f28335). and the frequency is 100HZ (same as what I set in the software).

    I also measured the PWM voltage use a voltage meter, I change the duty cycle and watch the voltage, the result is like this,

    1/65535 duty cycle = 0v

    32768/65535 duty cycle = 1.66v

    65000/65535 duty cycle = 3.3v.

    For now, I have only a voltage meter to measure the voltage between OUT_C and OUT_D. But I don't think it make much difference as motor spinning speed observer. 

    5) It is simple. I'm just using TI CCS3.3 (debug mode) and I modified the compare value manually in the watch window.

    Pls let me know if you need other information. 

    Appreciate your help.

    Best Regards,

    Fang

  • Hi Fang,

    Thank you for the information. From your response, here it what we believe to be happening. You can confirm this by removing the motor and measuring the voltages at OUT_C and OUT_D as you change the duty cycle.

    Mode 4 (M1M2M3 = HHL) is complementary mode. This means that when one side is driving the output high, the other side is driving low.

    At zero percent on OUT_C, OUT_C is low and OUT_D is high. This should cause the motor to spin as fast as possible in one direction. If the motor is not connected OUT_C should be at PVDD and OUT_D should be at 0V.

    At 100% on OUT_C, OUT_C is high and OUT_D is low. This should cause the motor to spin as fast as possible in the opposite direction. If the motor is not connected OUT_C should be at 0V and OUT_D should be at PVDD.

    As the PWM increases from 0 to 50% the motor should slow down until it will stop somewhere around 50%. If the motor is not connected both OUT_C and OUT_D should be at approximately VM/2.

    As the PWM increases above 50%, the motor should begin to spin in the opposite direction and increase speed until 100% PWM duty cycle is reached.

    The puzzling piece of information is that the motor stopped at 17000 instead of around 33000. 

    Is it possible the code is using a 16 bit unsigned value in a 15 bit operation? If you continue to increase the duty cycle from 32768 to 49152, does the motor slow down, and stop? If you then continue increasing the duty cycle past 49152 to 65535, does the motor reverse directions back to the original direction and speed up?

    We have many other EVMS that are specifically designed to drive a single brushed motor. What are your specific requirements? We can probably suggest a better fit.

  • Hi Rick,

    Thanks for your detailed explanation.

    The data type using for compare value is 16 bit unsigned. Actually if you are also using TI C2000 to control the motor, you will understand what I did from the code segment below,

    EPwm3Regs.TBPRD is initialized to 65535 (Uint16).

    Then I just change the value of EPwm3Regs.CMPA.half.CMPA (Uint16) manually in the watch window, from 0 to 65535, such as 0, 1, 100, 1000, 10000, 16384, 17000, ............65535. I tried a lot of Numbers!

    the motor spins in one direction when CMPA < 17000, and spins in the opposite direction when CMPA > 17000. (Note: To be precise, it is a value around 17000).

    I am using DRV8412 to control two motors for now, the peak voltage and current is good for me. In the future maybe I would like to use one chip to control three motors or more, if possible.

    Maybe little I should try to use PWM_A and see what happens, or further check Mode 1 or mode 2. Do you have any other idea to locate the problem?

    Thanks,

    Best Regards,

    Fang

  • Hi Fang,

    Does the motor speed change or direction as you increase CMPA from 32000 in increments of 2000 to 65000? If it does not, could there be some type of limit in the code that prevents use of numbers greater than 32000 when setting the PWM duty cycle?

    Everything sounds like it is working properly except for the range above 32000. Is that correct?

  • Hi Duncan,

    Sorry for the delay between posts.

    I had a little trouble accessing this forum before but  it seems fine now.

    About your question, no, I have the same problem with 100Hz PWM frequency (TBPRD corresponding to 65535). But, when I increase the PWM frequency to 20KHz(TBPRD corresponding to 3750), it works perfect. I mean, more smoother, and more important, the motor spins in one direction when I change PWM duty cycle from 5 to 1800 (approxiametely), and in the reverse direction when the duty cycle falls in 1800 to 3745.

    Have you any idea about this?

    Best Regards,

    Fang

  • Hi Duncan,

    It seems I have a new trouble here.

    I am trying to use mode 1 with uni-polar PWM, but the motor won't start to spin (with no load) at a high duty cycle, say 1500/3750. it starts to spin at duty cycle less than 1200/3750, and will spin faster when later I increase the duty cycle later.

    If I gave a high duty cycle before the motor spins, I must assert the RESET_AB and the motor will start to spin again with a lower duty cycle.

    Should I start the motor with a low speed and then increase it gradually? but if so, why with mode 4, the motor could start to spin at high duty cycle, say 10/3750?

    I don't understand this. With the adjustable Switching Mode Power Supply (0~30V, 0~20A), I saw the starting current is about 0.2A with the duty cycle 1200/3750.

    Best Regards,

    Fang

  • Hi Fang,

    When in mode 1, are you holding the non-PWM input low? If so, it must be pulsed to clear any cycle by cycle current limits. This new requirement is being added to the datasheet, but I don't know when it will appear.

    If a CBC event occurs, both PWM signals must be pulsed to clear it. If the CBC event occurs, there is no fault indicator in this condition.

    We recommend that you pulse the other PWM input for a minimum of 1% at the end of the cycle to prevent this scenario. It should work if you do this.

  • Hi Rick,

    I tried your recommendation, but I still failed to start the motor. here is how I did, first I pulse one PWM at a duty cycle of 3%, then about a few seconds later I increase this duty cycle to 60%, but the motor didn't spin.

    I think there is no CBC event, since the motor drives no load. And also, I can start the motor at a high speed (e.g., 3% or 95% duty cycle) with mode 4. 

    What do you think?

    Best Regards,

    Fang

  • Hi Fang,

    Mode 4 and Mode 1 operate differently. Mode 4 works because you are only using one PWM input. I am not certain how PWM_A and PWM_B were driven in Mode 1.  Let's match the operation of Mode 4 using Mode 1.

    I have attached a simple timing diagram showing what is required in Mode 1 to match Mode 4 operation.

    For mode 1, the important point to note is that if PWM_B is not toggled and the CBC limit is triggered, OUT_A and OUT_B will stop driving and there is no fault indication. The outputs will not begin to drive again until both PWM_A and PWM_B are toggled.

    I hope this is clear. If not please provide a timing diagram of what you did and I will mark it up to clarify.