Modelica.Electrical.Machines.SpacePhasors.Blocks

Blocks for space phasor transformation

Information


This package contains space phasor transformation blocks for use in controllers:

Space phasors are defined as vectors of length = 2, the first element representing the real part and the second element representing the imaginary part of the space phasor.

Extends from Modelica.Icons.Package (Icon for standard packages).

Package Content

NameDescription
Modelica.Electrical.Machines.SpacePhasors.Blocks.ToSpacePhasor ToSpacePhasor Conversion: three phase -> space phasor
Modelica.Electrical.Machines.SpacePhasors.Blocks.FromSpacePhasor FromSpacePhasor Conversion: space phasor -> three phase
Modelica.Electrical.Machines.SpacePhasors.Blocks.Rotator Rotator Rotates space phasor
Modelica.Electrical.Machines.SpacePhasors.Blocks.ToPolar ToPolar Converts a space phasor to polar coordinates
Modelica.Electrical.Machines.SpacePhasors.Blocks.FromPolar FromPolar Converts a space phasor from polar coordinates


Modelica.Electrical.Machines.SpacePhasors.Blocks.ToSpacePhasor Modelica.Electrical.Machines.SpacePhasors.Blocks.ToSpacePhasor

Conversion: three phase -> space phasor

Modelica.Electrical.Machines.SpacePhasors.Blocks.ToSpacePhasor

Information


Transformation of threephase values (voltages or currents) to space phasor and zero sequence value.

Extends from Modelica.Blocks.Interfaces.MIMO (Multiple Input Multiple Output continuous control block).

Parameters

TypeNameDefaultDescription
IntegerninmNumber of inputs
Integernout2Number of outputs

Connectors

TypeNameDescription
input RealInputu[nin]Connector of Real input signals
output RealOutputy[nout]Connector of Real output signals
output RealOutputzero 

Modelica definition

block ToSpacePhasor "Conversion: three phase -> space phasor"
  extends Modelica.Blocks.Interfaces.MIMO(final nin=m, final nout=2);
  constant Integer m=3 "Number of phases";
  constant Real pi=Modelica.Constants.pi;
protected 
  parameter Real TransformationMatrix[ 2, m]=2/m*
    {{cos(+(k - 1)/m*2*pi) for k in 1:m}, {+sin(+(k - 1)/m*2*pi) for k in 1:m}};
  parameter Real InverseTransformation[m, 2]=
    {{cos(-(k - 1)/m*2*pi), -sin(-(k - 1)/m*2*pi)} for k in 1:m};
public 
  Modelica.Blocks.Interfaces.RealOutput zero;

equation 
  m*zero = sum(u);
  y = TransformationMatrix *u;
//u = fill(zero,m) + InverseTransformation*y;
end ToSpacePhasor;

Modelica.Electrical.Machines.SpacePhasors.Blocks.FromSpacePhasor Modelica.Electrical.Machines.SpacePhasors.Blocks.FromSpacePhasor

Conversion: space phasor -> three phase

Modelica.Electrical.Machines.SpacePhasors.Blocks.FromSpacePhasor

Information


Transformation of space phasor and zero sequence value to threephase values (voltages or currents).

Extends from Modelica.Blocks.Interfaces.MIMO (Multiple Input Multiple Output continuous control block).

Parameters

TypeNameDefaultDescription
Integernin2Number of inputs
IntegernoutmNumber of outputs

Connectors

TypeNameDescription
input RealInputu[nin]Connector of Real input signals
output RealOutputy[nout]Connector of Real output signals
input RealInputzero 

Modelica definition

block FromSpacePhasor "Conversion: space phasor -> three phase"
  extends Modelica.Blocks.Interfaces.MIMO(final nin=2, final nout=m);
  constant Integer m=3 "Number of phases";
  constant Real pi=Modelica.Constants.pi;
protected 
  parameter Real TransformationMatrix[ 2, m]=2/m*
    {{cos(+(k - 1)/m*2*pi) for k in 1:m}, {+sin(+(k - 1)/m*2*pi) for k in 1:m}};
  parameter Real InverseTransformation[m, 2]=
    {{cos(-(k - 1)/m*2*pi), -sin(-(k - 1)/m*2*pi)} for k in 1:m};
