IE1206 Embedded Electronicskth.s3-website-eu-west-1.amazonaws.com/ie1206/slides/eng/...IE1206...

Preview:

Citation preview

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 sensorsI, U, R, P, serial and parallel

Ex2

Ex5

Kirchhoffs laws Node analysis Two-terminals R2R AD

Trafo, Ethernet contactLe13

Pulse sensors, Menu program

Le4

KC1 LAB1

KC3 LAB3

KC4 LAB4

Ex3Le5 KC2 LAB2 Two-terminals, AD, Comparator/Schmitt

Step-up, RC-oscillator

Le10Ex6 LC-osc, DC-motor, CCP PWM

LP-filter TrafoLe12 Ex7 Display

Le11

•••• Start of programing task

•••• Display of programing task

William Sandqvist william@kth.se

Easy to generate a sinusoidal voltage

Our entire power grid works with sinusoidal voltage.

When the loop rotates with constant speed in a magnetic field a sine wave is generated.

So much easier, it can not be …

William Sandqvist william@kth.se

The sine wave – what do you remember?

periodT

timet

y

amplitudetopY ,ˆ

RMSY

2

ˆ12)sin(ˆ)(

YY

TfftYty ==== πωω

William Sandqvist william@kth.se

(11.1) Phase ϕ

)sin(ˆ)( ϕω += tYty

If a sine curve does not begin with 0 the function expression has a phase angle ϕ.

Specify this function mathematically:

)10002sin(6)( ϕπ +⋅⋅⋅= ttu

y

)30(rad52,06

3arcsin)sin(63)0( °==

=⇒⋅== ϕϕu

)52,06283sin(6)( +⋅⋅= ttu

William Sandqvist william@kth.se

Apples and pears?In circuit analyses it is common (eg. in textbooks) to expresses the angle of the sine function mixed in radians ω·t [rad] and in degrees ϕ [°].

This is obviously improper, but practical (!). The user must "convert" phase angle to radians to calculate the sine function value for any given time t.

(You have now been warned …)

)306283sin(6)( °+⋅⋅= ttu

Conversion:x[°]= x[rad] ⋅57,3x[rad]= x[°]⋅0,017

? ?

William Sandqvist william@kth.se

William Sandqvist william@kth.se

Mean and effective value

T

ttu

UttuU

T

T

T

∫∫ === 0

2

0

1med

d)(

0d)(

All pure AC voltages, has the mean value0.

• More interesting is the effective value– root mean square, rms.

William Sandqvist william@kth.se

(11.2) Example. RMS.

V63,11015

1058

1015

105)0)2(2(d)(

3

3

3

3220

2

=⋅⋅⋅=

⋅⋅⋅+−+== −

−∫T

ttu

U

T

The rms value is what is normally used for an alternating voltage U. 1,63 V effective value gives the same power in a resistor as a 1,63 V pure DC voltage would do.

RMS, effective value

William Sandqvist william@kth.se

Sine wave effective value

2

1

2

1d)(sin2 ==∫ xx

)(sin2 x

2

1

• Effective value is often called RMS ( Root Mean Square ).

sin2 has the mean value ½

Therefore:

2

UU =

RMS, effective value

Ex. 11.3

William Sandqvist william@kth.se

William Sandqvist william@kth.se

Addition of sinusoidal quantities

)sin(ˆ111 ϕω += tAy

)sin(ˆ222 ϕω += tAy

?21 =+ yy

William Sandqvist william@kth.se

Addition of sinusoidal quantitiesWhen we shall apply the circuit laws on AC circuits, we must add the sines. The sum of two sinusoidal quantities of the same frequency is always a new sine of this frequency, but with a newamplitude and a new phase angle.

( Ooops! The result of the rather laborious calculations are shown below).

+++⋅−++=

=+=+⋅=+⋅=

)cos(A)cos(A

)sin(A)sin(Aarctansin)cos(AA2AA

)()()()sin(A)()sin(A)(

2211

22112121

22

21

21222111

ϕϕϕϕωϕϕ

ϕωϕω

t

tytytyttytty

William Sandqvist william@kth.se

Sine wave as a pointer

A sinusoidal voltage or current,

can be represented by a pointer that rotates (counterclockwise) with the angular velocity ω [rad/sec] .

)sin(ˆ)( tYty ⋅⋅= ω

Wikipedia Phasors

William Sandqvist william@kth.se

Simpler with vectors

If you ignore the "revolution" and adds the pointers with vector addition, as they stand at the time t = 0, it then becomes a whole lot easier!

Wikipedia Phasors

http://en.wikipedia.org/wiki/Phasors

William Sandqvist william@kth.se

Pointer with complex numbers

°⋅⋅+°⋅⇔⋅⇔°∠ ° 30sinj1030cos10e103010 30j

A AC voltage 10 V that has the phase 30° is usually written:

10 ∠ 30° ( Phasor)

Once the vector additions require more than the most common geometrical formulas, it is instead preferable to represent pointers with complex numbers.

In electricity one uses j as imaginary unit, as i is already in use for current.

baz j+=

Imaginary axis

Real axis

William Sandqvist william@kth.se

Phasor

A pointer (phasor) can either be viewed as a vector expressed inpolar coordinates, or as a complex number.

It is important to be able to describe alternating current phenomena without necessarily having to require that the audience has a knowledge of complex numbers - hence the vector method.

The complex numbers and jω-method are powerful tools that facilitate the processing of AC problems. They can be generalized to the Fourier transform and Laplace transform, so the electro engineer’s use of complex numbers is extensive.

Sinusoidal alternating quantities can be represented as pointers, phasors.

”amount” ∠∠∠∠ ”phase”

William Sandqvist william@kth.se

peak/effective value - phasor

baz j+=

The phasor lengths corresponds to sine peak values, but since the effective value only is the peak value scaled by 1/√2 so it does not matter if you count with peak values or effective values - as long as you are consistent!

Imaginary axis

Real axis

William Sandqvist william@kth.se

The inductor and capacitor counteracts changes

William Sandqvist william@kth.se

The inductor and capacitor counteracts changes, such as when connecting or disconnecting a source to a circuit.

What if the source then is sinusoidal AC – which is then changing continuously?

?

William Sandqvist william@kth.se

Alternating current through resistor

RR

RRRRRR )sin(ˆ)()()()sin(ˆ)(

IRU

tIRtuRtitutIti

⋅=⋅⋅=⇒⋅=⋅= ωω

A sinusoidal currentiR(t) through a resistor R provides a proportional sinusoidal voltage drop uR(t) according to Ohm's law. The current and voltage are in phase. No energy is stored in the resistor.

Phasors UR and IR become parallel to each other.

RR IRU ⋅=

The phasor may be a peak pointer or effective value pointer as long as you do not mix different types.

• Complex phasor

• Vector phasor

William Sandqvist william@kth.se

Alternating current through inductor

LL

LL

ILU

tILtILtut

tiLtutIti

⋅=

+⋅⋅=⋅⋅=⇒=⋅=

ω

πωωωωω )2

sin(ˆ)cos(ˆ)(d

)(d)()sin(ˆ)( L

LLLL

A sinusoidal current iL(t) through an inductor provides, due to self-induction, a votage drop uL(t) which is 90° before the current. Energy stored in the magnetic field is used to provide this voltage.

When using complex pointers one multiplies ωL with ”j”, this rotates the voltage pointer +90° (in complex plane). The method automatically keeps track of the phase angles!

LLLL jj IXILU ⋅=⋅= ω

• Vector phasor

• Complex phasor

The phasor UL will be ωL·IL and it is 90° before IL. The entity ωL is the ”amount” of the inductor’s AC resistance, reactance XL [Ω].

William Sandqvist william@kth.se

Alternating current through capacitor

)2

sin(ˆ1)cos(ˆ1

)()sin(ˆ)(

d)(1

)()(1

d

d1

d

)(d

CCCCC

CCCC

πωω

ωω

ω −⋅⋅=⋅⋅−=⇒⋅=

⋅=⇒⋅=⋅=⇒= ∫

tIC

tIC

tutIti

ttiC

tutiCt

q

Ct

tu

C

QU

A sinusoidal current iC(t) throug a capacitor will charge it with the ”voltage drop” uC(t) that lags 90°behind the current. Energy is storered in the electric field.

• Vector phasor

Phasor UC is IC/(ωC) and it lags 90°after IC. The entity 1/(ωC) is the ”amount” of the capacitor’s AC resistance, reactance XC [Ω].

CC

1I

CU ⋅=

ω

William Sandqvist william@kth.se

Complex phasor and the sign of reactance

If you use complex phasor you get the -90° phase by dividing (1/ωC) with ”j ”.

CXI

CI

CU CCCC ωωω

11-j

j

1 −=⇒⋅=⋅= • Complex phasor

The method with complex pointer automatically keeps track of the phase angles if we consider the capacitor reactance XCas negative, and hence the inductor reactance XL as positive.

L+C in series

William Sandqvist william@kth.se

Ωj5 Ω− j4 Ω+ j1

Ωj4 Ω− j5Ω− j1

=

=´L

´C

William Sandqvist william@kth.se

William Sandqvist william@kth.se

Reactance frequency dependency

fC

XLX CL

πωω

ω

2

1

=⋅

=⋅=

][ΩLX

][ΩLX

]Hz[f]Hz[f

William Sandqvist william@kth.se

LOG – LOG plot

Often electronics engineers use log-log scale. The inductor and capacitor reactances will then both be "linear" relationshipin such charts.

( ) ][log Ω− scaleX L ( ) ][log Ω− scaleX C

( ) ]Hz[log scalef − ( ) ]Hz[log scalef −

William Sandqvist william@kth.se

William Sandqvist william@kth.se

R L C

In general, our circuits are a mixture of different R L and C. The phase between I and U is then not ±90° but can have any intermediate value. Positive phase means that the inductances dominates over capacitances, we have inductive character IND . Negative phase means that the capacitance dominates over the inductances, we have capacitive character CAP.

The ratio between the voltage U and current I, the AC resistance, is called impedaceZ [Ω]. We then have OHM´s AC law: I

UZ =

CAP

William Sandqvist william@kth.se

Phasor diagrams

In order to calculate the AC resistance, the impedance, Z, of a composite circuit one must add currents and voltages phasors to obtain the total current I and the total voltage U.

I

UZ = The phasor diagram is our "blind stick" in to

the AC World!

William Sandqvist william@kth.se

Ex. Phasor diagram (11.5)

At a certain frequency f the capacitor has the reactance |XC| and the resistor Rhas the same amount (absolute value), R [Ω].

Elementary diagrams for R L and C

Use the elementary diagrams for R and C as building blocks to draw the whole circuit phasor diagram (for this actual frequency f ).

Try it your self …

William Sandqvist william@kth.se

Example. Phasor diagram.

2R ||UI

R

UIIUI 2

RC2C ==⊥

1) U2 reference phase ( = horizontal )

2)

