Nerd Girls Final Report - Nerd Girls Site Selection Page

advertisement
Light Circuit (Directionals and Hazard Lights):
The purpose of this circuit is to provide the driver with a means of warning other drivers
of her intended action. There are two switching capabilities included in this circuit,
directional signaling and hazard signaling. The directional signaling subcomponent
allows the driver to indicate the intended turning direction. The hazard signaling
subcomponent allows the driver to warn other drivers that her upcoming actions will vary
from what is expected.
The directional circuit is made up of two lights and a double-pull double-throw
switch. This switch allows the user to switch two lines to two different points and has
three positions, on-left, off, and on-right (Figure 1). This allows the driver to select one
of three options: right light flashing and left light off, both off, and right light off and left
light flashing (Figure 3).
Figure 1: Double-Pull Double-Throw Switch Functionality
http://www.1728.com/project2.htm
The hazard circuit is also made up of two lights and a double-pull double-throw
switch. However, in this instance the switch was modified to create two single-pull
single-throw switches. This modification allows the user to switch the switch into the
“on” position and activate both flashing lights (Figure 2). This switch was modified by
using only the pins marked with the WY and XZ as seen in figure 1 instead of using all
three pins on one side. When the switch was switched to the “on” position, both lights
flashed. Originally a single-pull single-throw was used (one line switched at one point),
however, this shorted the lights together due to the shared node. It was necessary to use a
double-pull double-throw switch in this instance avoid creating either a ground or a short
between the two lights. When such a connection was created, the directional portion of
Hesch, Mower, Smith
the circuit would not function properly because the lights would either be permanently
grounded or permanently powered.
The 555 Timer chip controls the flashing component of the circuit. A 555 timer
chip is a chip that provides an accurate and consistent timing mechanism for a circuit. It
is particularly convenient to use because its frequency can be controlled through the
alteration of the capacitive and resistive loads (Figure 3). The purpose of the pins are as
follows: pin 1- ground, pin 2- trigger, pin 3- output, pin 4- reset, pin 5- control voltage,
pin 6- threshold, pin 7- discharge, pin 8- power. The resistive (11 and 15 KΩ) and
capacitive (.47 μF) values chosen control the frequency of the flashes.
Figure 2: Diagram of Light Circuit
2
Hesch, Mower, Smith
Figure 3: Time Delay of the 555 Timer
http://www.national.com/ds/LM/LM555.pdf
Motor Control:
The motor controller circuit provides the means to control both the speed and
acceleration of each of the motors of the car (figure 7).
Figure 7: The Motor Controller
The pedal position (pedal potentiometer) and the revolutions per minute from the two
wheels provide the input. These inputs are translated into two distinct output
potentiometer values (external to the motor controller) that are used to stimulate their
respective motor controllers (figure 8).
3
Hesch, Mower, Smith
4
Figure 8: Motor Controller System Diagram
The principle input to this section is the acceleration pedal. The pedal contains a
potentiometer that provides a variable voltage source. This pedal, which has not yet been
purchased, should have 256 possible resistance values that will be activated by applying a
varying force to the pedal. These 256 resistance values translate into 256 different
voltage levels, which form a lookup table in the motor controller software. This lookup
table matches the input voltage level with an output potentiometer value and a desired
RPM value to be used as a safety check (Figure 9). The desired RPM should be
determined through an experimentation process. In this process the 256 output
potentiometer values should used as input to the purchased motor controller unit to
determine the corresponding RPM values of the physical motors associated with each
possible output potentiometer value. These trials would enable the Nerd Girls to
determine which RPM value should be expected given an input pedal potentiometer.
Figure 9: Functionality of the Motor Controller
While driving it is necessary to ensure that the two wheels of the vehicle are
rotating at the same rate. If they are not, there is a danger that car could begin to spin out
of control, endangering the driver. To maintain a constant wheel motion it is necessary to
check the revolutions per minute (RPM) against the expected RPM and against each
other (Figure 10).
Hesch, Mower, Smith
5
Figure 10: RPM Self-Validation
Each RPM is compared to the expected RPM value. If the two values match nothing is
done. If the two values are unequal the output potentiometer value of the motor is
checked. If this value does not match the assigned value, the output potentiometer value
is changed to reflect the expected potentiometer value. If the two values match then the
motor controller calibrations are unequal. In this case, the output potentiometer value
must be changed to reflect the inaccuracy of the motor controller. If the RPM is greater
than the expected RPM, the output potentiometer value is decremented. If the RPM is
less than the expected RPM, the output potentiometer is incremented.
The RPM of the two wheels are also checked to ensure a consistency of motion.
If the two wheels are allowed to rotate at different speeds it will be difficult to ensure a
continuous forward linear motion. The RPM values are compared. If the values are
equal, nothing is done. If the values are unequal and their difference is below a set
threshold and the potentiometer values are unequal, the higher potentiometer value is set
to the lower potentiometer value. If the potentiometer values are unequal, the
potentiometer value of the wheel with the higher RPM is decremented. If the difference
between the RPM of the two wheels is above a certain threshold, the power to the wheels
is cut to ensure driver safety (Figure 11).
Hesch, Mower, Smith
Figure 11: RPM Safety Check
This code has not been tested on either the physical motors or the digital
potentiometers because neither the motors nor the potentiometers have yet arrived. To
complete this section it is necessary to determine a method that can be used to write to
the potentiometers. The potentiometer ordered was the 256-tap digital
potentiometer, MCP42010-I/P-ND from Digikey. The datasheets of the potentiometers
can be found at
http://rocky.digikey.com/WebLib/Microchip/Web%20Data/MCP41XXX_42XXX.pdf.
After successfully determining how to write to the potentiometers it is necessary
to determine how the motors react to the potentiometer stimuli. This can be
accomplished by inputting the 256 output potentiometer positions to the motors to
determine the resulting revolutions per minute generated. After making this crude
calculation, it will be necessary to determine the RPM generated when the wheel rotates
6
Hesch, Mower, Smith
7
on the ground (instead of spinning in free air). This process will provide the constants
needed for the RPM regulation section of the code (figures 10 and 11). Through repeated
trials the relationship between output potentiometer and RPM can be determined and thus
the exact potentiometer changes necessary to modify the RPM a certain amount can be
determined. Once the expected RPM has been determined it will be necessary to
determine the appropriate threshold above which the motors should be stopped (figure
11) to ensure driver safety. This will have to be tested in a safe environment in which the
safety of the driver can be protected.
Download