ADVISOR: DR. BECKER-GOMEZ P14226 RC Camera Caredge.rit.edu/edge/P14226/public/Final...

37
P14226 RC Camera Car Final Review - 5/8/13 TIM SOUTHERTON BRIAN GROSSO MATTHEW MORRIS LALIT TANWAR KEVIN MEEHAN ALEX REID ADVISOR: DR. BECKER-GOMEZ 5/8/14 RC CAMERA CAR FINAL REVIEW 1

Transcript of ADVISOR: DR. BECKER-GOMEZ P14226 RC Camera Caredge.rit.edu/edge/P14226/public/Final...

Page 1: ADVISOR: DR. BECKER-GOMEZ P14226 RC Camera Caredge.rit.edu/edge/P14226/public/Final Documents...ActiveX control with VBA macros for importing, converting, formatting, and plotting

P14226 RC Camera CarFinal Review - 5/8/13

TIM SOUTHERTON

BRIAN GROSSO

MATTHEW MORRIS

LALIT TANWAR

KEVIN MEEHAN

ALEX REID

ADVISOR: DR. BECKER-GOMEZ

5/8/14 RC CAMERA CAR FINAL REVIEW 1

Page 2: ADVISOR: DR. BECKER-GOMEZ P14226 RC Camera Caredge.rit.edu/edge/P14226/public/Final Documents...ActiveX control with VBA macros for importing, converting, formatting, and plotting

Agenda ItemsBackground Review

◦ System Functions Review◦ Test Plan Review◦ Testing Results◦ Imagine RIT Feedback

Car Electrical Design SummaryConsole Electrical Design SummarySoftware Design SummarySystem CharacterizationFinal Project Review

◦ Documentation◦ Budget◦ Conclusions◦ Future Work Suggestions

5/8/14 RC CAMERA CAR FINAL REVIEW 2

Page 3: ADVISOR: DR. BECKER-GOMEZ P14226 RC Camera Caredge.rit.edu/edge/P14226/public/Final Documents...ActiveX control with VBA macros for importing, converting, formatting, and plotting

Background Review

5/8/14 RC CAMERA CAR FINAL REVIEW 3

Page 4: ADVISOR: DR. BECKER-GOMEZ P14226 RC Camera Caredge.rit.edu/edge/P14226/public/Final Documents...ActiveX control with VBA macros for importing, converting, formatting, and plotting

Problem Definition ReviewProject Goal:

◦ Build a RC car platform controlled remotely with intuitive controls and visual feedback that can be expanded to demonstrate Controls to college students. The project needs to be captivating and able to demonstrate multidisciplinary engineering innovation at various RIT events this year and into the future.

Completed Deliverables:1. RC Car Platform with Cameras and Sensors2. Driving Station with Controller3. Equation of Motion of the System4. Characterizing Parameters of the System5. Source Code for Low Level Processing6. Interface for Student Coding7. Preliminary Differential Drive Code8. Supporting Documentation

RC CAMERA CAR FINAL REVIEW 45/8/14

Page 5: ADVISOR: DR. BECKER-GOMEZ P14226 RC Camera Caredge.rit.edu/edge/P14226/public/Final Documents...ActiveX control with VBA macros for importing, converting, formatting, and plotting

Stakeholders ReviewCustomer: Dr. Juan Cockburn

◦ Controls Professor, RIT, Computer Engineering (CE)

Sponsors:◦ RIT CE Department (Rick Tolleson, Dr. Becker-Gomez)

◦ Multidisciplinary Senior Design (Mark Smith, Chris Fisher)

◦ Freescale Semiconductor (Andy Mastronardi)

◦ RIT FMS (Chris Furnare, Jim Shuffield)

◦ RIT ME Department (Bill Finch, Rob Kraynik)

Event Attendees:◦ ARM Developer Day. Freescale Cup, CE Symposium, Imagine RIT,

MSD Team

Future RIT MSD Teams / Prospective Students

5/8/14 RC CAMERA CAR FINAL REVIEW 5

Page 6: ADVISOR: DR. BECKER-GOMEZ P14226 RC Camera Caredge.rit.edu/edge/P14226/public/Final Documents...ActiveX control with VBA macros for importing, converting, formatting, and plotting

