+ All Categories
Home > Documents > Microstepping Bipolar Drive of Two-Phase Hybrid · PDF fileMicrostepping Bipolar Drive of...

Microstepping Bipolar Drive of Two-Phase Hybrid · PDF fileMicrostepping Bipolar Drive of...

Date post: 07-Feb-2018
Category:
Upload: hakhanh
View: 220 times
Download: 0 times
Share this document with a friend
10
Application Report SPRAAU7 – May 2008 Microstepping Bipolar Drive of Two-Phase Hybrid Stepping Motor on TMS320F2808 DSC Chawakorn Yodsanti and Mongkol Konghirun ..................... King Mongkut's University of Technology Thonburi ABSTRACT This application report describes the implementation of a micro-stepping algorithm for a two-phase stepper motor using the TMS320F2808 digital signal controller (DSC). The "C" code can easily be utilized with other members of the C2000™ DSC platform of devices. Project collateral and source code discussed in this application report can be downloaded from the following URL: http://www-s.ti.com/sc/techlit/spraau7.zip . Contents 1 Introduction .......................................................................................... 2 2 Microstepping Scheme With Current Controlled ............................................... 2 3 Experimental Results............................................................................... 3 4 Conclusion ........................................................................................... 9 5 References .......................................................................................... 9 List of Figures 1 Dual H-Bridge Circuit Connecting to a Two-Phase Hybrid Stepping Motor................. 2 2 Overall System Using DSP........................................................................ 3 3 Overall Hardware Setup ........................................................................... 4 4 Code Composer Studio Screen Capture With Graphs During Run-Time (the captured variables are discrete angle, reference current, feedback current, etc.) ........ 4 5 Overall Software Flowchart........................................................................ 5 6 Responses for Precision = 1/8 Step ............................................................. 6 7 Responses for Precision = 1/16 Step ............................................................ 7 8 Responses for Precision = 1/100 Step .......................................................... 7 9 Phase Current and Rotor Position Responses for Different Precisions ..................... 8 List of Tables 1 Code Size, Number of Cycle and MIPS Used for Microstepping Bipolar Drive of Two-Phase Hybrid Stepping Motor ............................................................... 9 C2000, Code Composer Studio are trademarks of Texas Instruments. eZdsp is a trademark of Spectrum Digital Inc. All other trademarks are the property of their respective owners. SPRAAU7 – May 2008 Microstepping Bipolar Drive of Two-Phase Hybrid Stepping Motor on F2808 DSC 1 Submit Documentation Feedback
Transcript
Page 1: Microstepping Bipolar Drive of Two-Phase Hybrid · PDF fileMicrostepping Bipolar Drive of Two-Phase Hybrid Stepping Motor on ... two-phase stepper motor using the ... 2 Microstepping

Application ReportSPRAAU7–May 2008

Microstepping Bipolar Drive of Two-Phase HybridStepping Motor on TMS320F2808 DSC

Chawakorn Yodsanti and Mongkol Konghirun ..................... King Mongkut's University of Technology Thonburi

ABSTRACTThis application report describes the implementation of a micro-stepping algorithm for atwo-phase stepper motor using the TMS320F2808 digital signal controller (DSC). The"C" code can easily be utilized with other members of the C2000™ DSC platform ofdevices.

Project collateral and source code discussed in this application report can bedownloaded from the following URL: http://www-s.ti.com/sc/techlit/spraau7.zip.

Contents1 Introduction .......................................................................................... 22 Microstepping Scheme With Current Controlled ............................................... 23 Experimental Results............................................................................... 34 Conclusion........................................................................................... 95 References .......................................................................................... 9

List of Figures

1 Dual H-Bridge Circuit Connecting to a Two-Phase Hybrid Stepping Motor................. 22 Overall System Using DSP........................................................................ 33 Overall Hardware Setup ........................................................................... 44 Code Composer Studio Screen Capture With Graphs During Run-Time (the

captured variables are discrete angle, reference current, feedback current, etc.) ........ 45 Overall Software Flowchart........................................................................ 56 Responses for Precision = 1/8 Step ............................................................. 67 Responses for Precision = 1/16 Step ............................................................ 78 Responses for Precision = 1/100 Step .......................................................... 79 Phase Current and Rotor Position Responses for Different Precisions ..................... 8

List of Tables

1 Code Size, Number of Cycle and MIPS Used for Microstepping Bipolar Drive ofTwo-Phase Hybrid Stepping Motor............................................................... 9

C2000, Code Composer Studio are trademarks of Texas Instruments.eZdsp is a trademark of Spectrum Digital Inc.All other trademarks are the property of their respective owners.

SPRAAU7–May 2008 Microstepping Bipolar Drive of Two-Phase Hybrid Stepping Motor on F2808 DSC 1Submit Documentation Feedback

Page 2: Microstepping Bipolar Drive of Two-Phase Hybrid · PDF fileMicrostepping Bipolar Drive of Two-Phase Hybrid Stepping Motor on ... two-phase stepper motor using the ... 2 Microstepping

1 Introduction

S1

S2

S3

S4

S5

S6

S7

S8

A1 A2 B1 B2

Supply +

Supply -

2 Microstepping Scheme With Current Controlled

the peak command voltage*

pv . The feedback of the peak current is calculated from the measured

2 2p a b

i i i= + (1)

* *a p disc

v v cos= q (2)* *

pb discv v sin= q (3)

Introduction www.ti.com

Hybrid stepping motors are used in a wide variety of position controlled equipments such as plotters,CNCs, printers, robots, etc. However, in high precision applications, the microstepping scheme isnecessary for accurate motor rotation. Two main advantages of this scheme have been well reported inliterature such as: reduction of resonance behavior [1], [2], [4] and smooth movement with very low rippletorque [3]. In this application report, the microstepping scheme with configurable fractional step isimplemented using a fixed-point TMS320F2808 DSC from Texas Instruments, Inc.

The discrete angle for discretized sinusoidal voltage commands is generated by the zero hold order (ZOH)module. The motor currents are controlled by using unipolar pulse width modulation (PWM) technique.The dual H-bridge circuit is primarily used to drive a two-phase hybrid stepping motor as shown inFigure 1. Each phase winding is connected to each H-bridge circuit, therefore, four switching devices areindependently controlled to generate appropriate voltage for each phase winding. The main advantage ofthis circuit topology is the independent generation of bipolar voltage between two phases. In low-cost,low-precision applications, the conventional full or half step scheme is selected to implement without thePWM technique. However, high performance systems employ microstepping to achieve accurate motorphase current control.

Figure 1. Dual H-Bridge Circuit Connecting to a Two-Phase Hybrid Stepping Motor

Figure 2 shows the overall system of a microstepping bipolar drive using a TMS320F2808 DSC. Thebipolar drive is well known for its advantage of 20%-30% increased torque capability, compared to theunipolar drive [4]. Notice that the reference variables are defined with a superscript * in Figure 2. In thesystem, the peak of the two-phase motor currents is controlled by a PI controller. The output of this PI is

phase–a and –b currents by the following:

The continuous angle (θcon) is discretized to obtain discrete angle (θdisc) by the ZOH block. The number offractional steps can be adjusted by this block. Then, θdisc is used to compute the discreate sinusoidalcommand voltages with the peak determined by PI output expressed as follows:

2 Microstepping Bipolar Drive of Two-Phase Hybrid Stepping Motor on F2808 DSC SPRAAU7–May 2008Submit Documentation Feedback

Page 3: Microstepping Bipolar Drive of Two-Phase Hybrid · PDF fileMicrostepping Bipolar Drive of Two-Phase Hybrid Stepping Motor on ... two-phase stepper motor using the ... 2 Microstepping

,

,

*a tri

*a tri

when S1on and S2 off

Otherwise, S1off and S2 on

when S3 on and S4 off

Otherwise, S3 off and S4 on

v > v

v > v-

(4)

phase-b command voltage*

bv . The main advantage of the unipolar PWM technique is the reduction of

θcon

ZOH

PI

*v v cosa p disc= q

*v v sinb p disc= q

*va

*vb

+-

vp

*ip

ip 2 2i i ip a b= +

2 PhaseUnipolar

PWMGen

DualH-BridgeConverter

ePWM1A

ePWM1B

ePWM2A

ePWM2B

ePWM3A

ePWM3B

ePWM4A

ePWM4B

ia

ib

TMS320F2808 eZ DSP

θdisc

3 Experimental Results

www.ti.com Experimental Results

