Implementing Embedded Speed Control for Brushless DC Motors: Part 3 -

Implementing Embedded Speed Control for Brushless DC Motors: Part 3

In earlier parts in this series of articles (Part1 and Part2), ourdiscussion of BLDC motor control using the 120-degree Hall-sensormethod covered a number of points.

To summarize, Hall sensors are an integral part of 120-degree,six-step trapezoidal control. These sensors are used to detect rotorposition and to make appropriate state changes (known as thecommutation sequence). Using position and timing information, we canmeasure speed and implement appropriate control. Thus, Hall sensorsprovide all of the necessary feedback information for the rotor.

This method of control has several advantages. It is easy to use,the required code is simple, and switching is straightforward. Theswitching has built-in dead time and does not require a special timer.Commutation or switching can be directly connected to the Hall signalsfor simplicity. Moreover, this method implements effective speedcontrol.

However, Hall-sensor based control does have its disadvantages. Hallsensors increase the cost of the motor and require that five more wiresbe connected. Also, the sensors add another source of EMI to the motor.Their behavior is noisy, too. They are susceptible to corrosion and areusually the first component in the system to fail. If the motor is ahermetically sealed system, Hall sensors will require extra seals.

As shown in Figure 21, below ,using an R8C/13series MCU, the 120-degree Hall-sensor control methodincorporates a Timer C, which performs the modulation function at 20kHz frequency. The R8C MCU has an internal structure that allowsfirmware to multiplex on the output pins as necessary to generatemodulation. Firmware can connect the timer C output directly to a pin,or it can disconnect timer C from that pin and set the pin's state toeither high or low. That is, the firmware can change the output tohigh, low, or modulation.

Figure21. R8C/13 based system configuration for six step control of a BLDCmotor.

Looking at Figure 21 above ,notice that firmware also can connect the upper three pins, the lowerthree pins, or one pin at a time. Six outputs are directed to theintegrated power module (IPM), which in turn connects to the threephases of the motor. Three Hall signals are received on three interruptpins—INT1, INT0, and KI3—on the rising or falling edges.

Timer X, used as the speed measurement counter, measures timebetween two consecutive Hall signals and provides CountMeas for thespeed-control loop. The INT3 pin is used as an emergency-shut-downinterrupt when a high-current or a high-temperature alarm signal isreceived from the IPM.

The R8C MCU has eight ADCs that can be used to implement tasks suchas measuring temperature, bus voltage, pressure, and current. Currentmeasurement is particularly important, because measuring averagecurrent through several electrical cycles lets us compute torque andspeed fairly accurately.

By combining speed measurement and current measurement, firmware candetermine the point on the torque speed curve at which the motor isoperating. Since the R8C MCU has several GPIO pins, the firmware canuse an LED on/off scheme to alert us to the internal state of thealgorithm and the performance of the motor.

Because the 16-bit R8C MCU runs at a 20 MHz CPU frequency andincludes on-chip flash and SRAM, designers can use this device tocreate single-chip solutions. The MCU's peripherals include eightchannels of ADC, three 8-bit timers with pre-scalars, and a flexible16-bit input-capture and output-compare timer that can generate up tosix PWM outputs.

The device also has a watchdog timer with ring oscillator, twoserial interfaces, a power-on reset function, a low-voltage detectfunction (generally known as brown-out detect), and an internalclock-generation circuit. Additionally, the MCU has up to 22 I/O pinsand 8, 12, or 16KB of flash plus 512 bytes, 768 bytes, or 1KB ofon-chip RAM.

Data flash is an especially important feature of the MCUs in theR8C/13 family. The two extra 2KB blocks of data flash havehigh-endurance write/erase capability and can eliminate the need forexternal EEPROM for a true single-chip solution. An R8C-based BLDCmotor control power board is shown in Figure22 below with motor interfaces and IPM placement.

Figure22. R8C MCU and integrated power module based motor control referenceplatform.

Sensorless BLDC control
As noted earlier, a significant disadvantage of Hall sensors is theircost. One way to reduce the overall cost of the motor is to eliminatethem.

The 120-degree modulation, six-step method of control does allow theuse of back-EMF signals to detect the rotor position. Recall that onlytwo of the power switches are turned on at each state change; one isleft off. In fact, one entire set of up-and-down switches is notpowered on. This is best understood by looking at the Up and Unsequence shown in Table 1 and also looking at Figure 23, below.

First the Up switch is turned on for 120 degrees of rotation. Thenfor 60 degrees there is no power in the U phase. The Un switch isturned on for the next 120 degrees and again, there is no power fornext 60 degrees. Thus, every 120 degrees there is a time period of 60degrees during which we can observe the back-EMF generated by therotating magnet.

When Up is energized, current is high in the U coil. When Un isenergized, current is low in the U coil. At this point the currentchanges direction from positive to negative, thus creating a zerocrossing. Detecting a zero crossing is equivalent to detecting therotor position. However, instead of detecting 60 degrees, 90 degreesare detected.

Thus, we can use zero-cross detection to identify the rotor positionand then wait until the proper angle is reached to change the state.For example, when a zero crossing is detected at 90 degrees, thefirmware can wait another 30 degrees of rotation to perform a statechange. The speed-control algorithm remains the same, but a wait periodhas been added.

Figure23. BLDC motor control without position sensor.

Now let's compare the Hall-sensor based algorithm to the back-EMFbased algorithm. Both methods use the 120-degree six-step method andperform a state change every 60 degrees. Both methods use the sametrapezoidal technique to control speed. The difference between twomethods lies in which signal is used for commutation.

