11 lecture slides me 3222 kinematics and control lab lab 2 ad da and sampling theory by dr. debao...

28
1 Lecture Slides ME 3222 Kinematics and Control Lab Lab 2 AD DA and Sampling Theory By Dr. Debao Zhou

Upload: andrew-jefferson

Post on 24-Dec-2015

220 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 11 Lecture Slides ME 3222 Kinematics and Control Lab Lab 2 AD DA and Sampling Theory By Dr. Debao Zhou

11

Lecture Slides

ME 3222 Kinematics and Control Lab

Lab 2 AD DA and Sampling Theory

By Dr. Debao Zhou

Page 2: 11 Lecture Slides ME 3222 Kinematics and Control Lab Lab 2 AD DA and Sampling Theory By Dr. Debao Zhou

2

System Review

Computer:

Software: Matlab (Lab 1)

Hardware: Sensory 626 card (Lab 2)

Controller (Labs 5 and 6)

Sensors:

Encoder/ accelerometer (Lab 3)

Amplifier Motor

External Equipment

(Project)

Lab 4

Page 3: 11 Lecture Slides ME 3222 Kinematics and Control Lab Lab 2 AD DA and Sampling Theory By Dr. Debao Zhou

• What will we do?

• What will we use?

• How to do?

• Why?– Your background

EE 2111 Linear Systems and Signal Analysis • Signal and system modeling concepts, system analysis in

time domain, Fourier series and Fourier transform. Discrete time domain signals and systems, Z transform, applications.

• Just read through slide #18.3

Page 4: 11 Lecture Slides ME 3222 Kinematics and Control Lab Lab 2 AD DA and Sampling Theory By Dr. Debao Zhou

4

Lab 2

• Task 1: Equipment, Simulink, • Build the model• Task 2: A/D - Set the power supply to

different voltages – Check and see if you're A/D program can read

the voltages correctly – Change the voltage range setting and repeat.

• Task 3: D/A - Send out different voltage to channel 0 from a program, check the output voltage using a multimeter to see if correct.

Page 5: 11 Lecture Slides ME 3222 Kinematics and Control Lab Lab 2 AD DA and Sampling Theory By Dr. Debao Zhou

5

Computer:

Data Acquisition and Processing

• Signals in data acquisition

Software: Matlab

Sensors e.g.

voltage

Amplifier

Hardware: Sensory 626 card (Lab 2)

A/D

Analog signal

Digital signal D/A

Digital signal

Motor

What is the difference between analog/digital continues-/discrete- time signals?

Analog signal

Page 6: 11 Lecture Slides ME 3222 Kinematics and Control Lab Lab 2 AD DA and Sampling Theory By Dr. Debao Zhou

6

Data Acquisition Card - Sensory 626

• http://www.sensoray.com/products/626.htm

• Six 24-bit counters for encoders• Four 14-bit D/A outputs (analog output)• Sixteen 16-bit differential A/D inputs (digital out input)• 48 digital signals (digital output)

Page 7: 11 Lecture Slides ME 3222 Kinematics and Control Lab Lab 2 AD DA and Sampling Theory By Dr. Debao Zhou

7

Data Acquisition Tasks

• Sampling• Convert analog voltage/current to digital data

(A/D)– Physical meanings of the analog data– Resolution

• Process of the digital data• Convert digital data to analog voltage/current

– Resolution– Physical meanings of the analog data

Page 8: 11 Lecture Slides ME 3222 Kinematics and Control Lab Lab 2 AD DA and Sampling Theory By Dr. Debao Zhou

8

Expression of the Sampled data in Computer

Blue: Analog data

Red: sampled data

Page 9: 11 Lecture Slides ME 3222 Kinematics and Control Lab Lab 2 AD DA and Sampling Theory By Dr. Debao Zhou

9

A/D Resolution calculation

• 16 bits ADC, measurement range ± 5v – The maximum number that could be represented with

a 16-bit word is 215 -1= 32767 . • The 15th bit is reserved for sign representation, • the represent numbers range is -32767 to +32767, or 2(16-1) -1

= 215 -1= 32767. • The resolution = 5v/32767 =5v/(215 -1 ) = 0.1525 mv

• Saturation: if the input value is beyond the measurable range, the digital value will saturate at the max/min value. – In the input is 6v, it will give 32767; – -9v will give -32767

Page 10: 11 Lecture Slides ME 3222 Kinematics and Control Lab Lab 2 AD DA and Sampling Theory By Dr. Debao Zhou

10

A/D Resolution Calculation

• The resolution calculation is similar to that of an ADC

• Example: – 12 bits DAC, measurement range ± 10v – The resolution = 10v/[(212-1)-1] = 4.88 mv

• If the digital number is beyond the range: – Case I: saturate (similar to the ADC case) – Case II: the voltage values repeat.

• The above 12-bit DAC range is -2047 to +2047, • if the digital value is 3000, it will give (3000-2047)/2047*10v =

4.66 v, instead of 3000/2047*10v =14.66v. • If the digital value is -2500, it will give

