RC Car - UCF EECS
Download
Report
Transcript RC Car - UCF EECS
Project Overview
Autonomous valet parking vehicle with search,
park, and return functionality
Provides a low cost solution to automatic valet
parking with potential use in real world
vehicles
Cars with this functionality would have their
own designated row of spaces
Requirements
Front-end parking
Carpeted surface with no incline
Avoid objects in path
Parked centered in space
All parking spaces uniform and designated
Return to drop-off position
Low cost to implement
Simulate potential real world environment
Battery powered
Specifications
Maximum RC car dimensions: 20”L x 6”W
Max Speed: 6 mph
Max search and park time: 5 minutes
Max pull out and return time: 5 minutes
Parked front end clearance: 3 in
Safe distance from obstacle in park search
mode: 10 in
Safe distance from obstacle in park mode: 3 in
Max cost: $400.00
Testing Area Specifications
Real World Measurements
Typical parking space
240 in L x 94.8 in W
Dimensions of average mid-sized car
181.4 in L x 70.2 in W
Scaled Down Testing Area Measurements (1:10)
Parking space
24 in L x 9.5 in W
4 inch clearance between cars
12 spaces total – 6 on each side
Total parking lot dimensions: 60 in L x 96 in W
48 inches will separate left and right spots
Components Overview
RC car platform
DC motor for forward and reverse propulsion
Steering servo for left and right maneuvers
Power Supply
Transmitter/Receiver pair
Obstacle avoidance sensors
Microcontroller
RC Car Comparison
Hobby grade RTR car
Fully proportional steering
Large, full function, but didn’t fit
budget
RTR car
Left/Right /Center steering
Purchased: Mercedes AMG R/C
Car (1:10 scale)
Large and fit budget
Dimensions: 18.125 in L x 7.5 in W
x 5 in H
Motor
Requirements:
Bi-directional
Speed control
Speed less than 6 mph
Utilize existing motor in R/C car
Operating voltage: 2.5 to 6V
Max speed: 5 mph (existing load)
Motor Control Options
Controlling the direction of motor rotation
is achieved by implementing an H-bridge
Manually build H-bridge with BJT or
MOSFET
2PNP
2 NPN
Diodes
Resitors
Implement Dual H-bridge IC
Chose: SN754410
4 drivers (2 bi-polar channels)
1A max per channel
Supports: 4.5V-36V
Built in clamping diodes
Thermal shutdown
H-bridge Implementation
SN754410
Utilize pins 1-8 and 16
MCU PWM to Pin1
Vcc2 Existing Power 7.2V
Vcc1 Secondary Power 5V
Pins 2 & 7 MCU input
Pins 3 and 6 Motor leads
Steering Servo
R/C car’s existing servo
6-wire servo motor
with potentiometer
4 Control lines
Blue - left
Yellow - right
Brown - always low
White – always high
2 Power leads
Will be controlled by
microcontroller
Transmitter & Receiver
Motivation:
Basic functionality
Send signal to begin parking spot search
Send signal to pull out of parking spot and
return to point of origin
Allows for expansion if different wireless
features want to be added
Transmitter & Receiver
Methods Considered
Bluetooth
Too expensive to implement
Infrared
Poor range
Wi-Fi
Components needed to implement system are too large
Chose: RF
Good range
Easy to implement on microcontroller
RF Transmitter
MO-SAWR-A
Transmits at a frequency
of 315Mhz
Range up to 500 ft.
No line of sight needed for
transmission
Common in car alarm
remotes, beepers, and
many similar devices
Operating voltage: 2 to 12v
RF Receiver
MO-RX3400-A
Receives signal at 315Mhz from
RF transmitter
Range of up to 500 ft.
Common in car alarm remotes,
beepers, and many similar
devices
Operating voltage: 5V
Current draw: 2.3 to 3 mA
Digital signal to
to microcontroller for easy
data processing
Sensors Considered
Infrared Sensors
Sharp IR GP2D12 Sensor
450 –750 nanometer range of visible light
Covers a range of 10 to 80cm with a optimized distance of 24cm
Operating Voltage: 0.3 to 7 volts
Max current draw: 10mA
Imaging Sensors
TSL 1401 Linescan Imaging Sensor Daughterboard
128-pixel sensor chip
7.9mm focal length imaging lens
Operating voltage: 3.3 to 5 volts.
Max current draw: 5mA
Sensors Considered cont’d
Ultrasonic Sensors
Chose: Ping Ultrasonic Range Finder
Emit a short 40 kHz signal
Range 0.8 in to 118.8 in (3.3 yd)
Operating Voltage: 5 volts
Max current draw: 35mA
Sensors
Advantages and Disadvantages
Ultrasonic sensor
Fastest response time at 115 us up to 18.5 ms
Smallest at 0.84 in W x 1.8 in L
Best range at 0.8 in to 118.8 in
Infrared sensor
Poor range
Imaging sensor
Poor range
Slow response time
Expensive
Ultrasonic Sensor
Considerations
The sensor must be
mounted perpendicular to
the floor for accurate
performance
Echo-free environment for
the most accurate readings
The object that the sensor
will detect has to be large
enough for the ultrasonic
waves to deflect off of it
Ultrasonic Sensor Mounting
The small size of the sensors
make it easy for mounting onto
the frame of the car
There will be three sensors
mounted on ParkBot one in
the front and one on each side
of the car
These sensors will be
connected in series to keep the
current draw low
Sensors will be mounted at
different heights to determine
optimal height
Power Supply
It was decided to divide the power system into
two parts:
One for the drive and servo motors
The other for remaining components
Voltage (V)
Current (mA) Power (mW)
Sensors (x3)
5
105
525
MCU
5
0.2
1
H-bridge VCC1 5
70
350
Receiver
5
3
15
H-bridge
VCC2
7.2
1000
7200
Servo
6
500
3000
Voltage Regulation
Required to regulate a voltage of 5VDC for the
components operating at this voltage and the logic
part of the H-Bridge(VCC1)
Required to regulate a voltage of 6VDC for the
front motor(servo/steering) with high current
Decided to use a simple linear regulator for the
5VDC and a variable regulator for the 6VDC
The components operating at 5VDC are not going
to draw much current so the dissipated power at
the regulator is not going to be large.
(7.2-5)V*107.5mA=2.2*107.5=236.5mW
For the 6VDC regulator the amount of current
draw will be about 1000m
(7.2-5)V*1000mA=2.2*1000=2.2W
For the 5VDC regulator a LM7805 IC is going to be
used, and for the 6VDC a LM 317t
Voltage Regulation
LM317
VOUT = 1.25 * ( 1 + R2/R1
)
R2 = R1 * ( (VOUT/1.25) -1
)
R1=240, R2=910 Vin=7.2
Vout = 6Vd
LM7805
Power 4
components
Connected from the
7.2v battery
Power Supply 1
Chose: Tenergy 7.2V Ni-MH 3000mAh
battery
The battery will be connected to a LM317
variable voltage regulator to power the
steering servo motor and rear motor
The battery was chosen based on the
amp/hours and volts needed to properly
operate the steering servo and rear motor
In charge of powering the rear motor and
steering servo
7.2v NiMH
H-Bridge
SN754410
VCC2
LM317
6VDC
Rear Motor
F/B
Steering
Servo
Power Supply 2
Came with the RC car
7.2v 700mAH Ni-Cd battery pack
It will be in charge of powering the additional components added to the
car
It will be connected to a LM7805 linear voltage regulator. Regulates
voltage to 5V. This will power:
Ultrasonic Sensors, RF Receiver unit, H-Bridge chip Vcc1 Logic, and
microcontroller
Microcontroller
7.2v NiCD
Sensors
LM7805
5VDC
RF Receiver unit
H-Bridge VCC1 logic
MCU Requirements
I/O pins needed:
4 digital (for obstacle avoidance sensors and RF receiver)
3 digital PWM (for DC motor control and servo control)
Open source
Well documented with online examples
Uses a familiar programming language
Sufficient memory and processing power
Operating voltage of 5V
Chose: Atmel ATMega328
MCU Specifications
Atmel ATMega328
With Arduino
Bootloader for use with
the Arduino language
Arduino language based
on C/C++
Max frequency: 20MHz
32KB of program space
23 I/O Pins
Operating Voltage: 5V
Pin Configuration Overview
Overall MCU Diagram
Programming the MCU
Use a SFE FTDI USB to
Serial Basic Breakout
Board that interfaces with
the MCU
Optimized to work with 5V
Arduino boards and cloned
5V Arduino boards
Easy loading of code onto
MCU through USB port on
PC
Cheaper than buying USB
to serial converter cable
($33 vs. $14)
PCB
We decided to go with a 28
pin development board
perfect for the Atmega328
microcontroller.
We will solder the PCB
after successful testing of
the implemented parts on
the board
Optimized Arduino
configuration will be used
for maximum perfomance
for our system
Size: 5" x 3.7" (127 x
93.98mm)
Parking Spot Search Algorithm
Wait for signal
to begin execution
Front
obstacle distance
< 10 in.?
YES
YES
NO
# of
occupied spots
> 7?
Check front sensor
at 2 Hz
NO
YES
Three point turn
and return
to starting
point
NO
Check parking
spot to the
left
NO
ParkBot moves
forward 9.5 inches
to parking spot
Process
NO
Check parking
spot to the
right
Open?
YES
Begin parking
algorithm
YES
Open?
Front
obstacle distance
< 10 in.
Parking Algorithm
Back up
the length
of one spot
Wait for
signal to
pull out
NO
Signal to
pull out
received?
Left or
right spot
open?
LEFT
RIGHT
YES
Turn wheels to
the left
Move backwards
until point where
wheels need to
be turned
Turn wheels to
the right
YES
Turn wheels in
opposite direction
as pulling into
spot
NO
Process
Move forward until
ParkBot completes
a 90 degree turn
Move backwards
until the pull into
parking spot start
point is reached
Turn wheels
straight and
move forward
NO
Has >
3.1 inch front
clearance
YES
ParkBot
centered
in spot?
Perform parking
spot search
algorithm without
looking for spots
Software Structure
ParkBot
-int numSpotsOccupied
-int rightOrLeftSpotAvail
- int obstacleDetectedFlag
-Servo steeringServo
- const int leftSensorPin
- const int rightSensorPin
- const int frontSensorPin
- const int motorPosTerminal
- const int motorNegTerminal
- const int rfReceiverPin
+ void moveForward(long distance)
+ void moveBackward(long distance)
+ void turnWheels(int direction)
+ long timeToDistance(long sensorReading)
+ long getFrontDistance()
+ long getLeftDistance()
+ long getRightDistance()
+ void pullCarIn()
+ void takeCarOut()
+ void threePointTurn()
+ int isCentered()
int numSpotsOccupied
Keeps track of the number of
occupied left and right spots.
Increments after each
occupied pair of spots is
detected
int rightOrLeftSpotAvail
Set to 1 if a right spot is
available and 2 if left spot is
available once open spot is
detected
int obstacleDetectedFlag
Set to 1 if there is a front
obstacle, 2 if there is a left
obstacle, and 3 if there is a
right obstacle during
obstacle avoidance loop
Motor and Steering Servo
Functions
void moveForward(long distance)
Moves ParkBot forward for the designated distance
given in inches
void moveBackward(long distance)
Moves ParkBot backwards for the designated distance
given in inches
void turnWheels(int direction)
If direction parameter is equal to 1, this function will
turn ParkBot’s wheels to the left. If direction parameter
is equal to 2,
Obstacle Sensor Functions
long getFrontDistance()
Returns the distance in inches of the nearest obstacle to
the front of ParkBot
long getLeftDistance()
Returns the distance in inches of the nearest obstacle to
the left of ParkBot
long getRightDistance()
Returns the distance in inches of the nearest obstacle to
the right of ParkBot
Obstacle Sensor Functions cont’d
long timeToDistance(long sensorReading)
Sensor-read helper function. Takes in a time in
microseconds (i.e. reading from an Ultrasonic sensor)
and converts the time into a distance in inches (i.e.
distance from nearest object to sensor).
According to Parallax's datasheet for the PING)))
Ultrasonic sensor, there are 73.746 microseconds per
inch. Also the sensor reading in microseconds is the
total time, outbound and return, so we must divide by 2
to get the distance to the obstacle. This gives us the
following conversion:
distanceInInches = sensorReading / 73.746 / 2
Algorithm Functions
void pullCarIn(int rightOrLeft)
Does the process of pulling ParkBot into a parking spot. If the
rightOrLeft parameter is 1, ParkBot will pull into the parking spot
on the right side. If the rightOrLeft parameter is 2, ParkBot will pull
into the parking spot on the left side
Common Pull Into Parking
Spot Scenario (figure not
drawn to scale):
Algorithm Functions cont’d
void takeCarOut(int rightOrLeft)
Does the process of pulling ParkBot out of a parking spot. If the
rightOrLeft parameter is 1, ParkBot will pull into the parking spot
on the right side. If the rightOrLeft parameter is 2, ParkBot will pull
into the parking spot on the left side
During the execution of pullCarIn() and takeCarOut(), all
sensors will be checked at a rate of 2 Hz to detect whether there
is an object within 3 inches of ParkBot on all sides. If an object is
detected during either of the two algorithms, the process will be
repeated again with minor modifications according to where the
obstacle was detected
int isCentered()
Returns a 1 if ParkBot’s left and right side clearance values are
within 0.2 inches of each other. Returns a 0 otherwise.
Testing Scenarios
The following scenarios will be accounted for and
mastered:
Spot available on left
Spot available on right
No spots available
Spot too small on the left
Spot too small on the right
Budget
Parts
Quantity
Price
Total Price
(Incl tax &
shipping)
RC Car
1
$ 68.00
$ 81.51
Ultrasonic Sensors
3
$ 26.95
$ 80.85
MCU
1
$ 5.50
$ 9.91
RF Transmitter
1
$ 3.50
$ 5.72
RF Receiver
1
$ 4.81
$ 6.93
Voltage Regulator
2
$ 3.00
$ 5.95
Battery
1
$ 26.99
$ 28.76
H-Bridge Chip
1
$ 2.53
$ 4.15
PCB
1
$ 25.00
$ 25.00
USB to Serial Board
1
$ 13.95
$ 18.95
$ 30.00
$ 30.00
Miscellaneous
Total Budget =
$ 297.73
Milestone
Research
90%
Design
90%
Parts
Acquisition
Software
85%
15%
20%
Prototyping
Testing
10%
51.70%
Overall
0.00%
20.00%
40.00%
60.00%
80.00%
100.00%
Timeline
All parts
ordered
Software
completed
Initial component
testing completed
Feb. 25
Feb. 10
All parts
received
Feb. 20
Final testing
completed
Apr. 1
Mar. 10
Hardware
circuitry
completed
Initial Complete
System Testing
completed
Mar. 1
Mar. 25
Questions???