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

Similar documents
ADC Guide, Part 1 The Ideal ADC

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

THIS SPEC IS OBSOLETE

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

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

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

16-Bit Hardware Pulse Width Modulator Data Sheet

Terminating RoboClock II Output

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

16-Bit PWM Dead Band Generator Data Sheet

3.3V Zero Delay Buffer

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

THIS SPEC IS OBSOLETE

1 Mbit (128K x 8) Static RAM

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

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

WirelessUSB LS Radio Module FCC Testing & Verification - AN4006

256K (32K x 8) Static RAM

THIS SPEC IS OBSOLETE

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

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

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

AN3134 Application note

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

Two Op-Amps Three Op-Amps

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

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

Crystal to LVPECL Clock Generator

MICROCONTROLLERS Stepper motor control with Sequential Logic Circuits

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

CE PSoC 6 MCU Breathing LED using Smart IO

Low Skew Clock Buffer

Spread Aware, Ten/Eleven Output Zero Delay Buffer

EDE1204 Bi-Polar Stepper Motor IC

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

AN Programming the PCA200x family of watch ICs. Document information

Stepping motor controlling apparatus

EEE3410 Microcontroller Applications Department of Electrical Engineering Lecture 11 Motor Control

AN2446 Application note

Test Report TIDA November 2015

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

DC motor control using arduino

Spread Spectrum Clock Generator

High-Torque/High-Power Bipolar Stepper Motor Driver Using 8-bit PIC Microcontroller. Over Temperature Detection COG1 COG1C COG2

SiT6722EB Evaluation Board User Manual

AN457 APPLICATION NOTE

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

Application Note. Brushless DC Motor Control AN-1114

Stepper Motor Drive Circuit

L6219DSA. Stepper motor driver for automotive range. Features. Description

Automated PMSM Parameter Identification

Universal Programmable Clock Generator (UPCG)

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

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

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

Electric Bike BLDC Hub Motor Control Using the Z8FMC1600 MCU

AN NFC, PN533, demo board. Application note COMPANY PUBLIC. Rev July Document information

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

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

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

AL5816EV1 User Guide. 4.5V to 60VDC Adjustable Linear LED Driver

Table 1. Quick reference data Symbol Parameter Conditions Values Unit Absolute maximum rating V DRM repetitive peak off-state

MBC Bipolar Microstep Driver. User s Guide. 910 East Orangefair Lane, Anaheim, CA

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

50 ma LED driver in SOT457

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

20 ma LED driver in SOT457

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

Dual ultrafast power diode in a SOT78 (TO-220AB) plastic package.

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

TED-Kit 2, Release Notes

BT D. 1. General description. 2. Features and benefits. 3. Applications. 4. Quick reference data. 4Q Triac

DM8010 tm. Hardware Reference Manual. Document Revision B3 May 16, 2018

DATA SHEET. BZA462A Quadruple ESD transient voltage suppressor DISCRETE SEMICONDUCTORS. Product data sheet Supersedes data of 1998 Oct 30.

BB Product profile. 2. Pinning information. 3. Ordering information. FM variable capacitance double diode. 1.1 General description

Hyperfast power diode in a SOD59 (2-lead TO-220AC) plastic package.

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

DATASHEET CA3275. Description. Features. Applications. Ordering Information. Block Diagram. Pinout. Dual Full Bridge Driver

AN TEA1892 GreenChip synchronous rectifier controller. Document information

AN12082 Capacitive Touch Sensor Design

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

Configuring PWM Outputs of TMS320F240 with Dead Band for Different Power Devices

AN243 Application note

DISCRETE SEMICONDUCTORS DATA SHEET. BT150 series Thyristors logic level

VHF variable capacitance diode

DATA SHEET. BZA800A-series Quadruple ESD transient voltage suppressor DISCRETE SEMICONDUCTORS. Product data sheet Supersedes data of 2000 May 01

ACT108W-600E. Table 1. Quick reference data Symbol Parameter Conditions Min Typ Max Unit V DRM. full sine wave; T j(init) = 25 C; t p = 16.

DISCRETE SEMICONDUCTORS DATA SHEET. 1PS76SB10 Schottky barrier diode. Product specification Supersedes data of 1996 Oct 14.

Four planar PIN diode array in SOT363 small SMD plastic package.

Quad 2-input NAND buffer (open collector) The 74F38 provides four 2-input NAND functions with open-collector outputs.

Table 1. Quick reference data Symbol Parameter Conditions Min Typ Max Unit V RRM. half sine wave; T sp 112 C; Fig A

BT G0T. 1. General description. 2. Features and benefits. 3. Applications. 4. Quick reference data. 4Q Triac

UHF variable capacitance diode. Voltage Controlled Oscillators (VCO) Electronic tuning in UHF television tuners

