3-phase Brushless DC Motor control with Hall sensors
As the use of BLDCM is increasing, we will build a simple example of BLDCM with a sensor-based control. In this example, we use a DC source to drive a three-phase brushless DC motor through a DC/AC inverter. Then install three Hall Effect sensors to measure the position of the rotor. Hall Effect sensor is one kind of position sensors which is often used when a motor requires a high initial or starting torque. Hall sensors send hall signals to control the commutation sequence while the north pole (shown as the red magnet) is in front of any of them.
To get a DC source (can also use a battery), left-click Components/Circuit/Source/V (step 1) and release the mouse. The voltage follows the cursor and right-click to change its direction (step 2). Until the voltage source is upward, left-click to put the voltage source on the workscreen. Currently we have not set an electric ground so that CASPOC will give a suggested message to insert an electric ground automatically. Click yes to insert the ground (step 3). Make sure there is a ground label shown in the anode of the DC source after the auto-insertion (step 4). Right-click on the voltage source (step 5) to modify its parameter. In the pop-window, enter value = 150 (step 6), make the rotary direction is 90 degree (step 7) and click OK to save the settings (step 8).
Here we need six MOSFETs and six diodes to build a DC/AC inverter. Left-click Components/Circuit/Semiconductors/D/MOSFET (step 1) and release the mouse. The MOSFET follows the cursor and left-click on the workscreen to put the MOSFET in the upper right corner of the voltage source. Right-click on the MOSFET (step 2) to change its parameters. In the pop-window, we can see the parameters as below (step 3):
- Rds(on) = 10m ohm (drain-source on resistance)
- Rds(off) = 100k ohm (drain-source off resistance)
- Vds(on) = 0 volt (drain-source voltage)
- BVdss(Vmax) = 1e35 volts (breakdown voltage – the maximum voltage)
Make sure that the rotary direction is 90 degrees (step 4) and then click OK to save the setting (step 5).
Again, left-click Components/Circuit/Semiconductors/MOSFET (step 1) and release the mouse. Left-click on the workscreen to place the second MOSFET in the right side of the first MOSFET (step 2). Right-click the MOSFET to modify BVdss(Vmax) = 1e35 (step 3), check the rotary direction is 90 degrees (step 4), and click OK to save the setting (step 5). Repeat the previous steps to add four more MOSFETs with the following configuration (step 6-9).
Left-click Components/Circuit/Semiconductors/D (step 1) and release the mouse. The diode follows the cursor and right-click to change its direction (step 2). Until the cathode of the diode is upward, left-click to put the diode in the right side of the first MOSFET (step 3). Right-click the diode to modify its parameters. In the pop-window, we can see the parameters as below:
- Rd(on) = 10m ohm (diode resistance at ON state)
- Rd(off) = 100k ohm (blocking diode resistance)
- Vd(on) = 0.7 volt (diode voltage)
- BV(BreakDown) = 1e35 volts (breakdown voltage) (step 4)
Make sure the rotary direction is 270 degrees (step 5) and click OK to save the settings (step 6).
Again, left-click Components/Circuit/Semiconductors/D (step 1) and release the mouse. Left-click on the workscreen to put the second diode in the right side of the second MOSFET (step 2). Right-click the diode to modify BV(BreakDown) = 1e35 (step 3), check the rotary direction is 90 degrees (step 4), and click OK to save the setting (step 5). Repeat the previous steps to add four more MOSFETs with the following configuration (step 6-9).
To measure the current value between the DC source and the inverter, add a current sensor in the DC circuit. Left-click Components/Library/Sensor/Current/I (step 1) and release the mouse. Left-click on the workscreen to put the current sensor around the cathode of the MOSFET and the anode of the DC voltage source (step 2). Right-click on the current sensor to change its internal resistance R= 1n (=1 nano ohm) (step 3). Make sure the rotary direction is 0 degree (step 4) and click OK to save the setting (step 5). Connect all the MOSFETs, diodes and the voltage source with the following configuration (step 6). Make sure there is a ground label (electrical ground) in the anode of the voltage source (step 7).
Also, we put a three-phase current sensor for measuring the output currents of the DC/AC inverter. Left-click Components/Library/Sensor/Current/I_3phase (step 1) and release the mouse. Left-click on the workscreen to put the 3-phase current sensor in the right side of the inverter (step 2). Left-click on the current sensor to modify its parameter. In the pop-window, enter R=1u (=1 micro ohm) (step 3), make sure the rotary direction is 0 degree (step 4) and click OK to save the setting (step 5). Then, connect the current sensor and the inverter with the following configuration (step 6).
Give labels for the output values of these current sensors. To get the direct current value, right-click on the bottom output of the current sensor (step 1) to give a label. In the pop-window, enter label = I_dc (step 2) and click OK to save the setting (step 3). To get the 3-phase alternating current values, assign 3 labels to the 3 bottom outputs. Right-click the bottom left one (step 4), enter label = I_a (step 5) and click OK to save the setting (step 6). Right-click the bottom center one (step 7), enter label = I_b (step 8) and click OK to save the setting (step 9). Right-click the bottom right one (step 10), enter label = I_c (step 11) and click OK to save the setting (step 12).
Our goal is to drive a BLDC motor by using a DC voltage source and an inverter. To add a BLDCM, left-click Components/Library/ElectricalMachines/Brushless/Brushless (step 1) and release the mouse. The BLDCM follows the cursor and left-click on the workscreen to put it in the right side of the 3-phase current sensor. Make sure that the 3-phase current inputs are well connected to the current sensor (step 2). Right-click on the BLDCM (step 3) to modify the parameters. In the pop-window, we can see the parameters as below (step 4):
- Friction = 1m Nm/Rad/s (friction of the bearing)
- JR = 100m Kgm˛ (rotor inertia)
- Ke = 1 Vpeak/(Rad/s)=Nm/A (torque / back EMF constant)
- LS = 1m H (winding inductance per phase)
- RS = 100m ohm (winding resistance per phase)
- Rm = 1000 ohm (the resistance in parallel with the magnetizing inductance for modeling the eddy current and hysteresis losses in the electrical machine)
- Polepair = 1 (number of pole pairs)
Click OK to save the settings (step 5).
According to BLDCM’s high starting torque, we use Hall Effect sensors to measure the rotor’s position in order to control the ON/OFF states of the six MOSFETs in the inverter. Left-click Components/Sensor/Rotational/Encoder/HallThreePhase (step 1) and release the mouse. Left-click on the workscreen to put the hall sensors in the right side of the BLDCM. Make sure that the BLDCM is well connected with the hall sensors (step 2). Right-click on the hall sensors (step 3) to modify its parameters if needed. In the pop-window, we can see the parameters as below (step 4):
- Initial Position = 0 degree (phase delay due to the placement of the hall sensors with respect to the stator pole)
- Phase Delay(from 60 to 120 degrees) = 120 degrees (distance between the hall sensors according to the number of the pole pairs)
- Pole pairs = 1 (number of the pole pairs)
- Pulse width = 180 degrees (pulse width of the hall output signal, mostly 180 degrees)
Click OK to save the setting (step 5).
To get the hall signals and control the ON/OFF state of MOSFET, we use a commutation sequence. Left-click Components/Library/ElectricalMachine/Brushless/CommutationSequence (step 1) and release the mouse. Left-click on the workscreen to put the commutation sequence below the DC/AC inverter. Connect the three bottom outputs of the hall sensors to the right inputs of the commutation sequence (step 2).
Assign three labels to the three hall output signals. Right-click on the first input signal (step 3), enter label = H1 (step 4) and click OK to save the setting (step 5). Right-click on the second input signal (step 6), enter label = H2 (step 7) and click OK to save the setting (step 8). Right-click on the third input signal (step 9), enter label = H3 (step 10) and click OK to save the setting (step 11).
Connect the gates of these MOSFETs to the commutation sequence with the following configuration (step 1). Also assign six labels for the six gates: Right-click on the upper left gate (step 2), enter label = QH_1 (step 3) and click OK to save the setting (step 4). Right-click on the lower left gate (step 5), enter label = QL_1 (step 6) and click OK to save the setting (step 7). Right-click on the upper center gate (step 8), enter label = QH_2 (step 9) and click OK to save the setting (step 10). Right-click on the lower center gate (step 11), enter label = QL_2 (step 12) and click OK to save the setting (step 13). Right-click on the upper right gate (step 14), enter label = QH_3 (step 15) and click OK to save the setting (step 16). Right-click on the lower right gate (step 17), enter label = QL_3 (step 18) and click OK to save the setting (step 19).
To measure the voltage values after the inverter, we assign also three labels: Right-click on the upper anode of the 3-phase current sensor (step 1), enter label = V_a (step 2) and click OK to save the setting (step 3). Right-click on the middle anode of the 3-phase current sensor (step 4), enter label = V_b (step 5) and click OK to save the setting (step 6). Right-click on the lower anode of the 3-phase current sensor (step 7), enter label = V_c (step 8) and click OK to save the setting (step 9).
Before adding a mechanical load, install an encoder which provides the information of torque (T), power (P), angular speed (ω) and the position of the rotor(θ). Left-click Components/Library/Sensor/Rotational/Encoder (step 10) and release the mouse. Make sure the encoder is well connected with the hall sensor (step 11). Assign the torque output a label by right-clicking it (step 12), enter label = T (step 13) in the pop-window, and then click OK to save the setting (step 14).
Add a mechanical load for the rotating rotor of BLDCM. Left-click Components/Library/Mechanic/Rotational/LoadQuadratic (step 1) and release the mouse. Left-click on the workscreen to put the quadratic load in the right side of the encoder. Make sure the load is connected to the encoder (step 2). Right-click on the quadratic load to modify its parameters (step 3). In the pop-window, we can see the parameters as below (step 4):
- J = 100m kgm˛ (inertia)
- Tn = 100 Nm (reference nominal torque)
- Wn = 150 Rad/s (reference nominal angular speed)
Click OK to save the setting (step 5).
First, we take a scope for getting the direct current value. Click the scope icon in the experience bar (step 1) and release the mouse. Left-click to put the scope below the commutation sequence (step 2). Left-click the right-bottom corner of the scope and hold down the mouse to enlarge this scope (step 3). Connect the label I_dc to the input trace of the scope.
Take second scope to read the 3-phase alternating current values (step 1). Click the scope icon in the experience bar (step 2) and release the mouse. Left-click to put the scope below the first scope. Left-click the right-bottom corner of the scope and hold down the mouse to enlarge this scope (step 3). Left-click the first blue input trace and draw it leftward a bit to extend its length (step 4). Repeat the same steps with the second red and the third azure input traces.
Right-click the first input trace (step 5) to add a label. In the pop-window, enter label = I_a (step 6) and click OK to save the setting (step 7). Right-click the second input trace (step 8) to add a label. In the pop-window, enter label = I_b (step 9) and click OK to save the setting (step 10). Right-click the third input trace (step 11) to add a label. In the pop-window, enter label = I_c (step 12) and click OK to save the setting (step 13).
Take third scope to read the 3-phase voltage values (step 1). Click the scope icon in the experience bar (step 2) and release the mouse. Left-click to put the scope below the second scope. Left-click the right-bottom corner of the scope and hold down the mouse to enlarge this scope (step 3). Left-click Components/Library/Sensor/Voltage/v2 (step 4) and put it in the left side of the third scope. Right-click the upper input of the voltage differential sensor (step 5), enter label = V_a (step 6) in the pop-window and then click OK to save the setting (step 7). Right-click the lower input of the voltage differential sensor (step 8), enter label = V_b (step 9) in the pop-window and then click OK to save the setting (step 10).
Take three more scopes to read 3 hall signals (step 1). Click the scope icon in the experience bar (step 2) and release the mouse. Left-click to put the scope below the second scope. Left-click the right-bottom corner of the scope and hold down the mouse to enlarge this scope (step 3). Repeat the steps to put two more scopes (step 4 and 5). Left-click the first blue input trace of scope 4 and draw it leftward a bit to extend its length, the same steps for scope 5 and 6. Right-click the first input trace of scope 4 (step 6) to add a label. In the pop-window, enter label = H1 (step 7) and click OK to save the setting (step 8). Right-click the first input trace of scope 5 (step 9) to add a label. In the pop-window, enter label = H2 (step 10) and click OK to save the setting (step 11). Right-click the first input trace of scope 6 (step 12) to add a label. In the pop-window, enter label = H3 (step 13) and click OK to save the setting (step 14).
Take 2 more scopes to read the torque value and the ON/OFF states of the upper gates. Click the scope icon in the experience bar (step 1) and release the mouse. Left-click to put the scope below the sixth scope. Left-click the right-bottom corner of the scope and hold down the mouse to enlarge this scope (step 2). Repeat these steps to add one more scope below scope 7 (step 3).
Left-click the first blue input trace of scope 7 and draw it leftward a bit to extend its length. Right-click the first input trace of scope 7 (step 4) to add a label. In the pop-window, enter label = T (step 5) and click OK to save the setting (step 6).
Left-click the first blue input trace of scope 8 and draw it leftward a bit to extend its length. Repeat the same steps with the second red and the third azure input traces. Right-click the first input trace of scope 8(step 7) to add a label. In the pop-window, enter label = QH_1 (step 8) and click OK to save the setting (step 9). Right-click the second input trace of scope 8 (step 10) to add a label. In the pop-window, enter label = QH_2 (step 11) and click OK to save the setting (step 12). Right-click the third input trace of scope 8 (step 13) to add a label. In the pop-window, enter label = QH_3 (step 14) and click OK to save the setting (step 15).
Take ninth scope to read the ON/OFF states of the lower gates. Click the scope icon in the experience bar (step 1) and release the mouse. Left-click to put the scope below the eighth scope. Left-click the right-bottom corner of the scope and hold down the mouse to enlarge this scope (step 2).
Left-click the first blue input trace of scope 9 and draw it leftward a bit to extend its length. Repeat the same steps with the second red and the third azure input traces. Right-click the first input trace (step 3) to add a label. In the pop-window, enter label = QL_1 (step 4) and click OK to save the setting (step 5). Right-click the second input trace (step 6) to add a label. In the pop-window, enter label = QL_2 (step 7) and click OK to save the setting (step 8). Right-click the third input trace (step 9) to add a label. In the pop-window, enter label = QL_3 (step 10) and click OK to save the setting (step 11).
Take the last scope for reading the angular speed of the rotor. Click the scope icon in the experience bar (step 1) and release the mouse. Left-click to put the scope below the encoder. Left-click the right-bottom corner of the scope and hold down the mouse to enlarge this scope (step 2). Connect the angular speed output (ω) to the first input trace of scope 10 (step 3).
Click the short-cut of simulation parameter (step 1). In the pop-window, select Euler for the Numerical Integration Method (step 2), Tscreen = 500m, dt = 100u (step 3) and then click OK to save the setting (step 4).
Click the short-cut of start simulation and then we can see the measured information is shown in all the scopes. From the scopes, we can see that in order to reach a certain angular speed, the starting torque is very high. After 50 milliseconds, the torque drops and keeps stable, so does the current value.
The following picture shows the structure inside the BLDCM. The red part represents the North Pole and the blue the South Pole. When the North Pole is in front of any of these hall sensors, a hall signal will be sent to control the commutation sequence. In the end of the simulation, we can see the first and third hall sensors are both sending a hall signal because of the North Pole. Only second hall sensor sends no signal at the moment. We can also find that ON/OFF state of these MOSFETs strongly depend on the hall signal for either upper or lower gates.
Hall sensor commutation
To control BLDC motors, 6-step, or 120 degrees trapezoidal control based on hall-sensors offers a very elegant and cost-effective solution. The figure above shows the block diagram of this scheme in which the motor is driven by a 3-phase H-bridge inverter. The commutation table block provides logic sequence to drive 6-switches of inverters and plays a very important role in the 6-step commutation control.
The 6-step commutation or 120 degrees trapezoidal control is characterized by a two-phase ON operation to control the 3-phase inverter. In this control scheme, torque production follows the principle that current should flow in two of the three phases at the same time and that the angle between the stator magnetic field and the rotor flux is kept close to 90 degrees to get the maximum generated torque. The next figure describes the electrical waveforms of motor voltage, current and hall-sensor signals with respect to rotor angle of BLDC motor. Typically most of BLDC motors are supplied with 3 integrated hall-sensors placed 120 degrees from each other. This provides the required digital signals (high/low) for the controller to determine the rotor position in intervals of 60 electrical degrees. The 120 degrees hall placement is the most popular configuration because in normal conditions it never generates the codes in which all three hall-sensors signal are high or low simultaneously. This means binary codes 111 or 000 are invalid and this allows for an easier fault detection mechanism.  
The information given in above figure can be easily deducted in the form of six state commutation table for 3-phase inverter, as shown in the table below. This table provides the proper sequence of excitation of motor phases with respect to binary code generated from 3-hall sensors. The correct commutation table is fundamental for a 6-step commutation algorithm to rotate the motor efficiently and to make sure that current is injected to proper phase at right time duration when its back-emf is in the flat-top region. For clarity of symbol convention, + sign in the table means that back-emf in particular phase is positive and a positive current must be injected in phase, and –sign means back-emf is negative and negative current must be injected in the phase. Positive direction of current is assumed to be entering the motor phase terminal and negative current direction means leaving out of motor phase terminal. OFF means current is zero in the phase.
Hall Sensors |
Motor Phases |
||||
HA |
HB |
HC |
PH_A |
PH_B |
PH_C |
1 |
1 |
0 |
OFF |
+ |
- |
0 |
1 |
0 |
- |
+ |
OFF |
0 |
1 |
1 |
- |
OFF |
+ |
0 |
0 |
1 |
OFF |
- |
+ |
1 |
0 |
1 |
+ |
- |
OFF |
1 |
0 |
0 |
+ |
OFF |
- |
If you’re able to get the above diagram of motor phases voltages with respect to hall-sensors from the datasheet or motor manufacturer, you can easily deduct the commutation table for a 3-phase inverter. However, it is found that there is significant inconsistency in the information provided by the manufacturer. There are several standards for labeling the motor phases: A,B,C or U,V,W or R, Y B. Likewise the hall-effect sensor connections are named and labeled: HALL A, B, C or Hall 1,2,3. In these circumstances, it becomes difficult for the end user to determine the right commutation table.
The good thing among all these inconsistencies is that hall sensors are always consistent if they are placed 120 degrees apart. This means that in between two consecutive commutation sequences only one hall-effect signal changes the logic either from high to low or from low to high.