Designing a MCU-driven permanent magnet BLDC motor controller: Part 1

BLDC motors have a lot of advantages in automotive applications. Theyare lighter weight, more durable, and consume less current than theirbrushed cousins. They have an excellent low end torque capability andcan be quite capable of a very wide speed range.

This translates to an optimum solution for many applications withinthe nasty automotive environment we all know and love. Applicationssuch as fuel pump, HVAC blower motor, seat coolingfan, engine cooling fan, AC compressor motor, and water pump , to name a few, canbenefit greatly from BLDC technology .

Anything with a continuous or high duty and/or in need of variable speed control couldeasily benefit both fiscally and durability-wise from BLDC motortechnology.

It wasn't so long ago when BLDC motor controllers were cumbersomeand expensive. Their difficulty to implement, inability to startreliably (without extra positionsensing help ), and overall cost kept the BLDC option off of thetable. The inverters used to drive the windings alone were prohibitivein cost and in size.

Thanks to Moore's law (and the Power MOSFET derivative of it ),the cost and size of these components have dropped dramatically. Somuch so that folks are looking seriously at those aforementionedapplications and thinking positively. When performance and reliabilitygo up, at the same time that costs comes down, the folks that count thepennies begin to smile. I think that we're there.

There are many microcontrollers that can easily control a brushlessmotor. Some are morecapable than others at doing this task. A lot has to do with theirperipherals. Some have the right kind of analog to digital convertercontrols allowing synchronous sampling of an analog voltage.

Others have dedicated motor control peripherals allowing forefficient Back EMF sensing, proper timing of different keymoments in a brushless control algorithm. Since there are severaldifferent micros to choose from, we will begin by focusing on the tasksat hand, controlling a brushless motor, and then start getting a bitspecific as we get into the design of the controller itself.

Typical motor configurations
A brush-type permanent magnet motor has the magnets in the stator, orthe stationary part of the motor, and the windings in the rotor. As therotor rotates between the brushes, the commutation, or switching fromone phase to the next, naturally happens. It's a mechanical thing. Itis a simple and somewhat reliable solution although brushes are theweakest link in the durability “chain.”

Brushless motors are just that, brushless. They have to commutatethe windings by some other means other than brushes and commutatorbars. We hope to do it using semiconductors. Things are a bit switchedaround in a brushless motor. In a permanent magnet brushless DC motor,the magnets are in the rotor and the switched, or commutated, windingsare in the stator.

Figure1. Wye and Delta winding configurations

This takes a fairly simple design, brushes and commutator bars, andmakes it much more complex (resistors,MOSFETs, capacitors, a microcontroller, Voltage regulator ),more reliable, easier to use, cheaper and better ” we know it will bebetter… It has to be.

Typical brushless motors are three phase machines with either wye ordelta wound stators , with the vastmajority of them being wye wound. The driving mechanism is the same forboth.

The difference is that a wye wound machine has one end of all of thephases connected together in the middle. If there are three phases thenthis looks like a “Y”; hence the “wye” nomenclature. A delta woundmachine ties the ends together such that, for a three phase machine,the configuration looks like a triangle, or a delta.

Phases and Poles
Phases refer to the number of separate sets of windings in the stator.Within a phase there may be a number of poles. Poles are typicallyreferred to in pairs of 2, 4, 6, 8, or more (or it can be expressed inpole pairs such as 1, 2, 3, or 4 pole pairs).

Each phase will have the same number of poles. In a 3 phase 2 polemotor going around the 360° (electrical) corresponds to the actualor mechanical 360° rotation.

As poles are added, the number of electrical degrees is multipliedto create the same mechanical or rotational degrees. For example, a 4pole machine will take 720° (360°x2) electrical to obtain onefull revolution of the rotor.

Other than this subtle difference, the number of poles does notchange how the motor is driven. It only changes the actual speed of themotor with a given “electrical speed.”

Back Electro-Motive Force
Take a brushless motor of any kind, stick an oscilloscope across anytwo leads and spin the rotor. You will see a periodic voltageoscillating at a frequency proportional to the motor rotational speed(see “Phases and Poles” above).

This is the basic result of passing a winding through a magneticfield (or B-Field). The changing B-field causes a voltage to appearacross the windings. This voltage is called Back Electro-MotiveForce , Back EMF, or BEMF for short.

Figure2. Back EMF voltages in a spinning motor (Top: Three Phases; Bottom:Three Phases Overlap)

A motor can be wound such that the waveform you get when you spin itis either sinusoidal or more trapezoidal. Figure 2 above illustrates a moretrapezoidal configuration. Driving a sinusoidal wound motor with a purethree phase sinusoidal signal provides the smooth control needed forapplications like electric power steering.

However, the applications addressed here do not require suchfinesse. These applications just need to spin at a given speed. Alittle torque ripple due to not being driven optimally is not a bigissue. As a result, this discussion is limited to trapezoidal wound /controlled motors.

Driving the Phases
A trapezoidally driven three phase brushless motor traverses 360degrees electrical through a six step approach as shown in Figure 3 below . Each phase is drivenfor 120 degrees electrical then tri-stated for 60 degree electrical.

