+ All Categories
Home > Education > Control And Programingof Synchronous Generator

Control And Programingof Synchronous Generator

Date post: 06-May-2015
Category:
Upload: freelay
View: 2,861 times
Download: 9 times
Share this document with a friend
Description:
author: International Team publisher: Daniel Garrido licence: Creative Commons place: University of Southern Denmark- Odense @fomenting colaborational knowledge
Popular Tags:
65
PROJECT Generator control International team: Esta obra está bajo una licencia de Creative Commons .
Transcript
Page 1: Control And Programingof Synchronous Generator

PROJECT Generator control

International team:

Esta obra está bajo una licencia de Creative Commons.

Page 2: Control And Programingof Synchronous Generator

2

TABLE OF CONTENTS

I.GENERAL DESCRIPTION……………………………………………….. 3 II.GENERAL IDEA OF THE PROJECT…………………………………....4 III.GENERAL SCHEMA OF THE CONNECTIONS…………………….. 5 IV.PROBLEMS TO SOLVE………………………………………………….7 V.THEORETICAL INTRODUCTION…………………………………….. 7 VI.DC MOTOR- GENERATOR (MEASUREMENT)…………………... 14 VII.POWER ELECTRONICS SUPPLY: H- BRIDGE ELECTRONIC CIRCUIT…………………………………………………………………….. 25 VIII.HEX BUFFER (NON- INVERTING) CD 4010C…………………… 34 IX.DC- DC CONVERTER…………………………………………………. 36 X.SERVOMOTOR- MAXON DC MOTOR………………………………. 38 XI.MICROCONTROLLER………………………………………………... 40 XII.TRANSDUCER………………………………………………………… 50 XIII.LabVIEW- CONTROL APPLICATION……………………………. 56

XIV.SUMMARY…………………………………………………………….. 64 XV.BIBLIOGRAPHY……………………….. ……………………………. .65

Page 3: Control And Programingof Synchronous Generator

3

I. GENERAL DESCRIPTION This project consists of control and supervision of generators. The generator, we have, shall

drive in ”Stand-alone”, together with a ”Rigid grid” or together with a “twin generator”. The generator is mechanical connected to a compound motor. The compound motor is the primary drive force. The generated voltage frequency controls from the velocity of the DC-motor, while the amplitude of the tension is controlled from the magnetic voltage.

The controller gets the power supply scald from a 3-phase transformer. This AC shall be rectified to a DC voltage. This gives power supply to the DC-servomotors. The electronic circuits are controlled by a microcontroller. The Data part includes:

Design, analysis and modelling of the DC-servomotor drive and SCADA The electrical power includes:

Analysis, modelling and test of DC- motor and synchrony generator, transformer and power grid.

Steps of paralleling the synchronous generator to the grid (prime mover – DC motor): On the output has to be 400V, 50Hz. To control voltage, frequency and power we can adjust by changing:

armature voltage of DC motor field current of DC motor field current of synchronous generator

1) Switch on DC power supply 2) Apply DC power supply to DC motor 3) Adjust armature voltage of DC motor 4) Adjust field current of synchronous generator until on the output will be 400V 5) Check lamps brightness (the phase sequence is correct the lamps will have the same

brightness) 6) Adjust the speed to 50Hz (by changing the field current of DC motor) unless synchroscope

would show that the speed is “too fast” or “too slow” 7) Synchronization – switch on to the grid 8) Power control – change the field current of synchronous generator

Page 4: Control And Programingof Synchronous Generator

4

SOFTWARE

ELECTRONICS

MACHINES

DATA ACQUISITON

II. GENERAL IDEA OF THE PROJECT

DSP DEBBUGER

LAB VIEW

ADMC401 MICROCONTROLLER

H BRIDGE

SERIAL BUS

PWM SIGNAL

GRID

DIGITAL AND

ANALOG TESTERS

SERVOMOTORS DC MOTOR- GENERATOR

REAL VALUES

TRANSDUCER

NI- USB 6008 CONVERTER

Page 5: Control And Programingof Synchronous Generator

5

III. GENERAL SCHEMA OF THE CONNECTIONS

Page 6: Control And Programingof Synchronous Generator

6

Fig. III1 General schema of the connections made in AutoCAD

Page 7: Control And Programingof Synchronous Generator

7

IV. PROBLEMS TO SOLVE

POWER ELECTRONICS SUPPLY: H- BRIDGE DC- DC CONVERTER HEX BUFFER (NON- INVERTING) CD 4010C MICROCONTROLLER ADMC 401 SERVOMOTOR- MAXON DC MOTOR MEASUREMENT NI- USB 6008 A/D CONVERTER TRANSDUCERS: TAS 331-DG, TAS 311-DG, MIQ96, MTR-1 LAB VIEW: FRONT PANEL AND BLOCK DIAGRAM

V. THEORETICAL INTRODUCTION

1. Synchronous generators principles

A synchronous generator rotates with the constant speed in the steady state; It is a doubly excited machine (the rotor poles (field windings) are excited by the dc current,

the stator (armature) windings are connected to the ac supply); When the field current (excitation current) flows through the rotor field winding, it establishes

a sinusoidally distributed flux in the air gap. If the rotor is now rotated by the prime mover (dc motor), a revolving field is producing in the air gap (excitation field). The rotating flux so produced will change the flux linkage of the armature windings and will induce voltages in the stator windings (excitation voltages).

The rotor speed and frequency of the induced voltage are related by:

pfn

120

, where n – rotor speed in rpm, p – number of poles.

The excitation voltage ( fE ) is proportional to the speed ( f ), excitation flux ( ), the latter

in turn ( N ) depends on the excitation current ( fI ):

wf KNfE 44,4

Fig. V1 Synchronous generator

Page 8: Control And Programingof Synchronous Generator

8

, where wK – winding factor The variation of the excitation voltage with the field current is shown in figure 2.

With increasing the field current fI , flux does not increase linearly with fI , because of the

saturation of the magnetic circuit.

The equivalent model of the synchronous generator:

araraf EjXIE

, where fI – field current, aI – current in the stator, f – flux in the air gap, fE – voltage by f ,

arE – armature reaction voltage, arX - reactance of armature reaction or magnetizing reactance.

Power (P, Q) and torque (T):

Fig. V2 The magnetization characteristic of the synchronous machine

Fig. V3 The equivalent model of the synchronous generator (OCC)

Fig. V4 Equivalent circuit per phase

Page 9: Control And Programingof Synchronous Generator

9

, where: tV – terminal voltage, alars XXX , ( sX – synchronous reactance, aR – stator winding resistance, alX - leakage reactance), sas jXRZ ( sZ – synchronous impedance)

sin3

3s

ft

XEV

P

VARXV

XEV

Qs

t

s

ft2

3

3cos

3

syn

PT

3

– power or torque angle

2. The infinite bus

The transmission of power is normally at high voltage levels (hundreds of kilovolts) to achieve higher efficiency;

A transformer is used to step up the voltage to the infinite bus; The synchronous generator and infinite bus must have the same:

Voltage Frequency Phase Phase sequence

These conditions can be checked by synchroscope (running too fast or too slow – frequency of the incoming machine is higher or lower than that of the infinite bus) and synchronizing lamps (if the phase sequence is correct the lamps will have the same brightness, if not – the lamps will brighten and darken in step);

Fig. V5 Power and torque characteristics

Fig. V6 Diagram of paralleling a synchronous generator with the infinite bus using synchronizing lamps

Page 10: Control And Programingof Synchronous Generator

10

3. DC motors principles

The armature winding is placed on the rotor and field windings are placed on the stator. The voltage induced in the armature winding is alternating. A mechanical commutator and a brush assembly function as rectifier or inverter, making the

armature terminal voltage unidirectional. DC motors can provide a wide range of accurate speed and torque control. Speed control in a dc machine can be achieved by following methods:

1) Armature voltage control (smooth variation of speed control, armature circuit resistance Ra and field current If remain constant, armature terminal voltage Vt is varied to change the speed, as Vt increases – the speed increases linearly); 2) Field control (armature circuit resistance Ra and armature terminal voltage Vt remain constant, field current If is varied to change the speed, the speed varies inversely with the field current); 3) Armature resistance control (charging resistance of the armature circuit with fixed other parameters);

The common method of control is the use of a separately excited dc motor with constant field excitation. The speed is controlled by changing the voltage applied to the motor terminals.

The voltage (Vt), armature current (Ia), speed (ωm) and torque (T) are related as follows (separately excited dc motor):

aataa RIVmKE

aa IKT

a

aat

KRIVm

TK

RK

Vma

a

a

t