3)

4) CCR 2 IIIII ⋅=+=

5)

21C1

1

22 UURIRIU

IU

⋅=⇒⋅⋅=⋅=

6)21 UUU +=

William Sandqvist william@kth.se

William Sandqvist william@kth.se

Impedance ZThe circuit AC resistance, impedance Z, one get as the ratio between the length of U and Iphasors. The impedance phase ϕϕϕϕis the angle between U and Iphasors.

The current is before the voltage in phase, so the circuit has a capacitive character, CAP.

( Something else had hardly been to wait since there are no coils in the circuit )

William Sandqvist william@kth.se

William Sandqvist william@kth.se

Complex phasors, jω-method

°−=−==⋅=⋅=

°+==⋅=⋅=°==⋅=

90)jarg()j

1arg(

j

1j

90)jarg(jj

0)arg(

CCCC

LLLL

RR

CCC

IXIU

LLIXIU

RRIU

ωω

ϕω

ωϕωϕ

Complex phasors. OHM’s law for R L and C.

Complex phasors. OHM’s law for Z.

][Im][Im

arctan][Re

][Imarctan)arg(][Re][Re

)arg()arg(arg)arg(

ZIU

R

X

Z

ZZZIU

IUI

UZ

I

UZZIU

⋅=

=

=⋅=

−=

===⋅= ϕ

In fact, there will be four useful relationships!• Re, • Im, • Abs, • Arg

William Sandqvist william@kth.se

Ex. Complex phasors.

U = 20 V C = 320 µF R = 10 Ω f = 50 Hz

William Sandqvist william@kth.se

Ex. Complex phasors.

j1010320502j

1

2j

1

j

16

−=⋅⋅⋅

=⋅⋅

= −ππω CfC

U = 20 V C = 320 µF R = 10 Ω f = 50 Hz

William Sandqvist william@kth.se

Ex. Complex phasors.

j55)j1010(

)j1010(

j1010

)j10(10

j1

j1

R//C −=++⋅

−−⋅=

+

⋅=

CR

CR

Z

ω

ω

U = 20 V C = 320 µF R = 10 Ω f = 50 Hz

j1010320502j

1

2j

1

j

16

−=⋅⋅⋅

=⋅⋅

= −ππω CfC

William Sandqvist william@kth.se

Ex. Complex phasors.

U = 20 V C = 320 µF R = 10 Ω f = 50 Hz

j1010320502j

1

2j

1

j

16

−=⋅⋅⋅

=⋅⋅

= −ππω CfC

j55)j1010(

)j1010(

j1010

)j10(10

j1

j1

R//C −=++⋅

−−⋅=

+

⋅=

CR

CR

Z

ω

ω

William Sandqvist william@kth.se

Ex. Complex phasors. I

U = 20 V C = 320 µF R = 10 Ω f = 50 Hz

j1010320502j

1

2j

1

j

16

−=⋅⋅⋅

=⋅⋅

= −ππω CfC

j55)j1010(

)j1010(

j1010

)j10(10

j1

j1

R//C −=++⋅

−−⋅=

+

⋅=

CR

CR

Z

ω

ω

William Sandqvist william@kth.se

Ex. Complex phasors. I

U = 20 V C = 320 µF R = 10 Ω f = 50 Hz

j1010320502j

1

2j

1

j

16

−=⋅⋅⋅

=⋅⋅

= −ππω CfC

j55)j1010(

)j1010(

j1010

)j10(10

j1

j1

R//C −=++⋅

−−⋅=

+

⋅=

CR

CR

Z

ω

ω

26,12,14,0j2140

j2,14,0)j31(

)j31(

j3-1

4

j)5-(5j10-

20

j1

22

C//R

=+=+=

+=++⋅=

+=

+==

,,I

ZC

U

Z

UI

ω

William Sandqvist william@kth.se

Ex. Complex phasors. U1

U = 20 V C = 320 µF R = 10 Ω f = 50 Hz

j1010320502j

1

2j

1

j

16

−=⋅⋅⋅

=⋅⋅

= −ππω CfC

j55)j1010(

)j1010(

j1010

)j10(10

j1

j1

R//C −=++⋅

−−⋅=

+

⋅=

CR

CR

Z

ω

ω

William Sandqvist william@kth.se

Ex. Complex phasors. U1

U = 20 V C = 320 µF R = 10 Ω f = 50 Hz

j1010320502j

1

2j

1

j

16

−=⋅⋅⋅

=⋅⋅

= −ππω CfC

j55)j1010(

)j1010(

j1010

)j10(10

j1

j1

R//C −=++⋅

−−⋅=

+

⋅=

CR

CR

Z

ω

ω

65,12)4(12j412

j412j)-10(j)2,14,0(j

1

221

1

=−+=−=

−=⋅+=⋅=

U

CIU

ω

William Sandqvist william@kth.se

Ex. Complex phasors. U2

U = 20 V C = 320 µF R = 10 Ω f = 50 Hz

j1010320502j

1

2j

1

j

16

−=⋅⋅⋅

=⋅⋅

= −ππω CfC

j55)j1010(

)j1010(

j1010

)j10(10

j1

j1

R//C −=++⋅

−−⋅=

+

⋅=

CR

CR

Z

ω

ω

William Sandqvist william@kth.se

Ex. Complex phasors. U2

U = 20 V C = 320 µF R = 10 Ω f = 50 Hz

j1010320502j

1

2j

1

j

16

−=⋅⋅⋅

=⋅⋅

= −ππω CfC

j55)j1010(

)j1010(

j1010

)j10(10

j1

j1

R//C −=++⋅

−−⋅=

+

⋅=

CR

CR

Z

ω

ω

94,848j48

j48j)3(1

j)3(1

j3-1

j120

j)5-(5j10-

j5-520

j1

222

C//R

C//R2

=+=+=

+=++⋅−⋅=

+⋅=

+⋅=

U

ZC

ZUU

ω

Voltage divider:

William Sandqvist william@kth.se

Ex. Complex phasors. IC

U = 20 V C = 320 µF R = 10 Ω f = 50 Hz

j1010320502j

1

2j

1

j

16

−=⋅⋅⋅

=⋅⋅

= −ππω CfC

j55)j1010(

)j1010(

j1010

)j10(10

j1

j1

R//C −=++⋅

−−⋅=

+

⋅=

CR

CR

Z

ω

ω

William Sandqvist william@kth.se

Ex. Complex phasors. IC

U = 20 V C = 320 µF R = 10 Ω f = 50 Hz

j1010320502j

1

2j

1

j

16

−=⋅⋅⋅

=⋅⋅

= −ππω CfC

j55)j1010(

)j1010(

j1010

)j10(10

j1

j1

R//C −=++⋅

−−⋅=

+

⋅=

CR

CR

Z

ω

ω

89,08,04,0j8,04,0

j8,04,0j10-

j48

j1

22C

2C

=+=+=

+−=+=⋅=

I

C

UI

ω

William Sandqvist william@kth.se

Ex. Complex phasors. IR

U = 20 V C = 320 µF R = 10 Ω f = 50 Hz

j1010320502j

1

2j

1

j

16

−=⋅⋅⋅

=⋅⋅

= −ππω CfC

j55)j1010(

)j1010(

j1010

)j10(10

j1

j1

R//C −=++⋅

−−⋅=

+

⋅=

CR

CR

Z

ω

ω

William Sandqvist william@kth.se

Ex. Complex phasors. IR

U = 20 V C = 320 µF R = 10 Ω f = 50 Hz

j1010320502j

1

2j

1

j

16

−=⋅⋅⋅

=⋅⋅

= −ππω CfC

j55)j1010(

)j1010(

j1010

)j10(10

j1

j1

R//C −=++⋅

−−⋅=

+

⋅=

CR

CR

Z

ω

ω

89,04,08,0j4,08,0

j4,08,010

j48

22R

2R

=+=+=

+=+==

I

R

UI

William Sandqvist william@kth.se

You get the phasor chart by plotting the points in the complex plane!

William Sandqvist william@kth.se

Vrida diagrammet …When we draw the phasor diagram it was natural to have U2 as reference phase (=horizontal), with the jω-method U was the natural choice of reference phase (=real).

Because it is easy to rotate the chart, so, in practice, we have the freedom of choosing any entity as the reference.

))7,26sin(j)7,26(cos(

7,268

4arctan)j48arg()arg( 2

°−⋅+°−×

°=

=+=U

Multiply the all complex numbers by this factor and rhe rotation will take effect!

William Sandqvist william@kth.se

William Sandqvist william@kth.se

SummarySinusoidal alternating quantities can be represented as pointers, phasors,

”amount” ∠∠∠∠ ”phase”.

A pointer (phasor) can either be seen as a vector expressed in polar coordinates, or as a complex number.

Calculations are usually best done with the complex method, while phasor diagrams are used to visualize and explain alternating current phenomena.

William Sandqvist william@kth.se

Notation

X

x Instant value

X Top value

XX Absolute value, the amount

Complex phasor

William Sandqvist william@kth.se

Recommended