W itty's robotically engineered car kraziness (W.R.E.C.K.)

20
Ben Fluehr, Derrick Lam, Brett Melonis, Alex Person

description

Ben Fluehr, Derrick Lam, Brett Melonis, Alex Person. W itty's robotically engineered car kraziness (W.R.E.C.K.). Overview. Work Completed Car Motion Control – Servos Car Vision – CMUcam Car Steering – Magnetometers Car Obstacle Avoidance – Range finders Work Remaining. Car Motion Control. - PowerPoint PPT Presentation

Transcript of W itty's robotically engineered car kraziness (W.R.E.C.K.)

Page 1: W itty's robotically engineered car kraziness (W.R.E.C.K.)

Ben Fluehr, Derrick Lam, Brett Melonis, Alex Person

Page 2: W itty's robotically engineered car kraziness (W.R.E.C.K.)

Overview Work Completed

Car Motion Control – ServosCar Vision – CMUcamCar Steering – MagnetometersCar Obstacle Avoidance – Range finders

Work Remaining

Page 3: W itty's robotically engineered car kraziness (W.R.E.C.K.)

Car Motion Control

Electronic Speed Controller (ESC) Single steering servo Controlled via Handy Board

Page 4: W itty's robotically engineered car kraziness (W.R.E.C.K.)

ESC Control

Pulse Width Modulated (PWM) control signal from Handy Board

Draws power from battery Grounded to Handy Board

Page 5: W itty's robotically engineered car kraziness (W.R.E.C.K.)

Steering Servo Control

Pulse Width Modulated (PWM) control signal from Handy Board

Draws power from ESC Grounded to Handy Board

Page 6: W itty's robotically engineered car kraziness (W.R.E.C.K.)

Motion Control Example#use "servo_a5.icb"#use "servo_a7.icb"

#define MOTOR_NEUTRAL 3040#define STEERING_NEUTRAL 3000#define NORMAL_SPEED 3350

void drive_forward() { servo_a5_pulse = NORMAL_SPEED;}

void brake() { servo_a5_pulse = MOTOR_NEUTRAL;}

Void steer_straight() { servo_a7_pulse = STEERING_NEUTRAL;}

#use “servo_a5.icb”

#define MOTOR_NEUTRAL 3040#define NORMAL_SPEED 3350

void accelerate() { int i; for (i = MOTOR_NEUTRAL; i <= NORMAL_SPEED; i + 10) { servo_a5_pulse = i; }}

Page 7: W itty's robotically engineered car kraziness (W.R.E.C.K.)

Car Vision - CMUcam 1

Page 8: W itty's robotically engineered car kraziness (W.R.E.C.K.)

CMUcam Main Loopvoid main(){ //Initialize camera init_camera(); clamp_camera_yuv();

//Main loop while(1) { if (track_red() > 40) { //Stop sign found }

if (track_yellow() > 40) { //Yield sign found

} }

Page 9: W itty's robotically engineered car kraziness (W.R.E.C.K.)

CMUcam Detecting Blobsint track_red()

{

if (trackRaw(180,220,40,65,85,115) > 0) {

return track_confidence;

} else return 0;

}

Page 10: W itty's robotically engineered car kraziness (W.R.E.C.K.)

CMUCam Continued int trackRaw(int rmin, int rmax, int ymin,

int ymax, int bmin, int bmax) Uses CrYCb instead of more commonly

known RGB space A box bounds the pixels within color

boundaries, and the amount of pixels within box determines the confidence rating

Must calibrate color ranges in track’s room with actual signs

Page 11: W itty's robotically engineered car kraziness (W.R.E.C.K.)

Magnetometer – Eval Board Pre-mounted

ComponentsHMC1052L MOSFET resetAmplifier circuitry

Five HolesVcc and GNDOut1 and Out2Set

Page 12: W itty's robotically engineered car kraziness (W.R.E.C.K.)

Magnetometer – Behavior Neutral Voltage = Vcc / 2 Voltage changes more as distance

decreases Magnetic field strength

Strongest at poles and weakest in betweenVery strong fields cause problemsPoint axis towards pole for best results

Page 13: W itty's robotically engineered car kraziness (W.R.E.C.K.)

Amplified Magnetometer Output Voltage vs. Magnet Distance

2

2.5

3

3.5

4

0 5 10 15 20

Distance (cm)

Out

put

(V)

Magnetometer – Behavior (cont.)

Page 14: W itty's robotically engineered car kraziness (W.R.E.C.K.)

Magnetometer – Code void CheckMagnetometer(){ int reading = analog(MAGNET_PORT); int absDiff = abs(reading - neutral); if (absDiff > MAGNET_THRESHOLD) {

ChangeSteering(absDiff);neutral = analog(MAGNET_PORT);

}}

Page 15: W itty's robotically engineered car kraziness (W.R.E.C.K.)

Car Obstacle Avoidance

Original planMaxbotix Range FinderAnalog output

ProblemStill having jumpy output in the distances of

interestIncreased code complexityDifficulty responding to small changes in

distance

Page 16: W itty's robotically engineered car kraziness (W.R.E.C.K.)

Solution

Sharp Range SensorsUse infrared instead of sonarShould “see” a narrower rangeOnly requires power, ground, analog output

May combine multiple sensorsSharp GP2D12: 10 – 80 cmSharp GP2Y0A02YK: 20 – 150 cmMaxSonar-EZ1: 15 – 645 cm

Page 17: W itty's robotically engineered car kraziness (W.R.E.C.K.)

Sharp Range Sensors GP2D12

GP2Y0A02YK

Sensor Cable

Page 18: W itty's robotically engineered car kraziness (W.R.E.C.K.)

Interactive C Example

#define PORT 5 /* 7 available ports */

void main()

{

int distance = analog(PORT); /* 0 to 255 */

if (distance > 128) /* half max distance */

brake();

}

Page 19: W itty's robotically engineered car kraziness (W.R.E.C.K.)

Work Remaining Mount components in final position

GluePieces of plastic

Combine code to run simultaneouslyCode finished for each componentCan probably call functions in turn from

main loopPossibility: multiple processes

○ Support from Interactive C○ Spawn from any C function○ Each runs for 5 ms

Page 20: W itty's robotically engineered car kraziness (W.R.E.C.K.)

Questions?