DATASHEET SEARCH SITE | WWW.ALLDATASHEET.COM
Document overview
- Manufacturer or author: Provided By ALLDATASHEET.COM(FREE DATASHEET DOWNLOAD SITE)
- PDF pages: 26
Technical content
AN031102-0311 Page 1 of 26 Abstract This application note discusses the closed loop control of a 3-phase brushless direct cur- rent (BLDC) motor using the Z16FMC Family of Microcontrollers (MCUs). The Z16FMC product family is designed specifically for motor control applications, featuring an on-chip integrated array of application-specific analog and digital modules. The result is fast and precise fault control, high system efficiency, on-the-fly speed/torque and direc- tion control, as well as ease of firmware development for customized applications. This document further discusses ways in which to implement a sensorless feedback con- trol system using a Phase Locked Loop along with back EMF sensing. Test results are based on using the Z16FMC Modular Development System (MDS) module, a 3-phase motor control (MC) application board and a 3-phase 24 VDC, 30 W, 3200 RPM BLDC motor with internal Hall sensors. The source code files associated with this application note, AN0311-SC01 and AN0311- SC02, were tested with version 4.12 of ZDS II for ZNEO MCUs. Subsequent releases of ZDS II may require you to modify the code supplied with this application note. The sample project included in ZDS II v4.12 and the firmware in the Rev D (or earlier) ver- sion of the Z16F28200KITG Development Kit were preprogrammed with AN0311-SC01. The source code files contained in AN0226-SC02 are enhanced versions of AN0311-SC01 that allow users to easily change parameters to accommodate differing motor types.
Revision History
Each instance in the following table reflects a change to this document from its previous version. For more details, refer to the corresponding pages or appropriate links provided in the table. Date Revision Level Description Page Number Mar 2011 05 AN0311-SC02 source code added to encompass multiple motor types; correction to TimerPrescale data in PLL flow, Figure 17. 1, 22 Dec 2010 01 Original issue. All Note: Application Note Sensorless Brushless DC Motor Control with the Z16FMC MCU AN031102-0311
AN031102-0311 Page 2 of 26 Sensorless Brushless DC Motor Control with the Z16FMC MCU Application Note
Features
The power-saving features of this Z16FMC application include:
- Smooth S-curve motor start-up with reduced starting current
- Sensorless (back-EMF) control using Phase Locked Loop feedback
- Microcontroller-based overcurrent protection
- Selectable speed or torque setting
- Selectable speed or torque control
- Selectable control of motor direction
- UART Interface for PC control
- LED for max speed indication
- LED for motoring running indication
- LED for fault indication Discussion The Z16FMC Series Flash microcontrollers are based on Zilog’s advanced ZNEO 16-bit CPU core. The Z16FMC MCU family of devices set a new standard of performance and efficiency with up to 20 MIPS performance at 20 MHz. It supports 16-bit internal and external bus widths and provides near-single-cycle instruction execution. The Z16FMC’s external interface allows seamless connection to external memory and peripherals. A 24-bit address bus and a selectable 8-bit or 16-bit data bus allows parallel access up to 16 MB. Up to 128 KB internal Flash memory is accessible by the CPU, 16 bits at a time, to improve processor throughput. Up to 4 KB of internal RAM provides storage of data, variables and stack operations. Figure 1 displays a block diagram of the Z16FMC MCU architecture.
- Time Stamp for Speed Control
- Integrated Operational Amplifier
- Multi-Channel PWM Timer Time Stamp for Speed Control Most microcontrollers use at least one dedicated comparator to detect the zero crossing of the input AC voltage signal so that the output driving pulses can be synchronized and
Figure 1. The Z16FMC MCU Architecture
20 MHz CPU
88888114 Number of pins available
AN031102-0311 Page 4 of 26 Sensorless Brushless DC Motor Control with the Z16FMC MCU Application Note adjusted to properly regulate the motor speed. An alternative approach based on Zilog's motor control MCU eliminates the need for this comparator by instead employing an ana- log to digital converter (ADC) in conjunction with a timer. In this case, the ADC samples the AC line voltage, with the timer running in the background. When the ADC samples the line voltage's zero crossing, it reads the timer count and writes the result to a register. As a result, the timers are cued for the output Pulse Width Modula- tion (PWM) pulses to efficiently regulate the speed of the motor. This time stamp approach results in a very simple and cost-effective solution for smooth operation of the motor in steady state. Integrated Operational Amplifier Appliance controllers almost invariably monitor motor speed by sensing the current through the windings, using sensor and sensorless techniques in conjunction with the ADC. Ordinarily, sampling instances by the ADC are synchronized by the MCU. With this process, an external operational amplifier is often used to convert the current signal to a voltage signal; the ADC next samples the voltage signal and outputs the result to the pro- cessor. The processor then synthesizes the PWM outputs to control motor speed. In the case of the Z16FMC Family of Microcontrollers, an on-chip integrated operational amplifier eliminates the requirement for an external component, thereby reducing overall system cost. Multi-Channel PWM Timer The Z16FMC features a flexible PWM module with three complementary pairs - or six independent PWM outputs - supporting deadband operation and fault protection trip input. These features provide multiphase control capability for a variety of motor types and ensure safe operation of the motor by providing immediate shutdown of the PWM pins during a fault condition. Theory of Operation In a brushless DC motor, the rotor is comprised of permanent magnets while the stator windings are similar to those in poly-phase motors. For a detailed discussion of BLDC motor fundamentals, as well as closed-loop control using sensorless techniques, refer to the Motor Control Electronics Handbook by: Richard Valentine, McGraw-Hill, NY, 1998. In sensor-based control applications, the Hall elements are integrated and are used to detect the position of the rotor for drive synchronization. In contrast, sensorless control employs the detection of Back EMF signals which are generated (induced) by specific phase windings to synchronize the timing of the control loop. A block diagram of the BLDC motor control system based on the Z16FMC MCU is shown in Figure 2. In a 3-phase commutation arrangement, at any given instance, only two phases are energized. The back EMF voltage is in turn generated in the unenergized phase winding, and the zero crossing of this induced voltage is detected for synchronization of the subsequent closed-loop control events. As discussed earlier, the innovative time stamp feature of the Z16FMC MCU provides for robust, efficient implementation of this critical sensing function without the requirement for an additional comparator.
of direction of rotation on command, as outlined below. Figure 2. . A 3-Phase BLDC Motor Control System
the PWM commutation signal period(s). this sequence of events are shown in Figure 5. updating the commutation period, if necessary. Figure 3. Cycle-By-Cycle Shutdown
AN031102-0311 Page 7 of 26 Sensorless Brushless DC Motor Control with the Z16FMC MCU Application Note Testing This section provides information about how to run the code and demonstrate this applica- tion, including the equipment used to build the implementation, its configuration and the results of its testing. Equipment Used The following equipment is used for the setup; the first five items are contained in the Z16FMC Series Development Kit (Z16FMC28200KITG).
- Zilog Z16FMC MDS Module (99C1299-001)
- Zilog 3-Phase Motor Control Application Board (99C0960-001)
- Opto-Isolated USB Smart Cable to connect the PC to the Z16FMC Series Development Board
- LINIX 3 Phase BLDC motor 24VDc, 30W 3200RPM (45ZWN24-30)
- 5 V DC power supply for the Z16FMC MDS Module
- 24 V DC power supply for BLDC motor
- Digital Oscilloscope or Logic Analyzer Hardware Setup Figures 4 and 5 illustrate the application hardware connections.
AN031102-0311 Page 10 of 26 Sensorless Brushless DC Motor Control with the Z16FMC MCU Application Note 6. From the main.c source file, choose the following mode for the Motor Control appli- cation: #define LOOP_SELECT_VALUE 1u // 0u = torque loop, 1u = speed loop 7. Compile the application and download the code to the Z16FMC MDS module. 8. Stop the debug mode from the IDE; disconnect the Opto-Isolated USB Smart Cable and switch off the power supply to the Z16FMC development board. 9. Connect the 24V DC supply sour ce to the MC application board. 10. Ensure that the RUN/STOP switch on the Z16FMC development board is in the STOP position. 11. First apply power to the Z16FMC development board supply, then apply power via the 24V supply to the MC application board. 12. Set the RUN/STOP switch on the Z16FMC development board to RUN. 13. Additionally, observe the following points: – If SPEED mode is selected, the speed of the motor can be varied by adjusting the potentiometer on the Z16FMC development board. – If TORQUE mode is selected, the motor speed is decreased with application of force on the shaft of the motor. – The direction of rotation of the motor is set by changing the position of the direction switch on the Z16FMC development board. You can now add your application software to the main program to experiment with addi- tional functions. While debugging your code, ensure that the Opto-Isolated USB Smart Cable controls the reset pin of the MCU. After debugging and running your code, detach the Opto-Isolated USB Smart Cable from P3 of the Z16F28200KITG to free the Reset pin and apply a power cycle to reset the MCU from debug mode. Result This Motor Control application was tested with the Z16FMC MDS board connected to Zilog’s 3-phase motor control application board. The BLDC motor specifications are:
- Manufacturer: Linix
- Motor type: 3-wire, 3-phase brushless DC motor
- Voltage rating: 24 V
- Power rating: 30 W
- Maximum speed of rotation: 3200 RPM Note:
Observations that we noted about speed and torque are indicated in Table 1. Table 1. Speed and Torque Observations
- RUN/STOP switch in STOP position • Motor is in idle mode.
- Yellow LED blinks.
- RUN/STOP switch in RUN position.
- Direction switch set to a clockwise rotation.
- Potentiometer R10 at minimum value.
- Motor starts rotating.
- When the motor is loaded mechanically by holding the shaft, speed initially decreases then picks up gradually; current increases.
- Green LED blinks.
- RUN/STOP switch in RUN position.
- Direction switch set to a clockwise rotation.
- Potentiometer R10 at maximum value.
- Motor starts rotating with no load.
- Green LED blinks.
- RUN/STOP switch in RUN position.
- Direction switch set to a counterclockwise rotation.
- Potentiometer R10 at minimum value.
- Motor starts rotating at a speed of 1280 RPM.
- When the motor is loaded mechanically by holding the shaft, speed initially decreases then picks up gradually; current increases.
- Green LED blinks.
- RUN/STOP switch in RUN position.
- Direction switch set to a counterclockwise rotation.
- Potentiometer R10 at maximum value.
- Motor begins rotating at a speed of 3890 RPM with no load.
- Green LED blinks. Torque
- RUN/STOP switch in RUN position.
- Direction switch set to a clockwise direction.
- Motor begins rotating at a speed of 1250 RPM at no load.
- Motor stops rotating upon holding the shaft Constant current consumption of 60mA.
- Green LED blinks.
- RUN/STOP switch in RUN position.
- Direction switch set to a counterclockwise direction.
- Motor starts rotating at a speed of 1250 RPM at no load.
- Motor stops rotating upon holding the shaft.
- Constant current consumption of 60mA.
- Green LED blinks.
- RUN/STOP switch in STOP position. • Motor is in idle mode.
- Yellow LED blinks.
AN031102-0311 Page 12 of 26 Sensorless Brushless DC Motor Control with the Z16FMC MCU Application Note available in the industry, result in less complex board designs and reduced design cycle time. References The following documents are associated with the Z16FMC Series of Motor Control MCUs; each is available for download on www.zilog.com.
- Z16FMC Series Motor Control MCU Product Specification (PS0287)
- Z16FMC Series Motor Control Development Kit User Manual (UM0234)
- Z16FMC Series Motor Control Development Kit Quick Start Guide (QS0079)
- Zilog Developer Studio II – ZNEO User Manual (UM0171)
- ZNEO CPU Core User Manual (UM0188)
- Sensorless Brushless DC Motor Control with Z8 Encore! MC Microcontrollers Appli- cation Note (AN0226)
Figures 7 and 8 show basic block and MCU schematics, respectively, for the Z16FMC Motor Control MDS Module. Figure 7. Z16FMC Motor Control MDS Module, #1 of 2
6800 Santa Teresa Blvd
Figure 8. Z16FMC Motor Control MDS Module, #2 of 2
20 MHz
Figure 9 shows the schematics for the MDS board’s power and serial interfaces. Figure 9. Z16FMC MDS Board Power and RS-232 Connections
100 OHm
Figure 10 displays MDS interface schematics. Figure 10. MDS Board Interfaces
Figures 11 through 13 display the schematics for the 3-Phase Motor Control Application Board. Figure 11. 3-Phase Motor Control Application Board, #1 of 3
Figure 12. 3-Phase Motor Control Application Board, #2 of 3
Figure 13. 3-Phase Motor Control Application Board, #3 of 3
specific application code, such as communications or additional user interfaces. Figure 16. Current Loop and Timed Housekeeping
Table 2. Back EMF Sensing Phase Locked Loop
AN031102-0311 Page 24 of 26 Sensorless Brushless DC Motor Control with the Z16FMC MCU Application Note Next, by using the bilinear transform identity: where T = the sampling period, yields the following equation. When multiplying by: the calculations that follow are: where: and: Collecting terms and dividing by z yields the following result:
AN031102-0311 Page 25 of 26 Sensorless Brushless DC Motor Control with the Z16FMC MCU Application Note When writing this computation as a computer program, it takes the form of a recursive fil- ter, with the coefficients A0 and A1: where:
- Y0 = Current output
- Y1 = Output at the last sample period
- R0 = Current ADC sample of Back EMF (phase voltage – VBUS / 2)
- R1 = Most recent sample of Back EMF from ADC
- A0 = a0
- A1 = –a1
AN031102-0311 Page 26 of 26 Sensorless Brushless DC Motor Control with the Z16FMC MCU Application Note Customer Support To share comments, get your technical questions answered, or report issues you may be experiencing with our products, please visit Zilog’s Technical Support page at http://support.zilog.com. To learn more about this product, find additional documentation, or to discover other fac- ets about Zilog product offerings, please visit the Zilog Knowledge Base at http:// zilog.com/kb or consider participating in the Zilog Forum at http://zilog.com/forum. This publication is subject to replacement by a later edition. To determine whether a later edition exists, please visit the Zilog website at http://www.zilog.com. DO NOT USE THIS PRODUCT IN LIFE SUPPORT SYSTEMS. LIFE SUPPORT POLICY ZILOG’S PRODUCTS ARE NOT AUTHORIZED FOR USE AS CRITICAL COMPONENTS IN LIFE SUPPORT DEVICES OR SYSTEMS WITHOUT TH E EXPRESS PRIOR WRITTEN APPROV AL OF THE PRESIDENT AND GENERAL COUNSEL OF ZILOG CORPORATION. As used herein Life support devices or systems are devices which (a) are intended for surgical implant into the body, or (b) support or sustain life and whose failure to perform when properly used in accordance with instructions for use provided in the labeling can be re asonably expected to result in a significant injury to the user. A critical component is any component in a life suppor t device or system whose failure to perform can be reasonably expected to cause the fa ilure of the life support device or system or to affect its safety or effectiveness. Document Disclaimer ©2011 Zilog, Inc. All rights reserved. Information in this publication concerning the devices, applications, or technology described is intended to suggest possible uses and ma y be superseded. ZILOG , INC. DOES NOT ASSUME LIABILITY FOR OR PROVIDE A REPRESENTATION OF ACCURACY OF THE INFORMATION, DEVICES, OR TECHNOLOGY DESCRIBED IN THIS DOCUMENT. ZILOG ALSO DOES NOT ASSUME LIABILITY FOR INTELLECTUAL PROPERTY INFRINGEMENT RELATED IN ANY MANNER TO USE OF INFORMATI ON, DEVICES, OR TECHNOLOGY DESCRIBED HEREIN OR OTHERWISE. The information contained within this document has been verified according to the general principles of electrical and mechanical engineering. Z8, Z8 Encore!, Z8 Encore! XP and ZMOTION are trademarks or registered trademarks of Zilog, Inc. All other product or service names are the property of their respective owners. Warning: