![Page 1: RC Car Thomas Chau, Ben Sack, Peter Tsonev. Overview Goal: to build a smart RC car that corrects itself using sensors. Objective: testing our run at high](https://reader036.vdocuments.site/reader036/viewer/2022062518/56649e4c5503460f94b40bf3/html5/thumbnails/1.jpg)
RC Car
Thomas Chau, Ben Sack, Peter Tsonev
![Page 2: RC Car Thomas Chau, Ben Sack, Peter Tsonev. Overview Goal: to build a smart RC car that corrects itself using sensors. Objective: testing our run at high](https://reader036.vdocuments.site/reader036/viewer/2022062518/56649e4c5503460f94b40bf3/html5/thumbnails/2.jpg)
Overview
Goal: to build a smart
RC car that corrects
itself using sensors.
Objective: testing our
run at high speed
towards an object and
halt before crashing.
![Page 3: RC Car Thomas Chau, Ben Sack, Peter Tsonev. Overview Goal: to build a smart RC car that corrects itself using sensors. Objective: testing our run at high](https://reader036.vdocuments.site/reader036/viewer/2022062518/56649e4c5503460f94b40bf3/html5/thumbnails/3.jpg)
Architecture and Design
NIOS system.
PWM component to interface Altera with Car
Ultrasonic Sensor component with interrupts.
Software component – feedback loop
integrating sensor readings and outputting to
PWM.
Additional servo to rotate sensor 90 degrees.
![Page 4: RC Car Thomas Chau, Ben Sack, Peter Tsonev. Overview Goal: to build a smart RC car that corrects itself using sensors. Objective: testing our run at high](https://reader036.vdocuments.site/reader036/viewer/2022062518/56649e4c5503460f94b40bf3/html5/thumbnails/4.jpg)
Algorithm
D = distance read from sensor (inches)
S = speed calculated from D and previous D (inches per second)
While (D is not target D)
Read D. Let S = (D' – D) * dt
Let new speed = function (D, S)
Let PWM level = normalization (speed) => [6% to 9%]
Write PWM level to register.
![Page 5: RC Car Thomas Chau, Ben Sack, Peter Tsonev. Overview Goal: to build a smart RC car that corrects itself using sensors. Objective: testing our run at high](https://reader036.vdocuments.site/reader036/viewer/2022062518/56649e4c5503460f94b40bf3/html5/thumbnails/5.jpg)
PID Equations
Two equations; two degrees of freedom
Gain equation tries to get car as close to target
as possible.
Differentiator equation opposes the first
equation if the speed of approach is too high.
The balance of the two equations brings the car
to target.
![Page 6: RC Car Thomas Chau, Ben Sack, Peter Tsonev. Overview Goal: to build a smart RC car that corrects itself using sensors. Objective: testing our run at high](https://reader036.vdocuments.site/reader036/viewer/2022062518/56649e4c5503460f94b40bf3/html5/thumbnails/6.jpg)
Implementation
Engineering a good
feedback loop takes a
great deal of
experimentation.
Precise distance
measurements are tough;
precise speed
measurements are even
harder.
![Page 7: RC Car Thomas Chau, Ben Sack, Peter Tsonev. Overview Goal: to build a smart RC car that corrects itself using sensors. Objective: testing our run at high](https://reader036.vdocuments.site/reader036/viewer/2022062518/56649e4c5503460f94b40bf3/html5/thumbnails/7.jpg)
Implementation Cont'd
PID theory is for linear behavior; however, the physical
system of the car and especially the throttle control is
highly nonlinear.
Our task is critical damping. The PID equations work
best for under-damping.
Solution: introduce a nonlinearity in the equations; the
differentiator is also a measure of distance to target.
(Smaller distance -> more reverse throttle)
![Page 8: RC Car Thomas Chau, Ben Sack, Peter Tsonev. Overview Goal: to build a smart RC car that corrects itself using sensors. Objective: testing our run at high](https://reader036.vdocuments.site/reader036/viewer/2022062518/56649e4c5503460f94b40bf3/html5/thumbnails/8.jpg)
Results
Engine lost reverse throttle capability.
The following graphs show our measurements
while the engine was still performing.
Graphs: Overdamping, Critical Damping, Dirty
Measurements
![Page 9: RC Car Thomas Chau, Ben Sack, Peter Tsonev. Overview Goal: to build a smart RC car that corrects itself using sensors. Objective: testing our run at high](https://reader036.vdocuments.site/reader036/viewer/2022062518/56649e4c5503460f94b40bf3/html5/thumbnails/9.jpg)
Row 2
Row 5
Row 8
Row 1
1
Row 1
4
Row 1
7
Row 2
0
Row 2
3
Row 2
6
Row 2
9
Row 3
2
Row 3
5
Row 3
8
Row 4
1
Row 4
4
Row 4
7
Row 5
0
Row 5
3
Row 5
6
Row 5
9
Row 6
2
Row 6
5
Row 6
8
Row 7
1
Row 7
4
Row 7
7
Row 8
0
Row 8
3
Row 8
6
Row 8
9
Row 9
2
Row 9
5
Row 9
8
Row 1
01
-20
0
20
40
60
80
100
120
140
distance
dirty_distance
delta_dist
![Page 10: RC Car Thomas Chau, Ben Sack, Peter Tsonev. Overview Goal: to build a smart RC car that corrects itself using sensors. Objective: testing our run at high](https://reader036.vdocuments.site/reader036/viewer/2022062518/56649e4c5503460f94b40bf3/html5/thumbnails/10.jpg)
Row 2
Row 4
Row 6
Row 8
Row 1
0
Row 1
2
Row 1
4
Row 1
6
Row 1
8
Row 2
0
Row 2
2
Row 2
4
Row 2
6
Row 2
8
Row 3
0
Row 3
2
Row 3
4
Row 3
6
Row 3
8
Row 4
0
Row 4
2
Row 4
4
Row 4
6
Row 4
8
Row 5
0
Row 5
2
Row 5
4
Row 5
6
Row 5
8
Row 6
0
Row 6
2
Row 6
4
Row 6
6
Row 6
8
Row 7
0
Row 7
2
Row 7
4
Row 7
6
Row 7
8
Row 8
0
Row 8
2
-20
0
20
40
60
80
100
120
distance
dirty_distance
delta_dist
![Page 11: RC Car Thomas Chau, Ben Sack, Peter Tsonev. Overview Goal: to build a smart RC car that corrects itself using sensors. Objective: testing our run at high](https://reader036.vdocuments.site/reader036/viewer/2022062518/56649e4c5503460f94b40bf3/html5/thumbnails/11.jpg)
Results
Graph
Row 2
Row 4
Row 6
Row 8
Row 1
0
Row 1
2
Row 1
4
Row 1
6
Row 1
8
Row 2
0
Row 2
2
Row 2
4
Row 2
6
Row 2
8
Row 3
0
Row 3
2
Row 3
4
Row 3
6
Row 3
8
Row 4
0
Row 4
2
Row 4
4
Row 4
6
Row 4
8
Row 5
0
Row 5
2
Row 5
4
Row 5
6
Row 5
8
Row 6
0
Row 6
2
Row 6
4
Row 6
6
Row 6
8
Row 7
0
Row 7
2
Row 7
4
Row 7
6
Row 7
8
Row 8
0
Row 8
2
Row 8
4
-20
0
20
40
60
80
100
120
140
distance
dirty_distance
delta_dist
![Page 12: RC Car Thomas Chau, Ben Sack, Peter Tsonev. Overview Goal: to build a smart RC car that corrects itself using sensors. Objective: testing our run at high](https://reader036.vdocuments.site/reader036/viewer/2022062518/56649e4c5503460f94b40bf3/html5/thumbnails/12.jpg)
Row 2
Row 4
Row 6
Row 8
Row 1
0
Row 1
2
Row 1
4
Row 1
6
Row 1
8
Row 2
0
Row 2
2
Row 2
4
Row 2
6
Row 2
8
Row 3
0
Row 3
2
Row 3
4
Row 3
6
Row 3
8
Row 4
0
Row 4
2
Row 4
4
Row 4
6
Row 4
8
-20
0
20
40
60
80
100
filtered_distance dirty_distance distance_delta
![Page 13: RC Car Thomas Chau, Ben Sack, Peter Tsonev. Overview Goal: to build a smart RC car that corrects itself using sensors. Objective: testing our run at high](https://reader036.vdocuments.site/reader036/viewer/2022062518/56649e4c5503460f94b40bf3/html5/thumbnails/13.jpg)
New Demo instead of Throttle Demo
Uses PID concept except with steering rather
than braking.
New challenges: sensor reads wall at a bad
incident angle.
Nonlinear throttle affects turning rate.
Poor sensor resolution requires larger
distances.
![Page 14: RC Car Thomas Chau, Ben Sack, Peter Tsonev. Overview Goal: to build a smart RC car that corrects itself using sensors. Objective: testing our run at high](https://reader036.vdocuments.site/reader036/viewer/2022062518/56649e4c5503460f94b40bf3/html5/thumbnails/14.jpg)
Difficulties
The car exploded
Physical difficulties:
measurement; figuring out
parameters for feedback
equations; hacking the
hardware; fundamental
nonlinearities.
Physical limitations; ultrasonic
sensor updating every 50ms
with 1” granularity. Car engine
with very rough speed control.
Unpredictable battery
conditions.
![Page 15: RC Car Thomas Chau, Ben Sack, Peter Tsonev. Overview Goal: to build a smart RC car that corrects itself using sensors. Objective: testing our run at high](https://reader036.vdocuments.site/reader036/viewer/2022062518/56649e4c5503460f94b40bf3/html5/thumbnails/15.jpg)
Lessons Learned
Be careful not to jerk the PWM levels,
damaging transistors.
Wiring is too low-level; it complicates debugging
and increases the development time.
Data filtering for dirty measurement data;
unforeseen sources of interference (ethernet,
battery, servos, engines, etc.)
![Page 16: RC Car Thomas Chau, Ben Sack, Peter Tsonev. Overview Goal: to build a smart RC car that corrects itself using sensors. Objective: testing our run at high](https://reader036.vdocuments.site/reader036/viewer/2022062518/56649e4c5503460f94b40bf3/html5/thumbnails/16.jpg)
Thanks!
Peter cuts a
breadboard down to
size.