Ward-Leonard variable speed drive

Reinhard Gahleitner, Werner Haas

Example: Ward-Leonard drive

System Configuration

[Maple OLE 2.0 Object]

System Parameters

Electrical subsystem:

Mechanical subsystem:

Coupling coefficients:

Modelling Assumptions

Solution: Symbolic Derivation of the Equations

Initialization

> restart:

loading of the functions of the package "ModSim"

change the path if necessary

> read "d:/JKULinz/MaplePackage/EnMo.mpl":

activation of the package "EnMo"

> with(EnMo);

[Model]

path of the working directory

> path := "d:/JKULinz/Examples/WardLeonard";

path :=

Defining the model

> wl:=Model("WardLeonard"):

systemparameters

> parms:=wl:-setParameters([omega[1],L[A],R[A],R[E],L[E],c[1],c[m],J[m],J[l],B[m],n]);

parms := _rtable[36334540]

inputvector to the system

> uu:=wl:-setInputs([u[S],T[l]]);

uu := _rtable[36848528]

Defining the mechanical part

generalized coordinates of the mechanical part (1 degree of freedom)

> q:=wl:-setCoordinates([phi[2]]);

q := _rtable[36206608]

derivatives of the generalized coordinates (speeds)

> dq:=wl:-setSpeeds([omega[2]]);

dq := _rtable[36206768]

no movement of the mass (only rotation)

> r[1]:=Vector([0]);

r[1] := _rtable[36639740]

vector for rotation

> tau[1]:=Vector([q[1]](t));

tau[1] := _rtable[36639820]

reduced moment of inertia

> J[red]:=J[m]+n^2*J[l];

J[red] := J[m]+n^2*J[l]

initialize the object for the rotating mass

> m1:=wl:-newMass("RotMass",m[1],r[1],J[red],q[1](t)):

initialize the object for the damping

> t1:=wl:-newFriction("Friction",q[1](t),B[m]):

set the external forces of the system (forces with no potential function)

> P[1]:=n*T[l](t):
Q:=wl:-setExternalForces([P[1]]);

Q := _rtable[861908]

Defining the electrical part

initialize the object for LA

> LA := wl:-newInductor("LA",L[A],u[L,A],i[A]):

initialize the object for RA

> RA := wl:-newResistor("RA",R[A],u[R,A],i[R,A]):

initialize the object for LE

> LE := wl:-newInductor("LE",L[E],u[L,E],i[S]):

initialize the object for RE

> RE := wl:-newResistor("RE",R[E],u[R,E],i[R,E]):

initialize the object for US

> US := wl:-newVoltageSource("US",u[S],u[U,E],i[U,E]):

voltage and current laws

> wl:-setKirchhoffEquations({
-c[1]*omega[1]*i[S]+u[L,A]+u[R,A]+c[m]*omega[2]=0,
i[R,A]=i[A],
i[U,E]=i[S],
i[R,E]=i[S],
u[U,E]=u[L,E]+u[R,E]});

