AN2170. AN2170 PSoC 1 - Sensored BLDC Motor Control using Hall Effect Sensors. Application Note Abstract. Introduction

Similar documents
This Application Note demonstrates how to use a PSoC to control a 3-phase Brushless Direct Current (BLDC) motor utilizing Hall-effect sensors.

AN Industrial Stepper Motor Driver. Application Note Abstract. Introduction. Stepper Motor Control Method

The Frequency Divider component produces an output that is the clock input divided by the specified value.

THIS SPEC IS OBSOLETE

ADC Guide, Part 1 The Ideal ADC

AN Low Frequency RFID Card Reader. Application Note Abstract. Introduction. Working Principle of LF RFID Reader

W H I T E P A P E R. Analog Signal Chain Calibration

Produces a selectable output voltage that is higher than the input voltage

16-Bit Hardware Pulse Width Modulator Data Sheet

Terminating RoboClock II Output

3.3V Zero Delay Buffer

1 Mbit (128K x 8) Static RAM

CAPACITIVE SENSING MADE EASY, Part 1: An Introduction to Different Capacitive Sensing Technologies

16-Bit PWM Dead Band Generator Data Sheet

THIS SPEC IS OBSOLETE

Produces a selectable output voltage that is higher than the input voltage

Operational Amplifier (Opamp) Features. General Description. Input/Output Connections. Noninverting Analog Follower or Opamp configuration

WirelessUSB LS Radio Module FCC Testing & Verification - AN4006

THIS SPEC IS OBSOLETE

Produces a selectable output voltage that is higher than the input voltage

256K (32K x 8) Static RAM

W H I T E P A P E R. EMC Countermeasure Techniques in Hardware. Introduction

Application Note. 3-Phase Brushless DC Motor Control with Hall Sensors AN-CM-244

2.5V or 3.3V, 200 MHz, 9-Output Zero Delay Buffer

Spread Spectrum Clock Generator

SINGLE PHASE HALL EFFECT LATCH SMART FAN MOTOR CONTROLLER

Crystal to LVPECL Clock Generator

CE PSoC 6 MCU Breathing LED using Smart IO

AN3134 Application note

Two Op-Amps Three Op-Amps

AN Using PSoC in a Gaming Environment. Application Note Abstract. Introduction. Memory Copy Design. Smash PSoC Design.

L E C T U R E R, E L E C T R I C A L A N D M I C R O E L E C T R O N I C E N G I N E E R I N G

AVR443: Sensor-based control of three phase Brushless DC motor. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

Application Note, V1.0, Oct 2006 AP08019 XC866. Sensorless Brushless DC Motor Control Using Infineon 8-bit XC866 Microcontroller.

Improving feedback current accuracy when using H-Bridges for closed loop motor control

AH5794 SINGLE PHASE HALL EFFECT LATCH FAN MOTOR DRIVER. Description. Pin Assignments NEW PRODUCT. Applications. Features. (Top View) O2 3 V SS TSOT26

Spread Aware, Ten/Eleven Output Zero Delay Buffer

AN Cypress Powerline Communication Debugging Tools. Application Note Abstract. Introduction. System Diagram

If you have a question, or need help with this application note, visit

AVR443: Sensorbased control of three phase Brushless DC motor. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

AH5792 SINGLE PHASE HALL EFFECT LATCH SMART FAN MOTOR CONTROLLER. Description. Pin Assignments. Features. Applications

Spread Spectrum Clock Generator

AN2047. Sensing - Ultrasound Motion Sensor. Application Note Abstract. Introduction

512 x 8 Registered PROM

Dead-Time Compensation Method for Vector-Controlled VSI Drives Based on Qorivva Family

AVR42778: Core Independent Brushless DC Fan Control Using Configurable Custom Logic on ATtiny817. Features. Introduction. AVR 8-bit Microcontroller

Digital-Output Magnetic Sensor (Hall IC)

Automated PMSM Parameter Identification

F²MC-8FX/16LX/16FX/FR FAMILY BLDC DRIVE WITH THE PPG