System Functions Review

RC CAMERA CAR FINAL REVIEW 6

Successfully Completed

Future Work

5/8/14

Page 7: ADVISOR: DR. BECKER-GOMEZ P14226 RC Camera Caredge.rit.edu/edge/P14226/public/Final Documents...ActiveX control with VBA macros for importing, converting, formatting, and plotting

5/8/14 RC CAMERA CAR FINAL REVIEW 7

P14226 TEST PLAN

Item ID Test Description Units Marginal Value StatusB

ASI

C K

INEM

ATI

CS

K1Measure encoder sensitivity for wheel speed measurement using timing gate and measure maximum speed m/s

+/- 5%, >0.5m/s 3 m/s

K2 Measure steering angle accuracy relative to steering input none +/- 5% +/- 2%

K3 Use wheel speed on straight track, record acceleration time s < 10 ~3 s

K4 Use wheel speed on straight track, record braking time s < 5 ~2.5 s

K5 Weigh chassis before and after component installation g < 2000 1670

K6 Drive in a circle and measure COG radial distance m < 2 .3 m

K7 Measure car battery life during constant operation hours > 0.5 1.5 hours

K8 Measure camera/ transmitter battery life during constant operation hours > 0.5 3 hours

CO

NTR

OLS

C1 Measure distance to where XBee stops working indoors m 3 ~50 m

C2 Measure distance to where video transmitter stops working indoors m 3 ~70 m

C3 Test extremes of car capabilities with differential drive model active nonesmooth driving in all scenarios

smooth driving in all scenarios

C4 Measure Control Delay nonesomewhat noticeable not noticeable

C5 Measure Video delay nonesomewhat noticeable not noticeable

USE

R E

XP

ERIE

NC

E

U1 Calculate steering ratio through measurement of steering wheel and car ND 12:1 < x < 20:1 4.3:1 to 9:1

U2 Measure pedal travel on console cm 5 > x > 1 4.5 cm

U3 Record frame rate / video quality nonenot visibly

choppy videoInterference in

some areas

U4 Record learning curve time on driving minutes < 1 < 1 minute

U5 Record average visual inspection nonepositive

responsesoverwhelmingly

positive

U4 Measure average vehicle downtime after damage or out of battery minutes < 30 3 minutes

U5 Record average car run time between charging during Imagine RIT hours > 0.5 1.5 hours

U6 Record frequency of manual resets at Imagine RIT resets/ hour ≤ 3 3 resets

Page 8: ADVISOR: DR. BECKER-GOMEZ P14226 RC Camera Caredge.rit.edu/edge/P14226/public/Final Documents...ActiveX control with VBA macros for importing, converting, formatting, and plotting

Imagine RIT FeedbackAppearance:

◦ It was good. I like it very much.◦ It looks like it took a long time to

build.◦ The "-X-" on top is cool.◦ The project is professional.◦ The setup looks cool and safe.

Suggestions:◦ Brighter colors for the components

could improve experience.◦ The car needs fiberglass body.◦ The steering is a little sensitive.◦ We could make the controls a little

better.◦ We could make it a little faster.

Issues:◦ The car gave a participant vertigo.

◦ Young children need to sit on parent’s laps because they cannot touch the pedals.

Observations:◦ Pulling on the wheel can break it,

since it is not load bearing.◦ It is hard to separate the camera delay

from the control delay.◦ Sometimes the car wouldn't drive

straight and the video cut out.

5/8/14 RC CAMERA CAR FINAL REVIEW 8

Page 9: ADVISOR: DR. BECKER-GOMEZ P14226 RC Camera Caredge.rit.edu/edge/P14226/public/Final Documents...ActiveX control with VBA macros for importing, converting, formatting, and plotting

Car Electrical Design Summary

5/8/14 RC CAMERA CAR FINAL REVIEW 9

Page 10: ADVISOR: DR. BECKER-GOMEZ P14226 RC Camera Caredge.rit.edu/edge/P14226/public/Final Documents...ActiveX control with VBA macros for importing, converting, formatting, and plotting

Adapter BoardThe adapter board was designed to allow for other sensors to be integrated with the motor shield.

