EECS 192: Mechatronics Design Lab Discussion 6: Velocity Control - - PowerPoint PPT Presentation

eecs 192 mechatronics design lab
SMART_READER_LITE
LIVE PREVIEW

EECS 192: Mechatronics Design Lab Discussion 6: Velocity Control - - PowerPoint PPT Presentation

EECS 192: Mechatronics Design Lab Discussion 6: Velocity Control GSI: Justin Yim 1 & 2 Mar 2017 (Week 6) 1 PCB Peer Review 2 Velocity Sensing 3 Feedback Control 4 Summary Ducky (UCB EECS) Mechatronics Design Lab 1 & 2 Mar 2017 (Week 6)


slide-1
SLIDE 1

EECS 192: Mechatronics Design Lab

Discussion 6: Velocity Control GSI: Justin Yim 1 & 2 Mar 2017 (Week 6)

1 PCB Peer Review 2 Velocity Sensing 3 Feedback Control 4 Summary

Ducky (UCB EECS) Mechatronics Design Lab 1 & 2 Mar 2017 (Week 6) 1 / 15

slide-2
SLIDE 2

PCB Peer Review

PCB Peer Review

Ducky (UCB EECS) Mechatronics Design Lab 1 & 2 Mar 2017 (Week 6) 2 / 15

slide-3
SLIDE 3

PCB Peer Review Activity

PCB Peer Review

◮ Why peer review?

◮ Get a fresh perspective on your board to

catch bugs you’ve missed

◮ Get a new opinion from someone with a

different background

◮ Facilitate transfer of knowledge

◮ Things to look for in your peer reviews:

◮ Schematic style: messiness hides bugs! ◮ Circuit safety and spec check ◮ Layout sanity: DRC violations, don’t

design for minimums

◮ Really, anything that looks off

Hopefully a fairly readable schematic

Ducky (UCB EECS) Mechatronics Design Lab 1 & 2 Mar 2017 (Week 6) 3 / 15

slide-4
SLIDE 4

PCB Peer Review Activity

PCB Peer Review

Pair up with another team

(or another two teams, if teams don’t line up)

Bring up the PCB Peer Review Checklist

(www-inst.eecs.berkeley.edu/~ee192/sp15/docs/dis5-pcbchecklist.pdf) but feel free to add additional criteria as you want

You’ll have 30 minutes to review each other’s boards

(so about 15 minutes per team in a group)

Note anything you really liked about the boards you reviewed

as well as pitfalls others should know and avoid

We’ll discuss as a class after you’re done in groups

Ducky (UCB EECS) Mechatronics Design Lab 1 & 2 Mar 2017 (Week 6) 4 / 15

slide-5
SLIDE 5

Velocity Sensing

Velocity Sensing

Ducky (UCB EECS) Mechatronics Design Lab 1 & 2 Mar 2017 (Week 6) 5 / 15

slide-6
SLIDE 6

Velocity Sensing Basics

Brainstorm!

What are some ways to sense velocity?

pros and cons of your methods? Ducky (UCB EECS) Mechatronics Design Lab 1 & 2 Mar 2017 (Week 6) 6 / 15

slide-7
SLIDE 7

Velocity Sensing Simple Encoder

Optical Encoders

Optical encoders...

◮ Detects when sensor is lit up ◮ Reflective sensor: light up codewheel,

sensor detects reflection

◮ Photointerruptors: direct light beam from

transmittor to detector, interrupt by object

◮ Outputs a pulse train

Sharp GP2S60 ...

◮ Compact reflective sensor including emitter

and detector

◮ Open collector output ◮ Optimal distance 0.7mm

GP2S60 reflective sensor

Ducky (UCB EECS) Mechatronics Design Lab 1 & 2 Mar 2017 (Week 6) 7 / 15

slide-8
SLIDE 8

Velocity Sensing Simple Encoder

Software Techniques

Two simple ways to measure speed: Pulse width measurement

◮ Measure width between transitions

Pulse counting

◮ Count number of transitions in timespan

Ducky (UCB EECS) Mechatronics Design Lab 1 & 2 Mar 2017 (Week 6) 8 / 15

slide-9
SLIDE 9

Velocity Sensing Simple Encoder

Beaglebone Blue

The Beaglebone Blue has a real-time module dedicated to reading quadrature encoders

Ducky (UCB EECS) Mechatronics Design Lab 1 & 2 Mar 2017 (Week 6) 9 / 15

slide-10
SLIDE 10

Velocity Sensing Simple Encoder

Quadrature Encoder

◮ Two square wave signals phase shifted by

90 degrees

◮ Generated by two sensors at an offset ◮ Can distinguish forwards from backwards ◮ More robust to spurious spikes

Two GP2S60 sensors

Ducky (UCB EECS) Mechatronics Design Lab 1 & 2 Mar 2017 (Week 6) 10 / 15

slide-11
SLIDE 11

Velocity Sensing Simple Encoder

Quadrature Hack

◮ Beaglebone Blue only accepts quadrature

inputs

◮ If your car only goes forwards, we can

“fake” one signal

◮ Delay the signal with an RC circuit and

pass it through a comparator Quadrature hack

Ducky (UCB EECS) Mechatronics Design Lab 1 & 2 Mar 2017 (Week 6) 11 / 15

slide-12
SLIDE 12

Velocity Sensing Simple Encoder

Live Demo!

Low speed demo High speed demo

what waveforms should you expect to see?

Issues

skipped pulses, inconsistent pulse lengths Ducky (UCB EECS) Mechatronics Design Lab 1 & 2 Mar 2017 (Week 6) 12 / 15

slide-13
SLIDE 13

Feedback Control

Feedback Control

Ducky (UCB EECS) Mechatronics Design Lab 1 & 2 Mar 2017 (Week 6) 13 / 15

slide-14
SLIDE 14

Feedback Control PID control

PID

◮ Control is the sum of three components: PWM = P + I + D ◮ Proportional Control

◮ P = Kp ∗ ( difference between sensor input and data) ◮ Very intuitive- increasing effort for increasing error.

◮ Integral Control

◮ I = Ki ∗ (integration of error over time) ◮ Overcomes offset errors (example: friction)

◮ Derivative Control

◮ D = Kd ∗ (instantaneous derivative of the error) ◮ Helps prevent oscillation (example: steering)

◮ Video about PID control on vehicle

◮ https://www.youtube.com/watch?v=4Y7zG48uHRo ◮ Video courtesy of MIT Aerospace Controls Lab Ducky (UCB EECS) Mechatronics Design Lab 1 & 2 Mar 2017 (Week 6) 14 / 15

slide-15
SLIDE 15

Summary

Summary

◮ Optical Encoders ◮ PID control overview

Ducky (UCB EECS) Mechatronics Design Lab 1 & 2 Mar 2017 (Week 6) 15 / 15