Download as pdf or txt
Download as pdf or txt
You are on page 1of 35

Technical Manual

Track-Guided Autonomous Electric Vehicle


Publication Date: 20 April 2017

1
Table of Contents
Table of Figures..................................................................................................................................3
Safety Precautions and User Information............................................................................................4
General User Summary and Product Use............................................................................................5
Design Summary..................................................................................................................................5
Schematic of Entire System.................................................................................................................7
Complete Parts List..............................................................................................................................8
Autonomous Vehicle Chassis...............................................................................................................9
Power Management.............................................................................................................................10
Motor Control......................................................................................................................................13
Steering Control...................................................................................................................................15
Microcontroller Implementation..........................................................................................................17
State Machine Logic............................................................................................................................19
Optional Car Accessories.....................................................................................................................22
Software Package.................................................................................................................................24
Final Code............................................................................................................................................25

2
Table of Figures
Figure 1: Voltage Regulator Circuit ..............................................................................................10
Figure 2: LM317 Pinout...............................................................................................................10
Figure 3: Buck Converter Circuit.................................................................................................10
Figure 4: IRF540 Pinout...............................................................................................10
Figure 5: Servo Powering Circuit.................................................................................................10
Figure 6: Motor Control Circuit...................................................................................................13
Figure 7: Tachometer and Hall Effect Sensor Circuit..................................................................13
Figure 8: Inductive Steering Circuit.............................................................................................15
Figure 9: FRDM-KL25Z Microcontroller Pinout........................................................................17
Figure 10: State Machine Logic...................................................................................................19
Figure 11: Bumper Hardware Configuration...............................................................................20
Figure 12: Run/Wait Pushbutton Configuration.................. .......................................................21
Figure 13: OPB704WZ Arrowhead Sensor.................................................................................22
Figure 14: Arrowhead Sensor Schematic.22

3
Safety Precautions and User Information
Warning: Use of this product poses the risk of serious harm, and individuals under
the age of 18 should be properly supervised or trained to avoid the many dangers
associated with operation of this vehicle. Team Yes, Incorporated is in no way liable
for any damages, personal injury, or other accidents caused during the proper or
improper use of this product.
Battery Use
a. Always make sure the battery is properly charged. Use a controlled battery
charge, often termed a smart charger in marketplaces, to prevent overcharging
and potential damage to the battery. Overcharging of Lithium Polymer (Li-Poly)
batteries can lead to fires and personal injury. Follow all charging instructions for
your battery pack.
b. The battery should be securely connected to the battery terminal under the main
car platform before operation of the vehicle. The red and black wires from the
connector and the battery should match. If this precaution is not taken, damage to
the product will occur.
c. Make sure the battery is properly seated in its holder under the main vehicle
chassis. Failure to do so could lead to the battery slipping off of the car and
damaging the product.
d. To remove the battery, make sure the vehicle is turned off. Then disconnect the
battery from the battery connector.
e. Do not remove any electronic components from the vehicle while the battery is
still connected. Failure to follow this step could lead to electric shock and
resulting injuries or even death.
Vehicle Modifications
a. Team Yes, Incorporated is in no way liable for the result of any changes made to
the original product.
b. For testing and design improvements, the car should be powered off. The change
and the overall vehicle performance should be tested in a safe manner, such as
using blocks to prevent the vehicle from rolling.
c. Each vehicle subsystem operates under specific design limits and tolerances.
After any changes, voltage levels should be measured to ensure that no electronics
will be damaged.
Operating Conditions
a. Avoid the exposure of the vehicle to water or any other fluids, as this could
damage the electronics.

4
b. Always make sure to clear the track of any debris or objects to minimize the risk
of vehicle damage or personal injury. If following the vehicle around the track,
clear the area of any potential tripping hazards.
Additional safety hazards may exist. Be observant during use to create a safe
environment. Further use information can be found related to each vehicle subsystem in
the following Technical Manual documentation.

General User Summary


To use the Track-Guided Autonomous Electric Vehicle all you need is a few things.
Once your vehicle is constructed, you just need a track to run it on. The track used for our
vehicle emits a 20 kHz square wave signal at 1A. When the vehicle is finished it simply needs to
be turned on and you are ready to race!

