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.
Tool/software:
We are currently using the DRV8711 driver to control a DC motor in our application. However, we are encountering a few issues during motor operation, and we would appreciate your assistance in addressing these problems. The issues are as follows:
PWM Frequency Issue: Although the PWM frequency is changing, the on-time and off-time remain constant. Could you kindly provide the code or guidance for generating a PWM signal with adjustable frequency and duty cycle?
Speed Discrepancy in Both Directions: We are observing that the motor speed is not the same when running in forward and reverse directions. Could you suggest any possible causes for this and how to address it?
Register Configuration for DC Motor Control: Could you provide the specific register values needed to control a DC motor using the DRV8711? We would like to set up the motor driver for optimal performance.
Closed-Loop Control for DC Motor: We intend to implement closed-loop control for the DC motor. Could you provide recommendations or examples on how to implement this with the DRV8711?
DC Motor Application Circuit: Could you provide a basic application circuit for connecting the DRV8711 to a DC motor? We would like to ensure that the wiring and connections are correct for efficient operation.
Decay Mode Selection: Could you advise on the correct decay mode to use for smooth motor operation? We are particularly looking for recommendations that minimize vibrations and ensure stable performance.
Hi Dhivya,
Thanks for your question. The device expert from my team will look into this and get back to you.
Thanks,
Ibinu
Hi Dhivya,
In the DRV8711 the default operating mode is set for driving a stepper motor with the internal indexer. For driving a BDC motor the PWMMODE bit must be set to 1b in the OFF register.
Based on the control logic table below please let us know what control logic you were using and the PWM was input, what frequency and duty cycle? How was the current regulation handled?
PWM Frequency Issue: Although the PWM frequency is changing, the on-time and off-time remain constant. Could you kindly provide the code or guidance for generating a PWM signal with adjustable frequency and duty cycle?
Please share oscilloscope captures showing the issue.
Closed-Loop Control for DC Motor: We intend to implement closed-loop control for the DC motor. Could you provide recommendations or examples on how to implement this with the DRV8711?
Please provide more information, how would you want to achieve closed-lop control? Did you mean voltage / speed control? How was the feedback done to the controller?
DC Motor Application Circuit: Could you provide a basic application circuit for connecting the DRV8711 to a DC motor? We would like to ensure that the wiring and connections are correct for efficient operation.
Please share your current schematic of the BDC motor driver using the DRV8711 as well as share the registers contents configured for the application.
Decay Mode Selection: Could you advise on the correct decay mode to use for smooth motor operation? We are particularly looking for recommendations that minimize vibrations and ensure stable performance.
Please let us know what is the current regulation setting. With BDC motor current regulation should be set to high just to limit in-rush current otherwise it must not be active. Decay Mode is intended only for current regulation. Thanks.
Regards, Murugavel
We included the schematic of the controller and DRV8711 circuit for the BDC, with current regulation managed through the torque register.
In Direct PWM Input mode logic, we are not getting the expected Aout1 and Aout2. We have included the oscilloscope images for reference.
FOR AOUT1 AND AOUT2 GET SAME OUTPUT(LOW)
2.In the main loop, we control the motor's direction by manipulating the direction control pins (AIN0, AIN1) through port manipulation, along with the PWM frequency as the input signal..
while(1)
{
/*****FORWARD*****/
PORTH&=0xEF; // AIN0
PORTJ |=0x20; // AIN1
/*****REVERSE*****/
PORTH |=0xFF; // AIN0
PORTJ&=0xDF; // AIN1
pwm_frequency(10000);
}
The following function is used to generate the PWM signal to control the speed of the motor.
void pwm_freqncy(int32_t res)
{
int32_t t_count2;
int32_t res1;
res1 = res;
t_count2 = (f_cpu/(res1*2*1));
t_count2 = (t_count2 - posone);
ICR4 = (int16_t)t_count2;//22
TCCR4A = 0x10; //**Toggle OC4B on ctc*/
TCCR4B = 0x19; /**WGM=toggle,mode ctc, NO PRESCALER**/
}
But in forware direction mode and reverse direction i am getting pwm in ain1 only
PWM IMAGE OF AIN1, AS PER FREQUENCY IT WILL CHANGE
3. WE NEED TO DO SPEED CONTROL
4. Our application circuit for BDC
We are controlling the DC motor driver (DRV8711) using the ATmega2560 microcontroller.
The following registers are configured via SPI communication to control the motor driver.
/**Write CTRL Register **/
dataHi = 0x08;
dataLo = 0x05;
SPI_DRV8711_ReadWrite(dataHi, dataLo);
/**Write TORQUE Register **/
dataHi = 0x16;
dataLo = 0x12;
driver_stat = dataLo;
SPI_DRV8711_ReadWrite(dataHi, dataLo);
/**Write OFF Register **/
dataHi = 0x21;
dataLo = 0xF0;
SPI_DRV8711_ReadWrite(dataHi, dataLo);
/**Write BLANK Register**/
dataHi = 0x30;
dataLo = 0x10;
SPI_DRV8711_ReadWrite(dataHi, dataLo);
/**Write DECAY Register**/
dataHi = 0x41;
dataLo = 0x10;
SPI_DRV8711_ReadWrite(dataHi, dataLo);
/**Write STALL Register**/
dataHi = 0x5F;
dataLo = 0xFF;
SPI_DRV8711_ReadWrite(dataHi, dataLo);
/**Write DRIVE Register**/
dataHi = 0x65;
dataLo = 0x0F;
SPI_DRV8711_ReadWrite(dataHi, dataLo);
/**Write STATUS Register**/
dataHi = 0x70;
dataLo = 0x00;
SPI_DRV8711_ReadWrite(dataHi, dataLo);
Hi Dhivya,
Thanks for the details.
In Direct PWM Input mode logic, we are not getting the expected Aout1 and Aout2. We have included the oscilloscope images for reference.
The DRV8711 gate driver outputs are meant for direct connection with external FETs. See block diagram below from the datasheet. 220 Ω between Gate to Source of the FETs will dramatically affect the gate driving. Please remove these resistors.
It appears the driver B H-bridge is unused, correct?
Suggested register settings:
CTRL register: 0x089, this will disable internal stall (used only with stepper motor), 650 ns dead time and Gain of 5
TORQUE register: 0x1612, SMPLTH = 800 μs, TORQUE = 0x12 or 18. Itrip (current chop) setting = 2.75 x TORQUE / (256 x Gain x Risense) = 2.75 x 18 / (256 x 5 x 0.01) = 3.87 A.
This current setting must match with the in-rush and stall current limiting and should be higher than the steady state motor running at the rated load. Which means no current chopping will happen under normal operating conditions.
OFF register: 0x21F0, PWMMODE = 1b bypass indexer, TOFF = 0xF0 or 240 which means it is 120.5 μs - this may have to be reduced to 24 or 32 μs.
BLANK register: 0x3010, ABT disable and TBLANK = 0x10 or 16 which means it is 340 ns.
DECAY register: 0x4110, Slow decay for increasing current, mixed decay for decreasing current (indexer mode only). For BDC motor the following should be used: 000: Force slow decay at all times. With this setting TDECAY would be irrelevant.
STALL register: For BDC motor this is not relevant. Internal stall not used for BDC motor.
DRIVE Register: 0x650F, I'd recommend to keep the default settings to begin with and increase IDRIVEP and IDRIVEN to the highest setting if APDF and BPDF were getting set as well as increase TDRIVEN and TDRIVEP to the next higher if APDF and BPDF were getting set and bridge disabled due to this.
But in forware direction mode and reverse direction i am getting pwm in ain1 only
PWM IMAGE OF AIN1, AS PER FREQUENCY IT WILL CHANGE
This does not work for PWM mode driving. This approach is for Phase and Enable PH/EN type of control logic only. We have other drivers both gate drivers and integrated drivers to support this mode for BDC motor. Why the DRV8711 was selected? Was there a specific reason?
For PWM mode driving the following drive should be used - aligned with the control table from the datasheet. Forward drive: AIN1 = 1, AIN2 = PWM with variable duty cycle and Reverse drive: AIN2 = 1, AIN1 = PWM with variable duty cycle.
WE NEED TO DO SPEED CONTROL
Varying the duty cycle keeping the PWM frequency constant with the above driving logic will control the speed of the motor. Thanks.
Regards, Murugavel
Hi sir,
Thanks for your reply!
Hi Dhivya,
Thank you for the update. Good to know our suggestions helped fix the issue of driving the motor with variable PWM duty cycle. Please mark this post as "RESOLVED".
- The speed is now controlled, but the motor does not operate below a certain minimum speed (e.g., below 6.6V), Based on your suggested register configuration I applied. I have set the torque register current value to the maximum.
- However, the motor functions properly when powered by an external supply (less than 6V).
DC motors behave differently with a PWM with lower duty cycle vs. using a direct drive of 6 V. There would be a lowest usable duty cycle for the motor to spin with the load conditions of the application which means you cannot go lower than this duty cycle for soft start or minimum operating speed. This is because the PWM drive does an ON = drive and OFF = brake (slow-decay) for current regulation.
It is possible to try an alternate option but this is not a recommended option as this could cause VM voltage pumping to higher value when the motor would be reducing in speed or stopped with 0 % duty cycle. This would be to keep one input to 0 V and drive the other input with PWM for one direction and vice-versa for the opposite direction. In this configuration the speed control above a duty cycle may not be good. You can try this to see if it is suitable for your applications. This is not a generally recommended approach. Thank you.
Regards, Murugavel
Hi Dhivya,
What I meant was driving a BDC motor with PWM on/off duty cycle vs. driving directly with an equivalent power supply direct drive behavior would be different. This has nothing to do with the driver IC rather behavior of the motor itself. Thanks.
Regards, Murugavel
Hello sir,
as per your suggestion, I tried the settings 0x6AAF, 0x6FAF and 0x6FFF for TDRIVEP and IDRIVEP in DRIVE register, than read the STATUS register but APDF and BPDF bits are not set.
can you suggest on this?
Hi Dhivya,
For normal operation APDF and BPDF must not be set. These are pre-driver fault indicator bits. If they're set the outputs will be disabled. Your system should have normal operation when these bits are not set. Thanks.
Regards, Murugavel