Stage 1 - The connections for the XBee, resistor networks for pull-up and pull-down of voltages, inputs, and outputs were all constructed on a bread-board.

Stage 2 - These connections were then made on a perf-board.

Stage 3 - The connections were modified and reduced to have minimal footprint. The adapter board could be fitted on top of the motor shield.

Page 11: ADVISOR: DR. BECKER-GOMEZ P14226 RC Camera Caredge.rit.edu/edge/P14226/public/Final Documents...ActiveX control with VBA macros for importing, converting, formatting, and plotting

Adapter BoardXBee placement module.

Input bus for incoming signals from sensors.

Output bus for outgoing signals to the micro controller.

Pass-through pins for servos.

Top Bottom

Page 12: ADVISOR: DR. BECKER-GOMEZ P14226 RC Camera Caredge.rit.edu/edge/P14226/public/Final Documents...ActiveX control with VBA macros for importing, converting, formatting, and plotting

Adapter Board

Page 13: ADVISOR: DR. BECKER-GOMEZ P14226 RC Camera Caredge.rit.edu/edge/P14226/public/Final Documents...ActiveX control with VBA macros for importing, converting, formatting, and plotting

Filtering CapacitorsThese were added to reduce the noise from the motors and the power sources.

The filtering allowed for suppression in erratic voltages due to RF interference and back EMF.

Filters placed across the voltage supply; both capacitors and ferrite cores.

Filters placed across the motor terminals

Page 14: ADVISOR: DR. BECKER-GOMEZ P14226 RC Camera Caredge.rit.edu/edge/P14226/public/Final Documents...ActiveX control with VBA macros for importing, converting, formatting, and plotting

Power SwitchA power switch was added to allow for easy programming of the car micro controller.

The micro controller cannot be programmed with both the USB and the power source plugged in as that damages the board.

This allowed for easy powering off of the car in case of emergencies or accidents.

Page 15: ADVISOR: DR. BECKER-GOMEZ P14226 RC Camera Caredge.rit.edu/edge/P14226/public/Final Documents...ActiveX control with VBA macros for importing, converting, formatting, and plotting

Speed Encoders

Encoders were 3-D printed and fitted on the rear wheels of the car.

These allowed for individual wheel speed calculations

The encoder signals were read into the micro controller and upon which PID was applied for torque vectoring.

Page 16: ADVISOR: DR. BECKER-GOMEZ P14226 RC Camera Caredge.rit.edu/edge/P14226/public/Final Documents...ActiveX control with VBA macros for importing, converting, formatting, and plotting

Console Electrical Design Summary

5/8/14 RC CAMERA CAR FINAL REVIEW 16

Page 17: ADVISOR: DR. BECKER-GOMEZ P14226 RC Camera Caredge.rit.edu/edge/P14226/public/Final Documents...ActiveX control with VBA macros for importing, converting, formatting, and plotting

Adapter BoardA single board was created to contain all necessary signals on the console

Included:• Resistor Network

• Level Shifter

• XBee Adapter

5/8/14 RC CAMERA CAR FINAL REVIEW 17

Page 18: ADVISOR: DR. BECKER-GOMEZ P14226 RC Camera Caredge.rit.edu/edge/P14226/public/Final Documents...ActiveX control with VBA macros for importing, converting, formatting, and plotting

Schematic

5/8/14 RC CAMERA CAR FINAL REVIEW 18

Page 19: ADVISOR: DR. BECKER-GOMEZ P14226 RC Camera Caredge.rit.edu/edge/P14226/public/Final Documents...ActiveX control with VBA macros for importing, converting, formatting, and plotting

SoftwareDesign Summary

5/8/14 RC CAMERA CAR FINAL REVIEW 19

Page 20: ADVISOR: DR. BECKER-GOMEZ P14226 RC Camera Caredge.rit.edu/edge/P14226/public/Final Documents...ActiveX control with VBA macros for importing, converting, formatting, and plotting

Architecture Overview

5/8/14 RC CAMERA CAR FINAL REVIEW 20

Page 21: ADVISOR: DR. BECKER-GOMEZ P14226 RC Camera Caredge.rit.edu/edge/P14226/public/Final Documents...ActiveX control with VBA macros for importing, converting, formatting, and plotting

MBED Online IDEChosen against Codewarrior