Design Summary
The Track-Guided Autonomous Electric Vehicle was designed to be able to effectively
and quickly steer and navigate around a 90.9-ft track. In order to accomplish this objective,
several subsystems were designed, built, and tested. These major subsystems include: power
management, the drivetrain, sensing and navigation, steering, and the processing unit. A brief
overview of these subsystems will be given, followed later in this Technical Manual with a more
detailed breakdown of the system components, operation, and troubleshooting tactics.
The first subsystem is the power management subsystem, comprised of the battery, on/off
switching with an incorporated fuse, and on-board voltage regulators. The recommended battery
for the system is a 12.6V Rated Li-Poly battery. By activation of the switch, this battery voltage
can then power the vehicle motors and source the two voltage regulators. The first of these
voltage regulators powers the microcontroller and provides power for all sensing circuits, and
outputs at a constant 7.5V. The second voltage regulator powers the servo motor for steering, and
outputs at 5.1V.
The second subsystem, the drivetrain, consists of both electrical and mechanical
components in order to propel the vehicle forward along the track. The motors and supporting
power electronics consist of a dominant portion of this system, and include two permanent-
magnet DC (PMDC) motors controlled by the output of a Buck converter with motor driver chip
to isolate the system from the processing unit. The shafts of these motors are attached to
gearboxes that then turn the rear wheel shaft and turn the tires, propelling the vehicle forward.
The third subsystem, handling sensing and navigation, is comprised of many different
packages in order to handle the data acquisition needed for successful steering and navigation.
Two inductive sensing circuits are implemented with two inductors mounted to detect the 20 kHz
and 1 A square wave signal propagated by the center track wire. Additional hardware acts to
filter the signal and allows for steering control feedback. Navigation is also handled by two
arrowhead sensors. Utilizing an IR emitter and phototransistor, these sensors allow for detection

5
of reflective strips placed along the track that can be used to determine the position of the
vehicle. The final sensor circuit is the tachometer, which receives feedback from a Hall Sensor
attached to the wheel-axle assembly and outputs a DC signal dependent upon the vehicles
current speed, allowing for adjustments to the motor speed for more accurate control.
The steering subsystem consists of a Futaba S3010 Servo Motor that adjusts the angle of
the front axle to allow for turning of the vehicle. A full 45 rotation in both directions is possible
in this configuration.
The final subsystem, the processing unit, is comprised of the FRDM-KL25Z
microcontroller, an affordable development board equipped with an ARM processor. All
complete system state logic, communications, sensing data processing, and controller operations
are performed by this system, with code developed using the MBED compiler environment for
rapid code development. This subsystem can also communicate with a computer through the
incorporation of a Bluetooth system, allowing for vehicle diagnostics and operational data.

6
Schematic of Entire System

7
Complete Parts List
FRDM-KL25Z 1- 560 Resistor
2- DC Motor 1- 1.2k Resistor
1- S3010 Servo 2- 120 Resistor
1- SS451 Hall Effect Sensor 1- 10 Resistor
2- LM317T Voltage Regulator 1-560k Resistor
3- S10A60 Diodes 2- 330 Resistor
2- 1N226 Schottky Diodes 7- 1k Resistor
1- IRF540N 4- 10k Resistor
1- TC4428 1- 130 Resistor
1- LM2907 Frequency-to-Voltage 1- 290 Resistor
Converter 2- 100 Resistor
1- LM324 Op-Amp IC 2 - 100k Resistor
2- Arrowhead Sensors 2- 0.1uF Capacitor
2- Pushbuttons 4- 1uF Capacitor
4- LEDs 2- 680pF Capacitor
2- 100mH Inductors 3 Contact Switches
2- 270 Resistor 2 OPB-704 Reflective Sensor

8
Autonomous Vehicle Chassis

The chassis used as the base of the autonomous vehicle is a Freescale Cup Chassis. This chassis
is lightweight, yet capable of carrying all the necessary components without a significant impact
on the speed of the system. The chassis came fitted with two DC permanent magnet motors to
drive the back wheels; a Futaba S3010 Servomotor also came fitted to the chassis at the front
wheels. These motors are what propel and steer the car based on the subsystems to be discussed
further.