DISCRETE SEMICONDUCTORS DATA SHEET. k, halfpage M3D102. BAP64-04W Silicon PIN diode Jan 29. Product specification Supersedes data of 2000 Jun 06

DISCRETE SEMICONDUCTORS DATA SHEET M3D319. PMEG3002AEB Low V F MEGA Schottky barrier diode. Product specification 2002 May 06

1.2 A 15 V H-Bridge Motor Driver IC

DISCRETE SEMICONDUCTORS DATA SHEET M3D319. BAS716 Low-leakage diode. Product specification 2003 Nov 07

AN4112 Application note

Motor control using FPGA

Transcription:

Industrial Stepper Motor Driver AN43679 Author: Dino Gu, Bill Jiang, Jemmey Huang Associated Project: Yes Associated Part Family: CY8C27x43, CY8C29x66 GET FREE SAMPLES HERE Software Version: PSoC Designer 4.4 Associated Application Notes: AN2229, AN41949 Application Note Abstract This application note demonstrates PSoC implementation of the universal industrial stepper motor controller. Microstepping control and current limiting are also explained in detail. Introduction The stepper motor is a brushless electromechanical device, which converts electric pulses into discrete mechanical movements. The rotation of the stepper motor is divided into several steps, called microsteps. The high position precision of the stepper motor control system is achieved by using microstepping control technology. The rotor s turning angle is proportional to the number of pulses sent into the motor. Stepper motors are widely used in low cost and open loop position control applications, such as ink jet printers, CNC machines, and volumetric pumps. The stepper motor has the following features: 1. Open Loop Positioning. Precise positioning and repetition without speed and position sensors. The rotor s tuning angle is defined by the number of pulses delivered to the motor. Hybrid motors are more expensive than permanent magnet motors, but they use smaller step angles, and have greater torque maximum speeds. Hybrid motors combine the best features of variable reluctance motors and permanent magnet motors. The most popular types of motors are the unipolar and the bipolar motors. This application note explains in detail about microstepping control and the current chopper PSoC implementation of a bipolar hybrid stepper motor. This method is also applicable for permanent magnet motors. Stepper Motor Control Method Bipolar hybrid stepper motor driving is shown in Figure 1. Two h-bridges control the two windings. Figure 1. Bipolar Hybrid Stepper Motor Driving 2. Holding Torque. Holds the shaft stationary and provides full torque when stopped, if windings are powered. 3. High Reliability. Because the stepper motor is brushless, the life span of a stepper motor depends on the bearings. 4. Excellent Response. Quick start, stop, and reverse capability. There are three basic types of stepping motors: Variable Reluctance Motor Permanent Magnet Motor Hybrid Motor December 20, 2007 Document No. 001-43679 Rev. ** - 1 -

The operational modes of the stepper motor include full step mode, half step mode, and microstep mode. The full step mode also has two driving modes: one phase on and two phase on driving modes. Each operational mode controls the motor with a different method. Single stepping a motor results in jerky movements of the motor, especially at lower speeds. Microstepping control achieves increased step resolution and smoother torque between steps. In addition, microstepping control has fewer noise and resonance problems. Microstepping control works on the principle of gradually transferring current from one phase to another. Microstep The waveform of eight microsteps is shown in Figure 4. With more division, the motor current is smoothly transferred from one phase to the other phase, as shown in the following figure. With sufficient division and current level, the motor phase current changes in a sinusoidal fashion. Thus, the torque of the motor keeps a constant value. Figure 4. Eight Microsteps Current Waveform The following sections describe the one phase on full step mode, half step mode, and microstep control. Full Step (One Phase On) The current waveform of the one phase on full step is shown in Figure 2. During every step, only one winding is powered. In the next step, the current alters to the other winding. In this mode, the torque varies in sinusoidal. Figure 2. Full Step Current Waveform PSoC-Based Implementation The control diagram of the PSoC-based stepper motor driver is shown in Figure 5. Figure 5. Control Diagram Half Step (One and Two Phase On) The half step mode is also called the one and two phase on mode. In this mode, the motor s step is one half of a step in the full step mode. One phase is turned on during each first step and the other phase is turned on during each second step. The half step mode provides constant torque with special controls. The current waveform of the half step mode is shown in Figure 3. Figure 3. Half Step Current Waveform This solution has lower system costs compared with the existing products because of PSoC s internal flexible digital and analog user modules. As seen in Figure 5, the PSoCbased stepper motor driver includes four main parts: state machine, sin or cosine voltage generator, kill signal generator, and PWM driving signals. December 20, 2007 Document No. 001-43679 Rev. ** - 2 -

