You are on page 1of 6

Testing Software Through Real-Time Model Of The Plant

An Experimental Example
M. Matuonto*, A. Monti**, G. Toni*
-
*Ansaldo Industria, Viale Sarca, 336 20126 Milano, Italy
phone: +39-2-6445-4590 ; fax: 39-2-64454500 ;e-mail : root@quadraltetec.polimi.it
**Dipartimento di Elettrotecnica,Politecnico di Milano, P.za Leonard0 da Vinci, 32 -
20133 Milano, Italy
phone: +39-2-2399-3753 ; fax: 39-2-2363561 ;e-mail :Anto@quadralt.etec.polimi.it

Abstract - The paper deals with a study and a laboratory APPLICATIONFEATURES


experiment conducted for testing a newly developed full digital
field oriented control for a salient-pole synchronous motor with The testing procedure developed has been performed in order to
independent field excitation. verify a Field Oriented Control (FOC) software for a synchronous
A dynamic model of the system to be controlled has been studied machine fed by a twelve pulse nocirculating current cycloconverter.
and implemented in a real time environment in order to reliably As the program was represented by newly designed algorithms it was
debug and test the control algorithms realised, by simulating the necessary to verify the correct operation in realising those parts which
same working conditions and the realistic time constraints. present analytical difficulties and operational criticality due to the
The final result was an easily configurable multiprocessor system strong dependency on the motor parameters. Moreover in the case of
architecture working on VME-bus, in which one CPU runs the FOC applications a full verification of the control algorithms used is
software to be tested and another one acts as the dynamic model extremely important because the control program has to calculate and
of the system. reconstruct not measurable variables which are difficult to monitor
during the normal drive operation.
INTRODUCXON Two were the main problems to solve:
- the FOC control for the synchronous motor represented a new
One of the hardest problems which can be found while developing a application for the authors which based the algorithms realisation
complex digital control, is represented by the difficulty of gradually over the theoretical analysis and over a previously realised off-line
applying and verieing the software program on the real plant simulationfor the asynchronous motor [3]
environment without previous exhaustive verifications. - the real-time implementation of the software contains aspects, very
If none intermediate step is provided, faults and bad operations may different from an off-line simulation and presents problems hardly
arise mainly from two causes: bugs in the software and physical determinablein an off-line execution.
behaviours not foreseen during the theoretical analysis of the system; In this specifk case a first PC simulation in C language had been
moreover time constraints represent a further aspect which strongly realised for a cycloconverter-asynchronousmotor system, simulating
affects control routines real-time implementationphase. the whole drive in a non real-time environment, dealing with
For these reasons the steps which, starting fiom the computer continuos signals, accessing directly to all system variables, not
simulation phase (if any has been performed), allow to obtain the final respecting real-time constraints; it allowed to preliminary study a
program running on the control rack of the drive prototype, may give consistent number of dynamic conditions for the drive, useful to
rise to problems which can be hardly managed and controlled while determine its feasibility.
the plant is working. Then, in order to simulate a more realistic system, a step over was
Af m step in the adaptation to the final plant requirements consists made by reducing the control routines sampling ffequency (till I
in the gradual reduction of simplifications and conditions typical of W),so creating a system with the motor and the converter
off-line simulation programs. simulated in the continuos domain and the control in the real discrete
Therefore a real useful and significant verification can be done only domain.

K;;yf
by providing a further simulation step realised directly on the CPU The new step which had to be developed was the testing of the
which represents the plant regulation unit: in this way it is possible to
gradually debug both the algorithms logic and the code operation.
This study can be realised by using a mathematical model of the
controlled plant in order to simulate the real drive dynamic operation
and to allow the possibility of easily testing every new plant
configuration during its sizing and installing phase.
7 control
system
VI \1
STY
-\is

field converter
I

I .
The aim of this work is to show how the development, verification
and use of a plant dynamic model has been conducted through a new
software-based equipment in order to debug and test a real-time
M
1 ' /I
' I

digital control system. The main features of the simulation


environment will be underlined. Fig. 1: Schematic representation of the inputloutput relations

