beautypg.com

Motorola M68HC08 User Manual

Page 99

background image

Software Design

State Diagram

DRM028 — Rev 0

Designer Reference Manual

MOTOROLA

Software Design

99

The output compare function is used to synchronize initiating the
dc-bus current sampling with the PWM cycle, and also for the
commutation timing.

Error Handler

If the BLDC motor is controlled properly, commutation events must be
locked to the back-EMF zero crossing feedback. When that feedback
is lost, commutation time is derived from previous commutation
events. If feedback does not recover during a defined number of
commutations (constant — C_MaxErr), then the situation is evaluated
as irrecoverable commutation error, and the fault state is entered.

Measurement Handler

The measurement handler assures that the measurement process is
done in the right order. The dc-bus voltage, speed command, and
temperature are scanned sequentially. After the state has run three
times, all the values for dc-bus current, dc-bus voltage, speed input,
and temperature are updated. dc-bus current is scanned with a
constant time period in the current measurement ISR, but the
over-current condition is evaluated in the main software loop. After a
defined number (I_OVC_Cnt) of successive over-current events, the
control flow enters into the fault state.

5.5.6 Running State

The BLDC motor is run with regular feedback. The speed controller is
used to control the motor speed by changing the value of PWM duty
cycle.

Figure 5-11

shows the state transitions.

Measurements Handler

Explained in

5.5.5 Back-EMF Acquisition State

.

Service of Commutation

Explained in

5.5.5 Back-EMF Acquisition State

.

Service of Received Back-EMF Zero Crossing

F

re

e

sc

a

le

S

e

m

ic

o

n

d

u

c

to

r,

I

Freescale Semiconductor, Inc.

For More Information On This Product,

Go to: www.freescale.com

n

c

.

..