Once the command voltages (2) and (3) are computed, then the duty cycle of each switching device in thedual H-bridge is determined by using the unipolar PWM technique. Based on this technique, the commandvoltages are compared with a triangle signal (Vtri) with a fixed switching frequency. The rules of fourswitching devices for phase-a are determined as follows:

Similarly, the same rules are applied for other four switching devices (S5-S8) for phase-b winding, using

ripple currents due to output voltages of the double switching frequency.

Figure 2. Overall System Using DSP

The overall system shown in Figure 2 is implemented using a fixed-point TMS320F2808 DSC operating at100 MHz system clock [5]. A photograph of the overall hardware setup is shown in Figure 3. In thissystem, the switching frequency is set at 10 kHz. This is also the frequency of the interrupt service routine(ISR) where overall algorithms are executed. In addition, two measured currents are sampled at thisfrequency using the on-chip 12-bit analog-to-digital (ADC) converter of DSC. The DSC is configured togenerate the 1-µs of dead time for upper and lower switching devices. The two-phase stepping motor israted 3A and 1.8° step angle. Code Composer Studio™ V3.1 is used as a DSP development tool and iscapable of plotting graphs of any variables in the codes during run-time [6]. Figure 4 shows a screencapture of Code Composer Studio with graphs. Some of the experimental results in this application reportare conveniently obtained from the Code Composer Studio graphs. The software flowchart of the overallimplementation can be shown in Figure 5.

SPRAAU7–May 2008 Microstepping Bipolar Drive of Two-Phase Hybrid Stepping Motor on F2808 DSC 3Submit Documentation Feedback

Page 4: Microstepping Bipolar Drive of Two-Phase Hybrid · PDF fileMicrostepping Bipolar Drive of Two-Phase Hybrid Stepping Motor on ... two-phase stepper motor using the ... 2 Microstepping

Experimental Results www.ti.com

Figure 3. Overall Hardware Setup

Figure 4. Code Composer Studio Screen Capture With Graphs During Run-Time (the captured variablesare discrete angle, reference current, feedback current, etc.)

4 Microstepping Bipolar Drive of Two-Phase Hybrid Stepping Motor on F2808 DSC SPRAAU7–May 2008Submit Documentation Feedback

Page 5: Microstepping Bipolar Drive of Two-Phase Hybrid · PDF fileMicrostepping Bipolar Drive of Two-Phase Hybrid Stepping Motor on ... two-phase stepper motor using the ... 2 Microstepping

c_int0

Initialize S/WModules

InitializeTime Bases

Enable EPWM1Time BaseCNT_Zero

Interrupt and CoreInterrupt INT3

Initialize OtherSystem

and ModuleParameters

BackgrountLoop

EPWM1_INT_ISR

INT3 Interrupt

Save Contextsand Clear

Interrupt Flags

Execute theADC Module

(CurrentsMeasurement)

Execute theRAMP_CNTL

Module

Execute theANG_GEN Module

Execute the ZOHModule

Execute theLPF and lpeakCalculations

Execute the PIModule

Execute theVcontrol

Calculations

Execute PWMUnipolar

Restore Contexts Return

INT3

www.ti.com Experimental Results

Figure 5. Overall Software Flowchart

SPRAAU7–May 2008 Microstepping Bipolar Drive of Two-Phase Hybrid Stepping Motor on F2808 DSC 5Submit Documentation Feedback

Page 6: Microstepping Bipolar Drive of Two-Phase Hybrid · PDF fileMicrostepping Bipolar Drive of Two-Phase Hybrid Stepping Motor on ... two-phase stepper motor using the ... 2 Microstepping

Experimental Results www.ti.com

Figure 6 through Figure 8 show the captured Code Composer Studio graphs of discrete angle, referencecurrent, feedback current, and current error when the step precision is configured by the ZOH block forprecision = 1/8, 1/16, and 1/100 step, respectively. As seen from these figures, the current is successfullycontrolled with a peak of 0.5 per-unit (base current of 2A) regardless of the step precision. The currenterrors in Figure 6(b), Figure 7(b), and Figure 8(b) are shown to validate the successful implementation ofcurrent control. As the fractional step is reduced, the current waveforms become less and less discretizedand eventually sinusoidal. When the currents are sinusoidal waveforms, the smooth rotation of thestepping motor is obtained with small ripple torque. This is a necessary requirement in high precisionapplications.

Figure 6. Responses for Precision = 1/8 Step