The sensor-based method uses the Hall signal for commutation. Assoon as the signal arrives, the state must be changed. The back-EMFmethod detects a zero crossing, waits for another 30 degrees ofrotation, and then makes the state change. Again, in both methods, thespeed-control algorithm and pattern recognition technique are the same.

Figure24. Back EMF detection for symmetric modulation of power switches.

Since both methods use the same type of modulation and the samesequence for energizing phases, both have torque ripple, lowefficiency, and high noise. Noise is particularly noticeable when a lowcarrier frequency is used. The response for speed control is acceptablewhen the sensor-based algorithm is used, but it is slow for thesensorless algorithm and in some cases inadequate.

Further, there are issues with zero-crossing detection. Zerocrossing happens in between modulations, when a particular phase is notenergized. As Figure 24, above shows,the MCU output is modulating each switch 60 degrees. Output for theinverter shows modulation from rail to rail on the voltage. When thisvoltage is compared to 1/2 Vcc, the zero crossing becomes visible andthen is detected by the interrupt.

Implementation example
Proper implementation with comparators using an R8C/1A MCU is shown in Figure 25, below . Back-EMF isdetected from the phase voltage, which is high. Thus, a resistor ladderis used to scale down the input into the MCU. Comparators are used toinput high or low voltages in interrupt pins as they did in theHall-sensor example.

In this case, when the interrupt is received, the timer X is readand its count is divided by 2. A second counter is then started thatwill be reset when it reaches one half the timer X count. When thatreset occurs, the state change is made.

The example shown here uses Timer Y for this purpose. This constructis required because the state change must be delayed for a 30-degreerotation period. Since we have measured the 60-degree rotation time,it's easy to calculate the 30-degree period. Note that because this R8CMCU uses comparators instead of an ADC, it is an extremelycost-effective solution.

Figure25. R8C/1A based sensorless implementation with Back EMF detection.

There is little difference between sensor and sensorless control interms of MCU processing. The pattern calculation and speed processingare essentially the same. See Figure26, below. When output stage calculations are done withzero-crossing detection rather than Hall sensors, however, one moretimer is required to accommodate the waiting period. This may alsochange the input masks, which are similar to those used for the Hall120-degree and 60-degree control methods.

Calculations for duty cycle and the bus voltage measurement andcorrections are unchanged. Experience shows that proper signalconditioning is required for signals going into the comparators.Otherwise, errors can occur in detecting zero crossings, resulting inpoor speed control and high torque ripple.

Figure26. Control flow for sensorless (Back EMF detection)implementation.<.b>

Like the Hall-sensor method, the back-EMF based sensorless controlapproach has advantages and disadvantages. Back-EMF methods eliminateHall sensors and thus reduce implementation costs. The motor is cheaperto build. However, the cost of new sensors is coming down anddecreasing the economic advantage of sensorless motor controllers.

Furthermore, sensorless control has various implementation issues.The process of detecting zero crossings introduces extra noise and maycause poor state changes. Sensorless control methods also introducemore torque ripple. Worse, the speed control performance achieved isnot acceptable in some applications.

Figure27. Aligning the rotor using Vp, Wn, Un coils.

Alignment procedure
It's important to note that before a BLDC motor is commanded to attaina certain speed, its rotor must be aligned properly for smoothoperation. This alignment can be done in various ways. One of thesimplest is to command the Vp, Un, and Wn for a certain time period,giving a predetermined number of pulses to the rotor.

This procedure aligns the south pole of the rotor with the Vp coil,as shown in Figure 27, above ,which shows a motor that has one pole pair. After the rotor is aligned,it will rotate with a fairly predictable amount of torque, startingwith step 1 for a smooth start. The benefit here is that when the rotoris aligned properly, the motor will consume significantly less currentduring start-up than it would if the rotor had not been aligned.

To read Part 1, go to Thebasicsof brushless motor control.
To read Part 2, go to Brushless motorcontrol using Hall sensor signal processing
Next in Part 4: 180 degree modulationin motor control

Yashvant Jani is director ofapplication engineering for the system LSI business unit at RenesasTechnology America.

1. PowerElectronics and Variable Frequency Drives Technology and Applications,Edited by Bimal K. Bose, IEEE Press, ISBN 0-7803-1084-5, 1997
2. MotorControl Electronics Handbook, By Richard Valentine, McGraw-Hill,ISBN 0-07-066810-8, 1998
3. F IRSTCourse On Power Electronics and Drives, By Ned Mohan, MNPERE, ISBN0-9715292-2-1, 2003
4.Electric Drives, By Ned Mohan, MNPERE, ISBN 0-9715292-5-6, 2003
5. Advanced Electric Drives,Analysis, Control and Modeling using Simulink, By Ned Mohan,MNPERE, ISBN 0-9715292-0-5, 2001
6. DC Motors Speed Controls Servo Systems including Optical Encoders,The Electro-craft Engineering Handbook by Reliance Motion Control, Inc.
7. ModernControl System Theory and Application, By Stanley M. Shinners,Addison-Wesley, ISBN 0-201-07494-X, 1978
8. The IndustrialElectronics Handbook, Editor-in-Chief J. David Irwin, CRC Press andIEEE Press, ISBN 0-8493-8343-9, 1997

This article is excerpted from apaper of the same name presented at the EmbeddedSystems Conference Boston 2006.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.