17
EECS192 Lecture 7 Mar. 5, 2019 Topics Quiz 3 PCB quick note Speed sensing/velocity control- quick intro Line sensor- processing Automatic Gain Control Edge detection/fitting Sanity check: median/outlier HW1 Python template and Natcar 2016 team1 data (under Resources on Piazza) Notes: 1. Check off- 3/8/2019 : benchtop velocity control + Lab Clean (individual) 3/15/2019: benchtop line tracking (line camera+servo) 3/22/2018 drop-and-run, figure 8 2. Community Spirit: PCB peer review, Piazza, helping fellow students 3. CalDay Sat. April 13 @ UCB,

Topicsee192/sp19/files/lec7.pdf · 2019. 5. 13. · EECS192 Lecture 7 Mar. 5, 2019 Topics • Quiz 3 • PCB quick note • Speed sensing/velocity control- quick intro • Line sensor-

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Topicsee192/sp19/files/lec7.pdf · 2019. 5. 13. · EECS192 Lecture 7 Mar. 5, 2019 Topics • Quiz 3 • PCB quick note • Speed sensing/velocity control- quick intro • Line sensor-

EECS192 Lecture 7

Mar. 5, 2019

Topics• Quiz 3

• PCB quick note

• Speed sensing/velocity control- quick intro

• Line sensor- processing– Automatic Gain Control

– Edge detection/fitting

– Sanity check: median/outlier

• HW1 Python template and Natcar 2016 team1 data

(under Resources on Piazza)

Notes:

1. Check off-

• 3/8/2019 : benchtop velocity control

+ Lab Clean (individual)

• 3/15/2019: benchtop line tracking (line camera+servo)

• 3/22/2018 drop-and-run, figure 8

2. Community Spirit: PCB peer review, Piazza, helping fellow students

3. CalDay Sat. April 13 @ UCB,

Page 2: Topicsee192/sp19/files/lec7.pdf · 2019. 5. 13. · EECS192 Lecture 7 Mar. 5, 2019 Topics • Quiz 3 • PCB quick note • Speed sensing/velocity control- quick intro • Line sensor-

PCB Notes

BATTERY

Page 3: Topicsee192/sp19/files/lec7.pdf · 2019. 5. 13. · EECS192 Lecture 7 Mar. 5, 2019 Topics • Quiz 3 • PCB quick note • Speed sensing/velocity control- quick intro • Line sensor-

On board- quick intro

• Shaft encoder

• Incremental position

time_min = rc_nanos_since_boot();

angle1 = rc_encoder_read ( int ch);

time_max = rc_nanos_since_boot();

Page 4: Topicsee192/sp19/files/lec7.pdf · 2019. 5. 13. · EECS192 Lecture 7 Mar. 5, 2019 Topics • Quiz 3 • PCB quick note • Speed sensing/velocity control- quick intro • Line sensor-

Velocity Sensing• On board: estimating Dx/DT

velocity sensing

Note: care about velocity sensing usually at cruise speed (also stopping)

Page 5: Topicsee192/sp19/files/lec7.pdf · 2019. 5. 13. · EECS192 Lecture 7 Mar. 5, 2019 Topics • Quiz 3 • PCB quick note • Speed sensing/velocity control- quick intro • Line sensor-

Sharp GPS260

100 us response time

velocity sensing

Page 6: Topicsee192/sp19/files/lec7.pdf · 2019. 5. 13. · EECS192 Lecture 7 Mar. 5, 2019 Topics • Quiz 3 • PCB quick note • Speed sensing/velocity control- quick intro • Line sensor-

Sharp GPS260

• Choose current 4 mA in LED

• Vcc = 3.3 V

• May want regulated/clean voltage for Vcc

velocity sensing

Page 7: Topicsee192/sp19/files/lec7.pdf · 2019. 5. 13. · EECS192 Lecture 7 Mar. 5, 2019 Topics • Quiz 3 • PCB quick note • Speed sensing/velocity control- quick intro • Line sensor-

Non-inverting amp to measure motor

current.

Back EMF can be estimated from battery

voltage and motor resistance.

Back EMF velocity sensing

1.8V

+

-0.01 ohm

(10 squares)

To A/D

