Upload
others
View
5
Download
0
Embed Size (px)
Citation preview
Hindawi Publishing CorporationChinese Journal of EngineeringVolume 2013 Article ID 425093 8 pageshttpdxdoiorg1011552013425093
Research ArticleImplementation of High Performance Microstepping DriverUsing FPGA with the Aim of Realizing Accurate Control ona Linear Motion System
Farid Alidoust Aghdam1 and Siamak Saeidi Haghi2
1 Mechatronics Engineering Department Tabriz Branch Islamic Azad University Tabriz Iran2 Energy Conversion Engineering Department Mazandaran University of Science and Technology Babol Iran
Correspondence should be addressed to Farid Alidoust Aghdam infoalidoostir
Received 1 September 2013 Accepted 27 October 2013
Academic Editors K Ariyur and J Wu
Copyright copy 2013 F Alidoust Aghdam and S Saeidi HaghiThis is an open access article distributed under the Creative CommonsAttribution License which permits unrestricted use distribution and reproduction in any medium provided the original work isproperly cited
This paper presents an FPGA-based microstepping driver which drives a linear motion system with a smooth and precise wayProposed driver built on a Spartan3 FPGA (XC3S400 core) development board from Xilinx Implementation of driver realizedby an FPGA and using Verilog hardware description language in the Xilinx ISE environment The driverrsquos control behavior can beadapted just by altering Verilog scripts In addition a linearmotion system developed (with 4mmmovement permotor revolution)and coupled it to the stepper motor The performance of the driver is tested by measuring the distance traveled on linear motionsystemThe experimental results verified using hardware-in-loopMatlab andXilinx cosimulationmethodThis driver accomplishesa firm and accurate control and is responsive
1 Introduction
Stepper motors are increasingly used in motion controlbecause of their low price and the ability to position well aconnected electromechanical system Mainly stepper motorsare employed in an open-loop control system where a lotof shortcomings appear for example block or leakage ofposition by overload torque reduction by driving in oper-ating range great power dissipation and lack of robustnessby dynamic loads At the moment to solve these problemsclosed-loop systems are used there are sensorless closed-loop controlling systems which were developed to decreasethe costs of stepper motor controlling systems Here wehave only the measurement of the phase currents and noencoder which is the most expensive device in such a controlsystemThe control algorithm can build on different kinds ofmicroprocessors When the closed-loop driver is employedwith a DSP via C language the coding and debugging arestraightforward For such uses it is possible to use FPGAswhere we can unite software and hardware solutions toget better performances because of the parallel computing
architecture of the FPGA [1ndash3] By means of this techniquethe programming and debugging are more challengingBecause of this the performance of the FPGA-based driveris still limited However an FPGA-based driver with Verilogor VHDL code is easier in ASIC manufacturing By usingFPGA it is likely to get a faster and more accurate controlthan it is possible with a microcontroller Our aim is toimprove a microstepping driver for stepper motors whichis able to do microsteps in a stepper motor so that effectslike signs of age or the heat which influence the steppereffectiveness have not any or very low influence on the driverOne more benefit of developing such systems in FPGA willbe the power consumption With low power FPGA devicesit is conceivable to have less power dissipation than in amicrocontroller [4ndash8]
2 Microstepping Driver Structure
21 Theory of Operation The stepper motor rotation hasseveral direct relationships to the applied input pulses The
2 Chinese Journal of Engineering
Table 1 Duty cycle values for microstepping
Step number 119863
1 2512 2383 2174 1885 1546 1147 708 249 2410 7011 11412 15413 18814 21715 23816 251
sequence of the applied pulses is directly related to thedirection of motor shaft rotation The simplest method todrive a stepper motor is controlling it by switching onoffthe current through control windings Typically the controlwindings are excited through driver transistors [9 10]
Rotating a stepper motor at its rated step size mainlyin high speed condition due to natural resonant frequenciesof the motor results in less smooth movement or in somecases leads to halt movement Microstepping is a procedureused to smooth the motorrsquos movement between full stepssolve resonant problems in high speed uses and increase thestep resolution of the motor Microstepping also develops theefficiency of the system since the current in the windingsof the motor is handled in a controlled routine rather thanbeing turned on and off sharply [9 10] Twomain advantagesof this outline have been well reported in the literature suchas reduction of resonance behavior [9 11ndash13] and smoothdrive with very low ripple torque [11ndash14] A microsteppingprocedure known as high torque microstepping consecu-tively alternates the current in the two windings of a steppermotor
Figure 1 shows a graph of the current in the windings asopposed to angular position using this method [10] A briefdescription of what is happening is that one winding is drivenwhile the current in the other winding is dropped to zero bitby bit reversed and then ramped up again This sequencethen recurs for the other winding Note that the transitionbetween a winding being energized in one direction andthen energized in the other direction has a sinusoidal shape(Figure 1)This figure offers the smoothest transition betweenthe motorrsquos rated step increments (ie 75 degrees) Thisshape is reached using a digital controller through the useof PWM Modulating the input to the drive circuitry for aspecific winding will result in a current that is related tothe duty cycle of the modulated waveform For instance ifa 5V stepper motor is rated at 1 amp then modulating a 5V
+3S +6S +9S
1st winding2nd winding
Angular position (S = rated step size)
Figure 1 The current in the windings versus angular position
supply across the winding at 50will result in a current of 05ampere (supposing low inductance for windings) [5ndash10] Thefollowing equation shows this relationship
119868 ≃ 119863 times 119868max (1)
where 119868max is the rated current of the motor and 119863 is theduty cycle of the PWM signal With the aim of achievingthe sinusoidal transition from a positive to negative chargein a winding several microsteps are needed The amountof microsteps typically ranges from 4 to 32 or more (powerof 2) microsteps per rated step size Rather than real-timecomputing of the duty cycle for each individual microstepa duty cycle look-up table is realized in softwareThe numberof table values is equal to the number of steps anticipated fora particular microstepping sequence Equation (2) is used toattain the duty cycle values for the top half of the table Thenext half of the table is basically the top half in a contrarydirection [5ndash10] We have
119863(step number) =cos (step number times 120587)(total steps + 1)
times (2totalsteps minus 1)
(2)
Using (2) duty cycle values were calculated for 16microsteps per full step sequence using an 8-bit PWMsignal in Table 1 Figure 2 shows the block diagram of amicrostepping driver The driver contains a pulse counterand sine wave LUT in the software section and powerconverter in hardware To rotate the stepper motor thecurrents in the phases of the motor are controlled to tracksine and cosine waves To do this the pulse commands arecounted up to get the ordered position and the orderedposition is used as an index of sine wave LUT The outputof the sine wave LUT is the reference input to the powerconverter and the currents in the phases of the motor arecontrolled to track the input reference In other sections ofthe paper the design of these blocks will be explained indetail
There are H-bridge circuit antialiasing filter analog todigital converter (ADC) PI-controller and PWM generatorunits in the proposed driver The H-bridge circuit is usedfor transferring the current in phases of the motor in asmooth way The ADC and antialiasing filter are used to getthe sampled current value for the PI current controller The
Chinese Journal of Engineering 3
Pulse commandto do CW or CCW
movement∙ Direction must be set
before pulse applied
Pulse counter∙ Count to determine
stepper position
Index LUT∙ Control steppercurrents due toreference current bya power converter
Stepper motor∙ Determine sine wave value depending on look-up table
Monitor steppercurrent
Sampling steppercurrents
Figure 2 Block diagram of microstepping method
S1
S2
S3
RMLM
S4
VS1to ADC
RS1
VS2to ADC
RS2
minusVsupply
+Vsupply
Figure 3 H-bridge circuit connected to stepper motor
PI controller will adjust the duty cycle of switching pulseaccording to the current error
22 Bridge Circuit and Current Feedback Themotor currentsare controlled by using pulse width modulation procedure(PWM) A dual H-bridge circuit is used to drive a two-phase stepper motor Such an H-bridge structure is shownin Figure 3 Each phase winding is coupled to each H-bridge circuit hence four switching devices are individuallycontrolled to make suitable voltage for each phase windingThe leading benefit of this circuit topology is the independentgeneration of bipolar voltage between two phases The H-bridge circuit (Figure 3) consists of four MOSFETs and twolow resistance sensing resistors for each phase of the steppermotor [12 14] The four mentioned MOSFETs are controlledvia a MOSFET driver IC (HIP4081A) With this H-bridgecircuit the currents flow through the phases of the motor aswell as the sensing resistors RS1 andRS2The voltagesVS1 andVS2 on the sensing resistors provide current information by
minusD D
minusT2 T2
minusVd minusVd
t
t
Vo(t)
Vd
Figure 4 Duty cycle and voltage on a phase of stepper motor
the relation VS = RS lowast 119868 This voltage is filtered and sampledby an ADC to produce a digital value This digital valuerepresents the value of the feedback current [11 14ndash17]
23 PI Controller A PI controller is used to control the dutycycle of the pulses that trigger switching devices [11 14]The input of the PI controller is the current error betweenthe reference current and feedback current (VS1 and VS2)and the output is the duty cycle of the switching pulses Todesign such a PI controller the first model of the PWMconverter is needed The H-bridge circuit (Figure 3) containsfour MOSFETs DC power and the phase of the motor (LMas inductance and RM as resistance) The four MOSFETsare preserved as two pairs of switches (S1 S4 and S2 S3)The MOSFET gate drive IC (HIP4081A) will set one ofthese two sets of the switches to the ON state The periodand duty cycle of the switching pulse are 119879 and 119863 corre-spondingly Figure 4 shows the duty cycle (119863) and voltagesupplied to one phase of the stepper motor Adjusting the
4 Chinese Journal of Engineering
Current errorRef
current
Feedbackcurrent
769D
(434e minus 9)s2 + (865e minus 4)s + 1PI controller
Figure 5 Simplified block of a power converter
value of 119863 allows the average DC voltage output to be variedThe phase voltage can be described as follows
119881119900(119905) =
minus119881119889larr997888minus119879
2lt 119905 lt minus119863
119881119889larr997888 minus119863 lt 119905 lt 119863
minus119881119889larr997888 119863 lt 119905 lt
119879
2
(3)
The relation between VO and the phase current IO isderived using the model of the RL circuit [11 14]
The phase of the motor is considered as a low pass filter[5]The duty cycle (119863) is the output of the controller In factthe output of the controller is a digital value that is comparedwith the value of an up-down counter for the purpose ofdetermining the switchingmoment of theMOSFETpairsWehave
119868feedback =769119863
(434119890 minus 9) 1199042 + (865119890 minus 4) 119904 + 1
(4)
With the transfer function as in (4) a PI controller is usedfor the current controlling loop Figure 5 By using sisotool andthe Ziegler-Nichols method in Matlab software coefficientsfor the PI controller are selected as the optimal values [11 14]The optimal coefficients of the PI controller are given by thefollowing
119870119901= 3541198906
119870119868= 91119890 minus 6
119866PI =3541198906 (1 + (91119890 minus 6) 119904)
119904
(5)
Bode plot of the closed loop power converter is exposedin Figure 6 The PI controller will regulate the duty cycleof the switching pulses with regard to the error in steppermotor phase current The PWM generator takes this dutycycle and creates the equivalent switching pulses to send totheHIP4082 ICwith the aimof controlling theMOSFETpairswitches Through this control outline the output current isorganized in such a way as to yield the desired current instepper motor phases [11ndash14]
However the proposed PI controller is in the analogdomain since we use FPGA which is a discrete devicethen we have to use a digitized version of the PI controllerFortunately Matlab software has a toolbox called fixed-point converter which could help us in converting analogtransfer functions to a discrete fixed-point one that could beimplemented in the FPGA
0
minus90
minus18010
310
410
510
610
7
Frequency (rads)
Bode for closed loop structure20100
minus10minus20minus30minus40
Figure 6 Bode plot of closed loop current controller
Positioncounter
Sine wavePulseseries
Index of LUT
Referencecurrentlook-up table
Figure 7 Position estimation and reference current sine waveoutput
24 Pulse Counter Unit and Sine Wave LUT The digitizedsinusoidal voltage is made via the zero order hold (ZOH)module The preceding section debates the power unit Torevolve the stepper motor the currents in the phases of thestepper motor need to be controlled to track sine and cosinesignals The preferred position is sent to the driver by a seriesof pulse commandsThe frequency of these command pulsesdepends on the desired speed The driver uses a counter forcounting the input pulses and the value of the counter is theindex of the sine and cosine LUT to produce the referencecurrent of the power converter (Figure 7) [11ndash14]
3 Hardware Structure
This section shows the implementation of the driver pre-sented in the prior sections in the FPGA-based steppermotordriverThe experimental results prove the performance of theproposed driver
31 Hardware Configuration The overall driver circuitshown in Figure 8 is realized using a Xilinx Spartan3(XC3S400 Core) FPGA development board operating at50 [Mhz] system clock A shot of the overall hardware setup
Chinese Journal of Engineering 5
Xilinx Spartan3(XC3S400 core)
FPGA developmentboard
driversHIP4081A
Dual H-bridgecircuit
Winding A
Winding B
Rotor
PWM11
PWM12
PWM13
PWM14
Feedback current AFeedback current B
Switch pair 1
Switch pair 2
Switch pair 3Switch pair 4
Enable AEnable B
DualMOSFET
Figure 8 Block diagram of circuit for microstepping
Figure 9 Developed linear motion system in CAD environment
is shown in Figure 10 In this system the switching frequencywas set at 40 [Khz] Furthermore this is the frequency ofoverall algorithms which are implemented Besides mea-sured currents are sampled at this frequency using the AD57812-bit ADC outside of the development board Due to thestructure of H-bridge circuit the FPGA software is designedto generate 1 [us] of the dead time for upper and lowerswitching device pairs to avoid short circuit in switchingprocess Our two-phase stepper motor is rated at 2A and18∘ step angle Xilinx-ISE software is used as an FPGAdevelopment and debugging tool
We had designed and fabricated a linear motion systemthat attached to the stepper motor The structure of thelinear motion system in CAD environment and its realimplementation are shown in Figures 9 and 10 respectivelyThis motion system will travel 4mm in forwardbackwarddirection in each stepper motor clockwisecounterclockwisefull revolution
Figure 10 illustrates the configuration of the experimen-tal system The proposed FPGA-based driver includes astepper motor and an attached load to its rotor whichis a linear motion system (4 [mm] travel per motor fullrevolution) The control processes are implemented on anFPGA chip (XC3S400-PQ208) of Xilinx and there are otherdevices such as ADC (AD578) for sampling the analoginput current feedback signals The sampling frequency ofthe driver current controller is 40 [KHz] also the PWMswitching frequency is 40 [KHz] the supply voltage is 24 [V]each phase inductance is 43 [mH] and the phase resistanceis 5 [Ω] Table 2 shows a summary of the utilized resourcesof the FPGA and Table 3 is a summary of the timing ofthe FPGA implementation The input clock frequency of theFPGA board is 50 [MHz] In this section the performance
Table 2 FPGA device utilization summary
Resources ValueSelected device XC3S400-4 PQ208Number of slices 1265 out of 3584 [35]Number of Slice flip flops 632 out of 7168 [8]Number of 4 input LUTs 2038 out of 7168 [28]Numbers used as logic 127Numbers used as shiftregisters 127
Number of IOs 264Number of bonded IOBs 52 out of 264 [20]Number of MULT18X18s 6 out of 16 [38]
Table 3 FPGA timing report
Expression ValueMinimum period 20 ns (50MHz)Minimum input arrival time before clock 11374 nsMaximum output required time after clock 7542 nsMaximum combinational path delay 6373 ns
of the driver is verified In order to verify the flowingcurrents in stepper motor we performed a hardware-in-loopverification using Matlab-Simulink and Xilinx-Chipscopesoftwares Such a configuration is illustrated in Figure 11First an experimentwas performed to check the performanceof the current control loop Second the motor is controlledto perform a smooth motion Figure 12 shows the referencecurrent and feedback current in one phase of the motor Thereference current is a sinewave and the output current followsa reference sine wave A small ripple (about 40 [mA]) is seenin the output current due to current switching components(Figure 13) The maximum current is set to 2 [A] The phaseshift between the two currents is caused by delays in the drivercontrol loop This result shows that the current output canfollow the desired current This is because the position ofthe motor depends on the value of the current when theoutput current is smooth the precise position control canbe achieved In this FPGA-based experimental system themotor driver can perform position control with maximum 2pulse errors in 16 microsteps mode which results in 25 [120583m]error in developed linear motion system
6 Chinese Journal of Engineering
XilinxSpartan3
FPGA board
Xilinx USBprogrammer
Power supply unit
30V5AStepper motor
and linear motion system
H-bridge circuitand ADC
Figure 10 Overall real hardware setup
Stepper motor
Power converterand ADC module
JTAGconnections
XilinxJTAG
FPGA development board
PC which does Matlab-Xilinxhardware-in-loop cosimulation
Figure 11 Hardware-in-loop cosimulation
4 Results
With respect to the achieved results the efficiency of thedriver is confirmed First an experiment was performed tocheck the efficiency of the driver control loop Second themotor is controlled to follow a smooth motion Figure 12shows the reference current and feedback current in a phaseof the stepper motor The reference current is a sine waveand the output current follows this sine wave The maximumcurrent is 2 [A] The phase shift between the two currents iscaused by the delays existing in the driver control loop andthemechanicalmovementsThis result shows that the currentoutput can follow the desired current This is because the
Reference currentFeedback current
(Am
pere
)
(ms)
3
2
1
0
minus1
minus2
minus30 50 100 150 200 250 300 350 400 450 500 550
Figure 12 Reference current and feedback current in 500 [ms]
position of the motor depends on the value of the currentwhen the output current is smooth the precise positioncontrol can be achieved Figure 13 shows the currents in the2 phases of the motor when the motor is controlled at aconstant speed Thus the currents in the 2 phases follow asine wave and shift in phase by an electric angle of 90∘ (thisis a cosine wave) Tables 2 and 3 represent the results of theimplementation of the microstepping driver on the FPGAdevice In this FPGA-based experimental system the drivercan perform position control with 25 [120583m] travel error or 2
Chinese Journal of Engineering 7
Winding A currentWinding B current
(Am
pere
)
(ms)0 50 100 150 200 250 300 350 400 450 500 550
2
15
1
05
0
minus05
minus1
minus15
minus2
Figure 13 Sampled currents in 2 phases of stepper motor in500 [ms]
Figure 14 Combination ofmultiple linear systems tomakemultipleaxis structures
pulse error when steppermotor drive linearmotion system ina 20 [cm] distant With this precision it is possible to makesmall scale and low cost low complexitymultiaxis structuresSuch a construction is presented in Figure 14
5 Conclusion
Stepper motors are used in an extensive range of positioncontrolling devices such as robots printers plotters andCNCs Nowadays most of the stepper motor controllingsystems do not work as accurately as they have potential toMicrostepping is a drive procedure for the stepper motorsthat allows the smooth movement of the rotor in a fractionof the motorrsquos full step angle In high precision applicationsthe microstepping driver is essential for accurate motor spinIn this paper a digital implementation of a microsteppingdrive system with current control using a Xilinx Spartan3(XC3S400) FPGA development board was presented Thedual H-bridge converter is planned to drive the two-phasestepper motor The model of the current controller and gainsof the PI controller for optimal control are calculated usingMatlab software In our design the FPGA is used to constructa high performance microstepping driver without using any
microcontroller DSP or driver chip additionally because allthe algorithms are written in Verilog hardware descriptionlanguage it is compatible with migrating proposed schemeto an ASIC and bulk fabrication methodsThe fractional stepcan be configured and the rotor movement can be controlledup to 1-16-step resolution giving an overall resolution ofdeveloped linear motion system Experimental results testedusing hardware-in-loop Matlab and Xilinx cosimulationmethod Finally the experimental results validate the perfor-mance of the driver
References
[1] Z Xiaodong H Junjun and S Chunlei ldquoAn approach ofmicro-stepping control for the step motors based on FPGArdquo inProceedings of the IEEE International Conference on IndustrialTechnology (ICIT rsquo05) pp 125ndash130 December 2005
[2] T Takahashi and J Goetz ldquoImplementation of complete ACservo control in a low cost FPGA and subsequent ASSPconversionrdquo in Proceedings of the 19th Annual IEEE AppliedPower Electronics Conference and Exposition (APEC rsquo04) pp565ndash570 February 2004
[3] S Xiaoyin and S Dong ldquoDevelopment of an FPGA-basedmotion control ASIC for robotic manipulatorsrdquo in Proceedingsof the 6thWorld Congress on Intelligent Control and Automation(WCICA rsquo06) pp 8221ndash8225 June 2006
[4] H K Bae and R Krishnan ldquoA study of current controllers anddevelopment of a novel current controller for high performanceSRM drivesrdquo in Proceedings of the 31st IEEE Industry Applica-tions Society AnnualMeeting (IAS rsquo96) pp 68ndash75 October 1996
[5] A I Maswood ldquoPWM voltage source inverter with PI con-troller for instantaneous motor current controlrdquo in Proceedingsof the 1995 International Conference on Power Electronics andDrive Systems pp 834ndash837 February 1995
[6] P Enjeti J F Lindsay P D Ziogas and M H Rashid ldquoNewcurrent control scheme for PWM invertersrdquo IEE Proceedings Bvol 135 no 4 pp 172ndash179 1988
[7] S Halasz G Csonka A A M Hassan and B T Huu ldquoAnalysisof the unipolar PWM techniquesrdquo in Proceedings of the 1996 8thMediterranean Electrotechnical Conference (MELECON rsquo06) pp353ndash356 May 1996
[8] S Halasz ldquoAnalysis of pulsewidth modulation techniques forinductionmotor drivesrdquo inProceedings of the IEEE InternationalSymposium on Industrial Electronics (ISIE rsquo93) pp 200ndash204Budapest Hungary 1993
[9] T Kenjo and A Sugawara Stepping Motors andTheir Micropro-cessor Controls Clarendon Press Oxford UK 1984
[10] R Condit StepperMotor Control Using the PIC16F684 Technol-ogy Inc 2004
[11] Q L Ngoc and W J Jae ldquoAn open-loop stepper motor driverbased on FPGArdquo in Proceedings of the International Conferenceon Control Automation and Systems (ICCAS rsquo07) pp 1322ndash1326October 2007
[12] S-M Yang and E-L Kuo ldquoDamping a hybrid stepping motorwith estimated position and velocityrdquo IEEE Transactions onPower Electronics vol 18 no 3 pp 880ndash887 2003
[13] Z Qiu S Shi X Li L Zhang and W Wu ldquoImplementation ofmotion control technique for stepper motor translation stagesin online detection systemrdquo in Proceedings of the 2011 Interna-tional Conference on Mechatronic Science Electric Engineeringand Computer (MEC rsquo11) pp 71ndash75 August 2011
8 Chinese Journal of Engineering
[14] N Dahm M Huebner and J Becker ldquoApproach of anFPGA based adaptive stepper motor control systemrdquo in Pro-ceedings of the 6th International Workshop on ReconfigurableCommunication-Centric Systems-on-Chip (ReCoSoC rsquo11) pp 1ndash6 June 2011
[15] Z Ali and R V Kshirsagar ldquoDevelopment of a CPLD basednovel open loop stepper motor controller for high performanceusing VHDLrdquo in Proceedings of the 14th International Confer-ence on Intelligent Engineering Systems (INES rsquo10) pp 307ndash312May 2010
[16] D Rossi and A Cuomo ldquoAnalog multiplex for sensing themagnitude and sense of the current through a h-bridge stageutilizing a single sensing resistancerdquo Google Patents 1989
[17] J D Wale and C Pollock ldquoA low-cost sensorless techniquefor load torque estimation in a hybrid stepping motorrdquo IEEETransactions on Industrial Electronics vol 46 no 4 pp 833ndash841 1999
International Journal of
AerospaceEngineeringHindawi Publishing Corporationhttpwwwhindawicom Volume 2014
RoboticsJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Active and Passive Electronic Components
Control Scienceand Engineering
Journal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
International Journal of
RotatingMachinery
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Hindawi Publishing Corporation httpwwwhindawicom
Journal ofEngineeringVolume 2014
Submit your manuscripts athttpwwwhindawicom
VLSI Design
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Shock and Vibration
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Civil EngineeringAdvances in
Acoustics and VibrationAdvances in
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Electrical and Computer Engineering
Journal of
Advances inOptoElectronics
Hindawi Publishing Corporation httpwwwhindawicom
Volume 2014
The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014
SensorsJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Modelling amp Simulation in EngineeringHindawi Publishing Corporation httpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Chemical EngineeringInternational Journal of Antennas and
Propagation
International Journal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Navigation and Observation
International Journal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
DistributedSensor Networks
International Journal of
2 Chinese Journal of Engineering
Table 1 Duty cycle values for microstepping
Step number 119863
1 2512 2383 2174 1885 1546 1147 708 249 2410 7011 11412 15413 18814 21715 23816 251
sequence of the applied pulses is directly related to thedirection of motor shaft rotation The simplest method todrive a stepper motor is controlling it by switching onoffthe current through control windings Typically the controlwindings are excited through driver transistors [9 10]
Rotating a stepper motor at its rated step size mainlyin high speed condition due to natural resonant frequenciesof the motor results in less smooth movement or in somecases leads to halt movement Microstepping is a procedureused to smooth the motorrsquos movement between full stepssolve resonant problems in high speed uses and increase thestep resolution of the motor Microstepping also develops theefficiency of the system since the current in the windingsof the motor is handled in a controlled routine rather thanbeing turned on and off sharply [9 10] Twomain advantagesof this outline have been well reported in the literature suchas reduction of resonance behavior [9 11ndash13] and smoothdrive with very low ripple torque [11ndash14] A microsteppingprocedure known as high torque microstepping consecu-tively alternates the current in the two windings of a steppermotor
Figure 1 shows a graph of the current in the windings asopposed to angular position using this method [10] A briefdescription of what is happening is that one winding is drivenwhile the current in the other winding is dropped to zero bitby bit reversed and then ramped up again This sequencethen recurs for the other winding Note that the transitionbetween a winding being energized in one direction andthen energized in the other direction has a sinusoidal shape(Figure 1)This figure offers the smoothest transition betweenthe motorrsquos rated step increments (ie 75 degrees) Thisshape is reached using a digital controller through the useof PWM Modulating the input to the drive circuitry for aspecific winding will result in a current that is related tothe duty cycle of the modulated waveform For instance ifa 5V stepper motor is rated at 1 amp then modulating a 5V
+3S +6S +9S
1st winding2nd winding
Angular position (S = rated step size)
Figure 1 The current in the windings versus angular position
supply across the winding at 50will result in a current of 05ampere (supposing low inductance for windings) [5ndash10] Thefollowing equation shows this relationship
119868 ≃ 119863 times 119868max (1)
where 119868max is the rated current of the motor and 119863 is theduty cycle of the PWM signal With the aim of achievingthe sinusoidal transition from a positive to negative chargein a winding several microsteps are needed The amountof microsteps typically ranges from 4 to 32 or more (powerof 2) microsteps per rated step size Rather than real-timecomputing of the duty cycle for each individual microstepa duty cycle look-up table is realized in softwareThe numberof table values is equal to the number of steps anticipated fora particular microstepping sequence Equation (2) is used toattain the duty cycle values for the top half of the table Thenext half of the table is basically the top half in a contrarydirection [5ndash10] We have
119863(step number) =cos (step number times 120587)(total steps + 1)
times (2totalsteps minus 1)
(2)
Using (2) duty cycle values were calculated for 16microsteps per full step sequence using an 8-bit PWMsignal in Table 1 Figure 2 shows the block diagram of amicrostepping driver The driver contains a pulse counterand sine wave LUT in the software section and powerconverter in hardware To rotate the stepper motor thecurrents in the phases of the motor are controlled to tracksine and cosine waves To do this the pulse commands arecounted up to get the ordered position and the orderedposition is used as an index of sine wave LUT The outputof the sine wave LUT is the reference input to the powerconverter and the currents in the phases of the motor arecontrolled to track the input reference In other sections ofthe paper the design of these blocks will be explained indetail
There are H-bridge circuit antialiasing filter analog todigital converter (ADC) PI-controller and PWM generatorunits in the proposed driver The H-bridge circuit is usedfor transferring the current in phases of the motor in asmooth way The ADC and antialiasing filter are used to getthe sampled current value for the PI current controller The
Chinese Journal of Engineering 3
Pulse commandto do CW or CCW
movement∙ Direction must be set
before pulse applied
Pulse counter∙ Count to determine
stepper position
Index LUT∙ Control steppercurrents due toreference current bya power converter
Stepper motor∙ Determine sine wave value depending on look-up table
Monitor steppercurrent
Sampling steppercurrents
Figure 2 Block diagram of microstepping method
S1
S2
S3
RMLM
S4
VS1to ADC
RS1
VS2to ADC
RS2
minusVsupply
+Vsupply
Figure 3 H-bridge circuit connected to stepper motor
PI controller will adjust the duty cycle of switching pulseaccording to the current error
22 Bridge Circuit and Current Feedback Themotor currentsare controlled by using pulse width modulation procedure(PWM) A dual H-bridge circuit is used to drive a two-phase stepper motor Such an H-bridge structure is shownin Figure 3 Each phase winding is coupled to each H-bridge circuit hence four switching devices are individuallycontrolled to make suitable voltage for each phase windingThe leading benefit of this circuit topology is the independentgeneration of bipolar voltage between two phases The H-bridge circuit (Figure 3) consists of four MOSFETs and twolow resistance sensing resistors for each phase of the steppermotor [12 14] The four mentioned MOSFETs are controlledvia a MOSFET driver IC (HIP4081A) With this H-bridgecircuit the currents flow through the phases of the motor aswell as the sensing resistors RS1 andRS2The voltagesVS1 andVS2 on the sensing resistors provide current information by
minusD D
minusT2 T2
minusVd minusVd
t
t
Vo(t)
Vd
Figure 4 Duty cycle and voltage on a phase of stepper motor
the relation VS = RS lowast 119868 This voltage is filtered and sampledby an ADC to produce a digital value This digital valuerepresents the value of the feedback current [11 14ndash17]
23 PI Controller A PI controller is used to control the dutycycle of the pulses that trigger switching devices [11 14]The input of the PI controller is the current error betweenthe reference current and feedback current (VS1 and VS2)and the output is the duty cycle of the switching pulses Todesign such a PI controller the first model of the PWMconverter is needed The H-bridge circuit (Figure 3) containsfour MOSFETs DC power and the phase of the motor (LMas inductance and RM as resistance) The four MOSFETsare preserved as two pairs of switches (S1 S4 and S2 S3)The MOSFET gate drive IC (HIP4081A) will set one ofthese two sets of the switches to the ON state The periodand duty cycle of the switching pulse are 119879 and 119863 corre-spondingly Figure 4 shows the duty cycle (119863) and voltagesupplied to one phase of the stepper motor Adjusting the
4 Chinese Journal of Engineering
Current errorRef
current
Feedbackcurrent
769D
(434e minus 9)s2 + (865e minus 4)s + 1PI controller
Figure 5 Simplified block of a power converter
value of 119863 allows the average DC voltage output to be variedThe phase voltage can be described as follows
119881119900(119905) =
minus119881119889larr997888minus119879
2lt 119905 lt minus119863
119881119889larr997888 minus119863 lt 119905 lt 119863
minus119881119889larr997888 119863 lt 119905 lt
119879
2
(3)
The relation between VO and the phase current IO isderived using the model of the RL circuit [11 14]
The phase of the motor is considered as a low pass filter[5]The duty cycle (119863) is the output of the controller In factthe output of the controller is a digital value that is comparedwith the value of an up-down counter for the purpose ofdetermining the switchingmoment of theMOSFETpairsWehave
119868feedback =769119863
(434119890 minus 9) 1199042 + (865119890 minus 4) 119904 + 1
(4)
With the transfer function as in (4) a PI controller is usedfor the current controlling loop Figure 5 By using sisotool andthe Ziegler-Nichols method in Matlab software coefficientsfor the PI controller are selected as the optimal values [11 14]The optimal coefficients of the PI controller are given by thefollowing
119870119901= 3541198906
119870119868= 91119890 minus 6
119866PI =3541198906 (1 + (91119890 minus 6) 119904)
119904
(5)
Bode plot of the closed loop power converter is exposedin Figure 6 The PI controller will regulate the duty cycleof the switching pulses with regard to the error in steppermotor phase current The PWM generator takes this dutycycle and creates the equivalent switching pulses to send totheHIP4082 ICwith the aimof controlling theMOSFETpairswitches Through this control outline the output current isorganized in such a way as to yield the desired current instepper motor phases [11ndash14]
However the proposed PI controller is in the analogdomain since we use FPGA which is a discrete devicethen we have to use a digitized version of the PI controllerFortunately Matlab software has a toolbox called fixed-point converter which could help us in converting analogtransfer functions to a discrete fixed-point one that could beimplemented in the FPGA
0
minus90
minus18010
310
410
510
610
7
Frequency (rads)
Bode for closed loop structure20100
minus10minus20minus30minus40
Figure 6 Bode plot of closed loop current controller
Positioncounter
Sine wavePulseseries
Index of LUT
Referencecurrentlook-up table
Figure 7 Position estimation and reference current sine waveoutput
24 Pulse Counter Unit and Sine Wave LUT The digitizedsinusoidal voltage is made via the zero order hold (ZOH)module The preceding section debates the power unit Torevolve the stepper motor the currents in the phases of thestepper motor need to be controlled to track sine and cosinesignals The preferred position is sent to the driver by a seriesof pulse commandsThe frequency of these command pulsesdepends on the desired speed The driver uses a counter forcounting the input pulses and the value of the counter is theindex of the sine and cosine LUT to produce the referencecurrent of the power converter (Figure 7) [11ndash14]
3 Hardware Structure
This section shows the implementation of the driver pre-sented in the prior sections in the FPGA-based steppermotordriverThe experimental results prove the performance of theproposed driver
31 Hardware Configuration The overall driver circuitshown in Figure 8 is realized using a Xilinx Spartan3(XC3S400 Core) FPGA development board operating at50 [Mhz] system clock A shot of the overall hardware setup
Chinese Journal of Engineering 5
Xilinx Spartan3(XC3S400 core)
FPGA developmentboard
driversHIP4081A
Dual H-bridgecircuit
Winding A
Winding B
Rotor
PWM11
PWM12
PWM13
PWM14
Feedback current AFeedback current B
Switch pair 1
Switch pair 2
Switch pair 3Switch pair 4
Enable AEnable B
DualMOSFET
Figure 8 Block diagram of circuit for microstepping
Figure 9 Developed linear motion system in CAD environment
is shown in Figure 10 In this system the switching frequencywas set at 40 [Khz] Furthermore this is the frequency ofoverall algorithms which are implemented Besides mea-sured currents are sampled at this frequency using the AD57812-bit ADC outside of the development board Due to thestructure of H-bridge circuit the FPGA software is designedto generate 1 [us] of the dead time for upper and lowerswitching device pairs to avoid short circuit in switchingprocess Our two-phase stepper motor is rated at 2A and18∘ step angle Xilinx-ISE software is used as an FPGAdevelopment and debugging tool
We had designed and fabricated a linear motion systemthat attached to the stepper motor The structure of thelinear motion system in CAD environment and its realimplementation are shown in Figures 9 and 10 respectivelyThis motion system will travel 4mm in forwardbackwarddirection in each stepper motor clockwisecounterclockwisefull revolution
Figure 10 illustrates the configuration of the experimen-tal system The proposed FPGA-based driver includes astepper motor and an attached load to its rotor whichis a linear motion system (4 [mm] travel per motor fullrevolution) The control processes are implemented on anFPGA chip (XC3S400-PQ208) of Xilinx and there are otherdevices such as ADC (AD578) for sampling the analoginput current feedback signals The sampling frequency ofthe driver current controller is 40 [KHz] also the PWMswitching frequency is 40 [KHz] the supply voltage is 24 [V]each phase inductance is 43 [mH] and the phase resistanceis 5 [Ω] Table 2 shows a summary of the utilized resourcesof the FPGA and Table 3 is a summary of the timing ofthe FPGA implementation The input clock frequency of theFPGA board is 50 [MHz] In this section the performance
Table 2 FPGA device utilization summary
Resources ValueSelected device XC3S400-4 PQ208Number of slices 1265 out of 3584 [35]Number of Slice flip flops 632 out of 7168 [8]Number of 4 input LUTs 2038 out of 7168 [28]Numbers used as logic 127Numbers used as shiftregisters 127
Number of IOs 264Number of bonded IOBs 52 out of 264 [20]Number of MULT18X18s 6 out of 16 [38]
Table 3 FPGA timing report
Expression ValueMinimum period 20 ns (50MHz)Minimum input arrival time before clock 11374 nsMaximum output required time after clock 7542 nsMaximum combinational path delay 6373 ns
of the driver is verified In order to verify the flowingcurrents in stepper motor we performed a hardware-in-loopverification using Matlab-Simulink and Xilinx-Chipscopesoftwares Such a configuration is illustrated in Figure 11First an experimentwas performed to check the performanceof the current control loop Second the motor is controlledto perform a smooth motion Figure 12 shows the referencecurrent and feedback current in one phase of the motor Thereference current is a sinewave and the output current followsa reference sine wave A small ripple (about 40 [mA]) is seenin the output current due to current switching components(Figure 13) The maximum current is set to 2 [A] The phaseshift between the two currents is caused by delays in the drivercontrol loop This result shows that the current output canfollow the desired current This is because the position ofthe motor depends on the value of the current when theoutput current is smooth the precise position control canbe achieved In this FPGA-based experimental system themotor driver can perform position control with maximum 2pulse errors in 16 microsteps mode which results in 25 [120583m]error in developed linear motion system
6 Chinese Journal of Engineering
XilinxSpartan3
FPGA board
Xilinx USBprogrammer
Power supply unit
30V5AStepper motor
and linear motion system
H-bridge circuitand ADC
Figure 10 Overall real hardware setup
Stepper motor
Power converterand ADC module
JTAGconnections
XilinxJTAG
FPGA development board
PC which does Matlab-Xilinxhardware-in-loop cosimulation
Figure 11 Hardware-in-loop cosimulation
4 Results
With respect to the achieved results the efficiency of thedriver is confirmed First an experiment was performed tocheck the efficiency of the driver control loop Second themotor is controlled to follow a smooth motion Figure 12shows the reference current and feedback current in a phaseof the stepper motor The reference current is a sine waveand the output current follows this sine wave The maximumcurrent is 2 [A] The phase shift between the two currents iscaused by the delays existing in the driver control loop andthemechanicalmovementsThis result shows that the currentoutput can follow the desired current This is because the
Reference currentFeedback current
(Am
pere
)
(ms)
3
2
1
0
minus1
minus2
minus30 50 100 150 200 250 300 350 400 450 500 550
Figure 12 Reference current and feedback current in 500 [ms]
position of the motor depends on the value of the currentwhen the output current is smooth the precise positioncontrol can be achieved Figure 13 shows the currents in the2 phases of the motor when the motor is controlled at aconstant speed Thus the currents in the 2 phases follow asine wave and shift in phase by an electric angle of 90∘ (thisis a cosine wave) Tables 2 and 3 represent the results of theimplementation of the microstepping driver on the FPGAdevice In this FPGA-based experimental system the drivercan perform position control with 25 [120583m] travel error or 2
Chinese Journal of Engineering 7
Winding A currentWinding B current
(Am
pere
)
(ms)0 50 100 150 200 250 300 350 400 450 500 550
2
15
1
05
0
minus05
minus1
minus15
minus2
Figure 13 Sampled currents in 2 phases of stepper motor in500 [ms]
Figure 14 Combination ofmultiple linear systems tomakemultipleaxis structures
pulse error when steppermotor drive linearmotion system ina 20 [cm] distant With this precision it is possible to makesmall scale and low cost low complexitymultiaxis structuresSuch a construction is presented in Figure 14
5 Conclusion
Stepper motors are used in an extensive range of positioncontrolling devices such as robots printers plotters andCNCs Nowadays most of the stepper motor controllingsystems do not work as accurately as they have potential toMicrostepping is a drive procedure for the stepper motorsthat allows the smooth movement of the rotor in a fractionof the motorrsquos full step angle In high precision applicationsthe microstepping driver is essential for accurate motor spinIn this paper a digital implementation of a microsteppingdrive system with current control using a Xilinx Spartan3(XC3S400) FPGA development board was presented Thedual H-bridge converter is planned to drive the two-phasestepper motor The model of the current controller and gainsof the PI controller for optimal control are calculated usingMatlab software In our design the FPGA is used to constructa high performance microstepping driver without using any
microcontroller DSP or driver chip additionally because allthe algorithms are written in Verilog hardware descriptionlanguage it is compatible with migrating proposed schemeto an ASIC and bulk fabrication methodsThe fractional stepcan be configured and the rotor movement can be controlledup to 1-16-step resolution giving an overall resolution ofdeveloped linear motion system Experimental results testedusing hardware-in-loop Matlab and Xilinx cosimulationmethod Finally the experimental results validate the perfor-mance of the driver
References
[1] Z Xiaodong H Junjun and S Chunlei ldquoAn approach ofmicro-stepping control for the step motors based on FPGArdquo inProceedings of the IEEE International Conference on IndustrialTechnology (ICIT rsquo05) pp 125ndash130 December 2005
[2] T Takahashi and J Goetz ldquoImplementation of complete ACservo control in a low cost FPGA and subsequent ASSPconversionrdquo in Proceedings of the 19th Annual IEEE AppliedPower Electronics Conference and Exposition (APEC rsquo04) pp565ndash570 February 2004
[3] S Xiaoyin and S Dong ldquoDevelopment of an FPGA-basedmotion control ASIC for robotic manipulatorsrdquo in Proceedingsof the 6thWorld Congress on Intelligent Control and Automation(WCICA rsquo06) pp 8221ndash8225 June 2006
[4] H K Bae and R Krishnan ldquoA study of current controllers anddevelopment of a novel current controller for high performanceSRM drivesrdquo in Proceedings of the 31st IEEE Industry Applica-tions Society AnnualMeeting (IAS rsquo96) pp 68ndash75 October 1996
[5] A I Maswood ldquoPWM voltage source inverter with PI con-troller for instantaneous motor current controlrdquo in Proceedingsof the 1995 International Conference on Power Electronics andDrive Systems pp 834ndash837 February 1995
[6] P Enjeti J F Lindsay P D Ziogas and M H Rashid ldquoNewcurrent control scheme for PWM invertersrdquo IEE Proceedings Bvol 135 no 4 pp 172ndash179 1988
[7] S Halasz G Csonka A A M Hassan and B T Huu ldquoAnalysisof the unipolar PWM techniquesrdquo in Proceedings of the 1996 8thMediterranean Electrotechnical Conference (MELECON rsquo06) pp353ndash356 May 1996
[8] S Halasz ldquoAnalysis of pulsewidth modulation techniques forinductionmotor drivesrdquo inProceedings of the IEEE InternationalSymposium on Industrial Electronics (ISIE rsquo93) pp 200ndash204Budapest Hungary 1993
[9] T Kenjo and A Sugawara Stepping Motors andTheir Micropro-cessor Controls Clarendon Press Oxford UK 1984
[10] R Condit StepperMotor Control Using the PIC16F684 Technol-ogy Inc 2004
[11] Q L Ngoc and W J Jae ldquoAn open-loop stepper motor driverbased on FPGArdquo in Proceedings of the International Conferenceon Control Automation and Systems (ICCAS rsquo07) pp 1322ndash1326October 2007
[12] S-M Yang and E-L Kuo ldquoDamping a hybrid stepping motorwith estimated position and velocityrdquo IEEE Transactions onPower Electronics vol 18 no 3 pp 880ndash887 2003
[13] Z Qiu S Shi X Li L Zhang and W Wu ldquoImplementation ofmotion control technique for stepper motor translation stagesin online detection systemrdquo in Proceedings of the 2011 Interna-tional Conference on Mechatronic Science Electric Engineeringand Computer (MEC rsquo11) pp 71ndash75 August 2011
8 Chinese Journal of Engineering
[14] N Dahm M Huebner and J Becker ldquoApproach of anFPGA based adaptive stepper motor control systemrdquo in Pro-ceedings of the 6th International Workshop on ReconfigurableCommunication-Centric Systems-on-Chip (ReCoSoC rsquo11) pp 1ndash6 June 2011
[15] Z Ali and R V Kshirsagar ldquoDevelopment of a CPLD basednovel open loop stepper motor controller for high performanceusing VHDLrdquo in Proceedings of the 14th International Confer-ence on Intelligent Engineering Systems (INES rsquo10) pp 307ndash312May 2010
[16] D Rossi and A Cuomo ldquoAnalog multiplex for sensing themagnitude and sense of the current through a h-bridge stageutilizing a single sensing resistancerdquo Google Patents 1989
[17] J D Wale and C Pollock ldquoA low-cost sensorless techniquefor load torque estimation in a hybrid stepping motorrdquo IEEETransactions on Industrial Electronics vol 46 no 4 pp 833ndash841 1999
International Journal of
AerospaceEngineeringHindawi Publishing Corporationhttpwwwhindawicom Volume 2014
RoboticsJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Active and Passive Electronic Components
Control Scienceand Engineering
Journal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
International Journal of
RotatingMachinery
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Hindawi Publishing Corporation httpwwwhindawicom
Journal ofEngineeringVolume 2014
Submit your manuscripts athttpwwwhindawicom
VLSI Design
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Shock and Vibration
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Civil EngineeringAdvances in
Acoustics and VibrationAdvances in
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Electrical and Computer Engineering
Journal of
Advances inOptoElectronics
Hindawi Publishing Corporation httpwwwhindawicom
Volume 2014
The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014
SensorsJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Modelling amp Simulation in EngineeringHindawi Publishing Corporation httpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Chemical EngineeringInternational Journal of Antennas and
Propagation
International Journal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Navigation and Observation
International Journal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
DistributedSensor Networks
International Journal of
Chinese Journal of Engineering 3
Pulse commandto do CW or CCW
movement∙ Direction must be set
before pulse applied
Pulse counter∙ Count to determine
stepper position
Index LUT∙ Control steppercurrents due toreference current bya power converter
Stepper motor∙ Determine sine wave value depending on look-up table
Monitor steppercurrent
Sampling steppercurrents
Figure 2 Block diagram of microstepping method
S1
S2
S3
RMLM
S4
VS1to ADC
RS1
VS2to ADC
RS2
minusVsupply
+Vsupply
Figure 3 H-bridge circuit connected to stepper motor
PI controller will adjust the duty cycle of switching pulseaccording to the current error
22 Bridge Circuit and Current Feedback Themotor currentsare controlled by using pulse width modulation procedure(PWM) A dual H-bridge circuit is used to drive a two-phase stepper motor Such an H-bridge structure is shownin Figure 3 Each phase winding is coupled to each H-bridge circuit hence four switching devices are individuallycontrolled to make suitable voltage for each phase windingThe leading benefit of this circuit topology is the independentgeneration of bipolar voltage between two phases The H-bridge circuit (Figure 3) consists of four MOSFETs and twolow resistance sensing resistors for each phase of the steppermotor [12 14] The four mentioned MOSFETs are controlledvia a MOSFET driver IC (HIP4081A) With this H-bridgecircuit the currents flow through the phases of the motor aswell as the sensing resistors RS1 andRS2The voltagesVS1 andVS2 on the sensing resistors provide current information by
minusD D
minusT2 T2
minusVd minusVd
t
t
Vo(t)
Vd
Figure 4 Duty cycle and voltage on a phase of stepper motor
the relation VS = RS lowast 119868 This voltage is filtered and sampledby an ADC to produce a digital value This digital valuerepresents the value of the feedback current [11 14ndash17]
23 PI Controller A PI controller is used to control the dutycycle of the pulses that trigger switching devices [11 14]The input of the PI controller is the current error betweenthe reference current and feedback current (VS1 and VS2)and the output is the duty cycle of the switching pulses Todesign such a PI controller the first model of the PWMconverter is needed The H-bridge circuit (Figure 3) containsfour MOSFETs DC power and the phase of the motor (LMas inductance and RM as resistance) The four MOSFETsare preserved as two pairs of switches (S1 S4 and S2 S3)The MOSFET gate drive IC (HIP4081A) will set one ofthese two sets of the switches to the ON state The periodand duty cycle of the switching pulse are 119879 and 119863 corre-spondingly Figure 4 shows the duty cycle (119863) and voltagesupplied to one phase of the stepper motor Adjusting the
4 Chinese Journal of Engineering
Current errorRef
current
Feedbackcurrent
769D
(434e minus 9)s2 + (865e minus 4)s + 1PI controller
Figure 5 Simplified block of a power converter
value of 119863 allows the average DC voltage output to be variedThe phase voltage can be described as follows
119881119900(119905) =
minus119881119889larr997888minus119879
2lt 119905 lt minus119863
119881119889larr997888 minus119863 lt 119905 lt 119863
minus119881119889larr997888 119863 lt 119905 lt
119879
2
(3)
The relation between VO and the phase current IO isderived using the model of the RL circuit [11 14]
The phase of the motor is considered as a low pass filter[5]The duty cycle (119863) is the output of the controller In factthe output of the controller is a digital value that is comparedwith the value of an up-down counter for the purpose ofdetermining the switchingmoment of theMOSFETpairsWehave
119868feedback =769119863
(434119890 minus 9) 1199042 + (865119890 minus 4) 119904 + 1
(4)
With the transfer function as in (4) a PI controller is usedfor the current controlling loop Figure 5 By using sisotool andthe Ziegler-Nichols method in Matlab software coefficientsfor the PI controller are selected as the optimal values [11 14]The optimal coefficients of the PI controller are given by thefollowing
119870119901= 3541198906
119870119868= 91119890 minus 6
119866PI =3541198906 (1 + (91119890 minus 6) 119904)
119904
(5)
Bode plot of the closed loop power converter is exposedin Figure 6 The PI controller will regulate the duty cycleof the switching pulses with regard to the error in steppermotor phase current The PWM generator takes this dutycycle and creates the equivalent switching pulses to send totheHIP4082 ICwith the aimof controlling theMOSFETpairswitches Through this control outline the output current isorganized in such a way as to yield the desired current instepper motor phases [11ndash14]
However the proposed PI controller is in the analogdomain since we use FPGA which is a discrete devicethen we have to use a digitized version of the PI controllerFortunately Matlab software has a toolbox called fixed-point converter which could help us in converting analogtransfer functions to a discrete fixed-point one that could beimplemented in the FPGA
0
minus90
minus18010
310
410
510
610
7
Frequency (rads)
Bode for closed loop structure20100
minus10minus20minus30minus40
Figure 6 Bode plot of closed loop current controller
Positioncounter
Sine wavePulseseries
Index of LUT
Referencecurrentlook-up table
Figure 7 Position estimation and reference current sine waveoutput
24 Pulse Counter Unit and Sine Wave LUT The digitizedsinusoidal voltage is made via the zero order hold (ZOH)module The preceding section debates the power unit Torevolve the stepper motor the currents in the phases of thestepper motor need to be controlled to track sine and cosinesignals The preferred position is sent to the driver by a seriesof pulse commandsThe frequency of these command pulsesdepends on the desired speed The driver uses a counter forcounting the input pulses and the value of the counter is theindex of the sine and cosine LUT to produce the referencecurrent of the power converter (Figure 7) [11ndash14]
3 Hardware Structure
This section shows the implementation of the driver pre-sented in the prior sections in the FPGA-based steppermotordriverThe experimental results prove the performance of theproposed driver
31 Hardware Configuration The overall driver circuitshown in Figure 8 is realized using a Xilinx Spartan3(XC3S400 Core) FPGA development board operating at50 [Mhz] system clock A shot of the overall hardware setup
Chinese Journal of Engineering 5
Xilinx Spartan3(XC3S400 core)
FPGA developmentboard
driversHIP4081A
Dual H-bridgecircuit
Winding A
Winding B
Rotor
PWM11
PWM12
PWM13
PWM14
Feedback current AFeedback current B
Switch pair 1
Switch pair 2
Switch pair 3Switch pair 4
Enable AEnable B
DualMOSFET
Figure 8 Block diagram of circuit for microstepping
Figure 9 Developed linear motion system in CAD environment
is shown in Figure 10 In this system the switching frequencywas set at 40 [Khz] Furthermore this is the frequency ofoverall algorithms which are implemented Besides mea-sured currents are sampled at this frequency using the AD57812-bit ADC outside of the development board Due to thestructure of H-bridge circuit the FPGA software is designedto generate 1 [us] of the dead time for upper and lowerswitching device pairs to avoid short circuit in switchingprocess Our two-phase stepper motor is rated at 2A and18∘ step angle Xilinx-ISE software is used as an FPGAdevelopment and debugging tool
We had designed and fabricated a linear motion systemthat attached to the stepper motor The structure of thelinear motion system in CAD environment and its realimplementation are shown in Figures 9 and 10 respectivelyThis motion system will travel 4mm in forwardbackwarddirection in each stepper motor clockwisecounterclockwisefull revolution
Figure 10 illustrates the configuration of the experimen-tal system The proposed FPGA-based driver includes astepper motor and an attached load to its rotor whichis a linear motion system (4 [mm] travel per motor fullrevolution) The control processes are implemented on anFPGA chip (XC3S400-PQ208) of Xilinx and there are otherdevices such as ADC (AD578) for sampling the analoginput current feedback signals The sampling frequency ofthe driver current controller is 40 [KHz] also the PWMswitching frequency is 40 [KHz] the supply voltage is 24 [V]each phase inductance is 43 [mH] and the phase resistanceis 5 [Ω] Table 2 shows a summary of the utilized resourcesof the FPGA and Table 3 is a summary of the timing ofthe FPGA implementation The input clock frequency of theFPGA board is 50 [MHz] In this section the performance
Table 2 FPGA device utilization summary
Resources ValueSelected device XC3S400-4 PQ208Number of slices 1265 out of 3584 [35]Number of Slice flip flops 632 out of 7168 [8]Number of 4 input LUTs 2038 out of 7168 [28]Numbers used as logic 127Numbers used as shiftregisters 127
Number of IOs 264Number of bonded IOBs 52 out of 264 [20]Number of MULT18X18s 6 out of 16 [38]
Table 3 FPGA timing report
Expression ValueMinimum period 20 ns (50MHz)Minimum input arrival time before clock 11374 nsMaximum output required time after clock 7542 nsMaximum combinational path delay 6373 ns
of the driver is verified In order to verify the flowingcurrents in stepper motor we performed a hardware-in-loopverification using Matlab-Simulink and Xilinx-Chipscopesoftwares Such a configuration is illustrated in Figure 11First an experimentwas performed to check the performanceof the current control loop Second the motor is controlledto perform a smooth motion Figure 12 shows the referencecurrent and feedback current in one phase of the motor Thereference current is a sinewave and the output current followsa reference sine wave A small ripple (about 40 [mA]) is seenin the output current due to current switching components(Figure 13) The maximum current is set to 2 [A] The phaseshift between the two currents is caused by delays in the drivercontrol loop This result shows that the current output canfollow the desired current This is because the position ofthe motor depends on the value of the current when theoutput current is smooth the precise position control canbe achieved In this FPGA-based experimental system themotor driver can perform position control with maximum 2pulse errors in 16 microsteps mode which results in 25 [120583m]error in developed linear motion system
6 Chinese Journal of Engineering
XilinxSpartan3
FPGA board
Xilinx USBprogrammer
Power supply unit
30V5AStepper motor
and linear motion system
H-bridge circuitand ADC
Figure 10 Overall real hardware setup
Stepper motor
Power converterand ADC module
JTAGconnections
XilinxJTAG
FPGA development board
PC which does Matlab-Xilinxhardware-in-loop cosimulation
Figure 11 Hardware-in-loop cosimulation
4 Results
With respect to the achieved results the efficiency of thedriver is confirmed First an experiment was performed tocheck the efficiency of the driver control loop Second themotor is controlled to follow a smooth motion Figure 12shows the reference current and feedback current in a phaseof the stepper motor The reference current is a sine waveand the output current follows this sine wave The maximumcurrent is 2 [A] The phase shift between the two currents iscaused by the delays existing in the driver control loop andthemechanicalmovementsThis result shows that the currentoutput can follow the desired current This is because the
Reference currentFeedback current
(Am
pere
)
(ms)
3
2
1
0
minus1
minus2
minus30 50 100 150 200 250 300 350 400 450 500 550
Figure 12 Reference current and feedback current in 500 [ms]
position of the motor depends on the value of the currentwhen the output current is smooth the precise positioncontrol can be achieved Figure 13 shows the currents in the2 phases of the motor when the motor is controlled at aconstant speed Thus the currents in the 2 phases follow asine wave and shift in phase by an electric angle of 90∘ (thisis a cosine wave) Tables 2 and 3 represent the results of theimplementation of the microstepping driver on the FPGAdevice In this FPGA-based experimental system the drivercan perform position control with 25 [120583m] travel error or 2
Chinese Journal of Engineering 7
Winding A currentWinding B current
(Am
pere
)
(ms)0 50 100 150 200 250 300 350 400 450 500 550
2
15
1
05
0
minus05
minus1
minus15
minus2
Figure 13 Sampled currents in 2 phases of stepper motor in500 [ms]
Figure 14 Combination ofmultiple linear systems tomakemultipleaxis structures
pulse error when steppermotor drive linearmotion system ina 20 [cm] distant With this precision it is possible to makesmall scale and low cost low complexitymultiaxis structuresSuch a construction is presented in Figure 14
5 Conclusion
Stepper motors are used in an extensive range of positioncontrolling devices such as robots printers plotters andCNCs Nowadays most of the stepper motor controllingsystems do not work as accurately as they have potential toMicrostepping is a drive procedure for the stepper motorsthat allows the smooth movement of the rotor in a fractionof the motorrsquos full step angle In high precision applicationsthe microstepping driver is essential for accurate motor spinIn this paper a digital implementation of a microsteppingdrive system with current control using a Xilinx Spartan3(XC3S400) FPGA development board was presented Thedual H-bridge converter is planned to drive the two-phasestepper motor The model of the current controller and gainsof the PI controller for optimal control are calculated usingMatlab software In our design the FPGA is used to constructa high performance microstepping driver without using any
microcontroller DSP or driver chip additionally because allthe algorithms are written in Verilog hardware descriptionlanguage it is compatible with migrating proposed schemeto an ASIC and bulk fabrication methodsThe fractional stepcan be configured and the rotor movement can be controlledup to 1-16-step resolution giving an overall resolution ofdeveloped linear motion system Experimental results testedusing hardware-in-loop Matlab and Xilinx cosimulationmethod Finally the experimental results validate the perfor-mance of the driver
References
[1] Z Xiaodong H Junjun and S Chunlei ldquoAn approach ofmicro-stepping control for the step motors based on FPGArdquo inProceedings of the IEEE International Conference on IndustrialTechnology (ICIT rsquo05) pp 125ndash130 December 2005
[2] T Takahashi and J Goetz ldquoImplementation of complete ACservo control in a low cost FPGA and subsequent ASSPconversionrdquo in Proceedings of the 19th Annual IEEE AppliedPower Electronics Conference and Exposition (APEC rsquo04) pp565ndash570 February 2004
[3] S Xiaoyin and S Dong ldquoDevelopment of an FPGA-basedmotion control ASIC for robotic manipulatorsrdquo in Proceedingsof the 6thWorld Congress on Intelligent Control and Automation(WCICA rsquo06) pp 8221ndash8225 June 2006
[4] H K Bae and R Krishnan ldquoA study of current controllers anddevelopment of a novel current controller for high performanceSRM drivesrdquo in Proceedings of the 31st IEEE Industry Applica-tions Society AnnualMeeting (IAS rsquo96) pp 68ndash75 October 1996
[5] A I Maswood ldquoPWM voltage source inverter with PI con-troller for instantaneous motor current controlrdquo in Proceedingsof the 1995 International Conference on Power Electronics andDrive Systems pp 834ndash837 February 1995
[6] P Enjeti J F Lindsay P D Ziogas and M H Rashid ldquoNewcurrent control scheme for PWM invertersrdquo IEE Proceedings Bvol 135 no 4 pp 172ndash179 1988
[7] S Halasz G Csonka A A M Hassan and B T Huu ldquoAnalysisof the unipolar PWM techniquesrdquo in Proceedings of the 1996 8thMediterranean Electrotechnical Conference (MELECON rsquo06) pp353ndash356 May 1996
[8] S Halasz ldquoAnalysis of pulsewidth modulation techniques forinductionmotor drivesrdquo inProceedings of the IEEE InternationalSymposium on Industrial Electronics (ISIE rsquo93) pp 200ndash204Budapest Hungary 1993
[9] T Kenjo and A Sugawara Stepping Motors andTheir Micropro-cessor Controls Clarendon Press Oxford UK 1984
[10] R Condit StepperMotor Control Using the PIC16F684 Technol-ogy Inc 2004
[11] Q L Ngoc and W J Jae ldquoAn open-loop stepper motor driverbased on FPGArdquo in Proceedings of the International Conferenceon Control Automation and Systems (ICCAS rsquo07) pp 1322ndash1326October 2007
[12] S-M Yang and E-L Kuo ldquoDamping a hybrid stepping motorwith estimated position and velocityrdquo IEEE Transactions onPower Electronics vol 18 no 3 pp 880ndash887 2003
[13] Z Qiu S Shi X Li L Zhang and W Wu ldquoImplementation ofmotion control technique for stepper motor translation stagesin online detection systemrdquo in Proceedings of the 2011 Interna-tional Conference on Mechatronic Science Electric Engineeringand Computer (MEC rsquo11) pp 71ndash75 August 2011
8 Chinese Journal of Engineering
[14] N Dahm M Huebner and J Becker ldquoApproach of anFPGA based adaptive stepper motor control systemrdquo in Pro-ceedings of the 6th International Workshop on ReconfigurableCommunication-Centric Systems-on-Chip (ReCoSoC rsquo11) pp 1ndash6 June 2011
[15] Z Ali and R V Kshirsagar ldquoDevelopment of a CPLD basednovel open loop stepper motor controller for high performanceusing VHDLrdquo in Proceedings of the 14th International Confer-ence on Intelligent Engineering Systems (INES rsquo10) pp 307ndash312May 2010
[16] D Rossi and A Cuomo ldquoAnalog multiplex for sensing themagnitude and sense of the current through a h-bridge stageutilizing a single sensing resistancerdquo Google Patents 1989
[17] J D Wale and C Pollock ldquoA low-cost sensorless techniquefor load torque estimation in a hybrid stepping motorrdquo IEEETransactions on Industrial Electronics vol 46 no 4 pp 833ndash841 1999
International Journal of
AerospaceEngineeringHindawi Publishing Corporationhttpwwwhindawicom Volume 2014
RoboticsJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Active and Passive Electronic Components
Control Scienceand Engineering
Journal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
International Journal of
RotatingMachinery
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Hindawi Publishing Corporation httpwwwhindawicom
Journal ofEngineeringVolume 2014
Submit your manuscripts athttpwwwhindawicom
VLSI Design
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Shock and Vibration
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Civil EngineeringAdvances in
Acoustics and VibrationAdvances in
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Electrical and Computer Engineering
Journal of
Advances inOptoElectronics
Hindawi Publishing Corporation httpwwwhindawicom
Volume 2014
The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014
SensorsJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Modelling amp Simulation in EngineeringHindawi Publishing Corporation httpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Chemical EngineeringInternational Journal of Antennas and
Propagation
International Journal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Navigation and Observation
International Journal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
DistributedSensor Networks
International Journal of
4 Chinese Journal of Engineering
Current errorRef
current
Feedbackcurrent
769D
(434e minus 9)s2 + (865e minus 4)s + 1PI controller
Figure 5 Simplified block of a power converter
value of 119863 allows the average DC voltage output to be variedThe phase voltage can be described as follows
119881119900(119905) =
minus119881119889larr997888minus119879
2lt 119905 lt minus119863
119881119889larr997888 minus119863 lt 119905 lt 119863
minus119881119889larr997888 119863 lt 119905 lt
119879
2
(3)
The relation between VO and the phase current IO isderived using the model of the RL circuit [11 14]
The phase of the motor is considered as a low pass filter[5]The duty cycle (119863) is the output of the controller In factthe output of the controller is a digital value that is comparedwith the value of an up-down counter for the purpose ofdetermining the switchingmoment of theMOSFETpairsWehave
119868feedback =769119863
(434119890 minus 9) 1199042 + (865119890 minus 4) 119904 + 1
(4)
With the transfer function as in (4) a PI controller is usedfor the current controlling loop Figure 5 By using sisotool andthe Ziegler-Nichols method in Matlab software coefficientsfor the PI controller are selected as the optimal values [11 14]The optimal coefficients of the PI controller are given by thefollowing
119870119901= 3541198906
119870119868= 91119890 minus 6
119866PI =3541198906 (1 + (91119890 minus 6) 119904)
119904
(5)
Bode plot of the closed loop power converter is exposedin Figure 6 The PI controller will regulate the duty cycleof the switching pulses with regard to the error in steppermotor phase current The PWM generator takes this dutycycle and creates the equivalent switching pulses to send totheHIP4082 ICwith the aimof controlling theMOSFETpairswitches Through this control outline the output current isorganized in such a way as to yield the desired current instepper motor phases [11ndash14]
However the proposed PI controller is in the analogdomain since we use FPGA which is a discrete devicethen we have to use a digitized version of the PI controllerFortunately Matlab software has a toolbox called fixed-point converter which could help us in converting analogtransfer functions to a discrete fixed-point one that could beimplemented in the FPGA
0
minus90
minus18010
310
410
510
610
7
Frequency (rads)
Bode for closed loop structure20100
minus10minus20minus30minus40
Figure 6 Bode plot of closed loop current controller
Positioncounter
Sine wavePulseseries
Index of LUT
Referencecurrentlook-up table
Figure 7 Position estimation and reference current sine waveoutput
24 Pulse Counter Unit and Sine Wave LUT The digitizedsinusoidal voltage is made via the zero order hold (ZOH)module The preceding section debates the power unit Torevolve the stepper motor the currents in the phases of thestepper motor need to be controlled to track sine and cosinesignals The preferred position is sent to the driver by a seriesof pulse commandsThe frequency of these command pulsesdepends on the desired speed The driver uses a counter forcounting the input pulses and the value of the counter is theindex of the sine and cosine LUT to produce the referencecurrent of the power converter (Figure 7) [11ndash14]
3 Hardware Structure
This section shows the implementation of the driver pre-sented in the prior sections in the FPGA-based steppermotordriverThe experimental results prove the performance of theproposed driver
31 Hardware Configuration The overall driver circuitshown in Figure 8 is realized using a Xilinx Spartan3(XC3S400 Core) FPGA development board operating at50 [Mhz] system clock A shot of the overall hardware setup
Chinese Journal of Engineering 5
Xilinx Spartan3(XC3S400 core)
FPGA developmentboard
driversHIP4081A
Dual H-bridgecircuit
Winding A
Winding B
Rotor
PWM11
PWM12
PWM13
PWM14
Feedback current AFeedback current B
Switch pair 1
Switch pair 2
Switch pair 3Switch pair 4
Enable AEnable B
DualMOSFET
Figure 8 Block diagram of circuit for microstepping
Figure 9 Developed linear motion system in CAD environment
is shown in Figure 10 In this system the switching frequencywas set at 40 [Khz] Furthermore this is the frequency ofoverall algorithms which are implemented Besides mea-sured currents are sampled at this frequency using the AD57812-bit ADC outside of the development board Due to thestructure of H-bridge circuit the FPGA software is designedto generate 1 [us] of the dead time for upper and lowerswitching device pairs to avoid short circuit in switchingprocess Our two-phase stepper motor is rated at 2A and18∘ step angle Xilinx-ISE software is used as an FPGAdevelopment and debugging tool
We had designed and fabricated a linear motion systemthat attached to the stepper motor The structure of thelinear motion system in CAD environment and its realimplementation are shown in Figures 9 and 10 respectivelyThis motion system will travel 4mm in forwardbackwarddirection in each stepper motor clockwisecounterclockwisefull revolution
Figure 10 illustrates the configuration of the experimen-tal system The proposed FPGA-based driver includes astepper motor and an attached load to its rotor whichis a linear motion system (4 [mm] travel per motor fullrevolution) The control processes are implemented on anFPGA chip (XC3S400-PQ208) of Xilinx and there are otherdevices such as ADC (AD578) for sampling the analoginput current feedback signals The sampling frequency ofthe driver current controller is 40 [KHz] also the PWMswitching frequency is 40 [KHz] the supply voltage is 24 [V]each phase inductance is 43 [mH] and the phase resistanceis 5 [Ω] Table 2 shows a summary of the utilized resourcesof the FPGA and Table 3 is a summary of the timing ofthe FPGA implementation The input clock frequency of theFPGA board is 50 [MHz] In this section the performance
Table 2 FPGA device utilization summary
Resources ValueSelected device XC3S400-4 PQ208Number of slices 1265 out of 3584 [35]Number of Slice flip flops 632 out of 7168 [8]Number of 4 input LUTs 2038 out of 7168 [28]Numbers used as logic 127Numbers used as shiftregisters 127
Number of IOs 264Number of bonded IOBs 52 out of 264 [20]Number of MULT18X18s 6 out of 16 [38]
Table 3 FPGA timing report
Expression ValueMinimum period 20 ns (50MHz)Minimum input arrival time before clock 11374 nsMaximum output required time after clock 7542 nsMaximum combinational path delay 6373 ns
of the driver is verified In order to verify the flowingcurrents in stepper motor we performed a hardware-in-loopverification using Matlab-Simulink and Xilinx-Chipscopesoftwares Such a configuration is illustrated in Figure 11First an experimentwas performed to check the performanceof the current control loop Second the motor is controlledto perform a smooth motion Figure 12 shows the referencecurrent and feedback current in one phase of the motor Thereference current is a sinewave and the output current followsa reference sine wave A small ripple (about 40 [mA]) is seenin the output current due to current switching components(Figure 13) The maximum current is set to 2 [A] The phaseshift between the two currents is caused by delays in the drivercontrol loop This result shows that the current output canfollow the desired current This is because the position ofthe motor depends on the value of the current when theoutput current is smooth the precise position control canbe achieved In this FPGA-based experimental system themotor driver can perform position control with maximum 2pulse errors in 16 microsteps mode which results in 25 [120583m]error in developed linear motion system
6 Chinese Journal of Engineering
XilinxSpartan3
FPGA board
Xilinx USBprogrammer
Power supply unit
30V5AStepper motor
and linear motion system
H-bridge circuitand ADC
Figure 10 Overall real hardware setup
Stepper motor
Power converterand ADC module
JTAGconnections
XilinxJTAG
FPGA development board
PC which does Matlab-Xilinxhardware-in-loop cosimulation
Figure 11 Hardware-in-loop cosimulation
4 Results
With respect to the achieved results the efficiency of thedriver is confirmed First an experiment was performed tocheck the efficiency of the driver control loop Second themotor is controlled to follow a smooth motion Figure 12shows the reference current and feedback current in a phaseof the stepper motor The reference current is a sine waveand the output current follows this sine wave The maximumcurrent is 2 [A] The phase shift between the two currents iscaused by the delays existing in the driver control loop andthemechanicalmovementsThis result shows that the currentoutput can follow the desired current This is because the
Reference currentFeedback current
(Am
pere
)
(ms)
3
2
1
0
minus1
minus2
minus30 50 100 150 200 250 300 350 400 450 500 550
Figure 12 Reference current and feedback current in 500 [ms]
position of the motor depends on the value of the currentwhen the output current is smooth the precise positioncontrol can be achieved Figure 13 shows the currents in the2 phases of the motor when the motor is controlled at aconstant speed Thus the currents in the 2 phases follow asine wave and shift in phase by an electric angle of 90∘ (thisis a cosine wave) Tables 2 and 3 represent the results of theimplementation of the microstepping driver on the FPGAdevice In this FPGA-based experimental system the drivercan perform position control with 25 [120583m] travel error or 2
Chinese Journal of Engineering 7
Winding A currentWinding B current
(Am
pere
)
(ms)0 50 100 150 200 250 300 350 400 450 500 550
2
15
1
05
0
minus05
minus1
minus15
minus2
Figure 13 Sampled currents in 2 phases of stepper motor in500 [ms]
Figure 14 Combination ofmultiple linear systems tomakemultipleaxis structures
pulse error when steppermotor drive linearmotion system ina 20 [cm] distant With this precision it is possible to makesmall scale and low cost low complexitymultiaxis structuresSuch a construction is presented in Figure 14
5 Conclusion
Stepper motors are used in an extensive range of positioncontrolling devices such as robots printers plotters andCNCs Nowadays most of the stepper motor controllingsystems do not work as accurately as they have potential toMicrostepping is a drive procedure for the stepper motorsthat allows the smooth movement of the rotor in a fractionof the motorrsquos full step angle In high precision applicationsthe microstepping driver is essential for accurate motor spinIn this paper a digital implementation of a microsteppingdrive system with current control using a Xilinx Spartan3(XC3S400) FPGA development board was presented Thedual H-bridge converter is planned to drive the two-phasestepper motor The model of the current controller and gainsof the PI controller for optimal control are calculated usingMatlab software In our design the FPGA is used to constructa high performance microstepping driver without using any
microcontroller DSP or driver chip additionally because allthe algorithms are written in Verilog hardware descriptionlanguage it is compatible with migrating proposed schemeto an ASIC and bulk fabrication methodsThe fractional stepcan be configured and the rotor movement can be controlledup to 1-16-step resolution giving an overall resolution ofdeveloped linear motion system Experimental results testedusing hardware-in-loop Matlab and Xilinx cosimulationmethod Finally the experimental results validate the perfor-mance of the driver
References
[1] Z Xiaodong H Junjun and S Chunlei ldquoAn approach ofmicro-stepping control for the step motors based on FPGArdquo inProceedings of the IEEE International Conference on IndustrialTechnology (ICIT rsquo05) pp 125ndash130 December 2005
[2] T Takahashi and J Goetz ldquoImplementation of complete ACservo control in a low cost FPGA and subsequent ASSPconversionrdquo in Proceedings of the 19th Annual IEEE AppliedPower Electronics Conference and Exposition (APEC rsquo04) pp565ndash570 February 2004
[3] S Xiaoyin and S Dong ldquoDevelopment of an FPGA-basedmotion control ASIC for robotic manipulatorsrdquo in Proceedingsof the 6thWorld Congress on Intelligent Control and Automation(WCICA rsquo06) pp 8221ndash8225 June 2006
[4] H K Bae and R Krishnan ldquoA study of current controllers anddevelopment of a novel current controller for high performanceSRM drivesrdquo in Proceedings of the 31st IEEE Industry Applica-tions Society AnnualMeeting (IAS rsquo96) pp 68ndash75 October 1996
[5] A I Maswood ldquoPWM voltage source inverter with PI con-troller for instantaneous motor current controlrdquo in Proceedingsof the 1995 International Conference on Power Electronics andDrive Systems pp 834ndash837 February 1995
[6] P Enjeti J F Lindsay P D Ziogas and M H Rashid ldquoNewcurrent control scheme for PWM invertersrdquo IEE Proceedings Bvol 135 no 4 pp 172ndash179 1988
[7] S Halasz G Csonka A A M Hassan and B T Huu ldquoAnalysisof the unipolar PWM techniquesrdquo in Proceedings of the 1996 8thMediterranean Electrotechnical Conference (MELECON rsquo06) pp353ndash356 May 1996
[8] S Halasz ldquoAnalysis of pulsewidth modulation techniques forinductionmotor drivesrdquo inProceedings of the IEEE InternationalSymposium on Industrial Electronics (ISIE rsquo93) pp 200ndash204Budapest Hungary 1993
[9] T Kenjo and A Sugawara Stepping Motors andTheir Micropro-cessor Controls Clarendon Press Oxford UK 1984
[10] R Condit StepperMotor Control Using the PIC16F684 Technol-ogy Inc 2004
[11] Q L Ngoc and W J Jae ldquoAn open-loop stepper motor driverbased on FPGArdquo in Proceedings of the International Conferenceon Control Automation and Systems (ICCAS rsquo07) pp 1322ndash1326October 2007
[12] S-M Yang and E-L Kuo ldquoDamping a hybrid stepping motorwith estimated position and velocityrdquo IEEE Transactions onPower Electronics vol 18 no 3 pp 880ndash887 2003
[13] Z Qiu S Shi X Li L Zhang and W Wu ldquoImplementation ofmotion control technique for stepper motor translation stagesin online detection systemrdquo in Proceedings of the 2011 Interna-tional Conference on Mechatronic Science Electric Engineeringand Computer (MEC rsquo11) pp 71ndash75 August 2011
8 Chinese Journal of Engineering
[14] N Dahm M Huebner and J Becker ldquoApproach of anFPGA based adaptive stepper motor control systemrdquo in Pro-ceedings of the 6th International Workshop on ReconfigurableCommunication-Centric Systems-on-Chip (ReCoSoC rsquo11) pp 1ndash6 June 2011
[15] Z Ali and R V Kshirsagar ldquoDevelopment of a CPLD basednovel open loop stepper motor controller for high performanceusing VHDLrdquo in Proceedings of the 14th International Confer-ence on Intelligent Engineering Systems (INES rsquo10) pp 307ndash312May 2010
[16] D Rossi and A Cuomo ldquoAnalog multiplex for sensing themagnitude and sense of the current through a h-bridge stageutilizing a single sensing resistancerdquo Google Patents 1989
[17] J D Wale and C Pollock ldquoA low-cost sensorless techniquefor load torque estimation in a hybrid stepping motorrdquo IEEETransactions on Industrial Electronics vol 46 no 4 pp 833ndash841 1999
International Journal of
AerospaceEngineeringHindawi Publishing Corporationhttpwwwhindawicom Volume 2014
RoboticsJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Active and Passive Electronic Components
Control Scienceand Engineering
Journal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
International Journal of
RotatingMachinery
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Hindawi Publishing Corporation httpwwwhindawicom
Journal ofEngineeringVolume 2014
Submit your manuscripts athttpwwwhindawicom
VLSI Design
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Shock and Vibration
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Civil EngineeringAdvances in
Acoustics and VibrationAdvances in
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Electrical and Computer Engineering
Journal of
Advances inOptoElectronics
Hindawi Publishing Corporation httpwwwhindawicom
Volume 2014
The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014
SensorsJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Modelling amp Simulation in EngineeringHindawi Publishing Corporation httpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Chemical EngineeringInternational Journal of Antennas and
Propagation
International Journal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Navigation and Observation
International Journal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
DistributedSensor Networks
International Journal of
Chinese Journal of Engineering 5
Xilinx Spartan3(XC3S400 core)
FPGA developmentboard
driversHIP4081A
Dual H-bridgecircuit
Winding A
Winding B
Rotor
PWM11
PWM12
PWM13
PWM14
Feedback current AFeedback current B
Switch pair 1
Switch pair 2
Switch pair 3Switch pair 4
Enable AEnable B
DualMOSFET
Figure 8 Block diagram of circuit for microstepping
Figure 9 Developed linear motion system in CAD environment
is shown in Figure 10 In this system the switching frequencywas set at 40 [Khz] Furthermore this is the frequency ofoverall algorithms which are implemented Besides mea-sured currents are sampled at this frequency using the AD57812-bit ADC outside of the development board Due to thestructure of H-bridge circuit the FPGA software is designedto generate 1 [us] of the dead time for upper and lowerswitching device pairs to avoid short circuit in switchingprocess Our two-phase stepper motor is rated at 2A and18∘ step angle Xilinx-ISE software is used as an FPGAdevelopment and debugging tool
We had designed and fabricated a linear motion systemthat attached to the stepper motor The structure of thelinear motion system in CAD environment and its realimplementation are shown in Figures 9 and 10 respectivelyThis motion system will travel 4mm in forwardbackwarddirection in each stepper motor clockwisecounterclockwisefull revolution
Figure 10 illustrates the configuration of the experimen-tal system The proposed FPGA-based driver includes astepper motor and an attached load to its rotor whichis a linear motion system (4 [mm] travel per motor fullrevolution) The control processes are implemented on anFPGA chip (XC3S400-PQ208) of Xilinx and there are otherdevices such as ADC (AD578) for sampling the analoginput current feedback signals The sampling frequency ofthe driver current controller is 40 [KHz] also the PWMswitching frequency is 40 [KHz] the supply voltage is 24 [V]each phase inductance is 43 [mH] and the phase resistanceis 5 [Ω] Table 2 shows a summary of the utilized resourcesof the FPGA and Table 3 is a summary of the timing ofthe FPGA implementation The input clock frequency of theFPGA board is 50 [MHz] In this section the performance
Table 2 FPGA device utilization summary
Resources ValueSelected device XC3S400-4 PQ208Number of slices 1265 out of 3584 [35]Number of Slice flip flops 632 out of 7168 [8]Number of 4 input LUTs 2038 out of 7168 [28]Numbers used as logic 127Numbers used as shiftregisters 127
Number of IOs 264Number of bonded IOBs 52 out of 264 [20]Number of MULT18X18s 6 out of 16 [38]
Table 3 FPGA timing report
Expression ValueMinimum period 20 ns (50MHz)Minimum input arrival time before clock 11374 nsMaximum output required time after clock 7542 nsMaximum combinational path delay 6373 ns
of the driver is verified In order to verify the flowingcurrents in stepper motor we performed a hardware-in-loopverification using Matlab-Simulink and Xilinx-Chipscopesoftwares Such a configuration is illustrated in Figure 11First an experimentwas performed to check the performanceof the current control loop Second the motor is controlledto perform a smooth motion Figure 12 shows the referencecurrent and feedback current in one phase of the motor Thereference current is a sinewave and the output current followsa reference sine wave A small ripple (about 40 [mA]) is seenin the output current due to current switching components(Figure 13) The maximum current is set to 2 [A] The phaseshift between the two currents is caused by delays in the drivercontrol loop This result shows that the current output canfollow the desired current This is because the position ofthe motor depends on the value of the current when theoutput current is smooth the precise position control canbe achieved In this FPGA-based experimental system themotor driver can perform position control with maximum 2pulse errors in 16 microsteps mode which results in 25 [120583m]error in developed linear motion system
6 Chinese Journal of Engineering
XilinxSpartan3
FPGA board
Xilinx USBprogrammer
Power supply unit
30V5AStepper motor
and linear motion system
H-bridge circuitand ADC
Figure 10 Overall real hardware setup
Stepper motor
Power converterand ADC module
JTAGconnections
XilinxJTAG
FPGA development board
PC which does Matlab-Xilinxhardware-in-loop cosimulation
Figure 11 Hardware-in-loop cosimulation
4 Results
With respect to the achieved results the efficiency of thedriver is confirmed First an experiment was performed tocheck the efficiency of the driver control loop Second themotor is controlled to follow a smooth motion Figure 12shows the reference current and feedback current in a phaseof the stepper motor The reference current is a sine waveand the output current follows this sine wave The maximumcurrent is 2 [A] The phase shift between the two currents iscaused by the delays existing in the driver control loop andthemechanicalmovementsThis result shows that the currentoutput can follow the desired current This is because the
Reference currentFeedback current
(Am
pere
)
(ms)
3
2
1
0
minus1
minus2
minus30 50 100 150 200 250 300 350 400 450 500 550
Figure 12 Reference current and feedback current in 500 [ms]
position of the motor depends on the value of the currentwhen the output current is smooth the precise positioncontrol can be achieved Figure 13 shows the currents in the2 phases of the motor when the motor is controlled at aconstant speed Thus the currents in the 2 phases follow asine wave and shift in phase by an electric angle of 90∘ (thisis a cosine wave) Tables 2 and 3 represent the results of theimplementation of the microstepping driver on the FPGAdevice In this FPGA-based experimental system the drivercan perform position control with 25 [120583m] travel error or 2
Chinese Journal of Engineering 7
Winding A currentWinding B current
(Am
pere
)
(ms)0 50 100 150 200 250 300 350 400 450 500 550
2
15
1
05
0
minus05
minus1
minus15
minus2
Figure 13 Sampled currents in 2 phases of stepper motor in500 [ms]
Figure 14 Combination ofmultiple linear systems tomakemultipleaxis structures
pulse error when steppermotor drive linearmotion system ina 20 [cm] distant With this precision it is possible to makesmall scale and low cost low complexitymultiaxis structuresSuch a construction is presented in Figure 14
5 Conclusion
Stepper motors are used in an extensive range of positioncontrolling devices such as robots printers plotters andCNCs Nowadays most of the stepper motor controllingsystems do not work as accurately as they have potential toMicrostepping is a drive procedure for the stepper motorsthat allows the smooth movement of the rotor in a fractionof the motorrsquos full step angle In high precision applicationsthe microstepping driver is essential for accurate motor spinIn this paper a digital implementation of a microsteppingdrive system with current control using a Xilinx Spartan3(XC3S400) FPGA development board was presented Thedual H-bridge converter is planned to drive the two-phasestepper motor The model of the current controller and gainsof the PI controller for optimal control are calculated usingMatlab software In our design the FPGA is used to constructa high performance microstepping driver without using any
microcontroller DSP or driver chip additionally because allthe algorithms are written in Verilog hardware descriptionlanguage it is compatible with migrating proposed schemeto an ASIC and bulk fabrication methodsThe fractional stepcan be configured and the rotor movement can be controlledup to 1-16-step resolution giving an overall resolution ofdeveloped linear motion system Experimental results testedusing hardware-in-loop Matlab and Xilinx cosimulationmethod Finally the experimental results validate the perfor-mance of the driver
References
[1] Z Xiaodong H Junjun and S Chunlei ldquoAn approach ofmicro-stepping control for the step motors based on FPGArdquo inProceedings of the IEEE International Conference on IndustrialTechnology (ICIT rsquo05) pp 125ndash130 December 2005
[2] T Takahashi and J Goetz ldquoImplementation of complete ACservo control in a low cost FPGA and subsequent ASSPconversionrdquo in Proceedings of the 19th Annual IEEE AppliedPower Electronics Conference and Exposition (APEC rsquo04) pp565ndash570 February 2004
[3] S Xiaoyin and S Dong ldquoDevelopment of an FPGA-basedmotion control ASIC for robotic manipulatorsrdquo in Proceedingsof the 6thWorld Congress on Intelligent Control and Automation(WCICA rsquo06) pp 8221ndash8225 June 2006
[4] H K Bae and R Krishnan ldquoA study of current controllers anddevelopment of a novel current controller for high performanceSRM drivesrdquo in Proceedings of the 31st IEEE Industry Applica-tions Society AnnualMeeting (IAS rsquo96) pp 68ndash75 October 1996
[5] A I Maswood ldquoPWM voltage source inverter with PI con-troller for instantaneous motor current controlrdquo in Proceedingsof the 1995 International Conference on Power Electronics andDrive Systems pp 834ndash837 February 1995
[6] P Enjeti J F Lindsay P D Ziogas and M H Rashid ldquoNewcurrent control scheme for PWM invertersrdquo IEE Proceedings Bvol 135 no 4 pp 172ndash179 1988
[7] S Halasz G Csonka A A M Hassan and B T Huu ldquoAnalysisof the unipolar PWM techniquesrdquo in Proceedings of the 1996 8thMediterranean Electrotechnical Conference (MELECON rsquo06) pp353ndash356 May 1996
[8] S Halasz ldquoAnalysis of pulsewidth modulation techniques forinductionmotor drivesrdquo inProceedings of the IEEE InternationalSymposium on Industrial Electronics (ISIE rsquo93) pp 200ndash204Budapest Hungary 1993
[9] T Kenjo and A Sugawara Stepping Motors andTheir Micropro-cessor Controls Clarendon Press Oxford UK 1984
[10] R Condit StepperMotor Control Using the PIC16F684 Technol-ogy Inc 2004
[11] Q L Ngoc and W J Jae ldquoAn open-loop stepper motor driverbased on FPGArdquo in Proceedings of the International Conferenceon Control Automation and Systems (ICCAS rsquo07) pp 1322ndash1326October 2007
[12] S-M Yang and E-L Kuo ldquoDamping a hybrid stepping motorwith estimated position and velocityrdquo IEEE Transactions onPower Electronics vol 18 no 3 pp 880ndash887 2003
[13] Z Qiu S Shi X Li L Zhang and W Wu ldquoImplementation ofmotion control technique for stepper motor translation stagesin online detection systemrdquo in Proceedings of the 2011 Interna-tional Conference on Mechatronic Science Electric Engineeringand Computer (MEC rsquo11) pp 71ndash75 August 2011
8 Chinese Journal of Engineering
[14] N Dahm M Huebner and J Becker ldquoApproach of anFPGA based adaptive stepper motor control systemrdquo in Pro-ceedings of the 6th International Workshop on ReconfigurableCommunication-Centric Systems-on-Chip (ReCoSoC rsquo11) pp 1ndash6 June 2011
[15] Z Ali and R V Kshirsagar ldquoDevelopment of a CPLD basednovel open loop stepper motor controller for high performanceusing VHDLrdquo in Proceedings of the 14th International Confer-ence on Intelligent Engineering Systems (INES rsquo10) pp 307ndash312May 2010
[16] D Rossi and A Cuomo ldquoAnalog multiplex for sensing themagnitude and sense of the current through a h-bridge stageutilizing a single sensing resistancerdquo Google Patents 1989
[17] J D Wale and C Pollock ldquoA low-cost sensorless techniquefor load torque estimation in a hybrid stepping motorrdquo IEEETransactions on Industrial Electronics vol 46 no 4 pp 833ndash841 1999
International Journal of
AerospaceEngineeringHindawi Publishing Corporationhttpwwwhindawicom Volume 2014
RoboticsJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Active and Passive Electronic Components
Control Scienceand Engineering
Journal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
International Journal of
RotatingMachinery
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Hindawi Publishing Corporation httpwwwhindawicom
Journal ofEngineeringVolume 2014
Submit your manuscripts athttpwwwhindawicom
VLSI Design
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Shock and Vibration
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Civil EngineeringAdvances in
Acoustics and VibrationAdvances in
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Electrical and Computer Engineering
Journal of
Advances inOptoElectronics
Hindawi Publishing Corporation httpwwwhindawicom
Volume 2014
The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014
SensorsJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Modelling amp Simulation in EngineeringHindawi Publishing Corporation httpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Chemical EngineeringInternational Journal of Antennas and
Propagation
International Journal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Navigation and Observation
International Journal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
DistributedSensor Networks
International Journal of
6 Chinese Journal of Engineering
XilinxSpartan3
FPGA board
Xilinx USBprogrammer
Power supply unit
30V5AStepper motor
and linear motion system
H-bridge circuitand ADC
Figure 10 Overall real hardware setup
Stepper motor
Power converterand ADC module
JTAGconnections
XilinxJTAG
FPGA development board
PC which does Matlab-Xilinxhardware-in-loop cosimulation
Figure 11 Hardware-in-loop cosimulation
4 Results
With respect to the achieved results the efficiency of thedriver is confirmed First an experiment was performed tocheck the efficiency of the driver control loop Second themotor is controlled to follow a smooth motion Figure 12shows the reference current and feedback current in a phaseof the stepper motor The reference current is a sine waveand the output current follows this sine wave The maximumcurrent is 2 [A] The phase shift between the two currents iscaused by the delays existing in the driver control loop andthemechanicalmovementsThis result shows that the currentoutput can follow the desired current This is because the
Reference currentFeedback current
(Am
pere
)
(ms)
3
2
1
0
minus1
minus2
minus30 50 100 150 200 250 300 350 400 450 500 550
Figure 12 Reference current and feedback current in 500 [ms]
position of the motor depends on the value of the currentwhen the output current is smooth the precise positioncontrol can be achieved Figure 13 shows the currents in the2 phases of the motor when the motor is controlled at aconstant speed Thus the currents in the 2 phases follow asine wave and shift in phase by an electric angle of 90∘ (thisis a cosine wave) Tables 2 and 3 represent the results of theimplementation of the microstepping driver on the FPGAdevice In this FPGA-based experimental system the drivercan perform position control with 25 [120583m] travel error or 2
Chinese Journal of Engineering 7
Winding A currentWinding B current
(Am
pere
)
(ms)0 50 100 150 200 250 300 350 400 450 500 550
2
15
1
05
0
minus05
minus1
minus15
minus2
Figure 13 Sampled currents in 2 phases of stepper motor in500 [ms]
Figure 14 Combination ofmultiple linear systems tomakemultipleaxis structures
pulse error when steppermotor drive linearmotion system ina 20 [cm] distant With this precision it is possible to makesmall scale and low cost low complexitymultiaxis structuresSuch a construction is presented in Figure 14
5 Conclusion
Stepper motors are used in an extensive range of positioncontrolling devices such as robots printers plotters andCNCs Nowadays most of the stepper motor controllingsystems do not work as accurately as they have potential toMicrostepping is a drive procedure for the stepper motorsthat allows the smooth movement of the rotor in a fractionof the motorrsquos full step angle In high precision applicationsthe microstepping driver is essential for accurate motor spinIn this paper a digital implementation of a microsteppingdrive system with current control using a Xilinx Spartan3(XC3S400) FPGA development board was presented Thedual H-bridge converter is planned to drive the two-phasestepper motor The model of the current controller and gainsof the PI controller for optimal control are calculated usingMatlab software In our design the FPGA is used to constructa high performance microstepping driver without using any
microcontroller DSP or driver chip additionally because allthe algorithms are written in Verilog hardware descriptionlanguage it is compatible with migrating proposed schemeto an ASIC and bulk fabrication methodsThe fractional stepcan be configured and the rotor movement can be controlledup to 1-16-step resolution giving an overall resolution ofdeveloped linear motion system Experimental results testedusing hardware-in-loop Matlab and Xilinx cosimulationmethod Finally the experimental results validate the perfor-mance of the driver
References
[1] Z Xiaodong H Junjun and S Chunlei ldquoAn approach ofmicro-stepping control for the step motors based on FPGArdquo inProceedings of the IEEE International Conference on IndustrialTechnology (ICIT rsquo05) pp 125ndash130 December 2005
[2] T Takahashi and J Goetz ldquoImplementation of complete ACservo control in a low cost FPGA and subsequent ASSPconversionrdquo in Proceedings of the 19th Annual IEEE AppliedPower Electronics Conference and Exposition (APEC rsquo04) pp565ndash570 February 2004
[3] S Xiaoyin and S Dong ldquoDevelopment of an FPGA-basedmotion control ASIC for robotic manipulatorsrdquo in Proceedingsof the 6thWorld Congress on Intelligent Control and Automation(WCICA rsquo06) pp 8221ndash8225 June 2006
[4] H K Bae and R Krishnan ldquoA study of current controllers anddevelopment of a novel current controller for high performanceSRM drivesrdquo in Proceedings of the 31st IEEE Industry Applica-tions Society AnnualMeeting (IAS rsquo96) pp 68ndash75 October 1996
[5] A I Maswood ldquoPWM voltage source inverter with PI con-troller for instantaneous motor current controlrdquo in Proceedingsof the 1995 International Conference on Power Electronics andDrive Systems pp 834ndash837 February 1995
[6] P Enjeti J F Lindsay P D Ziogas and M H Rashid ldquoNewcurrent control scheme for PWM invertersrdquo IEE Proceedings Bvol 135 no 4 pp 172ndash179 1988
[7] S Halasz G Csonka A A M Hassan and B T Huu ldquoAnalysisof the unipolar PWM techniquesrdquo in Proceedings of the 1996 8thMediterranean Electrotechnical Conference (MELECON rsquo06) pp353ndash356 May 1996
[8] S Halasz ldquoAnalysis of pulsewidth modulation techniques forinductionmotor drivesrdquo inProceedings of the IEEE InternationalSymposium on Industrial Electronics (ISIE rsquo93) pp 200ndash204Budapest Hungary 1993
[9] T Kenjo and A Sugawara Stepping Motors andTheir Micropro-cessor Controls Clarendon Press Oxford UK 1984
[10] R Condit StepperMotor Control Using the PIC16F684 Technol-ogy Inc 2004
[11] Q L Ngoc and W J Jae ldquoAn open-loop stepper motor driverbased on FPGArdquo in Proceedings of the International Conferenceon Control Automation and Systems (ICCAS rsquo07) pp 1322ndash1326October 2007
[12] S-M Yang and E-L Kuo ldquoDamping a hybrid stepping motorwith estimated position and velocityrdquo IEEE Transactions onPower Electronics vol 18 no 3 pp 880ndash887 2003
[13] Z Qiu S Shi X Li L Zhang and W Wu ldquoImplementation ofmotion control technique for stepper motor translation stagesin online detection systemrdquo in Proceedings of the 2011 Interna-tional Conference on Mechatronic Science Electric Engineeringand Computer (MEC rsquo11) pp 71ndash75 August 2011
8 Chinese Journal of Engineering
[14] N Dahm M Huebner and J Becker ldquoApproach of anFPGA based adaptive stepper motor control systemrdquo in Pro-ceedings of the 6th International Workshop on ReconfigurableCommunication-Centric Systems-on-Chip (ReCoSoC rsquo11) pp 1ndash6 June 2011
[15] Z Ali and R V Kshirsagar ldquoDevelopment of a CPLD basednovel open loop stepper motor controller for high performanceusing VHDLrdquo in Proceedings of the 14th International Confer-ence on Intelligent Engineering Systems (INES rsquo10) pp 307ndash312May 2010
[16] D Rossi and A Cuomo ldquoAnalog multiplex for sensing themagnitude and sense of the current through a h-bridge stageutilizing a single sensing resistancerdquo Google Patents 1989
[17] J D Wale and C Pollock ldquoA low-cost sensorless techniquefor load torque estimation in a hybrid stepping motorrdquo IEEETransactions on Industrial Electronics vol 46 no 4 pp 833ndash841 1999
International Journal of
AerospaceEngineeringHindawi Publishing Corporationhttpwwwhindawicom Volume 2014
RoboticsJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Active and Passive Electronic Components
Control Scienceand Engineering
Journal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
International Journal of
RotatingMachinery
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Hindawi Publishing Corporation httpwwwhindawicom
Journal ofEngineeringVolume 2014
Submit your manuscripts athttpwwwhindawicom
VLSI Design
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Shock and Vibration
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Civil EngineeringAdvances in
Acoustics and VibrationAdvances in
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Electrical and Computer Engineering
Journal of
Advances inOptoElectronics
Hindawi Publishing Corporation httpwwwhindawicom
Volume 2014
The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014
SensorsJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Modelling amp Simulation in EngineeringHindawi Publishing Corporation httpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Chemical EngineeringInternational Journal of Antennas and
Propagation
International Journal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Navigation and Observation
International Journal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
DistributedSensor Networks
International Journal of
Chinese Journal of Engineering 7
Winding A currentWinding B current
(Am
pere
)
(ms)0 50 100 150 200 250 300 350 400 450 500 550
2
15
1
05
0
minus05
minus1
minus15
minus2
Figure 13 Sampled currents in 2 phases of stepper motor in500 [ms]
Figure 14 Combination ofmultiple linear systems tomakemultipleaxis structures
pulse error when steppermotor drive linearmotion system ina 20 [cm] distant With this precision it is possible to makesmall scale and low cost low complexitymultiaxis structuresSuch a construction is presented in Figure 14
5 Conclusion
Stepper motors are used in an extensive range of positioncontrolling devices such as robots printers plotters andCNCs Nowadays most of the stepper motor controllingsystems do not work as accurately as they have potential toMicrostepping is a drive procedure for the stepper motorsthat allows the smooth movement of the rotor in a fractionof the motorrsquos full step angle In high precision applicationsthe microstepping driver is essential for accurate motor spinIn this paper a digital implementation of a microsteppingdrive system with current control using a Xilinx Spartan3(XC3S400) FPGA development board was presented Thedual H-bridge converter is planned to drive the two-phasestepper motor The model of the current controller and gainsof the PI controller for optimal control are calculated usingMatlab software In our design the FPGA is used to constructa high performance microstepping driver without using any
microcontroller DSP or driver chip additionally because allthe algorithms are written in Verilog hardware descriptionlanguage it is compatible with migrating proposed schemeto an ASIC and bulk fabrication methodsThe fractional stepcan be configured and the rotor movement can be controlledup to 1-16-step resolution giving an overall resolution ofdeveloped linear motion system Experimental results testedusing hardware-in-loop Matlab and Xilinx cosimulationmethod Finally the experimental results validate the perfor-mance of the driver
References
[1] Z Xiaodong H Junjun and S Chunlei ldquoAn approach ofmicro-stepping control for the step motors based on FPGArdquo inProceedings of the IEEE International Conference on IndustrialTechnology (ICIT rsquo05) pp 125ndash130 December 2005
[2] T Takahashi and J Goetz ldquoImplementation of complete ACservo control in a low cost FPGA and subsequent ASSPconversionrdquo in Proceedings of the 19th Annual IEEE AppliedPower Electronics Conference and Exposition (APEC rsquo04) pp565ndash570 February 2004
[3] S Xiaoyin and S Dong ldquoDevelopment of an FPGA-basedmotion control ASIC for robotic manipulatorsrdquo in Proceedingsof the 6thWorld Congress on Intelligent Control and Automation(WCICA rsquo06) pp 8221ndash8225 June 2006
[4] H K Bae and R Krishnan ldquoA study of current controllers anddevelopment of a novel current controller for high performanceSRM drivesrdquo in Proceedings of the 31st IEEE Industry Applica-tions Society AnnualMeeting (IAS rsquo96) pp 68ndash75 October 1996
[5] A I Maswood ldquoPWM voltage source inverter with PI con-troller for instantaneous motor current controlrdquo in Proceedingsof the 1995 International Conference on Power Electronics andDrive Systems pp 834ndash837 February 1995
[6] P Enjeti J F Lindsay P D Ziogas and M H Rashid ldquoNewcurrent control scheme for PWM invertersrdquo IEE Proceedings Bvol 135 no 4 pp 172ndash179 1988
[7] S Halasz G Csonka A A M Hassan and B T Huu ldquoAnalysisof the unipolar PWM techniquesrdquo in Proceedings of the 1996 8thMediterranean Electrotechnical Conference (MELECON rsquo06) pp353ndash356 May 1996
[8] S Halasz ldquoAnalysis of pulsewidth modulation techniques forinductionmotor drivesrdquo inProceedings of the IEEE InternationalSymposium on Industrial Electronics (ISIE rsquo93) pp 200ndash204Budapest Hungary 1993
[9] T Kenjo and A Sugawara Stepping Motors andTheir Micropro-cessor Controls Clarendon Press Oxford UK 1984
[10] R Condit StepperMotor Control Using the PIC16F684 Technol-ogy Inc 2004
[11] Q L Ngoc and W J Jae ldquoAn open-loop stepper motor driverbased on FPGArdquo in Proceedings of the International Conferenceon Control Automation and Systems (ICCAS rsquo07) pp 1322ndash1326October 2007
[12] S-M Yang and E-L Kuo ldquoDamping a hybrid stepping motorwith estimated position and velocityrdquo IEEE Transactions onPower Electronics vol 18 no 3 pp 880ndash887 2003
[13] Z Qiu S Shi X Li L Zhang and W Wu ldquoImplementation ofmotion control technique for stepper motor translation stagesin online detection systemrdquo in Proceedings of the 2011 Interna-tional Conference on Mechatronic Science Electric Engineeringand Computer (MEC rsquo11) pp 71ndash75 August 2011
8 Chinese Journal of Engineering
[14] N Dahm M Huebner and J Becker ldquoApproach of anFPGA based adaptive stepper motor control systemrdquo in Pro-ceedings of the 6th International Workshop on ReconfigurableCommunication-Centric Systems-on-Chip (ReCoSoC rsquo11) pp 1ndash6 June 2011
[15] Z Ali and R V Kshirsagar ldquoDevelopment of a CPLD basednovel open loop stepper motor controller for high performanceusing VHDLrdquo in Proceedings of the 14th International Confer-ence on Intelligent Engineering Systems (INES rsquo10) pp 307ndash312May 2010
[16] D Rossi and A Cuomo ldquoAnalog multiplex for sensing themagnitude and sense of the current through a h-bridge stageutilizing a single sensing resistancerdquo Google Patents 1989
[17] J D Wale and C Pollock ldquoA low-cost sensorless techniquefor load torque estimation in a hybrid stepping motorrdquo IEEETransactions on Industrial Electronics vol 46 no 4 pp 833ndash841 1999
International Journal of
AerospaceEngineeringHindawi Publishing Corporationhttpwwwhindawicom Volume 2014
RoboticsJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Active and Passive Electronic Components
Control Scienceand Engineering
Journal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
International Journal of
RotatingMachinery
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Hindawi Publishing Corporation httpwwwhindawicom
Journal ofEngineeringVolume 2014
Submit your manuscripts athttpwwwhindawicom
VLSI Design
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Shock and Vibration
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Civil EngineeringAdvances in
Acoustics and VibrationAdvances in
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Electrical and Computer Engineering
Journal of
Advances inOptoElectronics
Hindawi Publishing Corporation httpwwwhindawicom
Volume 2014
The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014
SensorsJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Modelling amp Simulation in EngineeringHindawi Publishing Corporation httpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Chemical EngineeringInternational Journal of Antennas and
Propagation
International Journal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Navigation and Observation
International Journal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
DistributedSensor Networks
International Journal of
8 Chinese Journal of Engineering
[14] N Dahm M Huebner and J Becker ldquoApproach of anFPGA based adaptive stepper motor control systemrdquo in Pro-ceedings of the 6th International Workshop on ReconfigurableCommunication-Centric Systems-on-Chip (ReCoSoC rsquo11) pp 1ndash6 June 2011
[15] Z Ali and R V Kshirsagar ldquoDevelopment of a CPLD basednovel open loop stepper motor controller for high performanceusing VHDLrdquo in Proceedings of the 14th International Confer-ence on Intelligent Engineering Systems (INES rsquo10) pp 307ndash312May 2010
[16] D Rossi and A Cuomo ldquoAnalog multiplex for sensing themagnitude and sense of the current through a h-bridge stageutilizing a single sensing resistancerdquo Google Patents 1989
[17] J D Wale and C Pollock ldquoA low-cost sensorless techniquefor load torque estimation in a hybrid stepping motorrdquo IEEETransactions on Industrial Electronics vol 46 no 4 pp 833ndash841 1999
International Journal of
AerospaceEngineeringHindawi Publishing Corporationhttpwwwhindawicom Volume 2014
RoboticsJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Active and Passive Electronic Components
Control Scienceand Engineering
Journal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
International Journal of
RotatingMachinery
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Hindawi Publishing Corporation httpwwwhindawicom
Journal ofEngineeringVolume 2014
Submit your manuscripts athttpwwwhindawicom
VLSI Design
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Shock and Vibration
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Civil EngineeringAdvances in
Acoustics and VibrationAdvances in
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Electrical and Computer Engineering
Journal of
Advances inOptoElectronics
Hindawi Publishing Corporation httpwwwhindawicom
Volume 2014
The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014
SensorsJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Modelling amp Simulation in EngineeringHindawi Publishing Corporation httpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Chemical EngineeringInternational Journal of Antennas and
Propagation
International Journal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Navigation and Observation
International Journal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
DistributedSensor Networks
International Journal of
International Journal of
AerospaceEngineeringHindawi Publishing Corporationhttpwwwhindawicom Volume 2014
RoboticsJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Active and Passive Electronic Components
Control Scienceand Engineering
Journal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
International Journal of
RotatingMachinery
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Hindawi Publishing Corporation httpwwwhindawicom
Journal ofEngineeringVolume 2014
Submit your manuscripts athttpwwwhindawicom
VLSI Design
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Shock and Vibration
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Civil EngineeringAdvances in
Acoustics and VibrationAdvances in
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Electrical and Computer Engineering
Journal of
Advances inOptoElectronics
Hindawi Publishing Corporation httpwwwhindawicom
Volume 2014
The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014
SensorsJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Modelling amp Simulation in EngineeringHindawi Publishing Corporation httpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Chemical EngineeringInternational Journal of Antennas and
Propagation
International Journal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Navigation and Observation
International Journal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
DistributedSensor Networks
International Journal of