Microstepping Bipolar Drive of Two-Phase Hybrid Stepping Motor on F2808 DSC6 SPRAAU7–May 2008Submit Documentation Feedback

Page 7: Microstepping Bipolar Drive of Two-Phase Hybrid · PDF fileMicrostepping Bipolar Drive of Two-Phase Hybrid Stepping Motor on ... two-phase stepper motor using the ... 2 Microstepping

www.ti.com Experimental Results

Figure 7. Responses for Precision = 1/16 Step

Figure 8. Responses for Precision = 1/100 Step

SPRAAU7–May 2008 Microstepping Bipolar Drive of Two-Phase Hybrid Stepping Motor on F2808 DSC 7Submit Documentation Feedback

Page 8: Microstepping Bipolar Drive of Two-Phase Hybrid · PDF fileMicrostepping Bipolar Drive of Two-Phase Hybrid Stepping Motor on ... two-phase stepper motor using the ... 2 Microstepping

Experimental Results www.ti.com

In Figure 9, phase-a current and rotor position of the stepping motor are shown for (a) full step, (b) 1/8step, and ) 1/100 step. The experiments are tested under the same peak current controlled and samestepping rate. As seen in Figure 9, the peak of current is always constant for three different stepprecisions because of successful current control. However, the movement of the rotor is extremely smoothfor precision = 1/100 step, compared to the full step angle (Figure 9(a)) and 1/8 step (Figure 9(b))precisions.

Figure 9. Phase Current and Rotor Position Responses for Different Precisions

8 Microstepping Bipolar Drive of Two-Phase Hybrid Stepping Motor on F2808 DSC SPRAAU7–May 2008Submit Documentation Feedback

Page 9: Microstepping Bipolar Drive of Two-Phase Hybrid · PDF fileMicrostepping Bipolar Drive of Two-Phase Hybrid Stepping Motor on ... two-phase stepper motor using the ... 2 Microstepping

4 Conclusion

5 References

www.ti.com Conclusion

Using the profiling capabilities of the Code Composer Studio, Table 1 summarizes the code size andnumber of cycles used for key functional blocks in the system:

Table 1. Code Size, Number of Cycle and MIPS Used for Microstepping Bipolar Drive of Two-PhaseHybrid Stepping Motor

Code Size (words) Cycles Used MIPS Used (1) (%)RAMP_CNTL 80 54 0.54ANG_GEN 65 95 0.95ZOH 75 236 2.36PI 100 146 1.46PWM 311 115 1.15Total Functional Blocks 3104 1581 15.81

(1) The MIPS used is calculated based on an ISR frequency of 10 kHz.

Microstepping is a drive technique of the stepping motor that allows the smooth movement of the rotor in afraction of the motor’s full step angle. This application report presents a digital implementation of amicrostepping bipolar drive system with current control using a fixed-point TMS320F2808 DSC. The dualH-bridge converter is designed to drive the two-phase stepping motor. The fractional step can beadjusted/configured using the ZOH block. The rotor movement can be controlled at 1/100 step resolution.The demo code is written in "C" and can be downloaded from TI web site at www.ti.com.

1. N.Q. Le and J.W. Jeon, An Open-Loop Stepper Motor Driver Based on FPGA, IEEE InternationalConference on Control, Automation and Systems (ICCAS ’07), pp. 1322-1326, 2007.

2. S-M. Yang and E-L Kuo, Damping a Hybrid Stepping Motor With Estimated Position and Velocity,IEEE Transaction on Power Electronics, vol. 18, no. 3, pp. 880-887, May 2003.

3. J.D. Wale and C. Pollock, A Low-Cost Sensorless Technique for Load Torque Estimation in a HybridStepping Motor, IEEE Transaction on Industrial Electronics, vol, 46, no. 4, pp. 833-841, August 1999.

4. T. Kenjo, Stepping Motors and Their Microprocessor Controls, Clarendon Press, Oxford, 1984.5. eZdsp™ F2808 USB: Technical Reference, Spectrum Digital Inc., Texas, 2005.6. Code Composer Studio Development Tools v3.3: Getting Started Guide (SPRU509)

SPRAAU7–May 2008 Microstepping Bipolar Drive of Two-Phase Hybrid Stepping Motor on F2808 DSC 9Submit Documentation Feedback

