April 17, 2015Jonathan Valvano EE445M/EE380L.6 Recap RTOS Debugging/verification Lab 4 Application...

22
March 16, 2022 Jonathan Valvano EE445M/EE380L.6 Recap RTOS Debugging/verification Lab 4 Application of RTOS Input sound, analog filter Digital filter, FFT Display amplitude versus freq on the oLED N oise Reduction -2048 -1536 -1024 -512 0 512 1024 1536 2048 0 1000 2000 3000 4000 5000 6000 7000 Time O utput

Transcript of April 17, 2015Jonathan Valvano EE445M/EE380L.6 Recap RTOS Debugging/verification Lab 4 Application...

April 18, 2023 Jonathan Valvano EE445M/EE380L.6

Recap•RTOS •Debugging/verification

Lab 4 Application of RTOS

• Input sound, analog filter • Digital filter, FFT• Display amplitude versus freq on the oLED

Noise Reduction

-2048

-1536

-1024

-512

0

512

1024

1536

2048

0 1000 2000 3000 4000 5000 6000 7000

Time

Ou

tpu

t

April 18, 2023 Jonathan Valvano EE445M/EE380L.6

Objectives

• Analog circuit design with single supply – MAX494CPD/TLC2274ACN rail to rail op amp

• Instrumentation amps (EE445L) – INA122

• Noise measurements and reduction

• Electret microphones

• IR distance sensor

April 18, 2023 Jonathan Valvano EE445M/EE380L.6

Convert to single supply• Vcc = 3.3V, start with design using +Vs -Vs• Assume ADC range is 0 to Vmax (0 to 3V) • Add an analog reference, Vref = ½ Vmax• Map

-Vs (-12) to digital ground

Analog ground to Vref reference

+Vs (+12) to Vcc supply

Reference EE345L book, chapter 5

April 18, 2023 Jonathan Valvano EE445M/EE380L.6

Inverting amp

yVI

I Vx

y

x

R1 R2

R3

Vin

R1

R2 VinV = -out

R =3 R +1 R2

R *1 R2

I2I in

+Vs

-Vs

0.1F

0.1F

Use a rail-to-rail opamp and map-Vs to digital groundAnalog ground to Vref reference+Vs to Vcc supply

April 18, 2023 Jonathan Valvano EE445M/EE380L.6

Original design Vout = 2Vin

with some LPF

April 18, 2023 Jonathan Valvano EE445M/EE380L.6

New design Vout = 2Vin-1.23

with some LPF

April 18, 2023 Jonathan Valvano EE445M/EE380L.6

Instrumentation amp

• Necessary conditions (must be true)– Differential input

• Motivation (at least one must be true)– Large gain– Large CMRR– Low noise– Small package– Large input impedance

April 18, 2023 Jonathan Valvano EE445M/EE380L.6

INA122

Final exam 2006, Q5

Vout = Gain*(V1-V2) + Vpin5

V1

V2

Vout

Vpin5

April 18, 2023 Jonathan Valvano EE445M/EE380L.6

Magnetic field noise

I1

Vs

ACpower

V1

Mutual inductance

S

Vs

V1

V = KBSm

Im

Motor Ourinstrument

Magnetic field

How do you reduce S?

April 18, 2023 Jonathan Valvano EE445M/EE380L.6

Electric field noise

Electric field

I1

Vs

ACpower

V1

Motor

Vs

V1

Stray capacitance

Id

Ourinstrument

How do you reduce C?

C

April 18, 2023 Jonathan Valvano EE445M/EE380L.6

Measure noise

Voltage

Time

Peak-to-

peak

White or 1/f noise Voltage

Time

Peak-to-

peak

Periodic noise

• DVM (AC mode)

• Oscilloscope (line trigger)

• Spectrum analyzer1000

100

10

11 10 100 1k 10k 100k

VoltageNoise

Frequency (Hz)

60Hz noise

1/f noisewhite noise

bandwidth limits

April 18, 2023 Jonathan Valvano EE445M/EE380L.6

Reduce noise

1) Reducing noise from the source– enclose noisy sources in a grounded metal

box– filter noisy signals– limit the rise/fall times of noisy signals. – limiting the dI/dt in the coil.

Noisy Less noisy

April 18, 2023 Jonathan Valvano EE445M/EE380L.6

Reduce noise

2) limiting the coupling between the noise source and your instrument.

– Maximize the distance from source to instrument – Cables with noisy signals should be twisted together, – Cables should also be shielded. – For high frequency signals, use coaxial – Reduce the length of a cable– Place the delicate electronics in a grounded case– Optical or transformer isolation circuits

April 18, 2023 Jonathan Valvano EE445M/EE380L.6

Reduce noise

2) limiting the coupling between the noise source and your instrument.

Shielded cable

Twisted wires

RoutZin

Transducer Instrument

Shielded cable

Twisted wires

RoutZin

Instrument Instrument

April 18, 2023 Jonathan Valvano EE445M/EE380L.6

Reduce noise

– 3) reduce noise at the receiver. – bandwidth should be as small as possible. – add frequency-reject digital filters– use power supply decoupling capacitors on each – twisted wires then Id1 should equal Id2. – V1-V2 = Rs1 Id1 - Rs2 Id2.

Id1

Vm

Vs

Rm

Rs1

Rs2

Rin1Rin2

Rdiff

Amp

Id2

V1

V2

April 18, 2023 Jonathan Valvano EE445M/EE380L.6

Electret microphone

April 18, 2023 Jonathan Valvano EE445M/EE380L.6

Typical cross section of an ECM

• JFET buffer

• Phantom Biasing

Data sheet says 2k

April 18, 2023 Jonathan Valvano EE445M/EE380L.6

Electret interface

Bias

HPF

Offset for single supply operation Balance Z to subtract bias current

LPF

LPF fc = 1/(2R13*C6)

HPF fc = 1/(2R9||R10)*C5)Gain = 1+R13/R12

Use max494

Show Measurements

April 18, 2023 Jonathan Valvano EE445M/EE380L.6

• Noiseo DVMo AC mode on scopeo Spectrum analyzer

• Signalo Peak to peako Spectrum

Sharp GP2Y0A21YK

April 18, 2023 Jonathan Valvano EE445M/EE380L.6

• You will need 5V to power IR sensor • Needs analog LPF• Reduces noise• Analog input protection• Needs digital median filter• Needs 10 F or larger +5V to gnd cap

for each sensor

Sharp GP2Y0A21YK

April 18, 2023 Jonathan Valvano EE445M/EE380L.6

d (cm) 1/d ADC10 0.100 70315 0.067 48420 0.050 38030 0.033 260

Calibration

ADC = 6706.7/d + 39.643

R2 = 0.9988

0100200300400500600700800

0.000 0.020 0.040 0.060 0.080 0.100 0.120

1/d (1/cm)

10-

bit

AD

C

Sharp GP2Y0A21YK

April 18, 2023 Jonathan Valvano EE445M/EE380L.6

• Accuracy => calibration• Resolution => noise

ADC = 6707/d+40d = 6707/(ADC-40)d (0.01cm) = 6706700/(ADC-40)