EECS 192: Mechatronics Design Lab Discussion 12: AGC & - - PowerPoint PPT Presentation

eecs 192 mechatronics design lab
SMART_READER_LITE
LIVE PREVIEW

EECS 192: Mechatronics Design Lab Discussion 12: AGC & - - PowerPoint PPT Presentation

EECS 192: Mechatronics Design Lab Discussion 12: AGC & Mechanical Tuning GSI: Varun Tolani 15 & 16 Apr 2015 (Week 12) 1 Automatic Gain Control Ducky (UCB EECS) Mechatronics Design Lab 15 & 16 Apr 2015 (Week 12) 1 / 5 Automatic


slide-1
SLIDE 1

EECS 192: Mechatronics Design Lab

Discussion 12: AGC & Mechanical Tuning GSI: Varun Tolani 15 & 16 Apr 2015 (Week 12)

1 Automatic Gain Control

Ducky (UCB EECS) Mechatronics Design Lab 15 & 16 Apr 2015 (Week 12) 1 / 5

slide-2
SLIDE 2

Automatic Gain Control

Automatic Gain Control

Ducky (UCB EECS) Mechatronics Design Lab 15 & 16 Apr 2015 (Week 12) 2 / 5

slide-3
SLIDE 3

Automatic Gain Control

◮ So the lighting on the 3rd floor is different than in the lab? ◮ Solutions

◮ External Lights (LED, flashlights, etc.) ◮ Robust line detection (derivatives, LPF, cross correlation- see

discussion 8)

◮ Automatic Gain Control!! Ducky (UCB EECS) Mechatronics Design Lab 15 & 16 Apr 2015 (Week 12) 3 / 5

slide-4
SLIDE 4

Automatic Gain Control

TSL1401 Timing- No Automatic Gain Control

Ducky (UCB EECS) Mechatronics Design Lab 15 & 16 Apr 2015 (Week 12) 4 / 5

slide-5
SLIDE 5

Automatic Gain Control

Pseudocode

void take_pic (){ SI High; CLK High; SI Low; for(i=0 to 128){ CLK High; camera[i] = read_adc (); CLK_Low; } }

◮ Each call to take pic reads out the previous capacitor voltages ◮ There is currently no exposure control ◮ Next up → Let’s run take pic() on a PIT!

Ducky (UCB EECS) Mechatronics Design Lab 15 & 16 Apr 2015 (Week 12) 5 / 5

slide-6
SLIDE 6

Automatic Gain Control

TSL1401 PIT Timing- AGC v1

◮ Don’t need to read garbage frames!

Ducky (UCB EECS) Mechatronics Design Lab 15 & 16 Apr 2015 (Week 12) 6 / 5

slide-7
SLIDE 7

Automatic Gain Control

TSL1401 PIT Timing- AGC v2

◮ Don’t need to read garbage frames! ◮ Removing read adc speed’s up code execution significantly

Ducky (UCB EECS) Mechatronics Design Lab 15 & 16 Apr 2015 (Week 12) 7 / 5

slide-8
SLIDE 8

Automatic Gain Control

Pseudocode

