IE1206 Embedded Electronics Le1 Le2 PIC-block Documentation, - - PowerPoint PPT Presentation

ie1206 embedded electronics
SMART_READER_LITE
LIVE PREVIEW

IE1206 Embedded Electronics Le1 Le2 PIC-block Documentation, - - PowerPoint PPT Presentation

IE1206 Embedded Electronics Le1 Le2 PIC-block Documentation, Seriecom Pulse sensors I , U , R , P , serial and parallel Le3 Ex1 KC1 LAB1 Pulse sensors, Menu program Start of programing task Ex2 Le4 Kirchhoffs laws Node


slide-1
SLIDE 1

IE1206 Embedded Electronics

Transients PWM Phasor jω PWM CCP CAP/IND-sensor

Le1 Le3 Le6 Le8 Le2 Ex1 Le9 Ex4 Le7

Written exam

William Sandqvist william@kth.se

PIC-block Documentation, Seriecom Pulse sensors I, U, R, P, serial and parallel

Ex2 Ex5

Kirchhoffs laws Node analysis Two-terminals R2R AD Trafo, Ethernet contact

Le13

Pulse sensors, Menu program

Le4

KC1 LAB1 KC3 LAB3 KC4 LAB4

Ex3 Le5

KC2 LAB2

Two-terminals, AD, Comparator/Schmitt Step-up, RC-oscillator

Le10 Ex6

LC-osc, DC-motor, CCP PWM

LP-filter Trafo

Le12 Ex7

Display

Le11

  • Start of programing task
  • Display of programing task
slide-2
SLIDE 2

William Sandqvist william@kth.se

A signal in reality …

Actual signals are difficult to interpret. They are often disturbed by noise and hum. Hum is our 50Hz network induced into the signal lines. Noise is random disturbances from amplifiers (or even resistors).

slide-3
SLIDE 3

William Sandqvist william@kth.se

Maybe a slow DC …

Perhaps the signal is a slowly increasing direct voltage from eg. a temperature sensor? In this case, the interference consist of 50 Hz hum and high frequency noise. A LP-filter (=LowPass) filters away the interference and removes the interferences from the signal.

slide-4
SLIDE 4

William Sandqvist william@kth.se

Maybe a sine wave …

Maybe the signal is a sine wave? In this case, the interference consist of the DC voltage level slowly changing,

  • ffst, and that

noise is added. A BP-filter (BandPass) will block the offset and filters out the noise.

slide-5
SLIDE 5

William Sandqvist william@kth.se

Maybe rapid variations …

Perhaps the signal is the rapid variations? In this case, the interference consist of the DC voltage level slowly changing, and that hum has been added. A HP-filter (HighPass) removes the interferences from the signal.

slide-6
SLIDE 6

William Sandqvist william@kth.se

Filter

With R L and C one can build effective filters. Inductors are more complicated to manufacture than capacitors and resistors, therefore, is typically only combination R and C used. Fast computers can filter signals digitally. Calculating a signal’s moving average can for example correspond to the LP filter. Nowadays dominates the digital filter technology over the analog. Simple RC filter are naturally in most measuring instruments, or even arising from "itself" when linking equipment. This is the reason that one must know and be able to calculate on simple RC-links, even though they regarded as filters are very incomplete.

slide-7
SLIDE 7

William Sandqvist william@kth.se

LP HP BP BS

BP and BS filters can be seen as different combination of LP and HP filters.

LP lowpass HP highpass BP bandpass BS bandstop

slide-8
SLIDE 8

William Sandqvist william@kth.se

slide-9
SLIDE 9

William Sandqvist william@kth.se

Voltage divider, Transfer function

Simple filters are often designed as a voltage dividers.A filter transfer function, H(ω) or H(f), is the ratio between output voltage and input

  • voltage. This ratio we get directly from the voltage divider formula!

2 1 2 1 2 2 1 2 1 2

) ( Z Z Z U U H Z Z Z U U + = =

  • +

= ω

slide-10
SLIDE 10

William Sandqvist william@kth.se

slide-11
SLIDE 11

William Sandqvist william@kth.se

RC LP-filter, vectors

Phasor diagram: R and C has the current I in common. Volyage over resistor and voltage over capacitors kondensatorn therefore becomes

  • perpendicular. Pythagorean theorem can be used:

1 2 2 2 2 3 2 1

arctan | | U U U U U = + = ϕ

ϕ 3 4 5

slide-12
SLIDE 12

William Sandqvist william@kth.se

RC LP-filter, jω

( )

RC RC RC U U RC U U RC C C C R C U U ω ω ω ϕ ω ω ω ω ω ω arctan 1 arctan ) j 1 arg( ) 1 arg( arg ) ( 1 1 j 1 1 j j j 1 j 1

1 2 2 1 2 1 2

− =

= + − =

  • =

+ = + = ⋅ + =

slide-13
SLIDE 13

William Sandqvist william@kth.se

RC LP-filter, H(ω)

( ) ( ) ( )

RC H RC H H RC H ω ω ω arctan arg ) ( 1 1 abs j 1 1

2

− = + = = + =

At the angular frequency when ωRC = 1 , will the numerator real part and imaginary part be equal. This is the filter cutoff frequency.

slide-14
SLIDE 14

William Sandqvist william@kth.se

LP-magnitude function

RC f RC RC H π ω ω 2 1 1 ) ( 1 1

G G 2

= = + =

R = 1 kΩ C = 1 µF

Hz 160 10 1 10 1 2 1

6 3 G

≈ ⋅ ⋅ ⋅ ⋅ =

π f

slide-15
SLIDE 15

William Sandqvist william@kth.se

LP-Phase function

( )

) arctan( arg RC H ω ϕ − = =

slide-16
SLIDE 16

William Sandqvist william@kth.se

Graphs with Mathematica

<<Graphics r=1*10^3; c=1*10^-6; w=2*Pi*f; u2u1[f_]=1/(1+I*w*r*c); LogLinearPlot[Abs[u2u1[f]],{f,1,10000},PlotRange->All,PlotPoints->100]; LogLinearPlot[Arg[u2u1[f]],{f,1,10000},PlotRange->All,PlotPoints->100];

Mathematica has commands for complex absolute value (abs []) and argument (arg [], in radians). Press SHIFT + ENTER to start the calculation and the plot. Amount plot Phase plot [rad]

slide-17
SLIDE 17

William Sandqvist william@kth.se

RC Two sides of the same coin

RC RC = = τ ω 1

G

Low cut off frequency ωG will supresses interference good, but it will also mean that the time constant τ is long so it takes time until UUT reaches its final value and can be read.

slide-18
SLIDE 18

William Sandqvist william@kth.se

( AD-converter LP-filter )

C

In order to remove noise from the input signal to the AD converter one usually add a capacitor C.

  • RS must have no bigger value than 10kΩ – otherwise you risk losing

accuracy because of the leakage current ILEAKAGE.

  • When the sample charge from C is taken to sampling capacitor
  • CHOLD. C should therefore be at least 1024 times greater than CHOLD

(10pF) if you do not want to lose accuracy.

  • C⋅RS gives the cutoff frequency of how fast signals AD converter

can follow.

  • It is necessary to compromise!
slide-19
SLIDE 19

William Sandqvist william@kth.se

slide-20
SLIDE 20

William Sandqvist william@kth.se

RC HP-filter, jω

  • =

° = + − =

  • +

= + = ⋅ + = RC RC RC RC U U RC RC U U RC RC C C C R R U U ω ω ω ω ω ω ω ω ω ω ω 1 arctan 1 arctan 90 ) j 1 arg( ) j arg( arg ) ( 1 j 1 j j j j 1

1 2 2 1 2 1 2

= arccot()

slide-21
SLIDE 21

William Sandqvist william@kth.se

RC HP-filter, H(ω)

( ) ( )

  • =

+ = + = RC H RC RC H RC RC H ω ω ω ω ω 1 arctan arg ) ( 1 abs j 1 j

2

At the angular frequency when ωRC = 1 , will the numerator real part and imaginary part be equal. This is the filter cutoff frequency.

slide-22
SLIDE 22

William Sandqvist william@kth.se

HP-magnitude function

R = 1 kΩ C = 1 µF Hz 160 10 1 10 1 2 1

6 3

≈ ⋅ ⋅ ⋅ ⋅ =

π

G

f

( )

2

) ( 1 abs RC RC H ω ω + =

slide-23
SLIDE 23

William Sandqvist william@kth.se

HP-phase function

( )

  • =

= RC H ω ϕ 1 arctan arg

slide-24
SLIDE 24

William Sandqvist william@kth.se

slide-25
SLIDE 25

William Sandqvist william@kth.se

Wienbridge (14.5)

Was investigated by Max Wien 1891 For a certain frequency U1 and U2 are in phase. What frequency?

slide-26
SLIDE 26

William Sandqvist william@kth.se

Wienbridge

RC R C C C R C R Z C R Z ω ω ω ω ω ω j 1 j j j 1 j 1 j 1

2 1

+ = ⋅ + ⋅ = + = ) 1 ( j 3 1 j 1 j 3 1 ) j 1 ( ) j 1 ( j 1 j 1 j 1

1 2

RC RC RC RC R RC R RC RC R C R RC R U U ω ω ω ω ω ω ω ω ω − + = + + = + + ⋅ + + + + =

U1 and U2 are in phase if the transferfunction imaginary part is 0! = 0

slide-27
SLIDE 27

William Sandqvist william@kth.se

Wienbridge

RC RC RC RC RC U U 1 1 ) 1 ( j 3 1

1 2

=

  • =

+ = ω ω ω ω ω

slide-28
SLIDE 28

William Sandqvist william@kth.se

Wienbridge

Magnitude plot Phase plot

RC f RC π ω 2 1 1 = =

Wienbridge is a band pass filter.

slide-29
SLIDE 29

William Sandqvist william@kth.se

William Hewlett’s master thesis

Master thesis 1930. Wienbridge with lamp!

slide-30
SLIDE 30

William Sandqvist william@kth.se

William Hewletts master thesis

Hewlett constructed a tone generator. Wien bridge attenuates the signal to 1/3 so he needed a amplifier with the gain exactly three times. The bulb stabilizes the signal. If the amplitude becomes too large the lamp will glow and then the signal is attenuated in the voltage divider at the amplifier input.

In phase!

slide-31
SLIDE 31

William Sandqvist william@kth.se

The Palo Alto garage the birthplace of Silicon Valley

Which global business will you start with your thesis?

slide-32
SLIDE 32

William Sandqvist william@kth.se

slide-33
SLIDE 33

William Sandqvist william@kth.se

When are filters used?

One speaker alone can not cope with all frequencies!

slide-34
SLIDE 34

Cross over filter

The crossover filter split the frequencies between the speakers.

William Sandqvist william@kth.se

slide-35
SLIDE 35

William Sandqvist william@kth.se

Passive/Active speaker

  • Analog crossoverfilter R L C
  • Digital crossoverfilter = computer program

When the amplifier is built in the speaker it becomes possible to use digital

  • crossovers. ( XOVER = crossover filter )
slide-36
SLIDE 36

William Sandqvist william@kth.se

slide-37
SLIDE 37

William Sandqvist william@kth.se

( Digital filter )

  • Ex. a "rolling" average of the 7 most recent readings.

n

x

1 − n

x

3 − n

x

2 − n

x

5 − n

x

6 − n

x

4 − n

x

=

n n n n

x y

6

7 1 t High frequencys are damped Low frequencys pass

  • Filtered signal
  • Brusig signal

There are much better digital filters than this ...

LP-filter

slide-38
SLIDE 38

William Sandqvist william@kth.se