2)(

, where: aE – armature induced voltage, – magnetic flux, aK – armature constant

Fig. V7 Separately excited dc motor

Fig. V8 Torque- speed characteristics

Page 11: Control And Programingof Synchronous Generator

11

4. The DC motor speed controller

The purpose of a motor speed controller is to drive a motor at the demanded speed. The controller may or may not actually measure the speed of the motor. If the controller measures the speed of the motor, it is called a Feedback Speed Controller or Closed Loop Speed Controller, if not it is called an Open Loop Speed Controller. Feedback speed control is better, but more complicated.

The speed of a DC motor is directly proportional to the supply voltage, so e.g. if we reduce the supply voltage from 12 Volts to 5 Volts, the motor will run more slowly. The speed controller works by varying the DC voltage sent to the motor. It could do this by simply adjusting the value of the voltage sent to the motor, but this is quite inefficient. A better way is to switch the motor's supply on and off very quickly. If the switching is fast enough, the motor doesn't notice it, it only notices the average effect. The motor won’t have time to change speed much, so the speed will be quite steady. This is the principle of switch mode speed control (PWM – Pulse Width Modulation). In our project we used onboard microcontroller which has PWM outputs.

As the amount of time that the voltage is on increases compared with the amount of time that it is off, the average speed of the motor increases.

This on-off switching is performed by power MOSFETs (that the H-Bridge contains). A MOSFET (Metal-Oxide-Semiconductor Field Effect Transistor) is a device that can turn very large currents on and off under the control of a low signal level voltage.

5. PWM- pulse width modulation

Pulse width modulation (PWM) is a technique in which a series of digital pulses is used to control an analog circuit. The length and frequency of these pulses determines the total power delivered to the circuit. PWM signals are most commonly used to control DC motors.

The digital pulse train that makes up a PWM signal has a fixed frequency and varies the pulse width to alter the average power of the signal. The ratio of the pulse width to the period is referred to as the duty cycle of the signal.

Fig. V9 PWM signals of varying duty cycles

Fig. V10 Definition of a general square wave

Page 12: Control And Programingof Synchronous Generator

12

PWM uses square wave whose duty cycle is modulated resulting in the variation of the average value of the waveform. If we consider a square waveform f(t) with a low value miny , a high value ymax

and a duty cycle TtD on (figure V10), the average value of the waveform is given as:

T

dttfT

y0

)(1

As f(t) is a square wave, its value is maxy for TDt 0 and miny for TtTD . The above expression then becomes:

minmaxminmax

min0

max )1()1(

)(1 yDyDT

yDTyTDdtydty

Ty

T

DT

DT

This expression can be simplified by assuming 0min y ,

maxyDy

From this equation, it is obvious that the average value of the signal

y is directly depended on the duty cycle D. To generate PWM signal we need sawtooth or triangle waveform and a comparator. When the value of the reference signal – sine wave is more than the modulation waveform, the PWM signal is in the high state, otherwise it is in the low state (fig. V11).

Sigma – Delta modulation: the output signal is subtracted from a reference signal to form an error signal. This error is integrated, and when the integral of the error exceed the limits, the output changes state.

Fig. V11 Principle of the PWM signal generating

Page 13: Control And Programingof Synchronous Generator

13

Microcontrollers are the digital circuits that can generate PWM signals to control an electrical motor. They normally use a counter that increments periodically (it is connected directly or indirectly to the clock of the circuit) and is reset at the end of every period of the PWM. When the counter value is more than the reference value, the PWM output changes state from high to low.

Important facts: 1) To increase speed you increase pulse width, so you increase motor voltage. 2) Frequencies between 20 Hz and 18 kHz may produce audible screaming from the speed

controller and motors. 3) RF interference emitted by the circuit will be worse the higher the switching frequency is. 4) Each switching on and off of the speed controller MOSFETs results in a little power loss.

Therefore the greater the time spent switching compared with the static on and off times, the greater will be the resulting switching loss in the MOSFETs.

5) The higher the switching frequency, the more stable is the current waveform in the motors. This waveform will be a spiky switching waveform at low frequencies, but at high frequencies the inductance of the motor will smooth this out to an average DC current level proportional to the PWM demand. This spikyness will cause greater power loss in the resistances of the wires, MOSFETs, and motor windings than a steady DC current waveform.

Fig. V12 Principle of the sigma- delta PWM

Page 14: Control And Programingof Synchronous Generator

14

VI. DC MOTOR- GENERATOR (MEASUREMENT)

Measurements for finding the relations between the active, reactive, apparent power and DC motor and synchronous generator currents

EQUATIONS

DC MOTOR SYNCRONOUS GENERATOR

1111 EfZIV arm 2222 VZIEf arm

cos3 111 VIP arm cos3 222 VIP arm

pfn

2120 1

11 pEKnEf HzfKP p 501

1

11

1

1

pE

arm

pE KIZ

KVn

VVKQ Q 4001

11 armp IK

11

11

11

1

field

arm

field IKIZ

IKVn

USING THE EQUATIONS TO SOLVE CURRENTS FROM P AND Q VALUES

The way the system gets this final relations between currents and P and Q using the

expressions shown below:

DC MOTOR SYNCHRONOUS GENERATOR

Fig. VI1 DC motor as prime mover for the synchronous generator (synchronous generator as mechanical load for DC motor)

Page 15: Control And Programingof Synchronous Generator

15

P f n

Ifield DC MOT

Iarm DC MOT HzfKP p 501 p

fn2

120 1

11

11

11

1

field

arm

field IKIZ

IKVn

cos3 1

111

VPIarm

Q VG EfG Ifield GEN VVKQ Q 4001

2222 VZIEf arm 22 armIfEf

11 armIfEf

3S V I

Those expressions should be checked in real world by doing tests of dc motor and synchronous generator. We then will get the constant relations found in the equations.

OPEN AND SHORT CIRCUIT TESTS OF SYNCHRONOUS GENERATOR

a) Open – circuit test (terminals are open, no load) – terminal voltage is measured

Ef (V2 -fig. VI1), field current is varied If (If2 – fig. VI1)

Values that we measured in the laboratory:

I field (A) 0 0,01 0,02 0,032 0,045 0,053 0,064 Ef (V) 2,32 9,88 16,6 28,52 41,1 45,3 53,7

Ef (V) / 3 - per phase Ef (V) 1,34 5,7 9,58 16,45 23,71 26,14 30,98

0,081 0,092 0,1 0,114 0,123 0,136 67,7 77,3 84,7 97,4 110 116,7

Ef (V) / 3 39,06 44,6 48,80 56,19 63,46 67,33

Fig. VI2 Relations between currents of motor, generator and powers

Fig. VI3 Circuit for this type of test

Page 16: Control And Programingof Synchronous Generator

16

b) Short – circuit test (terminals are shorted) field current is varied If, armature current is measured Iarm

Values that we measured in the laboratory:

I field (A) 0 0,012 0,021 0,034 0,052 0,075 0,094 0,103 0,126 0,136 I arm (A) 0,01 0,037 0,091 0,143 0,209 0,299 0,365 0,427 0,490 0,531

Error measured: I arm m = I arm m – I arm m (I field (0)) I arm (A) 0 0,027 0,081 0,133 0,199 0,289 0,355 0,417 0,480 0,521

IMPEDANCE We obtain the impedance of the synchronous generator from the figures mentioned before:

xy 9536,4 IfieldEf 9536,4 (V) (fig VI4)

xy 0491,0 IfieldIarm 0491,0 (A) (fig VI6)

IarmEfZs = 88,100

0491,09536,4

R measured = 2,4 Ω

Fig. VI4 Open- circuit test

Fig. VI5 Circuit for this test

Fig. VI6 Short- circuit test

Page 17: Control And Programingof Synchronous Generator

17