64K x 1 Static RAM CY7C187. Features. Functional Description. Logic Block Diagram. Pin Configurations. Selection Guide DIP. SOJ Top View.

The Application Note demonstrates a PSoC implementation of brushless direct current (BLDC) motor control using sensorless, back-emf technology.

128K x 8 Static RAM CY7C1019B CY7C10191B. Features. Functional Description. Logic Block Diagram. Pin Configurations

AN3332 Application note

AN2226. PSoC 1 - Using Correlated Double Sampling to Reduce Offset, Drift, and Low Frequency Noise. Introduction. Simple Approach. Too Simple Approach

Electric Bike BLDC Hub Motor Control Using the Z8FMC1600 MCU

EVAL6235N. Demonstration board for L6235 DMOS driver for 3-phase brushless DC motor. Description. Features

Low Skew Clock Buffer

AN4564 Application note

This Application Note demonstrates using the PSoC mixed-signal array to drive a low-power stepper motor for smart pointer gauges.

MDC V, 2A Brushless Controller. User s Guide E. Landon Drive Anaheim, CA

Application Note. Brushless DC Motor Control AN-1114

3.3V Zero Delay Buffer

AN2229. Motor Control - Multi-Functional Stepping Motor Driver. Application Note Abstract. Introduction

One-PLL General Purpose Clock Generator

AS5x40/AS5x45. User Manual AS5x40/AS5x45-AB-v bit Rotary Position Sensor with Digital Angle (Interface), ABI, UVW and PWM output

ML4818 Phase Modulation/Soft Switching Controller

Introduction to BLDC Motor Control Using Freescale MCU. Tom Wang Segment Biz. Dev. Manager Avnet Electronics Marketing Asia

Spread Spectrum Clock Generator

AN12232 QN908x ADC Application Note

CHAPTER 4 FUZZY BASED DYNAMIC PWM CONTROL

ams AG austriamicrosystems AG is now The technical content of this austriamicrosystems application note is still valid. Contact information:

Universal Programmable Clock Generator (UPCG)

Overview of the STM32F103xx ACIM and PMSM motor control software libraries release 2.0

Analog Devices: High Efficiency, Low Cost, Sensorless Motor Control.

High-Voltage, Non-Isolated Buck-Boost Converter for ISDN Digital Phones

AN243 Application note

AN1449 Application note

Ametek, Inc. Rotron Technical Products Division. 100 East Erie St., Suite 200 Kent, Ohio User's Guide. Number Revision F

EDE1204 Bi-Polar Stepper Motor IC

Using the High Voltage Physical Layer In the S12ZVM family By: Agustin Diaz

TOSHIBA Bi-CD Integrated Circuit Silicon Monolithic TB6633FNG/AFNG

TN ADC design guidelines. Document information

DISCRETE SEMICONDUCTORS DATA SHEET. book, halfpage M3D302. BZA418A Quadruple ESD transient voltage suppressor. Product specification 2002 Sep 02

Speed Control of BLDC Motor Using FPGA

One-PLL General Purpose Flash Programmable Clock Generator

AN2331. Power Management - MAX1583 White LED Driver Emulation with PSoC. Introduction. Principles of Operation

14-Bit Registered Buffer PC2700-/PC3200-Compliant

LV-Link 3.0 Software Interface for LabVIEW

CHAPTER 2 STATE SPACE MODEL OF BLDC MOTOR

I/O 1 I/O 2 I/O 3 I/O 4 I/O 5 I/O 6 I/O 7

PART 2 - ACTUATORS. 6.0 Stepper Motors. 6.1 Principle of Operation

AN4999 Application note

combine regular DC-motors with a gear-box and an encoder/potentiometer to form a position control loop can only assume a limited range of angular

A COMPARISON STUDY OF THE COMMUTATION METHODS FOR THE THREE-PHASE PERMANENT MAGNET BRUSHLESS DC MOTOR

