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.

HV Motor Control 3 Phase Inverter questions

Hello all,

I am still a bit new to the realm of TI MCUs and motor control, and I have a few (basic) questions to ask.

At some point I'm going to have to write my own control code based off of one of the examples TI provided with the (TMDSHVMTRPFCKIT) that I purchased. There has been much discussion on this forum about using the PWM module itself, and I understand that the PWM modules they have written will likely do a better/more efficient job than anything I could write. 

What I haven't seen or been able to figure out is how the PWM module interfaces with the inverter. I have looked at the documentation and browsed around here for a few hours, and I'm at a loss. To be more specific, the documentation (and code) for PWM_DRV (or whatever pwm module is being used) chronicles how the space vector inputs are 'converted' to pwm signals (or something like that-- feel free to clarify), but it seems that everything stops after that. Once these PWM signals are generated, how do they talk to the switches (power mosfets?) that comprise the inverter? Where at in this plethora of code does the switch get turned from a 0 to a 1? Is it possible to control this some other way?

FYI, I am assuming that the PWM modules talk to the inverter somehow based on a few things. Namely, the HVACI_scalar.c file essentially 'stops' control wise after calling the pwm macro, and the flow charts in the documentation for Scalar ACI Control show the PWM module talking to the 3 phase inverter.

Furthermore, once this is cleared up for me, is it even possible to replace the PWM module with something else? For instance, could a '6 pulse' macro be written to replace the pwm macro (in theory, I understand that it wouldn't improve performance)? 

Thanks,
Mike 

  • The PWM signals turn the switches on and off. In the HVACI_scalar.c the ISR frequency is 10kHz. This is the frequency (PWM frequency) at which the switches are being turned on and off. The duration for which they are turned on and off are based on the duty cycle of the pwm signal. In the schematic for the board you have purchased you will notice  that PWM 1,2 and 3 signals A&B are connected to the inverter module with the A signals switching the high side gate and the B signals turning the low side gate. These in turn "open and close" the MOSFETs. As far as generating signals with similar functionality, one could use timers but then the PWM peripheral is designed for this purpose. I hope that clarifies things a little. 

  • Thanks for the reply. Let me see if I have this straight-- the outputs of the PWM module are tied directly to the switches? I suppose this is why the PWM 'blocks' are located in the drivers for the MCU itself instead of with other math blocks. From what you said, I'm guessing that it is possible to replace the PWM functionality with something else, but would likely be more work than it's worth. 

    EDIT: which schematic are you referring to? There are a lot to fish through and I'd appreciate it if you could point me in the right direction.  

  •  1007.HVMotorCtrl+PFC-SCH[R5].pdf

    The second page specifically shows the PWMs connected to the inverter module.

    The power module used in this kit is a hybrid having both the Gate Driver IC and the IGBTs. "Gate driver IC's generate the current and voltage necessary to turn MOSFETs or IGBTs on and off from the logic output of a DSP, micro-controller or other logic device. " Accordingly the PWMs are tied to driver inputs. 

    The PWM block, while manipulating variables, also changed register values and that may be why it is found with the drivers. 

    Timers can be used and may not necessarily be more work, but since the peripheral is dedicated for this functionality I am not sure there is much to be gained. TI folks and other experts reading this may point out something I am not aware of. 

  • You mention 'timers' as a possibility to replace the pwm generation... I understand how this would work in principle (I think), but as far as actually coding it, I'm sure there is a lot I would have to do to get it to play nicely with the MCU. I really don't even know where to start with that. 

    For instance, the Scalar ACI generates a voltage to be outputted according to the V/Hz profile. This voltage/frequency combination is given to a space vector generator, which then feeds into the pwm generator. I'm guessing I would have to replace both the space vector generator and the pwm generator (how?), and I'm still not sure how I can tie into the switches in the programming. (My guess is that I would have to have the 'outputs' of the timer called the same thing as the outputs from the pwm module because those outputs are already tied to the driver inputs which control the inverter switches.) 

    Thanks again.  

  • Mike,

     What ever frequency you want your switches to turn at, you'd need to set up the timer to fire interrupts at that frequency. Within that period, you would turn the GPIO high and low to output the appropriate duty cycle which you would get from the space vector generator. You could think of the PWM peripheral as a dedicated timer unit for this functionality. The PWM peripheral has features such as dead band generation that will be quite cumbersome (in my opinion) to code manually.

    Anyway, in the kit that you have the PWMs are already tied to the inverter. I just had a look at HVACI_Scalar-DevInit_F2803x.c, and the PWM pins can be configured as outputs so could generate signals based on timers. But I'd say stick with the PWMs - I'm curious as to why you want to avoid the PWM peripheral?

  • Thanks again for the response.

    I suppose I would need to brush up on my C to be able to do that. I hate to keep asking for more, but could you point me in the right direction regarding a 'timer' program? I'm curious what it would look like.

    I'm going to end up using the PWM peripheral for this motor control project, but my advisor thought it would be worth looking into the possibility of controlling the switches manually in case we wanted to do something exotic with the board further down the road.  

  • Actually come to think of it, its probably going to be quite a lot of stuff. If the device is running at 60MHz, then you'll need to calculate the prescaler so that the timer has a base of period of your PWM frequency. After that, based on your duty cycle you will want the timer to interrupt at the beginning of the period so that you can read current values from the ADC and commence calculations. When the timer period is 0, you could flip the GPIO high and when the timer value equals the duty cycle percentage of the period you flip the GPIO pin low. The PWM peripheral does the same thing except you do not have to manually write to the GPIO each time - it intelligently flips based on your input.

    http://www.ti.com/lit/ug/sprugl8b/sprugl8b.pdf is the guide for timers and http://www.ti.com/lit/ug/spruge9e/spruge9e.pdf is the guide for PWM peripheral.

    I think the TI folks can confirm (and brag) that these devices and peripherals are designed for all kinds of "exotic" motor control operations.