12.07.2015 Views

3-Phase BLDC Motor Sensorless Control Using MC56F8013

3-Phase BLDC Motor Sensorless Control Using MC56F8013

3-Phase BLDC Motor Sensorless Control Using MC56F8013

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

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

Chapter 5Software Design5.1 IntroductionThis section describes the design of the drive’s software blocks. The software description comprises thefollowing two topics.• Main Software Flow Chart• Data Flow5.2 Main Software Flow ChartThe main software flow chart incorporates the main routine entered from the reset and interrupt states.The Main routine includes the initialization of the hybrid controller and the main loop. There are twoinitialization routines, one belonging to Processor Expert, and the other to the application program. Insidethe application initialization, also used power stage and motor parameters are loaded.The main loop incorporates the application state machine — the highest software level which providessettings for other software levels (<strong>BLDC</strong> motor commutation control, zero crossing offset control, speedcontrol, alignment current control, current limitation control). The inputs of the application state machineare the RUN/STOP switch state, the required speed omega, and the drive fault status. The requiredmechanical speed can be set from the FreeMaster or manually by the UP and DOWN push-buttons.The RUN/STOP switch is checked to provide an input for the application state machine (application runmode or stop mode).The main software flow chart is given in Figure 5-1.Interrupt service subroutines perform the main commutation tasks:• Commutation timing — IsrCommutation– Uses quad timer 0– Calling period depends on motor speed. At 2000 RPM for a 2-pole-pair motor, the commutationperiod is 2500 µs.– Performs commutation and commutation related actions, if required. It cooperates with driversinside BldcZC.c.• Speed and alignment current control — IsrSpeedCurrent<strong>Control</strong>Uses quad timer 2Calling period is 200 µs.Includes all PI controllers required for speed and alignment current regulations. To limit the DC-buscurrent, it runs a current limiting PI controller in parallel with these PI controllers. It also providesalignment timing.• ADC sampling — IsrADCEndofScanThe calling period is defined by the PWM frequency and the PWM reload prescaler. In thisapplication, the calling period is 50 µs.3-<strong>Phase</strong> <strong>BLDC</strong> <strong>Motor</strong> <strong>Sensorless</strong> <strong>Control</strong> using <strong>MC56F8013</strong>, Rev. 0Freescale Semiconductor 53

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

Saved successfully!

Ooh no, something went wrong!