From the series: Motor Control
Melda Ulusoy, MathWorks
This video discusses PWM—pulse-width modulation—and two different architectures to implement PWM control for controlling the speed of a BLDC motor.
PWM is a square wave signal that repeats itself at a certain frequency. Each PWM cycle is called a period, and the percentage of time the PWM signal is on during a given period determines the duty cycle. With PWM, we’re able to adjust a constant DC voltage to different voltage levels. This helps us control a motor at varying speeds. The video demonstrates two common architectures for PWM control. In the first one, we use a buck converter along with a PWM generator to step down the DC source voltage to the three-phase inverter. In the second one, we discuss a different architecture where the three-phase voltages are modulated directly using PWM control.
Check out this video series to learn how to build the models used in this tech talk video.
The model used in this video is available in this GitHub repository.
In this video, we’re going to learn what PWM, or pulse width modulation is and how it’s used to control the speed of a BLDC motor. Previously, we discussed how we can control a BLDC motor at varying speeds by adjusting the DC voltage provided to the three-phase inverter. In this simulation, we used an ideal voltage source which let us generate different DC voltage levels commanded by the controller. But in reality, the DC voltage source we have supplies a fixed voltage which we need to modulate using a technique called PWM or pulse width modulation before providing it to the three-phase inverter.
Here’s what a PWM signal looks like. It’s basically a square wave signal that repeats itself at a certain frequency. To understand how PWM helps with voltage modulation, let’s look at an example. Say that we have a DC voltage source that can supply either 0 or 100 volts. For controlling a motor at varying speeds, we need voltage values ranging from 0 to 100 volts. PWM acts like a switch that takes the DC voltage and applies it to the motor with a series of on and off pulses at a certain frequency. Each PWM cycle is called a period, and the percent of the time the PWM signal is on during a given period gives us the duty cycle. For example, if we have a duty cycle of 50%, this means that in each period half of the time the signal is on and in the other half it’s off. When we drive a motor with this, the effective voltage seen by the motor will be the average of this PWM signal, which is 50 volts. We were able to take the DC voltage of 100 volts and pulse it on and off with a 50% duty cycle to create 50 volts.
Now, if you keep changing the duty cycle, you can continuously modulate this signal and create the whole range of different values between 0 and 100 Volts to control your motor at varying speeds. Note that the longer the duty cycle, the higher the voltage we get. Now we know PWM control has an averaging effect on the output voltage that is seen by the motor. To get this averaging effect right, we should be careful when selecting the PWM frequency, which is computed by 1/period. If the switching frequency is too low, instead of seeing an averaged voltage, the motor will see a voltage that tries to follow the square wave shape. This will lead to poor tracking of the reference speed and the motor will keep speeding up and slowing down. However, when we increase the PWM frequency to a certain reasonable value, the voltage will be averaged out, which will improve the speed control performance. Note that the ripples will occur due to the switching nature of PWM. Typically, PWM frequencies to control BLDC motors are on the order of a few kilohertz and need to be selected to be much higher than the reciprocal of the motor time constant.
Now that we’ve discussed PWM conceptually, we’ll look at two common architectures used to implement PWM. Here’s the first one. In this model, we want the BLDC to track a desired speed that gradually ramps up from 0 to 600 RPM. This model consists of similar blocks that we saw in the previous video except this part where we implement PWM control by using a buck converter. The buck converter is used to adjust the DC source voltage to different voltage levels in order to be able to control the BLDC motor at varying speeds. In this simulation, the input to the buck converter is provided by this DC voltage source block which supplies 500 Volts. Let’s look inside this subsystem to understand how the buck converter works. What we see here is a PWM generator that generates a square wave signal at 1 kHz. If we go up, we see that the input to the PWM generator is the duty cycle, which is determined by the controller. The signal created by the PWM Generator fluctuates between 0 and 1 and controls the on and off duration of the two switches of the buck converter. Depending on this duration, we observe a different amount of voltage drop at the output of the buck converter.
Here, we measure two voltages; one at the input of the buck converter which is the DC source voltage and the second one at the output of the buck converter which gives us the modulated DC voltage that is then provided to the three-phase inverter. Now, we’ll run this model and take a look at both of these voltages as well as the reference and measured speeds.
In the upper plot, we see that the DC source voltage is 500 Volts. The second one shows us the modulated DC voltage by the buck converter. As a result of the voltage modulation, we’re able to control the motor at the different speeds we see in here. Here, the measured speed is shown in orange which successfully tracks the desired speed shown in green.
We discussed BLDC speed control using this architecture where a PWM generator is used along with a buck converter to provide a modulated DC voltage to the three-phase inverter. Let’s take a look at the second architecture to see how PWM control is implemented in this one. The first thing we notice here is that this model doesn’t use a buck converter. In the first model, we were modulating the voltage provided to the three-phase inverter. But in this model, we modulate the phase-voltages directly. Here, the PWM is used under commutation logic subsystem which we’ll take a closer look at next.
Here is the PWM generator. According to this logic we see here, the PWM generator output makes sure that the DC source voltage is pulsed on and off to energize the correct phases based on the sector the rotor is in. The easiest way to understand how voltage modulation is being performed here is to simulate this model and observe the phase-voltages. Now, we’ll run the model and take a look at the speed, sector, phase-A and phase-C voltages. As seen in the speed plot, in this region the speed is constant. So, let’s zoom into here to better see how phase-voltages change as the motor is running at a constant speed. According to this logic, when the rotor is let’s say in sector one, these two inputs are selected. This one commands a high and a low signal for A and C phases, respectively. And this input does exactly the opposite by sending a low signal to A and a high signal to C. The PWM generator switches between these two states based on its duty cycle, and as a result here we see how the phase-A and phase-C voltages are pulsed on and off between +/-250 Volts which is +/-DC source voltage/2. When the phase voltages are modulated like this, the effective voltage seen by the motor will be averaged.
Remember in the previous we discussed how the back-EMF is induced during the non-commutating phase. The back-EMF voltages seen in the plots gives us a clue about the averaged voltage that’s seen by the motor. For example, when the phase-A is not being commutated this is the phase A back-EMF voltage which tells us that the phase-A voltage seen by the motor will be around approximately 25 Volts throughout this region whereas the phase-C voltage seen by the motor will be around -25 Volts. Using this clue, we can simply figure out what the effective voltage is during the rest of the commutated phases.
In summary, we discussed the concept of PWM and how it’s used to control a BLDC motor at varying speeds. We also talked about two common implementations of PWM and simulated these models to take a closer look at the voltage and speed characteristics during PWM control. You can also check out our other video series where we show how to build the models that we use in these tech talk videos. Please find the link to the series below.
In the next Tech Talk videos, we’ll discuss PMSM motors and field-oriented control. For more information on BLDC and PMSM motor control, don’t forget to check out the links below this video.
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.