WARNING: It is not advised to make any significant alterations or adjustments to the chassis as
this could have a negative effect on the operation and run speed of the overall autonomous car
system.

9
Power Management

Figure 1: Voltage Regulator Circuit Figure 2: LM317 Pinout

Figure 3: Buck Converter Circuit Figure 4: IRF540 Pinout

10
Figure 5: Servo Powering Circuit

Materials:
2- Breadboard
22 Gauge Wire
2- LM317 Voltage Regulator
MBR1060
IRF540
Servo
10 Resistor
560 K Resistor
0.1 F Capacitor
1 F Capacitor
2 - 560 Resistor
270 Resistor
330 Resistor
1.2K Resistor

Procedure:
1. Construct the circuit in Figure 1 and 3 and securely attach the Breadboard to the car.
2. Make a common ground and voltage on the breadboard by attaching jumpers across the
terminals.
3. Attach the battery to the main power hookup already built into the chassis and place the
battery into the battery holding area beneath the Plexiglas panel.
4. Take the second breadboard and place it near or above the servo.
5. Construct the second voltage regulator for the servo as seen in Figure 5.

WARNING: If the output of the voltage regulator (from figure 1) is not approximately 5.1V
go back over the hardware configuration to verify that everything is connected properly.

11
WARNING: If the output of the voltage regulator (from figure 5) is not approximately 6V
go back over the hardware configuration to verify that everything is connected properly.
WARNING: Before first operation always double check the hardware configuration and
pinouts to prevent damaging parts and/or injuring yourself

12
Motor Control

Figure 6: Motor Control Circuit

Figure 7: Tachometer and Hall Effect Sensor Circuit

Materials:
LM2907 (Tachometer)

13
Hall Effect Sensor
TC4428
DC Motors
IRF540
MBR1060 Schottky Diode
1 K Resistor
10uF Capacitor
690 pF Capacitor
.1 uF Capacitor
1 uF Capacitor
10 K Resistor
56 K Resistor
560 K Resistor
10 Resistor

Procedure:
1. Assemble the circuits depicted in Figures 3 and 4.
2. Using the FRDM-KL25Z microcontroller and the MBED online compiler, write code to
send a PWM signal to control the power output to the motors based upon the duty cycle.
3. Create an AnalogIn pin object in the MBED software to read in the current speed from
the tachometer circuit.
4. Implement a user designed control algorithm to control the motor based upon the desired
speed and the current measured speed.
WARNING: Ensure that the output of the tachometer cannot exceed 3.3V. Anything over
3.3V will fry the microcontroller.

14
Steering Control

Figure 8: Inductive Steering circuit

Materials:
Breadboard
22 Gauge Wire
2- LM324 Op-Amp
2- 100mH Inductors
2- 680pF Capacitors
4- 1K Resistors
2- 1N5226 Zener Diodes
2- MBR1060 Shottky Diodes
2- 10uF Capacitors
2- 330 Resistors

Procedure:
1. Assemble the Inductive steering circuit above in Figure 5 and attach the breadboard to the
car. Try to position the inductors as close to the front of the car as possible and as low as
possible.
WARNING: Verify that the breadboards and inductors are securely attached to the car.
2. Attach the breadboard to the top of the car and attach the inductors with whatever method
works best for the specific car.
3. Ensure that the two inductors are mounted securely and equidistant from the center of the
car.

15
4. Use an oscilloscope or multimeter to measure the output levels of the sensors with the car
centered on the track. Account for any errors within the code using a scaling multiplier to
allow for accurate position monitoring.
WARNING: Make sure that when the car is sitting in the middle of the track that the
voltage of the left and right Inductor are the same.

16
Microcontroller Implementation

Figure 9: FRDM-KL25Z Microcontroller Pinout

Materials:
FRDM-KL25Z Microcontroller
USB-to-Mini USB cord
Soldering Iron and Solder
Headers
2 8 Pin
1 6 Pin
1 10 Pin
Safety glasses

