within AIDAModelica; model AllocationControl "Allocation Coltrol Model" // CP: 65001 // SimulationX Version: 3.8.2.45319 x64 Modelica.Blocks.Interfaces.RealInput TotalThrustAP(quantity = "Mechanics.Translation.Force", displayUnit = "N") "'input Real' as connector" annotation( Placement(transformation(extent = {{-95, 40}, {-55, 80}}), iconTransformation(extent = {{-120, 55}, {-80, 95}}))); Modelica.Blocks.Interfaces.RealInput TotalThrustManual(quantity = "Mechanics.Translation.Force", displayUnit = "N") "'input Real' as connector" annotation( Placement(transformation(extent = {{-95, 0}, {-55, 40}}), iconTransformation(extent = {{-120, 5}, {-80, 45}}))); Modelica.Blocks.Interfaces.RealInput MomentumsConsign[3](quantity = "Mechanics.Rotation.Torque", displayUnit = "Nm") "'input Real' as connector" annotation( Placement(transformation(extent = {{-50, -15}, {-10, 25}}), iconTransformation(extent = {{-120, -45}, {-80, -5}}))); Modelica.Blocks.Interfaces.RealOutput Motor1Rate(quantity = "Mechanics.Rotation.RotVelocity", displayUnit = "rpm") "'output Real' as connector" annotation( Placement(transformation(extent = {{35, 45}, {55, 65}}), iconTransformation(extent = {{90, 65}, {110, 85}}))); Modelica.Blocks.Interfaces.RealOutput Motor2Rate(quantity = "Mechanics.Rotation.RotVelocity", displayUnit = "rpm") "'output Real' as connector" annotation( Placement(transformation(extent = {{35, 30}, {55, 50}}), iconTransformation(extent = {{90, 15}, {110, 35}}))); Modelica.Blocks.Interfaces.RealOutput Motor3Rate(quantity = "Mechanics.Rotation.RotVelocity", displayUnit = "rpm") "'output Real' as connector" annotation( Placement(transformation(extent = {{35, 10}, {55, 30}}), iconTransformation(extent = {{90, -35}, {110, -15}}))); Modelica.Blocks.Interfaces.RealOutput Motor4Rate(quantity = "Mechanics.Rotation.RotVelocity", displayUnit = "rpm") "'output Real' as connector" annotation( Placement(transformation(extent = {{35, -5}, {55, 15}}), iconTransformation(extent = {{90, -85}, {110, -65}}))); Modelica.Blocks.Interfaces.BooleanInput SelectedControlMode "'input Boolean' as connector" annotation( Placement(transformation(extent = {{-115, 20}, {-75, 60}}), iconTransformation(extent = {{-120, -95}, {-80, -55}}))); AIDAModelica.ComputeMotorRate computeMotorRate1 annotation( Placement(visible = true, transformation(extent = {{-5, 20}, {15, 45}}, rotation = 0))); Modelica.Blocks.Logical.Switch SelectTotalThrustConsign annotation( Placement(transformation(extent = {{-50, 30}, {-30, 50}}))); equation connect(SelectTotalThrustConsign.y, computeMotorRate1.TotalThrust) annotation( Line(points = {{-29, 40}, {-5, 40}}, color = {0, 0, 127}, thickness = 0.0625)); connect(computeMotorRate1.Motor4Rate, Motor4Rate) annotation( Line(points = {{15, 25}, {40, 25}, {40, 5}, {45, 5}}, color = {0, 0, 127}, thickness = 0.0625)); connect(computeMotorRate1.Motor3Rate, Motor3Rate) annotation( Line(points = {{15, 30}, {40, 30}, {40, 20}, {45, 20}}, color = {0, 0, 127}, thickness = 0.0625)); connect(computeMotorRate1.Motor2Rate, Motor2Rate) annotation( Line(points = {{15, 35}, {40, 35}, {40, 40}, {45, 40}}, color = {0, 0, 127}, thickness = 0.0625)); connect(computeMotorRate1.Motor1Rate, Motor1Rate) annotation( Line(points = {{15, 40}, {40, 40}, {40, 55}, {45, 55}}, color = {0, 0, 127}, thickness = 0.0625)); connect(computeMotorRate1.MomentumConsign[:], MomentumsConsign[:]) annotation( Line(points = {{-5, 25}, {-25, 25}, {-25, 5}, {-30, 5}}, color = {0, 0, 127}, thickness = 0.0625)); connect(SelectTotalThrustConsign.u1, TotalThrustAP) annotation( Line(points = {{-52, 48}, {-57, 48}, {-70, 48}, {-70, 60}, {-75, 60}}, color = {0, 0, 127}, thickness = 0.0625)); connect(SelectTotalThrustConsign.u2, SelectedControlMode) annotation( Line(points = {{-52, 40}, {-57, 40}, {-90, 40}, {-95, 40}}, color = {255, 0, 255}, thickness = 0.0625)); connect(SelectTotalThrustConsign.u3, TotalThrustManual) annotation( Line(points = {{-52, 32}, {-57, 32}, {-70, 32}, {-70, 20}, {-75, 20}}, color = {0, 0, 127}, thickness = 0.0625)); annotation( TotalThrustAP(flags = 2), TotalThrustManual(flags = 2), MomentumsConsign(flags = 2), Motor1Rate(flags = 2), Motor2Rate(flags = 2), Motor3Rate(flags = 2), Motor4Rate(flags = 2), SelectedControlMode(flags = 2), computeMotorRate1(TotalThrust(flags = 2), MomentumConsign(flags = 2), Motor1Rate(flags = 2), Motor2Rate(flags = 2), Motor3Rate(flags = 2), Motor4Rate(flags = 2), P4(flags = 2), M4(flags = 2), AngVelVector(flags = 2), TMomVector(flags = 2), ParamCosSin(flags = 2)), SelectTotalThrustConsign(u1(flags = 2), u2(flags = 2), u3(flags = 2), y(flags = 2)), Icon(coordinateSystem(extent = {{-100, -125}, {100, 125}}, initialScale = 0.1), graphics = {Rectangle(fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid, extent = {{-100, 126.7}, {100, -126.7}}), Text(origin = {-57, 21}, extent = {{-11, 5}, {105, -39}}, textString = "AllocationControl")}), experiment(StopTime = 1, StartTime = 0, Interval = 0.002, MaxInterval = "0.001")); end AllocationControl;