AIDA is a study case for model based system engineering, made by MOISE project. This project contains the simulation model of AIDA (made with SimulationX in Modelica)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

46 lines
1.9 KiB

within AIDAModelica;
model YAngularSpeedErrorModel "Y angular speed error calculation model"
Modelica.Blocks.Interfaces.RealInput PitchCosign(
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 Pitch(
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 AngularSpeedY(
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 AngularSpeedYError(
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 Kwteta=1.5 "Proportional gain Kwteta";
parameter Boolean RTStepConsign=false "test pour commande de step sur la consigne de vitesse angulaire";
Real eteta(
quantity="Mechanics.Rotation.Angle",
displayUnit="rad") "Teta error";
Real wyd(
quantity="Mechanics.Rotation.RotVelocity",
displayUnit="rad/s") "Desired angular speed Y";
equation
// enter your equations here
eteta = Pitch-PitchCosign;
if RTStepConsign==true and abs(PitchCosign)>0.001 then
wyd = Kwteta;
else
wyd = -Kwteta*eteta;
end if;
AngularSpeedYError = wyd-AngularSpeedY;
annotation(Icon(graphics={
Rectangle(
fillColor={255,255,255},
fillPattern=FillPattern.Solid,
extent={{-100,100},{100,-100}})}));
end YAngularSpeedErrorModel;