Procedure:
1. In order to implement the microcontroller, various pins must be used. The best way to
make these connections is to solder header pins onto the board so that wires may be
easily connected to and removed from the microcontroller
WARNING: Always wear safety glasses when using the soldering iron. Not using
protective equipment can lead to serious injury and even blindness.

17
2. Create an account on http://www.developer.mbed.org/ in order to access their compiler;
this compiler will be used to develop all software used on the autonomous vehicle. Be
sure to test a simple program such as Blinky to ensure that your microcontroller is
working properly

Simple instructions can be found on http://www.developer.mbed.org/ to ensure your


microcontroller is properly updated.

3. The microcontroller should now be attached to the autonomous vehicle. Ideally, the
microcontroller should be placed on top of the chassis in a location that makes it easily
accessible as other subsystems will have to connect to it.

4. To power the microcontroller, a voltage regulator will be used to supply power from the
voltage source (battery). The output of this regulator should be connected to the Vin pin
of the microcontroller.

WARNING: The FRDM-KL25Z can only be powered by voltages in the range of 5V


9V. To ensure proper operation it is best to set the voltage regulator output to a voltage
in this range. Our team chose to power the microcontroller with 7.5V. Note: Always
ensure the microcontroller is properly grounded.

5. After ensuring the microcontroller is properly powered and grounded the code needs to
be compiled. Code generated on the mbed compiler can be uploaded to the
microcontroller via the USB to mini USB cable. The link to the compiler is
http://www.developer.mbed.org/compiler

18
State Machine Logic
Overview:
The state machine logic is an important and useful subsystem of the autonomous vehicle. As the
name suggests, the state machine gives a visual representation of which state the vehicle is in.
There are four states: RUN, WAIT, STOP, and OFF-TRACK; each state is discussed further
below. The figure below represents the logic between and transition between each state.

Figure 10: State Machine Logic

WAIT:
The WAIT state will be the initial state the vehicle is in when first turned on. In this state the
vehicle reads a high inductor voltage and is on the track; in this state the vehicle is waiting to
enter the RUN state. The WAIT state is represented visually when the yellow LED is lit.
RUN:
The RUN state is the state the vehicle will be in when it moving around the track. The vehicle
will always enter the RUN state from the WAIT state. In order to enter the RUN state, a push-
button is pressed sending the signal to enter the RUN state. The RUN state can be visually
represented by the green LED being lit.
STOP:
The STOP state is the state the vehicle will enter if it collides with an obstacle or another vehicle.
When entering the STOP state the DC motors will stop running in order to prevent the vehicle

19
from moving. This state is useful in order to protect the vehicle from further damage if it
collides with an object. To exit the STOP state, a reset button can be pressed that will send the
vehicle back into the WAIT state. The STOP state is represented visually by the red LED being
lit.
OFF-TRACK:
As the name suggests, the OFF-TRACK state occurs when the vehicle leaves the track
completely. In this case, the vehicle does not sense a high enough inductor voltage which will
trigger the OFF-TRACK state. When in OFF-TRACK the vehicle stops moving, similar to the
STOP state. The vehicle will reenter the WAIT state if it is placed back on the track, and a high
enough inductor voltage is sensed. The OFF-TRACK state is represented visually by the blue
LED being lit.
Materials:
3 bumper switches
2 push buttons
1 red LED
1 green LED
1 yellow LED
1 blue LED
4 1 k resistor
FRDM-KL25Z microcontroller
Procedure:
To implement the state machine logic, the vehicle needs the following circuitry:

Figure 11: Bumper Hardware Configuration

Figure 11 above shows the circuit used to implement the STOP state logic. The bumpers act as
simple switches that will trigger the STOP state when they are pressed. Position 2 on each
bumper switch is connected to the microcontroller. When the switch closes the microcontroller
registers a change in voltage across that pin and enters the vehicle into the stop state.

20
Figure 12:Run/Wait Pushbutton Configuration