When booting up, the system detects board configurations such as rotation direction, current level, and stepping pace. The system provides four current options and six step paces. Then the system stands by and waits for incoming step pulses. If no pulse comes within a predefined time interval, the system enters the half current mode. The current in the half current mode is half of the current in the normal operation. This saves power consumption and also generates holding torques to keep the motor stable. A built-in sin or cosine table is stored in PSoC s internal Flash. A Digital-to-Analog Converter (DAC) is used to set the winding current in microstep mode. Precise positions are achieved in microstep mode. The voltage output of the DAC is the winding current reference and is fed into a comparator input. Another comparator input is the sampled winding current. The winding current is sampled by a shunt resistor, which is placed between the system ground and the winding as shown in Figure 1 on page 1. The voltage on the shunt resistor is proportional to the current flowing through the windings. The comparator output is high if the sampled winding current is higher than the DAC output reference current, otherwise the comparator output is low. The comparator output is the kill signal routed into the PWM Dead Band generator (PWMDB). An active high kill signal drags the PWMDB low. PWMDB output is routed to pins through the Global Output Bus. The PSoC device internals are shown in the Appendix. The user modules used in the application follow: 1. Two PWMDBs 2. Two SC Blocks for DAC 3. Two SC Blocks for Comparator 4. Two PGA for On-Chip Adjustable Current Level 5. One Timer Block for Half Current Mode Detection 6. Two DigBufs for Internal PWMDB Output Signal Routing Stepper Motor Driver The driver board with motor is shown in Appendix 1 on page 4. It is an industrial controller with configurable current, rotation direction, and microsteps. It also has a step pulse input interface. The features of the driver follow: Bipolar Stepper Motor PWM Current Regulator Pulse Command Receiver Interface Individual Power Switches Two H-Bridge Circuits Automatic Half Current at Still Microstep Configurable Selectable Dynamic Motor Phase Current Volume Optional Rotation Clockwise or Counterclockwise There are eight switches (SW1 to SW8) that are used to select rotate direction, current level, and the number of microsteps. Table 1 lists the current configuration. The current selection depends on the load. Table 1. Dynamic Current Configuration SW7 SW8 Peak Current On On 0.6A Off On 1.0A On Off 1.6A Off Off 3.0A Table 2 lists the selection of the number of microsteps. Table 2. Microstep Configuration SW1 SW2 SW3 Microstep Step/Revolution On On Off Fullstep 200 On Off On Halfstep 400 Off Off On 4 800 Off On Off 8 1600 On Off Off 16 3200 Off Off Off 32 6400 SW4-On selects rotating clockwise, or counterclockwise. The step command input, +5V pulse, is fed into the stepper motor driver. The higher the frequency of the pulse command, the faster the motor spins. Thus, both speed and the position of the stepper motor may be precisely adjusted by an external controller at every moment. The Software The flowchart of the software is shown in Appendix 3 on page 6. In the main loop, PSoC monitors the change of dynamic current settings and acts accordingly. When an external pulse command comes in, an IO interrupt is triggered. As a result, MstepCnt, which is used to counter microstep numbers, increases by MStep. The lookup sin/cos table faction uses MStepCnt as a pointer to generate the sin or cosine current reference value. When MStepCnt loops to zero, the software enters the step switching code. In this code, the patterns of the power switches are rearranged according to the internal state machine. The direction of the stepper motor may be easily changed by inverting the step loop sequence. Summary This application note describes stepper motor control based on PSoC. With the assistance of a PSoC device, the stepper motor driver implements microstepping control, and allows the user to easily configure parameters. December 20, 2007 Document No. 001-43679 Rev. ** - 3 -

Appendix 1 Figure 6. Stepper Motor Driver Board December 20, 2007 Document No. 001-43679 Rev. ** - 4 -

Appendix 2 Figure 7. User Module Placement in PSoC Designer December 20, 2007 Document No. 001-43679 Rev. ** - 5 -

Appendix 3 Figure 8. Software Flowchart Start IO ISR Device Initialization MStepCnt += MStep Enable interrupt MStepCnt &= 31 Enable PWMs N MStepCnt = 0 Adjust Current according to IO input Y Adjust MStep number according to IO input Step++ Step =1 Step =2 Step =3 Step =4 Call vstep1 Call vstep3 Step =0 Dir = CW N N Dir = CW Y Y Call vstep2 Call vstep4 Look up sin/cos table according to MStepCnt Set two DACs Ret December 20, 2007 Document No. 001-43679 Rev. ** - 6 -

Appendix 4 Figure 9. Board Control Diagram December 20, 2007 Document No. 001-43679 Rev. ** - 7 -

Appendix 5 Figure10. Schematic (Control Circuit) December 20, 2007 Document No. 001-43679 Rev. ** - 8 -

Figure 11. Schematic (Drive Circuit) December 20, 2007 Document No. 001-43679 Rev. ** - 9 -

About the Authors Name: Dino Gu Bill Jiang Jemmey Huang Title: Senior Application Engineer Senior Application Engineer FAE Manager Contact: qdgu@cypress.com xpj@cypress.com jhu@cypress.com 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 may be 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. 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. Nor 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. December 20, 2007 Document No. 001-43679 Rev. ** - 10 -