Presentation is loading. Please wait.

Presentation is loading. Please wait.

ECE 192: NATCAR Team (Triton X) Sponsored by IEEE (http://ieee.ucsd.edu) Vincent Bantigue, Joseph Formanes,

Similar presentations


Presentation on theme: "ECE 192: NATCAR Team (Triton X) Sponsored by IEEE (http://ieee.ucsd.edu) Vincent Bantigue, Joseph Formanes,"— Presentation transcript:

1 ECE 192: NATCAR Team (Triton X) Sponsored by IEEE (http://ieee.ucsd.edu) Vincent Bantigue, vbantigu@ucsd.edu vbantigu@ucsd.edu Joseph Formanes, jformane@ucsd.edu jformane@ucsd.edu Henry Kao, hkao@ucsd.edu hkao@ucsd.edu Puneet Khattar, pkhattar@ucsd.edu pkhattar@ucsd.edu Advisor: Dr. Clark Guest Week 7, 2/18/05

2 Agenda: Tasks Accomplished this week PID Control Theory IR Sensors Upcoming Tasks for next week

3 Tasks Accomplished this week: Acquired IR sensor parts In the process of building IR sensor circuit Continued creating MATLAB models of IR sensor system Continued microcontroller programming I/O Programming learned I/O Programming learned PWM Output learned PWM Output learned Studied PID (Proportional, Integral, Derivative) Control Theory

4 PID Control Theory: To control speed and steering using PID, an algorithm manipulates one control output to force a process value towards a reference point. Analogy: Cruise Control System Control Output is acceleration Control Output is acceleration Process Value is current speed Process Value is current speed Reference point is target speed Reference point is target speed Analogy courtesy of http://www.flightgear.org/Docs/XMLAutopilot/node2.html http://www.flightgear.org/Docs/XMLAutopilot/node2.html

5 PID (cont’d)- Proportional: e n = y n – r n e n is error, y n is process value, and r n is reference point (target). e n is error, y n is process value, and r n is reference point (target). All three components of PID are driven by the error, e n All three components of PID are driven by the error, e n uP n = K p * e n u n is control output, K p = proportionality constant u n is control output, K p = proportionality constant Problem: Need to know when u n = 0 (when e n = 0) Problem: Need to know when u n = 0 (when e n = 0)

6 PID (cont’d)- Integral: uI n = K i * Σ 0 n (e n * dt) Over time, the larger the summation gets, this component contributes more to the control output In the example of the cruise control, if the integral increases over time, the acceleration increases to get to the target speed faster In the example of the cruise control, if the integral increases over time, the acceleration increases to get to the target speed faster

7 PID (cont’d)- Derivative: uD n = K d * de n / dt The rate of the change of the error with respect to time. Effect: holds back PID system. Prevents oscillations by predicting future of error. Prevents oscillations by predicting future of error. When the error is approaching stability, derivative component is less. When the error is approaching stability, derivative component is less. Usually K d is small because its highly sensitive to noise

8 PID (cont’d): u n = K p * uP n + K i * uP i + K d * uP d The total control output is a sum of the proportional, integral and derivative components.

9 Row Sensor

10 Sensors: Rate of Change Response Create a history of past line center points (LCPs) Error (E): Distance from row’s center point Desire Decreasing Error over time If E n < E n-1, Decreasing Average Error: Check Over Previous k errors { int(En T { int(En T Where T is some threshold > k/2 s.t. the majority of the Error differences are decreasing over time Where T is some threshold > k/2 s.t. the majority of the Error differences are decreasing over time If Avg Error increase, Alter turn degree

11 Accurate Path Calculation Create a good model for the car Need the acceleration graph of the motor Need true velocity of the car (place optical sensors on motor shaft Need Arc Sensing ability (possibly with multirow arrays)

12 Upcoming Tasks for next week: Finish working prototype Assemble Motor Controller Assemble Motor Controller Finish assembling IR sensor array circuit Finish assembling IR sensor array circuit Assemble DC-DC converter Assemble DC-DC converter Complete basic Program Complete basic Program Begin testing

13 Microcontroller: Concatenated PWM registers for use of 16bit duty resolution (instead of 8bit) Created code for translating 16bits of data from input port registers into distance error Translated PID algorithm from MATLAB to C Learned to load data into FLASH memory (with help from members of other groups)

14 Microcontroller (cont’d): Sensor data conversion pseudo-code: for i = 0 to 7 (bits of sensor) for i = 0 to 7 (bits of sensor) Mask = 00000001 bitwise shifted left by I Current = mask & sensor_registers If (current == 1){ //that particular bit is high white detected Error = error + (val – i) * spacing //val is (N-1)/2, spacing is distance b/w center of two sensors next to each other Error = error + (val – i) * spacing //val is (N-1)/2, spacing is distance b/w center of two sensors next to each other Num = num+1 Num = num+1}} If (num == 0) Error = previous error else Error = error/(float)(num);

15 Microcontroller (cont’d): 7654321 0 SPACING ERROR 7654321 0 Example: Bits = 8, Val = 3.5 Bit 5 high: (3.5 – 5)x 2cm = -3, Bit 6 high: (3.5-6)x0.2cm = -5 Error = -3 + -5 = -8cm Real Error = -8cm / 2 = -4cm 2cm

16 Microcontroller (cont’d): Obstacles: 4Kb on EEPROM is not nearly enough to fit our program (solved: used FLASH) 4Kb on EEPROM is not nearly enough to fit our program (solved: used FLASH) Bootloader says “Flash Program Error” when I try to load my program into Flash Bootloader says “Flash Program Error” when I try to load my program into Flash (will call Imagecraft and read documentation to find out how to properly load FLASH)


Download ppt "ECE 192: NATCAR Team (Triton X) Sponsored by IEEE (http://ieee.ucsd.edu) Vincent Bantigue, Joseph Formanes,"

Similar presentations


Ads by Google