[-2500-(-2047)]/2.47*10= -9.76 mv

Page 11: 11 Lecture Slides ME 3222 Kinematics and Control Lab Lab 2 AD DA and Sampling Theory By Dr. Debao Zhou

11

Lab 2

• Task 1: Equipment, Simulink, • Build the model• Task 2: A/D - Set the power supply to

different voltages – Check and see if you're A/D program can read

the voltages correctly – Change the voltage range setting and repeat.

• Task 3: D/A - Send out different voltage to channel 0 from a program, check the output voltage using a multimeter to see if correct.

Page 12: 11 Lecture Slides ME 3222 Kinematics and Control Lab Lab 2 AD DA and Sampling Theory By Dr. Debao Zhou

12

Sampling

Page 13: 11 Lecture Slides ME 3222 Kinematics and Control Lab Lab 2 AD DA and Sampling Theory By Dr. Debao Zhou

Review: Period – Frequency

Sinusoidal periodical functions

•Frequency, period

•V=cos(t)=cos(2ft) = cos(2t/T)

• 2f = 2/T

•f = 1/T

13

Page 14: 11 Lecture Slides ME 3222 Kinematics and Control Lab Lab 2 AD DA and Sampling Theory By Dr. Debao Zhou

14

DT and CT Periodic Function

Page 15: 11 Lecture Slides ME 3222 Kinematics and Control Lab Lab 2 AD DA and Sampling Theory By Dr. Debao Zhou

Displayed and Reconstructed

15

Page 16: 11 Lecture Slides ME 3222 Kinematics and Control Lab Lab 2 AD DA and Sampling Theory By Dr. Debao Zhou

16

Sampling Theory

A band-limited signal can be fully reconstructed from its samples, provided that the sampling rate (fs) exceeds twice the maximum frequency (B) in the band-limited signal (fs >= 2B).

This minimum sampling frequency (fs) is called the Nyquist rate.

This results, usually attributed to Nyquist and Shannon, is known as the Nyquist–Shannon sampling theorem, or simply the sampling theorem.

Page 17: 11 Lecture Slides ME 3222 Kinematics and Control Lab Lab 2 AD DA and Sampling Theory By Dr. Debao Zhou

Sampling frequency, input signal frequency and output signal frequency relationship (sine wave)

17

fsfs/2 3fs/2 2fs Input Frequency

Output Frequency

Sampling Frequency

fout

fin

foutfin fs

Page 18: 11 Lecture Slides ME 3222 Kinematics and Control Lab Lab 2 AD DA and Sampling Theory By Dr. Debao Zhou

18

Lab 2

• Task 4: demonstration of the sampling theorem – Set the sampling frequency to be 1000 Hz;– Change input signal frequency on the function

generator to vary from 50 Hz to 1500Hz. – For each input frequency, write down the

estimated frequency of the output signal from the oscilloscope

Page 19: 11 Lecture Slides ME 3222 Kinematics and Control Lab Lab 2 AD DA and Sampling Theory By Dr. Debao Zhou

19

Sampling Theory

Page 20: 11 Lecture Slides ME 3222 Kinematics and Control Lab Lab 2 AD DA and Sampling Theory By Dr. Debao Zhou

20

Sampling Theory

Trigonometric Fourier Series

Page 21: 11 Lecture Slides ME 3222 Kinematics and Control Lab Lab 2 AD DA and Sampling Theory By Dr. Debao Zhou

21

Sampling Theory

Page 22: 11 Lecture Slides ME 3222 Kinematics and Control Lab Lab 2 AD DA and Sampling Theory By Dr. Debao Zhou

22

Sampling Theory

Page 23: 11 Lecture Slides ME 3222 Kinematics and Control Lab Lab 2 AD DA and Sampling Theory By Dr. Debao Zhou

23

Sampling Theory

Page 24: 11 Lecture Slides ME 3222 Kinematics and Control Lab Lab 2 AD DA and Sampling Theory By Dr. Debao Zhou

24

Sampling Theory

Page 25: 11 Lecture Slides ME 3222 Kinematics and Control Lab Lab 2 AD DA and Sampling Theory By Dr. Debao Zhou

25

Sampling Theory

Page 26: 11 Lecture Slides ME 3222 Kinematics and Control Lab Lab 2 AD DA and Sampling Theory By Dr. Debao Zhou

26

Sampling Theory

(Aliasing)

Page 27: 11 Lecture Slides ME 3222 Kinematics and Control Lab Lab 2 AD DA and Sampling Theory By Dr. Debao Zhou

27

Sampling Theory

Page 28: 11 Lecture Slides ME 3222 Kinematics and Control Lab Lab 2 AD DA and Sampling Theory By Dr. Debao Zhou

28

Sampling - Reconstruction

)()(

is there,by output hemultiply t weIf

).(1

)(

is thereansform,Fourier tr inverse theTake

)(1

)(

is therefilter, lowpass after the then ,2 If

tmtmT

T

tmT

tm

fMT

fM

Bf

ss

s

ss

ss

s