void take_pic(int mode ){ SI High; CLK High; SI Low; for(i=0 to 128){ CLK High; if (mode == 1)// Read camera[i] = read_adc (); CLK_Low; } if (mode == 0)// Delay delay(camera_delay ); else // Read adjust_camera_delay (); // How might you do this? } void pit_handler (){ /* Clock out garbage data & expose new image */ take_pic (0); /* Read new image and update exposure delay */ take_pic (1); }

Ducky (UCB EECS) Mechatronics Design Lab 15 & 16 Apr 2015 (Week 12) 8 / 5

slide-9
SLIDE 9

Automatic Gain Control

Code Structure v1

int main (){ take_pic (0); take_pic (1); find_line (); estimate_velocity (); calculate_new_controls (); telemetry.do_io (); } void pit_handler (){ apply_servo_control (); apply_motor_control (); }

◮ Pro- Interrupt executes very quickly- potentially easier to debug ◮ Con- Potentially updating servo/motor control on old sensor readings

Ducky (UCB EECS) Mechatronics Design Lab 15 & 16 Apr 2015 (Week 12) 9 / 5

slide-10
SLIDE 10

Automatic Gain Control

Code Structure v2

int main (){ telemetry.do_io (); } void pit_handler (){ take_pic (0); take_pic (1); find_line (); estimate_velocity (); calculate_new_controls (); apply_servo_control (); apply_motor_control (); }

◮ Pro- Updating servo/motor control on newest sensor readings ◮ Con- Interrupt execution time must fit within interrupt period

Ducky (UCB EECS) Mechatronics Design Lab 15 & 16 Apr 2015 (Week 12) 10 / 5

slide-11
SLIDE 11

Mechanical Tuning

Mechanical Tuning

Ducky (UCB EECS) Mechatronics Design Lab 15 & 16 Apr 2015 (Week 12) 11 / 5

slide-12
SLIDE 12

Mechanical Tuning

Disclaimer

◮ I’m not a mechanical engineer

◮ I’ve tuned exactly zero cars

◮ Information here from various Internet

sources, which hopefully is correct

◮ (it passes the “smell test”)

◮ If it sounds wrong, it might really be...

not actually that bad

from knowyourmeme.com

Ducky (UCB EECS) Mechatronics Design Lab 15 & 16 Apr 2015 (Week 12) 12 / 5

slide-13
SLIDE 13

Mechanical Tuning Motivation

Goals

What’s the ultimate goal here?

Ducky (UCB EECS) Mechatronics Design Lab 15 & 16 Apr 2015 (Week 12) 13 / 5

slide-14
SLIDE 14

Mechanical Tuning Motivation

Goals

What’s the ultimate goal here?

◮ Reduce race time

How do we do that? what you want

from Big Rigs: Over the Road Racing a game that you should never touch Ducky (UCB EECS) Mechatronics Design Lab 15 & 16 Apr 2015 (Week 12) 13 / 5

slide-15
SLIDE 15

Mechanical Tuning Motivation

Goals

What’s the ultimate goal here?

◮ Reduce race time

How do we do that?

◮ High acceleration - speed on straights ◮ Fast cornering - fast through turns ◮ High deceleration - slowing for turns

Essentially maximizing acceleration. How? what you want

from Big Rigs: Over the Road Racing a game that you should never touch Ducky (UCB EECS) Mechatronics Design Lab 15 & 16 Apr 2015 (Week 12) 13 / 5

slide-16
SLIDE 16

Mechanical Tuning Motivation

Goals

What’s the ultimate goal here?

◮ Reduce race time

How do we do that?

◮ High acceleration - speed on straights ◮ Fast cornering - fast through turns ◮ High deceleration - slowing for turns

Essentially maximizing acceleration. How?

◮ Maximize tire grip!

what you want

from Big Rigs: Over the Road Racing a game that you should never touch Ducky (UCB EECS) Mechatronics Design Lab 15 & 16 Apr 2015 (Week 12) 13 / 5

slide-17
SLIDE 17

Mechanical Tuning Tires

Tire Grip Curves

Tire Grip vs. Load Curve

◮ Tire grip is nonlinear with load ◮ Diminishing returns with more pressure

So I have 4 tires - what’s the optimal distribution? tire grip curve

Ducky (UCB EECS) Mechatronics Design Lab 15 & 16 Apr 2015 (Week 12) 14 / 5

slide-18
SLIDE 18

Mechanical Tuning Tires

Tire Grip Curves

Tire Grip vs. Load Curve

◮ Tire grip is nonlinear with load ◮ Diminishing returns with more pressure

So I have 4 tires - what’s the optimal distribution?

◮ Completely even ◮ Don’t trade a loss of larger amount of grip

for a gain of smaller amount of grip tire grip curve

Ducky (UCB EECS) Mechatronics Design Lab 15 & 16 Apr 2015 (Week 12) 14 / 5

slide-19
SLIDE 19

Mechanical Tuning Suspension Tuning

Camber

Camber: angle between wheel and vertical (from front)

◮ Positive if tilting outwards ◮ Negative if tilting inwards

What’s optimal to maximize contact area? positive camber negative camber

Ducky (UCB EECS) Mechatronics Design Lab 15 & 16 Apr 2015 (Week 12) 15 / 5

slide-20
SLIDE 20

Mechanical Tuning Suspension Tuning

Camber

Camber: angle between wheel and vertical (from front)

◮ Positive if tilting outwards ◮ Negative if tilting inwards

What’s optimal to maximize contact area?

◮ 0 degree, ideally

But need to account for turning chassis roll

Ducky (UCB EECS) Mechatronics Design Lab 15 & 16 Apr 2015 (Week 12) 15 / 5

slide-21
SLIDE 21

Mechanical Tuning Suspension Tuning

Camber

Camber: angle between wheel and vertical (from front)

◮ Positive if tilting outwards ◮ Negative if tilting inwards

What’s optimal to maximize contact area?

◮ 0 degree, ideally

But need to account for turning chassis roll

◮ Increases camber angle during turns ◮ So slightly negative camber (1°-4°) to

increase traction when cornering

Ducky (UCB EECS) Mechatronics Design Lab 15 & 16 Apr 2015 (Week 12) 15 / 5

slide-22
SLIDE 22

Mechanical Tuning Suspension Tuning

Camber

Camber: angle between wheel and vertical (from front)

◮ Positive if tilting outwards ◮ Negative if tilting inwards

What’s optimal to maximize contact area?

◮ 0 degree, ideally

But need to account for turning chassis roll

◮ Increases camber angle during turns ◮ So slightly negative camber (1°-4°) to

increase traction when cornering camber effects from turning

Ducky (UCB EECS) Mechatronics Design Lab 15 & 16 Apr 2015 (Week 12) 15 / 5

slide-23
SLIDE 23

Mechanical Tuning Suspension Tuning

Caster

Caster: angle between steering axis and vertical

◮ Positive when steering axis line intersects

road ahead of contact patch What are the stability effects of positive caster?

think shopping cart “caster” wheels

caster

Ducky (UCB EECS) Mechatronics Design Lab 15 & 16 Apr 2015 (Week 12) 16 / 5

slide-24
SLIDE 24

Mechanical Tuning Suspension Tuning

Caster

Caster: angle between steering axis and vertical

◮ Positive when steering axis line intersects

road ahead of contact patch What are the stability effects of positive caster?

think shopping cart “caster” wheels ◮ Self-centering effect

◮ Contact patch “trails” steering axis

◮ Typically 3°-5°recommended

◮ Less may increase steering at stability cost

◮ Overall effect is fairly small

caster self-centering effect

Ducky (UCB EECS) Mechatronics Design Lab 15 & 16 Apr 2015 (Week 12) 16 / 5

slide-25
SLIDE 25

Mechanical Tuning Suspension Tuning

Toe

Toe: angle between wheels, viewed from top

◮ Toe-in (positive): inwards towards front ◮ Toe-out (negative): outwards towards front

Effects of toe:

◮ Toe-in provides straight-line stability ◮ Toe-out provides better turn-in but

amplifies disturbances

◮ Small changes produces noticable effect ◮ Recommended range (front): -3°-1°

Why might toe be bad? toe-in toe-out

Ducky (UCB EECS) Mechatronics Design Lab 15 & 16 Apr 2015 (Week 12) 17 / 5

slide-26
SLIDE 26

Mechanical Tuning Suspension Tuning

Toe

Toe: angle between wheels, viewed from top

◮ Toe-in (positive): inwards towards front ◮ Toe-out (negative): outwards towards front

Effects of toe:

◮ Toe-in provides straight-line stability ◮ Toe-out provides better turn-in but

amplifies disturbances

◮ Small changes produces noticable effect ◮ Recommended range (front): -3°-1°

Why might toe be bad?

◮ Wheels rub against road - reduces tire life

toe-in toe-out

Ducky (UCB EECS) Mechatronics Design Lab 15 & 16 Apr 2015 (Week 12) 17 / 5

slide-27
SLIDE 27

Mechanical Tuning Weight Tuning

Weight Distribution

Freescale Car setup:

◮ Front wheels: steering ◮ Rear wheels: power

What does front/back weight distribution do?

Ducky (UCB EECS) Mechatronics Design Lab 15 & 16 Apr 2015 (Week 12) 18 / 5

slide-28
SLIDE 28

Mechanical Tuning Weight Tuning

Weight Distribution

Freescale Car setup:

◮ Front wheels: steering ◮ Rear wheels: power

What does front/back weight distribution do?

◮ Towards front: more steering grip ◮ Towards back: more acceleration traction

Ducky (UCB EECS) Mechatronics Design Lab 15 & 16 Apr 2015 (Week 12) 18 / 5

slide-29
SLIDE 29

Vehicle Dynamics

Vehicle Dynamics

Ducky (UCB EECS) Mechatronics Design Lab 15 & 16 Apr 2015 (Week 12) 19 / 5

slide-30
SLIDE 30

Vehicle Dynamics Weight Transfer

Lateral Weight Transfer

What happens to my effective weight distribution when turning?

assume stiff suspension for simplicity analysis with springs much more involved

direction of travel

Ducky (UCB EECS) Mechatronics Design Lab 15 & 16 Apr 2015 (Week 12) 20 / 5

slide-31
SLIDE 31

Vehicle Dynamics Weight Transfer

Lateral Weight Transfer

What happens to my effective weight distribution when turning?

assume stiff suspension for simplicity analysis with springs much more involved ◮ Inward turning force from wheels ◮ Applies torque, rolling to outer side of turn ◮ Increases pressure on outer wheel ◮ Decreases pressure on inner wheel

So total grip reduced - how to fix? direction of travel weight transfer

Ducky (UCB EECS) Mechatronics Design Lab 15 & 16 Apr 2015 (Week 12) 20 / 5

slide-32
SLIDE 32

Vehicle Dynamics Weight Transfer

Lateral Weight Transfer

What happens to my effective weight distribution when turning?

assume stiff suspension for simplicity analysis with springs much more involved ◮ Inward turning force from wheels ◮ Applies torque, rolling to outer side of turn ◮ Increases pressure on outer wheel ◮ Decreases pressure on inner wheel

So total grip reduced - how to fix?

◮ Note lever effect of turning force ◮ Shorten lever to reduce torque

direction of travel weight transfer

Ducky (UCB EECS) Mechatronics Design Lab 15 & 16 Apr 2015 (Week 12) 20 / 5

slide-33
SLIDE 33

Vehicle Dynamics Weight Transfer

Longitudal Weight Transfer

What happens to my effective weight distribution when accelerating?

Ducky (UCB EECS) Mechatronics Design Lab 15 & 16 Apr 2015 (Week 12) 21 / 5

slide-34
SLIDE 34

Vehicle Dynamics Weight Transfer

Longitudal Weight Transfer

What happens to my effective weight distribution when accelerating?

◮ Acceleration force produced at rear wheel ◮ Applies torque pitching up ◮ Increases traction on motor wheels ◮ Decreases grip on steering wheels

Ducky (UCB EECS) Mechatronics Design Lab 15 & 16 Apr 2015 (Week 12) 21 / 5

slide-35
SLIDE 35

Vehicle Dynamics Weight Transfer

Tuning Ride Height

Ride height: distance between track surface to underside of chassis We know lower center-of-gravity minimizes weight transfer. What are the limits? ride height

Ducky (UCB EECS) Mechatronics Design Lab 15 & 16 Apr 2015 (Week 12) 22 / 5

slide-36
SLIDE 36

Vehicle Dynamics Weight Transfer

Tuning Ride Height

Ride height: distance between track surface to underside of chassis We know lower center-of-gravity minimizes weight transfer. What are the limits?

◮ Need to clear uneven surfaces

◮ Like the courtyard tile gaps ◮ Or the Freescale Cup hump

◮ Don’t drag your chassis

◮ you know who you are...

ride height

Ducky (UCB EECS) Mechatronics Design Lab 15 & 16 Apr 2015 (Week 12) 22 / 5

slide-37
SLIDE 37

Vehicle Dynamics Steering

Ackermann Steering

You may have noticed that your wheels aren’t parallel when turning. Why?

Ducky (UCB EECS) Mechatronics Design Lab 15 & 16 Apr 2015 (Week 12) 23 / 5

slide-38
SLIDE 38

Vehicle Dynamics Steering

Ackermann Steering

You may have noticed that your wheels aren’t parallel when turning. Why?

◮ Different turn radius for inner/outer wheels ◮ Ackermann steering: angular difference

between inner and outer wheels for different turn radius

◮ A result of the different lengths / angles of

steering linkages

Ducky (UCB EECS) Mechatronics Design Lab 15 & 16 Apr 2015 (Week 12) 23 / 5

slide-39
SLIDE 39

Vehicle Dynamics Steering

Slipping

Given the Ackermann steering geometry... What happens if the front wheels slip?

Ducky (UCB EECS) Mechatronics Design Lab 15 & 16 Apr 2015 (Week 12) 24 / 5

slide-40
SLIDE 40

Vehicle Dynamics Steering

Slipping

Given the Ackermann steering geometry... What happens if the front wheels slip?

◮ Understeer: turns less than intended ◮ Turning radius increased

What happens if the back wheels slip?

Ducky (UCB EECS) Mechatronics Design Lab 15 & 16 Apr 2015 (Week 12) 24 / 5

slide-41
SLIDE 41

Vehicle Dynamics Steering

Slipping

Given the Ackermann steering geometry... What happens if the front wheels slip?

◮ Understeer: turns less than intended ◮ Turning radius increased

What happens if the back wheels slip?

◮ Oversteer: turns more than intended ◮ Turning radius decreased

Ducky (UCB EECS) Mechatronics Design Lab 15 & 16 Apr 2015 (Week 12) 24 / 5

slide-42
SLIDE 42

Vehicle Dynamics Steering

Benchmarking

Obviously, what matters in the end is measurable performance So, what are some ways to measure success?

Ducky (UCB EECS) Mechatronics Design Lab 15 & 16 Apr 2015 (Week 12) 25 / 5

slide-43
SLIDE 43

Vehicle Dynamics Steering

Benchmarking

Obviously, what matters in the end is measurable performance So, what are some ways to measure success?

◮ Straight-line acceleration ◮ Maximum cornering velocity ◮ Minimum cornering radius

We’ve typically had less experience with mechanical tuning

◮ Try to benchmark and measure results ◮ Have a known-good configuration

◮ “The better is the enemy of the good”

◮ Sensor and control algorithms important

Ducky (UCB EECS) Mechatronics Design Lab 15 & 16 Apr 2015 (Week 12) 25 / 5

slide-44
SLIDE 44

Summary

Summary

Summary

◮ Demo: adjusting suspension parameters ◮ Maximize grip to maximize acceleration to reduce track times ◮ Tune camber (slightly negative), caster (slightly positive), toe ◮ Lower center of gravity: minimize weight transfer ◮ Measure, measure, measure ◮ Many topics not covered: tires, springs, shocks, sprung roll

(Possibly) one more discussion section left

◮ Any topics people want to see?

Ducky (UCB EECS) Mechatronics Design Lab 15 & 16 Apr 2015 (Week 12) 26 / 5