Easier to learn with many provided examples

The lack of a debugger and try/catch became a problem in the final hours of the project, making it more difficult to identify bugs.

The following libraries were used:◦ Quadrature Encoder for Steering Wheel

◦ Real-Time OS for Multi-Threading

◦ TFC for Freedom Cup Motor Shield Support

◦ PID for Control System

5/8/14 RC CAMERA CAR FINAL REVIEW 21

Page 22: ADVISOR: DR. BECKER-GOMEZ P14226 RC Camera Caredge.rit.edu/edge/P14226/public/Final Documents...ActiveX control with VBA macros for importing, converting, formatting, and plotting

Console SoftwareAnalog inputs were used for the potentiometer/pedals

Digital inputs were used for the wheel’s quadrature encoder and centering signal

Raw input values were scaled to range of transmitted data

Data transmitted as characters over serial connection; a specific range was chosen to avoid whitespace/unusual characters

Characters vs Integers

Xbees were configured to 9600 baud

Maximum rate of transmission was 300 updates/second at selected baud

5/8/14 RC CAMERA CAR FINAL REVIEW 22

Page 23: ADVISOR: DR. BECKER-GOMEZ P14226 RC Camera Caredge.rit.edu/edge/P14226/public/Final Documents...ActiveX control with VBA macros for importing, converting, formatting, and plotting

Transmitted DataString Character Value Quantity Range Units

1 Carriage Return N/A N/A nd

2 Encoder Left Char Left Encoder Pulsewidth 34-126 ms

3 Encoder Right Char Right Encoder Pulsewidth 34-126 ms

4 Wheel Pos Char Scaled Wheel Displacement CW 34-126 nd

5 Wheel Neg Char Scaled Wheel Displacement CCW 34-126 nd

6 Gas Int Scaled Gas Pedal Displacement 34-126 nd

7 Brake Int Scaled Brake Pedal Displacement 34-126 nd

8 New Line N/A N/A nd

Serial data transmitted from console to car, car to console, and console to computer

Characters 1 and 8 sent for packet formatting

Characters 2 and 3 sent from car back through console to computer

Characters 4 through 7 sent to car and computer

5/8/14 RC CAMERA CAR FINAL REVIEW 23

Page 24: ADVISOR: DR. BECKER-GOMEZ P14226 RC Camera Caredge.rit.edu/edge/P14226/public/Final Documents...ActiveX control with VBA macros for importing, converting, formatting, and plotting

Car SoftwareTFC library used to provide servo and motor control and battery level display

Multi-threading implemented through RTOS library

Three threads were set up; one for each encoder, and control system

Encoders used interrupts to measure pulse width

Experimented with median filters to reduce electrical noise

Control systems were implemented with PID libraries; constants came from system model

DIP switches used to select control system mode of operation

5/8/14 RC CAMERA CAR FINAL REVIEW 24

Page 25: ADVISOR: DR. BECKER-GOMEZ P14226 RC Camera Caredge.rit.edu/edge/P14226/public/Final Documents...ActiveX control with VBA macros for importing, converting, formatting, and plotting

System Characterization

5/8/14 RC CAMERA CAR FINAL REVIEW 25

Page 26: ADVISOR: DR. BECKER-GOMEZ P14226 RC Camera Caredge.rit.edu/edge/P14226/public/Final Documents...ActiveX control with VBA macros for importing, converting, formatting, and plotting

Data CollectionDone using Excel

ActiveX control with VBA macros for importing, converting, formatting, and plotting serial data

Compares input signal with encoder data graphically for PID control characterization

5/8/14 RC CAMERA CAR FINAL REVIEW 26

Page 27: ADVISOR: DR. BECKER-GOMEZ P14226 RC Camera Caredge.rit.edu/edge/P14226/public/Final Documents...ActiveX control with VBA macros for importing, converting, formatting, and plotting

PID Curve FittingCar driven in a straight line subjected to a step input

Speed capped at 1.0 m/s based on previous testing for noise caused by high PWM values

PID saturation at 0.75 PWM to motors to reduce noise spikes

Noise seen at end of data before deceleration due to back emf from the motors

Encoder data at end clean due to lack of h-bridge output

5/8/14 RC CAMERA CAR FINAL REVIEW 27