Page 10: Microstepping Bipolar Drive of Two-Phase Hybrid · PDF fileMicrostepping Bipolar Drive of Two-Phase Hybrid Stepping Motor on ... two-phase stepper motor using the ... 2 Microstepping

IMPORTANT NOTICETexas Instruments Incorporated and its subsidiaries (TI) reserve the right to make corrections, modifications, enhancements, improvements,and other changes to its products and services at any time and to discontinue any product or service without notice. Customers shouldobtain the latest relevant information before placing orders and should verify that such information is current and complete. All products aresold subject to TI’s terms and conditions of sale supplied at the time of order acknowledgment.TI warrants performance of its hardware products to the specifications applicable at the time of sale in accordance with TI’s standardwarranty. Testing and other quality control techniques are used to the extent TI deems necessary to support this warranty. Except wheremandated by government requirements, testing of all parameters of each product is not necessarily performed.TI assumes no liability for applications assistance or customer product design. Customers are responsible for their products andapplications using TI components. To minimize the risks associated with customer products and applications, customers should provideadequate design and operating safeguards.TI does not warrant or represent that any license, either express or implied, is granted under any TI patent right, copyright, mask work right,or other TI intellectual property right relating to any combination, machine, or process in which TI products or services are used. Informationpublished by TI regarding third-party products or services does not constitute a license from TI to use such products or services or awarranty or endorsement thereof. Use of such information may require a license from a third party under the patents or other intellectualproperty of the third party, or a license from TI under the patents or other intellectual property of TI.Reproduction of TI information in TI data books or data sheets is permissible only if reproduction is without alteration and is accompaniedby all associated warranties, conditions, limitations, and notices. Reproduction of this information with alteration is an unfair and deceptivebusiness practice. TI is not responsible or liable for such altered documentation. Information of third parties may be subject to additionalrestrictions.Resale of TI products or services with statements different from or beyond the parameters stated by TI for that product or service voids allexpress and any implied warranties for the associated TI product or service and is an unfair and deceptive business practice. TI is notresponsible or liable for any such statements.TI products are not authorized for use in safety-critical applications (such as life support) where a failure of the TI product would reasonablybe expected to cause severe personal injury or death, unless officers of the parties have executed an agreement specifically governingsuch use. Buyers represent that they have all necessary expertise in the safety and regulatory ramifications of their applications, andacknowledge and agree that they are solely responsible for all legal, regulatory and safety-related requirements concerning their productsand any use of TI products in such safety-critical applications, notwithstanding any applications-related information or support that may beprovided by TI. Further, Buyers must fully indemnify TI and its representatives against any damages arising out of the use of TI products insuch safety-critical applications.TI products are neither designed nor intended for use in military/aerospace applications or environments unless the TI products arespecifically designated by TI as military-grade or "enhanced plastic." Only products designated by TI as military-grade meet militaryspecifications. Buyers acknowledge and agree that any such use of TI products which TI has not designated as military-grade is solely atthe Buyer's risk, and that they are solely responsible for compliance with all legal and regulatory requirements in connection with such use.TI products are neither designed nor intended for use in automotive applications or environments unless the specific TI products aredesignated by TI as compliant with ISO/TS 16949 requirements. Buyers acknowledge and agree that, if they use any non-designatedproducts in automotive applications, TI will not be responsible for any failure to meet such requirements.Following are URLs where you can obtain information on other Texas Instruments products and application solutions:Products ApplicationsAmplifiers amplifier.ti.com Audio www.ti.com/audioData Converters dataconverter.ti.com Automotive www.ti.com/automotiveDSP dsp.ti.com Broadband www.ti.com/broadbandClocks and Timers www.ti.com/clocks Digital Control www.ti.com/digitalcontrolInterface interface.ti.com Medical www.ti.com/medicalLogic logic.ti.com Military www.ti.com/militaryPower Mgmt power.ti.com Optical Networking www.ti.com/opticalnetworkMicrocontrollers microcontroller.ti.com Security www.ti.com/securityRFID www.ti-rfid.com Telephony www.ti.com/telephonyRF/IF and ZigBee® Solutions www.ti.com/lprf Video & Imaging www.ti.com/video

Wireless www.ti.com/wireless

Mailing Address: Texas Instruments, Post Office Box 655303, Dallas, Texas 75265Copyright © 2008, Texas Instruments Incorporated


Recommended