Figure 12 above shows the circuit used to implement the RUN and WAIT states. The run button
sets the start logic equal to 1 which causes the vehicle to enter the RUN state. The wait/reset
button changes the reset logic equal to 1 and the start logic equal to 0. This is used to enter the
vehicle into the WAIT state. Each of these buttons is connected to a pin on the microcontroller
in order to interface with the rest of the car, the appropriate LEDs are also connected in order to
visually represent each state.
Finally, the OFF-TRACK state utilizes the steering control circuitry. Whenever the inductors on
that circuit both enter low-voltage the vehicle will enter the OFF-TRACK state. These are
connected to the microcontroller; as the microcontroller reads the low inductor voltage it sends a
signal to light the blue LED and stop the vehicle.

21
Optional Car Accessories
Binary Position Counter
A position counter is an incredibly useful accessory to implement in the autonomous vehicle
design. This counter works by counting strips of reflective tape across the track. The reflective
tape is either on the left or right side of the vehicle; a white reflective strip across the width of the
track represents the start/finish line. Every time the vehicle passes over another position the total
count increases by 1; when the car crosses the finish line the count is reset back to 0. The
reflective tape is counted using OPB704WZ Arrowhead Reflective Object Sensors. The sensors
detect a change in voltage as they pass over the reflective tape which sends a signal to the
microcontroller to add to the total position count.

Figure 13: Arrowhead sensor

This system is useful to implement as it allows for finer tuning of the vehicle at different points
cross the track. For example the position information can be used to increase speed on
straightaways or reduce speed but increase stability when going through the turns.
The counter implemented on our vehicle displays a visual representation of the count utilizing
binary. Four LEDs represent the 1, 2, 4, and 8 binary positions; different combinations of the
LEDs light up to represent the count position in binary. The circuit diagram for the arrowhead
sensor is displayed below:

Figure 14: Arrowhead Sensor Schematic

22
When the sensor triggers a change in the count the microcontroller sends a signal to the four
LEDs to light up to represent the current count. The LEDs in the state logic machine can also be
used for the binary counter. The physical set-up is the same, code just needs to be implemented
to account for the change in position.

23
Software Package
Software implemented in the autonomous vehicle design was developed using C++ on the mbed
compiler at http://www.developer.mbed.org/compiler. The final code used for the race is
presented at the end of this section.
Package Contents:
1. PI Motor Control
2. P+ Bias Steering Control
3. Position Counting and Landmark Detection
4. State Machine Logic

PI Motor Control
The DC motors used for propulsion of the vehicle are controlled using a Proportional-Integral
(PI) controller. As the tachometer system measures the speed of the vehicle, the error from the
desired speed can be determined and this error term is then multiplied by the proportional control
gain of 1.590. The integral term is determined by adding the integral control gain by the error
and the time step to the previous integral term, and acts to reduce the steady state speed error to
zero. The integral control gain, Ki, is equal to 41.107. By adding the proportional and integral
term, the desired control output can be determined, although it is limited by saturation levels of 0
and 1 for 0% to 100% output.
P+ Bias Steering Control
The steering control is implemented using a proportional plus bias control algorithm. The servo
motor is centered by a 7.5% duty cycle PWM signal, and this percentage acts as the bias term for
the controller. By subtracting right position from the left position measurement from the
inductive sensor packages, an error term can be generated, that is then multiplied by the
proportional controller gain, Kp. For the first two navigation positions on the track, this gain is
set to 0.07. For all other positions, the gain is set to 0.09.By addition of the bias with this product
term, the servo motor PWM duty cycle can be set for desired steering control.
Position Counting and Landmark Detection
The software package utilizes the binary position counter in order to keep track of the vehicles
position on the track. Four LEDs will light up to represent the vehicles position on the track in
binary. There are 10 positions on the track; the start/finish line will reset the position count to 0
and all LEDs will be turned off.
State Machine Logic
The state machine logic discussed earlier is implemented into the software package. LEDs are
used to visually represent which state the vehicle is in. When in the RUN state the LEDs will

24
light up based on the binary position counter. When in the WAIT state only the yellow LED will
be lit. When in the STOP state only the red led will be lit. Finally, when in the OFF-TRACK
state only the blue LED will be lit.

25
26
27
28
29
30
31
32
33
34
35

You might also like