AN1661 Freescale Semiconductor / Motorola, AN1661 Datasheet - Page 9

no-image

AN1661

Manufacturer Part Number
AN1661
Description
Low Cost Universal Motor Chopper Drive System
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
MAKE_PI
Subroutine
RAMPE
Subroutine
AN1661
MOTOROLA
The MAKE_PI subroutine is entered when a time event occurs. The
main job is the calculation of the actual speed and the calculation of the
PI controller. The input value for the speed calculation is a good filtered
16-bit output value from the input capture interrupt. A 32/16-bit division
is used where the 32-bit number is a constant and the 16-bit number is
the output from the input capture interrupt.
The constant can be calculated from this expression:
Where:
For the PI controller, a well-known equation is used:
Where:
The output from the PI controller is the input value for the MCU’s PWM
peripheral block.
The RAMPE subroutine is entered when a time event occurs. In fact, this
subroutine changes the slope of the command speed’s signal. The slope
is the same for the rising and falling edges and can be modified through
a change in the time interval for the RAMPE subroutine.
CONST = N x INCAP
CONST = Constant for division
N = Maximal number of result 255
INCAP
tachometer signal (376 for 15,000 RPM and 6-MHz crystal)
CONST = 255 x 376 = 95,880 (00017688 hex)
V = VZ_1 + P_CONST x (E - EZ_1) + I_CONST x E
V = Actual new value
VZ_1 = V in last step
P_CONST = Proportional constant
E = command_speed — actual_speed
EZ_1 = E in last step
I_CONST = Integration constant
Freescale Semiconductor, Inc.
For More Information On This Product,
Min
Go to: www.freescale.com
= Minimal number of counts between two edges of
MIN
Control Algorithm
Application Note
9

Related parts for AN1661