📄 introductionhardwaresoftwareresu.htm
字号:
well. Originally, in drive mode, the rear motor was constantly on. To slow the
car down, we sent a PWM signal to constantly turn the motor on and off. The
PWM slowed the car down to approximately half the original speed. Driving
slower, the sensors were then able to sense turns in the
track.</FONT></SPAN></P>
<P class=MsoNormal style="LINE-HEIGHT: 150%" align=justify><U><SPAN
style="FONT-WEIGHT: 700; LINE-HEIGHT: 115%; FONT-FAMILY: Palatino Linotype"><FONT
size=4>Relationship of your design to available IEEE, ISO, ANSI, DIN, and
other standards</FONT></SPAN></U></P>
<P class=MsoNormal style="LINE-HEIGHT: 150%" align=justify><SPAN
style="LINE-HEIGHT: 115%; FONT-FAMILY: Palatino Linotype"><FONT size=4>All
components used for our project has been approved by the IEEE compliance
standards and there are no standards that pertain to our
project.</FONT></SPAN></P>
<P class=MsoNormal style="LINE-HEIGHT: 150%" align=justify><U><SPAN
style="FONT-WEIGHT: 700; LINE-HEIGHT: 115%; FONT-FAMILY: Palatino Linotype"><FONT
size=4>Existing patents, copyrights, and trademarks which are
relevant</FONT></SPAN></U></P>
<P class=MsoNormal style="LINE-HEIGHT: 150%" align=justify><SPAN
style="LINE-HEIGHT: 115%; FONT-FAMILY: Palatino Linotype"><FONT size=4>There
are no relevant copyrights, patents, and trademarks for our project.
Line-following robots already exist without a patent and our car
implementation does not infringe upon any copyright or
trademark.</FONT></SPAN></P></BLOCKQUOTE>
<A
href="http://instruct1.cit.cornell.edu/courses/ee476/FinalProjects/s2007/bl222_wh84/bl222_wh84/index.html#top">Back
to Top</A>
<H1><FONT face="Palatino Linotype"><A id=hware></A>Hardware</FONT></H1>
<BLOCKQUOTE>
<P class=MsoNormal align=justify><FONT face="Palatino Linotype"
size=4><B><U>H-Bridge Circuit</U></B></FONT></P>
<P class=MsoNormal align=justify><FONT face="Palatino Linotype" size=4>We
implemented a full H-Bridge and a half H-Bridge to control the turning of our
motors. Since we needed our front motor to turn both directions for left and
right, we connected a full H-Bridge to the front motor, which allows us to run
the current in two different directions. Because we did not need our car to
drive in reverse, a half H-Bridge was sufficient to control the rear motor. A
schematic of our full and half H-Bridges are shown in figures 2 and 3
respectively.</FONT></P>
<P class=MsoCaption style="TEXT-ALIGN: center" align=center><IMG height=635
src="IntroductionHardwareSoftwareResu.files/HBridge.jpg" width=1069
border=0></P>
<P class=MsoCaption style="TEXT-ALIGN: center" align=center>Figure 2: H-Bridge
for Turning Motor</P>
<P class=MsoNormal align=justify><FONT face="Palatino Linotype"
size=4> The H-Bridge
design is essentially four switches, where the switch is a BJT. When the top
left and bottom right switches are turned on by a logic high from the MCU, the
current will flow from the battery source through the switches and will spin
the motor in one direction. When the top right and bottom left switches are
turned on, the current will flow the opposite direction through the motor.
This opposite direction of current flow causes the motor to spin the opposite
direction. When the two top switches are turned on and the bottom two switches
are turned off, it creates a short circuit across the motor. This short causes
the motor to spin in both directions and hence simulates braking or
deceleration. Although we could also stop the car by simply turning off all
the transistors, we noticed during testing that there would be a delay when
the steering motor turns off. Since we didn't want the car turning more
than it should, we added the braking logic so that there would be quicker stop
in the front motor. Switches on the same side (left or right) are never
turned. If they are turned on simultaneously, there will be a short circuit
across the power supply and will damage the circuitry as well as the power
source. </FONT></P>
<P class=MsoNormal style="TEXT-INDENT: 0.5in" align=justify><FONT
face="Palatino Linotype" size=4>Since the motor will be switching on and off
in two directions, protection diodes are needed across the collectors and
emitters of the BJTs to prevent inductive kickback that could damage the motor
and transistors. Fortunately, the TIP102s and TIP107s we chose already had
protection diodes built-in so there was no need for external protection
diodes. To ensure that the noise generated by the motor does not affect the
MCU power and ground, we used opto-isolators to turn on the BJTs. Ports A3 -
A6 are connected to the inputs of the opto-isolators, which isolate MCU power
and ground from the H-Bridge power and ground. To prevent too much current
flowing from the MCU ports into the input of the opto-isolators, 330Ω
resistors were connected to them to limit the current. We chose an
opto-isolator packaged with four units on a single chip to facilitate circuit
population. Each of the four opto-isolators for the full H-Bridge is connected
to the base of one of the four BJTs. Figure 2 shows which MCU ports are
connected to which BJT gate.</FONT></P>
<P class=MsoNormal style="TEXT-INDENT: 0.5in" align=justify><FONT
face="Palatino Linotype" size=4>The half H-Bridge was constructed much the
same way except it only used one NPN, one PNP, and two opto-isolators. Only
one control signal is required to turn both BJTs on and thus turn the motor
on. We did not implement braking for the rear motor because there was no need
for sudden braking. The input signal to the BJTs for the rear motor is
connected to Port B.3 on the MCU. The schematic of the half H-Bridge is shown
below in figure 3.</FONT></P>
<P class=MsoCaption style="TEXT-ALIGN: center" align=center><IMG height=617
src="IntroductionHardwareSoftwareResu.files/Half_Bridge.jpg" width=640
border=0></P>
<P class=MsoCaption style="TEXT-ALIGN: center" align=center>Figure 3: Half
Bridge for Rear Motor</P>
<P class=MsoNormal><B><U><FONT face="Palatino Linotype" size=4>H-Bridge
Testing and Results</FONT></U></B></P>
<P class=MsoNormal><FONT face="Palatino Linotype"
size=4>
Initially, we tried using NMOS transistors to construct our H-Bridge. In the
MOSFET H-Bridge design, the drains of the top two transistors were connected
to the positive end of the battery and sources of the bottom two transistors
were connected to the negative end of the battery. The sources of the top
transistors were connected to the drains of the bottom transistors and the
motor was placed between these two nodes. We applied 5V to the gates of the
top left and bottom right transistors to supply voltage to the motor. However,
the across the motor was consistently around 1V no matter how much voltage we
supplied to the H-Bridge. We had first supplied 5V to the H-Bridge with only
1V across the motor. We increased the voltage to the H-Bridge to 12V and the
we still measured 1V. We then realized that 5V was insufficient to put the
switching NMOS into saturation. Instead, the NMOS transistors were still in
the linear region and thus limited the current flow and thus limited the
output voltage. We raised the input voltage to the NMOS gates to 7V with a 5V
supply to the H-Bridge. This time, the NMOS transistors were in saturation and
the H-Bridge gave an output voltage of 4.6V. Although we had gotten our MOSFET
H-Bridge to work, the 7V needed to turn on the transistors posed a problem
since the MCU ports could only provide 5V when turned high. Also, when
we applied 7V to the MOSFETs, they became very hot and this would pose an
unacceptable risk to the user. Of course we could use heat sinks but
that would increase costs and make construction more inconvenient.
</FONT></P>
<P class=MsoNormal><FONT face="Palatino Linotype"
size=4> Due
to this problem, we decided to try using BJTs instead of MOSFETs for our
switching transistors. The two high side transistors were PNPs and the two low
side transistors were NPNs. We picked TIP102s for the NPNs and TIP107s for the
PNPs because they were both Darlington configurations, which have high current
gains, and they had protection diodes built-in. Furthermore, these BJTs came
in TO-220 packages which are easy to use on the protoboard. The 10kΩ
resistor between the output of the opto-isolator and the base of the BJT
limits the current that goes to the gate. According to the TIP102
datasheet, the max base current is 1 A but we decided to be more cautious and
use a large resistance value. </FONT></P>
<P class=MsoNormal><FONT face="Palatino Linotype"
size=4> We
tested the BJT H-Bridge by applying 5V to the top left and bottom right
opto-isolators and also supplying a separate 5V to the H-Bridge power supply.
This time, the voltage across the motor was approximately 4.6V so we were able
to see at least what we were supplying to the H-Bridge across the motor. We
then connected the H-Bridge to the motor, and the H-Bridge successfully
powered the motor. Since we wanted our car to run without being connected to a
power supply, we decided to power the H-Bridges using batteries. We initially
thought of using four AA batteries in series to provide 6V to the H-Bridges.
However, when we tested the car by supplying 6V to the H-Bridges using the
power supply, the car had difficulty fully activating the turning and driving
at the same time. The two motors needed at least 7V for them to run
simultaneously without problems. Therefore, we decided to power the H-Bridges
using a 9V battery. We initially tested running our car off of one 9V battery
but the car had difficulty driving because the battery was not providing
enough current. Thus, we connected a second 9V battery in parallel to supply
the H-Bridge with more current. With increased current, the car ran
normally.</FONT></P>
<P class=MsoNormal><B><U><FONT face="Palatino Linotype"
size=4>Phototransistors</FONT></U></B></P>
<P class=MsoNormal><FONT face="Palatino Linotype"
size=4> To detect
black lines on a white surface, we chose the QRB1114 phototransistor for its
low cost and easy implementation. The QRB1114 is a package consisting of an
LED and a phototransistor BJT. The transmitter is the LED, which emits
infrared light that reflects off a surface. The amount of reflected
light is measured by the BJT, which sinks more current to ground if it detects
more reflected light. White surfaces reflect light well whereas black
absorbs most of the light and thus very little is reflected back to the
receiver. A schematic of the sensor circuit is shown below in figure 4.
Note that the schematic for the photosensors is somewhat misleading. The
light from the LED does not directly activate the BJT, which is what happens
in an opto-isolator. Rather, the light reflects off a surface and
activates the BJT.</FONT></P>
<P class=MsoNormal> </P>
<P class=MsoNormal align=center> <IMG height=730
src="IntroductionHardwareSoftwareResu.files/photosense.jpg" width=640
border=0></P>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -