Upload
others
View
1
Download
0
Embed Size (px)
Citation preview
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,
PCB Notes
BATTERY
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();
Velocity Sensing• On board: estimating Dx/DT
velocity sensing
Note: care about velocity sensing usually at cruise speed (also stopping)
Sharp GPS260
100 us response time
velocity sensing
Sharp GPS260
• Choose current 4 mA in LED
• Vcc = 3.3 V
• May want regulated/clean voltage for Vcc
velocity sensing
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
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
TSL 1401 line sensor
Line sensor
TSL 1401 line sensor
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
TSL 1401 line sensor NATCAR 8 bitFrame 0
Frame 0
Frame 1
Frame 2 Frame 2-Frame 0
Frame 1-Frame 0
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
Extra Slides
Differential amp to read back EMF for
H Bridge driving motor. Change values for
12V Back EMF…
Back EMF velocity sensing
3.3V
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