{i[R,E] = i[S], -c[1]*omega[1]*i[S]+u[L,A]+u[R,A]+c...

Defining the electromechanical coupling

> DC1 := wl:-newDCMotor("DCMotor",c[m],phi[2],i[A]):

> DC2 := wl:-newDCGenerator("DCGenerator",c[1],phi[1],i[A],i[S]):

print an overviev of the model

the parameter defines the level of detail

> wl:-printModel(1);

Overview over the Model WardLeonard

--------------------------------------------------

Masses in the Model:

--------------------------------------------------

Mass: RotMass

--------------------------------------------------

Frictions in the Model (Q=d*v^rho):

--------------------------------------------------

Friction: Friction

--------------------------------------------------

Inductors in the Model:

--------------------------------------------------

Inductor: LA

Inductor: LE

--------------------------------------------------

Resistors in the Model:

--------------------------------------------------

Resistor: RA

Resistor: RE

--------------------------------------------------

Voltage sources in the Model:

--------------------------------------------------

Voltage source: US

--------------------------------------------------

DC motors in the Model:

--------------------------------------------------

DCMotor: DCMotor

--------------------------------------------------

DC generators in the Model:

--------------------------------------------------

DCGenerator: DCGenerator

Energy, Potential and Force

Calculation of the energy and power quantities of the system

the parameter defines the level of detail for the user information

> wl:-calcPowerEnergy(2);

Mechanical Power and Energy Quantities: WardLeonard

Kinetic Energy: WardLeonard

1/2*diff(phi[2](t),t)^2*(J[m]+n^2*J[l])

Potential Energy: WardLeonard

0

Rayleigh-potential: WardLeonard

1/2*B[m]*diff(phi[2](t),t)^2

Electrical Power and Energy Quantities: WardLeonard

Electrical Power: p[L]

sum(u*i,L) = (c[1]*omega[1]*i[S](t)-R[A]*i[A](t)-c[...

Electrical Power: p[C]

sum(u*i,C) = 0

Electrical Power: p[u]

sum(p[u](u),S) = 1/2*R[A]*i[A](t)^2+1/2*R[E]*i[S](t...

Electrical Power: p[i]

sum(p[i](i),S) = 1/2*R[A]*i[A](t)^2+1/2*R[E]*i[S](t...

Electrical Coenergy: w[el]

sum(w[el],L)+sum(w[el],C) = 1/2*L[A]*i[A](t)^2+1/2*...

Extended Lagrangian Function: WardLeonard

1/2*diff(phi[2](t),t)^2*(J[m]+n^2*J[l])+1/2*L[A]*i[...

Extended Lagrangian - Formalism

> LL:=wl:-extendedLagrange(2):

Equations of Motion for Mechanical Part:

Second Order Differential Equation 1

diff(phi[2](t),`$`(t,2))*(J[m]+n^2*J[l])-c[m]*i[A](...

Equations of Motion for Electrical Part:

Differential Equation 1

L[A]*diff(i[A](t),t)+c[m]*diff(phi[2](t),t)-c[1]*i[...

Differential Equation 2

L[E]*diff(i[S](t),t)+R[E]*i[S](t)-u[S](t) = 0

First order differential equations

convert the second order differential equations to a system of first order differential equations diff(x,t) = f(x,u)

the parameter defines the level of detail for the user information

> f:=wl:-firstorderDEQ(2):

First Order Equations: x' = f(x,u)

_rtable[35868768]

substitute constant input velocity of the generator

> ff:=subs(diff(phi[1](t),t)=omega[1],f);

ff := _rtable[35868848]

Output functions

statevector of the system

> x:=wl:-getState();

x := _rtable[35868928]

output function: angular velocity of load

> h:=Vector([n*dq[1](t)]);

h := _rtable[35868968]

Calculate Transfer Function G[Ward](s) :

Calculate Matrices

> Award:=wl:-vectorDiff(ff,map(i->i(t),x));

Award := _rtable[36339644]

> Bward:=wl:-vectorDiff(ff,map(i->i(t),uu));

Bward := _rtable[36330240]

> Cward:=wl:-vectorDiff(h,map(i->i(t),x));

Cward := _rtable[36548000]

Transfer Function

> Gward:=Cward.(-LinearAlgebra:-CharacteristicMatrix(Award,s))^(-1).Bward;

Gward := _rtable[35834264]

Simulation: Generation of Simulation-Code from the Equations

Numeric Values

numeric parameters for simulation

> parms_num :=
Tl=25.4/1000*9.81*0.4536*(-1500),
T0=25.4/1000*9.81*0.4536*(-10)/3,
omega[1]=190,
L[A]=0.2,
R[A]=1,
R[E]=10,
L[E]=60,
c[1]=0.78,
c[m]=16.95,
J[m]=25.4/1000*9.81*0.4536*30,
J[l]=25.4/1000*9.81*0.4536*6,
B[m]=25.4/1000*9.81*0.4536*0.4,
n=3;

parms_num := Tl = -169.5379896, T0 = -.3767510880, ...
parms_num := Tl = -169.5379896, T0 = -.3767510880, ...

initial conditions for the state

> ic := Vector([0,0,0,0]);

ic := _rtable[35828032]

Generate Simulink S-function

loading of the functions of the package "SimCo"

change the path if necessary

> read "d:/JKULinz/MaplePackage/SimCo.mpl":

> with(SimCo);

[SimulationModel]

> sm:=SimulationModel("WardLeonard"):

set the path for the Matlab working directory

> sm:-setPath(path,"Matlab");
sm:-getPath();

set code generation options for Matlab

> sm:-setOptions({IC,STATE,DLL});
sm:-getOptions();

{DLL, STATE, IC}

> sm:-setDynamics(ff);
sm:-setState(x);
sm:-setOutputs(h);
sm:-setInputs(uu);
sm:-setParameters(parms);
sm:-setParameterValues(subs({parms_num},parms));
sm:-setInitial(ic);

> #sm:-printModel();

generate C-code for simulation

This code can be compiled and used for simulation with simulink

the parameter defines the level of detail for the user information

> sm:-makeSFunction(1);

Transfer Variables to Matlab Workspace

set initial values and parameter for simulation

> sm:-initSimulation(2);
Matlab[setvar]("T0",subs(parms_num,T0));
Matlab[setvar]("Tl",subs(parms_num,Tl));

Generate Dynast code

set the path for the Dynast working directory

> sm:-setDynastPath(path,"Dynast");
sm:-getDynastPath();

set code generation options for Dynast

> sm:-setDynastOptions({FILE});

set the time how long to simulate

> sm:-setSimulationTime(80);

set the dynamics

> fimp:=subs({diff(phi[1](t),t)=omega[1]},wl:-firstorderDEQ(1,false)):
sm:-setImplicitDynamics(fimp);

generate dynast-code for simulation

This code can be used for simulation with dynast

> sm:-makeDynast(1);

>