TOSHIBA Original CMOS 16-Bit Microcontroller. TLCS-900/H Series TMP95C061BFG TMP95C061BDFG. Semiconductor Company

TC75S55F, TC75S55FU, TC75S55FE

Electronic Speed Controls and RC Motors


4-Mbit (512K words 8 bit) Static RAM with Error-Correcting Code (ECC)

AN Programming the PCA200x family of watch ICs. Document information

Transcription:

PSoC 1 - Sensored BLDC Motor Control using Hall Effect Sensors AN2170 Application te Abstract Author: Andrey Magarita Associated Project: Associated Part Family: CY8C27xxx, CY8C29xxx Software Version: PSoC Designer 5.1 SP1 Associated Application tes: ne AN2170 discusses using Hall-effect sensors to control a Brushless DC (BLDC) motor using PSoC 1. By using the digital and analog system of a PSoC 1 device, one can reliability track the position of the BLDC motor rotor using the Hall-effect sensors. With this information, a reliable control system can be implemented to commutate the BLDC motor at the appropriate moment producing an efficient sensored BLDC motor controller. Introduction 3-phase BLDC motors are widely used in modern electronic devices such as hard, floppy and CD-ROM PC drives as well as other consumer and industrial equipment. The motor operational principles discussed in this application note are described, in detail, in the Handbook of Small Electric Motors [1], and the essential concepts are summarized here. BLDC motors have a straight-line, speed-torque curve similar to that of their mechanically commutated counterparts. In BLDC motors, the magnets rotate and the current-carrying coils are stationary. Electronic switches, FETs in this case, control current direction. The switch sequence and timing are established by the use of a rotorposition sensor. Figure 1 shows the BLDC motor internals, which consist of a multi-pole permanent magnet rotor and a stator with multiple coils linked together using a triangle or star connection. Figure 1. BLDC Motor Internals Outer-Rotor Version Several approaches can be used to obtain information about rotor position. Possible methods include sensor-less techniques, such as back electromagnetic force sensing or sensor-based techniques, such as optical encoders and magnetic field sensors (inductor or Hall-effect based). This application note demonstrates a BLDC motor drive with Hall-effect sensors. Figure 2 on page 2 demonstrates the motor commutation operation. Each half-rotor revolution consists of six phases, with the rotor rotating 30º during each phase. The three bipolar, 120º-shifted voltage sources are used for motor control. These voltages can be true sinusoidal or step approximation of the sinewave signal. In Figure 2b, the stator coils are shown symbolically. The coil winding method used for this application note is different from that shown in Figure 2b. However, the magnetic field generation is the same as shown in Figure 2a. The minus sign before the coil marks that the coil is wound in the opposite direction relative to the part, which is marked without a minus sign. te that the coils formed by the magnetic field are non-uniform. They have maximum voltage at the pole center, with levels approximately two times higher than at the pole edges. The 3-phase switching voltage forms the rotating magnetic field. Figure 2 illustrates the stator fields after phaseswitching events. The six events (Event 1 Event 6) mark the phase-switching moments. This figure shows clockwise rotation marked by an arched arrow. To rotate the rotor counter clock-wise, the reverse phase-switching order is used and can be achieved by exchanging the switching order of any two motor coils. The polling order of the Hall-effect sensors should be reversed as well. The following notations are used in Figure 2: H1-H3 Hall sensor output signals. Wph, Vph, Uph phase W, V, U driving voltages. WUph, VWph, UVph voltages between phases WU, VW, UV. April 06, 2011 Document. 001-34560 Rev. *A 1

