Files
AIDASimulation/SimulationModels/AIDAModelica/ZAngularSpeedErrorModel.mo

47 lines
1.8 KiB
Plaintext
Raw Normal View History

// CP: 65001
// SimulationX Version: 3.8.2.45319 x64
within AIDAModelica;
model ZAngularSpeedErrorModel "Z angular speed error calculation model"
Modelica.Blocks.Interfaces.RealInput YawCosign(
quantity="Mechanics.Rotation.Angle",
displayUnit="rad") "'input Real' as connector" annotation(Placement(
transformation(extent={{-20,-20},{20,20}}),
iconTransformation(extent={{-120,30},{-80,70}})));
Modelica.Blocks.Interfaces.RealInput Yaw(
quantity="Mechanics.Rotation.Angle",
displayUnit="rad") "'input Real' as connector" annotation(Placement(
transformation(extent={{-20,-20},{20,20}}),
iconTransformation(extent={{-120,-20},{-80,20}})));
Modelica.Blocks.Interfaces.RealInput AngularSpeedZ(
quantity="Mechanics.Rotation.RotVelocity",
displayUnit="rad/s") "'input Real' as connector" annotation(Placement(
transformation(extent={{-20,-20},{20,20}}),
iconTransformation(extent={{-120,-70},{-80,-30}})));
Modelica.Blocks.Interfaces.RealOutput AngularSpeedZError(
quantity="Mechanics.Rotation.RotVelocity",
displayUnit="rad/s") "'output Real' as connector" annotation(Placement(
transformation(extent={{-10,-10},{10,10}}),
iconTransformation(extent={{86.7,-10},{106.7,10}})));
parameter Real Kwyaw=1.5 "Proportional gain Kwyaw";
Real eyaw(
quantity="Mechanics.Rotation.Angle",
displayUnit="rad") "Yaw error";
Real wzd(
quantity="Mechanics.Rotation.RotVelocity",
displayUnit="rad/s") "Desired angular speed Z";
equation
// enter your equations here
eyaw = YawCosign-Yaw;
wzd = Kwyaw*eyaw;
AngularSpeedZError = wzd-AngularSpeedZ;
annotation(Icon(graphics={
Rectangle(
fillColor={255,255,255},
fillPattern=FillPattern.Solid,
extent={{-100,96.7},{-100,93.3}}),
Rectangle(
fillColor={255,255,255},
fillPattern=FillPattern.Solid,
extent={{-100,100},{100,-100}})}));
end ZAngularSpeedErrorModel;