85,100)4,2()88,100()()( 2222 RZsXs H

TESTING RELATIONS CURRENTS – SPEED OF DC MOTOR (in laboratory) TEST 1.

VT [V] IA [A] N [rpm] Ωm

[rad/s] kg Pout [W] Vload

[V] M [N*m]

0 0,0 0 0,000 0,000 0,000 0,000 0,000 20 0,5 160 1,005 0,300 1,480 0,012 1,473 40 1,0 314 1,973 0,450 4,360 0,037 2,210 60 1,5 483 3,035 0,600 8,941 0,053 2,946 80 2,0 633 3,977 0,750 14,647 1,500 3,683 100 2,8 807 5,071 0,850 21,166 20,000 4,174 120 3,5 695 6,063 1,000 29,769 40,000 4,910 140 4,0 1127 7,081 1,150 39,986 75,000 5,647 160 4,8 1300 8,168 1,300 52,136 86,000 6,383 180 5,5 1463 9,192 1,450 65,447 97,500 7,120 200 6,0 1625 10,210 1,600 80,210 108,000 7,856

TEST 2.

I arm DC [A]

I field DC [A]

V arm DC [V]

V field DC [V]

Speed n [rpm]

V dc supply [V]

2,44 0,13 16,3 25,97 340 30 2,05 0,16 25,3 32 543 37 1,86 0,189 30,8 35,9 600 42 1,33 0,29 59,2 57,8 835 66 1,15 0,39 81 79,5 902 87 1,07 0,508 106 97,5 988 112,6 1,06 0,62 131,4 119,1 1082 137,6 1,06 0,75 160 144 1217 166 1,07 0,85 185 165,7 1335 191,3 1,12 0,98 211,4 189,8 1463 218 1,14 1,06 230 206,2 1554 237 1,17 1,13 247,8 221,8 1638 254,8 1,21 1,227 268,8 240,6 1737 276,6

Fig. VI7 Impedance Zs, Terminal voltage Ef, amature current Iarm as function of field current

Page 18: Control And Programingof Synchronous Generator

18

In this graphic we can see that the speed increases with increasing of the armature current. The equation we can deduce is:

In this graphic we can see how field current influences on the speed are highly change by the currents. The equation we can deduce is:

TESTING ARMATURE CURRENT INFLUENCE OF DC MOTOR ON REAL, REACTIVE AND APPARENT POWER OF GRID

Measured values: GEN DC MOTOR GRID DC M GEN Dc sup I field

[A] I arm

[A] I field

[A] P [W] Q[VAR] S [VA] Varm

[V] V field

[V] V field

[V] 0,976 3,26 0,406 46 191,64 199,3 163 120 147 0,969 3,478 0,405 64 195 184 180 120 147 0,961 3,959 0,403 123 152 198 136,5 120 147 0,958 4,09 0,402 137 153 203 136 118 147 0,932 5,31 0,395 308 68,52 320 135 117 147 0,930 6,3 0,391 441 138 469 136 118 147 0,924 6,77 0,389 473 134,75 500 135 112 147 0,895 9,49 0,377 796,2 316,30 877,2 135 111 147 0,894 9,63 0,377 800 315 857 135 116 147

Fig. VI8 DC motor speed dependence on the armature current

Fig. VI9 DC motor speed dependence on the field current

Page 19: Control And Programingof Synchronous Generator

19

In this graphic we can see that P, Q and S are highly depend on the DC motor armature current. The equations we can deduce are:

In this graphic we can see that only armature current of dc motor changes with real power. The

equation we can deduce is:

TESTING FIELD CURRENT INFLUENCE OF SYNCHRONOUS GENERATOR ON REAL, REACTIVE POWER, ARMATURE AND FIELD CURRENTS OF DC MOTOR

Measured values: GEN DC MOTOR GRID DC M GEN I field

[A] I arm

[A] I field

[A] P [W] Q

[VAR] S [VA] V arm

[V] V field

[V] 0,945 7,05 0,387 504 71 506 134 120 0,975 7,08 0,387 495 167 518 134 120 0,998 7,13 0,387 491 244 550 134 122 1,054 7,07 0,386 494 439 661 134 130 1,098 7,08 0,385 486 612 785 134 140 1,13 7,16 0,388 490 739 893 134 143

Fig. VI10 Powers dependence on the armature current (DC motor)

Fig. VI11 Currents dependence on real power

Page 20: Control And Programingof Synchronous Generator

20

In this graphic we can see how P,Q, S depend on the generator field current. The equations we

can deduce are:

In this graphic we conclude that there are no changes in the DC Motor currents when the Generator field current is changed.

TESTING FIELD CURRENT INFLUENCE OF DC MOTOR ON REAL, REACTIVE POWER, ARMATURE AND FIELD CURRENTS OF DC MOTOR AND SYNCHRONOUS GENERATOR

Measured values:

GEN DC MOTOR GRID DC M GEN I field

[A] I arm

[A] I field

[A] P [W] Q

[VAR] S [VA] V arm

[V] V field

[V] 1,16 3,54 0,42 74 904 909 138 150 1,158 4,4 0,398 162 887 903 134 140 1,14 5,2 0,378 254 829 865 131 150 1,13 6,17 0,358 353 751 824 127 150 1,11 7,06 0,342 427 694 818 124 150 1,10 7,8 0,32 487 647 803 121 150 1,09 8,7 0,31 555 569 790 118 150

Fig. VI12 Powers dependence on the field current (synchronous generator)

Fig. VI13 Currents dependence on real power

Page 21: Control And Programingof Synchronous Generator

21

P f n

Ifield DC MOT

Iarm DC MOT HzfKP p 501

11

11

11

1

field

arm

field IKIZ

IKVn

11 armIfEf

pfn

2120 1

cos3 1

111

VPIarm

In this graphic we can see how P,Q, S depend on the DC motor field current. The equations

we can deduce are:

In this graphic we can see that only armature current of dc motor changes with real power. The equation we can deduce is:

AFTER THE TESTS WE TRY TO FIND THE REAL RELATIONS

Fig. VI14 Powers dependence on the field current (DC motor)

Fig. VI15 Currents dependence on real power

Page 22: Control And Programingof Synchronous Generator

22

Q VG EfG Ifield GEN VVKQ Q 4001

2222 VZIEf arm 22 armIfEf

3S V I

RELATION BETWEEN P AND CURRENTS As is shown in the fig. VI4:

( )f fieldGENE f I 495,36f fieldGENE I

100,88GENZ 495,36armGENfieldGEN GEN GENI I Z V

495,36 100,88fieldGEN armGEN GENI I V 495,36 100,88GEN fieldGEN armGENV I I

3 400armGENSI

As is shown in the figure:

81,343GEN fieldGENS I 81,343 367, 47

3 400fieldGEN

armGEN

II

0,1174 53,506armGEN fieldGENI I

495,36 11,84 53,5GEN fieldGEN fieldGENV I I V

( 400 )GEN GENQ K V V

(495,36 11,84 53,5 400 )GEN fieldGEN fieldGENQ K I I V V

(485,51 453,506 )GEN fieldGENQ K I V

As is shown in the Plot n:

139,144 108,33GEN fieldGENQ I 0, 2865QK

Page 23: Control And Programingof Synchronous Generator

23

P f n

Ifield DC MOT

Iarm DC MOT HzfKP p 501

11

11

11

1

field

arm

field IKIZ

IKVn

11 armIfEf

P f n

Ifield DC MOT

Iarm DC MOT HzfKP p 501

11

11

11

1

field

arm

field IKIZ

IKVn

11 armIfEf

pfn

2120 1

cos3 1

111

VPIarm

cos3 1

111

VPIarm

EQUATIONS AFTER OPERATIONS WITH TEST VALUES

CONCLUSION

RELATION BETWEEN Q AND CURRENTS As is shown in the Plot n:

( )f fieldGENE f I 495,36f fieldGENE I As is shown in the Plot n

100,88GENZ 495,36armGENfieldGEN GEN GENI I Z V

495,36 100,88fieldGEN armGEN GENI I V 495,36 100,88GEN fieldGEN armGENV I I

3 400armGENSI

As is shown in the Plot n:

81,343GEN fieldGENS I 81,343 367, 47

3 400fieldGEN

armGEN

II

0,1174 53,506armGEN fieldGENI I

495,36 11,84 53,5GEN fieldGEN fieldGENV I I V

Page 24: Control And Programingof Synchronous Generator

24

Q VG EfG Ifield GEN VVKQ Q 4001 2222 VZIEf arm 22 armIfEf

3S V I

0, 2865( 400 )GEN GENQ V V 495,36f fieldGENE I 11,84 53,5f fieldGEN GENE I V V

Q Ifield GEN 139,144 ( ( ))GEN fieldGENQ I C c f P

( 400 )GEN GENQ K V V

(495,36 11,84 53,5 400 )GEN fieldGEN fieldGENQ K I I V V

(485,51 453,506 )GEN fieldGENQ K I V

As is shown in the Plot n:

139,144 108,33GEN fieldGENQ I 0, 2865QK

EQUATIONS AFTER OPERATIONS WITH TEST VALUES

CONCLUSION

Page 25: Control And Programingof Synchronous Generator

25

VII. POWER ELECTRONICS SUPPLY: H- BRIDGE ELECTRONIC CIRCUIT

A) GENERAL FIGURE:

B) TRUTH TABLE:

V6 V5 Result 0 0 stop 0 1 reverse 1 0 forward 1 1 not allowed

0 logic LOW, 0V 1 logic HIGH, 5V

Fig. VII1Scheme of H- bridge

Page 26: Control And Programingof Synchronous Generator

26

C) OPERATING PRINCIPLES:

Forward mode:

