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

Post on 24-Dec-2015

221 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

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

• 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

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.

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

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)

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

8

Expression of the Sampled data in Computer

Blue: Analog data

Red: sampled data

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

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

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.

12

Sampling

Review: Period – Frequency

Sinusoidal periodical functions

•Frequency, period

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

• 2f = 2/T

•f = 1/T

13

14

DT and CT Periodic Function

Displayed and Reconstructed

15

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.

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

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

19

Sampling Theory

20

Sampling Theory

Trigonometric Fourier Series

21

Sampling Theory

22

Sampling Theory

23

Sampling Theory

24

Sampling Theory

25

Sampling Theory

26

Sampling Theory

(Aliasing)

27

Sampling Theory

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

top related