170 likes | 280 Views
DC Motor Control. The material presented is taken from a variety of sources including: http://www.compworks.faithweb.com/electronics/components/inductor001.html#howworks , and Building Robot Drive Trains by Clark and Owings. Voltage.
E N D
DC Motor Control The material presented is taken from a variety of sources including: http://www.compworks.faithweb.com/electronics/components/inductor001.html#howworks, and Building Robot Drive Trains by Clark and Owings
Voltage • A motor requires a power source within its operating voltage, i.e., the recommended voltage range for best efficiency of the motor. • Lower voltages will usually turn the motor (but provide less power). • Higher voltages, in some cases, can increase the power output but almost always at the expense of the operating life of the motor.
Current • When constant voltage is applied, a DC motor draws current in the amount proportional to the work it is doing. • For example, if a robot is pushing against an obstacle, it is drawing more current than when it is moving freely in open space. • The reason is the resistance to the motor motion introduced by the obstacle. • If the resistance is very high the motor draws a maximum amount of power, and stalls. This is defined as the stall current of the motor: the most current it can draw at its specified voltage.
Control • A microprocessor cannot drive the motor directly (Not enough current supply) • The motor power must come from another source; only control signals come from the microprocessor • Control Topics: • Basic H-Bridges • Isolation • Pulse-width modulation
H-bridge • The basic circuit for driving DC motors in both directions is an H-bridge. This circuit enables the motor to spin in either direction from a single power supply.
Noise • A DC motor can create a tremendous amount of power supply noise. Why? • Current demand: When a motor starts or changes direction, it draws a great deal of current almost behaving as a short circuit. • Commutator brush noise: As the brushes make and break contact with the communtator, power to the coils is switched on and off. As a result of inductance, the coils generate a brief high voltage spike as the current is switched off.
Inductance • An inductor resists change in current flow. • You learned that when current flows through a conductor, a magnetic field surrounds the conductive wire. The more current traveling through the wire the greater the amount of flux. What you didn't learn is that these lines of flux can generate voltage on surrounding conductors. • Induced voltage results from change in current flow. At steady state, the induced EMF collapses. • The voltage that appears in the inductor (i.e., the motor) is of opposite polarity to the original voltage and is called Counter Electro Motive Force (CEMF). • The faster the current changes, the larger the CEMF voltage. Spike of 20 times the original voltage can appear.
Pulse Width Modulation • Pulse width modulation is a technique for reducing the amount of power delivered to a DC motor. • Instead of reducing the voltage operating the motor (which would reduce its power), the motor's power supply is rapidly switched on and off. • The percentage of time that the power is on determines the percentage of full operating power that is accomplished.
PWM 75 50 25
Which PWM frequency is best • A wide range of frequencies could be used for the pulse width modulation signal. • Frequencies above 1K Hz are recommended. • Lower frequencies may resonate and cause your motor to vibrate.
Installing the Pololu serial motor controller • Place the controller on your breadboard and connect it to the BS2 and motors per the instructions in the user’s guide (Exercise 17).
Motor Controller Communication • The motor controller uses a serial interface to communicate with the Basic Stamp 2 (BS2). • You must program the BS2 to send data in the correct format the the contoller’s serial input, pin 4. • The controller expects 8 bits at a time at a constant baud rate ranging from 1200 to 19200 baud. • You must send the correct sequence of bytes to get the controller to run your motors.
The SEROUT command • The controller requires a non-inverted serial transmission at a baud rate between 1200 and 19200, 8 bits at a time with no parity. • The SEROUT command: SEROUT PIN#, 84, {OutputData} Provides that transmission at 9600 baud.
Configuring the Motor Controller • You can configure your controller to control either one or two motors.
Controlling the Motor • You can control each motor individually to run either forward or reverse at any one of 127 different speeds (from 0 to 127).