16 V -> VQVce 0)2( saturated -> max)2( cc IQI -> VMVgs 12)2( ->

VMVds 0)2( saturated -> max)2( dd IMI -> VMVd 12)2( -> VV 05 -> VQVce 12)1( clogged -> AQI c 0)2( -> VMVgs 0)3( -> VMVds 12)3( clogged ->

AMI d 0)3( -> VMVgs 11)4( from voltage divider -> VMVds 0)4( saturated ->

VMVd 0)4( -> VMVgs 0)1( -> AMI d 0)1( -> VMVds 12)1( clogged, DC motor rotates in forward direction

Reverse mode:

06 V -> VQVce 12)2( clogged-> AQI c 0)2( -> VMVgs 0)2( ->

VMVds 12)2( clogged -> AMI d 0)2( -> VMVd 0)2( -> VV 15 -> VQVce 0)1( saturated -> max)2( cc IQI -> VMVgs 12)3( -> VMVds 0)3( saturated ->

max)3( dd IMI -> VMVgs 0)4( -> VMVds 12)4( clogged -> VMVd 12)4( ->

VMVgs 11)1( from voltage divider -> max)1( dd IMI -> VMVds 0)1( saturated, DC motor rotates in reverse direction

Stop mode:

06 V -> VQVce 12)2( clogged-> AQI c 0)2( -> VMVgs 0)2( ->

VMVds 12)2( clogged -> AMI d 0)2( -> VMVd 0)2( -> VV 05 -> VQVce 12)1( clogged -> AQI c 0)2( -> VMVds 12)3( clogged -> AMI d 0)3( -> VMVd 0)3( M4 and M3 unpolarizated, DC motor doesn’t rotate

Not allowed mode:

16 V -> VQVce 0)2( saturated -> max)2( cc IQI -> VMVgs 12)2( ->

VMVds 0)2( saturated -> max)2( dd IMI -> VMVd 12)2( -> VV 15 -> VQVce 0)1( saturated -> max)2( cc IQI -> VMVgs 12)3( -> VMVds 0)3( saturated ->

max)3( dd IMI -> VMVd 12)3(

So Transistors M1, M4 are also saturated which shorts power supply!!! Not recommended.

Page 27: Control And Programingof Synchronous Generator

27

D) CHARACTERISTIC SIGNALS:

FORWARD AND REVERSE MODE - control voltage signals

- dc motors voltage and current

Page 28: Control And Programingof Synchronous Generator

28

STOP MODE - control voltage signals

- DC motor’s voltage and current

Page 29: Control And Programingof Synchronous Generator

29

NOT ALLOWED MODE

- control voltage signals

- DC motor’s voltage and current

Page 30: Control And Programingof Synchronous Generator

30

E) CHOSEN INTEGRATED CIRCUIT:

To build power electronic supply which drives each DC servomotor we have chosen IC type L298. The l298 id is an integrated monolithic circuit. It is a high voltage, high current dual full- bridge driver designed to accept standard TTL logic levels and drive inductive loads such as relays, solenoids, dc and stepping motors. Two enable inputs are provided to enable or disable the device independently of the inputs signals. The emitters of the lower transistors of each bridge are connected together and the corresponding external terminal can be used for the connection of an external sensing resistor. An additional supply input is provided so that the logic works at the lower voltage. The block diagram of this circuit is as following:

THE TRUTH TABLE OF THIS IC AS FOLLWING:

Inputs Function

Ven=H C=H; D=L Forward C=L; D=H Reverse

C=D Fast Motor Stop Ven=L C=X; D=X Free Running Motor Stop

Fig. VII2 Block diagram

Page 31: Control And Programingof Synchronous Generator

31

PIN FUNCTIONS OF THIS IC ARE AS FOLLOWING (refer to the block diagram):

MW. 15 Name Function

1; 15 Sense A; Sense B Between this pin and ground is connected the sense resistor to control the current of the load

2; 3 Out 1; Out 2 Outputs of the Bridge A; the current that

flows through the load connected between these two pins is monitored at pin 1

4 Vs

Supply Voltage for the Power Output Stages. A non- inductive 100nF capacitor must be

connected between this pin and ground 5; 7 Input 1; Input 2 TTL Compatible Inputs of the Bridge A

6; 11 Enable A; Enable B TTL Compatible Enable Input; the L state disables the bridge A (enable A) and/or the

bridge B (enable B) 8 GND Ground

9 VSS Supply Voltage for the Logic Blocks. A

100nF capacitor must be connected between this pin and ground

10; 12 Input 3; Input 4 TTL Compatible Inputs of the Bridge B

13; 14 Out 3; Out 4 Outputs of the Bridge B. The current that flows through the load connected between

these two pins is monitored at pin 15 - N. C. Not Connected

PIN CONNECTIONS (top view):

Fig. VII3 Pin connections

Page 32: Control And Programingof Synchronous Generator

32

Fig. VII4 Scheme of practical circuit

TYPICAL ELECTRICAL PARAMETERS OF THIS IC:

F) PRACTICAL APPLICATION:

We are able to use one piece of IC L298 to drive two servomotors. According to general ideas of our project we have to control three servomotors. That is why we use 2 pieces of L298. On the following scheme we present practical circuit with all necessary external elements. The scheme shows application for only one DC servomotor, because the rest is exactly the same. As an external power supply we use standard adjustable laboratory DC supply.

Page 33: Control And Programingof Synchronous Generator

33

Fig. VII5 H- Bridghe’s tests

Description:

- the levels of control voltage signals are: L=0V, H=5V - diodes D1, D2, D3, D4– reduce current spikes from motor switching, we use typical

Schottky’s diodes type: 1N5819 40V- peak repetitive reverse voltage, 25A non-repetitive peak surge current

- capacitors which bypass power supply: C=100nF - the value of Vs should respect total voltage drop on internal transistors and output

current. Our servomotor operates at 12V and 60mA. So lets take maximum voltage drop as 1V, so Vs~13V, Vss=5V

- we don’t use sensing output - to enable circuit Enable input is H - each unused input called N\C is connected to GND - each unused output is connected to GND through 10MΩ resistor - control voltage wire connections are as short as possible to avoid parasite induction

G) H- BRIDGE’S TEST:

Tests confirmed that H- Bridge was a good idea to use in our project to control the motor. In

the pictures above we can see two situations: when the motor is turning in right way- green diode shows that and when the motor is turning in opposite way- red diode.

Page 34: Control And Programingof Synchronous Generator

34

VIII. HEX BUFFER (NON- INVERTING) CD 4010C

In our project we used the buffer in front of the H – bridge, because higher current productivity was needed to drive bridge properly (on the inputs of circuit L298 are placed bipolar transistors that demand certain level of gate current, microprocessor can’t provide enough current to activate H- Bridge). As the buffer we used CMOS 4010 integrated circuit.

General Description The CD 4010 C hex buffer is monolithic complementary MOS integrated circuit. The N- and P-

channel enhancement mode transistors provide a symmetrical circuit with output swings essentially equal to the supply voltage. This results in high noise immunity over a wide supply voltage range. No DC power other than that caused by leakage current is consumed during static conditions. The gates may be used as hex buffers, CMOS to DTL or TTL interface or as CMOS current drivers. Conversion ranges are from 3V to 15V providing Vcc ≤ Vdd. The device also has buffered outputs which improve transfer characteristics by providing very high gain.

Features

Wide supply voltage range: 3V to 15V Low power typ.100nW High noise immunity High current sinking capability: min 8mA at V0=0,5V and Vdd=10V

Applications

Industrial control Automotive Data terminals Medical electronics Remote metering Computers Alarm systems Instrumentation

Fig. VIII1 Connection and schematic diagrams

Page 35: Control And Programingof Synchronous Generator

35

Absolute maximum ratings (limits beyond which damage to the device may occur):

Voltage at any pin Vss –0,3V to Vss +15,5V Operating temperature range -45°C to +85°C Power dissipation (Pd) Dual- In- Line 700mW Small Outline 500mW Lead temperature Tl (soldering, 10s) 260°C Operating Range (Vdd) Vss +3V to Vss +15V

Fig. VIII2 Typical application

Page 36: Control And Programingof Synchronous Generator

36

IX. DC- DC CONVERTER

DC - DC converter allows us regulate dc power supply of the servomotors. This circuit provides greater output current than the input current that we need to drive the servomotors.

We used DC- DC converter to increase the output current coming from H- Bridge using high power transistors. So now we are able to use the power supply to provide the current for servomotors. This system can operate with very small input currents, so we can regulate heat on the H-bridge by regulating the current on output. Transistors will do all the work in that system.

To minimize the ripple on output we can use a low- pass filter. The only thing we have to do is to assume the minimum frequency of the signal applied to input to control the servo motors. Our goal is to build a filter that has a low resonance frequency lower than the minimum frequency that we can generate from the microcontroller.

We used C = 470µF , L = 28,8µH for filter circuit in our test experiment. The test has shown that we can easily drive a motor that needs 1,6A of the starting current. We can control also the speed of motor changing the duty cycle of the input signal (the test signal was a square signal with Vpp=5V and Voffset=5V to be able to use transistor correctly).

Another possibility was to use DC- DC converter alone to control DC servomotors by changing the duty cycle with microcontroller, but using an H- Bridge makes it easier to work with servomotors and control the generator.

Driving motor in both two ways

We encountered a small problem in this type of controlling. The problem was to drive the motor in both ways forward and backward. We overcame this problem with something like a dual DC-DC converter (figure VIII2). Both DC- DC converters should be driven by two independent voltage otherwise ground will be a big problem that will cause a fatal error in circuit by equalizing both plus and minus nodes of servomotor and stopping the motor.

C1

Q1

D1

L1

VCC

control signal

S1M

Q2 Q3 high power and high current gain transistors

