Other Parts Discussed in Thread: CONTROLSUITE
Hello,
I am trying to build a simple three phase voltage source inverter to drive a three phase induction machine using a six switch inverter module. So far, I have configured ePWM4, 5 and 6 to produce complementary pairs of PWM signals with a deadband in between and I am going to use these to control the three legs of my inverter respectively.
At the moment, I have simply specified a duty cycle for these PWM signals so that I could verify them on my oscilloscope.
Uint32 ePWMdutyA = 500; Uint32 ePWMdutyB = 600; Uint32 ePWMdutyC = 700; ...... EPwm4Regs.CMPA.half.CMPA = ePWMdutyA; // adjust duty for output ePWM4A EPwm5Regs.CMPA.half.CMPA = ePWMdutyB; // adjust duty for output ePWM5A EPwm6Regs.CMPA.half.CMPA = ePWMdutyC; // adjust duty for output ePWM6A
I do this within main() and it behaves as I would expect.
Now though, I want to modulate this duty cycle to produce a sinusoidal output. I am planning on using the sine function from the math.h library. I want to do something like this:
ePWMdutyA = modulationIndex * sin(2 * pi * f * t)
ePWMdutyB = modulationIndex * sin(2 * pi * f * t + 120)
ePWMdutyC = modulationIndex * sin(2 * pi * f * t - 120)
I am not sure how to go about doing this over time though, ie where to get this t term from. Would it be best to set up an interrupt to fire when my PWM timer hits its maximum and change the duty cycle at this maximum point? Would it be best to set up a separate CPU timer to do this?
What I am eventually planning to do is take feedback from an encoder and use this to change the modulationIndex and the frequency to implement a very basic v/f control scheme.
Any advice would be appreciated as I am very new to this field!