Low voltage r-r op-amp

Page 8: Topicsee192/sp19/files/lec7.pdf · 2019. 5. 13. · EECS192 Lecture 7 Mar. 5, 2019 Topics • Quiz 3 • PCB quick note • Speed sensing/velocity control- quick intro • Line sensor-

Velocity Control overview

On board…Proportional control:

U = kp*e = kp* (r-y);

Proportional + integral controlU = kp*e + ki * e_sum;

e_sum = e_sum + e;

PWM

Commanded

velocity

Sensed velocity

Page 9: Topicsee192/sp19/files/lec7.pdf · 2019. 5. 13. · EECS192 Lecture 7 Mar. 5, 2019 Topics • Quiz 3 • PCB quick note • Speed sensing/velocity control- quick intro • Line sensor-

TSL 1401 line sensor

Line sensor

Page 10: Topicsee192/sp19/files/lec7.pdf · 2019. 5. 13. · EECS192 Lecture 7 Mar. 5, 2019 Topics • Quiz 3 • PCB quick note • Speed sensing/velocity control- quick intro • Line sensor-

TSL 1401 line sensor

Line sensor

Page 11: Topicsee192/sp19/files/lec7.pdf · 2019. 5. 13. · EECS192 Lecture 7 Mar. 5, 2019 Topics • Quiz 3 • PCB quick note • Speed sensing/velocity control- quick intro • Line sensor-

TSL 1401 line sensor- option exposure control(would need to modify PRU code)

Line sensor

SI

CLK

AO

Exposure time (>25 us)

129 clocks

Clock only

no A/D read

A/D read

~12 us

Page 12: Topicsee192/sp19/files/lec7.pdf · 2019. 5. 13. · EECS192 Lecture 7 Mar. 5, 2019 Topics • Quiz 3 • PCB quick note • Speed sensing/velocity control- quick intro • Line sensor-

TSL 1401 line sensor NATCAR 8 bitFrame 0

Frame 0

Frame 1

Frame 2 Frame 2-Frame 0

Frame 1-Frame 0

Line sensor

Page 13: Topicsee192/sp19/files/lec7.pdf · 2019. 5. 13. · EECS192 Lecture 7 Mar. 5, 2019 Topics • Quiz 3 • PCB quick note • Speed sensing/velocity control- quick intro • Line sensor-

Python Template# track_center_list - A length n array of integers from 0 to 127.

Represents the predicted center of the line in each frame.

# track_found_list - A length n array of Booleans (100=true, 10 = false).

Represents whether or not each frame contains a detected line.

# cross_found_list - A length n array of booleans.

Represents whether or not each frame contains a crossing.

Start line finish linecrossingSteps

Page 14: Topicsee192/sp19/files/lec7.pdf · 2019. 5. 13. · EECS192 Lecture 7 Mar. 5, 2019 Topics • Quiz 3 • PCB quick note • Speed sensing/velocity control- quick intro • Line sensor-
Page 15: Topicsee192/sp19/files/lec7.pdf · 2019. 5. 13. · EECS192 Lecture 7 Mar. 5, 2019 Topics • Quiz 3 • PCB quick note • Speed sensing/velocity control- quick intro • Line sensor-

Extra Slides

Page 16: Topicsee192/sp19/files/lec7.pdf · 2019. 5. 13. · EECS192 Lecture 7 Mar. 5, 2019 Topics • Quiz 3 • PCB quick note • Speed sensing/velocity control- quick intro • Line sensor-

Differential amp to read back EMF for

H Bridge driving motor. Change values for

12V Back EMF…

Back EMF velocity sensing

3.3V

Page 17: Topicsee192/sp19/files/lec7.pdf · 2019. 5. 13. · EECS192 Lecture 7 Mar. 5, 2019 Topics • Quiz 3 • PCB quick note • Speed sensing/velocity control- quick intro • Line sensor-

SW

t

closed

im

VL

open

0 57 us20 us

7.5V

5 amp

6.5 amp

-2.65V

+

-10v

+ VL -

vDS0.1 ohm

SW

Lim

Rm

e+ -

2v

Snubber/flyback diode

Back EMF velocity sensing

VDS = 10V - VDIODE