Fig. IX1 DC- DC Converter (S1 => DC motor)

Page 37: Control And Programingof Synchronous Generator

37

This system will make possible to drive also bigger motors by such low current electronic devices.

Example of calculating the minimum value of circuit inductance:

VVd 5 , VV 120 assuming e.g. fs = 20kHz, I0 = 1A, C = 470µF and the ideal circuit components

DV

VV

d

114,2

5120

6,058,0 D

sf

Ts

s 501

200 )1(

2DD

LVTI s (Boundary mode)

HDDIVTL

b

s 8,28)1(2

2

0

0min

THE FORMULA FOR RESONANCE FREQUENCY

kHzLC

f res 37,110470108,282

12

166

In the experiment we calculated the resonance frequency to build the filter. That frequency

should be lower than possible applied frequency range to the input of dc-dc converter.

C1

Q1

L1

control signal

S1M

Q2 Q3 high power and high current gain transistors

D1

Q4 Q5 Q6 U1control signal

D2 L2

V1

V2

Fig. IX2 Dual DC- DC Converter

Page 38: Control And Programingof Synchronous Generator

38

X. SERVOMOTOR- MAXON DC MOTOR

Knowledge about basic servomotor features allows us design electronic device properly (H–Bridge and DC- DC converter as well).

, whre n– speed, M– torque, I– current

Fig. X1 Maxon DC motor

Fig. X2 Operating ranges

Fig. X3 Short term operation

Page 39: Control And Programingof Synchronous Generator

39

, where: ON- Motor in operation OFF- Motor inoperative Î- max. peak current Ipermiss.- max. permissible continuous current Ton- ON time T- cycle time ton + toff D- Duty cykle in percent

Important parameters of the motor:

power rating (reccomended uotput power range) P [W] nominal voltage U [V] no load speed n0 [rpm] (motor turns at nominal voltage without speed, speed is proportional to

applied voltage) starting torque M [mNm] speed / torque gradient Δn / ΔM [rpm/mNm] (calculating at 25°C winding temperature) no load current I0 [mA] – (depends on brush and gearing friction) starting current Ia [mA] - proportional to starting torque terminal resistance R [Ω] (at 25°C, determines starting current) maximum permissible speed nmax [rpm] maximum permissible continuous current Ipermiss [mA] (operating motor continuosly at

25°C) max permissible continuous torque Mperm [mNm] max output power Pmax [mW] (at 25°C rotor temperature) max efficiency η [%] (the higher efficiency - nearer to no load speed) torque constant Km [mNm/A] speed constant Kn [rpm/V] mechanical time constant τm [ms] (the time required the motor to accelerate from standstill to

63% of its no load speed, after 4τ rotor will reach 99% of no load speed) moment of interia Jr [gcm2] terminal inductance L [mH] (measured at 1kHz, sinusoidal.) thermal resistance Rth [K/W] (from housing to ambient air)

Fig. X4 Motor parameters

Page 40: Control And Programingof Synchronous Generator

40

Fig. XI1 Power supply connector of ADMC401 processor board

XI. MICROCONTROLLER

The ADMC401 processor board is intended as a compact, highly integrated evaluation and software development platform for the ADMC401 controller. The processor board permits access through a UART connection to the Motion Control Debugger software that operates under Windows. The Motion Control Debugger is used to download executable code, examine the contents of registers, program memory and data memory, run executable modules, set breakpoints and enable single- step operation.

In our project we have 3 electronic bridges. Each of them needs two PWM signals so

eventually the project requires using six PWM signals. The ADMC401 Analog devices equipment has this possibility.

In this part of our report we are wondering about performance of the microcontroller and also trying to find out suitable source code.

Power supply requirements

The ADMS401 processor board contains a 4- way terminal block for connection of external power supplies. For correct operation, the following supplies were required:

+5V ± 5%, 300 mA (VDD) +5V ± 5%, 30 mA (+AVDD) -5V ± 5%, 30 mA (-AVDD) Ground

The VDD supply powers the digital logic circuits of the processor board, including the

ADMC401 controller. In addition, it is used as the analog voltage supply of the ADMC401 and as the input to the dc- dc converter that provides the isolated supply for the UART interface. The processor board is laid out with separate analog and digital ground planes that are connected by a link (JP2) close to the power supply terminal block for noise immunity. This link should not be removed. An LED on the processor board indicated correct connection of the VDD supply. The +AVDD and –AVDD supplies power the operational amplifiers used in the analog interface section. These amplifiers correctly offset the analog inputs to the board for interface to the ADC inputs of the ADMC401. Appropriate decoupling capacitors are provided on the processor board for all three power supply inputs (VDD, +AVDD and –AVDD) to reduce noise coupling from the external power supplies. However, for best performance, well- regulated external power supplies and correct wiring are recommended.

Page 41: Control And Programingof Synchronous Generator

41

A) THE SINGLE UPDATE MODE AND DOUBLE UPDATE MODE

The PWM generation Unit of ADMC401 can be programmed to operate in two distinct operating modes: single update mode or double update mode. We will be using the second one, because it gives for us more capabilities. This mode is enabled by setting bit 6 of the MODECTRL register. The performance and capability of double update mode are as a following:

The switching period is controlled by the PWMTM register according to:

Ts = 2*PWMTM * tck , where tck is the DSP clock rate (38.5 ns at a 26 MHz CLKOUT rate)

The moments of interrupt are given by the PWMSYNC signal. It is produced by the internal PWM Generation Unit every:

Tsync = PWMTM * tck The width of PWMSYNC pulse is still controlled by the PWMSYNCWT register. As we can see, moments of interrupts appear twice per switching period. After that microprocessor reads new duty cycles values from suitable registers. PWMSYNC interrupt is generated within the ADMC401 by the rising edge of signal. The PWMSYNC pulse is produced on the dedicated PWMSYNC pin.

New duty cycle’s values can be written to the PWMCHA, PWMCHB, PWMCHC registers twice per switching period. This means that different values can be used to control both the rising edge and falling edge of each PWM signal.

In addition, it is also possible to update all other registers of the PWM (PWMTM, PWMDT, PWMPD, PMWSEG, PWMGATE, and PWMSYNCWT) at a rate of twice that of the switching frequency. If these registers are not updated, the same value is applied continuously.

The bit 3 of SYSSTAT register (0 or 1) indicates half of duty cycles. When this bit is cleared, the timer decrements each DSP clock period (tck) until it reaches zero. When we set this bit, the timer is incrementing and the SYSSTAT signal is generated.

The duty cycle’ values can be also programmed by using of PWMDT register. DT means dead time and it indicates shift between edges of two PWM signals. DT switches edges away from the desired point by an equal amount.

PWMTRIP allows shutting down the microcontroller immediately. It is possible when we change 1 to 0. At this moment also the PWMSYNC pulses are switched off. The bit 1 of SYSSTAT register contains information about configuration of PWMTRIP.

Using of double update mode ensures some advantages:

It produces lower harmonic distortion than symmetrical pattern in single update mode. In other words, our signals on the outputs are more similar in theoretical meaning.

The symmetrical PWM schemes can be also shown to produce small frequency distortions at multiples of the fundamental output frequency. With the asymmetrical switching frequency schemes (produced using double update mode) can be shown that no such harmonic can be produced.

It is also possible to update the applied voltage to the motor twice as fast as with single update mode.

Page 42: Control And Programingof Synchronous Generator

42

Fig. XI2 Switching periods

Disadvantage of using the double update mode:

The only disadvantage in double update mode is that the complete control law must be computed within half a switching period. However, the power of the DSP core of the ADMC401 provides sufficiently fast and efficient processing that the computational burden of double update mode can be handled adequately.

In case of double update mode it is possible to calculate ton and duty cycles value.

1. The on-times can be expressed as:

2. Duty-cycle can be expressed as:

Regardless of operation mode selection each of the six PWM outputs signals can be enabled or disabled by separate output enable bits of the PWMSEG register. It is also possible by using PWMPOL pin. It can be used to select the polarity of the PWM signals so either active high or active low PWM patterns can be produced by the ADMC401.

The operation during start-up will be somewhat different depending on whether or not the PWMTM register is the first PWM register that is written. If the PWMTM register is written first (we will use this option), the PWM timer begin incrementing from zero to the PWMTM values. This actually corresponds to second half cycle of the PWM. During this time, the PWM unit is in the disable state and all six PWM outputs are OFF. Provided the PWMCHA, PWMCHB and PWMCHC registers have all been written to at the time the PWM-timer reaches the PWMTM value, the first internal load signal will then be generated when the PWM timer reaches the PWMTM value. At this point the PWM generation unit enters the normal state and the new values are latched into the PWMCHA, PWMCHB and PWMCHC registers. However the PWMSYNC pulse is generated at this

CKAL

CKAH

