Main Content

Field Oriented Control of PMSM with Input Power Factor Correction Using Boost Converter

This example shows how to implement power factor correction (PFC) using a boost converter with the C2000™ Microcontroller Blockset. The example uses the Texas Instruments F28069M controlCARD with high voltage motor control kit (TMDSHVMTRINSPIN).

Using this example, you can:

  • Implement PFC using a boost converter with a resistive load.

  • Integrate Field Oriented Control (FOC) of PMSM with input factor correction.

In this example you will learn:

  • Simulate PFC using a boost converter.

  • Run a motor as a load for PFC using QEP Encoder

  • Generate code for the controller and load it on the controlCARD.

  • Monitor signals using the host computer.

Required Hardware

Hardware Connections

For Resistive Load

The High voltage motor control kit (TMDSHVMTRINSPIN) configuration includes the following hardware components:

  • F28069M controlCARD

  • DC power supply

  • Resistive Load

  • Variac

The following steps describe the jumper connections, switch settings and power supply connections for the High voltage motor control kit (TMDSHVMTRINSPIN):

1. Install the Jumpers [Main]-J3, J4 and J5, J9 for 3.3V, 5V and 15V power rails.

2. Unpack the DIMM style controlCARD and place it in the connector slot of [Main]-J1.

3. For controlCARDs with on-card isolated emulation, ex: TMDSCNCD28069MISO:

  • Populate M3-J5 on HV kit (disables power to HVKIT emulator)

  • Do NOT populate J9 on HV kit (disables JTAG connection)

4. On the F28069 ISO control card, ensure the following switch settings,

  • SW3: position 1 ON and position 2 ON.

  • SW2: position 1 OFF and position 2 OFF.

  • SW1: position 1 ON and position 2 ON.

5. Connect 15V DC power supply to [M6]-JP1 and ensure that [M6]-SW1 is in the "Off" position.

6. Connect banana cable from [Main]-BS1 to [Main]-BS3 (This will connect the rectifier output to the boost converter input).

7. Connect banana cable from [Main]-BS4 and [Main]-BS5 (This will include the inverter DC bus capacitors in parallel to the pfc output stage capacitors).

8. Connect AC power to the [Main]-P1 through a variac. Ensure AC input to the kit is in the range 15 to 18 V.

For Motor Load

The High voltage motor control kit (TMDSHVMTRINSPIN) configuration includes the following hardware components:

  • F28069M controlCARD

  • DC power supply

  • Resistive Load

  • Variac

Ensure the connection described for resistive load is also made for the Motor load.

Available Models

Resistive Load

Motor Load

The model consists of the plant model and the controller. The plant model consists of three major modules:

  • AC-DC Rectifier: This module takes 15 to 18 V AC input and outputs rectified DC voltage.

  • DC-DC Boost Converter: This module boosts up the input voltage based on the duty cycle of the pulse width modulation (PWM) output.

  • DC-AC Inverter: This module converts the DC input voltage into 3 phase AC voltage which is connected to the motor terminals.

PFC Using Boost Converter

The AC-DC rectification stage uses a traditional uncontrolled H-bridge rectifier. The DC-DC boost converter on the kit has a two-phase interleaved topology. For simplicity, only one phase has been used for the boost operation. The duty cycle of the PWM output determines the amount of boost imparted to the input voltage.

The PFC controller provides current shaping of the AC input and regulates the DC bus. The outer voltage loop ensures that the output DC voltage is maintained at the set reference(24 V) by using a discrete proportional integral (PI) controller.

The inner current loop performs the wave shaping of the input AC current to maintain a high power factor. The reference for the current loop is generated by feed-forward of the rectified DC voltage as well as the output of the voltage control loop.

The output of the PFC controller is the PWM duty cycle of the DC-DC boost converter which is switched at 200 kHz. The controller operates at a rate of 100 kHz i.e. half of the PWM switching frequency.

Motor Load

The PFC stage for the model containing motor load is same as the one described above with the resistive load.

The DC-DC Boost converter output voltage acts as input for the 3 phase inverter which in turn drives the 3 phase PMSM motor. In this model, the 3 phase inverter is switched at 10kHz and the FOC alogorithm is also executed at 10KHz. The motor is controlled using FOC where the motor position is sensed using the QEP Encoder.

The QEP offset for the motor used in the model can be calculated using different low voltage setup. For more, refer to QEP calibration. For more information, refer Quadrature Encoder Offset Calibration for PMSM Motor

The motor control is enabled when the output voltage of the boost converter reaches around 24V.

The PFC control algorithm for motor load is implemented inside CLA.

The signals/states/data stores required to be stored in the CLA memory space is done with the help of the Code Mappings - Component Interface of the Embedded Coder dictionary. The following image shows the elements in the model configured in CLA memory space.

Peripheral Block Configuration

ePWM block for PFC

The PWM signals are generated at a frequency of 200 kHz. The ePWM4 module is configured to operate in up-down count mode. All ADC results are read in (100kHz) ISR labelled PFC_ISR. This ISR is triggered by ePWM4 on every second of CMPB (with a preset value) match event during down count, so that the ISR is triggered only after the ADC conversions are complete.

ePWM block for Motor Load

  • PWMs Synchronization and ADC Start of Conversion*

  • The motor PWM whose frequency is 10kHz generates a synchronization pulse at Counter=0 for the PWM of PFC whose frequency is 200kHz.

  • PFC total inductor current is sampled at the midpoint of the PWM ON pulse. Since the sampled value represents the average inductor current under CCM (continuous conduction mode) condition. PFC inductor current is also oversampled 4 times during each PWM time period. These 4 sampled values are then used to calculate the average PFC inductor current. The voltage signal conversions are also initiated when the PFC switch is on. The 4 SOC triggers are generated when,

  • ePWM4 counter reaches zero and period.

  • ePWM5 counter reaches a preset CMPA values during up and down count.

Overvoltage Protection

An overvoltage protection mechanism is implemented using custom code in System Outputs block. The sensed DC bus output voltage from the ADC input is compared against the overvoltage protection threshold set in the initialization script file. Vpfc_trip_level is the overvoltage threshold point which is set to 35 V for the model. When overvoltage condition is met, the one-shot trip in ePWM is enabled.

Simulate PFC Using Boost Converter

Run the Model

1. Open the c28069pfchvkit model, and click the Run button to simulate the model.

2. Observe the output waveforms on the Results block from the following path c28069pfchvkit > Plant Model > Simulation.

Similarly, open the c28069pfcmotorcontrolhvkit model and perform the above mentioned steps.

Generate Code for Controller and Load It on controlCARD

The deployment model has a real-time interrupt service routines (ISR) configured to trigger PFC control at the rate of 100 kHz.

Load Model with Resistive Load

1. Ensure the hardware connections are made as mentioned in the Resistive Load Hardware Connections section.

2. Turn on [M6]SW1 on the kit to power on the controlCARD.

3. Open the c28069pfchvkit model and generate code by pressing Ctrl+B.

4. Follow the build process by opening the diagnostic viewer using the link at the bottom of the model canvas.

5. Connect an appropriate resistive load to the PFC DC output terminals (BS5 & BS6). Ensure the load resistance is in the range of 20 to 50 ohms.

6. Turn on the AC power supply and gradually increase the AC input ([Main]-P1) to the value between 15 V to 18 V.

  • The PFC algorithm kicks in when the AC input is more than 14 V.

7. Run the host model and observe the output capacitor voltage & the PFC inductor current.

8. Turn off the AC power first and wait for a few minutes for the PFC DC bus capacitor to discharge completely.

Load Model with Motor Load

1. Repeat the steps from 1 to 4 for c28069pfcmotorcontrolhvkit Motor Load model and generate code by pressing Ctrl+B.

2. Connect a high value resistance of 50 ohm across the PFC DC output terminals (BS5 & BS6) so that boost converter does not operate at no load.

3. Turn on the AC power supply and gradually increase the AC input ([Main]-P1) to the value between 15 V to 18 V. The PFC algorithm kicks in when the AC input is more than 14 V.

4. The motor control is enabled, after a delay of 10sec when the boost converter output voltage reaches 24V. By default, the motor starts spinning at speed of around 0.3 per unit.

5. Run the host model and observe the output capacitor voltage & the PFC inductor current.

6. Turn off the AC power first and wait for a few minutes for the PFC DC bus capacitor to discharge completely.

Monitor Signals on Host Computer

The host model receives the data from the hardware kit and plots it to verify the performance of the PFC controller.

Configure and Run Model on Host Computer

1. On the host computer, browse to Device Manager > Ports (COM & LPT) to find the COM port.

2. Set the parameter Port of the following blocks in the c2000_host_pfc model to match the COM port of the host computer:

  • c2000_host_pfc > Serial Configuration

  • c2000_host_pfc > Serial Receive

3. Click the Run button on the Simulation tab to run the host model.

4. While the model runs, you can monitor the boost converter output capacitor voltage and input inductor current to analyze the performance of PFC control.

Similarly, you can configure and run model on host computer using c2000pfcmotorcontrolhostmodel model.

Hardware Results

Resistive Load

The following figure shows the hardware results for the model c28069pfchvkit. Observe the boost converter output capacitor voltage and input inductor current. The following result is taken at a resistive load of 30 ohm.

Motor Load

The following figure shows the hardware results for the c28069pfcmotorcontrolhvkit model. Observe the boost converter output capacitor voltage and motor current.

The following result is taken when motor is running at no load along with resistance of 50 ohm. we can observe that the PFC output voltage is controlled at 24V super imposed with double the line frequency component. The motor load current varies between +/- 0.5A.

In the following image you can observe the PFC inductor current which is a rectified sinusoid along with motor current.

More About