Quantcast
Channel: Dave (Wisconsin) Wilson's Activities
Viewing all articles
Browse latest Browse all 534

Controlling Low Side FETs (DRV8301-69m-kit)

$
0
0

Hi folks,

I posted this question to the motor driver forums but was recommended by Nicholas to come here with my problem. Here is the link to my exchange with him: http://e2e.ti.com/support/applications/motor_drivers/f/38/p/449884/1618330#1618330

I'm trying to figure out how to control the low side FET's to be able to utilize regenerative braking for the system I'm working on. Here is the last thing I posted on the motor drive forums and it's where I'm currently at:

" I've spent quite a bit of time looking through hal.c and came up short with what I wanted. I guess I was looking for a duty cycle parameter or something and didn't notice anything. Although, after further reading, I've noticed that epwm 1,2, and 3 get initialized in Hal.c:
// initialize PWM handles
obj->pwmHandle[0] = PWM_init((void *)PWM_ePWM1_BASE_ADDR,sizeof(PWM_Obj));
obj->pwmHandle[1] = PWM_init((void *)PWM_ePWM2_BASE_ADDR,sizeof(PWM_Obj));
obj->pwmHandle[2] = PWM_init((void *)PWM_ePWM3_BASE_ADDR,sizeof(PWM_Obj));

Each ePWM has an A and B associated with it for high side and low side FETs. The pwm object associated with the pwmHandle has a slew of different variables associated with it. After ctrl+f'ing through spruh18e.pdf, I've found this:

B Duty modulation for EPWMxA is set by CMPA, and is active high (that is, high time duty proportional to CMPA).
C Duty modulation for EPWMxB is set by CMPB and is active high (that is, high time duty proportional to CMPB).

So it sounds like I need to write to the CMP registers to get the duty cycle that I want. In my main file (inside the forever loop), I write the following for a duty cycle of 0%:

halHandle->pwmHandle[0]->CMPA = 0; 
halHandle->pwmHandle[1]->CMPA = 0;
halHandle->pwmHandle[2]->CMPA = 0;

All I get is a high pitched noise coming from my motor as it continues to spin. Am I off track or getting close?  "

Any help would be greatly appreciated!

-Jim


Viewing all articles
Browse latest Browse all 534

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>