ee192 spring 2009 final presentation · control we used a pd controller centerservo + (k p ×...
TRANSCRIPT
![Page 1: EE192 Spring 2009 Final Presentation · Control We used a PD controller centerServo + (k p × diff)/100 + (k d × (diffL - diff))/100; We started with an estimate for the k p and](https://reader033.vdocument.in/reader033/viewer/2022050514/5f9ebd630c682d074956ae0c/html5/thumbnails/1.jpg)
EE192 Spring 2009 – Final Presentation
1/22/2010University of California, Berkeley - Electrical Engineering and Computer Science 1
Farzad Fatollahi-FardHartej DhamiAman Mouhidin
![Page 2: EE192 Spring 2009 Final Presentation · Control We used a PD controller centerServo + (k p × diff)/100 + (k d × (diffL - diff))/100; We started with an estimate for the k p and](https://reader033.vdocument.in/reader033/viewer/2022050514/5f9ebd630c682d074956ae0c/html5/thumbnails/2.jpg)
Overview Hardware
General
Sensors
Software
Controls
Performance
Roles and Contributions
1/22/2010University of California, Berkeley - Electrical Engineering and Computer Science 2
![Page 3: EE192 Spring 2009 Final Presentation · Control We used a PD controller centerServo + (k p × diff)/100 + (k d × (diffL - diff))/100; We started with an estimate for the k p and](https://reader033.vdocument.in/reader033/viewer/2022050514/5f9ebd630c682d074956ae0c/html5/thumbnails/3.jpg)
Hardware - General We used ADUC7026 evaluation board
ProsWe had cross-talk in adjacent ADC pins, with 11 ADCs we were able to
use every otherEasy to change GPIO functions (All pins have headers)
ConsAccommodate larger board (5-6 times more area than mini-board)Always get asked “Why is your board so big?” We were assigned the ADUC7026, we just stuck with it.
We used hi-torque instead of hi-speed servo Pros
Turns not limited by lateral momentum
ConsLower slew rate (0.08 rad/s vs. 0.06 rad/s)
1/22/2010University of California, Berkeley - Electrical Engineering and Computer Science 3
![Page 4: EE192 Spring 2009 Final Presentation · Control We used a PD controller centerServo + (k p × diff)/100 + (k d × (diffL - diff))/100; We started with an estimate for the k p and](https://reader033.vdocument.in/reader033/viewer/2022050514/5f9ebd630c682d074956ae0c/html5/thumbnails/4.jpg)
Sensors We used three sensors
Middle, Left, and right
PCB can handle four sensor inputs if need be
We used a two stage amplifier One gain stage and One buffer stage
Our power circuitry and sensor circuitry had common ground plane We did not run into any noise problems with a common
ground plane
The DC boost and sensor op-amps were on opposite parts of the PCB
1/22/2010University of California, Berkeley - Electrical Engineering and Computer Science 4
![Page 5: EE192 Spring 2009 Final Presentation · Control We used a PD controller centerServo + (k p × diff)/100 + (k d × (diffL - diff))/100; We started with an estimate for the k p and](https://reader033.vdocument.in/reader033/viewer/2022050514/5f9ebd630c682d074956ae0c/html5/thumbnails/5.jpg)
SensorsCharts
-10
-5
0
5
10
-8 -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8
Estimate
Estimate
1/22/2010University of California, Berkeley - Electrical Engineering and Computer Science 5
0
500
1000
1500
2000
2500
3000
3500
4000
4500
Left
Right
Center
![Page 6: EE192 Spring 2009 Final Presentation · Control We used a PD controller centerServo + (k p × diff)/100 + (k d × (diffL - diff))/100; We started with an estimate for the k p and](https://reader033.vdocument.in/reader033/viewer/2022050514/5f9ebd630c682d074956ae0c/html5/thumbnails/6.jpg)
Software Optimizations
We tried to do bit shifting if possible
Common conditions are at top of if statement tree
Used shorts instead of integers
There is no ‘special’ feature
We believed that simpler code would result in best performance (KISS, more knobs…)
Able to change kp & kd via Bluetooth™
1/22/2010University of California, Berkeley - Electrical Engineering and Computer Science 6
![Page 7: EE192 Spring 2009 Final Presentation · Control We used a PD controller centerServo + (k p × diff)/100 + (k d × (diffL - diff))/100; We started with an estimate for the k p and](https://reader033.vdocument.in/reader033/viewer/2022050514/5f9ebd630c682d074956ae0c/html5/thumbnails/7.jpg)
Software Locked in last turn direction to recover if track is lost
Used saturation on servo turn angle calculation to protect against large current draw from V-REG
Used timers for servo PWM and in-built PWM for motor
Used version control for code (SVN)
Better is not the enemy of good with version control for code anymore
1/22/2010University of California, Berkeley - Electrical Engineering and Computer Science 7
![Page 8: EE192 Spring 2009 Final Presentation · Control We used a PD controller centerServo + (k p × diff)/100 + (k d × (diffL - diff))/100; We started with an estimate for the k p and](https://reader033.vdocument.in/reader033/viewer/2022050514/5f9ebd630c682d074956ae0c/html5/thumbnails/8.jpg)
Control We used a PD controller
centerServo + (kp × diff)/100 + (kd × (diffL - diff))/100;
We started with an estimate for the kp and kd values Then we changed kp and kd via Bluetooth™ until we saw a stable result Initial Problems:
Initially we were sampling the ADC values in the while loop, every xth
iteration of the loop Our car was very wobbly and this was because we were not sampling
often enough We changed our code to sample ADC values based on Timer2 interrupt
Simulations proved helpful in understanding the concepts. We tried doing simulation to get a starting value for kp and kd, those
values were close but a little off from what we ended up using kp: 5.54 rad/m; kd: 1.82 rad × s/m
1/22/2010University of California, Berkeley - Electrical Engineering and Computer Science 8
![Page 9: EE192 Spring 2009 Final Presentation · Control We used a PD controller centerServo + (k p × diff)/100 + (k d × (diffL - diff))/100; We started with an estimate for the k p and](https://reader033.vdocument.in/reader033/viewer/2022050514/5f9ebd630c682d074956ae0c/html5/thumbnails/9.jpg)
Performance Runs well except following short comings:
Twitches on straight-ways at crossings
Slips on turns
Tries to run away at 100% Duty Cycle PWM when touched inappropriately
1/22/2010University of California, Berkeley - Electrical Engineering and Computer Science 9
-10
-5
0
5
10
15
20
0.0
00
.06
0.1
10
.17
0.2
30
.28
0.3
40
.40
0.4
60
.51
0.5
70
.63
0.6
80
.74
0.8
00
.85
0.9
10
.97
1.0
21.
08
1.14
1.20
1.25 1.31
1.37
1.4
21.
48
1.54
1.59
1.6
51.
711.
761.
82
1.8
81.
94
1.9
92.
05
2.11
2.16
2.22
2.28
2.33
2.39
Err
or(
cm)
Error(cm) VS Distance(m) @2m/s
Error
![Page 10: EE192 Spring 2009 Final Presentation · Control We used a PD controller centerServo + (k p × diff)/100 + (k d × (diffL - diff))/100; We started with an estimate for the k p and](https://reader033.vdocument.in/reader033/viewer/2022050514/5f9ebd630c682d074956ae0c/html5/thumbnails/10.jpg)
Things we tried Use cross sensor
If cross value high enough ignore other sensors and keep last servo value
Decreased performance
Car twitches a lot more.
Speed encoder
Simple addition/subtraction scheme to modulate speed
Held speed within 0.5 ft/s of requested speed
Worked fine indoors
Did not work in sunlight
1/22/2010University of California, Berkeley - Electrical Engineering and Computer Science 10
![Page 11: EE192 Spring 2009 Final Presentation · Control We used a PD controller centerServo + (k p × diff)/100 + (k d × (diffL - diff))/100; We started with an estimate for the k p and](https://reader033.vdocument.in/reader033/viewer/2022050514/5f9ebd630c682d074956ae0c/html5/thumbnails/11.jpg)
Roles and Contributions Hartej Software Development
Car platform/boom design
PCB Schematic & Layout 2
Farzad Software Development
PCB Schematic & Layout 1 and 2
Aman Circuit Design
PCB Schematic & Layout 1 and 2
1/22/2010University of California, Berkeley - Electrical Engineering and Computer Science 11
![Page 12: EE192 Spring 2009 Final Presentation · Control We used a PD controller centerServo + (k p × diff)/100 + (k d × (diffL - diff))/100; We started with an estimate for the k p and](https://reader033.vdocument.in/reader033/viewer/2022050514/5f9ebd630c682d074956ae0c/html5/thumbnails/12.jpg)
Fin
1/22/2010University of California, Berkeley - Electrical Engineering and Computer Science 12