Figure 2. BLDC Coil Phase Voltage Switching (a) and Rotor Rotation Phases (b) The driver block diagram is shown in Figure 3. Signals from three Hall sensors with differential outputs are multiplexed by multiplexer MUX 1 and the differential signal is separated by the instrumentation amplifier, DIFF AMP. te that Hall-effect sensors have differential outputs and do not contain any internal post-processing hardware. This implementation is used in this design to minimize the cost. A differential amplifier output can be inverted using the multiplexer MUX 2 and compared to a reference signal using a comparator, COMP. The comparator generates interrupts, which are used by the CPU core to estimate rotor position. The CPU core controls the 3-channel PWM generator, which drives the winding motor via the coil s driver. An internal timer is used to measure the rotation speed and adjust the winding drive current according to the measured/demanded rotation speed value. The entire signal-processing pathway is implemented inside the PSoC. Only the coil drivers are external. Figure 3 BLDC Motor Driver Flowchart BLDC Motor Coils Driver 3 Channel PWM Hall (a) (b) MUX 1 DIFF AMP Interval Timer CPU Core Driver Implementation The BLDC motor driver has been implemented on a CY8C27466 PSoC 1 device. The various analog resources available in the PSoC device reduce the number of required external components. Table 1 lists the specifications for the motor control driver we will create for our example in this application note. Hall Hall + - -1 Inverter MUX 2 Vref + - Comp Table 1. Driver Specifications Motor Used: 3 Floppy Drive with 12V Power Supply Phases: 3 Poles: 4 Power Supply: 12V DC Power Consumption: 350 ma Rotation Speed: 60-1200 rpm Single button to change rotational direction; Service Possibilities: Two buttons to change rotational speed; Speed or driving torque stabilization modes. April 06, 2011 Document. 001-34560 Rev. *A 2

2 GN D AN2170 The Driver Schematic Figure 4 illustrates the driver schematic. The driver consists of the PSoC, U 1, mode switch, SW 1, four buttons, SW 2-SW 5, a level translator, U 2, three 4-wire Hall sensors, E 1-E 3, and a linear regulator, U 3. Figure 4. Motor Driver Schematic J1 SW2 2 1 SW3 SW1 SW4 SW5 MODE Stop/Start Reverse Speed_Up Speed_Down D1 1N4001 Mode2 Mode1 SS Rev Up Down 12V HU_N HW_N HV_N Mode2 C_V C_W Down Rev U1 VCC 1 2 P0[7] P0[6] 3 P0[5] P0[4] 4 P0[3] P0[2] P0[1] P0[0] 5 6 P2[7] P2[6] 7 P2[5] P2[4] 8 P2[3] P2[2] P2[1] P2[0] 9 SMP XRES 10 11 P1[7] P1[6] 12 P1[5] P1[4] 13 P1[3] P1[2] P1[1] P1[0] 14 Vss CY27443 U3 3 VIN VOUT 1 28 27 26 25 24 23 22 21 20 19 18 17 16 15 VCC HU_P HW_P HV_P M_EN C_U VCC Mode1 Up SS 5V 12V HU_N HU_P C_U C_V C_W M_EN M_EN U2 E2 2 7 IN1 10 IN2 15 IN3 IN4 1 9 EN1 EN2 8 16 VS VSS L293D R1 180R VCC - + X M1 3 OUT1 6 OUT2 11 OUT3 14 OUT4 U W V + + X X - E1 - E3 HW_P HW_N HV_P HV_N LINE C1 0.1uF C2 470uF LM78L05 C3 220uF C4 0.1uF C5 0.1uF April 06, 2011 Document. 001-34560 Rev. *A 3

The Driver Operation Details Figure 5 shows the placement of the PSoC user modules. PSoC analog blocks are used to build the sensor s signal processing section and identify rotor-phase position. This section consists of: An instrumentation amplifier with differential multiplexer for sensor signal-level shifting and amplification. A gain inverter stage for signal rectification. A comparator for rotor-phase switching interrupt generation. Signal processing of the Comparator signal determines the current motor rotor phase. PSoC digital blocks are used to build the three 8-bit PWM timers with variable incoming frequency (an additional 8-bit prescaler is used to generate the PWM module s clock signal). The 16-bit timer is used to measure the rotation speed of the motor. The phase shift between the output signal of the adjacent PWM timer is 120º. PWM timer outputs for different phases are listed in Table 2 on page 5. Figure 5. PSoC Internal User Module Placement April 06, 2011 Document. 001-34560 Rev. *A 4

