Motor Control Class: Lecture 12 - Motor Control System

Showing results for 
Show  only  | Search instead for 
Did you mean: 

Motor Control Class: Lecture 12 - Motor Control System

NXP Employee
NXP Employee

This is the last lecture of the Motor Control Class with Model Based Design. In this 12th lecture we discuss about the overall motor control application developed under the Model Based Design Toolbox with Matlab and Simulink.

We are going to assemble all the blocks developed throughout this course and we will have the motor running in closed loop controlled via a PI Speed Controller.


We show how configure the FreeMASTER to create nice control panels for the applications and how you can validate the Speed Controller and overall Motor Control application.


Main topics:

- Speed Controller implementation in Simulink for real time systems;

- Motor and Inverter protection for over-current, over- and under-voltage;

- FreeMASTER control panel using HTML and Java Script;

- Various validation tests;



    - Understand the motor control systems and how to put together all the pieces to get the motor up and running;

    - Understand the requirements and validate the final product;   


NOTE: Chinese viewers can watch the video on YOUKU using this link





Additional information:

    - Simulink models used in this video;

    - FreeMASTER control panel;

    - ClosedLoop_Control.mot file that can be flash with RAppID.exe bootloader or S32DesignStudion;

Original Attachment has been moved to:

Update revisions:

February 25, 2019

May 06, 2020

4 Replies

Contributor III

Hi,   dumitru-daniel.popa

      First of all thank you for your great work.
      In the model, only the speed closed-loop control is used. The duty cycle signal is obtained from the output of the PI controller. Then the duty cycle of the six switch tubes is obtained according to the phase change table. I would like to ask you:
      Question 1: What should I do if I want to add three current loops to control the three-phase current?
My idea is that the output of the speed PI controller gets the amplitude of the reference current, and then the three-phase current reference is obtained based on the Hall signal lookup table. After three current PI controllers, the three-phase reference voltage is obtained. Is my idea right so far? After getting the three-phase reference voltage, how do I get the duty cycle signal of six switches as you did?

     I drew a control chart:

     Question 2: You are switching as shown in Figure 1, and the upper and lower arms seem to be independent. If I want to implement the approach of Fig. 2, one phase arm is complementary, the second phase is grounded, and the third phase is not powered. What should I do?


                                                Figure 1


                                              Figure 2
     In addition, I use HVP-MC3PH.

Good luck!

wang xuan

NXP Employee
NXP Employee

Hi wangxuan

In regards with question number #1, my advice is to implement a protection like this in case of BLDC 6-step commutation:


You read the DC bus current and depending on how much value is drawn from the power source you should limit the amount of voltage that is applied to the motor phase (duty cycle)

Of course you could do it your way as well but you will load the CPU with unnecessary computations. Also since the phase currents tends to have a square phase and the each phase is disconnected 2 times per commutation sequence you will have discontinuities in the PI controllers. 

Your proposed method works for PMSM where all phases are powered all the time but is not suitable here.

In regards with question number #2 why do you want to do that ? You will increase the commutation losses since you will have significant more transistor switches. As far as i know that complementary PWM control method can be used in case you want to reduce the voltage stress of the transistors. In the original method the voltage stress is Vdc - the lower transistor needs to switch the entire Vdc while the method you are proposing is having a voltage stress of Vdc/2. For most of the transistors at such low DC level that should not be an issue. Are you planning to use the setup for high voltages - in that case that would make sense.

Anyhow - is case you wish to go with complementary PWM control method, then you need to modify the PWM blocks and the way the BLDC communtation blocks (standard Simulink logic) of how the PWM duty cycles is computed. In the example model the 6-step commutation is implemented with state-flow diagrams. 

My advice - just simulate the new 6-step commutation based on complementary method and then add the PWM output blocks to test on real HW.

Hope this helps!


Contributor III


    Thank you very much for your good advice.

    I will adopt the suggestion in Question 1: Use the bus current to do the PI control of the current loop.
    For Question 2: I would like to ask you again:Can  HVP-MC3PH drive the BLDC motor with low rated voltage? For example 48V.

     About HVP-MC3PH platform with 48V motor considerations:

     I tried to write the following points:Can I use the HVP-MC3PH high-voltage platform to drive low-voltage DC brushless motors, I mainly consider from the following two points:

     1. The main circuit power supply mode of HVP-MC3PH is: All power supplies are powered by bus voltage Busbars can be powered by two power supplies, ie through the rectifier circuit input, or through the PFC converter.

     + 15V power supply

     The +15V level is generated by the bus voltage through the LNK306GN switching boost/buck converter. The converter can provide up to 300mA of current. This voltage level provides the bias voltage for the IGBT of the three-phase inverter bridge of the IPM smart model.So when powered in standard mode (both the power board and the control board are powered by the power cord and accessed from the power connector), all circuits are powered by the main power input. No additional low voltage power supply can be used to power the IPM module.

    2. After obtaining the above conclusions, referring to the schematic diagram of HVP-MC3PH, the power board is set to prevent over-current, over-voltage and under-voltage fault protection, and the fault signal is divided into two signals. Indicates motor overcurrent, PFC overcurrent, and DC bus undervoltage conditions. The fault_2 signal indicates overvoltage on the DC bus and it is active high.

      The core of all problems lies in the undervoltage protection action of the board. The default signal is derived from the VFO fault output pin of the IPM module, which has internal UVLO (undervoltage lockout) protection for the upper tube control bias voltage. If this voltage is lower than 10.5V, the IPM fault status is set. The fault_1 signal connected to J11 pin 25 is forced low to indicate that the controller has failed.So when the voltage is lower than about 10.5V VDC, the automatically generated fault signal (fault_1) is active low. So this is the lowest voltage I think.

      So I think even if it is lower than HVP-MC3PH user manual: Input voltage AC: 90-240V / DC: 110-390VDC, but above 20VDC (safety), it should also work normally.


     Is my idea right so far?

Best regards
wang xuan 

0 Kudos

NXP Employee
NXP Employee

MPC5744P and MotorGD DevKits Setup for Motor Control Application.

For all the models, applications and videos shown in this course, the MPC5744P DevKit was configured to use external power supply from the MotorGD DevKit Power Stage.

The MCP5744P DevKit jumper configurations are show below:



The MotorGD DevKit Jumper configurations configurations are show below:


The MotorGD DevKit and Linix Motor 45ZWN24LINIX - sensors and phase connections are shows below:



If you setup the boards this way and presumably if you have the same motor type, then by simply using the files attached below and the How To Program the Application in the Flash/RAM you should be able to have the motor running in OPEN or CLOSED loop.