tPWMDTPWMDTWPMCHAPWMCHAPWMTMPWMTMTtPWMDTPWMDTPWMCHAPWMCHAT

)()(

212121

2121

21

212121

21

2121

PWMTMPWMTMPWMDTPWMDTWPMCHAPWMCHAPWMTMPWMTM

TTd

PWMTMPWMTMPWMDTPWMDTPWMCHAPWMCHA

TTd

S

ALAL

S

AHAH

Page 43: Control And Programingof Synchronous Generator

43

first load signal. The values written to the PWMCHA, PWMCHB and PWMCHC registers (in conjunction with the other PWM registers such as PWMDT, PWMPD, PWMSEG, PWMGATE registers) define the outputs during next half cycle (in double update mode). The appearance of the first PWMSYNC pulse (and associated interrupt) will occur at the end of the first half cycle of PWM when the PWMTM reaches zero. The second PWMSYNC pulse will occur at the second cycle of PWM when the PWMTM reaches zero. This situation will be repeating cyclically.

B) GENERAL RELATIONS AMONG DIFFERENT FILES, WHICH DOUBLE UPDATE PROGRAM CONSIST OF

main.dsp => this file is the actual implementation of the application. Therefore it contains at

least the starting point of the program. It must be located in the current working directory. This file refers to set of header files (*.h). It contains initialisation functions and code which is intended to demonstrate the use of particular set of library routines.

main.h => this file contains definition of specific system constant and system parameters, configuration constants. All these constants are used by library routines. This file refers to header files with general ADMC401 constants and some of macro definitions.

ADMC401.h => this file includes important ADMC401 constants with addresses assigned to this constant.

macro.h => it contains definitions of some macros for commonly needed tasks.

PWM401.h => it is the part of implementation of PWM401 routine program. There are macros definitions, variable definition which can be used by each module that refers to this file.

PWM401.dsp => the purpose of this code file is the implementation of subroutines and definitions log global and local variables.

Tree of the above structure:

Main.dsp

PWM401.h main.h

macro.h

PWM401.h

subroutines:PWM_INIT

ADMD401.h

Fig. XI3 Structure of the double update program

Page 44: Control And Programingof Synchronous Generator

44

Also provided are some other files which are either necessary to assembler/linker [architecture files (ADMCxxx.ach, ADMCxxx.sys) register definition (ADMCxxx.h)] or useful for code development [general purpose macros (macro.h), definition of routines included in the ROM of the device (romutil.h) ,where applicable].

Compilation process

The batch file that compiles and links the application is called make.bat. It must be located in the current working directory. In order to work correctly, the path of the Root_Directory is expected as the input parameter.

