21.01.2014 Views

3.22EjemploDRM007 Co..

3.22EjemploDRM007 Co..

3.22EjemploDRM007 Co..

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Software Design <strong>Co</strong>nsiderations<br />

interrupt handler is used for the speed control and continuous generation<br />

of reference speeds, including positive and negative values, so the<br />

agitator moves in both directions of rotation.<br />

5.9.1.5 Spin CW and Spin CCW<br />

When the Spin process is selected in either direction, the motor<br />

initialization is called, and then an acceleration ramp is loaded from a<br />

Spin look up table, and the sign of the reference speed is set according<br />

to the direction of rotation selected.<br />

5.9.1.6 Fixed Reference Speed<br />

When the acceleration ramp table of the Spin process is fully loaded, the<br />

reference speed remains constant.<br />

5.9.2 InitPLL(void)<br />

This function is called once in the application. It sets the bus frequency<br />

to 8 MHz with an external crystal of 4 MHz.<br />

5.9.3 InitPWMMC(void)<br />

This function initializes the PWM module for motor control with the<br />

following settings:<br />

• PWM frequency of 15.625 kHz<br />

• Two microseconds of deadtime<br />

• Reload every PWM cycle<br />

5.9.4 InitTimerA(void)<br />

Timer A and timer A channel 1 are initialized for speed control and<br />

commutation control. The overflow interrupt is enabled for speed control<br />

each millisecond. Channel 1 is configured as an input capture channel<br />

with interrupt enabled on any edge. This channel is connected to Hall<br />

sensor A.<br />

DRM007<br />

BLDC Motor <strong>Co</strong>ntrol Board for Industrial and Appliance Applications<br />

90 Software Design <strong>Co</strong>nsiderations MOTOROLA

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!