0-7803-1328-3/94$03.0001994 IEEE
1807
software in a real plant control rack. time in order to allow real time operations of the whole system (the
Without specifying the control structure (not object of the present control routines time cycle is 1 ms), allowing the analog monitoring
paper) it is worthwhile briefly underlining the main critical points section and the communicationprotocol between the two CPUs.
which the authors desired to investigate: As a final result the tool used allowed also to simplify the successive
- verifying the good operations of the mathematical model used for changes introduced and brought to the development of a standard
reconstructing the magnetising flux phasor (realised in the z discrete library of the motor mathematical models realised.
domain) starting from motor currents and rotor position (in the The real-time simulation of the whole system (running on two CPU
control structure the flux modulus allows to determine the boards interfaced on VME BUS) had allowed to monitor the control
quadrature current reference, starting from the torque reference software behaviour during steady state and transient operations
value); consequent to some solicitations (speed and torque reference steps,
- studying the correct load angle determination which is necessary for load variations, faults, etc.).
realising the co-ordinate transformation from the reference fnune
fixed with the flux to the one fixed with the polar axis; MOTOR
MODELDEScrur*nON
- verifying the de-coupling operations between id and iq effects in the
current regulator; it represents a hdamental function whose correct The hdamental features of the motor dynamic model used will be
operation can be hlly debugged only with a simulation facility. briefly shown.
For these reason the authors adopted the solution of running the Firstly a basic introduction on the specific synchronous motor
control s o h a r e previously debugged and time optimised on the structure analysed will be made because it a€fects the control
definitive target HW (a Motorola 680x0 based CPU board), testing its philosophy and the mathematical modelling; by taking in account the
operation by realising a parallel running mathematical dynamic model typical cycloconverter drives application fields (high power and low
of motor and static field exciting converter on a second CPU. speed operation, such as rolling mills, elevators and ship propulsion) a
In the simulating environment development a relevant aid has been salient pole synchronous motor with independent excitation and
given by the use of the Ansaldo graphic designer (ISOGRAPH-GL @ damper windings has been considered.
[6]) which allows to realise control application programs by easily The asymmetrical structure of this motor suggests, for the machine
connecting already realised functional blocks with standard logic and modelling purposes, that d-q reference frame is fured with the polar
intemal and extemal signals. This tool allows to directly apply the axis in order to deal with time-independent parameters. The motor
obtained model in some different plant simulation programs thanks to equivalent windings in the Park reference frame are displaced as
the possibility of creating code structures (called Building Blocks)
separately built and compiled, which, once realised and debugged,
may be easily used in any application. where.:
d direct stator w
i di g
This feature allowed to develop the motor model code and to deal it f field w
i di g
as an "object": in fact it constitutes a general dynamic model which D direct rotor wi di g (damper w
i di g)
gets a three-phase voltage system (of whatever waveform), the field q quadrature stator wi di g
current reference value and the load torque as inputs and returns stator Q quadrature rotor wi di g (damper wi di g)
and field currents and rotor position as outputs (further variables may
be also monitored if necessary). A schematic view of the input/output
relations is shown in Fig. 1.
ISOGWH-GL @ is based on a scheduling operating system which
'7
manages the execution of the different tasks composing the whole
control program; moreover it provides an interfacing environment
which allows to graphically design the final program structure. It
allows also to easily manage the I/O interfaces and prevents the user Fig. 2: Motor windings distribution over the d-q frame
by designing specific drivers and interrupt handlers.
One of the fundamental features of the chosen method derives from represented in fig. 2.
the fact that the Building Blocks are written in the standard ANSI "C" The determination of the differential equations set which defines the
language. model, starts from the motor equations in the Park domain (VI).
In this way it has been possible to preliminary study the behaviour of Parameters definitions are the following (see Fig. 3):
the mathematical model by implementing it through the C interface of XL W a g e stator reactance
standard tools such as MATLABlSIMULINK(The Mathworks 8). d, q axis magnetising reactances
xAd. X A Q
This skill has been useh1 for testing the mathematical model
implementation by debugging the motor significant variable XI,X
, , XKr! Leakage rotor react. (field & damper wind.)
waveforms; as a verification of the correct system operation some RS Stator resistance
typical tests (such as steady state analysis, short circuit, load transient
and so on) have been carried on using the SIMULINK environment Rr , RKD, RKQ Rotor (field and damper wind.) resistances
facilities and resources.
The porting phase of the C code on the final target has been quite The dynamic motor model is represented by this set of equations:
easy from the syntactical point of view, while the most hard and
necessary part of the work was dedicated to optimise code execution

