* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download Microcontroller Systems ELET 3232 Topic 14: Motion Control
Switched-mode power supply wikipedia , lookup
Power engineering wikipedia , lookup
Buck converter wikipedia , lookup
Control theory wikipedia , lookup
Opto-isolator wikipedia , lookup
Stray voltage wikipedia , lookup
Electrification wikipedia , lookup
Resilient control systems wikipedia , lookup
Pulse-width modulation wikipedia , lookup
Embedded system wikipedia , lookup
Control system wikipedia , lookup
History of electric power transmission wikipedia , lookup
Commutator (electric) wikipedia , lookup
Three-phase electric power wikipedia , lookup
Rectiverter wikipedia , lookup
Mains electricity wikipedia , lookup
Voltage optimisation wikipedia , lookup
Alternating current wikipedia , lookup
Electric machine wikipedia , lookup
Electric motor wikipedia , lookup
Brushed DC electric motor wikipedia , lookup
Brushless DC electric motor wikipedia , lookup
Variable-frequency drive wikipedia , lookup
Microcontroller Systems ELET 3232 Topic 14: Motion Control Objectives To gain an understanding of the operation of a stepper motor To develop a means to control a stepper motor To gain an understanding of servo motors 1/5/2011 1/5/2011 Speed control Position control 2 2 Stepper Motors [1] Stepper motors are used in many devices we use daily They are used in: printers, disk drives, toys, windshield wipers, vibrating pagers, robotic arms, and video cameras. We’ll focus on the permanent magnet stepper 1/5/2011 It is simpler and more popular than the variable reluctance type [1] Simon, D., 2003, Get Your Motor Running, Embedded Systems Design, April 10, 2003 3 Stepper Motors [1] Teeth with wire wound around them. The wire wound around the teeth is referred to as the winding, coil, or phase The rotor is a permanent magnet that is free to rotate about the center of the motor Stator (stationary part of the motor) 1/5/2011 [1] Simon, D., 2003, Get Your Motor Running, Embedded Systems Design, April 10, 2003 4 Stepper Motors [1] Because the current is flowing in this direction through the winding, an electromagnet is produced in these teeth, with the North end pointing up. This magnetic field causes the rotor to rotate to this point, aligning itself with the magnetic field. 1/5/2011 [1] Simon, D., 2003, Get Your Motor Running, Embedded Systems Design, April 10, 2003 5 Stepper Motors [1] If we now apply current to winding 2, the rotor will turn to this new position 1/5/2011 [1] Simon, D., 2003, Get Your Motor Running, Embedded Systems Design, April 10, 2003 6 Stepper Motors [1] And now, if current is applied to winding 1 again, but in the opposite direction as before, the rotor will turn to this new position 1/5/2011 [1] Simon, D., 2003, Get Your Motor Running, Embedded Systems Design, April 10, 2003 7 Stepper Motors [1] And now we have made one complete revolution by applying current (in the opposite direction as before) through winding 2 1/5/2011 [1] Simon, D., 2003, Get Your Motor Running, Embedded Systems Design, April 10, 2003 8 Stepper Motors [1] We have completed one cycle of the electrical stimulation to the windings and at the same time, have made one revolution (cycle) of the rotor. fe = fm 1/5/2011 [1] Simon, D., 2003, Get Your Motor Running, Embedded Systems Design, April 10, 2003 9 Stepper Motors [1] We have completed one cycle of the electrical stimulation to the windings and at the same time, have made one revolution (cycle) of the rotor. fe = fm In general: fe = fm p 2 where p is the number of equally-spaced magnetic poles on the rotor and: 1/5/2011 Step = 180° p [1] Simon, D., 2003, Get Your Motor Running, Embedded Systems Design, April 10, 2003 10 Stepper Motors [1] We have completed one cycle of the electrical stimulation to the windings and at the same time, have made one revolution (cycle) of the rotor. fe = fm In general: fe = fm p 2 where p is the number of equally-spaced magnetic poles on the rotor and: “It is common to find two-phase steppers with anywhere between 12 and 200 poles, which results in a stepping resolution of anywhere between 15º and 0.9º.” [1] 1/5/2011 Step = 180° p [1] Simon, D., 2003, Get Your Motor Running, Embedded Systems Design, April 10, 2003 11 Stepper Motors [1] This is a two-phase, six-pole motor: It has two windings (two-phase) for the four teeth 1/5/2011 [1] Simon, D., 2003, Get Your Motor Running, Embedded Systems Design, April 10, 2003 12 Stepper Motors [1] This is a two-phase, six-pole motor: It has two windings (two-phase) for the four teeth and six equally spaced permanent magnet poles 1/5/2011 [1] Simon, D., 2003, Get Your Motor Running, Embedded Systems Design, April 10, 2003 13 Stepper Motors [1] Voltage is applied to stator windings #1 with a polarity such that current will flow in a direction that causes a North magnetic field at the top and South at the bottom. 1/5/2011 [1] Simon, D., 2003, Get Your Motor Running, Embedded Systems Design, April 10, 2003 14 Stepper Motors [1] Voltage is applied to stator windings #1 with a polarity such that current will flow in a direction that causes a North magnetic field at the top and South at the bottom. If we remove that voltage and apply a voltage to windings 2 such that a North polarity forms on the left (South on the right), the rotor will rotate clockwise one position. 1/5/2011 [1] Simon, D., 2003, Get Your Motor Running, Embedded Systems Design, April 10, 2003 15 Stepper Motors [1] Voltage is applied to stator windings #1 with a polarity such that current will flow in a direction that causes a North magnetic field at the top and South at the bottom. If we remove that voltage and apply a voltage to windings 2 such that a North polarity forms on the left (South on the right), the rotor will rotate clockwise one position. And then reapply voltage to winding one, but with the opposite polarity we get another clockwise rotation of one position. 1/5/2011 [1] Simon, D., 2003, Get Your Motor Running, Embedded Systems Design, April 10, 2003 16 Stepper Motors [1] Voltage is applied to stator windings #1 with a polarity such that current will flow in a direction that causes a North magnetic field at the top and South at the bottom. If we remove that voltage and apply a voltage to windings 2 such that a North polarity forms on the left (South on the right), the rotor will rotate clockwise one position. And then reapply voltage to winding one, but with the opposite polarity we get another clockwise rotation of one position. And finally, reapply voltage to winding 2 with the opposite polarity as before, we get one more step. 1/5/2011 [1] Simon, D., 2003, Get Your Motor Running, Embedded Systems Design, April 10, 2003 17 Stepper Motors [1] Obviously, some type of control circuit needs to be developed to control: The sequence of voltages applied to the windings The polarity of the voltages applied to the windings An AVR is perfect for the “heart” of the control circuit 1/5/2011 But, an AVR cannot provide enough current to the windings to turn the stepper motor An H bridge will need to be connected to each winding to provide the current [1] Simon, D., 2003, Get Your Motor Running, Embedded Systems Design, April 10, 2003 18 H-Bridge [2] This image shows two H-Bridges, one to control each of the two phases of the stepper motor. Note: +V can be whatever is required for the stepper motor and transistors. 1/5/2011 [2] Freescale, 2007, Stepper Motor, downloaded 3/16/08 from: http://www.freescale.com/webapp/sps/site/overview.jsp?nodeId=02nQXGrrlPZh3C 19 H-Bridge [2] This image shows two H-Bridges, one to control each of the two phases of the stepper motor. If a small voltage is applied to the bases of Q1 and Q4, then current will flow DOWN through phase 1. The AVR voltages are only used to turn on the transistors. The output port pins should be tied through a resistor to the base of the transistors. 1/5/2011 [2] Freescale, 2007, Stepper Motor, downloaded 3/16/08 from: http://www.freescale.com/webapp/sps/site/overview.jsp?nodeId=02nQXGrrlPZh3C 20 H-Bridge [2] This image shows two H-Bridges, one to control each of the two phases of the stepper motor. If a small voltage is applied to the bases of Q2 and Q3, then current will flow UP through phase 1. 1/5/2011 [2] Freescale, 2007, Stepper Motor, downloaded 3/16/08 from: http://www.freescale.com/webapp/sps/site/overview.jsp?nodeId=02nQXGrrlPZh3C 21 H-Bridge [2] This image shows two H-Bridges, one to control each of the two phases of the stepper motor. If a small voltage is applied to the bases of Q5 and Q8, then current will flow DOWN through phase 2. 1/5/2011 [2] Freescale, 2007, Stepper Motor, downloaded 3/16/08 from: http://www.freescale.com/webapp/sps/site/overview.jsp?nodeId=02nQXGrrlPZh3C 22 H-Bridge [2] This image shows two H-Bridges, one to control each of the two phases of the stepper motor. If a small voltage is applied to the bases of Q6 and Q7, then current will flow UP through phase 2. 1/5/2011 [2] Freescale, 2007, Stepper Motor, downloaded 3/16/08 from: http://www.freescale.com/webapp/sps/site/overview.jsp?nodeId=02nQXGrrlPZh3C 23 H-Bridge [2] In the lab we have used: 1. 2N3904 transistors 2. A 10 kΩ resistor between the base of the transistor and the output of the port. 1/5/2011 [2] Freescale, 2007, Stepper Motor, downloaded 3/16/08 from: http://www.freescale.com/webapp/sps/site/overview.jsp?nodeId=02nQXGrrlPZh3C 24 H-Bridge [2] In the lab we have used: 1. 2N3904 transistors 2. A 10 kΩ resistor between the base of the transistor and the output of the port. 1/5/2011 [2] Freescale, 2007, Stepper Motor, downloaded 3/16/08 from: http://www.freescale.com/webapp/sps/site/overview.jsp?nodeId=02nQXGrrlPZh3C 25 Controller Outputs Step 1: Transistors: 87654321 00001001 So, the sequence we need to repeat is: 1/5/2011 26 Controller Outputs Step 2: Transistors: 87654321 00001001 01100000 So, the sequence we need to repeat is: 1/5/2011 27 Controller Outputs Step 3: Transistors: 87654321 00001001 01100000 00000110 So, the sequence we need to repeat is: 1/5/2011 28 Controller Outputs Step 4: Transistors: 87654321 00001001 01100000 00000110 10010000 So, the sequence we need to repeat is: 1/5/2011 29 Controller Outputs Step 5: Transistors: 87654321 00001001 01100000 00000110 10010000 Etc. So, the sequence we need to repeat is: 1/5/2011 30 Controller Outputs Step 5: Transistors: 87654321 00001001 01100000 00000110 10010000 Etc. It appears that each pin in the output port will need a square wave output. All need the same frequency, and all will have a 25% duty cycle, but they will all be out of phase. 1/5/2011 31 Controller Outputs Port X b0 Port X b1 Port X b2 Port X b3 Port X b4 Port X b5 Port X b6 Port X b7 You have to leave the pulse high long enough for the stepper to move a step, but not too long if you want smooth movement. 1/5/2011 32 H-Bridge [3] Of course, you can always use an IC H-Bridge as shown above, but you will still need the square wave outputs. [3] Acroname Robotics, 2007, downloaded 3/16/08 from: http://www.acroname.com/robotics/parts/R27-18200.html 1/5/2011 33 Unipolar Stepper Motors [1] This is a wiring diagram of a unipolar stepper motor. As you can see the center tap of the winding also has a lead (C). 1/5/2011 [1] Simon, D., 2003, Get Your Motor Running, Embedded Systems Design, April 10, 2003 34 Unipolar Stepper Motors [1] This is a wiring diagram of a unipolar stepper motor. As you can see the center tap of the winding also has a lead (C). The controller circuit (and sequence of high/low outputs from the controller) is a little different. 1/5/2011 [1] Simon, D., 2003, Get Your Motor Running, Embedded Systems Design, April 10, 2003 35 Unipolar Stepper Motors [1] Black (+12 V) Red (Coil 1) Brown (Coil 3) Green (Coil 2) White (Coil 4) When connecting a stepper motor to a circuit, you should look up the specifications for that motor. The color codes above are typical but not necessarily correct for your stepper motor. 1/5/2011 [1] Simon, D., 2003, Get Your Motor Running, Embedded Systems Design, April 10, 2003 36 Unipolar Stepper Motors [1] Transistor Sequence: T1 T2 T3 T4 1 0 1 1 0 0 0 1 0 0 1 1 Etc. 0 1 1 0 Above is the sequence of outputs from the AVR port to get this type of motor moving. 1/5/2011 [1] Simon, D., 2003, Get Your Motor Running, Embedded Systems Design, April 10, 2003 37 Servo Motors [4] Servo motors may also be used in applications where exact positioning or speed is required. 1/5/2011 [4] Baldor Electric Company, Servo Control Facts 38 Servo Motors [4] Servo motors may also be used in applications where exact positioning or speed is required. Servo motors are actually an assembly of parts that include a motor, a control circuit, and a feedback device. 1/5/2011 [4] Baldor Electric Company, Servo Control Facts 39 Servo Motors [4] Servo motors may also be used in applications where exact positioning or speed is required. Servo motors are actually an assembly of parts that include a motor, a control circuit, and a feedback device. For speed control a tachometer would be used as the feedback device. If position control is needed, a position encoder would be used. There are several types of encoders including, absolute, directional, and incremental. 1/5/2011 [4] Baldor Electric Company, Servo Control Facts 40 Servo Motors [4] This is an example of an incremental encoder. As the motor shaft rotates, the disk also rotates. As the light shines through the disk and lines up with the grid assembly, light will strike the photo sensor. This produces a pulse, which can be counted 1/5/2011 [4] Baldor Electric Company, Servo Control Facts 41 Servo Motors [4] For our purposes, we need to know how to make the motor move, in this case, to a specific position. Our controller would only need to provide a pulse of the required duration to achieve the desired position. The values to the left are a good rule of thumb. To maintain this position, the pulse would have to be repeated at specified intervals. This information would be provided by the manufacturer. 1/5/2011 [4] Baldor Electric Company, Servo Control Facts 42 Servo Motors [4] This is an example of pulse width modulation (PWM). In this example, the motor would rotate at a rate defined by the voltage applied to it. The pulses of different widths would provide different average voltage values, thus producing different speeds. 1/5/2011 [4] Baldor Electric Company, Servo Control Facts 43 Servo Motors [4] Pulse frequency modulation (PFM) works in much the same way. Again, this motor would rotate at a rate defined by the voltage applied to it. The different frequency of pulses would also provide different average voltage values, thus producing different speeds. 1/5/2011 [4] Baldor Electric Company, Servo Control Facts 44 Summary We discussed the operation of a stepper motor We discussed a means to control a stepper motor We also discussed the operation of servo motors and: 1/5/2011 How to control speed How to control position 45