![]() |
||||||||||||||||||||||||||||||
Measuring RPM via Photo reflector
Computer
Interface
|
Stepper Motors and Stepper Driver Circuit When deciding how to move the robot through the house, the designers realized that precision movement would be necessary in order to avoid touching the walls and receiving penalties. In order to achieve the required precision in movement, it was decided that the robot would utilize stepper motors. The main benefit of stepper motors is that they are able to turn a specific number of degrees for every step. A four phase stepper motor has four coils that, when energized in a specific sequence, rotate a driving magnetic field which, consequently, rotates a set of permanent magnets. These permanent magnets are attached to a rotor which drives an output shaft. Thus, by pulsing the coils in a certain sequence, a clockwise or counterclockwise movement can be attained. The following table shows a typical stepping sequence for a four phase stepper motor:
A change in the coil states (ie. changing from state 2 to state 3 as shown above) results in a single step of the motor shaft. Direction is easily controlled by running through the above sequence either forward or backward. It should also be noted that the coils A and A' are always oppositely charged, as are coils B and B'. By inverting the signals going to coils A and B, the corresponding signals A' and B' can be attained. Thus, only two control lines are required to place the motor into any one of the 4 possible states. Even though this is an important consideration for certain applications, the controller used in this implementation has a sufficient number of lines to control each coil. Furthermore, because two of the coils are always energized at any given time, the rotor is held into place by the two magnetic fields and hence will not easily slip -- even when the motor is not turning. This is another benefit of stepper motors. Figure 2 provides an internal diagram of a typical four phase stepper motor. Figure 2: Internal Diagram of 4 Phase Stepper Motor The stepper motors used for this project were salvaged from surplus Epson printers. The steppers are designed to provide 1.8 degrees per step (or 200 steps per revolution) and supply a sufficient amount of torque. However, the current requirements of almost any motor are more than a digital output can provide. Because of this requirement, a transistor circuit is needed to drive the motor coils. The circuit shown in Figure 3 is used to drive the motor coils. Because there are a total of eight motor coils in the robot, eight of these circuits are needed. The circuit functions by receiving a digital input from the microcontroller. This signal is fed to an optoisolator in order to separate the low-voltage, low-current microcontroller from potentially dangerous signals in the motor driver circuit. In other words, the optoisolator allows the 68HC12 to control the motors without any physical connection to the driver circuit. The output side of the optoisolator then drives the base of the TIP112 driver transistor. Just as the stepper motors were, the TIP112 transistors were salvaged from the Epson printers. The TIP112 power transistors are able to supply 50 watts of power, which is more than sufficient to drive the stepper motor coils.
When the microcontroller outputs a digital low signal (logic 0), the output side of the optoisolator acts as an open circuit (ie. no current flows into the collector). The remaining current path is then from Vcc through the pull-up resistor and into the base of the TIP112 driver transistor. This effectively turns the transistor on so that current can flow from collector to emitter. Clearly, current will flow from the 7.2V battery, through the motor coil, into the collector of the TIP112, and to the emitter ground. Hence, when a logic 0 is sent from the 68HC12 to a given driver circuit, the corresponding coil will become energized. Inversely, when the microcontroller outputs a digital high signal (logic 1), current will flow from collector to emitter in the output of the optoisolator. This will restrict current from flowing into the base of the driver transistor -- causing it to be turned "off". When the driver transistor is "off", there is no path to ground and thus the coil will not be energized. The current dissipating diode (or "free-wheeling diode") D1 is used so that the current stored in the motor coil does not damage the power transistor. When the transistor is turned off, the large magnetic field stored in the motor coil could generate a current spike through the collector to ground. The diode, however, will allow this potentially dangerous current to flow around the motor coil until it has been dissipated. The diode also helps to reduce the time it takes for the motor coil to switch from an "on" state to an "off" state. The speed at which a stepper motor can reliably rotate is relative to the amount of time it takes for a motor coil to switch states. By reducing the transition time, the stepper motor can be driven at higher frequencies resulting in a higher velocity. A small resistor in series with diode D1 has also been added to help reduce the transition time of the motor coil. The shaft of each stepper motor is mounted directly to a 4" diameter rubber wheel. The wheels were purchased at a local hobby shop and provide a sufficient amount of friction with the floor of the house. In order to calculate how much the robot will move with each step of the motor, the following equation for arc length can be used: Length = radius x angle, or
|
|||||||||||||||||||||||||||||