Skip to content

Commit 1392e6f

Browse files
authored
Merge branch 'master' into RenameMachinesControllers
2 parents fa70283 + 43020b6 commit 1392e6f

File tree

1 file changed

+80
-0
lines changed

1 file changed

+80
-0
lines changed

Modelica/Electrical/Machines.mo

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17202,6 +17202,86 @@ the result is the angle with respect to one pole pair and can be directly used f
1720217202
</html>"));
1720317203
end SinCosEvaluation;
1720417204

17205+
block SinCosEvaluation "Evaluation of the signals of a sin-cos-resolver"
17206+
extends Modelica.Blocks.Icons.Block;
17207+
Blocks.Interfaces.RealInput u[4] "Signal from sin-cos-resolver"
17208+
annotation (Placement(transformation(extent={{-140,20},{-100,-20}})));
17209+
Blocks.Math.Feedback feedbackCos
17210+
annotation (Placement(transformation(extent={{-70,30},{-50,50}})));
17211+
Blocks.Math.Feedback feedbackSin
17212+
annotation (Placement(transformation(extent={{-70,-30},{-50,-50}})));
17213+
SpacePhasors.Blocks.Rotator rotator
17214+
annotation (Placement(transformation(extent={{-20,-10},{0,10}})));
17215+
Blocks.Continuous.Integrator integrator(final k=1e6)
17216+
annotation (Placement(transformation(extent={{10,-10},{30,10}})));
17217+
Blocks.Continuous.Der der1
17218+
annotation (Placement(transformation(extent={{60,-70},{80,-50}})));
17219+
Blocks.Interfaces.RealOutput phi(unit="rad") "Angle"
17220+
annotation (Placement(transformation(extent={{100,-10},{120,10}})));
17221+
Blocks.Interfaces.RealOutput w(unit="rad/s") "Angular velocity"
17222+
annotation (Placement(transformation(extent={{100,-70},{120,-50}})));
17223+
equation
17224+
connect(u[1], feedbackCos.u1) annotation (Line(points={{-120,15},{-80,15},
17225+
{-80,40},{-68,40}}, color={0,0,127}));
17226+
connect(u[2], feedbackCos.u2)
17227+
annotation (Line(points={{-120,5},{-60,5},{-60,32}}, color={0,0,127}));
17228+
connect(u[3], feedbackSin.u1) annotation (Line(points={{-120,-5},{-80,-5},
17229+
{-80,-40},{-68,-40}}, color={0,0,127}));
17230+
connect(u[4], feedbackSin.u2) annotation (Line(points={{-120,-15},{-60,
17231+
-15},{-60,-32}}, color={0,0,127}));
17232+
connect(feedbackCos.y, rotator.u[1]) annotation (Line(points={{-51,40},{
17233+
-40,40},{-40,0},{-22,0}}, color={0,0,127}));
17234+
connect(feedbackSin.y, rotator.u[2]) annotation (Line(points={{-51,-40},{
17235+
-40,-40},{-40,0},{-22,0}}, color={0,0,127}));
17236+
connect(rotator.y[2], integrator.u)
17237+
annotation (Line(points={{1,0},{8,0}}, color={0,0,127}));
17238+
connect(integrator.y, rotator.angle) annotation (Line(points={{31,0},{40,
17239+
0},{40,-20},{-10,-20},{-10,-12}}, color={0,0,127}));
17240+
connect(integrator.y, der1.u) annotation (Line(points={{31,0},{40,0},{40,
17241+
-60},{58,-60}}, color={0,0,127}));
17242+
connect(integrator.y, phi)
17243+
annotation (Line(points={{31,0},{110,0}}, color={0,0,127}));
17244+
connect(der1.y, w)
17245+
annotation (Line(points={{81,-60},{110,-60}}, color={0,0,127}));
17246+
annotation (Icon(graphics={
17247+
Line(points={{-80,80},{-76.2,79.8},{-70.6,76.6},{-64.9,69.7},{-59.3,
17248+
59.4},{-52.9,44.1},{-44.83,21.2},{-27.9,-30.8},{-20.7,-50.2},{-14.3,
17249+
-64.2},{-8.7,-73.1},{-3,-78.4},{2.6,-80},{8.2,-77.6},{13.9,-71.5},
17250+
{19.5,-61.9},{25.9,-47.2},{34,-24.8},{42,0}}, smooth=Smooth.Bezier),
17251+
Line(points={{-80,0},{-68.7,34.2},{-61.5,53.1},{-55.1,66.4},{-49.4,
17252+
74.6},{-43.8,79.1},{-38.2,79.8},{-32.6,76.6},{-26.9,69.7},{-21.3,
17253+
59.4},{-14.9,44.1},{-6.83,21.2},{10.1,-30.8},{17.3,-50.2},{23.7,
17254+
-64.2},{29.3,-73.1},{35,-78.4},{40.6,-80},{46.2,-77.6},{51.9,-71.5},
17255+
{57.5,-61.9},{63.9,-47.2},{72,-24.8},{80,0}}, smooth = Smooth.Bezier)}),
17256+
Documentation(info="<html>
17257+
<p>
17258+
The <a href=\"modelica://Modelica.Electrical.Machines.Sensors.SinCosResolver\">sin-cos-resolver</a> provides four tracks:
17259+
</p>
17260+
<ul>
17261+
<li>cosine</li>
17262+
<li>minus sine<li>
17263+
<li>sine</li>
17264+
<li>minus cosine<li>
17265+
</ul>
17266+
<p>
17267+
All four tracks have the same amplitude and the same offset &gt; amplitude. Offset is used to detect loss of a track.
17268+
To remove offset, (minus sine) is subtracted from (sine) and (minus cosine) from (cosine),
17269+
resulting in a cosine and a sine signal with doubled amplitude but without offset.
17270+
</p>
17271+
<p>
17272+
Interpreting cosine and sine as real and imaginary part of a phasor, one could calculate the angle of the phasor (i.e., transform rectangular coordinates to polar coordinates).
17273+
This is not very robust if the signals are superimposed with some noise.
17274+
Therefore the phasor is rotated by an angle that is obtained by a controller. The controller aims at imaginary part equal to zero.
17275+
The resulting angle is continuous, i.e. differentiating the angle results in 2*&pi;*frequency.
17276+
If desired, the angle can be wrapped to the interval ]-&pi;, +&pi;].
17277+
</p>
17278+
<p>
17279+
If the <a href=\"modelica://Modelica.Electrical.Machines.Sensors.SinCosResolver\">sin-cos-resolver</a> provides one period of the tracks during a rotation of 2&pi;/p,
17280+
the result is the angle with respect to one pole pair and can be directly used for field oriented control.
17281+
</p>
17282+
</html>"));
17283+
end SinCosEvaluation;
17284+
1720517285
model SwitchYD "Y-D-switch"
1720617286
parameter Integer m=3 "Number of phases";
1720717287
Modelica.Electrical.Polyphase.Interfaces.PositivePlug plugSupply(final m=

0 commit comments

Comments
 (0)