Professional Documents
Culture Documents
Control System
Control System
A current-
carrying conductor generates a magnetic field; when this is then placed in an external
magnetic field, it will experience a force proportional to the current in the conductor,
and to the strength of the external magnetic field. As you are well aware of from
playing with magnets as a kid, opposite (North and South) polarities attract, while like
polarities (North and North, South and South) repel. The internal configuration of
a DC motor is designed to harness the magnetic interaction between a current-carrying
conductor and an external magnetic field to generate rotational motion.
Every DC motor has six basic parts -- axle, rotor (a.k.a., armature), stator,
commutator, field magnet(s), and brushes. In most common DC motors (and all
that BEAMers will see), the external magnetic field is produced by high-strength
permanent magnets1. The stator is the stationary part of the motor -- this includes the
motor casing, as well as two or more permanent magnet pole pieces. The rotor
(together with the axle and attached commutator) rotate with respect to the stator. The
rotor consists of windings (generally on a core), the windings being electrically
connected to the commutator. The above diagram shows a common motor layout --
with the rotor inside the stator (field) magnets.
You'll notice a few things from this -- namely, one pole is fully energized at a time
(but two others are "partially" energized). As each brush transitions from one
commutator contact to the next, one coil's field will rapidly collapse, as the next coil's
field will rapidly charge up (this occurs within a few microsecond). We'll see more
about the effects of this later, but in the meantime you can see that this is a direct
result of the coil windings' series wiring:
Luckily for you, I've gone ahead and done this in your stead. The
guts of a disassembled Mabuchi FF-030-PN motor (the same
model that Solarbotics sells) are available for you to seehere (on
10 lines / cm graph paper). This is a basic 3-pole DC motor, with 2
brushes and three commutator contacts.
The use of an iron core armature (as in the Mabuchi, above) is quite common, and has
a number of advantages2. First off, the iron core provides a strong, rigid support for
the windings -- a particularly important consideration for high-torque motors. The
core also conducts heat away from the rotor windings, allowing the motor to be driven
harder than might otherwise be the case. Iron core construction is also relatively
inexpensive compared with other construction types.
But iron core construction also has several disadvantages. The iron armature has a
relatively high inertia which limits motor acceleration. This construction also results
in high winding inductances which limit brush and commutator life.
The coreless design also allows manufacturers to build smaller motors; meanwhile,
due to the lack of iron in their rotors, coreless motors are somewhat prone to
overheating. As a result, this design is generally used just in small, low-power
motors. BEAMers will most often see coreless DC motors in the form of pager
motors.
Motor
Servos have small electric motors in them that provide power. The motor has a rotor with two attached
to it, one on either side. There are two magnets outside of the motor, also on either side. When current
flows through both coils, a magnetic field which turns the rotor so that they face the magnets. When the
coils pass their magnets, they get another pulse of electricity, pushing them towards the other magnet.
The rotor gets two strong pushes every rotation, which keep it turning. The motor is attached by gears to
the control wheel.
Control Wheel
The control wheel is where the servo motor attaches to whatever control mechanism it is powering. It
usually can turn 90 degrees in either direction from the starting position for a total of 180 degrees of
movement. The control wheel uses a potentiometer to tell exactly how far it has turned and when to stop.
The potentiometer is a variable resistor, a device which creates electricity. As the motor turns, the
potentiometer creates more or less resistance. By measuring the potentiometer, the servo controller can
tell how far it has turned and send a signal to tell it when to stop.
Controlling the Servo
Servo motors usually have three wires, two which provide power and one which provides a control
signal. The control signal uses pulse width modulation. It sends pulses of electricity to the servo every 20
milliseconds. The duration, or "width", of each pulse tells the motor what position to turn to. The motor has
control circuitry inside that sends signals to move into position and to stop once it gets there.
A servo motor consists of several main parts, the motor and gearbox, a position sensor,
an error amplifier and motor driver and a circuit to decode the requested position. Figure
1 contains a block diagram of a typical servo motor unit.
The radio control receiver system (or other controller) generates a pulse of varying
length approximately every 20 milliseconds. The pulse is normally between 1 and 2
milliseconds long. The length of the pulse is used by the servo to determine the position
it should rotate to.
Figure 1. Servo Motor Block Diagram
Starting from the control pulse we will work though each part of the diagram and explain
how it all fits together. Once we have gone through how the servo works we will
investigate how the control pulses can be generated with a microcontroller.
The control pulse is feed to a pulse width to voltage converter. This circuit charges a
capacitor at a constant rate while the pulse is high. When the pulse goes low the charge
on the capacitor is fed to the output via a suitable buffer amplifier. This essentially
produces a voltage related to the length of the applied pulse.
The circuit is tuned to produce a useful voltage over a 1ms to 2ms period. The output
voltage is buffered and so does not decay significantly between control pulses so the
length of time between pulses is not critical.
Position Sensor
The current rotational position of the servo motor output shaft is read by a sensor. This
is normally a potentiometer (variable resistor) which produces a voltage that is related to
the absolute angle of the output shaft.
The position sensor then feeds its current value into the Error Amplifier which compares
the current position with the commanded position from the pulse width to voltage
converter.
Error Amplifier
The error amplifier is an operational amplifier with negative feedback. It will always try to
minimise the difference between the inverting (negative) and non-inverting (positive)
inputs by driving its output is the correct direction.
The output of the error amplifier is either a negative or positive voltage representing the
difference between its inputs. The greater the difference the greater the voltage.
The error amplifier output is used to drive the motor; If it is positive the motor will turn in
one direction, if negative the other. This allows the error amplifier to reduce the
difference between its inputs (thus closing the negative feedback loop) and so make the
servo go to the commanded position.
The servo normally contains a single integrated circuit and a hand full of discreet
components to implement the entire control system.
From the above we can determine that we need to generate a pulse approximately
every 20ms although the actual time between pulses is not critical. The pulse width
however must be accurate to ensure that we can accurately set the position of the
servo.
PWM modules
Many microcontrollers are equipped with PWM generators and most people initially
consider using these to generate the control signals. Unfortunately they are not really
suitable.
The problem is that we need a relatively accurate short pulse then a long delay; and
generally you only have one PWM generator share between several servos which
would require switching components outside the microcontroller and complicate the
hardware.
The PWM generator is designed to generate an accurate pulse between 0% and 100%
duty cycle, but we need something in the order of 5% to 10% duty cycle (1ms/20ms to
2ms/20ms). If a typical PWM generator is 8 or 10 bits say, then we can only use a small
fraction of the bits to generate the pulse width we need and so we loose a lot of
accuracy.
Timers
A more beneficial approach can be implemented with simple timers and software
interrupts. The key is realising that we can run a timer at a faster rate and do a single
servo at a time, followed by the next and the next etc. Each of the outputs is driven in
turn for its required time and then turned off. Once all outputs have been driven, the
cycle repeats.
The timer is configured so that we have plenty of accuracy over the 1 to 2 millisecond
pulse time. Each servo pin is driven high in turn and the timer configured to interrupt the
processor when the pulse should be finished. The interrupt routine then drives the
output low.
For simplicity, the output pins can be arranged on a single port and the value zero
(0x00) written to the port to turn off all pins at once so that the interrupt routine does not
need to know which servo output is currently active.
After the pulse has ended, the microprocessor sets up the next pulse and begins the
process again.
A current sensor is a device that detects electrical current (AC or DC) in a wire, and generates a signal
proportional to it.
AC current input,
analog output, which duplicates the wave shape of the sensed current
bipolar output, which duplicates the wave shape of the sensed current
unipolar output, which is proportional to the average or RMS value of the sensed current
DC current input,
unipolar, with a unipolar output, which duplicates the wave shape of the sensed current
digital output, which switches when the sensed current exceeds a certain threshold
A metal detector is a device which responds to metal that may not be readily apparent.
The simplest form of a metal detector consists of an oscillator producing an alternating current that
passes through a coil producing an alternating magnetic field. If a piece of electrically conductive metal is
close to the coil, eddy currents will be induced in the metal, and this produces an alternating magnetic
field of its own. If another coil is used to measure the magnetic field (acting as a magnetometer), the
change in the magnetic field due to the metallic object can be detected.
The first industrial metal detectors were developed in the 1960s and were used extensively for mining and
other industrial applications. Uses include de-mining (the detection of land mines), the detection of
weapons such as knives and guns, especially in airport security, geophysical prospecting, archaeology
and treasure hunting. Metal detectors are also used to detect foreign bodies in food, and in
the construction industryto detect steel reinforcing bars in concrete and pipes and wires buried in walls
and floors.
A gas detector is a device which detects the presence of various gases within an area, usually as part of
a safety system. This type of equipment is used to detect a gas leak and interface with a control system
so a process can be automatically shut down. A gas detector can also sound an alarm to operators in the
area where the leak is occurring, giving them the opportunity to leave the area. This type of device is
important owing to the fact that there are many gases that can be harmful to organic life, such
as humans or animals.
Gas detectors are usually battery operated. They transmit warnings via a series of audible and visible
signals such as alarms and flashing lights, (sometimes using LED technology), when dangerous levels of
gas vapors are detected. As detectors measure a gas concentration, the sensor responds to a calibration
gas, which serves as the reference point or scale. As a sensor’s detection exceeds a preset alarm level,
the alarm or signal will be activated. As units, gas detectors are produced as portable or stationary
devices. Originally, detectors were produced to detect a single gas, but modern units may detect several
toxic or combustible gases, or even a combination of both types. [1]
A leaf sensor is a phytometric device (measurement of plant physiological processes [1]) that measures
water loss or the water deficit stress (WDS) in plants[2] by real-time monitoring the moisture level in plant
leaves. The first leaf sensor was developed by LeafSens, an Israeli company who were granted a US
patent for a mechanical leaf thickness sensing device in 2001. [3] LeafSen has made strides incorporating
their leaf sensory technology into citrus orchards in Israel. [4] A solid state smart leaf sensor technology
was developed by the University of Colorado at Boulder for NASA in 2007. It was designed to help
monitor and control agricultural water demand.[5] AgriHouse received a National Science Foundation
(NSF) STTR grant in conjuction with the University of Colorado to further develop the solid state leaf
sensor technology for precision irrigation control in 2007. [6]
A flow sensor is a device for sensing the rate of fluid flow. Typically a flow sensor is the sensing element
used in a flow meter, or flow logger, to record the flow of fluids. As is true for all sensors, absolute
accuracy of a measurement requires a functionality for calibration.
There are various kinds of flow sensors and flow meters, including some that have a vane that is pushed
by the fluid, and can drive a rotary potentiometer, or similar device.
Other flow sensors are based on sensors which measure the transfer of heat caused by the moving
medium. This principle is common for microsensors to measure flow.
Flow meters are related to devices called velocimeters that measure velocity of fluids flowing through
them. Laser-based interferometry is often used for air flow measurement, but for liquids, it is often easier
to measure the flow. Another approach is Doppler-based methods for flow measurement. Hall effect
sensors may also be used, on a flapper valve, or vane, to sense the position of the vane, as displaced by
fluid flow.