Table 2. Driver PWM Phase Signals Output Phase 1 Phase 2 Phase 3 Phase 4 Phase 5 Phase 6 Clock-wise Rotation U H H M L L M V L M H H M L W M L L M H H U-V 2A A -A -2A -A A V-W -A A 2A A -A -2A W-U -A -2A -A A 2A A Counter Clock-wise Rotation U H H M L L M V M L L M H H W L M H H M L U-V A 2A A -A -2A -A V-W A -A -2A -A A 2A W-U -2A -A A 2A A -A received, the phase drive signals are switched and the PWM timers reloaded. Figure 6. PWM Phase Signals Figure 7. Motor Winding Voltages U, V, and W are the PWM timer phase outputs. U-V, V-W, and W-U are the motor winding levels. L is the minimum PWM value. H is the maximum PWM value. M is the middle PWM level. A equals H-M = M-L, or half the maximum PWM value of winding the motor. Table 2 and Figure 6 show that the PWM output signals assign a combination of 3 allowable voltage levels on the motor windings. These levels are shown in Figure 7. According to Table 2, there are six possible rotation phases (states) and six corresponding PWM driver states. The signal curve can be considered a 2-bit approximation of a triangle signal. The PWM timers work as one-shot devices. The one-shot rerun is implemented in software and triggered by motor rotor-phase change events. In the brushless DC motor, the rotation speed is determined by the construction of the motor, PWM timer output signal s duty cycle, and current load value. Rotation direction is changed using the standard approach of reverse driving and waiting during the phase sequence for two motor windings. By switching the PSoC internal hardware buses, users can change the phases driving sequence. Be aware, phases that are waiting for instructions should be changed only in the firmware. Interrupts from the sensor signal-processing unit are the foundation of the main loop program. When no interrupts occur within a predefined timeout, the next commutation cycle is forcibly initiated. The phase switching returns to the conventional method (non-forced commutation) when periodic interrupts from the rotor sensor signal-processing section are received. So when a rotation sensor signal is The driver stabilizes the driving torque or rotation speed to get stable motor operation. Demand mode is set by using DIP-switches, and a new mode is activated only after a motor restart. When torque stabilization mode is selected, the duty cycle is stabilized via a PWM clock frequency adjustment without changing the PWM compare value. The compare value is adjusted in this mode only when the preset speed is increased or decreased by pressing the Speed Up or Speed Down buttons, respectively. The correction is implemented based on the measurement results of the interval counter. This counter measures the duration of each phase in units of the PWM clock frequency. The four control buttons are used to start or stop the motor and adjust the rotation speed or torque. There are 20 levels in speed stabilization mode and 14 levels in torque stabilization mode. When rotation speed stabilization mode is selected, the PWM clock frequency is fixed, but PWM compare values vary depending on the measured data from the interval counter. A proportional regulator with a first order input IIR filter is used in both modes. The more advanced regulator types (PID for example) can easily be implemented in the firmware due to low CPU overheads in the current implementation. The ideal single-revolution rate of the regulator (in RPMs) is determined by the PWM clock divider value N cd and PWM timer period, N pwm: April 06, 2011 Document. 001-34560 Rev. *A 5

Equation 1 F vc1 is the VC1 clock frequency. N pwm is the PWM timers period. N d is the PWM clock divider coefficient. The timer PWM H, M, and L levels are calculated using the speed coefficient, K speed, with the following formulas: Equation 2 The speed coefficient is set using the Speed Up and Speed Down buttons. Summary This note demonstrates using PSoC for sensored brushless DC motor control. This design can be adapted for other rotor position sensing techniques, such as quadrature decoders and inductance-based position sensors. The driver can be updated to support motors with different power levels by replacing the coil driver. References 1. Handbook of Small Electric Motors, William H. Yeadon, Alan W. Yeadon, McGraw-Hill, 2001. About the Author Name: Title: Background: Contact: Andrey Magarita Sr. Application Engineer Andrey has more than 15 years experience in embedded systems design. You may contact him at makar@ltf.lviv.net. April 06, 2011 Document. 001-34560 Rev. *A 6