1808
with respect to time) without requiring approximations about the
motor saturation state.
(1) Therefore, in this case the inductance matrix must be inverted in
order to obtain the relation between currents and fluxes: thanks to the
de-coupling function between the variables on d and q axes the
inversion can be done by separately dealing two sub matrices:

where:
vd vq vD Stator and rotor voltages
Id I ID IQ Stator and rotor currents
vd vq Y vD YQ Stator and rotor fluxes

0 Pulsation at base frequency


where:
9 Rotor position Dd = L,j. L .LD - M 2 ' ( 4+ L + LD)+2M3
P Time derivative operator D~= L ~ . - M~~

yd Ld M M 0 0 Id obtain:
y M L M O O I
v D = M M LD 0 0 .Io p y , = v,
Dd
.L/- M2)-v, + M ( M -L,,). v/ + M(A4-L.~).
v,,]+ s-v,
Yq 0 0 0 Lq MQ Iq
q - MQ.vu]- 8. v,
PV, = vy -A.[%.
vc,, 0 0 0 MQ Lo IQ
v
Dr

To complete the differential equation system two firther equations


At this point in order to determine the differential equations that must be considered, by introducing the rotor speed and the load angle
have to be integrated at each simulation step, a set of state variables as state variables:
must be chosen; two are the analysed possibilities:
- a set of stator and rotor currents . (c-c)
-'oP Mechanical equation
- a set of stator and rotor fluxes J
The first solution presents the advantage of dealing with more simple ps=$- Load angle dynamic expression
equations, avoiding the inductance matrix inversion; on the contrary it
presents a further complexity due to the dependency on the motor ,+,here:
saturation level and the test realised in the specific case demonstrated
that the execution time reduction is not so consistent.
So &er a comparative analysis of both the solutions the second one
has been preferred for it allows to obtain a good flexibility dealing
also with non linear models (inductances varying with a whatever law
','= .'{[2- f+i.f.,-M'
4 I. V ~M.(M-I,,).
I& wf -
M.(M-f,f)
Dd
'k%
I MO
--'(Vd'Vq
4

Total moment of inertia reported at motor shaft


G Load torque

4:!tKD4:T$ XKD

Fig. 3: Motor equivalent circuits on d and q axes


As two were the aims of the simulation tests:
- verifying the correctness of the motor parameters values. by
comparing typical determination tests waveforms of the real and
simulated machine;
- testing the real-time control routines directly on the target system;
the Building Block realised by using the above described model had
to fit both the different operating conditions.

1809
In the first situation care must be held in the initial conditions operations are schematicallyrepresented in fig. 4;
determination because no feedback is present so start conditions must
coincide with the steady state of the system at constant base speed;for
- the real-time simulation is perform& it allows to realise meaningful
this reason the state variables at the start must be evaluated by realistic tests in order to verify the satisfaction of the effective time
imposing, in the differential equations, that theirs derivatives are zero constraints and to evaluate the dynamic performances of the motor
with the motor speed set at the synchronism value and no load. in different conditions;
These conditions have been imposed (P.u. values): - the simulation environment differs from the effective plant control
v, = 0 vq = 1 w= 1 4, = I,,,
hardware only by the presence of one more CPU where the motor
(the mechanical and load angle equations loose significance) in order model runs; this feature allows, after an exhaustive test campaign, to
to determine the initial flux values (note that the conditions on voltage obtain a completely reliable error-free program, running on the
phasor components assure that in the no-load operations the flux effective platform, ready to be used in the plant control;
phasor is directed on the polar axis). - every CPU manages an analog I/O board in order to visualise on a
In the second situation the initial conditions are set by imposing that scope the interesting variables allowing to analyse the waveforms of
all the state variables are null at the simulation starting because the whatever motor and control variable. This skill represents an
motor is at stand-still and the control is designed to automatically important debugging facility in that it allows to study every variable
realise the flux transitory of the machine before imposing voltage operation during dynamic and steady state conditions.
reference values over the motor terminals. This condition is realised
by dealing only with the field and D damper windings differential SIMULATION FEATURES
equations, by imposing that the stator currents and fluxes are null; by
integratingthis reduced set of equations and calculating the respective Without describing all the simulation program details it is
currents value, it is possible to simulate the flux transitory until the worthwhile underlining some choices aimed to better simulate the real
nominal value. plant conditions and to reduce the execution time in order to reach the
real-time operation.
HARDWARE DESCRIPTION These conditions have been imposed:
- the Runge-Kutta four order integration method has been used with 1
The standard hardware platform used, based on a VME Bus system, ms time cycle (quicker methods as Eulero or third order Runge-
allowed to reach a high level of portability and flexibility by using Kutta, have been abandoned as they diverged);
standard YO (digital and analog) and memory boards. - the rotor position is returned in a digital word format (behveen 0
The final configuration used presents two CPUs (based on Motorola and 65535: 16 bit resolution) in order to simulate the same
68020 with FPU) which allow to separately download and monitor operation of the resolver to digital converter used; with this format it
(by using two personal computers as developing tools) respectively is possible to quantify how much the reduction of the ratio between
the motor model and the control program. In this way the two tasks resolver and motor pole numbers may affect the control operation
can run in parallel, so obtaining interesting results: precision;
- the master CPU realises the FOC algorithms (start/stop and enabling - a 600 Hz sinusoidal noise (due to the twelve pulse converter
logic, current, flux and speed regulation loops, flux reconstruction reaction) has been superimposed on the motor input voltages in
etc.) while the slave processor realises the simulation of the order to partially take in account the cycloconverter operation and
controlled plant. The whole hardware configuration and timing testing the control capability in dealing with deformed current

MASTER CPU
/-- --. SLAVE CPU
\
-
TASK 2 5 ms TASK 1 -1 ms TASK 1 -1 UIS Load
Field current Current regulation Motor simualtion Porwe
Enables, Star-Stop
Protection logic Determination and determination of
sending of Voltage motor currents &
Operator Interface position
Flux and speed

*,
regulation Write prot. Read prot.

I Write prot.
Flux reconstr.
Flux and speed
\I/ I

/H I 1
reference setting fTASK2-2ms

rewnstruct. Analog I/O manag.

Fig. 4: Real-time simulating system configuration:functional operations and tasks timing

1810
signals. Simulating the current ripple allowed in fact to make a first - RED a process is working on the mail box
analysis on the need of inserting a filtering function on the control - GREEN the mail-box is free
inputs, studying the effective response determined by the real motor - LOCK the writing CPU is not ready to give the first value
parameters; Only the CPU acting as the writer is able to change the semaphore
- only two motor currents are retumed by the motor Building Block, state from the LOCK condition. The deadlock is avoided thanks to a
while the third is reconstructed by the control algorithm (as it is in control on the WAIT cycle with respect to the GREEN state of the
the real plant application); semaphore: exception conditions are detected and transmitted by the
By applying some code optimisation (as the use of pre tabulated state change of a binary flag.
trigonometric hnctions for the Park transformation) it has been In fig. 5 the Petri net realised for studying and designing the
possible to reduce the simulated motor execution time till 800 ps. communication logic is represented.

Communication protocol PRAC~CAL


RESULTS

The requirement of finding a reliable communication between the The described simulating environment allowed to fully verify the
two CPUs has been solved by realising a suited protocol which control algorithms operation and the software routines by running the
represents a very flexible and portable interfacing system. model of the same system used in the laboratory prototype (an 80 kW
It is able to transmit a certain set of data of any type (double, integer, motor with digital six-pulse static field exciting converter). This study
short or char) previously loaded in a continuos memory area, to a represented in fact a valid step between the developing and the testing
shared memory area (which may be disposable on one of the CPU phases and allowed to reduce various causes of errors.
boards or on an extra memory board) and vice versa. It was in fact possible to realise tests of the whole virtual system,
The first requirement to be satisfied is that the communication of having as output the real wave form of every interesting variables
control and motor variables has to lowly affect the whole (motor voltages and currents, torque performance, speed step response
multiprocessor system operation; for this reason it was worthwhile and so on) obtained thanks to a configurable analog output structure.
realising a consumer-producer structure, avoiding to introduce heavy The validity of the work realised has been confirmed by the high
controls on the writing and reading cycles alternating logic. simplicity in modifying the various operation conditions and in
In fact it is not important if any sets of data may be sometimes lost, determining and analysing some intermediate testing procedures
in order to simulate the real system operation where the plant must get which could be applied to the physical prototype in order to gradually
on working even ifsome data refreshes are lost, test all the parts composing the control system.
The only guaranteed condition is that the data read at every cycle Among the various tests, a precise evaluation and optimisation of the
must belong to the same operation instant. real execution time, thanks to the possibility of analysing the signal
The data coherency is assured by a SW semaphore which prevents a acquisition times, CPU elaborating times and interfaces (i.e. digital
read cycle from being done during a write operation and vice versa. and analog U 0 and diagnostic) managing times has been carried on.
This semaphore can be set in one of three possible states: Moreover an accurate study, development and test of start-stop,
enabling and protections logic have been realised, verifying all the
logic operations under different possible conditions.
A very interesting feature is then represented by the tests of dynamic
performances of the whole system, which allowed to define and
modify constant parameters (like regulators ones) or whole control
0 modules (as the structure of a particular loop) in order to reach the
Not abil optimal solution, with the advantage of working in absolute security; a
set of tests allowed to determine the correct value for the regulators
parameters and the correct operations of the flux reconstructor block.
Moreover it revealed to be an useful tool to study also the regulator
performances and allowed to determine some bad operations related to
oscillations of the PI current regulators, making possible to study and
test a better optimised current regulator.
Another facility is represented by the possibility of foreseeing and
test the adequacy of the sequence of steps to apply when realising the
installation of a plant in order to formalise the definitive procedure.
This is a feature useful not only during the test of a new control
software, but also for every new plant installation.
Because the simulating studies revealed to be very useful in the
control software testing phase, the authors developed also a Building
Block simulating a three-phase asynchronous motor, useful for the test
of other Ansaldo drives.
Finally it is worthwhile saying that in parallel with these further
Fig. 5 : Petri net describing the communication protocol logic studies the control algorithms have been fully applied on the real
prototype drive and exhaustive tests have been carried on in order to

1811
vcriry all the drivc dynamic pcrformanccs. 'fhc control algorithms
application to the real plant revealed pcrformanccs and opcrations REFERENCES
vcry close to the test pcrformcd during the simulation phase.
[I] Manigmso R., Supcrti Furga G., "Elemertli di dinamica delle
FUTURETRENDS mucchine elettriche". Dipartimento di Elcttrotccnica.
Politccnicodi Milano
The authors are on the way to study and dcvelop the possibility of
exploiting the plant model and the communication protocol realiscd, [2] Que-Do V., Barry A. 0. "A real time model of the synchronous
in order to develop an on-line adaptive control and a parameters machine based on digital signal processors", IEEE Transactions
identification procedure, in which the instantaneous responses of the on applied superconductivity,vol. 3, march 1993
real system are compared with the mathematically determined ones.
The only requirement from the hardware point of view is to use th'e [3] Chiesa E., Monti A., Matuonto M. "Computer simulation of a
second CPU also during the normal operation of the plant in order to cycloconverter drive and development of a full digital Field
perform an on-line state observer function. Oriented Control", presented at EPE Conference, Brighton UK,
At present a successfd study is being conducted for dealing the 1993
dynamic motor model equations in the discrete domain of the z-
transform in order to reduce the execution time. The results have been [4] Vas, P., 1990, "Vector control of AC machines", Oxford
good in the constant speed tests and by now some tests are being University Press, New York, US
conducted also in d>namicconditions, with the FOC control structure.
The major difficulties are related to the dependency of the equations [5] Cadzow J.A., Martens H.R., "Discrete-time and computer
parameters on h e rotor speed, but it has been possible to reach time control systems",Prentice-Hall Inc., New Jersey, US
cycles minor than 500 ps, by tabulating the parameters with respect to
a certain number of discretised possible speed values. [6] Matuonto M.? Mazzocut E., Monti A., "Graphic soffWare
As a further working trend some studies are being held in order to designers: a quick way to develop and standardise electrical
realise a Building Block simulating the double star synchronous motor drives digirai conrrd", presented at SPEEDAM Conference,
operation for testing the extension of the FOC control algorithm. Taormina Italy. 1994

Fig. 6: Speed transient during a system response to a speed reference step (simulated motor controlled by the real-time Field Oriented program)

I I I I II I\ . i
i
i
I

#
Fig. 7: Current \vnvefomi during ii thrcc-phasc short circuit transient (simulated motor fed by a three-phax sinusoidal voltage system with
constant csciting voltage rcgulation)

1812

You might also like