Home
DRM025, 3-Phase BLDC Motor Control with Hall Sensors Using
Contents
1. Figure 6 5 DSP56F805EVM Jumper Reference Designer Reference Manual DRMO025 Rev 0 56 System Setup MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc System Setup DSP56F805EVM Set Up Table 6 2 DSP56F805EVM Jumper Settings Jumper Group Comment Connections JG1 PDO input selected as a high 1 2 JG2 PD1 input selected as a high 1 2 JG3 Primary UNI 3 serial selected 1 2 3 4 5 6 7 8 JG4 Secondary UNI 3 serial selected 1 2 3 4 5 6 7 8 JG5 Enable on board parallel JTAG Command Converter NC Interface JG6 Use on board crystal for DSP oscillator input 2 3 JG7 Select DSP s Mode 0 operation upon exit from reset 1 2 JG8 Enable on board SRAM 1 2 JG9 Enable RS 232 output 1 2 JG10 Secondary UNI 3 Analog temperature input unused NC JG11 Use Host power for Host target interface 1 2 JG12 Primary Encoder input pone for quadrature encoder 2 3 5 6 8 9 JG13 Secondary Encoder input selected 2 3 5 6 8 9 JG14 Primary UNI 3 3 Phase o selected as Analog 2 3 5 6 8 9 JG15 Secondary UNI 3 Phase A Overcurrent selected for
2. Figure 3 1 System Concept The control process is as follows The state of the user interface is periodically scanned while the speed of the motor is measured each new coming edge from the Hall sensors only one phase is used for speed measurement According to the state of the control signals Start Stop switch speed Up Down buttons the speed command is calculated The comparison between the actual speed command and the measured speed generates a speed error The speed error is input to the speed PI controller that generates a new corrected duty cycle The duty cycle value together with commutation algorithm creates the PWM output signals for the BLDC power stage Designer Reference Manual MOTOROLA System Description 31 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc System Description Designer Reference Manual The Hall sensor signals are scanned independently on a speed control Each new coming edge of any Hall sensor signal calls the interrupt routine which provides the commutation algorithm In case of under voltage the PWM outputs are disabled and the fault state is displayed DRM025 Rev 0 32 System Description MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Designer Reference Manual 3 Ph BLDC Motor Control with Hall Sensors Section 4 Hardware Design 4 1 Contents 42
3. PCmaster software Hall sensors Scope observes actual Hall sensors state DC Bus under voltage fault protection The introduced BLDC drive is designed to power a low voltage BLDC motor equipped with Hall sensors which is supplied with the EVM Motor Board The motor has the following specifications Table 3 1 Specifications of the Motor and Hall Sensors Motor Specification 3 Phase BLDC Motor eMotor Type 4Poles Speed Range lt 5000 RPM Line Voltage 60V Phase Current 2A Position Sensor Specification Sensor 1 Type 3 Phase Hall Sensors Sensor 2 Type Quadrature Decoder 500 Pulses Per Revolution 3 3 Application Description A standard system concept is chosen for the drive see Figure 3 1 The system incorporates the following hardware boards Power Supply 12V DC 4Amps EVM Motor Board BLDC Motor IB23810 with Hall sensors Evaluation Board DSP56F805 DRM025 Rev 0 Designer Reference Manual 30 System Description For More Information On This Product Go to www freescale com MOTOROLA DRMO025 Rev 0 Freescale Semiconductor Inc System Description Application Description The DSP runs the main control algorithm According to the user interface and feedback signals it generates 3 phase PWM output signals for a 3 phase inverter DSP56F80x EVM DSP56F80x PC Remote Control Speed Calculation Commutation Handler
4. MASK 0 1 or 2 3 or 4 5 Figure 5 2 PWM Swapping and Masking for BLDC Motor 5 4 Software Implementation The general software diagram incorporates the Main routine entered from Reset and the interrupt states see Figure 5 3 The Main routine provides the initialization of the DSP initialization of the application and then it enters an infinite background loop The background loop contains an application state machine The following interrupt service routines are utilized Input Capture ISR TimerAO A1 A2 services signals generated by the Hall sensors Input Capture ISR TimerA3 services period measurement for speed calculation Timer ISR services the speed controller and LED diode blinking Designer Reference Manual DRMO025 Rev 0 44 Software Design MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Software Design Software Implementation e Push Button Up ISR and Push Button Down ISR services Up and Down push buttons e SCI ISR services communication with the PC master software Reset Initialization Main loop State Machine Figure 5 3 State Diagram General Overview 5 4 1 Initialization The Main Routine provides initialization of the DSP e Disables Interrupts e Initializes DSP PLL e Disables COP and LVI e Initializes the Timer for time base reference 20ms e Initializes LED e Initializes the PWM modu
5. Rev 0 Designer Reference Manual MOTOROLA Target Motor Theory and Control 21 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Target Motor Theory and Control PWM switching ON PWM Q1 OFF ON PWM Q2 OFF ON PWM Q3 OFF ON PWM Q4 OFF ON PWM Q5 OFF ON PWM Q6 OFF 10 20 30 40 50 60 70 80 90 Electrical angle Figure 2 4 Independent Switching of Power Transistors 2 3 2 Complementary Switching of Power Transistors NOTE Designer Reference Manual With complementary switching two transistors are switched on when the phase of the BLDC motor is connected to the power supply But there is a difference during freewheeling With independent switching all the transistors are switched off The current continues to flow in the same direction through freewheeling diodes and until it falls to zero Contrary to this with complementary switching the complementary transistors are switched on during freewheeling Thus the current may be able to flow in the opposite direction Figure 2 5 depicts the complementary switching Both described switching modes are able to work in bipolar or unipolar mode For detailed information about bipolar and unipolar modes see the Application Note DSP56F80x MC PWM Module in Motor Control Applications Figure 2 4 and Figure 2 5 illustrate the bipolar switching mode The presented application utilizes the complementa
6. Rev 0 Appendix B Glossary AC Alternating Current ADC Analogue to Digital Converter brush A component transfering elektrical power from non rotational terminals mounted on the stator to the rotor BLDC Brushless DC motor commutation A process providing the creation of a rotation field by switching of power transistor electronic replacement of brush and commutator commutator A mechanical device alternating DC current in DC commutator motor and providing rotation of DC commutator motor COP Computer Operating Properly timer DC Direct Current DSP Digital Signal Prosessor DSP56F80x A Motorola family of 16 bit DSPs dedicated for motor control DT see Dead Time DT Dead Time DT A short time that must be inserted between the turning off of one transistor in the inverter half bridge and turning on of the complementary transistor due to the limited switching speed of the transistors duty cycle A ratio of the amount of time the signal is on versus the time it is off Duty cycle is usually represented by a percentage GPIO General Purpose Input Output Designer Reference Manual MOTOROLA Glossary 65 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Hall Sensors A position sensor giving six defined events each 60 electrical degrees per electrical revolution for 3 phase motor interrupt A tem
7. Information in this document is provided solely to enable system and software implementers to use Motorola products There are no express or implied copyright licenses granted hereunder to design or fabricate any integrated circuits or integrated circuits based on the information in this document Motorola reserves the right to make changes without further notice to any products herein Motorola makes no warranty representation or guarantee regarding the suitability of its products for any particular purpose nor does Motorola assume any liability arising out of the application or use of any product or circuit and specifically disclaims any and all liability including without limitation consequential or incidental damages Typical parameters which may be provided in Motorola data sheets and or specifications can and do vary in different applications and actual performance may vary over time All operating parameters including Typicals must be validated for each customer application by customer s technical experts Motorola does not convey any license under its patent rights nor the rights of others Motorola products are not designed intended or authorized for use as components in systems intended for surgical implant into the body or other applications intended to support or sustain life or for any other application in which the failure of the Motorola product could create a situation where personal injury or death may occur Should
8. kat n I TN l d yN we A Actual flux vector Figure 2 7 Situation Right Before Commutation VCC Phase A Phase C foe MOS Phase B aon E VCC New flux vector Figure 2 8 Situation Right After Commutation Designer Reference Manual MOTOROLA Target Motor Theory and Control 25 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Target Motor Theory and Control 2 3 4 Speed Control Designer Reference Manual Table 2 1 Commutation Sequence for Clockwise Rotation 4 66 0O Vas Ws ne ee 9 es o Ne ees o Mele 0 o a NC Ves o tt res ves e 78 3 e a Ne pos i Pt does Te Te Table 2 2 Commutation Sequence for Counterclockwise Rotation Hall Sensor A Hall Sensor B Hall Sensor C Commutation ensures the proper rotor rotation of the BLDC motor while the motor speed only depends on the amplitude of the applied voltage The amplitude of the applied voltage is adjusted by using the PWM technique The required speed is controlled by a speed controller The speed controller is implemented as a conventional PI controller The difference between the actual and required speed is input to the PI controller and based on this difference the PI controller controls duty cycle of PWM pulses which corresponds to the voltage amplitude required to keep the required speed DRMO025 Rev 0 26 Target Motor Theory and Control MOTOROL
9. Buyer purchase or use Motorola products for any such unintended or unauthorized application Buyer shall indemnify and hold Motorola and its officers employees subsidiaries affiliates and distributors harmless against all claims costs damages and expenses and reasonable attorney fees arising out of directly or indirectly any claim of personal injury or death associated with such unintended or unauthorized use even if such claim alleges that Motorola was negligent regarding the design or manufacture of the part MOTOROLA Motorola and the Stylized M Logo are registered in the U S Patent and Trademark Office digital dna is a trademark of Motorola Inc All other product or service names are the property of their respective owners Motorola Inc is an Equal Opportunity Affirmative Action Employer Motorola Inc 2003 DRMO25 D For More Information On This Product Go to www freescale com
10. Product Go to www freescale com Freescale Semiconductor Inc Designer Reference Manual 3 Ph BLDC Motor Control with Hall Sensors Section 3 System Description 3 1 Contents 3 2 System LOL soe pep adicere doy od Ro REGI SOR e 29 3 3 Application Description n x ea ddd c T RC RC dedo 30 3 2 System Outline The system is designed to drive a 3 phase BLDC motor The application meets the following performance specification e Voltage control of BLDC motor using Hall sensors Targeted for DSP56F805EVM e Running on 3 phase EVM Motor Board Control technique incorporates Voltage BLDC motor control with speed closed loop Both directions of rotation Motoring mode Start from any motor position without rotor alignment Minimal speed 500 RPM Maximal speed 1000 RPM limited by power supply e Manual interface Start Stop switch Up Down push button control LED indication e PC master software control interface motor start stop speed set up e PC master software monitor DRMO025 Rev 0 Designer Reference Manual MOTOROLA System Description 29 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc System Description PC master software graphical Control Page required speed actual motor speed start stop status DC Bus voltage level system status PC master software Speed Scope observes actual amp desired speeds
11. Semiconductor Inc Designer Reference Manual 3 Ph BLDC Motor Control with Hall Sensors Section 1 Introduction 1 1 Contents 1 2 Application Benefit occ docere d ow 309 PORRO GIG SCR RR dads 13 1 38 Motorola DSP Advantages and Features 14 1 2 Application Benefit This Reference Design describes the design of a 3 phase BLDC Brushless DC motor drive based on Motorola s DSP56F805 dedicated motor control device BLDC motors are very popular in a wide application area Compared with a DC motor the BLDC motor uses the electric commutator replacing the mechanical commutator and so it is more reliable than the DC motor In BLDC motors rotor magnets generate the rotor s magnetic flux so that BLDC motors achieve higher efficiency Therefore BLDC motors may be used in high end white goods refrigerators washing machines dishwashers etc high end pumps fans and in other appliances which require high reliability and efficiency The concept of the application is a speed closed loop BLDC drive using a Hall position sensor It serves as an example of a BLDC motor control system design using a Motorola DSP56F805 This Reference Design includes the basic motor theory system design concept hardware implementation and software design including the PC master visualization tool DRMO025 Rev 0 Designer Reference Manual MOTOROLA Introduction 13 For More Information On This Product Go to www freescal
12. System Configurall lt isa n aaae 4p RR RR Ea 33 43 DSP56F805EVM Controller Board Lse 34 AA EVM iGO DOPO ved esa ian 4 d to d d eder do edo 35 4 5 Hardware Documentation aaa saaa acr oe es eden anne 38 4 2 System Configuration The application is designed to drive the 3 phase BLDC motor It consists of the following modules see Figure 4 1 e DSP56F805EVM Controller Board e Evaluation Motor Board e 3 phase BLDC Motor 40w flat U2 ribbon U1 cable 12 GND Controller Board DSP56F805EVM Evaluation Motor Board 12VDC ECMTREVAL IB23810 Hall Sensors Cable Figure 4 1 Low Voltage Evaluation Motor HW System Configuration DRMO025 Rev 0 Designer Reference Manual MOTOROLA Hardware Design 33 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Hardware Design 4 3 DSP56F805EVM Controller Board The DSP56F805EVM is used to demonstrate the abilities of the DSP56F805 and to provide a hardware tool allowing the development of applications that use the DSP56F805 The DSP56F805EVM is an evaluation module board that includes a DSP56F805 part peripheral expansion connectors external memory and a CAN interface The expansion connectors are for signal monitoring and user feature expandability The DSP56F805EVM is designed for the following purposes e Allowing new users to become familiar with the features of the 568
13. evaluation boards it provides a ready made software development DRMO025 Rev 0 Designer Reference Manual MOTOROLA Hardware Design 35 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Hardware Design platform for small brushless dc motors The motor is capable of being controlled with either Hall sensors an optical encoder or with sensorless techniques Figure 4 3 is an illustration of the board Motor Connector Copyright c 20 FVM Motor Soar 0 U tU UU TTTI eoeee s eoeee eee UNI 3 eoeee Connector eoeee eoeee A 99999 al eoeee 4 He es mg Hi GNDA uil sooo L Tus amp TTIIE 5 5 ull a eoeee c THE eo m ER s 999 Emm mm THEE i E TT IB lico 90299 EN it A M TE OO el ni D E Power Supply e e e le Connector e je Figure 4 3 EVM Motor Board 4 4 1 Electrical Characteristics The electrical characteristics in Table 4 1 apply to operation at 25 C and a 12 Vdc power supply voltage Designer Reference Manual DRM025 Rev 0 36 Hardware Design MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Table 4 1 Electrical Characteristics Hardware Design EVM Motor Board Characteristic Symbol Min Typ Max Units Power Supply Voltage Vdc 10 12 16 V Quiescent Current lec 50 mA Min Logic 1 Input Voltage Vin 2 4 V Max Logic 0 Input Vo
14. speed is set by the UP S2 IRQB and DOWN S1 IRQA push buttons see Figure 6 1 If the application runs and motor spinning is disabled i e the system is ready the USER LED LED D13 shown in Figure 6 2 will blink When motor spinning is enabled the USER LED is On Refer to Table 6 1 for application states Designer Reference Manual MOTOROLA System Setup 51 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc System Setup me Figure 6 1 RUN STOP Switch and UP DOWN Buttons at DSP56F805EVM PWM Output LEDs Figure 6 2 USER and PWM LEDs at DSP56F805EVM Designer Reference Manual DRMO025 Rev 0 52 System Setup MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc System Setup Operational Modes Table 6 1 Motor Application States Application State Motor State Green LED State Stopped Stopped Blinking at a frequency of 2Hz Running Spinning On Fault Stopped Blinking at a frequency of 8Hz PC master software Remote Operating Mode The drive is controlled remotely from a PC through the SCI communication channel of the DSP device via an RS 232 physical interface The drive is enabled by the RUN STOP switch which can be used to safely stop the application at any time PC master software enables to set the required speed of the motor PC master software displays the following i
15. 00 architecture The tools and examples provided with the DSP56F805EVM facilitate evaluation of the feature set and the benefits of the family e Serving as a platform for real time software development The tool suite enables the user to develop and simulate routines download the software to on chip or on board RAM run it and debug it using a debugger via the JTAG OnCE port The breakpoint features of the OnCE port enable the user to easily specify complex break conditions and to execute user developed software at full speed until the break conditions are satisfied The ability to examine and modify all user accessible registers memory and peripherals through the OnCE port greatly facilitates the task of the developer e Serving as a platform for hardware development The hardware platform enables the user to connect external hardware peripherals The on board peripherals can be disabled providing the user with the ability to reassign any and all of the DSP s peripherals The OnCE port s unobtrusive design means that all of the memory on the board and on the DSP chip are available to the user The DSP56F805EVM provides the features necessary for a user to write and debug software demonstrate the functionality of that software and interface with the customer s application specific device s The DSP56F805EVM is flexible enough to allow a user to fully exploit the Designer Reference Manual DRMO025 Rev 0 34 Hardware Design MOTO
16. A For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Target Motor Theory and Control Digital Control of a BLDC Motor Power Stage PWM Output Duty Cycle error desired PWM Generator Speed Controller Hall Sensors Figure 2 9 Speed Controller The speed controller calculates a Proportional Integral PI algorithm according to equations below 1 t K d EQ 2 1 u t eo z em d After transformation to a discrete time domain using an integral approximation by a Backward Euler method we get following equations for the numerical PI controller calculation e k w k m k EQ 2 2 u k up k uj EQ 2 3 up k K e k EQ 2 4 u k uk D Kir e k EQ 2 5 I where e k Input error in step k w k Desired value in step k m k Measured value in step k u k Controller output in step k DRMO025 Rev 0 Designer Reference Manual MOTOROLA Target Motor Theory and Control 27 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Target Motor Theory and Control up k Proportional output portion in step k uj k Integral output portion in step k u k Integral output portion in step k 1 T Integral time constant Sampling time Ko Controller gain Designer Reference Manual DRM025 Rev 0 28 Target Motor Theory and Control MOTOROLA For More Information On This
17. C 010 Phase C Phase B 5 lan ABC AU pm 100 001 ABC 101 ABC Hall Sensors Output Figure 2 6 Stator Flux Vectors at Six Step Control The next two figures depict the commutation process The actual rotor position in Figure 2 7 corresponds to the Hall sensors state ABC 110 see Figure 2 6 The actual voltage pattern can be derived from the Table 2 1 Phase A is connected to the positive DC bus voltage by the transistor Q1 phase C is connected to the ground by transistor Q6 and phase B is unpowered As soon as the rotor reaches a certain position see Figure 2 7 the Hall sensors state changes its value from ABC 110 to ABC 100 From Table 2 1 a new voltage pattern is selected and applied to the BLDC motor As can be seen using a six step control technique there is no possibility of keeping the angle between the rotor flux and the stator flux precisely at 90 The real angle varies from 60 to 120 The commutation is repeated per each 60 electrical degrees The commutation event is critical for its angular time accuracy Any deviation causes the torque ripples and hence speed variation Designer Reference Manual DRMO025 Rev 0 24 Target Motor Theory and Control MOTOROLA For More Information On This Product Go to www freescale com DRMO025 Rev 0 Freescale Semiconductor Inc Target Motor Theory and Control Digital Control of a BLDC Motor VCC Phase A Phase C e MP Phase p
18. FAULTA1 1 2 JG16 Secondary UNI 3 Phase B Overcurrent selected for FAULTB1 1 2 JG17 CAN termination unselected NC JG18 Use on board crystal for DSP oscillator input 1 2 NOTE When running the EVM target system in a stand alone mode from Flash the JG5 jumper must be set in the 1 2 configuration to disable the command converter parallel port interface DRMO025 Rev 0 Designer Reference Manual MOTOROLA System Setup 57 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc System Setup 6 5 Projects Files The BLDC Motor Control application is composed of the following files bldc_hall_sensors_sa bldc_hall_sensor_sa c main program bIldc_hall_sensor_sa bldc_hall_sensor_sa mecp application project file bldc_hall_sensor_sa ApplicationConfig appconfig h application configuration file bldc_hall_sensor_sa SystemConfig ExtRam linker_ram cmd linker command file for external RAM bldc_hall_sensor_sa SystemConfig Flash linker_flash cmd linker command file for Flash bldc_hall_sensor_sa SystemConfig Flash flash cfg configuration file for Flash bldc_hall_sensor_sa PCMaster bldc_hall_sensors pmp PC master software file These files are located in the application folder Motor Control algorithms used in the application Acontrollers c h source and header files for PI controller In stand alone application all the necessary resourc
19. Freescale Semiconductor Inc ef oye mE digital dna intelligence everywhere 3 Phase BLDC Motor Control with Hall Sensors Using 56F805 Designer Reference Manual 56800 Hybrid Controller DRM025 D Rev 0 03 2003 MOTOROLA COM SEMICONDUCTORS For More Information On This Product Go to www freescale com Freescale Semiconductor Inc For More Information On This Product Go to www freescale com Freescale Semiconductor Inc 3 Phase BLDC Motor Control with Hall Sensors Using 56F805 Designer Reference Manual Rev 0 by Pavel Grasblum Ph D Motorola Czech System Laboratories Roznov pod Radhostem Czech Republic DRMO025 Rev 0 Designer Reference Manual MOTOROLA 3 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Revision history To provide the most up to date information the revision of our documents on the World Wide Web will be the most current Your printed copy may be an earlier revision To verify you have the latest information available refer to http www motorola com semiconductors The following revision history table summarizes changes contained in this document For your convenience the page number designators have been linked to the appropriate location Revision history Revision mee Page Date Level Description Number s January 50s 1 Initial release N A Designer Reference Manua
20. Motor Theory llle 19 Digital Control of a BLDC MOI oocssdo cech RR RR Rs 20 Section 3 System Description COIS PTTTEETRTTITIU TOL 1501 17 7 707 1 1 27 1215 29 ase CUIRE oa ip pines d Rb Uo ed cob doce eod 29 Application Description L4 uda COO REOR oo EUR REN GN 30 Section 4 Hardware Design bci T TER ETT 33 System Configuration PPP 33 DSP56F805EVM Controller Board 34 EVM Motor Board T 35 Hardware Documentation nnana aaee 38 Section 5 Software Design Designer Reference Manual MOTOROLA 7 For More Information On This Product Go to www freescale com Designer Reference Manual Freescale Semiconductor Inc Table of Contents 54 5 2 5 3 5 4 5 5 6 1 6 2 6 3 6 4 6 5 6 6 hs ji i MPO ee oe Melek ee Pr 39 Software Desc dfi duda ue b Cede he ac ac acc 39 Dala FIO MMC 39 Software Implementation aaua aaa 44 Implementation Notes a na anaana aaea 48 Section 6 System Setup COMENS PPP 51 Operational Modes 2 uod La dada de ehh Sex Sra qr d Wed da 51 Applicaton SGU Sid iusaackAn prius a REX WR dE AE RRN 54 DSP56F805EVM Set Up i2sereuassk wes 4 a RR RR 56 FIBER FIGS 223523 AREE AO dicun oc RR 9 RE RR de 58 Application Build amp Execute 0 0002 e ee eee 59 Appendix A References Appendix B Glossary DRM025 Rev 0 8 MOTOROLA For More Information On This Product Go to www freesca
21. ROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Hardware Design EVM Motor Board DSP56F805 s features to optimize the performance of their product as shown in Figure 4 2 DSP56F805 4 Channel 10 bit D A MODE IRQ RS 232 LOGIC MODE IRQ Interface CAN Interface Address Data amp Control Peripheral Expansion Connector s Program Memory 64Kx16 bit Debug LEDs PWM LEDs Data Memory 64Kx16 bit Over V Sense Over Sense Memory Expansion Connector s pura Mi JTAG JTAG OnCE Primary Connector UNI 3 Parallel Secondary JTAG UNI 3 Interface Low Freq Power Supply Crystal XTAL EXTAL 3 3 V amp GND 3 3V 5 0V amp 3 3VA Figure 4 2 Block Diagram of the DSP56F805EVM 4 4 EVM Motor Board Motorola s evaluation motor board EVM motor board is a 12 volt 4 amp power stage that is an integral part of Motorola s embedded motion control series of development tools It is supplied in kit number ECMTREVAL along with a small brushless dc motor an encoder an encoder cable a 40 pin ribbon cable and mounting hardware In combination with one of the embedded motion control series control or
22. asked not swapped the Phase A is connected to positive DC Bus voltage e Phase B masked disabled e Phase C not masked swapped the Phase C is connected to negative DC Bus voltage The swap of Phase B provides the identical pulses on the upper switch of Phase A and the lower switch of Phase C and conversely on the lower switch of Phase A and the upper switch of Phase C As soon as the rotor passes the sector border Figure 2 8 the commutation is done in two steps swap Phase B unconnected phase e mask disable Phase C unmask enable Phase B After commutation the state of masking and swapping is see Table 2 2 e Phase A not masked not swapped the Phase A is connected to positive DC Bus voltage Phase B not masked swapped the Phase B is connected to negative DC Bus voltage e Phase C masked disabled This commutation process is repeated six times per electrical revolution In complementary switching mode it is necessary to use the software control feature for masking For independent mode it is possible to use the masking feature in the PWM Channel Control Register This feature works properly in independent mode only Designer Reference Manual MOTOROLA Software Design 43 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Software Design SWAP 0 1 or 2 3 or 4 5 PWM Gen 0 24 PWM Gen 1 3 5 PWMO24 i PWM 1 3 5 i i
23. e com Designer Reference Manual Freescale Semiconductor Inc Introduction 1 3 Motorola DSP Advantages and Features The Motorola DSP56F80x family is well suited for digital motor control combining on a single chip the DSP s calculation capability with the MCU s controller features These DSPs offer many dedicated peripherals like a Pulse Width Modulation PWM module Analog to Digital Converter ADC Timers communication peripherals SCI SPI CAN on board Flash and RAM Generally all family members are well suited for various motor controls A typical member of the family the DSP56F805 provides the following peripheral blocks Two Pulse Width Modulator modules PWMA amp PWMB each with six PWM outputs three Current Sense inputs and four fault inputs fault tolerant design with deadtime insertion supporting both center and edge aligned modes Twelve bit Analog to Digital Converters ADCs supporting two simultaneous conversions with dual 4 pin multiplexed inputs the ADC can be synchronized by PWM modules Two Quadrature Decoders Quad DecO amp Quad Dec1 each with four inputs or two additional Quad Timers A amp B Two dedicated General Purpose Quad Timers totaling 6 pins Timer C with 2 pins and Timer D with 4 pins CAN 2 0 A B Module with 2 pin ports used to transmit and receive Two Serial Communication Interfaces SCIO amp SCI1 each with two pins or four additional GPIO lines Serial Peripheral I
24. e module SCI A module that supports asynchronous communication serial peripheral interface module SPI A module that supports synchronous communication software Instructions and data that control the operation of a microcontroller software interrupt SWI An instruction that causes an interrupt and its associated vector fetch SPI See serial peripheral interface module SPI timer A module used to relate events in a system to a point in time Designer Reference Manual MOTOROLA Glossary 67 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Designer Reference Manual DRMO025 Rev 0 68 Glossary MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc For More Information On This Product Go to www freescale com Freescale Semiconductor Inc HOW TO REACH US USA EUROPE LOCATIONS NOT LISTED Motorola Literature Distribution P O Box 5405 Denver Colorado 80217 1 303 675 2140 or 1 800 441 2447 JAPAN Motorola Japan Ltd SPS Technical Information Center 3 20 1 Minami Azabu Minato ku Tokyo 106 8573 Japan 81 3 3440 3569 ASIA PACIFIC Motorola Semiconductors H K Ltd Silicon Harbour Centre 2 Dai King Street Tai Po Industrial Estate Tai Po N T Hong Kong 852 26668334 TECHNICAL INFORMATION CENTER 1 800 521 6274 HOME PAGE http motorola com semiconductors
25. ed fractional numbers SF lie in the following range N 1 1 0 lt SF lt 1 0 2 EQ 5 1 Designer Reference Manual DRM025 Rev 0 48 Software Design MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Software Design Implementation Notes For words and long word signed fractions the most negative number that can be represented is 1 0 whose internal representation is 8000 and 80000000 respectively The most positive word is 7FFF or 1 0 2715 and the most positive long word is 7FFFFFFF or 1 0 2 The following equation shows the relationship between real and fractional representations Real Value Fractional Value E Rance EQ 5 2 where Fractional Value is a fractional representation of the real value Frac16 Real Value is the real value of the quantity V A RPM etc Real Quantity Range is the maximal range of the quantity defined in the application V A RPM etc 5 5 2 DC Bus Voltage Scaling The DC Bus voltage sense is defined by following equation Vpc BUS MAX u dc bus 32767 Where u dc bus is variable of DC Bus voltage Vpc sus is measured DC Bus voltage Vmax ls max measurable DC Bus voltage NOTE Vx 16V for the EVM Motor Board 5 5 3 PI Controller Parameters The P constant was chosen as 0 12207 32000 2719 and the constant was chosen as 0 095367 25000 2719 The controller parameters were experi
26. ence Manual 3 Ph BLDC Motor Control with Hall Sensors Appendix A References 1 Brushless DC Motor Control using the MC68HC708MCA John Deatherage and Jeff Hunsinger AN1702 D Motorola 2 DSP56F80x MC PWM Module in Motor Control Applications Leos Chalupa AN1927 D Motorola 3 Design of Brushless Permanent magnet Motors J R Hendershot JR and T J E Miller Magna Physics Publishing and Clarendon Press 1994 4 CodeWarrior for Motorola DSP56800 Embedded Systems CWDSP56800 Metrowerks 2001 5 DSP56F800 16 bit Digital Signal Processor Family Manual DSP56F800FM D Motorola 2001 6 DSP56F80x 16 bit Digital Signal Processor User s Manual DSP56F801 7UM D Motorola 2001 7T DSP56F805 Evaluation Module Hardware User s Manual DSP56F805EVMUM D Motorola 2001 8 Evaluation Motor Board User s Manual MEMCEVMBUM D Motorola 9 3 Phase BLDC Motor Control with Hall Sensors Using DSP56F80x Pavel Grasblum AN1916 D Motorola 2001 10 Motorola SPS web page htip www motorola com DRMO025 Rev 0 Designer Reference Manual MOTOROLA References 63 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc References Designer Reference Manual DRM025 Rev 0 64 References MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Designer Reference Manual 3 Ph BLDC Motor Control with Hall Sensors DRMO025
27. ent to a reversed DC commutator motor in which the magnet rotates while the conductors remain stationary In the DC commutator motor the current polarity is DRMO025 Rev 0 Designer Reference Manual MOTOROLA Target Motor Theory and Control 19 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Target Motor Theory and Control altered by the commutator and brushes On the contrary in the brushless DC motor the polarity reversal is performed by power transistors switching in synchronization with the rotor position Therefore BLDC motors often incorporate either internal or external position sensors to sense the actual rotor position or the position can be detected without sensors 2 3 Digital Control of a BLDC Motor The BLDC motor is driven by rectangular voltage strokes coupled with the given rotor position see Figure 2 2 The generated stator flux interacts with the rotor flux which is generated by a rotor magnet defines the torque and thus speed of the motor The voltage strokes must be properly applied to the two phases of the three phase winding system so that the angle between the stator flux and the rotor flux is kept close to 90 to get the maximum generated torque Due to this fact the motor requires electronic control for proper operation Voltage Uncs Phase A s Uss Phase B i B Uncs Phase C 120 150 180 210 240 270 300 330 Electr
28. es algorithms and peripheral drivers are part of the application project file Designer Reference Manual bldc_hall_sensors_sa src include folder for general C header files bldc_hall_sensors_sa src dsp56805 folder for the device specific source files e g drivers M bldc hall sensors saWsrc pc master support folder for PC master software source files bldc_hall_sensors_sa src algorithms folder for algorithms DRM025 Rev 0 58 System Setup MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc System Setup Application Build amp Execute 6 6 Application Build amp Execute When building the BLDC Motor Control Application with Hall Sensors the user can create an application that runs from internal Flash or External RAM To select the type of application to build open the bldc hall sensors mop project and select the target build type as shown in Figure 6 6 A definition of the projects associated with these target build types may be viewed under the Targets tab of the project window pw bldc sensor mcp Link Order Targets e External RAM i x A gt Fash E External RAM 115K TK e o 1K 289 e o 19 files 116K 76K Figure 6 6 Target Build Selection The project may now be built by executing the Make command as shown in Figure 6 7 This will build and link the BLDC Motor Control Application with Hall Sensor
29. ical angle Figure 2 2 Voltage Strokes Applied To the 3 ph BLDC Motor For the common 3 phase BLDC motor a standard 3 phase power stage is used as is illustrated in Figure 2 3 The power stage utilizes six power transistors with switching in either the independent mode or complementary mode Designer Reference Manual DRM025 Rev 0 20 Target Motor Theory and Control MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Target Motor Theory and Control Digital Control of a BLDC Motor Uscs 2 PWM Q3 NO PWM Q4 3 Q4 Phase A Phase B Phase C Figure 2 3 3 phase BLDC Power Stage In both modes the 3 phase power stage energizes two motor phases concurrently The third phase is unpowered see Figure 2 2 Thus we get six possible voltage vectors that are applied to the BLDC motor using a PWM technique see Figure 2 3 and Figure 2 4 There are two basic types of power transistor switching independent switching and complementary switching 2 3 1 Independent Switching of Power Transistors With independent switching only two transistors are switched on when current is conducted from the power supply to the phase of the BLDC motor In one phase the top transistor is switched on in second phase the bottom transistor is switched on and the third phase is not powered During freewheeling all transistors are switched off see Figure 2 4 DRMO025
30. ion read the time between the adjacent edges of Hall sensor output one phase only and calculates the actual motor speed omega actual mech 5 3 2 Speed Controller DRMO025 Rev 0 This process compares the required and actual speed and calculates the duty cycle of the PWM output signals For detailed information see Section 2 3 4 Designer Reference Manual MOTOROLA Software Design 41 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Software Design 5 3 3 Mask and Swap Calculation This process performs a rotor commutation As already mentioned the only two phases are powered by a six step control The proper PWM output can be generated by changing the PWM value duty cycle registers only This has two disadvantages The first is that the speed controller which changes the duty cycle affects the commutation algorithm performed by changing the duty cycle The second disadvantage is that a change in the duty cycle is synchronized with PWM reload which may cause a delay between a proper commutation moment and the PWM reload This is especially pronounced at high speed when the commutation period is very short The DSP56F80x family has two features dedicated to BLDC motor control the ability to swap odd and even PWM generator outputs and the ability to mask disable any PWM generator outputs These two features allow creation of a rotational field without changing the con
31. isable the parallel port and press the RESET button Once the application is running move the RUN STOP switch to the RUN position and set the required speed using the UP DOWN push buttons Pressing the UP DOWN buttons should incrementally increase the motor speed until it reaches maximum speed If successful the BLDC motor will be spinning If the RUN STOP switch is set to the RUN position when the application starts toggle the RUN STOP switch between the STOP and RUN DRM025 Rev 0 60 System Setup For More Information On This Product Go to www freescale com MOTOROLA DRMO025 Rev 0 Freescale Semiconductor Inc System Setup Application Build amp Execute positions to enable motor spinning This is a protection feature that prevents the motor from starting when the application is executed from CodeWarrior You should also see a lighted green LED which indicates that the application is running If the application is stopped the green LED will blink at a 2Hz frequency If an Undervoltage fault occurs the green LED will blink at a frequency of 8Hz Designer Reference Manual MOTOROLA System Setup 61 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc System Setup Designer Reference Manual DRMO025 Rev 0 62 System Setup MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Designer Refer
32. l DRM025 Rev 0 4 MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Designer Reference Manual 3 Ph BLDC Motor Control with Hall Sensors List of Sections Section 1 Introduction ci csscadsserescecadeiaaaen 13 Section 2 Target Motor Theory and Control 19 Section 3 System Description 29 Section 4 Hardware Design 33 Section 5 Software Design 39 Section 6 System Setup 51 Appendix A References 63 Appendix B Glossary ees 65 DRMO25 Rev 0 Designer Reference Manual MOTOROLA B For More Information On This Product Go to www freescale com Freescale Semiconductor Inc List of Sections Designer Reference Manual DRMO025 Rev 0 6 MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Designer Reference Manual 3 Ph BLDC Motor Control with Hall Sensors 1 2 1 3 2 1 2 2 2 3 3 1 3 2 3 3 4 1 4 2 4 3 4 4 4 5 DRM025 Rev 0 Table of Contents Section 1 Introduction COMENS takin hanane Ee don rd CURRERE QN 13 Application Benefit nananana dak RR RR R Ran 13 Motorola DSP Advantages and Features 14 Section 2 Target Motor Theory and Control f i1 o P T TRES 19 Brushless DC
33. le Center aligned complementary PWM mode positive polarity PWM modulus defines PWM frequency PWM deadtime defines PWM deadtime Disable faults Initializes Quadrature Decoder Sets on chip digital filter of the Quadrature Decoder inputs Connects Quadrature Decoder signals to Quad TimerA DRMO025 Rev 0 Designer Reference Manual MOTOROLA Software Design 45 For More Information On This Product Go to www freescale com Designer Reference Manual Freescale Semiconductor Inc Software Design Initializes Quad TimerA channels AO A1 A2 Sets Count Mode to Count Sets Input Source to Bus Clock 128 Sets Input Polarity to Normal Sets Secondary Input Source to Input 0 1 2 Sets CountFrequency to Repeatedly Sets Count Length to Past Compare Sets Count Direction to Up Sets Capture Mode BothEdges Associates Callback On Input Edge to ISRQTimer Initializes Quad TimerA channel A3 Sets Count Mode to Count Sets Input Source to Bus Clock 128 Sets Input Polarity to Normal Sets Secondary Input Source to Input 2 Sets Count Frequency to Repeatedly Sets Count Length to Past Compare Sets Count Direction to Up Sets Capture Mode BothEdges Associates Callback On Input Edge to CallbackOnNewEdge Associates CallbackOnOverflow to CallbackOnOverload Sets up I O ports brake switch push buttons Brake LED switch on GPIO Push buttons on interrupts IRQO IRQ1 Initializes the Analog
34. le com Freescale Semiconductor Inc Designer Reference Manual 3 Ph BLDC Motor Control with Hall Sensors List of Figures Figure Title Page 2 1 BLDC Motor Cross Section 00 eee eaee 19 2 2 Voltage Strokes Applied To the 3 ph BLDC Motor 20 2 3 3 phase BLDC Power Stage llllslssllslsss 21 2 4 Independent Switching of Power Transistors 22 2 5 Complementary Switching of Power Transistors 23 2 6 Stator Flux Vectors at Six Step Control 24 2 7 Situation Right Before Commutation 25 2 8 Situation Right After Commutation 25 2 9 Speed Con iy acia dE RR esse bed RARE ERROR ORC CR RS 27 3 1 System Concept ii cde a kk kk dd Ed dae ves AR RR CR 31 4 1 Low Voltage Evaluation Motor HW System Configuration 33 4 2 Block Diagram of the DSP56F805EVM 35 4 3 EVM Motor Gea soos d rara RRPR EN d EROR Ed OEC RR 36 5 1 BAU FOG 2d auasaeE ER Ed REQUE AE E272 42 d d ORC 40 5 2 PWM Swapping and Masking for BLDC Motor 44 5 3 State Diagram General Overview 0055 45 5 4 Drive State Machine Transitions 00055 48 6 1 RUN STOP Switch and UP DOWN Buttons at DSP56F805EVM ssds kae ERG RR RR Ro 52 6 2 USER and PWM LEDs at DSP56F805EVM 52 6 3 PC Master Software Control Window llus 54 6 4 Set up of the BLDC Motor Control Application
35. ltage ViL 0 8 V Input Resistance Rin 10 kQ Analog Output Range Vout 0 3 3 V Bus Current Sense Voltage Isense 412 mV A Bus Voltage Sense Voltage VBus 206 mV V Power MOSFET On Resistance Rps on 32 40 MQ RMS Output Current IM 6 A Total Power Dissipation Paiss 5 W 4 4 2 Motor Characteristics The motor characteristics in Table 4 2 apply to operation at 25 C Table 4 2 Motor Characteristics Characteristic Symbol Min Typ Max Units Terminal Voltage Vi 60 V Speed V 5000 RPM Torque Constant Ki 0 08 Nm A Voltage Constant Ke 8 4 V kKRPM Winding Resistance Ri 2 8 Q Winding Inductance L 8 6 mH Continuous Current lcs 2 A Peak Current lps 5 9 A DRMO025 Rev 0 Designer Reference Manual MOTOROLA Hardware Design For More Information On This Product Go to www freescale com 37 Hardware Design Table 4 2 Motor Characteristics Freescale Semiconductor Inc Inertia Jm 0 075 kgcm Thermal Resistance 3 6 C W 4 5 Hardware Documentation All the system parts are supplied and documented according the following references e M1 1B23810 Motor supplied in kit ECMTREVAL Evaluation Motor Board Kit e U2 EVM Motor Board supplied in kit with IB23810 Motor ECMTREVAL E
36. mentally tuned DRMO025 Rev 0 Designer Reference Manual MOTOROLA Software Design 49 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Software Design 5 5 4 Velocity Calculation The constant OMEGA ACTUAL MECH CONST is defined by the following equations position difference 1 4 rev given by each edge of one Hall sensors phase and two pole pairs motor max period time 0 2 s chosen according to required min speed Vmin 60 position difference max period time 75 RPM Vmax 20 Vmin 1500 RPM chosen according to required max speed OMEGA ACTUAL MECH CONST 32767 Vmin Vmax 1638 Designer Reference Manual DRMO025 Rev 0 50 Software Design MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Designer Reference Manual 3 Ph BLDC Motor Control with Hall Sensors 6 1 Contents 6 2 Operational Modes DRMO025 Rev 0 6 2 6 3 6 4 6 5 6 6 Section 6 System Setup Operational Modes 0 0 00 eee 51 Application Set Up Ivaed xb cn ee eck RO RC AUR E Re ORC 54 DSPS6FBOSEVM Set Up ic csdccccu cs rre RR Re 56 35 221 MERIT eae Sees ren ees 58 Application Build amp Execute osos RR Rn 59 This BLDC Motor Control Application with Hall Sensors can operate in two modes 1 Manual Operating Mode The drive is controlled by the RUN STOP switch S6 The motor
37. nformation Applied Voltage Required Voltage Speed RUN STOP Switch Status Application Mode Start the PC master software window s application bldc hall sensors pmp Figure 6 3 illustrates the PC master software control window after this project has been launched NOTE Ifthe PC master software project pmp file is unable to control the application it is possible that the wrong load map elf file has been selected PC master software uses the load map to determine addresses for global variables being monitored Once the PC master software project has been launched this option may be selected in the PC master software window under Project Select Other Map FileReload DRMO025 Rev 0 Designer Reference Manual MOTOROLA System Setup 53 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc System Setup f BLDC Demo pmp PCMaster Jol x File Edit View Explorer Item Project Help MEEA saom als es SA eee E BLDC Motor Control with Hall Sensors BLDC Hall Sensors Handler Designed by gt Hall Sensors Signals Motorola Czech System Laboratories M MOTOROLA gt Main Scope Roznov p Radh Czech Republic BLDC Demo Control with Hall Sensors Applied Voltage Speed Required Application mode Voltage i Running ENUM RUN STOP Switch Status RUN ENUM Speed 811 RPM Applied Voltage 60 0 96 Required Voltage 60 0 Figure 6 3 PC Master Softwa
38. nterface SPI with configurable 4 pin port or four additional GPIO lines Computer Operating Properly COP timer Two dedicated external interrupt pins Fourteen dedicated General Purpose I O GPIO pins 18 multiplexed GPIO pins External reset pin for hardware reset JTAG On Chip Emulation OnCE DRM025 Rev 0 14 Introduction MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc e Software programmable Phase Lock Loop based frequency synthesizer for the DSP core clock Table 1 1 Memory Configuration Introduction Motorola DSP Advantages and Features DSP56F801 DSP56F803 DSP56F805 DSP56F807 Program Flash 8188 x 16 bit 32252 x 16 bit 32252 x 16 bit 61436 x 16 bit Data Flash 2K x 16 bit 4K x 16 bit 4K x 16 bit 8K x 16 bit Program RAM 1K x 16 bit 512 x 16 bit 512 x 16 bit 2K x 16 bit Data RAM 1K x 16 bit 2K x 16 bit 2K x 16 bit 4K x 16 bit Boot Flash 2K x 16 bit 2K x 16 bit 2K x16 bit 2K x 16 bit In addition to the fast Analog to Digital converter and the 16 bit Quad Timers the most interesting peripheral from the BLDC motor control point of view is the Pulse Width Modulation PWM module The PWM module offers a high degree of freedom in its configuration permitting efficient control of the BLDC motor The PWM has the following features e Three complementary PWM signal pairs or six independent PWM signals e Feat
39. porary break in the sequential execution of a program to respond to signals from peripheral devices by executing a subroutine input output I O Input output interfaces between a computer system and the external world A CPU reads an input to sense the level of an external signal and writes to an output to change the level on an external signal JTAG Interface allowing On Chip Emulation and Programming LED Lignt Emiting Diode logic 1 A voltage level approximately equal to the input power voltage Voo logic 0 A voltage level approximately equal to the ground voltage Vss PI controller Proportional Integral controller phase locked loop PLL A clock generator circuit in which a voltage controlled oscillator produces an oscillation which is synchronized to a reference signal PM Permanent Magnet PMSM Permanent Magnet Synchronous Motor PWM Pulse Width Modulation Quadrature Decoder A module providing decoding of position from a quadrature encoder mounted on a motor shaft Quad Timer A module with four 16 bit timers reset To force a device to a known condition RPM Revolutions per minute SCI See serial communication interface module SCI Designer Reference Manual DRMO025 Rev 0 66 Glossary MOTOROLA For More Information On This Product Go to www freescale com DRMO025 Rev 0 Freescale Semiconductor Inc Glossary serial communications interfac
40. r decrements the desired speed with the decrement PC and SCI Interrupt Handlers provide SCI communication and service routines for the PC master software These routines are fully independent of the motor control tasks The drive can be in one of the following states as shown in Figure 5 4 which also shows transition conditions among the drive states The user is able to recognize the actual state by a blinking green LED diode In Designer Reference Manual MOTOROLA Software Design 47 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Software Design case of the init and stop state the green LED diode blinks with a frequency of 2 Hz In the fault state the green LED diode blinks with a frequency of 8 Hz During the running state the green LED diode is continuously lit Reset SwitchState RUN SwitchState STOP u_dc_bus gt MIN_DC_BUS_VOLTAGE u_dc_bus lt MIN_DC_BUS_VOLTAGE Stopped State SwitchState STOP SwitchState RUN Running State Figure 5 4 Drive State Machine Transitions 5 5 Implementation Notes The following chapter describes calculation of application constans and quantity scaling 5 5 1 Scaling of Quantities The BLDC motor control application uses a fractional representation for all real quantities except time The N bit signed fractional format is represented using 1 N 1 format 1 sign bit N 1 fractional bits Sign
41. re Control Window 6 3 Application Set Up Freescale Semiconductor Inc Figure 6 4 illustrates the hardware set up for the BLDC Motor Control Application with Hall Sensors Designer Reference Manual DRMO025 Rev 0 54 System Setup MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc System Setup Application Set Up 4 BLDC Motor J Motor Power Connector Hall Sensors 4 Connector Controller Board Parallel Cable to PC to PC Figure 6 4 Set up of the BLDC Motor Control Application using DSP56F805EVM The system consists of the following components e BLDC Motor IB23810 supplied in kit ECMTREVAL Evaluation Motor Board Kit e EVM Motor Board Supplied in kit with IB23810 Motor ECMTREVAL Evaluation Motor Board Kit e DSP56F805 Board DSP56F805 Evaluation Module supplied as DSP56F805EVM DRMO025 Rev 0 Designer Reference Manual MOTOROLA System Setup 55 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc System Setup The serial cable needed for the PC master software debugging tool only The parallel cable needed for the Metrowerks Code Warrior debugging and s w loading 6 4 DSP56F805EVM Set Up To execute the BLCD Motor Control with Hall Sensors the DSP56F805EVM board requires the strap settings shown in Figure 6 5 and Table 6 2
42. ribed in the following sections The main data flow can be divided into four parts Speed control Velocity calculation Rotor commutation DC Bus voltage measurement Speed control starts with the omega required mech variable This variable is set by user buttons or remotely by the PC within allowed Designer Reference Manual MOTOROLA Software Design 39 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Software Design limits The variable omega required mech is copied to omega desired mech ata defined moment This variable is used as a shadow variable to avoid change of the required speed from the PC at any time The variable omega desired mech is input to the speed PI controller as a reference value SCI Communication POSITION SENSOR Hall Sensors SPEED SETTING by BUTTONS one phase only Capture omega required mech Period Interrupt Measuring E omega desired mech MeasuredTime Velocity Calculation omega actual mech DirectionSpinning EncoderState por MEG Speed Controller PI Controller DC Bus Voltage A D Converter Mask and Swap Calculation u dc bus DesVoltage PWMState E PWM Generation Software Block Hardware Block A Figure 5 1 Main Data Flow Designer Reference Manual DRMO025 Rev 0 40 Software Design MOTOROLA For More Information On This Product Go to www free
43. ry unipolar PWM mode DRM025 Rev 0 22 Target Motor Theory and Control MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Target Motor Theory and Control Digital Control of a BLDC Motor PWM Switching ON PWM Q1 OFF ON PWM Q2 OFF ON PWM Q3 OFF ON PWM Q4 OFF ON PWM Q5 OFF ON Pw og TTI HIT OFF 10 20 30 40 50 60 70 80 90 Electrical angle Figure 2 5 Complementary Switching of Power Transistors 2 3 3 Commutation Commutation provides the creation of a rotation field As was explained for proper operation of a BLDC motor it is necessary to keep the angle between stator and rotor flux close to 90 With six step control we get a total of six possible stator flux vectors The stator flux vector must be changed at a certain rotor position The rotor position is usually sensed by Hall sensors The Hall sensors generate three signals that also comprise six states Each of Hall sensors states corresponds to certain stator flux vector All Hall sensor states with corresponding stator flux vectors are illustrated in Figure 2 6 The same figure is illustrated in tables Table 2 1 and Table 2 2 DRMO025 Rev 0 Designer Reference Manual MOTOROLA Target Motor Theory and Control 23 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Target Motor Theory and Control AB
44. s and all needed Metrowerks libraries DRMO025 Rev 0 Designer Reference Manual MOTOROLA System Setup 59 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc System Setup NOTE Designer Reference Manual W Metrowerks CodeWarrior File Edit Search Mais Debug DSP56800 Window Help B GE E Add Wingo Add Files Create New Group Heck Suntar etl 3X9 Codec File CQ Depender g EEC Sources g B codec 12 files Preconipie Sammlle Str Fey ox gc v e Disassemble Bring Up To Date Ctrl U stri rea Step Build mo un 3 ma Figure 6 7 Execute Make Command To execute the BLDC Motor Control application select Project Debug in the CodeWarrior IDE followed by the Run command For more help with these commands refer to the CodeWarrior tutorial documentation in the following file located in the CodeWarrior installation folder lt gt CodeWarrior Documentation PDF Targeting DSP56800 pdf If the Flash target is selected CodeWarrior will automatically program the internal Flash of the DSP with the executable generated during Build If the External RAM target is selected the executable will be loaded to off chip RAM Once Flash has been programmed with the executable the EVM target system may be run in a stand alone mode from Flash To do this set the JG5 jumper in the 1 2 configuration to d
45. scale com Freescale Semiconductor Inc Software Design Data Flow MeasuredTime incorporates a time period of one Hall sensor phase The phase time period is used for a speed calculation Calculated speed omega actual mech is input to the speed PI controller as a secondary input The PI controller output determines the duty cycle of the generated PWM output signals Each new edge of the Hall sensor signals a capture interrupt to be called The interrupt routine saves the actual Hall sensor state to EncoderState The EncoderState variable is input to mask and swap calculation which calculates the final shape of the output voltage The output variable PWMState is written directly to the PWM block The next task which is provided by interrupt routine is calculation of the spin direction The result DirectionSpinning is used for the speed calculation A variable u dc bus contains the actual DC Bus voltage The value is used for under voltage detection 5 3 1 Latest Position Capture Period Measuring and Velocity Calculation Latest Position Capture Period Measuring and Velocity Calculation processes relate to the Hall sensor inputs The sensors generate streams of pulses that are captured separately for each sensor by the Input Capture IC function The process Latest Position Capture is called by an input capture interrupt and captures the latest state of the Hall sensors The processes Period Measuring and Velocity Calculat
46. tents of the PWM value registers The influence of masking and swapping on the PWM generator outputs is illustrated in Figure 5 2 Detailed information about PWM settings for BLDC motors can be found in the Application Note DSP56F80x MC PWM Module in Motor Control Applications The commutation algorithm bldchsCommHandlerComp calculates based on the actual Hall sensor state the output PWMState The structure of PWMState consists of two parts variables The first part PWMState Swap defines the swapping of phases and the second part PWMState Mask defines phase masking Then these values are written directly to the PWM generator The swapping value is written to the PWM Channel Control Register and the masking value is written to the PWM Output Control Register The following paragraph describes in detail the commutation transition from the one to the next commutation sector as is depicted on Figure 2 7 Figure 2 8 and Figure 5 2 The even PWM value registers are set e g to 75 duty cycle The odd PWM value registers are set to complementary value 100 75 25 duty cycle The rotor in Figure 2 7 is situated in sector ABC 110 The state of masking and swapping is following see Table 2 2 Designer Reference Manual DRM025 Rev 0 42 Software Design MOTOROLA For More Information On This Product Go to www freescale com NOTE DRMO025 Rev 0 Freescale Semiconductor Inc Software Design Data Flow e Phase A not m
47. ter 16 bit position difference counter Maximum count frequency equals the peripheral clock rate Position counter can be initialized by SW or external events Preloadable 16 bit revolution counter Inputs can be connected to a general purpose timer to aid low speed velocity Since the Quadrature Decoder also has all input pins connected to the Quad Timer module A the BLDC application uses the digital input filter to filter Hall sensor signals Designer Reference Manual MOTOROLA Introduction 17 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Introduction Designer Reference Manual DRMO025 Rev 0 18 Introduction MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Designer Reference Manual 3 Ph BLDC Motor Control with Hall Sensors Section 2 Target Motor Theory and Control 2 1 Contents 22 Brushless DC Motor Theoty 0 000ee0eee n 19 2 3 Digital Control of a BLDC Mot i i er YR 20 2 2 Brushless DC Motor Theory A brushless DC BLDC motor is a rotating electric machine where the stator is a classic three phase stator like that of an induction motor and the rotor has surface mounted permanent magnets see Figure 2 1 Stator Stator winding in slots Shaft Rotor Air gap Permanent magnets Figure 2 1 BLDC Motor Cross Section In this respect the BLDC motor is equival
48. to Digital Converter ADC set for sequential sampling single conversion Channel 0 DC Bus voltage DRM025 Rev 0 46 Software Design MOTOROLA For More Information On This Product Go to www freescale com 5 4 2 Interrupts 5 4 3 Drive State Machine DRMO025 Rev 0 Freescale Semiconductor Inc Software Design Software Implementation Initializes control algorithm speed controller control algorithm parameters Enables interrupts Starts ADC conversion Identifies the voltage level according to the identified power stage The interrupt handlers have the following functions Input Capture Interrupt Handler Timer AO A1 A2 reads the actual status of the Hall sensors That value is input to the commutation algorithm The description of the commutation is in Section 2 3 3 and Section 5 3 3 The order of Hall sensor edges determines the direction of spin Input Capture Interrupt Handler Timer A3 reads the time between the two subsequent IC edges of one Hall sensor phase which is used for speed calculation Timer Interrupt Handler generates the time base 20ms The routine called within this time base blinks the green LED diode reads the result of the ADC conversion calculates the speed and provides the speed controller Push Button Interrupt Handler takes care of the push button service The UpButton Interrupt Handler increments the desired speed with the increment the DownButton Interrupt Handle
49. ures of complementary channel operation e Deadtime insertion e Separate top and bottom pulse width correction via current status inputs or software e Separate top and bottom polarity control e Edge aligned or center aligned PWM signals e 15 bits of resolution e Half cycle reload capability Integral reload rates from one to 16 e Individual software controlled PWM outputs e Mask and swap of PWM outputs DRMO025 Rev 0 Designer Reference Manual MOTOROLA Introduction 15 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Introduction Designer Reference Manual e Programmable fault protection e Polarity control e 20 mA current sink capability on PWM pins e Write protectable registers The BLDC motor control utilizes the PWM block set in the complementary PWM mode permitting generation of control signals for all switches of the power stage with inserted deadtime The PWM outputs can be controlled separately by software allowing the setting of the control signal to logical 0 or 1 This feature is used to enable disable control signal by software The PWM module s swap function allows the immediate swap of top and bottom control signals in the same phase These functions permit the separation of the rotor commutation and speed control to the two independent program parts The state of the control signals can be changed immediately when required by the motor position phase comm
50. using DSPSEPEDSEVM 1uus dedi kx RR Ra ca EGRE denen 55 6 5 DSP56F805EVM Jumper Reference 56 6 6 Target Build Selection nonna nnana hr Rn 59 6 7 Execute Make Command nananana aaaeeeaa 60 DRM025 Rev 0 Designer Reference Manual MOTOROLA 9 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc List of Figures Designer Reference Manual DRMO025 Rev 0 10 MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Designer Reference Manual 3 Ph BLDC Motor Control with Hall Sensors DRMO025 Rev 0 Table List of Tables Title Page Memory Configuration iu esaadexkebie ed qure X E He Ee 15 Commutation Sequence for Clockwise Rotation 26 Commutation Sequence for Counterclockwise Rotation 26 Specifications of the Motor and Hall Sensors 30 Electrical Characteristics lt a lt sc ceiccusdiseasaksseeduas 37 Motor Characteristics c OCIO aaan 37 Motor Application States 0 0 0 0 cee 53 DSP56F805EVM Jumper Settings 57 Designer Reference Manual MOTOROLA 11 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc List of Tables Designer Reference Manual DRM025 Rev 0 12 MOTOROLA For More Information On This Product Go to www freescale com Freescale
51. utation without changing the content of the PWM value registers These changes can be accomplished asynchronously to the PWM duty cycle update The Quad Timer is provides all required services related to time events It has the following features e Each timer module consists of four 16 bit counters timers e Count up down e Counters are cascadable e Programmable count modulo Max count rate equals peripheral clock 2 when counting external events e Max count rate equals peripheral clock when using internal clocks e Count once or repeatedly e Counters are preloadable e Counters can share available input pins e Each counter has a separate prescaler e Each counter has capture and compare capability DRM025 Rev 0 16 Introduction MOTOROLA For More Information On This Product Go to www freescale com DRMO025 Rev 0 Freescale Semiconductor Inc Introduction Motorola DSP Advantages and Features The BLDC motor application utilizes three channels of a Quad Timer module in Input Capture mode It enables sensing of the rotor position using position Hall sensors The fourth channel of the Quad Timer module is set to generate time base for a speed controller The Quadrature Decoder is a module providing decoding of position from a quadrature encoder mounted on a motor shaft It has the following features Includes logic to decode quadrature signals Configurable digital filter for inputs 32 bit position coun
52. valuation Motor Board Kit described in Evaluation Motor Board User s Manual e U1 CONTROLLER BOARD for DSP56F805 supplied as DSP56805EVM described in DSP Evaluation Module Hardware User s Manual Detailed descriptions of individual boards can be found in comprehensive User s Manuals belonging to each board The manuals are available on the Motorola web The User s Manual incorporates the schematic of the board description of individual function blocks and a bill of materials An individual board can be ordered from Motorola as a standard product Designer Reference Manual DRMO025 Rev 0 38 Hardware Design For More Information On This Product Go to www freescale com MOTOROLA Freescale Semiconductor Inc Designer Reference Manual 3 Ph BLDC Motor Control with Hall Sensors 5 1 Contents 5 2 5 3 5 4 aa Section 5 Software Design Software Description 0 0 0 0 cee eee 39 Boeie e kc coo ae EURO a EORUM OPER ERR E al 39 Software Implementation 0 0 0 0 cece eee eee 44 Implementation Notes iusso erasa hn ease 48 5 2 Software Description 5 3 Data Flow DRMO025 Rev 0 This section describes the design of the software blocks of the drive The software will be described in terms of Control Algorithm Data Flow Software Implementation The control algorithm of a closed loop BLDC drive is described in Figure 5 1 The individual processes are desc
Download Pdf Manuals
Related Search
Related Contents
品番VC-0410 - Edinburgh Projector Sales EX- バイタルデザイン シューヘルパーをお買い上げ賜り、城に T S 2 1 D - P 取 扱 説 明 書 Nostalgia Electrics OFP-501 Use and Care Manual NitraVis 70x IQ TS Beewi BBZ302 KV30, KV45, KV60, KV80 KV30E, KV45E, KV60E Adams Manufacturing 9303-48-3700 Instructions / Assembly 468KB - 古河テクノマテリアル Copyright © All rights reserved.
Failed to retrieve file