0.00

0.50

1.00

1.50

2.00

2.50

0.0 2.0 4.0 6.0 8.0 10.0 12.0

Sp

eed

(m

/s)

Time (s)

Straight Line Results Comparison

Data Left Encoder Speed m/s

Data Left Target Speed m/s

Simulink Left Output Speed m/s

Page 28: ADVISOR: DR. BECKER-GOMEZ P14226 RC Camera Caredge.rit.edu/edge/P14226/public/Final Documents...ActiveX control with VBA macros for importing, converting, formatting, and plotting

PID Curve FittingEncoder pulsewidth timeout in code to produce 0 m/s output when car not moving

Noise data (shorter pulsewidths than speeds the car can realize) are written the previous reasonable pulsewidth values

Pulsewidths greater than 96 ms written to 0 m/s for data transmission

Simulink model matched to data with parameters

5/8/14 RC CAMERA CAR FINAL REVIEW 28

0.00

0.50

1.00

1.50

2.00

2.50

0.0 2.0 4.0 6.0 8.0 10.0 12.0

Sp

eed

(m

/s)

Time (s)

Straight Line Results Comparison

Data Left Encoder Speed m/s

Data Left Target Speed m/s

Simulink Left Output Speed m/s

Page 29: ADVISOR: DR. BECKER-GOMEZ P14226 RC Camera Caredge.rit.edu/edge/P14226/public/Final Documents...ActiveX control with VBA macros for importing, converting, formatting, and plotting

Cornering Data FittingSpeed limited to 0.45 m/s max speed for center of car

Car driven in continuous circle

Wheel speeds received by encoders compared with target speeds and Simulink modeled performance

Occasional noise still at low speeds due to occasional bad encoder values requiring high PWM pulses

5/8/14 RC CAMERA CAR FINAL REVIEW 29

0.00

0.25

0.50

0.75

1.00

1.25

1.50

0.0 1.0 2.0 3.0 4.0 5.0 6.0

Sp

eed

(m

/s)

Time (s)

Full Left Turn Results Comparison

Data Left Encoder Speed m/s Data Right Encoder Speed m/s

Data Left Target Speed m/s Data Right Target Speed m/s

Simulink Left Output Speed m/s Simulink Right Output Speed m/s

Page 30: ADVISOR: DR. BECKER-GOMEZ P14226 RC Camera Caredge.rit.edu/edge/P14226/public/Final Documents...ActiveX control with VBA macros for importing, converting, formatting, and plotting

System Parameters

Noise in the microcontroller significantly reduces useful PWM range for testing

Based on testing, motors are undersized and PID controls are barely noticeable◦ Low saturation

◦ Large deadzone due to car weight and rolling resistance

Parameter Symbol Value Units

Wheel Base b 0.1981 m

Track Width w 0.1397 m

Tire Radius r 0.0356 m

Time Constant τ 1.4 s

Total Weight Fg 1670 g

Steering Angle δ -35 < δ < +35 deg

Tangential Velocity V 0 < V < 6 (ideal) m/s

Dead Zone DZ +/- 2.78 (0.5 PWM) m/s

Velocity Saturation - DZ Vsat +/- 1.52 (0.75 PWM) m/s

Torque Saturation - DZ Tsat +/- 0.7 (0.75 PWM) m/s2

5/8/14 RC CAMERA CAR FINAL REVIEW 30

Page 31: ADVISOR: DR. BECKER-GOMEZ P14226 RC Camera Caredge.rit.edu/edge/P14226/public/Final Documents...ActiveX control with VBA macros for importing, converting, formatting, and plotting

Motor CharacteristicsTook data with a timing gate to establish speeds outside of encoder operating range

Disabled PID controls and ran car with fixed max speeds on multiple test runs

Plotted data (blue) and mapped motor PWM to max speed of the car

Orange represents data without deadzone characteristics for use in Simulink

Deadzone taken into account in Simulink processing

5/8/14 RC CAMERA CAR FINAL REVIEW 31

y = 5.7267x - 2.7753

y = 5.7267x + 3E-14

0.0

1.0

2.0

3.0

4.0

5.0

6.0

7.0

0 0.2 0.4 0.6 0.8 1

