Download Controls_Paper_4

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Power inverter wikipedia , lookup

Flexible electronics wikipedia , lookup

Fault tolerance wikipedia , lookup

Electrical ballast wikipedia , lookup

Ohm's law wikipedia , lookup

Three-phase electric power wikipedia , lookup

History of electric power transmission wikipedia , lookup

Ground loop (electricity) wikipedia , lookup

Power engineering wikipedia , lookup

Stray voltage wikipedia , lookup

Rectifier wikipedia , lookup

Electric motor wikipedia , lookup

Electric machine wikipedia , lookup

Brushless DC electric motor wikipedia , lookup

Electrical substation wikipedia , lookup

Voltage optimisation wikipedia , lookup

Commutator (electric) wikipedia , lookup

Circuit breaker wikipedia , lookup

Current source wikipedia , lookup

Surge protector wikipedia , lookup

AC motor wikipedia , lookup

Ground (electricity) wikipedia , lookup

Switched-mode power supply wikipedia , lookup

Two-port network wikipedia , lookup

Power MOSFET wikipedia , lookup

Earthing system wikipedia , lookup

Buck converter wikipedia , lookup

Brushed DC electric motor wikipedia , lookup

Variable-frequency drive wikipedia , lookup

Mains electricity wikipedia , lookup

Alternating current wikipedia , lookup

Transistor wikipedia , lookup

Resistive opto-isolator wikipedia , lookup

Network analysis (electrical circuits) wikipedia , lookup

Stepper motor wikipedia , lookup

Current mirror wikipedia , lookup

Induction motor wikipedia , lookup

Opto-isolator wikipedia , lookup