At any given point, one phase is driven high and another is drivenlow with the third phase left floating, or tri-stated. That tri-statedportion of the waveform is where the BEMF is transitioning from onepolarity to the other. The rotor position information for commutationtiming is found during this transition time.

Figure3. Driving a three phase brushless motor

Position Sensing – When to Commutate
Sensing the BEMF generated during normal rotation of the rotor is a”free” solution to knowing rotor position. An easy reference point iswhere the BEMF transits from one polarity to another, or the “zerocrossing point.”

The “zero crossing point” occurs during the 60° electrical timewhen the phase is floating. Commutation does not occur at this point;rather it is used as a reference point to get a good idea as to wherethe rotor is positioned.

Figure4. A simplified illustration of the three phases of a driven motor.

The BEMF information used to discern rotor position is essentiallythe voltage from the center point to the motor lead of the floatingphase. To measure this voltage, we have to know what the center pointis.

One typical method is to fabricate this neutral voltage by tyingthree resistors together, one from each phase. Another common method isto tap into the neutral point directly. The method to be discussed herewill do something altogether different ” and better.

Figure5. One phase during normal PWM switching

As stated earlier, in a trapezoidally driven BLDC motor, at anygiven moment one phase is pulled high, and other is pulled low whilethe third is floating and in transition from either high-to-low orlow-to-high. If the MOSFET that is pulling the one phase high ischopped, then motor inductance will cause that phase voltage to fall tojust below ground as the lower transistor conducts on that phase in thereverse direction (see Figure 6 below ).

Figure6.Inductance causes the current to continue to flow when the high-sideswitch is turned off.

Starting from when the Phase A upper switch is off and the lowerswitch is conducting from ground (Figure6 above ), the following equations can be generated:

From phase A, we can derive the value of the neutral voltage Vn:

From phase B, we can derive the value of Vn in a different way:

For the unused Phase C we can derive the value of Vn in a third way:

From (1) and (2), we derive a value of Vn that is independent ofmotor inductance or resistance:

In a balanced three-phase system the sum of the phase EMF voltagesis equal to zero:

Incorporating equation (5) into equation (4) yields

Using equations (3) and (6) the terminal voltage Vc can beexpressed:

A few observations can be made. First, the voltage seen at VC iszero when the BEMF on phase C is crossing zero. Second, the gain of theBEMF signal is 150% of the actual BEMF.

From this it is apparent that the sensitivity of this sensing methodis superior to anything that has to attenuate the sensed voltage priorto bringing it into a control circuit.

The ability to sense BEMF is the key factor in fast and reliablestarting. This is the fastest way of starting a brushless motor. Withthis, you can even drive any higher voltage motor without any signalattenuation.

Figure 7 below illustrateswhat the micro sees when sensing BEMF in this way. Note that the zerocrossing information is well within the 5V range of the micro input.

Figure7. BEMF signal sensing at the micro – capped at 5V.

Since there needs to be an “off-time” to discern the BEMF on theunused phase, the PWM duty cycle is limited to a maximum. This limitsthe amount of power the motor can deliver since the phases can never befully turned on.

At this point the BEMF is quite high. During this time, the sensingmethod can change from sensing only when the upper phase isfreewheeling to when the upper phase is on.

This requires dynamically adding a voltage divider on the phasesense inputs and changing the zero crossing reference point (see the “high-side Sensing” block in Figure 8 below ). Using threemicro ports and three resistors the system can, on demand, begin toattenuate the BEMF signal such that the micro can “read” the unusedphase voltage when the high-side switch is on.

This changes the zero crossing point from something close to zerovolts (according to Equation 7 above ) to something close to half of thebattery voltage. If we go back through the equations with the Phase Ahigh-side switch still on, the resulting neutral or center pointvoltage looks like this:

Now using this new reference point (1/2VDC) when the other twophases are active (one driven highand the other low ) and attenuating the phase voltageappropriately, the motor can be driven with no PWM-ing or chopping.

This provides for a full-on condition. Attenuation of the BEMFsignal at this point is not critical. The motor is already spinningfairly quickly and generating a healthy amount of BEMF.

Figure8. A running motor at full duty cycle.

Starting a sensorless motor
There is only one minor catch with sensing BEMF to determine rotorposition. In order to rotate the motor properly, and in the rightdirection, the position of the rotor must be known first.

But that information is not available until the rotor is spinning.So, the rotor is pulled into a known position by powering two phasesand holding them for a while. This provides a known electricalpositioning of the motor.

Figure9. Current and motor speed information at start-up.

From that position, the phases can be stepped blindly as a steppermotor would be but in a way that smoothly accelerates the rotor up to a”sense-able” speed. At that point, the BEMF sensing can be used todetermine when to commutate the stator.

Next in Part 2: Designing thehardware and software

David Swanson is a principalengineer in the Automotive Business Unit of STMicroelectronics. He has a BSEE from North Carolina State University and holds severalautomotive-related patents. Kurt Perski is a Microcontroller FieldApplications Engineer with STMicroelectronics, whose professionalinterests focus on embedded software design.

Leave a Reply

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