Design BLDC Motor Speed Controller in Simulink 

 October 1, 2021

By  Addepalli Dolendra Vikas


In this blog, we will be going through what a BLDC or Brush Less DC motor is, how is it different from the Permanent Magnet Synchronous Machines, and how to design a Speed Controller for BLDC in Simulink.

Required Add-Ons

  • Simscape
  • Simscape Electrical

BLDC Motors

            Everyday devices to the more complex machines use brushless dc motors that convert electrical energy into rotational mechanical energy. Brushless dc motors, also referred to as BLDCs, have many advantages over the brushed dc motor. BLDC motors require less maintenance and provide higher efficiency. That’s why these motors replaced brushed dc motors in many applications.

             BLDC motor operates on the same principle as the brushed motors in which rotational motion is generated through the attraction and repulsion of the magnetic poles of permanent and electromagnets.
Permanent and electro magnet

Permanent and electro magnet

The way these motors are controlled is very different. These motors require a complex controller to convert DC power to the three-phase voltages. To better understand this, let’s look at the BLDC motor structure.

BLDC motor structure

BLDC motor structure

Here the rotor is a Permanent magnet, and the stator is a three-phase Coil winding. This is a DC motor turned inside out. There are various BLDC motors with different magnet arrangements. The stator may have a different number of windings, and the rotor may have multiple pole pairs.

            A permanent magnet (PM) AC motor, which has a trapezoidal back-EMF, is referred to as a BLDC motor. The BLDC motor drive system is based on the feedback of the rotor system at fixed points for communication of the phase currents.

Wave forms

Wave forms

The BLDC motor requires quasi-rectangular shaped currents fed into stator windings of the machine. Alternatively, the voltage may be applied to the motor every 1200, with a current limit to hold the current within motor capabilities. Because the phase currents are excited in synchronism with the constant part of the back-EMF, constant torque is generated.

            The electromagnetic torque developed by the BLDC motor is a function of PM flux and current. Back-EMF in each phase is trapezoidal and is 1200 displaced (electrical) to each other. A rectangular current pulse is injected into each phase. The phase current coincides with the flat portion (1200) of the back-EMF waveform. Hence, the motor develops almost constant torque.

             The following is the functional block diagram of the BLDC motor controller.
Functional block diagram of the BLDC controller

Functional block diagram of the BLDC controller

Design BLDC Controller in Simulink

Note: Before designing the BLDC controller in Simulink, ensure that Simscape and Simscape electrical are correctly installed.

 The following image is the block diagram of the BLDC speed controller in Simulink.
BLDC controller block diagram in Simulink

BLDC controller block diagram in Simulink

Get Access to
Simulink Model!

Design the speed controller to the BLDC Motor or Brushless DC motor in Simulink using the PMSM or Permanent Magnet Synchronous Machine block; Developed in MATLAB R2020b with Simulink, Simscape, and Simscape Electrical

Select the permanent magnet synchronous machine, change its back EMF to trapezoidal in its block parameters, and set the number of phases to 3. To view the output of this block, we need to use the bus selector. In the bus selector, you can view the parameters that the PMSM (Permanent Magnet Synchronous Machine) can give as output. Select the required parameters that you wish to view and close the block. The following image is the switching logic block,

Switching logic block

Switching logic block

The switching block takes the three hall sensor digital signals from the motor as input. It generates the three logic signals for the PWM drive circuit. The following image is the PWM drive circuit,

PWM drive circuit

PWM drive circuit

The PWM drive circuit develops six device driving signals of the three-phase inverter supplying the BLDC motor. The following image is the block diagram o the three-phase inverter,

PWM inverter

PWM inverter

Take the rotor speed as the feedback and feed the error signal to the PID block. Now connect the PID block output to the PWM drive circuit to generate the six device driving signals of the three-phase inverter supplying the BLDC motor accordingly. The following image is the scope data before zooming,

Rotor speed and hall effect sensor digital signal

Rotor speed and hall effect sensor digital signal

The first channel shows the rotor speed of the motor, the speed of the motor is gradually reached to the set value. The remaining three channels are the three hall sensor digital signals. The following image is the scope data after zooming.

Hall effect sensor digital signal

Hall effect sensor digital signal

The following image is the scope data showing the back EMF generated by the BLDC motor,

Trapezoidal back EMF

Trapezoidal back EMF

As we discussed earlier, the back EMF generated by the BLDC motor is trapezoidal.


            Nowadays, DC motors are replaced by these BLDC motors, which require complex controllers, unlike regular DC motors. So, understanding the working of the BLDC motor and its controller will give better intuition on the working latest gadgets. “Simulink” and “Simscape” have made simulating these motors and verifying the control system for these motors easy.

Did you find some helpful content from our video or article and now looking for its code, model, or application? You can purchase the specific Title, if available, and instantly get the download link.

Thank you for reading this blog. Do share this blog if you found it helpful. If you have any queries, post them in the comments or contact us by emailing your questions to [email protected]. Follow us on LinkedIn Facebook, and Subscribe to our YouTube Channel. If you find any bug or error on this or any other page on our website, please inform us & we will correct it.

If you are looking for free help, you can post your comment below & wait for any community member to respond, which is not guaranteed. You can book Expert Help, a paid service, and get assistance in your requirement. If your timeline allows, we recommend you book the Research Assistance plan. If you want to get trained in MATLAB or Simulink, you may join one of our training modules. 

If you are ready for the paid service, share your requirement with necessary attachments & inform us about any Service preference along with the timeline. Once evaluated, we will revert to you with more details and the next suggested step.

Education is our future. MATLAB is our feature. Happy MATLABing!

About the author 

Addepalli Dolendra Vikas

I’m an electronics hobbyist and tech enthusiast. I keep roaming around the stuff that are related to embedded systems, IoT and robotics. I love prototyping stuff and make it work.

  • A. Sai Sharmila says:

    I m recently working on Torque control of bldc motor. Can I check you simulink model if possible.

  • KHUSHAL KHAN says:

    sir i need you simulink model for BLDC motor

  • TSCA Electrical Group of Company Incorporated says:

    Hey, I read your article and your information is very amazing and so much helpful for me. Keep it up and Thank you very much. 🙂

  • Chandradhekhar says:

    Useful sir. Pl provide details of pwm driver circuit. One input to relational operator is pid and other input chain? Pl explain the block between pmsm and pwm inverter.
    My mail id is *********@gmail.com (Email ID Removed in Moderation)
    Thank u.

  • {"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}

    MATLAB Helper ®

    Follow: YouTube Channel, LinkedIn Company, Facebook Page, Instagram Page

    Join Community of MATLAB Enthusiasts: Facebook Group, Telegram, LinkedIn Group

    Use Website Chat or WhatsApp at +91-8104622179