Appendix A. Software Flowcharts Figure 8. Main Loop Flowchart Begin Main Init Variables START_DELAY= ON MOVE=MOVE_ MOTOR START_DELAY=OFF SystemTimerCheck =ON Start PWM Timers Start Measure Counter Determinate current phase BUTT_CHECK= ON EVENT_CALC_PWM=ON Input and verification Press Buttons EVENT_CALC_PWM =ON MOVE=ON Calculate value PWM Timers dependent on mode EVENT_CALC_PWM=OFF MOVE=START_ MOVE Define start condition add start motor MOVE=MOVE_MOTOR April 06, 2011 Document. 001-34560 Rev. *A 7

Figure 9. Sensor Comparator Interrupt Flowchart April 06, 2011 Document. 001-34560 Rev. *A 8

Appendix B. Driver Photographs Figure 10. Driver Motor, Assembled Board (a), Rotor opposite Side (b), Coils and Hall Sensors (c) April 06, 2011 Document. 001-34560 Rev. *A 9

Document History Page Document Title: AN2170 PSoC 1 Sensored BLDC Motor Control using Hall Effect Sensors Document Number: 001-34560 Revision ECN Orig. of Change Submission Date Description of Change ** 1505943 RLRM 10/08/2007 Original Document *A 3216274 RLRM 04/06/2011 Document Title updated. Document History Page added In March of 2007, Cypress recataloged all of its Application tes using a new documentation number and revision code. This new documentation number and revision code (001-xxxxx, beginning with rev. **), located in the footer of the document, will be used in all subsequent revisions. PSoC is a registered trademark of Cypress Semiconductor Corp. "Programmable System-on-Chip," PSoC Designer, and PSoC Express are trademarks of Cypress Semiconductor Corp. All other trademarks or registered trademarks referenced herein are the property of their respective owners. Cypress Semiconductor 198 Champion Court San Jose, CA 95134-1709 Phone: 408-943-2600 Fax: 408-943-4730 http://www.cypress.com/ Cypress Semiconductor Corporation, 2007-2011. The information contained herein is subject to change without notice. Cypress Semiconductor Corporation assumes no responsibility for the use of any circuitry other than circuitry embodied in a Cypress product. r does it convey or imply any license under patent or other rights. Cypress products are not warranted nor intended to be used for medical, life support, life saving, critical control or safety applications, unless pursuant to an express written agreement with Cypress. Furthermore, Cypress does not authorize its products for use as critical components in life-support systems where a malfunction or failure may reasonably be expected to result in significant injury to the user. The inclusion of Cypress products in life-support systems application implies that the manufacturer assumes all risk of such use and in doing so indemnifies Cypress against all charges. This Source Code (software and/or firmware) is owned by Cypress Semiconductor Corporation (Cypress) and is protected by and subject to worldwide patent protection (United States and foreign), United States copyright laws and international treaty provisions. Cypress hereby grants to licensee a personal, non-exclusive, non-transferable license to copy, use, modify, create derivative works of, and compile the Cypress Source Code and derivative works for the sole purpose of creating custom software and or firmware in support of licensee product to be used only in conjunction with a Cypress integrated circuit as specified in the applicable agreement. Any reproduction, modification, translation, compilation, or representation of this Source Code except as specified above is prohibited without the express written permission of Cypress. Disclaimer: CYPRESS MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS MATERIAL, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. Cypress reserves the right to make changes without further notice to the materials described herein. Cypress does not assume any liability arising out of the application or use of any product or circuit described herein. Cypress does not authorize its products for use as critical components in life-support systems where a malfunction or failure may reasonably be expected to result in significant injury to the user. The inclusion of Cypress product in a life-support systems application implies that the manufacturer assumes all risk of such use and in doing so indemnifies Cypress against all charges. Use may be limited by and subject to the applicable Cypress software license agreement. April 06, 2011 Document. 001-34560 Rev. *A 10