Transcript
Dissecting a Sandwich
Engineering 315
Control Systems
Mark Gordon
Abstract—This is an analysis of the robot called Sandwich. Sandwich is a line following
robot described by David Cook in the book Robot Building for Beginners. It uses
Cadmium Sulfide Photo-resistors as sensors and a comparator chip as the controlling
logic. Sandwich is a great learning tool for the introduction of robotics or to use for the
integration of Electrical Engineering with Mechanical Engineering.
Introduction
Robotics is a field that is going to be of great influence in the coming era.
Robotics will be to the twenty-first century what computers were to the twentieth.
Today, robots are used mostly by the government and industry. This is due mainly to the
cost of robotics. The government pays top dollar for robotics because it wants to push to
the forefront when it comes to areas such as space exploration, bomb disarment, and
military implications. Industry can afford to pay top dollar for robotics because it uses
the robot to do the same task millions of times before they have to get a new one. The
robot is considerably more consistent than human workers so it is worth the money to
buy a robot. However, since the technology used in robotics is improving at a rapid pace,
both in ability and price, more personal robotics will soon be realistic.
One problem that the robotics field faces is the interface between robot and
operator. However, even today robotics are being designed with this in mind and are
starting to appear in people’s households. The Roomba is a robotic vacuum that operates
with the push of a button. Rather than having a person program in the position of the
walls of a room, the Roomba just moves around until it believes it has covered the whole
area. This allows people to turn it on before they leave for work and empty it when they
get home. The Roomba is an example of robots that will complete common tasks that
many humans find remedial and boring. As computers grow faster and cheaper, robotics
will continue to push the front between what humans have to do and what they have can
have done for them.
Sandwich
Building a robot is a great way to learn about this exiting field. It also provides
hands on experience that intertwines engineering academics with the creativity of life. It
shows the connectivity of electrical engineering and mechanical engineering by
demonstrating how projects in life are not solely electrical or mechanical. Sandwich is a
great robot to learn about robotics with. It is fairly cheap and easy for people without a
machine shop to manufacture. The book “Robot Building for Beginners” explains how
each part of the robot functions with explanations about the various components used in
Sandwich. The feedback loop is simple but effective which makes it easy to understand
what is happening without the system being over simplified. Although there are not
many mechanical aspects of Sandwich that are closely examined, the book makes a few
key points such as the motors which is enough to show the integration between
concentrations.
Power Source
Robot building for beginners starts by building the circuit part by part on a
breadboard. The book suggests using an actual 9 Volt battery because Sandwich will
eventually run on a 9 Volt battery. However, this requires either buying a lot of batteries
or having a rechargeable battery and a battery charger. Instead, a 7.5 V transformer can
be used. While this provides less potential difference to drive the circuit, it is a suitable
voltage source if that fact is kept in mind.
Switch
Next a switch is added to the breadboard to control the circuit. This allows the
circuit to be shut off rather than disconnecting the power source whenever parts are
changed. The switch of choice is a single pole single throw. Since only an on/off switch
is needed, the other side is left open to simulate an off. This does the same thing as an off
switch would do by creating a connection when flipped one way and an open circuit
when flipped the other way.
LED
To tell if the circuit was working or not an LED is connected to the circuit to
display when it is ‘on’. Before this is done a resistor is added in series with the LED.
This reduces the current by adding a higher voltage drop across the circuit. Without this
the LED could be fried and the circuit would not work. One note, since LED’s are light
emitting diodes it does matter what end the high is connected to and what end the low is
connected to. The anode must be connected to the high and the cathode to the ground
side. These can often be told apart by a flat side of the led. This flat notch is on the
cathode side which also happens to often be the shorter of the two leads. Although using
the short/long cathode/anode detection method is usually correct, it should always be
checked before the LED is put into the circuit.
It will not hurt the LED, but an
unawareness of this difference cause the circuit to be taken apart when the only problem
was a backwards LED.
Back to the circuit: once this LED is installed it can be easily told if the circuit is
hooked up correctly or not. If the switch is on, so should the LED be. If it is on when the
switch is off, there is also a problem.
Trimpot
Next a trimpot is added to the circuit. This is mainly done for an understanding of
how trimpots work. Trimpots have three leads coming out of them. The center lead is
where the common input is delivered and a set resistance is distributed between the other
two leads. For instance, a 100kΩ trimpot (which is what is used) can be turned so the
resistances are distributed 100/0, 40/60, 50/50, 60/40, 0/100 or anywhere in between.
This can be used to dim or brighten the LED. The trimpot is connected to the high from
the switch (with the resistor to cut the current down before it) and to the LED circuit.
When the trimpot is dialed up (resistance up) the current is decreased and the LED is
dimmer. When the timpot is dialed down (resistance down) the current increases and the
LED is brighter. Once that is established another LED is added to the other side of the
timpot. This shows that when the timpot is turned one LED gets brighter as the other
LED gets dimmer.
Photoresistor
Once the concept of a trimpot is grasped the photoresistor is introduced.
Sandwich uses cadmium-sulfide photoresistors. The ones that Sandwich use have an
approximate range from 450kΩ when they are in complete darkness to 100Ω when they
are exposed to direct light. This provides a large range of voltage drops than can occur
across the resistors. Four photoresistors were connected (two on each side) in place of
the LEDs. Although the easy way to test the system (the LEDs) is removed, a DMM can
easily be used to see if the circuit is working or not.
However, there is another problem afoot. It would be desirable to have both sets
of resistors to be equal. The reason for this will become obvious in a bit, but the
important thing for now is obtaining this balance. This is where the trimpot comes in.
Since the two sets of photoresistors are connected to opposite parts of the trimpot, it can
be used to increase the resistance in comparison to the other set of photoresistors. It is
important to notice that the resistance of one set of photoresistors is not being decreased
while the other resistances are being increased. Rather the overall resistance from before
the trimpot to the ground is being changed. The trimpot cannot change the resistance of
the photoresistor; it can merely be added in various portions to even the resistances.
Comparator Chip
Although the resistances can be measured using the DMM, it is not an ideal way
to tune the system. Constantly measuring the resistances and then turning the trimpot
only to measure and turn again is not a good tuning method.
Instead, a voltage
comparator chip can be used. The chip that is used is the LM393 chip. It is a “Low
Power, Low Offset Voltage, Single Supply, Dual Differential Comparators” chip. This
merely means that it does not take a lot of power to run, it can sense a low voltage
difference, it is powered by the same source as the inputs (i.e. no internal battery), it can
be used as two separate comparators, and it triggers off of a voltage difference between
the inputs. One small problem with this comparator is that it only works on voltages less
than 1.5V. This has to do with the sensitivity of the chip; a chip could be designed with
high sensitivity and high voltages, but that would be increasingly expensive.
To test this chip and get a greater understanding of how it works a test circuit is
set up. This is not connected to the previous circuit containing the photoresistors. A
resistor is connected to high to pull down the current. This is then connected to a LED
which was connected to the first pin on the chip. For the first test, pin two was connected
to the power source and pin four was connected to ground. This put pin two at a higher
voltage (same as the battery) than pin one (brought down by the resistor).
The
comparator chip then makes pin four a ground which connects the LED circuit to the
ground turning the LED on. Next, pin two was connected to ground rather than the
battery. This made the voltage of pin one greater than that of pin two making the output
(pin four) to become a disconnect. Since no current can flow in the circuit, the LED was
not turned on. This will be the idea that drives the motors of Sandwich.
The two circuits are then integrated. Two wires run from the points before the
photoresistors to the comparator chip. This will ‘read’ the voltage at that point which is
the voltage drop over the two resistors for each of the systems. The voltages are then
compared by the comparator chip and the output is either ground or open. These wires
are also connected to the other side of the chip with the roles being reversed. This means
that there will always be one ground and one open created by the chip.
LED Circuits
To go with these outputs, two other circuits are made. They are very simple
circuits consisting of a wire from the battery connecting to a current limiting resistor and
then through an LED. The other ends of the LEDs are connected to outputs of the chip.
This allows the circuit to turn the LEDs on or off according to the voltage drop across the
photoresistors. When one set of photoresistors has a greater voltage drop across them,
the chip will create a ground on that side of the chip. That will ground the LED circuit
and allow the current to flow through the LED. The other LED circuit, however, will be
open and not allow the LED to light.
Since these voltages are coming from the
photoresistors it can make for a fun time. Just waving your finger over the resistors can
make a dazzling display of lights.
Transistors
The transistors that are used in Sandwich are 2907A transistors. The 2907A
transistor is a bipolar PNP general-purpose amplifier.
Bipolar is the type of
semiconductor it is. It is fairly resistant to static-electricity, it is fast, and it can deliver a
lot of current. The down side to bipolar semiconductors is that they use more energy than
other semiconductors do. PNP means that the transistor turns on when ‘negative power’
is supplied to it. General purpose means that it has similar properties as most other
transistors. It is not designed to be a low-noise, high-speed, or power transistor; it is
designed for general purposes. Amplifier simply means that it can amplify the signal that
it is given.
Transistors have three leads: emitter, base, and collector. When the base
lead is connected to negative power, the transistor is turned on. The way that sandwich
uses the transistors is to connect the output from the comparator to the base of the
transistor. When the comparator output is ‘negative’ (ground), the transistor will power a
circuit that includes LEDs and another one that will include the motors.
Now that a greater understanding of transistors has been reached, a test circuit can
be implemented. The collector of the transistor is connected to a resistor, a LED, and
then the ground in series while the base is connected to a resistor and the ground. On the
other hand, the emitter is connected directly to the source. When the circuit is in this
configuration the transistor is ‘on.’ The base is connected to ground and thus is a
‘negative voltage’ when compared to the power source. This allows the current to flow
through the LED and light it. This type of a circuit can be used to test if a transistor is
PNP or NPN. If it is a PNP it will light, but a NPN will not allow the LED to light. This
is due to the fact that the PNP is turned on by a negative voltage while the NPN is turned
off by it.
This transistor circuit is then integrated with the rest of the circuit. Instead of the
output of the comparator chip going directly to the LED as it previously did, it is run
through the base of the transistor. The emitter is then connected to the high voltage
source and the collector is connected to the LED circuit. This time the LED circuit has
been changed a little bit. Instead of being a resistor and a single LED, three LEDs are
wired in series. This will be used later and for now it makes a more visually dramatic
display. Now when the comparator chip outputs a ground, the base of the transistor is
grounded and allows the current to flow from the emitter, through the collector and on to
the LED circuit.
DC Motor
The next components to be investigated are DC motors. DC motors work due to
magnetism (specifically electromagnetism). They are mostly composed of three parts:
stator, rotor, and cap. The stator is a metal cup that contains two permanent magnets.
Unlike the other magnets in the motor, these are not dependent in the current that is
running through the motor.
The next part of the motor is the rotor. The rotor contains the rotor windings
which are wires that are wound around an iron core. This make an electromagnet out of
the iron core whose magnetization can be changed by merely changing the current
running through the wires. Also contained in the rotor is a commutator. This is the part
of the motor that will receive the power for the windings. Since the windings are
spinning, however, the wires cannot be directly attached to the outside voltage source.
The commutator spins between metal brushes that are attached to the cap.
The brushes are pieces of spring loaded metal that press against the commutator
and are connected to the battery. This allows for the current to run from the battery,
through the brushes, to the commutator, through the coils, and back again to the battery.
Since the commutator has to be connected to both ends of the windings it has to have two
connections to the brushes.
In fact this is what makes the motor work.
commutator turns it switches which brush it is in contact with.
As the
This switches the
potential back and forth from negative to positive. This switches the direction of the
current, which in turn switches the magnetization of the iron core.
When the motor is first turned on the iron core will be magnetized in a certain
way. It will be attracted to one of the permanent magnets and repelled by the other one.
This will cause the rotor to turn. However, once the rotor turns the commutator switches
which brush it is in contact with and the magnetization in the windings are reversed. This
means that the magnet that the core had just moved towards is now repelling it and the
opposite magnet is attracting it. This is what keeps the motor turning; the switching in
magnetization makes the rotor turn and the rotor turning makes the magnetization switch.
Sandwich requires a gearhead motor. This is required because most electrical
motors are designed to spin at rapid paces. They can be run at lower voltages to decrease
their speed, but DC motors should only be run between 50% and 125% of their optimal
voltage. Outside of these ranges the motor may cease to have enough momentum to keep
going or it may overheat. Since Sandwich does not want to end up stranded due to a
lower voltage being used, and he likes the additional torque generated by the gearhead
motors, a gearhead motor is used to drive the wheels. Although gearhead motors might
seem like a dream come true, there are some disadvantages to them as well. They
increase the noise generated by the motor, the mass of the motor, and decrease the length
the motor can be run before the battery needs to be recharged.
Gearhead motors are the same a normal motors only they have a gear reduction
built onto them. The gearbox is mounted directly on the motor shaft at the end of the
motor. This often offsets where the final shaft comes out. Instead of being directly
centered, it is often closer to the outside. While in some cases this might be annoying, for
Sandwich it is useful. The wheels need to be mounted a low as possible to keep
Sandwich off of the ground; the offset is used to do this.
Diode
Another thing associated with the motor is the introduction of a barrier diode.
This has to be implemented because Len’s Law says that ‘Nature abhors a change in
magnetic flux.’ If the power is shut off the current running through the motor stops as
well. This abruptly changes the magnetic field which is known as the magnetic flux. To
compensate for this there is a current that runs backwards through the circuit called backemf. If the diode is not in place, the transistor connected to the motor could be destroyed
due to the current being supplied to the collector. As mentioned earlier, diodes only let
current run through them in one direction. The diode is installed in parallel with the
motor so that normally there is no current running through it. However, when the circuit
is shut off and the current tries to run backwards through the circuit, the diode lets it run
in a loop through the circuit containing the diode and the motor (the resistance of the
collector of the transistor keeps the current from running through it). The voltage is
eventually dissipated and the circuit is fine.
The motor circuit is now ready to be connected to the rest of the circuit. It runs
off of the same transistor that as the LED circuits runs off of. When the LEDs are on, the
motor should be spinning. This is done by connecting the diode and motor parallel
circuit to ground on one end and the collector of the transistor on the other end. The
circuit is now complete.
Printed Circuit Board
The circuit has been completed, but it is still on the bulky breadboard. The circuit
needs to be transferred to a circuit board and wires. Circuit boards specifically designed
for Sandwich are sold by Solarbotics.com. This is a good way to build your first robot.
To some it seems like cheating because you are not etching your own board and to others
it seems too hard because you have to do the soldering yourself. However, it is good to
get another overview of how the circuit works through soldering the pieces on and it also
is good preparation for future robotic projects.
Soldering
Not only does the circuit board need to be assembled, but the motors, switches,
and battery snap need to be soldered. One thing that has not been mentioned up to this
point is a switch that will allow for Sandwich to follow either a dark line on light flooring
or a light line on dark flooring. This is important because you do not always have access
to a light floor where you are trying to give a demonstration. This change can be done
very simply though. The switch is put between the transistors and the motors. The
switch is a double pole double throw switch. Double pole means that it can control two
separate components and double throw means that it can make two different connections.
This means that the motors can be set to connect to either of the transistors to the motors.
Since switching the robot from following a light line to following a dark line merely
requires running the opposite motor; this switch solves all of the problems.
The rest of the soldering was very straight forward. The motors were connected
to Molex KK connectors as were the two switches (one off/on and one line switching)
and the battery snap. Molex connectors make disassembling the robot much easier.
Desoldering components when you want to take them off is not ideal, but the Molex
connectors can be taken off and put back on as frequently as needed.
Body
Now that the circuit is done, the body of the robot can be focused on. Although
any sized wheels would be fine to use, some will work better than others. The most
important feature is the diameter of the wheel. The speed of the motor can be obtained
from a tachometer so the speed of the robot can be calculated as a function of the wheel
size by
RobotSpeed
inches
 MotorSpeed( rpm)   WheelDiameter( inches )