public 
  Modelica.Blocks.Interfaces.RealInput zero;
equation 
  y = fill(zero,m) + InverseTransformation*u;
//m*zero = sum(y);
//u = TransformationMatrix *y;
end FromSpacePhasor;

Modelica.Electrical.Machines.SpacePhasors.Blocks.Rotator Modelica.Electrical.Machines.SpacePhasors.Blocks.Rotator

Rotates space phasor

Modelica.Electrical.Machines.SpacePhasors.Blocks.Rotator

Information


Rotates a space phasor (voltage or current) by the angle provided by the input signal "angle" from one coordinate system into another.

Extends from Modelica.Blocks.Interfaces.MIMOs (Multiple Input Multiple Output continuous control block with same number of inputs and outputs).

Parameters

TypeNameDefaultDescription
Integern2Number of inputs (= number of outputs)

Connectors

TypeNameDescription
input RealInputu[n]Connector of Real input signals
output RealOutputy[n]Connector of Real output signals
input RealInputangle 

Modelica definition

block Rotator "Rotates space phasor"
  extends Modelica.Blocks.Interfaces.MIMOs(final n=2);
protected 
  Real RotationMatrix[2,2] = {{+cos(-angle),-sin(-angle)},{+sin(-angle),+cos(-angle)}};
//Real InverseRotator[2,2] = {{+cos(+angle),-sin(+angle)},{+sin(+angle),+cos(+angle)}};
public 
  Modelica.Blocks.Interfaces.RealInput angle;
equation 
  y = RotationMatrix*u;
//u = InverseRotator*y;
end Rotator;

Modelica.Electrical.Machines.SpacePhasors.Blocks.ToPolar Modelica.Electrical.Machines.SpacePhasors.Blocks.ToPolar

Converts a space phasor to polar coordinates

Modelica.Electrical.Machines.SpacePhasors.Blocks.ToPolar

Information


Converts a space phasor from rectangular coordinates to polar coordinates.

Extends from Modelica.Blocks.Interfaces.MIMOs (Multiple Input Multiple Output continuous control block with same number of inputs and outputs).

Parameters

TypeNameDefaultDescription
Integern2Number of inputs (= number of outputs)

Connectors

TypeNameDescription
input RealInputu[n]Connector of Real input signals
output RealOutputy[n]Connector of Real output signals

Modelica definition

block ToPolar "Converts a space phasor to polar coordinates"
  extends Modelica.Blocks.Interfaces.MIMOs(final n=2);
  constant Real small=Modelica.Constants.small;
equation 
  y[1] = sqrt(u[1]^2 + u[2]^2);
  y[2] = if noEvent(y[1] <= small) then 0 else Modelica.Math.atan2(u[2], u[1]);
/*
  if y[1] <= small then
    y[2] = 0;
  else
    if u[2] >= 0 then
      y[2] =  Modelica.Math.acos(u[1]/y[1]);
    else
      y[2] = -Modelica.Math.acos(u[1]/y[1]);
    end if;
  end if;
*/
end ToPolar;

Modelica.Electrical.Machines.SpacePhasors.Blocks.FromPolar Modelica.Electrical.Machines.SpacePhasors.Blocks.FromPolar

Converts a space phasor from polar coordinates

Modelica.Electrical.Machines.SpacePhasors.Blocks.FromPolar

Information


Converts a space phasor from polar coordinates to rectangular coordinates.

Extends from Modelica.Blocks.Interfaces.MIMOs (Multiple Input Multiple Output continuous control block with same number of inputs and outputs).

Parameters

TypeNameDefaultDescription
Integern2Number of inputs (= number of outputs)

Connectors

TypeNameDescription
input RealInputu[n]Connector of Real input signals
output RealOutputy[n]Connector of Real output signals

Modelica definition

block FromPolar "Converts a space phasor from polar coordinates"
  extends Modelica.Blocks.Interfaces.MIMOs(final n=2);
equation 
  y = u[1]*{cos(u[2]),sin(u[2])};
end FromPolar;

Automatically generated Fri Nov 12 16:29:03 2010.