Every code files is then assembled and linked. If no errors are found, the ADMCxxx executable file main.exe is created and short informs of correct compilation. Firstly, the user`s code is assembled with to a call to ams21.The second task is to compile all the library routines and packing them into a 21xx library file. If the available program memory allows for it, this section may be unchanged. If due to memory constraints unused library routines need to be excluded, the user may remove them by simply removing the corresponding library file in the statement invoking. At last the assembled object files are linked by the statement invoking LD21. Every user file must be listed in the following line, where FILENAMEx is the name of the object file (without extension, i.e. MAIN) to be linked .The library is linked automatically with the– user switch.

C) PWMCH values calculation to update duty cycles

Each of generated PWM signals has its own duty cycle. It can be updated using following macro. The resultant values are computed as an actual value of PWMTM register multiplied by desired duty cycle for each channel (expressed as hexadecimal variables set from external software i.e. Lab View through SPORT- serial port). These hexadecimal variables we declare as circular data buffers which will be explained in the next paragraph. In the end the resultant values are converted into PWMCHA, PWMCHC and PWMCHC registers.

The general formula of this macro is as following:

PWMT initial value is defined in admc401.h file: .CONST PWMTM = 0x2008; PWM timer register

D) Data Buffer declaration

We will declare data buffer as 3– element length circular buffer, each word is written down on 10 bits (in binary notation). Circular buffer can be located in certain boundaries in memory. It has to start at a base address which is multiplied of 2n, where n is number of bits required to represent the buffer length in binary notation. The “n” has to satisfy following formula:

nL 22 12

, where L is the length of the buffer

So in our case L=3, in binary 3=>11 so we have got n=2 bits. We round upward the L value to the closest power of 2, that’s why base address will be assigned by linker as a*22=4a for example it

Page 45: Control And Programingof Synchronous Generator

45

will be 8. The 2 least significant bits will be set as 0 (because length of buffer in binary is presented on 2 bits)

Base address=XXXXXX00

And whole buffer address can be presented as:

XXXXXX00 – first element (base) XXXXXX01 – second element

XXXXXX10 – third element

Next address inside buffer – calculation principle The way how the next address is derived can be stated as follows:

Next address=(I+M-B)Modulo(L)+B , where:

I -> current address M -> modify value (signed) B -> base address L -> buffer length M+I -> modified address Modulo division returns a change from division

In our case at the beginning was: I0=8, B=8, M0=1, L0=3, then: (I0+M0-B)Modulo(L0)+B=(8+1-8)mod(3)+8=1+8=9; now I0=9 => (9+1-8)mod(3)+8=2+8=10; (10+1-8)mod(3)+8=0+8=8; (8+1-8)mod(3)+8=9; ………….. This generates following address sequence for the elements in our data buffer: (8,9,10,8,9,10,8,9,10,8…….and so on)

Final declaration of our buffer can be stated as following:

.VAR/DM/RAM/CIRC dt[3]; .GLOBAL dt;

L0=%dt; length of circular buffer is assigned to L0 register

I0=^dt; start address of buffer is loaded into I0 register M0=1; reading buffer by increment location of 1 each time

, where L0, I0, M0 are DAG index registers; L – buffer length register used to read and wraparound the buffer; I – index register indicates memory location; M – increment register. These registers are used to access buffer in code.

To make buffer possible to invoke from main.dsp program we have to add special “GLOBAL” directive below the main declaration and also define it as “EXTERNAL” in main.dsp.

Now we are able to declare our “dt” buffer as a global variable in PWM401.h file. Part of resultant listing from this file is:

Page 46: Control And Programingof Synchronous Generator

46

Fig. XI4 Fragment of the microcontroller’s

E) SPORT usage

We use SPORT serial port as our data input from external Lab View software. ADMC401 has two synchronous serial port called SPORT0 and SPORT1. We choose one of them to transfer data from the outside: SPORT1. Each SPORT has a five-pin interface:

SCLK – serial clock RFS – receive frame synchronization TFS – transmit frame synchronization DR – serial data receive DT – serial data transmit

SPORT can receive and transmit data simultaneously (DR, DT), the bits are synchronous to the

serial clock SCLK usually generated internally by processor. Frame synchronization signals RFS and TFS are used to indicate the beginning of a serial data word or stream of serial words. Additional important feature of SPORT:

support serial data word of length from 3 to 16 bits using DAG registers- SPORT can automatically receive and transmit an entire circular buffer

with rate one word per cycle, this transfer is automatic and does not need additional programming

To configure SPORT we have to set proper bits and field values in its configuration registers which are memory mapped. Following the most important control registers are distinguished:

Page 47: Control And Programingof Synchronous Generator

47

0x3FF6 – control register of multichannel mode, serial clock, frame synchronization, companding mode, serial word length

0x3FF5 –data transfer frequency determination 0x3FF4 – frame synchronization frequency of receiving 0x3FF3 – autobuffering control register

Furthermore each SPORT has receive registers RX0, RX1 and transmit registers TX0, TX1 which are not memory mapped, but are identified by assembler mnemonics.

To initialize SPORT configuration we choose direct method which simply assign immediate data to proper register. For example:

AX0=0x6B27; the contents of AX0 are written to the register of address 0x3FF2 DM(0x3FF2)=AX0 a) SPORT1 enable, Boot Wait States and Program Memory States enable To enable we set bits number 12, 4 3, 2, 1, 0 of register 0x3FFF. b) SPORT1 serial clock enable To enable internal SCLK clock signal for SPORT1 we set 14-th bit of register 0x3FF6. Frame sync signal needs to have frequency of 60 kHz. That is because changes in CHA, CHB and CHC registers are made according to PWMSYNC signal twice per PWM period with freq of 20 kHz. Hence SPORT has to read out all three data words from Lab View until PWMSYNC interrupt occur. To adjust frame sync signal freq we modify the value of RFSDIV modulus which can be calculated as:

RFSDIV=(SCLK freq/ RFS freq) – 1 Then, we have: SCLK freq=2.048 MHz, RFS freq=60 kHz=0.06 MHz => RFSDIV=34-1=33, We put value “33” in decimal into register 0x3FF4; c) Choice of serial word length for SPORT1 To set the number of bits of serial word as 10- bit we modify the value of SLEN field in 0x3FF6 control register. SERIAL WORD LENGTH=SLEN+ 1 and SLEN=9 (1001 in binary) => SWL=10 bit. SLEN value is written binary on 4 least significant bits in 0x3FF6 register. d) Enable frame synchronization for receiving mode We set 13-th bit of register 0x3FF6 to enable RFS data synchronization. e) Setting frame synchronization signal for receiving mode We set 8-th bit as 0 in register 0x3FF6 to enable IRFS - externally generated frame sync signal. Now the external data software (Lab View) controls the data transmission and reception. The SPORT1 will wait for receiving frame sync before receiving data. f) Enable the normal framing mode We set 12- bit as 0 in 0x3FF6 register to enable normal framing mode for receiving data. If frame sync signal is detected at the falling edge of SCLK clock signal, on the next falling edge of SCLK signal data is latched on and entire word is captured. After that the next detection of frame signal is made. h) Choice of frame sync signal polarity We set 6-th bit as 0 in register 0x3FF6 so that frame sync signal is active high. i) Data µ- law data companding This is the process of logarithmically encoding and decoding data to minimize the number of bits that must be sent. We set bits number 5 as 1 and bit number 4 as 0 in 0x3FF6 register.

Page 48: Control And Programingof Synchronous Generator

48

j) Multichannel mode disables 15-th bit of 0x3FF6 register as 0. k) Disable the transmit frame sync required and width by setting bits number 11, 10 as 0 in register 0x3FF6. l) Disable internal transmit frame sync by setting 7-th bit of 0x3FF6 register as 0. SPORT1 initialization code AX0=33; DM(0x3FF4)=AX0; frame sync divide modulus =33, frame sync signal frequency of 60kHz AX0=2; DM(0x3FF5)=AX0; SCLK clock frequency set as 2.048MHz AX0=0x6129; in binary notation 0110000100101001 DM(0x3FF6)=AX0; internal SCLK clock, 10 – bit of word length, frame synchronization at start of every data word, internal IRFS signal, normal framing mode, frame sync signal active high, mu – law 10-bit data compounding IFC=0x1E; clears any extraneous SPORT interrupts INCTL=0; interrupts nesting disabled AX0=0x101F; in binary notation 0001000000011111 DM(0x3FF)=AX0 SPORT1 enabled, Bwait and Pwait enabled IMASK=0x1E; SPORT1 interrupts are enabled) This SPORT1 initialization we locate in main.dsp file.

F) FINAL PROGRAM

After circular buffer declaration and SPORT initialization we are able to assign data received through SPORT to declared buffer and use it in our macro, which calculates values for PWMCHA, PWMCHB and PWMCHC registers. It can be done simply using RX0 register of SPORT1. Despite of the highest priority of IRQ2 interrupts which are used by PWSYNC_ISR routine, we are able to acquire and transfer to buffer all three data words through SPORT1 until IRQ2 interrupt occurs because of adjusted frame sync signal frequency (it was described in previous paragraph) and resultant SPORT interrupts. Startup: PWM_Init(PWMSYNC_ISR, PWMTRIP_ISR); Set_Bit_DM(MODECTRL, 6); Sets into Double Update Mode IFC = 0x80; Clears any pending IRQ2 inter. ay0 = 0x200; unmask irq2 interrupts. ar = IMASK; ar = ar or ay0; IMASK = ar; IRQ2 ints fully enabled here

Page 49: Control And Programingof Synchronous Generator

49

Main: Waits for interrupt to occur jump Main; rts; AY0=RX0; content of RX0 register is transferred to AY0 DM(I0,M0)=AY0; loads AY0 value to current location in “dt” global buffer, it is described by

current values of I0 and M0 registers rti; goes back to main program and waist for next SPORT interrupt PWM Interrupts Service Routine PWMSYNC_ISR: Test_Bit_DM(SYSSTAT, 3); if_Set_Jump(Second_Halve); PWM_update_DutyCycles(DM(I0,M0),DM(I0+1,M0),DM(I0+2,M0)); rti; Second_Halve: PWM_update_DutyCycles(DM(I0,M0),DM(I0+1,M0),DM(I0+2,M0)); rti;

G) MICROPROCESSOR’S CONFIGURATION AND TESTS

Tests went well. We were able to check program, connections, possibilities and finally send our code to microprocessor.

Fig. XI5 Microprocessor’s tests

Page 50: Control And Programingof Synchronous Generator

50

XII. TRANSDUCER To control the proper working of our machinery we need to check the output values as they

come. The best solution is to use some kind of transducer which will be take values and then send to the external device, in our case to LabVIEW via NI- USB 6008 converter. We could use a few different models of transducer, but finally we used two DEIF transducers from Danish company.

A transducer is an electronic device that converts energy from one form to another.

Used transducers:

The TAS- 331DG is a micro- controller based AC- transducer with 1 analog output for measurement of power or reactive power on an AC- network. This transducer can be delivered pre- configured to the desired measuring value and range or it can be delivered un- configured for customer configuration through the PC- interface. The PC- configuration makes free adjustment of the full input range and output range possible without any mechanical settings or adjustments inside the transducer. TAS- 331DG can be configured as a normal linear transducer or with up to three slopes giving the possibility for a higher resolution in one or two ranges of the measurement.

TAS- 311DG is a micro- controller based AC- transducer with 1 analog output for

measurement of RMS- voltages, RMS- current, phase angle or frequency on an AC- network. Because we wanted to use National Instrument device NI- USB 6008 converter we had to choose some kind of transducers which have on the output analog voltage range.

Fig. XII1 Transducers: TAS- 311DG, TAS- 331DG

Page 51: Control And Programingof Synchronous Generator

51

Connections diagrams:

Fig. XII2 Equipment in the laboratory. MIQ96 (upper) and TAS- 331DG (lower)

Fig. XII3 Connection diagram of TAS- 331DG

Page 52: Control And Programingof Synchronous Generator

52

Thanks to these two transducers we are able to measure active/reactive power from the TAS- 331DG and RMS voltage/frequency from the TAS- 311DG. Unfortunately we could not measure all these four parameters in the same time. It is a huge difficulty. Better solution will be using MTR-1:

The MTR-1 multi transducer is a microprocessor- based measuring unit providing measurement of all electrical values on a single phase or 3- phase network, showing the measurements on the built- in display and transmitting these also as the 3 analog outputs. This transducer can replace several transducers in all electrical measuring applications, and can be applied both as a normal transducer, where the analog output is connected to a local control system, and as a remote value

Fig. XII5 MTR- 1 multi- line transducer

Fig. XII4 Connections diagrams of TAS- 311DG

Page 53: Control And Programingof Synchronous Generator

53

reading unit, where all measured values are transmitted to the remote control via the serial interface (RS-232). Each of the 3 analog outputs can be programmed to represent any of the possible measurements, and the output signal can be programmed to the required scaling and type.

Efficiency is an important consideration in any transducer. Transducer efficiency is defined as

the ratio of the power output in the desired form to the total power input. Mathematically, if P represents the total power input and Q represents the power output in the desired form, then the efficiency E, as a ratio between 0 and 1, is given by:

Fig. XII6 Principle diagram of connecting MTR- 1

Fig. XII7 Connection of 2W4, 3- phase network, 4- wire unbalanced

Fig. XII8 Terminal overview

Page 54: Control And Programingof Synchronous Generator

54

E = Q/P

If E% represents the efficiency as a percentage, then:

E% = 100Q/P

No transducer is 100-percent efficient; some power is always lost in the conversion process. Usually this loss is manifested in the form of heat. Some antennas approach 100-percent efficiency.

MTR- 1 is based on a modern digital signal processing platform, where all current and voltage signals are digitally sampled and all measured values are calculated from the sampled signals. This ensured a very accurate measuring system, which also measures harmonics in voltage, current and power. MTR- 1 will measure up to 500 Hz (10th harmonic of a 50 Hz system). From 500 Hz to 2600 Hz (52nd harmonic of a 50 Hz system) MTR- 1 will measure the harmonics in the signal with slightly reduced accuracy.

The digital measuring principle will also give a faster response compare to conventional analog systems. All measuring signals will be updated for every period 20 ms@50 Hz.

All voltages and currents are calculated as true RMS values by the formula:

N

uU

N

nn

RMS

1

2

N

iI

N

nn

RMS

1

2

, where nu and ni are the sampled values and N is the number of samples during one period of the input signal

In the same way the active power P is defined as:

N

n

nn

Niu

P1

, where N is the number of samples during the latest period of the voltage input signal

Unfortunately, we could not use this kind of transducer because on the analog output we can get only values expressed in current. It could be perfect solution (MTR-1 sends even 3 analog parameters), but we would need something instead of NI USB- 6008 to convert data. NI can only read voltage on the input. We have to know that this kind of equipment is only a basic solution. Possibilities of this box are limited.

In many modern applications we get values expressed in current than in voltage. We usually can choose the range of working from 0 to 20 or from 4 to 20. The last choice is more desirable because when we have 0 on the screen we could not be sure if it means that it is measured zero or maybe there is some problem with equipment which was not connected properly.

Connections diagrams:

Another better solution could be mentioned MIQ96 and serial communication, but we were not able to use that because of the problem with cable which could not work with RS-485 protocol.

Page 55: Control And Programingof Synchronous Generator

55

DEIF’s SOFTWARE

By using DEIF’s software we were able to program analog outputs to get proper data. Output range was programmed from 0 to10V.

Fig. XII9 Software to get data from transducer

Page 56: Control And Programingof Synchronous Generator

56

XIII. LabVIEW- CONTROL APPLICATION

Like www.ni.com says: “For 20 years, engineers and scientists have been using National Instruments LabVIEW, a powerful graphical development environment, for signal acquisition, measurement analysis, and data presentation. LabVIEW also provides the flexibility of a programming language without the complexity of traditional development tools”. That is way we also decided to use this wealthy tool to get to know how in the real life that such of work with LabVIEW looks like. How exactly this tool is powerful? Trying to learn how to think in imaginatively way to present our ideas on the screen in the form of code of LabVIEW. To bring closer to subject matter which automation in industry is.

On the beginning we started to think, what the purposes are, what exactly our program should do, what we want to measure, how our front panel should looks like. But the most important thing was to start with that maybe on the beginning difficult program. We think that we managed to take steps to our preconditions.

Lab view is combination of two integrated “files”: front panel which consist of controls and indicators, which are the interactive input and output terminals of the VI, respectively. Controls are knobs, push buttons, dials, and other input mechanisms. Indicators are graphs, LEDs, and other output displays. Controls simulate instrument input mechanisms and supply data to the block diagram of the VI. Indicators simulate instrument output mechanisms and display data the block diagram acquires or generates. The second “file” is block diagram. After when we build the front panel, we add code using graphical representations of functions to control the front panel objects. The block diagram contains this graphical source code, also known as G code or block diagram code. Front panel objects appear as terminals on the block diagram.

Fig. XIII1 Front panel and block diagram

Page 57: Control And Programingof Synchronous Generator

57

FRONT PANEL

The first task was to design front panel which will be transparent and easy to work with it. We placed Vertical Toggle Switch to stop measurement in accurate moment. Below we have three meters which will be measure for us Voltage, Real power and Reactive power. We add also one gauge to check frequency. Adding Numeric Indicator we can observe exact value which have significant role in our project, because unless we obtain 50Hz, we would not work in synchronism.

Fig. XIII2 Front panel

Page 58: Control And Programingof Synchronous Generator

58

BLOCK DIAGRAM

Fig. XIII3 Block diagram

Page 59: Control And Programingof Synchronous Generator

59

To explain what the code means would not be so easy. Let is start from the block DAQ Assistant. This block represents equipment from National Instruments NI USB-6008.

This instrument provides basic data acquisition functionality for applications such as simple data logging, portable measurements, and academic lab experiments. It is affordable for student use, but powerful enough for more sophisticated measurement applications. It included ready-to-run data logger software to begin taking basic measurements, or program it using LabVIEW or C and the included NI-DAQmx Base measurement services software for a custom measurement system.

The most significant features:

12 or 14-bit input resolution, at up to 48kS/s Built- in, removable connectors for easier and more cost- effective connectivity 2 true DAC analog outputs for accurate output signals 12 digital I/O lines (TTL/LVTTL/CMOS) 32- bit event counter

We used four analog inputs from mentioned equipment (ai0, ai1, ai2, ai3). Where, in all of them we measure voltage. It could be puzzling how we could measure e.g. power in Volts. The answer is easy; our pre-equipment (transducer from Danish company- DEIF) measures values in real units and converts into Volts. The range is changed as well. Analog inputs of NI USB- 6008 have own durability (20V). We could not increase this level, because we can burn out converter. Fortunately LabVIEW has built-in transfer function, so even if we take Volts we can observe all measurement in real values and units.

Fig. XIII4 NI USB-6008

Page 60: Control And Programingof Synchronous Generator

60

Next blocks which were used after DAQ assistant blocks were Collector and Statistics. Task of Collector is to collect input signals and returns the most recent data, up to the specified maximum number of samples per channel. When we call this Express VI repeatedly and the Express VI reaches the maximum number of samples per channel, the Express VI discards the oldest data and adds the newest data to the collected samples. For example if we established to collect thousand samples in means that the next block will calculate arithmetic mean from this thousand values and give the final result. This method can protect against spikes or unstable values.

Thanks to block Write LabVIEW Measurement File Express VI we can store the data acquired from DAQ device, but this data after mathematical processing. It can help us to check how the values were changing during the measurement.

Fig. XIII5 Converting data from Volts into Watts in appropriate scale

Fig. XIII6 Collector and Statistics blocks

Fig. XIII7 Write to measurement file block

Page 61: Control And Programingof Synchronous Generator

61

When is the problem with acquiring data from DAQ device or the Vertical Toggle Switch was switched, the structure below will stop everything, protecting against having incomplete data if one or two devices do not work properly or simply if we want to interrupt our measurement.

Another structure which was used in our block diagram is compare structure. It is really helpful if we want to decide what the program should do when the measured value is higher or lower than the desirable value.

Our second idea was to use DAQ assistant which will be sending value to the analog output depending on the ending conditions. If the output voltage would be lower than 400V DAQ assistant would take value from the ground 0V output and send this value on the analog output 1, while if the value was higher, device would send 5V from the stable output to analog output 2 and additionally would send some beep noise to warn against to high value. Unfortunately this kind of solution is not right because to control machine we need smooth range from 0 to 5V, not only this to extreme values. Using NI USB- 6008 we are not able to be up to this.

Fig. XIII8 Unbundle by name, compound arithmetic- or, loop condition- stop.

Fig. XIII9 Compare structure with Case Structure. Analog solution

Fig. XIII10Linking inputs with outputs to solve the problem

Page 62: Control And Programingof Synchronous Generator

62

If we are not able to send analog values we decided to send digital values, but this time not to use NI- USB 6008 converter, because it has only 12- bits digital output.

Our new idea was to use NI- USB only to observe behavior of the machine and use microcontroller’s D/A converter to send hexadecimal values which will be changing the duty cycle in PWM signal.

We came back to our first idea with using RS-232 protocol and serial interface to exchange data between computer and microcontroller. In datasheets is written:

Solution is showed in the pictures below:

Fig. XIII11 Compare structure with Case Structure. Way to increase the duty cycle. Digital solution

Fig. XIII12 Compare structure with Case Structure. Way to decrease the duty cycle. Digital

Page 63: Control And Programingof Synchronous Generator

63

Idea is easy. We use serial port to exchange information. Depending if the value is lower or higher than 400V Case Structure will execute appropriate step:

a) VISA Configure Serial Port initializes the serial port specified by VISA resource name to the specified settings.

b) VISA Read reads the specified number of bytes from the interface specified by VISA resource name and returns the data in read buffer.

c) Hexadecimal String to Number Interprets the characters 0 through 9, A through F, and a through f in string starting at offset as a hex integer and returns it in number.

d) Depending if we increase or decrease duty cycle appropriate mathematical calculation is executed. 32 is hexadecimal value is our step, everything depends how fast we want to increase or decrease the speed of the machine to obtain synchronism.

e) U32 converts a number to a 32-bit unsigned integer in the range 0 to 232–1 f) In Range and Coerce block determines whether a 32-bit unsigned integer falls within a range

specified by the upper limit and lower limit inputs (0000, 7FFF). In every applications programmer have to predict and guarantee correctness of work.

g) Number to Hexadecimal String converts number to a string hexadecimal digits h) VISA Write writes the data from write buffer to the interface specified by VISA resource name. i) VISA Close block closes a device session specified bye VISA resource name. That block let to

use this port by the other applications when it is not used.

Now, in this way we are able to work in smooth range 0- 5V (0000 determines 0V, 7FFF determines 5V) with using digital values and microcontroller’s C/A converter.

Our idea was shown by comparing output voltage, but we can use powers or frequency as well. We have a few possibilities.

To the final block diagram (program) we can add some waveform graphs to observe relationships between values in specific situation.

Page 64: Control And Programingof Synchronous Generator

64

XIV. SUMMARY

First of all we want to thank all professors for enable for us to use all laboratories’ tools, devices, kits, integrated circuits and components.

Our final report of the project contains in majority practical solution of commissioned task. Unfortunately, when we solved all particular parts of the integrity, we could not test the system entirely. Although we suppose that everything should work properly, because each block was tested in detail.

In our opinion we used all available stuff exhaustively.

We learned a lot during this semester and especially during the project course. It improved our practical skills. We must admit that it was the first time that we could to set ourselves against the problem, which is used in real life. It helped for us to be more creative to be the real engineers.

Page 65: Control And Programingof Synchronous Generator

65

XV. BIBLIOGRAPHY

Principles of electric Machines and Power Electronics, 2nd ed., John Wiley & Sons, 1997 Electronics Control of DC motors and AC motors, T. Wildi DC- DC Switch mode converters, Mohan, Undeland, Robbins http://homepages.which.net http://en.wikipedia.org http://www.windpower.org/en/tour/wtrb/syncgen Datasheets of integrated circuits, servomotor, transducers


Recommended