. If Sandwich is made
 minute 
to go too quickly, it will not have enough reaction time to adjust to the sensors feedback
and it will go off course. If the wheels are too slow, Sandwich will be boring to watch
and it will test the viewer’s patience rather than the robot’s capabilities.
Wheels
Lego wheels are suggest for use because of their relative cheapness and ease in
changing. Lego wheels normally come with their own axels that allow them to be put on
and taken off of the robot so other wheels can be tried or if those wheels are needed for
another robot. They are also available in many different sizes so if Sandwich’s speed is
not what it should be, another size can be easily obtained and tried out.
The actual body of Sandwich, not to mention the inspiration for its name, is a
Ziplock sandwich container. This is chosen because it is cheap and easy to machine.
This is taken into account because most people do not have access to a full machine shop
to do their beginning robotics projects. It is also a very lightweight body; the heavier the
body is the more the motors will have to work to move the robot and it will drain the
batteries more.
Because of these factors the body was very easy to build. Holes are drilled in
what use to be the bottom of the container (which is the top of Sandwich) to mount the
circuit board upon. Nylon spacers and washers are used to hold the circuit board in the
correct place where the sensors are correctly placed. Holes are cut in the side so that the
two trimpots can be adjusted without taking the robot completely apart.
The two
switches are also mounted to the container for easy access. A hole was cut in the lid of
the container so that the sensors and headlights would not be blocked by the blue
covering. The motors are the hardest thing to mount.
Holes had to be drilled in the side
for the axel as well as the mounting holes. Once these were drilled the motor could be
mounted to the container. However, since the plastic used to construct the body is very
weak, the container starts to bend under the torque exerted by the weight of the motors.
To keep this from being a problem a brace is put between the two motors. An M&M
mini’s container is used because it is the correct size to fit nicely around the motors. This
keeps the motors parallel to the ground and the tires perpendicular to it.
Conclusion
Robotics, in general, is a great learning tool for the integration of engineering
disciplines. Sandwich, in particular, is a good example because the components are
simple enough that the overall design of the robot is easy to see without the
oversimplifying that occurs in many engineering programs. Sandwich can also be used
as an introduction into the exciting world of robotics which will play an ever increasing
role in the future of engineering. With the recent explosion in the power of computers,
robotics is set to have a profound affect on our society.