Car

Sp

eed

(m

/s)

Motor PWM

Car Speed versus PWM

Actual Speed Ideal Speed

Linear (Actual Speed) Linear (Ideal Speed)

Page 32: ADVISOR: DR. BECKER-GOMEZ P14226 RC Camera Caredge.rit.edu/edge/P14226/public/Final Documents...ActiveX control with VBA macros for importing, converting, formatting, and plotting

Final Project Review

5/8/14 RC CAMERA CAR FINAL REVIEW 32

Page 33: ADVISOR: DR. BECKER-GOMEZ P14226 RC Camera Caredge.rit.edu/edge/P14226/public/Final Documents...ActiveX control with VBA macros for importing, converting, formatting, and plotting

DocumentationExtensive documentation of setup for future work

◦ Developer Guide with over 90 pages of detailed explanation and diagrams

http://edge.rit.edu/edge/P14226/public/Final%20Documents%20Subdirectory/Developer_Guide_5_6_14.pdf

◦ Technical Paper summarizing results

http://edge.rit.edu/edge/P14226/public/Final%20Documents%20Subdirectory/P14226_Technical_Paper_RC_Camera_Car_5_6_14.pdf

◦ EDGE site detailing project development

http://edge.rit.edu/edge/P14226/public/Home

◦ Final program and file repository on EDGE

http://edge.rit.edu/edge/P14226/public/Final%20Documents%20Subdirectory

5/8/14 RC CAMERA CAR FINAL REVIEW 33

Page 34: ADVISOR: DR. BECKER-GOMEZ P14226 RC Camera Caredge.rit.edu/edge/P14226/public/Final Documents...ActiveX control with VBA macros for importing, converting, formatting, and plotting

BudgetAbout $500 was allocated to this project from RIT MSD

$536 was spent making the project

There is a total value of over $1500 in parts thanks to donors and reusing available components.

Future projects with a larger budget could use:

◦ Better chassis ~$200.00

◦ Better camera system ~$500.00

◦ More XBees ~$100.00

5/8/14 RC CAMERA CAR FINAL REVIEW 34

Major Budget Items Cost

Wireless Camera System $280.03

XBee RF Modules $39.99

Freescale Cup Car Chassis $200.00

Steering / Throttle Controller

$60.00

Console Building Supplies $44.88

Other $211.21

Other (Free) $771.91

Total $1,608.03

Page 35: ADVISOR: DR. BECKER-GOMEZ P14226 RC Camera Caredge.rit.edu/edge/P14226/public/Final Documents...ActiveX control with VBA macros for importing, converting, formatting, and plotting

Future Work SuggestionsFor balancing platform, the base chassis needs to be better quality

◦ More expensive, but less need to modify mechanically

◦ Motors with enough torque to achieve better PID performance

Modify console to more adequately conform to small children◦ Still needs to be able to fit full size adults

◦ Adjustable pedals, table height, and seat height for children

◦ Firmly mount all components to table, ground, etc.

Separate or isolate data logging from motor controls◦ Significant issues with noise due to motor shield

◦ Would need more XBees and thus better node networking

Incorporate dashboard instrument panel and other aesthetic improvements

Utilize new Simulink interface for Freescale Cup motor shield

5/8/14 RC CAMERA CAR FINAL REVIEW 35

Page 36: ADVISOR: DR. BECKER-GOMEZ P14226 RC Camera Caredge.rit.edu/edge/P14226/public/Final Documents...ActiveX control with VBA macros for importing, converting, formatting, and plotting

ConclusionsProject final product accomplished all achievable target metrics for customer needs

Exhibit at Imagine RIT was a major hit with significant participant interest that should be continued in future years

Controls application adequately conveys the real world application of PID controllers with many physical system issues that help improve students knowledge base

Most importantly, it is still fun to drive at any age.

5/8/14 RC CAMERA CAR FINAL REVIEW 36

Page 37: ADVISOR: DR. BECKER-GOMEZ P14226 RC Camera Caredge.rit.edu/edge/P14226/public/Final Documents...ActiveX control with VBA macros for importing, converting, formatting, and plotting

Additional SlidesP14226 EDGE SITE

RC CAMERA CAR FINAL REVIEW 375/8/14