Home
Global Affairs Office GDANSK UNIVERSITY OF TECHNOLOGY
Contents
1. 10 7 Conculsion aa aa w wa enn W W i W WW W W 10 8 Reference 11 9 Appendix I The main c Program of the Developed Embedded Programs 12 10 Appendix II Create Embedded Programs for Testing Step by Step 18 Abstract In this laboratory training the basics of stepper motor and its modern controls were learnt An AMR microprocessor broad controller was offered as a pulse source to control a stepper motor with driver that is a project kept in the lab 1 and the embedded control programs were written in C language in uVision 4 platform 1 Introduction Motors play an important role in automation motor types with different structure and control methods can be divided into DC motors AC motors servo motors and stepper motors In terms of power consumption DC and AC motors have better power output However on control accuracy view servo motors and stepper motors are the better choice Stepper motor or pulse motor unlike AC motors DC motors and servo motors Because of high torque at low speed high holding torque at rest start stop and reversing response is good and the rotation angle is proportional to the input pulse and low angle error characteristics the use of open loop control to achieve closed loop control of the demand for high precision angle and high precision positi
2. E A main Select Device for Target EDS20 zs Ik Remove Item 5 2 lcd c Clean target ba ld 2 Build target l IF i Rebuild all target files Batch Build 2 Translate C Keil ARM Ken EDS20 controller main c Ctri F7 Stop build 18 Il Anew window will pop up then go to Output and then tick the box Create HEX File arget EL Device Target Output isting User CiCt Asm Linker Debug Utilities Select Folder for Objects Name of Executable EDS20 Create Executable EDS20 6 Debug Information IV Create HEX File M Browse Information Create Library EDS20 LIB Device Target Output Listing User C C Asm Linker Debug Utliies IV Use Memory Layout from Target Dialog Make RW Sections Position Independent R O Base lt o0000000 Make RO Sections Position Independent R W Base foxaoo00000 SS I Dont Search Standard Libraries Pisa if Caire an Enon disable Wamings sm se Linker cpu ARM7TDMI o strict scatter EDS20 sct a control summary_stdem info summarysizes map xref callgraph symbols string be Cancel Defaults Help 19 Then after finish writing programs and build it without any error the HEX file can be compiled by using Flash Magic The following is the compiling steps In Step 1 Select the testing processor in this case is processor LPC2129 Il Ch
3. Y Reckitt Benckiser GDANSK UNIVERSITY OF TECHNOLOGY FACULTY OF ELECTRICAL AND CONTROL ENGINEERING STEPPING MOTOR CONTROLLING BY USING ARM MICROPROCESSOR AUTOR SUPERVISOR Chi Kin Lao dr in Jaros aw Guzi ski Gdansk 2012 Global Affairs Office ACKNOWLEDGEMENT Thanks IAESTE Faculty of Electrical and Control Engineering of Gdansk University of Technology and Global Affairs Office for offer me this internship Thanks my supervisor Dr Guzinski for his great support It was very nice to work with him Thanks Dr Kevin Hung for writing me the recommendation letter Thanks my FYP partner Mr U Kin Che and my roomate Mr Jos Rua for their knowledge in programing Table of Content Acknowledgement 1 Abstract 3 1 Introduction W 3 2 Project kept in the lab 4 3 The control algorthim 5 4 Current control M 6 5 Immplementation 8 6 Future development
4. 1 else LCDSendByte 0 hex 1 17 Appendix II Create Embedded Programs for Testing Step by Step The embedded programs were written in C langue in the microcontroller development kit MDK Vision 4 and the programs were compiled and tested on the processor in HEX format by using the programming tool Flash Magic via serial port The following will tell how to do step by step from downloading uVision 4 to testing the program on processor The below link is the official download web page of pVision 4 https www keil com demo eval arm htm The programming tool Flash Magic can be found from another official website as shown as the following http www flashmagictool com After download and install the software you may start to create a new project You can view and download the official Getting Started guide in PDF format from the below link http www keil com product brochures uv4 pdf At page 75 chapter 6 is talking about how to create embedded programs in detail Don t forget to generate the HEX file for testing on the processor and it can be apply from the following steps with figures 1 Inthe Project Menu gt Options for Target Flash Debug Peripherals Tools SVCS Window Help gu g New Vision Project AN FEEL igi New Multi Project Workspace Project E EDS20 Open Project Close Project q Startup Export g Start Manage i 4 6 Source
5. Ideal 4 Current Limit FINAIS Time MOS Gate Drive Voltage vs Time Tc Chop period Ti Initial On Time To Duty Cycle on time Drive Voltage i mi Duty Cycle off time Current 5V 0 Time Fig 6 Voltage pulse and winding current control with PWM 5 Implementation The implemented system is shown as Figure 7 4 The ARM controller broad is supplied at 9 V and the driver is powered by a voltage supply which will directly affect the torque and the maximum speed of the motor The controller will keep listening to the buttons pressed by the user and generates the corresponding pulse signal to the driver then the driver will converse the input signal to be large signal to control and supply the rotation of the stepper motor Also there is a LCD displaying information to the user According to time limitation the system was built without current control feedback but the building method is discussed later in the future development JUL ARM Controller Driver Stepper Motor Power Supply 9V Supply Fig 7 Overall system blocks diagram To realize the above system control the connections and settings of the ARM broad are shown as below Output PO 8 12 of the processor as control pulse PINs is connected to the Inputs 5V DO D3 of EDS 20 correspondingly Note that ON OFF of the winding LEDs A B Cand D on EDS 20 is inversed to DO 3 correspondingly Functions and its symbols of the buttons
6. or input PINs are shown as table P0 27 AINO as ADC input PIN for motor rotational delay P0 29 AIN2 and P0 30 AIN3 is for LCD display For jumpers JP11 14 KB1 4 connected to KB11 14 correspondingly Jumper J10 for button INT1 is on Jumper ANA_EN for AINO is on Table Functions and its symbols of the buttons on the ARM broad Button S1 S2 S3 S INT1 Function Continuously Continuously Counterclockwise Clockwise Stop counterclockwise clockwise rotation rotation rotation rotation Symbol lt lt gt gt lt gt X PIN PO 4 P0 5 P0 6 PO 7 P0 14 With the connection and settings mentioned above the embedded programs were written inside it the ADC and LCD display function is base on the ARM broad example The following is the description of the main c in Appendix I Every time the program starts to run it will display the stepper motor name EDS 20 on the LCD and only power band A and band B in the motor at the beginning then display functions of the buttons Table I and then after reading the variable resistance by the on chip ADC motor rotational delay which depends on this reading will be displayed on the LCD At this moment the processor will keep listening to the buttons pressed by the user If INTL is pressed functions of the buttons will display again and last for few second then again keep listening to the
7. val int t ADCR 0x01000000 do Set both D2 and D3 1 Set both DO and D1 0 Set both DO and D3 1 Set both D1 and D2 0 Set both DO and D1 1 Set both D2 and D3 0 Set both D1 and D2 1 Set both DO and D3 0 start converting AC 15 val ADDR while val amp Ox80000000 0 ADCR amp 0x01000000 val val gt gt 6 amp OxO3FF Display the reading value LCDTextXY 0 1 AINO Ox LCD_Hex val gt gt 8 amp OxOF LCD_Hex val gt gt 4 amp OxOF LCD_Hex val amp OxOF Delay for the motor rotation for t 0 t lt val 1000 0x20000 t if IOPINO amp 0x00004000 run val val gt gt 2 amp OxOOFF IOCLR1 OxOOFFOOOO IOSET1 OxOOFFOO0O amp val lt lt 16 int clockwise int step_val switch step_val case 1 return 4 case 2 return 1 case 3 return 2 case 4 return 3 int counterclockwise int step_val switch step_val 16 read the conversion result wait for the end of the conversion of AC AC conversion end 1st digit 2nd digit 3rd digit LED off 8 most significant bits of the conversion to LED case 1 return 2 case 2 return 3 case 3 return 4 case 4 return 1 void delay unsigned int del_ time unsigned int i for i 0 i lt del_time i void LCD_Hex int hex if hex gt 9 LCDSendByte A hex 10
8. buttons If S1 or S2 is pressed the motor will rotate in counterclockwise or clockwise direction continuously with every new ADC delay reading During the delay written in for loop the processor will keep listening to the stop button INT1 The rotation can be stop immediately as the processer will spend most of the time in the for loop and the other lines in the program will be processed within a very short time The performance of this stopping almost achieves to employ external interrupt If INT1 is pressed it will do the same process as mentioned before During the non delay period if S1 was pressed before it will listen to S2 for reverse rotation and vice versa for S2 was pressed before If S3 or S4 is being pressed the motor will keep rotating in counterclockwise or clockwise direction with every new ADC delay reading until the button is released After release pressing if INT1 is pressed it will do the same process as mentioned before 6 Future Development The embedded programs developed in this training contain basic rotational and speed controls on the motor and with a LCD displaying feature User can make the motor rotates or stops by pressing the buttons on the controller and can view the information displayed on LCD The following would like to give some recommendation to have further advance control on the motor a According to safety reason we always
9. constant by series a resistor to the winding Such method is simple enough but with a drawback on the heat energy consumption of the series resistor There is a further current control method so called pulse width modulation PWM technic which normally using with microprocessor according to its highly integration and high speed operation and detection PWM can achieve high dynamic together with reasonable power consumption The method is to apply high voltage to the driver and a feedback path from the motor resistor to the ADC of the processor When signal pulse comes to one of transistor input terminal of a winding Figure 5 1 according to the high supply voltage to the driver the current flowing through the winding will increase and reach to working value very fast high dynamic but once the winding current or the voltage of the motor resistor exceed some value normally below the rating current the processor will trigger to switch off the signal so the winding current will drop down then similarly once the winding current or the voltage of the motor resistor lower than some value the processor will trigger to switch on the signal so that to maintain the winding current around a expected value Figure 6 3 during pulse period T A A A A a Uzas e i SARAD 7 JR J JE JF EDS 20 Fig 5 Commutator Connection of EDS 20 Current vs time for stepper motor winding
10. ion Loop function for buttons S1 to S4 and INT1 while 1 When S1 connected to P0 4 13 if IOPINO amp 0x00000010 while 1 Rotate continuously Changing step value for clockwise rotation step_val counterclockwise step_val stepping step_val if IOPINO amp 0x00000020 break Break and rotate in counterclockwise when button INT1 is pressed When S2 connected to P0 5 else if IOPINO amp 0x00000020 while 1 step_val clockwise step_val stepping step_val if IOPINO amp 0x00000010 break Break and rotate in clockwise when button INT1 is pressed When S3 connected to P0 6 else if IOPINO amp 0x00000040 step_val counterclockwise step_val stepping step_val When S4 connected to PO 7 else if IOPINO amp 0x00000080 step_val clockwise step_val stepping step_val else if IOPINO amp 0x00004000 14 run While end Stepping motor steps to one of the 4 steps void stepping int step_val if step_val 1 IOSETO Ox0000F900 IOCLRO 0x00000600 else if step_val 2 IOSETO OxOO00F300 IOCLRO 0x00000C00 else if step_val 3 IOSETO OxOO00E700 IOCLRO 0x00001800 else if step_val 4 IOSETO OxOOOOEDOO IOCLRO 0x00001200 delay_ADC Delay the motor rotation and display the delay value void delay ADC void unsigned int
11. l interrupt and timer interrupt in processor and PWM technic for advance control were given in the last section 10 Reference 1 Krzysztof Jendraszek Projekt i wykonanie przeksztattnika do mikroprocesorowo sterowanego silnika skokowego Gdansk 2008 Stepper motor from WIKI http en wikipedia org wiki Stepper_motor Stepper motor and control http www stepperworld com Tutorials pgCurrentControl htm 4 LPC2129 user manual http www keil com dd docs datashts philips user_manual_lpc2119 2129 2 194 2292 2294 pdf 5 Stepper motor basics http library solarbotics net pdflib pdf motorbas pdf 11 Appendix The main c Program of the Developed Embedded Programs JORK ER LARS ERALAL EERE SERERE ELE EERE REEL EEE ELAR REE EEL ERR EAE ZLSARM Controller of the stepping motor EDS 20 Inputs 5V and DO D3 of EDS 20 is connected to PO 8 12 correspondingly ON OFF of LEDs A B C and D on EDS 20 is inverse to DO D3 correspondingly REREAELEE ERLE LLES EEA EERER ERE EERELE LLANE RATER EER ELLE REE EERE AE include lt LPC21xx H gt include const_bit h include Icd h define del_ 0x400000 define del_s 0x10000 unsigned int step_val 1 Totally 4 step values 1 to 4 represent the states of DO to D3 void run void The core function for controlling void delay_ADC void Delay of the motor retation depends on the ADC reading void delay unsigned int del_time Delay for LCD diaplay void step
12. oning Since the drive is simple accurate positioning and control is open loop so it s often be used in variety of precise positioning applications such as on printer plotter floppy drive and other devices The objective of this training is to understand the knowledge of stepper motor and its control methods and try to develop an embedded control programs work with ARM microprocessor 2 Project Kept in the Lab 1 The stepper motor of the project kept in the lab is model EDS 20 Inside it current can flow in a band in only one direction during operation Unipolar control is thus imposed by the structure of the motor itself The bands totally 4 combination of the motor is illustrated in Fig 1 Fig 1 Bands combination of EDS 20 engine 1 The following figure shows a typical control system of a stepper motor The driver in the original project was already well developed and the main task of this training is to use only one ARM processor broad to generate pulse signals to the driver to control the motor JUL Pulse Source Control Logic Driver Stepper Motor Power Supply Fig 2 Typical control system of a stepper motor The next two sections will discuss the basic control theories on this unipolar motor 3 The control algorithm 1 For the control of EDS 20 engine the controller was designed to implement the algorithm work for 2 4 which is also known as two phase This algo
13. oose the appropriate COM Port in this case is COM 3 Ill Set the Baud Rate of the COM Port to 19200 IV Select Interface to be None ISP V Set Oscillator frequency to 12 MHz which is the same as the clock of LPC2129 In Step 2 VI Tick the box Erase all Flash Code Rd Prot In Step 3 VII Apply the location of the HEX file for compile In Step 5 VIII Click the Start button Remember to connect the computer and COMO of the ARM broad via serial port power the ARM broad the jumper J7 on the ARM broad should be on ISP as we have chosen ISP interface before and COM port on computer should be free for use or without access by other software else File ISP Options Tools Help GAJADGVE gt P G GZ LPC2129 Erase block 0 0x0 0 Erase bloc Er COM Port COM 3 Baud Rate 19200 Interface None ISP se block Erase all Oscillator MHz 12 Erase blocks used by Hex File Step 3 Hex File Hex File C Keil ARIM Ken EDS20 controlen EDS20 hex Modified Monday August 13 2012 09 54 00 more info Step 4 Options Verify after programming Fill unused Flash Gen block checksums Execute Technical on line articles about 8051 and XA programming www esacademy com fag docs Finally you will see if the program works normally or not 20
14. ping int step_val Only DOD1 D1D2 D2D3 or D3D1 will set 0 at any moment int clockwise int step_val Stepping changing for clockwise rotation int counterclockwise int step_val Stepping changing for counterclockwise rotation void LCD_Hex int hex Hex digit display on the LCD int main void Define in output IODIRO OxFFOOFFOO IODIR1 OxOOFFOOOO PINSEL1 amp BIT26 BIT27 BIT28 BIT29 PINSEL1 BIT22 ADCR 0x002E0401 AC 10 bit AINO 3MHz LCDInit LCDSendByte 0x01 0 clrser 12 delay del_s Display the stepping motor name EDS 20 in LCD LCDSendByte 1 delay del_ LCDSendByte 1 delay del_ I LCDSendByte 1 delay del_ I LCDSendByte 1 delay del_l LCDSendByte 1 delay del_ LCDSendByte E 1 delay del_ LCDSendByte D 1 delay del_I LCDSendByte S 1 delay del_ LCDSendByte 1 delay del_ LCDSendByte 2 1 delay del_I LCDSendByte 0 1 delay del_I LCDSendByte 1 delay del_ LCDSendByte 1 delay del_ I delay del_I Initialize the outputs DOD1D2D3 0011 IOSETO OxOOOOFFOO IOCLRO 1 lt lt 9 IOCLRO 1 lt lt 10 run MITT MMT TTT TTT TTT void run void LCDTextXY O 1 1 lt lt 2 gt gt 3 lt 4 gt 5X Display functions of the buttons S1 S2 S3 S4 INT1 delay 8 del_ LCDTextXY 0 1 delay_ADC Show the current delay value of motor rotat
15. rithm is specific to unipolar motors reluctance The ideal 2 4 switching of four band motor is characterized by the fact that 2 bands are powered and 2 bands remain in open circuit condition at anytime while the numbers of possible combinations of the powered bands are 4 Figure 3 2 presents the ideal case of full step drive 2 4 switching Coils A FULL STEP DRIVE B C D Fig 3 Idealized process algorithm 2 4 1 In fact during the implementation of the algorithm in motor windings will be slightly different from those shown in Figure 11 Deformation of ideal waveforms is caused by the presence of a delay time of rising and falling current in the individual bands This phenomenon always appears to decrease the frequency of jumps The course of the actual algorithm 2 4 is shown in Figure 4 ema PA lm am Pasmo B A o pmt O N em gt emo h i E ami Fig 4 The actual course of the algorithm 2 4 4 Current Control As we know the instantaneous torque generated in each band depends on the current flowing though in the band rather than the voltage drop on the band 5 Each band in stepper motor is characterized by a resistance and inductance Inductance makes the motor winding oppose current changes and every RL circuit is characterized by a time constant t L R therefore limits high speed operation 1 The original project already employed the control method L Rn that reduces the time
16. want the ARM processor can response to us to stop the motor at any time External interrupt function can be applied to achieve this requirement b The motor rotational delay depends on the resistance reading from on chip ADC and also the processor speed Timer interrupt function can be combined with the ADC to have precise timing control c PWM technic can be applied to achieve high dynamic in the motor It can be realize by applying voltage feedback from the resistor Rm at the driver to one of the on chip ADCs There are totally 4 ADCs with analog input PIN namely AINO 3 PO0 27 30 in the processor As mentioned before AINO is used for the motor rotational delay and both of P0 29 and P0 30 are employed for the LCD display The only unused ADC PIN in this program is AIN1 P0 28 but note that the jumper NTC_EN J5 must be switched OFF so that the AIN1 is really available To measure the voltage on Rm correctly the grounds of the driver and the processor should be connected and another end of Rm should be connected to P0 28 Conclusion In this 6 weeks training stepper motor and its control algorithms were learnt A control program for stepper motor EDS 20 was designed with C langue in uVision 4 and well tested by using ARM microprocessor LPC2129 The controls basically include speed control clockwise and counterclockwise rotations reversing rotation stop rotating and LCD display function Future developments employing externa
Download Pdf Manuals
Related Search
Related Contents
Samsung ME183GNR Керівництво користувача Guide Express Murray MB1842LT User's Manual Nouvel Arrivant Francophone (Février 2013) Modes d`emploi 1000FLT - EURO 【ハウス内ユニット】試運転担当の方へ 2003 05 21 - Livret mode d`emploi Tycon Systems PSHP-24 Copyright © All rights reserved.
Failed to retrieve file