Browse Source

Initialize simulation models.

Signed-off-by: Aurelien Didier <aurelien.didier51@gmail.com>
master
Aurelien Didier 6 years ago
parent
commit
6465362982
  1. 91
      SimulationModels/AIDAModel-integrationProSivic_reference.mo
  2. 284
      SimulationModels/AIDAModelica/.gitignore
  3. 4
      SimulationModels/AIDAModelica/AIDAModelica.mo_old
  4. 61
      SimulationModels/AIDAModelica/AccelerationToSpeed.mo
  5. 232
      SimulationModels/AIDAModelica/AcquirePositioningSignal.mo
  6. 58
      SimulationModels/AIDAModelica/AllocationControl.mo
  7. 94
      SimulationModels/AIDAModelica/AttitudeControl.mo
  8. 151
      SimulationModels/AIDAModelica/AttitudeControl_PID2.mo
  9. 35
      SimulationModels/AIDAModelica/ComputationAccelerationModel.mo
  10. 27
      SimulationModels/AIDAModelica/ComputationChangeAngleVelocity.mo
  11. 40
      SimulationModels/AIDAModelica/ComputeAltitudeConsign.mo
  12. 41
      SimulationModels/AIDAModelica/ComputeDroneAngularsVelocities.mo
  13. 47
      SimulationModels/AIDAModelica/ComputeDroneAttitude.mo
  14. 37
      SimulationModels/AIDAModelica/ComputeDronePosition.mo
  15. 57
      SimulationModels/AIDAModelica/ComputeDroneVelocity.mo
  16. 28
      SimulationModels/AIDAModelica/ComputeMoments.mo
  17. 79
      SimulationModels/AIDAModelica/ComputeMotorRate.mo
  18. 235
      SimulationModels/AIDAModelica/ComputePositionAndTime.mo
  19. 61
      SimulationModels/AIDAModelica/ComputeThrustAndAttitudeConsign.mo
  20. 23
      SimulationModels/AIDAModelica/ComputeTotalThrust.mo
  21. 57
      SimulationModels/AIDAModelica/ComputeTotalThrustCA.mo
  22. 33
      SimulationModels/AIDAModelica/ComputeTotalThrustMM.mo
  23. 92
      SimulationModels/AIDAModelica/ControlAltitude.mo
  24. 44
      SimulationModels/AIDAModelica/ControlAltitudeEx.mo
  25. 54
      SimulationModels/AIDAModelica/ControlDroneNavigation.mo
  26. 54
      SimulationModels/AIDAModelica/ControlEffectivenessModel.mo
  27. 17
      SimulationModels/AIDAModelica/ControlMotor.mo
  28. 38
      SimulationModels/AIDAModelica/ControlPitchAngle.mo
  29. 75
      SimulationModels/AIDAModelica/ControlPosition.mo
  30. 50
      SimulationModels/AIDAModelica/ControlPositionSAC.mo
  31. 290
      SimulationModels/AIDAModelica/ControlPositionV0.mo
  32. 38
      SimulationModels/AIDAModelica/ControlRollAngle.mo
  33. 49
      SimulationModels/AIDAModelica/ControlSpeed.mo
  34. 96
      SimulationModels/AIDAModelica/ControlYawAngle.mo
  35. 54
      SimulationModels/AIDAModelica/Cosim_Sim_m.mo
  36. 30
      SimulationModels/AIDAModelica/CreateMotion.mo
  37. 153
      SimulationModels/AIDAModelica/GeneratePositioningSignal.mo
  38. 127
      SimulationModels/AIDAModelica/LowLevelFlightControlSystem.mo
  39. 514
      SimulationModels/AIDAModelica/ModelicaLicense2.mo
  40. 22
      SimulationModels/AIDAModelica/MotorControl.mo
  41. 23
      SimulationModels/AIDAModelica/MotorPropellerModel.mo
  42. 120
      SimulationModels/AIDAModelica/PID_2.mo
  43. 134
      SimulationModels/AIDAModelica/PID_discrete.mo
  44. 201
      SimulationModels/AIDAModelica/PositionControl.mo
  45. 64
      SimulationModels/AIDAModelica/PositionConvector.mo
  46. 234
      SimulationModels/AIDAModelica/ProSIVICToSimXInterface.mo
  47. 183
      SimulationModels/AIDAModelica/ProSIVICToSimXInterfaceTest.mo
  48. 1930
      SimulationModels/AIDAModelica/QuadcopterModel.mo
  49. 215
      SimulationModels/AIDAModelica/RemoteControl.mo
  50. 184
      SimulationModels/AIDAModelica/RemoteControlForIntegration.mo
  51. 53
      SimulationModels/AIDAModelica/RigidBodyDynamicModel.mo
  52. 41
      SimulationModels/AIDAModelica/RigidBodyKinematicModel.mo
  53. 2011
      SimulationModels/AIDAModelica/RunFlightPlan.mo
  54. 37
      SimulationModels/AIDAModelica/SelectAttitudeConsign.mo
  55. 152
      SimulationModels/AIDAModelica/SelectControlMode.mo
  56. 37
      SimulationModels/AIDAModelica/SelectSpeedConsign.mo
  57. 35
      SimulationModels/AIDAModelica/SelectTotalThrustConsign.mo
  58. 99
      SimulationModels/AIDAModelica/SimXToProSIVICInterface.mo
  59. 171
      SimulationModels/AIDAModelica/SimXToProSIVICInterfaceTest.mo
  60. 53
      SimulationModels/AIDAModelica/SpeedErrorModel.mo
  61. 40
      SimulationModels/AIDAModelica/SpeedErrorModelMM.mo
  62. 61
      SimulationModels/AIDAModelica/SpeedErrorModelSAC.mo
  63. 177
      SimulationModels/AIDAModelica/Step_analysis.mo
  64. 1846
      SimulationModels/AIDAModelica/TrajectoryManagement.bak
  65. 5285
      SimulationModels/AIDAModelica/TrajectoryManagement.ism
  66. 1860
      SimulationModels/AIDAModelica/TrajectoryManagement.mo
  67. 42
      SimulationModels/AIDAModelica/XAngularSpeedErrorModel.mo
  68. 46
      SimulationModels/AIDAModelica/YAngularSpeedErrorModel.mo
  69. 27
      SimulationModels/AIDAModelica/YawConsignProducing.mo
  70. 46
      SimulationModels/AIDAModelica/ZAngularSpeedErrorModel.mo
  71. 64
      SimulationModels/AIDAModelica/modele_complet_RC.mo
  72. 14697
      SimulationModels/AIDAModelica/package.mo
  73. 70
      SimulationModels/AIDAModelica/package.order

91
SimulationModels/AIDAModel-integrationProSivic_reference.mo

@ -0,0 +1,91 @@ @@ -0,0 +1,91 @@
model AIDA_System "AIDAModel-integrationProSivic_reference.isx"
AIDAModelica.QuadcopterModel quadcopterModel1(
rigidBodyKinematicModel1(
computeDronePosition1(
integrator10(initType = Modelica.Blocks.Types.Init.SteadyState, y_start = -0.29),
integrator11(initType = Modelica.Blocks.Types.Init.InitialOutput),
integrator12(initType = Modelica.Blocks.Types.Init.InitialOutput))),
rigidBodyDynamicModel1(
computeDroneVelocity1(
integrator4(initType = Modelica.Blocks.Types.Init.SteadyState)))) annotation(
Placement(visible = true, transformation(extent = {{29, -8}, {49, 17}}, rotation = 0)));
AIDAModelica.LowLevelFlightControlSystem lowLevelFlightControlSystem1(
controlAltitude1(computeAltitudeConsign1(
PID1(k = 30, Ti = 1, Td = 0.1, Nd = 10, initType=Modelica.Blocks.Types.InitPID.InitialOutput)),
pID_2(k = 25, Ti = 0.5, Td = 0.08, initType=Modelica.Blocks.Types.InitPID.InitialOutput)),
attitudeControl1(Test_CstMomentumActiv = false, Test_open_loop = {false, false, false},
controlRollAngle1(xAngularSpeedErrorModel1(Kwphi = 1.5),
PID(k = 0.07, Ti = 30, Td = 0.02, Nd = 0.1,initType=Modelica.Blocks.Types.InitPID.InitialOutput,
Add(k1 = 1, k2 = 1, k3 = 1))),
controlPitchAngle1(yAngularSpeedErrorModel1(Kwteta = 1.5, RTStepConsign = false),
PID1(k = 0.07, Ti = 30, Td = 0.02, Nd = 0.1,initType=Modelica.Blocks.Types.InitPID.InitialOutput,
Add(k1 = 1, k2 = 1, k3 = 1))),
controlYawAngle1(zAngularSpeedErrorModel1(Kwyaw = 2),
PID2(k = 0.04, Ti = 20, Td = 0.5, Nd = 2.5,initType=Modelica.Blocks.Types.InitPID.InitialOutput,
Add(k1 = 1, k2 = 1, k3 = 1)))),
positionControl1(
controlSpeed1(
PID(k = 0.8, Ti = 1,initType=Modelica.Blocks.Types.InitPID.InitialOutput),
PID2(k = 0.8, Ti = 1,initType=Modelica.Blocks.Types.InitPID.InitialOutput),
PID1(k = 30, Ti = 1, Td=0.1,initType=Modelica.Blocks.Types.InitPID.InitialOutput)))) annotation(
Placement(visible = true, transformation(extent = {{-37, -6}, {-12, 19}}, rotation = 0)));
AIDAModelica.ControlDroneNavigation controlDroneNavigation1 annotation(
Placement(visible = true, transformation(extent = {{-79, -3}, {-59, 17}}, rotation = 0)));
AIDAModelica.RemoteControl remoteControl1(
VS_cmd=-0.5,
VS_cmd_t={0.1,5},
Pitch_cmd=0.02,
Pitch_cmd_t={6,12},
Yaw_cmd_t={15,19},
Roll_cmd=0.02,
Roll_cmd_t={3,9},
Auto_Ctl_t=0.2) annotation(
Placement(visible = true, transformation(extent = {{-57, 49}, {-32, 69}}, rotation = 0)));
equation
connect(lowLevelFlightControlSystem1.AngularSpeed, quadcopterModel1.AngularVelocities) annotation(
Line(points = {{-33, -6}, {-33, -30}, {81.1667, -30}, {81.1667, 12}, {49.1667, 12}}, color = {0, 0, 127}));
connect(lowLevelFlightControlSystem1.Attitude, quadcopterModel1.Attitude) annotation(
Line(points = {{-29, -6}, {-29, -26}, {69.3333, -26}, {69.3333, 8}, {49.3333, 8}}, color = {0, 0, 127}));
connect(lowLevelFlightControlSystem1.Position, quadcopterModel1.Position) annotation(
Line(points = {{-24.5, -6}, {-24.5, -22}, {61.5, -22}, {61.5, 4}, {49.5, 4}}, color = {0, 0, 127}));
connect(lowLevelFlightControlSystem1.Speed, quadcopterModel1.Speed) annotation(
Line(points = {{-21, -6}, {-17.6667, -6}, {-17.6667, -18}, {57.3333, -18}, {57.3333, 0}, {49.3333, 0}}, color = {0, 0, 127}));
connect(lowLevelFlightControlSystem1.Accelerations, quadcopterModel1.Accelerations) annotation(
Line(points = {{-17, -6}, {-13.8333, -6}, {-13.8333, -16.0333}, {54.9167, -16.0333}, {54.9167, -4.0333}, {48.4167, -4.0333}}, color = {0, 0, 127}));
connect(quadcopterModel1.ThrottleCommand1, lowLevelFlightControlSystem1.ThrottleCommand1) annotation(
Line(points = {{29, 10.75}, {1, 10.75}, {1, 14}, {-12, 14}}, color = {0, 0, 127}, thickness = 0.015625));
connect(lowLevelFlightControlSystem1.ThrottleCommand2, quadcopterModel1.ThrottleCommand2) annotation(
Line(points = {{-12, 9}, {8.5, 9}, {8.5, 7}, {29, 7}}, color = {0, 0, 127}, thickness = 0.015625));
connect(quadcopterModel1.ThrottleCommand3, lowLevelFlightControlSystem1.ThrottleCommand3) annotation(
Line(points = {{29, 2.41667}, {12.5, 2.41667}, {12.5, 4}, {-12, 4}}, color = {0, 0, 127}, thickness = 0.015625));
connect(lowLevelFlightControlSystem1.ThrottleCommand4, quadcopterModel1.ThrottleCommand4) annotation(
Line(points = {{-12, -1}, {26, -1}, {26, -2}, {29, -2}}, color = {0, 0, 127}, thickness = 0.015625));
connect(quadcopterModel1.Speed[:], lowLevelFlightControlSystem1.Speed[:]) annotation(
Line);
connect(controlDroneNavigation1.YawConsign, lowLevelFlightControlSystem1.YawConsign) annotation(
Line(points = {{-59, 7}, {-34, 7}, {-34, 4}, {-37, 4}}, color = {0, 0, 127}, thickness = 0.0625));
connect(controlDroneNavigation1.DronPositionConsign[:], lowLevelFlightControlSystem1.DronePositionConsign[:]) annotation(
Line(points = {{-59, 12}, {-48, 12}, {-48, 14}, {-37, 14}}, color = {0, 0, 127}, thickness = 0.0625));
connect(lowLevelFlightControlSystem1.SelectedControlMode, controlDroneNavigation1.SelectedControlMode) annotation(
Line(points = {{-37, -1}, {-54, -1}, {-54, 2}, {-59, 2}}, color = {255, 0, 255}, thickness = 0.0625));
connect(lowLevelFlightControlSystem1.RCVerticalSpeedCommand, remoteControl1.VerticalSpeedCommand) annotation(
Line(points = {{-31, 19}, {-52.75, 19}, {-52.75, 49}}, color = {0, 0, 127}));
connect(lowLevelFlightControlSystem1.RCYawCommand, remoteControl1.YawCommand) annotation(
Line(points = {{-22, 19}, {-36.4167, 19}, {-36.4167, 51}, {-35.4167, 51}, {-35.4167, 49}, {-36.4167, 49}}, color = {0, 0, 127}));
connect(remoteControl1.RollCommand, lowLevelFlightControlSystem1.RCAttitudeCommands[1]) annotation(
Line(points = {{-47, 49}, {-47, 22}, {-27, 22}, {-27, 19}}, color = {0, 0, 127}, thickness = 0.0625));
connect(remoteControl1.PitchCommand, lowLevelFlightControlSystem1.RCAttitudeCommands[2]) annotation(
Line(points = {{-42, 49}, {-42, 22}, {-27, 22}, {-27, 19}}, color = {0, 0, 127}, thickness = 0.0625));
connect(remoteControl1.IndicatorYawConsign, controlDroneNavigation1.IndicatorYawConsign) annotation(
Line(points = {{-57, 59}, {-94, 59}, {-94, 6}, {-80, 6}, {-80, 8}, {-78, 8}, {-78, 8}, {-78, 8}}, color = {255, 0, 255}));
connect(remoteControl1.ControlMode, controlDroneNavigation1.APEngagement) annotation(
Line(points = {{-57, 54}, {-84, 54}, {-84, 12}, {-79, 12}}, color = {255, 0, 255}, thickness = 0.015625));
connect(controlDroneNavigation1.Yaw, quadcopterModel1.Attitude[3]) annotation(
Line(points = {{-79, 2}, {-87, 2}, {-87, -36}, {91, -36}, {91, 8}, {49, 8}, {49, 8}, {49, 8}, {49, 8}}, color = {0, 0, 127}));
annotation(
Icon(coordinateSystem(grid = {3, 2})),
experiment(StartTime = 0, StopTime = 30, Tolerance = 1e-06, Interval = 0.002),
__OpenModelica_simulationFlags(jacobian = "coloredNumerical", s = "dassl", lv = "LOG_STATS"));
end AIDA_System;

284
SimulationModels/AIDAModelica/.gitignore vendored

@ -0,0 +1,284 @@ @@ -0,0 +1,284 @@
/QuadcopterModel.mo13
/QuadcopterModel.mo14
/QuadcopterModel.mo15
/QuadcopterModel.mo16
/QuadcopterModel.mo17
/RemoteControl.mo94
/RemoteControl.mo95
/RemoteControl.mo96
/RigidBodyDynamicModel.mo10
/RigidBodyDynamicModel.mo11
/RigidBodyDynamicModel.mo12
/RigidBodyDynamicModel.mo13
/RigidBodyDynamicModel.mo9
/RigidBodyKinematicModel.mo7
/RigidBodyKinematicModel.mo8
/SelectSpeedConsign.mo6
/SimXToProSIVICInterface.mo2
/SpeedErrorModel.mo5
/SpeedErrorModel.mo6
/SpeedErrorModelSAC.mo10
/SpeedErrorModelSAC.mo11
/SpeedErrorModelSAC.mo9
/ComputationAccelerationModel.mo10
/ComputationAccelerationModel.mo11
/ComputationAccelerationModel.mo12
/ComputationAccelerationModel.mo13
/ComputationAccelerationModel.mo14
/ComputationAccelerationModel.mo5
/ComputationAccelerationModel.mo6
/ComputationAccelerationModel.mo7
/ComputationAccelerationModel.mo8
/ComputationAccelerationModel.mo9
/ComputationChangeAngleVelocity.mo2
/ComputeDroneVelocity.mo10
/ComputeDroneVelocity.mo6
/ComputeDroneVelocity.mo7
/ComputeDroneVelocity.mo8
/ComputeDroneVelocity.mo9
/ComputeThrustAndAttitudeConsign.mo12
/ComputeThrustAndAttitudeConsign.mo13
/ComputeThrustAndAttitudeConsign.mo14
/ComputeTotalThrustCA.mo1
/ComputeTotalThrustCA.mo10
/ComputeTotalThrustCA.mo2
/ComputeTotalThrustCA.mo3
/ComputeTotalThrustCA.mo4
/ComputeTotalThrustCA.mo5
/ComputeTotalThrustCA.mo6
/ComputeTotalThrustCA.mo7
/ComputeTotalThrustCA.mo8
/ComputeTotalThrustCA.mo9
/ControlPosition.mo37
/Cosim_Sim_m.mo1
/Cosim_Sim_m.mo2
/drone_feets.bak
/drone_feets.mo1
/package.mo60
/package.mo61
/package.mo62
/package.mo63
/package.mo64
/package.mo65
/package.mo66
/package.mo67
/AttitudeControl.mo28
/AttitudeControl.mo29
/package.mo68
/ProSIVICToSimXInterface.mo5
/ProSIVICToSimXInterface.mo6
/ProSIVICToSimXInterfaceTest.mo10
/ProSIVICToSimXInterfaceTest.mo11
/ProSIVICToSimXInterfaceTest.mo9
/QuadcopterModel.mo18
/QuadcopterModel.mo19
/QuadcopterModel.mo20
/RemoteControl.mo97
/SimXToProSIVICInterface.mo12
/SimXToProSIVICInterface.mo13
/XAngularSpeedErrorModel.mo15
/XAngularSpeedErrorModel.mo16
/YAngularSpeedErrorModel.mo14
/ZAngularSpeedErrorModel.mo30
/Step_analysis.mo1
/Step_analysis.mo2
/Step_analysis.mo10
/Step_analysis.mo11
/Step_analysis.mo12
/Step_analysis.mo13
/Step_analysis.mo14
/Step_analysis.mo15
/Step_analysis.mo16
/Step_analysis.mo17
/Step_analysis.mo18
/Step_analysis.mo19
/Step_analysis.mo20
/Step_analysis.mo3
/Step_analysis.mo4
/Step_analysis.mo5
/Step_analysis.mo6
/Step_analysis.mo7
/Step_analysis.mo8
/Step_analysis.mo9
/AttitudeControl.mo30
/ComputeAltitudeConsign.mo2
/ControlRollAngle.mo15
/ControlRollAngle.mo16
/PositionControl.mo29
/ProSIVICToSimXInterfaceTest.mo12
/QuadcopterModel.mo21
/RigidBodyKinematicModel.mo9
/Step_analysis.bak
/ComputeAltitudeConsign.mo10
/ComputeAltitudeConsign.mo11
/ComputeAltitudeConsign.mo12
/ComputeAltitudeConsign.mo13
/ComputeAltitudeConsign.mo14
/ComputeAltitudeConsign.mo15
/ComputeAltitudeConsign.mo16
/ComputeAltitudeConsign.mo17
/ComputeAltitudeConsign.mo18
/ComputeAltitudeConsign.mo19
/ComputeAltitudeConsign.mo20
/ComputeAltitudeConsign.mo21
/ComputeAltitudeConsign.mo3
/ComputeAltitudeConsign.mo4
/ComputeAltitudeConsign.mo5
/ComputeAltitudeConsign.mo6
/ComputeAltitudeConsign.mo7
/ComputeAltitudeConsign.mo8
/ComputeAltitudeConsign.mo9
/ComputeMotorRate.mo10
/ComputeMotorRate.mo11
/ComputeMotorRate.mo12
/ComputeMotorRate.mo13
/ComputeMotorRate.mo14
/ComputeMotorRate.mo15
/ComputeMotorRate.mo16
/ComputeMotorRate.mo17
/ComputeMotorRate.mo18
/ComputeMotorRate.mo19
/ComputeMotorRate.mo20
/ComputeMotorRate.mo21
/ComputeMotorRate.mo22
/ComputeMotorRate.mo23
/ComputeMotorRate.mo24
/ComputeMotorRate.mo25
/ComputeMotorRate.mo26
/ComputeMotorRate.mo27
/ComputeMotorRate.mo28
/ComputeMotorRate.mo29
/ComputeMotorRate.mo30
/ComputeMotorRate.mo31
/ComputeMotorRate.mo32
/ComputeMotorRate.mo33
/ComputeMotorRate.mo4
/ComputeMotorRate.mo5
/ComputeMotorRate.mo6
/ComputeMotorRate.mo7
/ComputeMotorRate.mo8
/ComputeMotorRate.mo9
/ComputeThrustAndAttitudeConsign.mo15
/ComputeThrustAndAttitudeConsign.mo16
/ComputeThrustAndAttitudeConsign.mo17
/ComputeThrustAndAttitudeConsign.mo18
/ComputeThrustAndAttitudeConsign.mo19
/ComputeThrustAndAttitudeConsign.mo20
/ComputeTotalThrust.mo5
/ComputeTotalThrustCA.mo11
/ComputeTotalThrustCA.mo12
/ComputeTotalThrustCA.mo13
/ComputeTotalThrustCA.mo14
/ComputeTotalThrustCA.mo15
/ComputeTotalThrustCA.mo16
/ComputeTotalThrustCA.mo17
/ComputeTotalThrustCA.mo18
/ComputeTotalThrustCA.mo19
/ComputeTotalThrustCA.mo20
/ComputeTotalThrustCA.mo21
/ComputeTotalThrustCA.mo22
/ComputeTotalThrustCA.mo23
/ComputeTotalThrustCA.mo24
/ControlDroneNavigation.mo29
/ControlPitchAngle.mo15
/ControlPitchAngle.mo16
/ControlPitchAngle.mo17
/ControlRollAngle.mo17
/ComputationAccelerationModel.mo15
/LowLevelFlightControlSystem.mo123
/LowLevelFlightControlSystem.mo124
/LowLevelFlightControlSystem.mo125
/LowLevelFlightControlSystem.mo126
/LowLevelFlightControlSystem.mo127
/LowLevelFlightControlSystem.mo128
/LowLevelFlightControlSystem.mo129
/LowLevelFlightControlSystem.mo130
/LowLevelFlightControlSystem.mo131
/LowLevelFlightControlSystem.mo132
/LowLevelFlightControlSystem.mo133
/LowLevelFlightControlSystem.mo134
/package.mo69
/package.mo70
/package.mo71
/package.mo72
/package.mo73
/package.mo74
/package.mo75
/package.mo76
/package.mo77
/package.mo78
/package.mo79
/package.mo80
/RemoteControl.mo100
/RemoteControl.mo101
/RemoteControl.mo102
/RemoteControl.mo103
/RemoteControl.mo104
/RemoteControl.mo105
/RemoteControl.mo106
/RemoteControl.mo107
/RemoteControl.mo108
/RemoteControl.mo109
/RemoteControl.mo110
/RemoteControl.mo111
/RemoteControl.mo112
/RemoteControl.mo113
/RemoteControl.mo98
/RemoteControl.mo99
/Step_analysis.mo21
/Step_analysis.mo22
/Step_analysis.mo23
/Step_analysis.mo24
/Step_analysis.mo25
/Step_analysis.mo26
/Step_analysis.mo27
/Step_analysis.mo28
/Step_analysis.mo29
/Step_analysis.mo30
/Step_analysis.mo31
/Step_analysis.mo32
/Step_analysis.mo33
/Step_analysis.mo34
/Step_analysis.mo35
/Step_analysis.mo36
/XAngularSpeedErrorModel.mo17
/CreateMotion.mo4
/CreateMotion.mo5
/CreateMotion.mo6
/CreateMotion.mo7
/AttitudeControl.mo31
/CreateMotion.mo8
/AIDAModelica.ComputeAltitudeConsign_discrete.mo1
/ComputeMotorRate.mo34
/ComputeTotalThrustCA.mo25
/ComputeTotalThrustCA.mo26
/ComputeTotalThrustCA.mo27
/ComputeTotalThrustCA.mo28
/AttitudeControl.mo32
/AttitudeControl.mo33
/AttitudeControl.mo34
/AttitudeControl.mo35
/AttitudeControl.mo36
/AttitudeControl.mo37
/ComputeMotorRate.mo35
/ComputeMotorRate.mo36
/ComputeMotorRate.mo37
/ComputeThrustAndAttitudeConsign.mo21
/ComputeThrustAndAttitudeConsign.mo22
/ComputeThrustAndAttitudeConsign.mo23
/ComputeTotalThrustCA.mo29
/ComputeTotalThrustCA.mo30
/ControlPitchAngle.mo18
/RemoteControl.mo114
/RemoteControl.mo115
/RemoteControl.mo116
/RemoteControl.mo117
/RemoteControl.mo118
/RemoteControl.mo119
/RemoteControl.mo120
/RemoteControl.mo121
/RemoteControl.mo122
/RemoteControl.mo123
/PositionControl.mo37
/SpeedErrorModel.mo19
/RunFlightPlan.mo37

4
SimulationModels/AIDAModelica/AIDAModelica.mo_old

@ -0,0 +1,4 @@ @@ -0,0 +1,4 @@
within;
package AIDAModelica "AIDA Modelica Libraries"
annotation(dateModified="2018-04-03 09:30:06Z");
end AIDAModelica;

61
SimulationModels/AIDAModelica/AccelerationToSpeed.mo

@ -0,0 +1,61 @@ @@ -0,0 +1,61 @@
// CP: 65001
// SimulationX Version: 3.8.2.45319 x64
within AIDAModelica;
model AccelerationToSpeed "Acceleration to speed convector"
Modelica.Blocks.Interfaces.RealInput Acceleration[3](
quantity="Mechanics.Translation.Accel",
displayUnit="m/s²") "'input Real' as connector" annotation(Placement(
transformation(extent={{-120,10},{-80,50}}),
iconTransformation(
origin={0,-100},
extent={{-20,-20},{20,20}},
rotation=90)));
Modelica.Blocks.Interfaces.RealOutput Speed[3](
quantity="Mechanics.Translation.Velocity",
displayUnit="m/s") "'output Real' as connector" annotation(Placement(
transformation(extent={{-5,20},{15,40}}),
iconTransformation(
origin={0,100},
extent={{-10,-10},{10,10}},
rotation=90)));
Modelica.Blocks.Continuous.Integrator integrator1 annotation(Placement(transformation(extent={{-60,50},{-40,70}})));
Modelica.Blocks.Continuous.Integrator integrator2 annotation(Placement(transformation(extent={{-60,20},{-40,40}})));
Modelica.Blocks.Continuous.Integrator integrator3 annotation(Placement(transformation(extent={{-60,-10},{-40,10}})));
equation
connect(integrator1.u,Acceleration[1]) annotation(Line(
points={{-62,60},{-67,60},{-95,60},{-95,30},{-100,30}},
color={0,0,127},
thickness=0.0625));
connect(integrator2.u,Acceleration[2]) annotation(Line(
points={{-62,30},{-67,30},{-95,30},{-100,30}},
color={0,0,127},
thickness=0.0625));
connect(integrator3.u,Acceleration[3]) annotation(Line(
points={{-62,0},{-67,0},{-95,0},{-95,30},{-100,30}},
color={0,0,127},
thickness=0.0625));
connect(integrator1.y,Speed[1]) annotation(Line(
points={{-39,60},{-34,60},{0,60},{0,30},{5,30}},
color={0,0,127},
thickness=0.0625));
connect(integrator2.y,Speed[2]) annotation(Line(
points={{-39,30},{-34,30},{0,30},{5,30}},
color={0,0,127},
thickness=0.0625));
connect(integrator3.y,Speed[3]) annotation(Line(
points={{-39,0},{-34,0},{0,0},{0,30},{5,30}},
color={0,0,127},
thickness=0.0625));
annotation(
Acceleration(flags=2),
Speed(flags=2),
Icon(graphics={
Rectangle(
fillColor={255,255,255},
fillPattern=FillPattern.Solid,
extent={{-100,100},{100,-100}})}),
experiment(
StopTime=1,
StartTime=0,
Interval=0.001));
end AccelerationToSpeed;

232
SimulationModels/AIDAModelica/AcquirePositioningSignal.mo

@ -0,0 +1,232 @@ @@ -0,0 +1,232 @@
// CP: 65001
// SimulationX Version: 3.8.2.45319 x64
within AIDAModelica;
model AcquirePositioningSignal "Acquire Positioning Signal"
Modelica.Blocks.Interfaces.RealOutput Measured_positioning_signal[4] "'output Real' as connector" annotation(Placement(
transformation(extent={{-10,-10},{10,10}}),
iconTransformation(extent={{90,-10},{110,10}})));
Modelica.Blocks.Interfaces.RealInput Positioning_signal[4] "'input Real' as connector" annotation(Placement(
transformation(extent={{-20,-20},{20,20}}),
iconTransformation(extent={{-120,-20},{-80,20}})));
equation
// enter your equations here
Measured_positioning_signal = Positioning_signal;
annotation(Icon(graphics={
Rectangle(
fillColor={255,255,255},
fillPattern=FillPattern.Solid,
extent={{-100,100},{100,-100}}),
Bitmap(
imageSource="iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAYAAAD0eNT6AAAAAXNSR0IArs4c6QAAAARnQU1BAACx
jwv8YQUAAAAJcEhZcwAACxIAAAsSAdLdfvwAAC5nSURBVHhe7d0JuLbluPDxp95mUokkiSapZN6m
aE75KBRCSpRp2+xjbzvbvDOEShHb3CYZolSmsu1ChWRokFJpEM21m1Sa+77/+S6ft2Wda73PWusZ
7vs+///j+B2HI/UO17ru+1nrHq6rZ2atahmsgcdiS7wIr8c7cRAOw7H4CX6J3+BcXITLcA1uxG24
56/if8c/i/8v/p34d+O/ORPxa8SvFb9m/Nrxe8TvFb9n/N7xZ9gE8WeKP5uZmZnNofgQXR/Pxmvx
IRyOU3EV/m+D3Yv4M/4c8Wf+IOLvsC3i7+Q3CGZmVr774al4DT6BExE/fceHaPbh2gVxtSH+jj/G
x7EXnoIVYGZm1rnWxU7YB0fjQnT5g3624huDC3AU/gMxVjFmZmZmrWlZbIq34tu4FtmHnhYvnkn4
FvbGM+AtBDMza0wPwvOxP36G25F9mGn+Ymx/iv2wI1aFmZnZSFoaWyA+hM5C9kGl0YjbKPGmwoex
OZaCmZnZwHo44mn2Y/BnZB9GGr+bEM8RxMOFa8LMzGxWLYFn4SM4G9mHjZrvt4hbM/FMRnxNzczM
phQfEPGg2cdwObIPFLXXpYhFjJ4GMzOzhe+hx0/6f0T2waHuuQRxZeDJMDOzQm2EeHDsYmQfEKoj
1mSIFQsfDTMz62Cx2tweOAXZB4EUex7sjuVhZmYt7wn4FGKzm+yk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DpWFmZmaLaTn8N7IP1Db5
Ltzcx8zMbBbFDoLfQ/bB2gbHwA9/MzOzORSXzuP+efYB22RfxlIwMzOzORYPz30U2QdtE+2PeKPB
zMzMBtA/IpbQzT50m+AO7AUzMzMbcM/E5cg+gMfpUjwdZmZmNqQehKORfRCPw5FYFWZmZjaCXoJx
Xg2In/p3gpmZmY24+2Mf3ITsQ3oYbsS7sQLMzMxsjK2Cd+BPyD60B+ESvBUrwczMzBpUvDK4LT6H
QdweiMv8n8XWcC1/MzOzlrQBXokDEcvy/gZX4lbc81fxv+OfnYlYtz/+3d2wPsysk/V6/w8NTtrN
uryBtgAAAABJRU5ErkJggg==",
extent={{-100,-100},{100,100}})}));
end AcquirePositioningSignal;

58
SimulationModels/AIDAModelica/AllocationControl.mo

@ -0,0 +1,58 @@ @@ -0,0 +1,58 @@
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;

94
SimulationModels/AIDAModelica/AttitudeControl.mo

@ -0,0 +1,94 @@ @@ -0,0 +1,94 @@
within AIDAModelica;
model AttitudeControl "Attitude Control Model"
// CP: 65001
// SimulationX Version: 3.8.2.45319 x64
parameter Boolean Test_CstMomentumActiv = false;
parameter Boolean Test_open_loop[3] = {false, false, false} "parameter";
parameter Real Test_CstMomentumValues[3] = {0.0, 0.0, 0.0};
Modelica.Blocks.Interfaces.RealInput AttitudeConsignAP[2](quantity = "Mechanics.Rotation.Angle", displayUnit = "rad") "Desired phi and teta angles input" annotation(
Placement(visible = true, transformation(extent = {{-166, 23}, {-126, 63}}, rotation = 0), iconTransformation(origin = {-50, 100}, extent = {{-20, -20}, {20, 20}}, rotation = 270)));
Modelica.Blocks.Interfaces.RealInput AttitudeRCConsign[2](quantity = "Mechanics.Rotation.Angle", displayUnit = "rad") "Desired phi and teta angles input sac" annotation(
Placement(visible = true,transformation(extent = {{-163, -45}, {-123, -5}}, rotation = 0), iconTransformation(extent = {{-120, -20}, {-80, 20}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealInput YawConsign(quantity = "Mechanics.Rotation.Angle", displayUnit = "rad") "Desired yaw angle input" annotation(
Placement(transformation(extent = {{-80, -70}, {-40, -30}}), iconTransformation(extent = {{-120, -70}, {-80, -30}})));
Modelica.Blocks.Interfaces.RealInput AngularSpeed[3](quantity = "Mechanics.Rotation.RotVelocity", displayUnit = "rad/s") "Real angular velocities feedback input" annotation(
Placement(transformation(extent = {{-89.7, 58}, {-49.7, 98}}), iconTransformation(origin = {-50, -100}, extent = {{-20, -20}, {20, 20}}, rotation = 90)));
Modelica.Blocks.Interfaces.RealInput Attitude[3](quantity = "Mechanics.Rotation.Angle", displayUnit = "rad") "Real attitude feedback input" annotation(
Placement(transformation(extent = {{-40, 45}, {0, 85}}), iconTransformation(origin = {0, -100}, extent = {{-20, -20}, {20, 20}}, rotation = 90)));
Modelica.Blocks.Interfaces.RealOutput MomentumsConsign[3](quantity = "Mechanics.Rotation.Torque", displayUnit = "Nm") "Desired moments output" annotation(
Placement(transformation(extent = {{90, -15}, {110, 5}}), iconTransformation(extent = {{90, -10}, {110, 10}})));
Modelica.Blocks.Interfaces.RealInput RCYawCommand(quantity = "Mechanics.Rotation.Angle", displayUnit = "rad") "RC yaw angle input" annotation(
Placement(transformation(extent = {{-80, -100}, {-40, -60}}), iconTransformation(origin = {-100, 50}, extent = {{-20, -20}, {20, 20}})));
Modelica.Blocks.Interfaces.BooleanInput SelectedControlMode "'input Boolean' as connector" annotation(
Placement(visible = true, transformation(extent = {{-164, -11}, {-124, 29}}, rotation = 0), iconTransformation(origin = {50, -100}, extent = {{-20, -20}, {20, 20}}, rotation = -270)));
AIDAModelica.ControlRollAngle controlRollAngle1(xAngularSpeedErrorModel1(Kwphi = 3), PID(k = 0.09, Ti = 1.5, Td = 0.03, Add(k1 = 1, k2 = 1, k3 = 1))) annotation(
Placement(visible = true, transformation(extent = {{49, -8}, {69, 12}}, rotation = 0)));
AIDAModelica.ControlPitchAngle controlPitchAngle1(yAngularSpeedErrorModel1(Kwteta = 1.5), PID1(Add(k1 = 1, k2 = 1, k3 = 1))) annotation(
Placement(visible = true, transformation(extent = {{49, 20}, {69, 40}}, rotation = 0)));
AIDAModelica.ControlYawAngle controlYawAngle1(PID2(k = 0.05, Ti = 2, Td = 0.03, Add(k1 = 1, k2 = 1, k3 = 1))) annotation(
Placement(visible = true, transformation(extent = {{48, -37}, {68, -17}}, rotation = 0)));
Modelica.Blocks.Logical.Switch SelectRollConsign annotation(
Placement(visible = true, transformation(extent = {{-56, -20}, {-36, 0}}, rotation = 0)));
Modelica.Blocks.Logical.Switch SelectPitchConsign annotation(
Placement(visible = true, transformation(extent = {{-56, 17}, {-36, 37}}, rotation = 0)));
Modelica.Blocks.Math.Add computeYawConsign annotation(
Placement(transformation(extent = {{-35, -75}, {-15, -55}})));
equation
connect(SelectRollConsign.u1, AttitudeConsignAP[1]) annotation(
Line(points = {{-58, -2}, {-106, -2}, {-106, 43}, {-146, 43}}, color = {0, 0, 127}, thickness = 0.0625));
connect(SelectRollConsign.u2, SelectedControlMode) annotation(
Line(points = {{-58, -10}, {-78, -10}, {-78, 9}, {-144, 9}}, color = {255, 0, 255}, thickness = 0.0625));
connect(SelectRollConsign.u3, AttitudeRCConsign[1]) annotation(
Line(points = {{-58, -18}, {-94, -18}, {-94, -25}, {-143, -25}}, color = {0, 0, 127}, thickness = 0.0625));
connect(controlRollAngle1.RollConsign, SelectRollConsign.y) annotation(
Line(points = {{49, 7}, {8, 7}, {8, -10}, {-35, -10}}, color = {0, 0, 127}));
connect(SelectPitchConsign.u1, AttitudeConsignAP[2]) annotation(
Line(points = {{-58, 35}, {-106, 35}, {-106, 43}, {-146, 43}}, color = {0, 0, 127}, thickness = 0.0625));
connect(SelectPitchConsign.u2, SelectedControlMode) annotation(
Line(points = {{-58, 27}, {-78, 27}, {-78, 9}, {-144, 9}}, color = {255, 0, 255}, thickness = 0.0625));
connect(SelectPitchConsign.u3, AttitudeRCConsign[2]) annotation(
Line(points = {{-58, 19}, {-94, 19}, {-94, -25}, {-143, -25}}, color = {0, 0, 127}, thickness = 0.0625));
connect(controlPitchAngle1.PitchCosign, SelectPitchConsign.y) annotation(
Line(points = {{49, 35}, {22, 35}, {22, 27}, {-35, 27}}, color = {0, 0, 127}));
connect(controlYawAngle1.YawConsign, computeYawConsign.y) annotation(
Line(points = {{48, -22}, {-9, -22}, {-9, -65}, {-14, -65}}, color = {0, 0, 127}));
// la sortie est soit celle caclulée par le contrôleur soit fixée selon la valeur du paramètre Test_CstMomentumActiv et Test_CstMomentumValues
MomentumsConsign[3] = if Test_CstMomentumActiv then Test_CstMomentumValues[3] else controlYawAngle1.MomentumZ;
MomentumsConsign[2] = if Test_CstMomentumActiv then Test_CstMomentumValues[2] else controlPitchAngle1.MomentumY;
MomentumsConsign[1] = if Test_CstMomentumActiv then Test_CstMomentumValues[1] else controlRollAngle1.MomentumX;
controlRollAngle1.AngularSpeedX = if Test_open_loop[1] then 0 else AngularSpeed[1] annotation(
Line(points = {{36, 18}, {-25, 18}, {-25, 35}, {-30, 35}}, color = {0, 0, 127}, thickness = 0.0625));
controlRollAngle1.Roll = if Test_open_loop[1] then 0 else Attitude[1] annotation(
Line(points = {{36, 23}, {4, 23}, {4, 36}, {-4, 36}}, color = {0, 0, 127}));
controlYawAngle1.AngularSpeedZ = if Test_open_loop[3] then 0 else AngularSpeed[3] annotation(
Line(points = {{36, -34}, {-25, -34}, {-25, 35}, {-30, 35}}, color = {0, 0, 127}, thickness = 0.0625));
controlYawAngle1.Yaw = if Test_open_loop[3] then 0 else Attitude[3] annotation(
Line(points = {{36, -29}, {2, -29}, {2, 36}, {-4, 36}}, color = {0, 0, 127}));
controlPitchAngle1.AngularSpeedY = if Test_open_loop[2] then 0 else AngularSpeed[2] annotation(
Line(points = {{36, -8}, {-25, -8}, {-25, 35}, {-30, 35}}, color = {0, 0, 127}, thickness = 0.0625));
controlPitchAngle1.Pitch = if Test_open_loop[2] then 0 else Attitude[2] annotation(
Line(points = {{36, -3}, {2, -3}, {2, 36}, {-4, 36}}, color = {0, 0, 127}));
connect(computeYawConsign.u2, RCYawCommand) annotation(
Line(points = {{-37, -71}, {-42, -71}, {-55, -71}, {-55, -80}, {-60, -80}}, color = {0, 0, 127}, thickness = 0.0625));
connect(computeYawConsign.u1, YawConsign) annotation(
Line(points = {{-37, -59}, {-42, -59}, {-55, -59}, {-55, -50}, {-60, -50}}, color = {0, 0, 127}, thickness = 0.0625));
annotation(
AttitudeConsignAP(flags = 2),
AttitudeRCConsign(flags = 2),
YawConsign(flags = 2),
AngularSpeed(flags = 2),
Attitude(flags = 2),
MomentumsConsign(flags = 2),
RCYawCommand(flags = 2),
SelectedControlMode(flags = 2),
controlRollAngle1(RollConsign(flags = 2), Roll(flags = 2), AngularSpeedX(flags = 2), MomentumX(flags = 2), xAngularSpeedErrorModel1(RollConsign(flags = 2), Roll(flags = 2), AngularSpeedX(flags = 2), AngularSpeedXError(flags = 2), ephi(flags = 2), wxd(flags = 2)), PID(u(flags = 2), y(flags = 2), P(u(flags = 2), y(flags = 2)), I(u(flags = 2), y(flags = 2)), D(u(flags = 2), y(flags = 2), x(flags = 2)), Gain(u(flags = 2), y(flags = 2)), Add(u1(flags = 2), u2(flags = 2), u3(flags = 2), y(flags = 2)))),
controlPitchAngle1(PitchCosign(flags = 2), Pitch(flags = 2), AngularSpeedY(flags = 2), MomentumY(flags = 2), yAngularSpeedErrorModel1(PitchCosign(flags = 2), Pitch(flags = 2), AngularSpeedY(flags = 2), AngularSpeedYError(flags = 2), eteta(flags = 2), wyd(flags = 2)), PID1(u(flags = 2), y(flags = 2), P(u(flags = 2), y(flags = 2)), I(u(flags = 2), y(flags = 2)), D(u(flags = 2), y(flags = 2), x(flags = 2)), Gain(u(flags = 2), y(flags = 2)), Add(u1(flags = 2), u2(flags = 2), u3(flags = 2), y(flags = 2)))),
controlYawAngle1(YawConsign(flags = 2), Yaw(flags = 2), AngularSpeedZ(flags = 2), MomentumZ(flags = 2), zAngularSpeedErrorModel1(YawCosign(flags = 2), Yaw(flags = 2), AngularSpeedZ(flags = 2), AngularSpeedZError(flags = 2), eyaw(flags = 2), wzd(flags = 2)), PID2(u(flags = 2), y(flags = 2), P(u(flags = 2), y(flags = 2)), I(u(flags = 2), y(flags = 2)), D(u(flags = 2), y(flags = 2), x(flags = 2)), Gain(u(flags = 2), y(flags = 2)), Add(u1(flags = 2), u2(flags = 2), u3(flags = 2), y(flags = 2)))),
SelectRollConsign(u1(flags = 2), u2(flags = 2), u3(flags = 2), y(flags = 2)),
SelectPitchConsign(u1(flags = 2), u2(flags = 2), u3(flags = 2), y(flags = 2)),
computeYawConsign(u1(flags = 2), u2(flags = 2), y(flags = 2)),
Icon(graphics = {Rectangle(fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid, extent = {{-100, 100}, {100, -100}}), Text(textString = "Control Attitude", fillPattern = FillPattern.None, extent = {{-29, 11}, {29, -11}}, origin = {1, 3})}),
experiment(StopTime = 30, StartTime = 0, Interval = 0.002, Tolerance = 1e-06),
__OpenModelica_simulationFlags(jacobian = "coloredNumerical", s = "dassl", lv = "LOG_STATS"));
end AttitudeControl;

151
SimulationModels/AIDAModelica/AttitudeControl_PID2.mo

@ -0,0 +1,151 @@ @@ -0,0 +1,151 @@
// CP: 65001
// SimulationX Version: 3.8.2.45319 x64
within AIDAModelica;
model AttitudeControl_PID2 "Attitude Control Model_PID2"
parameter Real k=1;
parameter Real Ti=10000;
parameter Real Td=0.0001;
Modelica.Blocks.Interfaces.RealInput AttitudeConsignAP[2](
quantity="Mechanics.Rotation.Angle",
displayUnit="rad") "Desired phi and teta angles input" annotation(Placement(
transformation(extent={{-115,5},{-75,45}}),
iconTransformation(
origin={-50,100},
extent={{-20,-20},{20,20}},
rotation=270)));
Modelica.Blocks.Interfaces.RealInput AttitudeRCConsign[2](
quantity="Mechanics.Rotation.Angle",
displayUnit="rad") "Desired phi and teta angles input sac" annotation(Placement(
transformation(extent={{-115,-55},{-75,-15}}),
iconTransformation(extent={{-120,-20},{-80,20}})));
Modelica.Blocks.Interfaces.RealInput YawConsign(
quantity="Mechanics.Rotation.Angle",
displayUnit="rad") "Desired yaw angle input" annotation(Placement(
transformation(extent={{-80,-70},{-40,-30}}),
iconTransformation(extent={{-120,-70},{-80,-30}})));
Modelica.Blocks.Interfaces.RealInput AngularSpeed[3](
quantity="Mechanics.Rotation.RotVelocity",
displayUnit="rad/s") "Real angular velocities feedback input" annotation(Placement(
transformation(extent={{-50,15},{-10,55}}),
iconTransformation(
origin={-50,-100},
extent={{-20,-20},{20,20}},
rotation=90)));
Modelica.Blocks.Interfaces.RealInput Attitude[3](
quantity="Mechanics.Rotation.Angle",
displayUnit="rad") "Real attitude feedback input" annotation(Placement(
transformation(extent={{-25,15},{15,55}}),
iconTransformation(
origin={0,-100},
extent={{-20,-20},{20,20}},
rotation=90)));
Modelica.Blocks.Interfaces.RealOutput MomentumsConsign[3](
quantity="Mechanics.Rotation.Torque",
displayUnit="Nm") "Desired moments output" annotation(Placement(
transformation(extent={{90,-15},{110,5}}),
iconTransformation(extent={{90,-10},{110,10}})));
Modelica.Blocks.Interfaces.RealInput RCYawCommand(
quantity="Mechanics.Rotation.Angle",
displayUnit="rad") "RC yaw angle input" annotation(Placement(
transformation(extent={{-80,-100},{-40,-60}}),
iconTransformation(
origin={-100,50},
extent={{-20,-20},{20,20}})));
Modelica.Blocks.Interfaces.BooleanInput SelectedControlMode "'input Boolean' as connector" annotation(Placement(
transformation(extent={{-115,-25},{-75,15}}),
iconTransformation(
origin={50,-100},
extent={{-20,-20},{20,20}},
rotation=-270)));
PID_2 controlRollAngle1(
k=k,
Ti=Ti,
Td=Td) annotation(Placement(transformation(extent={{38,13},{58,33}})));
PID_2 controlPitchAngle1(
k=k,
Ti=Ti,
Td=Td) annotation(Placement(transformation(extent={{48,-15},{68,5}})));
PID_2 controlYawAngle1(
k=k,
Ti=Ti,
Td=Td) annotation(Placement(transformation(extent={{58,-39},{78,-19}})));
Modelica.Blocks.Logical.Switch SelectRollConsign annotation(Placement(transformation(extent={{-60,0},{-40,20}})));
Modelica.Blocks.Logical.Switch SelectPitchConsign annotation(Placement(transformation(extent={{-60,-30},{-40,-10}})));
Modelica.Blocks.Math.Add add1 annotation(Placement(transformation(extent={{-35,-75},{-15,-55}})));
equation
connect(add1.y, controlYawAngle1.Consign) annotation(
Line(points = {{-14, -65}, {55, -65}, {55, -27}, {59, -27}}, color = {0, 0, 127}, thickness = 0.0625));
connect(controlYawAngle1.y, MomentumsConsign[3]) annotation(
Line(points = {{79, -29}, {95, -29}, {95, -5}, {100, -5}}, color = {0, 0, 127}, thickness = 0.0625));
connect(controlYawAngle1.du, AngularSpeed[3]) annotation(
Line(points = {{59, -33}, {-25, -33}, {-25, 35}, {-30, 35}}, color = {0, 0, 127}, thickness = 0.0625));
connect(controlYawAngle1.u, Attitude[3]) annotation(
Line(points = {{58, -23}, {0, -23}, {0, 35}, {-5, 35}}, color = {0, 0, 127}, thickness = 0.0625));
connect(SelectRollConsign.y, controlRollAngle1.Consign) annotation(
Line(points = {{-39, 10}, {15, 10}, {15, 25}, {39, 25}}, color = {0, 0, 127}, thickness = 0.0625));
connect(controlRollAngle1.y, MomentumsConsign[1]) annotation(
Line(points = {{59, 23}, {95, 23}, {95, -5}, {100, -5}}, color = {0, 0, 127}, thickness = 0.0625));
connect(controlRollAngle1.du, AngularSpeed[1]) annotation(
Line(points = {{39, 19}, {-25, 19}, {-25, 35}, {-30, 35}}, color = {0, 0, 127}, thickness = 0.0625));
connect(controlRollAngle1.u, Attitude[1]) annotation(
Line(points = {{38, 29}, {0, 29}, {0, 35}, {-5, 35}}, color = {0, 0, 127}, thickness = 0.0625));
connect(SelectPitchConsign.y, controlPitchAngle1.Consign) annotation(
Line(points = {{-39, -20}, {35, -20}, {35, -3}, {49, -3}}, color = {0, 0, 127}, thickness = 0.0625));
connect(controlPitchAngle1.y, MomentumsConsign[2]) annotation(
Line(points = {{69, -5}, {100, -5}}, color = {0, 0, 127}, thickness = 0.0625));
connect(controlPitchAngle1.du, AngularSpeed[2]) annotation(
Line(points = {{49, -9}, {-25, -9}, {-25, 35}, {-30, 35}}, color = {0, 0, 127}, thickness = 0.0625));
//controlPitchAngle1.u=0; en boucle ouverte : Ki=100 s-1, tau=0.1s
connect(controlPitchAngle1.u, Attitude[2]) annotation(
Line(points = {{48, 1}, {0, 1}, {0, 35}, {-5, 35}}, color = {0, 0, 127}, thickness = 0.0625));
connect(SelectRollConsign.u3, AttitudeRCConsign[1]) annotation(
Line(points = {{-62, 2}, {-67, 2}, {-90, 2}, {-90, -35}, {-95, -35}}, color = {0, 0, 127}, thickness = 0.0625));
connect(SelectRollConsign.u2, SelectedControlMode) annotation(
Line(points = {{-62, 10}, {-67, 10}, {-90, 10}, {-90, -5}, {-95, -5}}, color = {255, 0, 255}, thickness = 0.0625));
connect(SelectRollConsign.u1, AttitudeConsignAP[1]) annotation(
Line(points = {{-62, 18}, {-67, 18}, {-90, 18}, {-90, 25}, {-95, 25}}, color = {0, 0, 127}, thickness = 0.0625));
connect(SelectPitchConsign.u3, AttitudeRCConsign[2]) annotation(
Line(points = {{-62, -28}, {-67, -28}, {-90, -28}, {-90, -35}, {-95, -35}}, color = {0, 0, 127}, thickness = 0.0625));
connect(SelectPitchConsign.u2, SelectedControlMode) annotation(
Line(points = {{-62, -20}, {-67, -20}, {-90, -20}, {-90, -5}, {-95, -5}}, color = {255, 0, 255}, thickness = 0.0625));
connect(SelectPitchConsign.u1, AttitudeConsignAP[2]) annotation(
Line(points = {{-62, -12}, {-67, -12}, {-90, -12}, {-90, 25}, {-95, 25}}, color = {0, 0, 127}, thickness = 0.0625));
connect(add1.u1, YawConsign) annotation(
Line(points = {{-37, -59}, {-42, -59}, {-55, -59}, {-55, -50}, {-60, -50}}, color = {0, 0, 127}, thickness = 0.0625));
connect(add1.u2, RCYawCommand) annotation(
Line(points = {{-37, -71}, {-42, -71}, {-55, -71}, {-55, -80}, {-60, -80}}, color = {0, 0, 127}, thickness = 0.0625));
annotation(
AttitudeConsignAP(flags=2),
AttitudeRCConsign(flags=2),
YawConsign(flags=2),
AngularSpeed(flags=2),
Attitude(flags=2),
MomentumsConsign(flags=2),
RCYawCommand(flags=2),
SelectedControlMode(flags=2),
SelectRollConsign(
u1(flags=2),
u2(flags=2),
u3(flags=2),
y(flags=2)),
SelectPitchConsign(
u1(flags=2),
u2(flags=2),
u3(flags=2),
y(flags=2)),
add1(
u1(flags=2),
u2(flags=2),
y(flags=2)),
Icon(graphics={
Rectangle(
fillColor={255,255,255},
fillPattern=FillPattern.Solid,
extent={{-100,100},{100,-100}})}),
experiment(
StopTime=1,
StartTime=0,
Interval=0.002,
MaxInterval="0.001"));
end AttitudeControl_PID2;

35
SimulationModels/AIDAModelica/ComputationAccelerationModel.mo

@ -0,0 +1,35 @@ @@ -0,0 +1,35 @@
within AIDAModelica;
model ComputationAccelerationModel "Computation Acceleration Model"
// CP: 65001
// SimulationX Version: 3.8.2.45319 x64
Modelica.Blocks.Interfaces.RealInput TotalThrust(quantity = "Mechanics.Rotation.Torque", displayUnit = "Nm") "'input Real' as connector" annotation(
Placement(transformation(extent = {{-75, 15}, {-35, 55}}), iconTransformation(extent = {{-95, 5}, {-55, 45}})));
Modelica.Blocks.Interfaces.RealInput Attitude[3](quantity = "Mechanics.Rotation.Angle", displayUnit = "rad") "'input Real' as connector" annotation(
Placement(transformation(extent = {{-75, 55}, {-35, 95}}), iconTransformation(origin = {-25, 75}, extent = {{-20, -20}, {20, 20}})));
Modelica.Blocks.Interfaces.RealOutput DroneAcceleration[3](quantity = "Mechanics.Translation.Accel", displayUnit = "m/s²") "'output Real' as connector" annotation(
Placement(transformation(extent = {{65, -15}, {85, 5}}), iconTransformation(extent = {{61.7, -10}, {81.7, 10}})));
Modelica.Blocks.Interfaces.RealInput ExternalForce[3] "'input Real' as connector" annotation(
Placement(transformation(extent = {{-60, -40}, {-20, 0}}), iconTransformation(extent = {{-95, -45}, {-55, -5}})));
parameter Real m(quantity = "Basics.Mass", displayUnit = "kg") = 1.8 "Quadcopter mass";
parameter Real g(quantity = "Mechanics.Translation.Accel", displayUnit = "m/s²") = 9.8 "Parameter g";
parameter Real e3[3] = {0, 0, 1} "Unit vector";
Real Reb[3, 3] "From the ABCF to the EFCF rotation matrix";
Real Rz[3, 3] "Z rotation matrix";
Real Ry[3, 3] "Y rotation matrix";
Real Rx[3, 3] "X rotation matrix";
equation
// enter your equations here
Rz = {{cos(Attitude[3]), sin(Attitude[3]), 0}, {-sin(Attitude[3]), cos(Attitude[3]), 0}, {0, 0, 1}};
Ry = {{cos(Attitude[2]), 0, -sin(Attitude[2])}, {0, 1, 0}, {sin(Attitude[2]), 0, cos(Attitude[2])}};
Rx = {{1, 0, 0}, {0, cos(Attitude[1]), sin(Attitude[1])}, {0, -sin(Attitude[1]), cos(Attitude[1])}};
Reb = transpose(Rz) * transpose(Ry) * transpose(Rx);
DroneAcceleration = g * e3 - TotalThrust / m * Reb * e3 + ExternalForce / m;
annotation(
TotalThrust(flags = 2),
Attitude(flags = 2),
DroneAcceleration(flags = 2),
ExternalForce(flags = 2),
Icon(coordinateSystem(extent = {{-75, -75}, {75, 75}}, initialScale = 0.1), graphics = {Rectangle(fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid, extent = {{-76.7, 76.7}, {80, -76.7}}), Text(origin = {-6, 4}, extent = {{-12, 6}, {12, -6}}, textString = "%name")}),
experiment(StopTime = 1, StartTime = 0, Interval = 0.002, MaxInterval = "0.001"));
end ComputationAccelerationModel;

27
SimulationModels/AIDAModelica/ComputationChangeAngleVelocity.mo

@ -0,0 +1,27 @@ @@ -0,0 +1,27 @@
within AIDAModelica;
model ComputationChangeAngleVelocity "Computation ChangeAngle Velocity"
// CP: 65001
// SimulationX Version: 3.8.2.45319 x64
Modelica.Blocks.Interfaces.RealInput DronAngularVelocities[3](quantity = "Mechanics.Rotation.RotVelocity", displayUnit = "rad/s") "'input Real' as connector" annotation(
Placement(transformation(extent = {{-20, -20}, {20, 20}}), iconTransformation(extent = {{-95, 5}, {-55, 45}})));
Modelica.Blocks.Interfaces.RealInput Attitude[3](quantity = "Mechanics.Rotation.Angle", displayUnit = "rad") "'input Real' as connector" annotation(
Placement(transformation(extent = {{-20, -20}, {20, 20}}), iconTransformation(origin = {-75, -25}, extent = {{-20, -20}, {20, 20}})));
Modelica.Blocks.Interfaces.RealOutput ChangeAngleVelocity[3](quantity = "Mechanics.Rotation.RotVelocity", displayUnit = "rad/s") "'output Real' as connector" annotation(
Placement(transformation(extent = {{-10, -10}, {10, 10}}), iconTransformation(extent = {{61.7, -10}, {81.7, 10}})));
Real W[3, 3] "Matrix W";
equation
// enter your equations here
W[1, 1] = 1;
W[1, 2] = tan(Attitude[2]) * sin(Attitude[1]);
W[1, 3] = tan(Attitude[2]) * cos(Attitude[1]);
W[2, 1] = 0;
W[2, 2] = cos(Attitude[1]);
W[2, 3] = -sin(Attitude[1]);
W[3, 1] = 0;
W[3, 2] = sin(Attitude[1]) / cos(Attitude[2]);
W[3, 3] = cos(Attitude[1]) * cos(Attitude[2]);
ChangeAngleVelocity = W * DronAngularVelocities;
annotation(
Icon(coordinateSystem(extent = {{-75, -75}, {75, 75}}, initialScale = 0.1), graphics = {Rectangle(fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid, extent = {{-80, 76.7}, {76.7, -76.7}}), Text(origin = {-5, 1}, extent = {{-19, 7}, {19, -7}}, textString = "%name")}));
end ComputationChangeAngleVelocity;

40
SimulationModels/AIDAModelica/ComputeAltitudeConsign.mo

@ -0,0 +1,40 @@ @@ -0,0 +1,40 @@
within AIDAModelica;
model ComputeAltitudeConsign "[SF2.4.1] Compute altitude consign"
// CP: 65001
// SimulationX Version: 3.8.2.45319 x64
Modelica.Blocks.Interfaces.RealInput RCVerticalSpeedCommand(quantity = "Mechanics.Translation.Velocity", displayUnit = "m/s") "RC vertical speed consign" annotation(
Placement(transformation(extent = {{-150, 25}, {-110, 65}}), iconTransformation(extent = {{-120, 30}, {-80, 70}})));
Modelica.Blocks.Interfaces.RealInput VSpeed(quantity = "Mechanics.Translation.Velocity", displayUnit = "m/s") "Real drone speed feedback" annotation(
Placement(transformation(extent = {{-150, -35}, {-110, 5}}), iconTransformation(extent = {{-120, -70}, {-80, -30}})));
Modelica.Blocks.Interfaces.RealOutput AccelerationConsign(quantity = "Mechanics.Translation.Accel", displayUnit = "m/s²") "Drone acceleration consign " annotation(
Placement(transformation(extent = {{65, 25}, {85, 45}}), iconTransformation(extent = {{90, -10}, {110, 10}})));
Modelica.Blocks.Continuous.PID PID1(k = 250, Ti = 1.5, Td = 0.02, initType = Modelica.Blocks.Types.InitPID.NoInit) annotation(
Placement(transformation(extent = {{15, 25}, {35, 45}})));
AIDAModelica.SpeedErrorModelSAC speedErrorModelSAC1 annotation(
Placement(transformation(extent = {{-55, 30}, {-35, 50}})));
equation
connect(speedErrorModelSAC1.SpeedError, PID1.u) annotation(
Line(points = {{-35, 40}, {-30, 40}, {8, 40}, {8, 35}, {13, 35}}, color = {0, 0, 127}, thickness = 0.0625));
connect(RCVerticalSpeedCommand, speedErrorModelSAC1.SpeedConsign) annotation(
Line(points = {{-130, 45}, {-125, 45}, {-60, 45}, {-60, 40}, {-55, 40}}, color = {0, 0, 127}, thickness = 0.0625));
connect(VSpeed, speedErrorModelSAC1.Speed) annotation(
Line(points = {{-130, -15}, {-125, -15}, {-45, -15}, {-45, 25}, {-45, 30}}, color = {0, 0, 127}, thickness = 0.0625));
connect(PID1.y, AccelerationConsign) annotation(
Line(points = {{36, 35}, {41, 35}, {70, 35}, {75, 35}}, color = {0, 0, 127}, thickness = 0.0625));
annotation(
Speed(flags = 2),
RCVerticalSpeedCommand(flags = 2),
AccelerationConsign(flags = 2),
PID1(u(flags = 2), y(flags = 2), P(u(flags = 2), y(flags = 2)), I(u(flags = 2), y(flags = 2)), D(u(flags = 2), y(flags = 2), x(flags = 2)), Gain(u(flags = 2), y(flags = 2)), Add(u1(flags = 2), u2(flags = 2), u3(flags = 2), y(flags = 2))),
speedErrorModelSAC1(SpeedConsign(flags = 2), Speed(flags = 2), SpeedError(flags = 2), vzd(flags = 2), vz(flags = 2), ASE(flags = 2)),
Icon(graphics = {Rectangle(fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid, extent = {{-100, 100}, {100, -100}})}),
experiment(StopTime = 1, StartTime = 0, Interval = 0.002, MaxInterval = "0.001"),
Speed(flags = 2),
RCVerticalSpeedCommand(flags = 2),
AccelerationConsign(flags = 2),
PID1(u(flags = 2), y(flags = 2), P(u(flags = 2), y(flags = 2)), I(u(flags = 2), y(flags = 2)), D(u(flags = 2), y(flags = 2), x(flags = 2)), Gain(u(flags = 2), y(flags = 2)), Add(u1(flags = 2), u2(flags = 2), u3(flags = 2), y(flags = 2))),
speedErrorModelSAC1(SpeedConsign(flags = 2), Speed(flags = 2), SpeedError(flags = 2), vzd(flags = 2), vz(flags = 2), ASE(flags = 2)),
Icon(graphics = {Rectangle(fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid, extent = {{-100, 100}, {100, -100}}), Text(origin = {-1, 4}, extent = {{-35, 10}, {35, -10}}, textString = "%name")}, coordinateSystem(initialScale = 0.1)),
experiment(StopTime = 1, StartTime = 0, Interval = 0.002, MaxInterval = "0.001"));
end ComputeAltitudeConsign;

41
SimulationModels/AIDAModelica/ComputeDroneAngularsVelocities.mo

@ -0,0 +1,41 @@ @@ -0,0 +1,41 @@
within AIDAModelica;
model ComputeDroneAngularsVelocities "[SimuD4 DM] Compute drone angulars velocities"
// CP: 65001
// SimulationX Version: 3.8.2.45319
Modelica.Blocks.Interfaces.RealInput Moments[3](quantity = "Mechanics.Rotation.Torque", displayUnit = "Nm") "'input Real' as connector" annotation(
Placement(transformation(extent = {{-120, 20}, {-80, 60}}), iconTransformation(extent = {{-95, -20}, {-55, 20}})));
Modelica.Blocks.Interfaces.RealOutput DroneAngularVelocities[3](quantity = "Mechanics.Translation.Velocity", displayUnit = "m/s") "'output Real' as connector" annotation(
Placement(transformation(extent = {{90, 30}, {110, 50}}), iconTransformation(extent = {{61.7, -10}, {81.7, 10}})));
ComputationAngularAccelerationModel computationAngularAccelerationModel1 annotation(
Placement(transformation(extent = {{-40, 35}, {-25, 45}})));
Modelica.Blocks.Continuous.Integrator integrator1 annotation(
Placement(transformation(extent = {{40, 60}, {60, 80}})));
Modelica.Blocks.Continuous.Integrator integrator2 annotation(
Placement(transformation(extent = {{40, 30}, {60, 50}})));
Modelica.Blocks.Continuous.Integrator integrator3 annotation(
Placement(transformation(extent = {{40, 0}, {60, 20}})));
equation
connect(computationAngularAccelerationModel1.Moments[:], Moments[:]) annotation(
Line(points = {{-40, 40}, {-45, 40}, {-95, 40}, {-100, 40}}, color = {0, 0, 127}, thickness = 0.0625));
connect(integrator1.u, computationAngularAccelerationModel1.DroneAngularAcceleration[1]) annotation(
Line(points = {{38, 70}, {33, 70}, {-20.3, 70}, {-20.3, 40}, {-25.3, 40}}, color = {0, 0, 127}, thickness = 0.0625));
connect(integrator2.u, computationAngularAccelerationModel1.DroneAngularAcceleration[2]) annotation(
Line(points = {{38, 40}, {33, 40}, {-20.3, 40}, {-25.3, 40}}, color = {0, 0, 127}, thickness = 0.0625));
connect(integrator3.u, computationAngularAccelerationModel1.DroneAngularAcceleration[3]) annotation(
Line(points = {{38, 10}, {33, 10}, {-20.3, 10}, {-20.3, 40.3}, {-25.3, 40.3}}, color = {0, 0, 127}, thickness = 0.0625));
connect(integrator1.y, DroneAngularVelocities[1]) annotation(
Line(points = {{61, 70}, {66, 70}, {95, 70}, {95, 40}, {100, 40}}, color = {0, 0, 127}, thickness = 0.0625));
connect(integrator2.y, DroneAngularVelocities[2]) annotation(
Line(points = {{61, 40}, {66, 40}, {95, 40}, {100, 40}}, color = {0, 0, 127}, thickness = 0.0625));
connect(integrator3.y, DroneAngularVelocities[3]) annotation(
Line(points = {{61, 10}, {66, 10}, {95, 10}, {95, 40}, {100, 40}}, color = {0, 0, 127}, thickness = 0.0625));
annotation(
Moments(flags = 2),
DroneAngularVelocities(flags = 2),
integrator1(u(flags = 2), y(flags = 2)),
integrator2(u(flags = 2), y(flags = 2)),
integrator3(u(flags = 2), y(flags = 2)),
Icon(coordinateSystem(extent = {{-75, -50}, {75, 50}}, initialScale = 0.1), graphics = {Rectangle(fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid, extent = {{-76.7, 50}, {76.7, -50}}), Text(origin = {-13, 4}, extent = {{-13, 4}, {13, -4}}, textString = "%name")}),
experiment(StopTime = 1, StartTime = 0, Interval = 0.001));
end ComputeDroneAngularsVelocities;

47
SimulationModels/AIDAModelica/ComputeDroneAttitude.mo

@ -0,0 +1,47 @@ @@ -0,0 +1,47 @@
within AIDAModelica;
model ComputeDroneAttitude "[SimuD6 KM] Compute drone attitude"
// CP: 65001
// SimulationX Version: 3.8.2.45319 x64
Modelica.Blocks.Interfaces.RealInput DroneAngularVelocities[3](quantity = "Mechanics.Rotation.RotVelocity", displayUnit = "rad/s") "'input Real' as connector" annotation(
Placement(transformation(extent = {{-135, 5}, {-95, 45}}), iconTransformation(extent = {{-95, -20}, {-55, 20}})));
Modelica.Blocks.Interfaces.RealInput AttitudeFB[3](quantity = "Mechanics.Rotation.Angle", displayUnit = "rad") "'input Real' as connector" annotation(
Placement(transformation(extent = {{-135, -25}, {-95, 15}}), iconTransformation(origin = {-25, -50}, extent = {{-20, -20}, {20, 20}}, rotation = -270)));
Modelica.Blocks.Interfaces.RealOutput Attitude[3](quantity = "Mechanics.Rotation.Angle", displayUnit = "rad") "'output Real' as connector" annotation(
Placement(transformation(extent = {{75, 5}, {95, 25}}), iconTransformation(extent = {{61.7, -10}, {81.7, 10}})));
ComputationChangeAngleVelocity computationChangeAngleVelocity1 annotation(
Placement(transformation(extent = {{-60, 10}, {-45, 25}})));
Modelica.Blocks.Continuous.Integrator integrator7 annotation(
Placement(transformation(extent = {{10, 35}, {30, 55}})));
Modelica.Blocks.Continuous.Integrator integrator8 annotation(
Placement(transformation(extent = {{10, 5}, {30, 25}})));
Modelica.Blocks.Continuous.Integrator integrator9 annotation(
Placement(transformation(extent = {{10, -25}, {30, -5}})));
equation
connect(computationChangeAngleVelocity1.DronAngularVelocities[:], DroneAngularVelocities[:]) annotation(
Line(points = {{-60, 20}, {-65, 20}, {-110, 20}, {-110, 25}, {-115, 25}}, color = {0, 0, 127}, thickness = 0.0625));
connect(integrator7.u, computationChangeAngleVelocity1.ChangeAngleVelocity[1]) annotation(
Line(points = {{8, 45}, {3, 45}, {-40.3, 45}, {-40.3, 17.3}, {-45.3, 17.3}}, color = {0, 0, 127}, thickness = 0.0625));
connect(integrator8.u, computationChangeAngleVelocity1.ChangeAngleVelocity[2]) annotation(
Line(points = {{8, 15}, {3, 15}, {-40.3, 15}, {-40.3, 17.3}, {-45.3, 17.3}}, color = {0, 0, 127}, thickness = 0.0625));
connect(integrator9.u, computationChangeAngleVelocity1.ChangeAngleVelocity[3]) annotation(
Line(points = {{8, -15}, {3, -15}, {-40.3, -15}, {-40.3, 17.7}, {-45.3, 17.7}}, color = {0, 0, 127}, thickness = 0.0625));
connect(integrator7.y, Attitude[1]) annotation(
Line(points = {{31, 45}, {36, 45}, {80, 45}, {80, 15}, {85, 15}}, color = {0, 0, 127}, thickness = 0.0625));
connect(integrator8.y, Attitude[2]) annotation(
Line(points = {{31, 15}, {36, 15}, {80, 15}, {85, 15}}, color = {0, 0, 127}, thickness = 0.0625));
connect(integrator9.y, Attitude[3]) annotation(
Line(points = {{31, -15}, {36, -15}, {80, -15}, {80, 15}, {85, 15}}, color = {0, 0, 127}, thickness = 0.0625));
connect(computationChangeAngleVelocity1.Attitude[:], AttitudeFB[:]) annotation(
Line(points = {{-60, 15}, {-65, 15}, {-110, 15}, {-110, -5}, {-115, -5}}, color = {0, 0, 127}, thickness = 0.0625));
annotation(
DroneAngularVelocities(flags = 2),
AttitudeFB(flags = 2),
Attitude(flags = 2),
computationChangeAngleVelocity1(DronAngularVelocities(flags = 2), Attitude(flags = 2), ChangeAngleVelocity(flags = 2), W(flags = 2)),
integrator7(u(flags = 2), y(flags = 2)),
integrator8(u(flags = 2), y(flags = 2)),
integrator9(u(flags = 2), y(flags = 2)),
Icon(coordinateSystem(extent = {{-75, -50}, {75, 50}}, initialScale = 0.1), graphics = {Rectangle(fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid, extent = {{-76.7, 50}, {76.7, -50}}), Text(origin = {-3, 3}, extent = {{-13, 5}, {13, -5}}, textString = "%name")}),
experiment(StopTime = 1, StartTime = 0, Interval = 0.002, MaxInterval = "0.001"));
end ComputeDroneAttitude;

37
SimulationModels/AIDAModelica/ComputeDronePosition.mo

@ -0,0 +1,37 @@ @@ -0,0 +1,37 @@
within AIDAModelica;
model ComputeDronePosition "[SimuD5 KM] Compute drone position"
// CP: 65001
// SimulationX Version: 3.8.2.45319 x64
Modelica.Blocks.Interfaces.RealInput DronVelocity[3](quantity = "Mechanics.Translation.Velocity", displayUnit = "m/s") "'input Real' as connector" annotation(
Placement(transformation(extent = {{-125, -15}, {-85, 25}}), iconTransformation(extent = {{-95, -20}, {-55, 20}})));
Modelica.Blocks.Interfaces.RealOutput Position[3](quantity = "Mechanics.Translation.Displace", displayUnit = "m") "'output Real' as connector" annotation(
Placement(transformation(extent = {{50, -5}, {70, 15}}), iconTransformation(extent = {{61.7, -10}, {81.7, 10}})));
Modelica.Blocks.Continuous.Integrator integrator10(y_start = -0.5) annotation(
Placement(transformation(extent = {{-20, -35}, {0, -15}})));
Modelica.Blocks.Continuous.Integrator integrator11(y_start = 39) annotation(
Placement(transformation(extent = {{-20, -5}, {0, 15}})));
Modelica.Blocks.Continuous.Integrator integrator12 annotation(
Placement(transformation(extent = {{-20, 25}, {0, 45}})));
equation
connect(integrator12.u, DronVelocity[1]) annotation(
Line(points = {{-22, 35}, {-27, 35}, {-100, 35}, {-100, 5}, {-105, 5}}, color = {0, 0, 127}, thickness = 0.0625));
connect(integrator11.u, DronVelocity[2]) annotation(
Line(points = {{-22, 5}, {-27, 5}, {-100, 5}, {-105, 5}}, color = {0, 0, 127}, thickness = 0.0625));
connect(integrator10.u, DronVelocity[3]) annotation(
Line(points = {{-22, -25}, {-27, -25}, {-100, -25}, {-100, 5}, {-105, 5}}, color = {0, 0, 127}, thickness = 0.0625));
connect(integrator12.y, Position[1]) annotation(
Line(points = {{1, 35}, {6, 35}, {55, 35}, {55, 5}, {60, 5}}, color = {0, 0, 127}, thickness = 0.0625));
connect(integrator11.y, Position[2]) annotation(
Line(points = {{1, 5}, {6, 5}, {55, 5}, {60, 5}}, color = {0, 0, 127}, thickness = 0.0625));
connect(integrator10.y, Position[3]) annotation(
Line(points = {{1, -25}, {6, -25}, {55, -25}, {55, 5}, {60, 5}}, color = {0, 0, 127}, thickness = 0.0625));
annotation(
DronVelocity(flags = 2),
Position(flags = 2),
integrator10(u(flags = 2), y(flags = 2)),
integrator11(u(flags = 2), y(flags = 2)),
integrator12(u(flags = 2), y(flags = 2)),
Icon(coordinateSystem(extent = {{-75, -50}, {75, 50}}, initialScale = 0.1), graphics = {Rectangle(fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid, extent = {{-76.7, 50}, {76.7, -50}}), Text(origin = {-5, 1}, extent = {{-11, 5}, {11, -5}}, textString = "%name")}),
experiment(StopTime = 1, StartTime = 0, Interval = 0.001));
end ComputeDronePosition;

57
SimulationModels/AIDAModelica/ComputeDroneVelocity.mo

@ -0,0 +1,57 @@ @@ -0,0 +1,57 @@
within AIDAModelica;
model ComputeDroneVelocity "[SimuD3 DM] Compute drone velocity"
// CP: 65001
// SimulationX Version: 3.8.2.45319 x64
Modelica.Blocks.Interfaces.RealInput TotalThrust(quantity = "Mechanics.Translation.Force", displayUnit = "N") "'input Real' as connector" annotation(
Placement(transformation(extent = {{-75, 25}, {-35, 65}}), iconTransformation(extent = {{-120, 5}, {-80, 45}})));
Modelica.Blocks.Interfaces.RealOutput Accelerations[3] "Accelerations" annotation(
Placement(transformation(extent = {{70, -40}, {90, -20}}), iconTransformation(extent = {{90, -35}, {110, -15}})));
Modelica.Blocks.Interfaces.RealInput Attitude[3](quantity = "Mechanics.Rotation.Angle", displayUnit = "rad") "'input Real' as connector" annotation(
Placement(transformation(extent = {{-75, -10}, {-35, 30}}), iconTransformation(origin = {0, 50}, extent = {{-20, -20}, {20, 20}}, rotation = -90)));
Modelica.Blocks.Interfaces.RealOutput DroneVelocity[3](quantity = "Mechanics.Translation.Velocity", displayUnit = "m/s") "'output Real' as connector" annotation(
Placement(transformation(extent = {{120, 20}, {140, 40}}), iconTransformation(extent = {{90, 15}, {110, 35}})));
Modelica.Blocks.Interfaces.RealInput ExternalForce[3] annotation(
Placement(transformation(extent = {{-75, -40}, {-35, 0}}), iconTransformation(extent = {{-120, -45}, {-80, -5}})));
ComputationAccelerationModel computationAccelerationModel1 annotation(
Placement(transformation(extent = {{5, 20}, {20, 35}})));
Modelica.Blocks.Continuous.Integrator integrator4 annotation(
Placement(transformation(extent = {{70, -10}, {90, 10}})));
Modelica.Blocks.Continuous.Integrator integrator5 annotation(
Placement(transformation(extent = {{70, 20}, {90, 40}})));
Modelica.Blocks.Continuous.Integrator integrator6 annotation(
Placement(transformation(extent = {{70, 50}, {90, 70}})));
equation
connect(computationAccelerationModel1.Attitude[:], Attitude) annotation(
Line(points = {{10, 35}, {10, 40}, {-20, 40}, {-20, 10}, {-50, 10}, {-55, 10}}, color = {0, 0, 127}, thickness = 0.0625));
connect(computationAccelerationModel1.TotalThrust, TotalThrust) annotation(
Line(points = {{5, 30}, {0, 30}, {-50, 30}, {-50, 45}, {-55, 45}}, color = {0, 0, 127}, thickness = 0.0625));
connect(integrator6.u, computationAccelerationModel1.DroneAcceleration[1]) annotation(
Line(points = {{68, 60}, {63, 60}, {24.7, 60}, {24.7, 27.3}, {19.7, 27.3}}, color = {0, 0, 127}, thickness = 0.0625));
connect(integrator5.u, computationAccelerationModel1.DroneAcceleration[2]) annotation(
Line(points = {{68, 30}, {63, 30}, {24.7, 30}, {24.7, 27.3}, {19.7, 27.3}}, color = {0, 0, 127}, thickness = 0.0625));
connect(integrator4.u, computationAccelerationModel1.DroneAcceleration[3]) annotation(
Line(points = {{68, 0}, {63, 0}, {24.7, 0}, {24.7, 27.7}, {19.7, 27.7}}, color = {0, 0, 127}, thickness = 0.0625));
connect(integrator6.y, DroneVelocity[1]) annotation(
Line(points = {{91, 60}, {96, 60}, {125, 60}, {125, 30}, {130, 30}}, color = {0, 0, 127}, thickness = 0.0625));
connect(integrator5.y, DroneVelocity[2]) annotation(
Line(points = {{91, 30}, {96, 30}, {125, 30}, {130, 30}}, color = {0, 0, 127}, thickness = 0.0625));
connect(integrator4.y, DroneVelocity[3]) annotation(
Line(points = {{91, 0}, {96, 0}, {125, 0}, {125, 30}, {130, 30}}, color = {0, 0, 127}, thickness = 0.0625));
connect(computationAccelerationModel1.ExternalForce[:], ExternalForce[:]) annotation(
Line(points = {{5, 25}, {0, 25}, {-1, -20}, {-50, -20}, {-55, -20}}, color = {0, 0, 127}, thickness = 0.0625),
AutoRoute = false);
connect(computationAccelerationModel1.DroneAcceleration[:], Accelerations[:]) annotation(
Line(points = {{19.7, 27.3}, {24.7, 27.3}, {25, -30}, {75, -30}, {80, -30}}, color = {0, 0, 127}, thickness = 0.0625),
AutoRoute = false);
annotation(
TotalThrust(flags = 2),
Attitude(flags = 2),
DroneVelocity(flags = 2),
computationAccelerationModel1(TotalThrust(flags = 2), Attitude(flags = 2), DroneAcceleration(flags = 2), ExternalForce(flags = 2)),
integrator4(u(flags = 2), y(flags = 2)),
integrator5(u(flags = 2), y(flags = 2)),
integrator6(u(flags = 2), y(flags = 2)),
Icon(coordinateSystem(extent = {{-100, -50}, {100, 50}}, initialScale = 0.1), graphics = {Rectangle(fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid, extent = {{-100, 53.3}, {103.3, -53.3}}), Text(origin = {-5, -3}, extent = {{-15, 5}, {15, -5}}, textString = "%name")}),
experiment(StopTime = 1, StartTime = 0, Interval = 0.002, MaxInterval = "0.001"));
end ComputeDroneVelocity;

28
SimulationModels/AIDAModelica/ComputeMoments.mo

@ -0,0 +1,28 @@ @@ -0,0 +1,28 @@
within AIDAModelica;
model ComputeMoments "[SimuD2 CEM] Compute moments"
// CP: 65001
// SimulationX Version: 3.8.2.45319 x64
Modelica.Blocks.Interfaces.RealInput Motor1AngularVelocity(quantity = "Mechanics.Rotation.RotVelocity", displayUnit = "rpm") "'input Real' as connector" annotation(
Placement(transformation(extent = {{-20, -20}, {20, 20}}), iconTransformation(extent = {{-95, 55}, {-55, 95}})));
Modelica.Blocks.Interfaces.RealInput Motor2AngularVelocity(quantity = "Mechanics.Rotation.RotVelocity", displayUnit = "rpm") "'input Real' as connector" annotation(
Placement(transformation(extent = {{-20, -20}, {20, 20}}), iconTransformation(extent = {{-95, 5}, {-55, 45}})));
Modelica.Blocks.Interfaces.RealInput Motor3AngularVelocity(quantity = "Mechanics.Rotation.RotVelocity", displayUnit = "rpm") "'input Real' as connector" annotation(
Placement(transformation(extent = {{-20, -20}, {20, 20}}), iconTransformation(extent = {{-95, -45}, {-55, -5}})));
Modelica.Blocks.Interfaces.RealInput Motor4AngularVelocity(quantity = "Mechanics.Rotation.RotVelocity", displayUnit = "rpm") "'input Real' as connector" annotation(
Placement(transformation(extent = {{-20, -20}, {20, 20}}), iconTransformation(extent = {{-95, -95}, {-55, -55}})));
Modelica.Blocks.Interfaces.RealOutput Moments[3](quantity = "Mechanics.Rotation.Torque", displayUnit = "Nm") "'output Real' as connector" annotation(
Placement(transformation(extent = {{-10, -10}, {10, 10}}), iconTransformation(extent = {{65, -35}, {85, -15}})));
parameter Real d(quantity = "Basics.Length", displayUnit = "m") = 0.33 "Distance from body centre mass to motor centre mass";
parameter Real cT(quantity = "Mechanics.Translation.Force", displayUnit = "N") = 3.438e-7 "Parameter cT";
parameter Real coef_cT(quantity = "Mechanics.Rotation.RotVelocity", displayUnit = "rpm") = 0.10471975511965977 "Parameter";
parameter Real cM(quantity = "Mechanics.Rotation.Torque", displayUnit = "Nm") = 5.7e-9 "Parameter cM";
parameter Real coef_cM(quantity = "Mechanics.Rotation.RotVelocity", displayUnit = "rpm") = 0.10471975511965977 "Parameter";
equation
// enter your equations here
Moments[1] = d * (cT / coef_cT ^ 2) * (sqrt(2) / 2) * (Motor1AngularVelocity ^ 2 - Motor2AngularVelocity ^ 2 - Motor3AngularVelocity ^ 2 + Motor4AngularVelocity ^ 2);
Moments[2] = d * (cT / coef_cT ^ 2) * (sqrt(2) / 2) * (Motor1AngularVelocity ^ 2 + Motor2AngularVelocity ^ 2 - Motor3AngularVelocity ^ 2 - Motor4AngularVelocity ^ 2);
Moments[3] = cM / coef_cM ^ 2 * (Motor1AngularVelocity ^ 2 - Motor2AngularVelocity ^ 2 + Motor3AngularVelocity ^ 2 - Motor4AngularVelocity ^ 2);
annotation(
Icon(coordinateSystem(extent = {{-75, -125}, {75, 125}}, initialScale = 0.1), graphics = {Rectangle(fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid, extent = {{-76.7, 126.7}, {73.3, -126.7}}), Text(origin = {-6, -6}, extent = {{-16, 8}, {16, -8}}, textString = "%name")}));
end ComputeMoments;

79
SimulationModels/AIDAModelica/ComputeMotorRate.mo

@ -0,0 +1,79 @@ @@ -0,0 +1,79 @@
within AIDAModelica;
// CP: 65001
// SimulationX Version: 3.8.2.45319 x64
model ComputeMotorRate "[SF2.5] Compute thrust"
import Modelica.Math;
Modelica.Blocks.Interfaces.RealInput TotalThrust(
quantity="Mechanics.Translation.Force",
displayUnit="N") "Desired total thrust " annotation(Placement(
transformation(extent={{-20,-20},{20,20}}),
iconTransformation(extent={{-120,55},{-80,95}})));
Modelica.Blocks.Interfaces.RealInput MomentumConsign[3](
quantity="Mechanics.Rotation.Torque",
displayUnit="Nm") "Desired momentums consign" annotation(Placement(
transformation(extent={{-20,-20},{20,20}}),
iconTransformation(extent={{-120,-95},{-80,-55}})));
Modelica.Blocks.Interfaces.RealOutput Motor1Rate(
quantity="Mechanics.Rotation.RotVelocity",
displayUnit="rpm") "Desired angular speed of 1 motor" annotation(Placement(
transformation(extent={{-10,-10},{10,10}}),
iconTransformation(extent={{90,65},{110,85}})));
Modelica.Blocks.Interfaces.RealOutput Motor2Rate(
quantity="Mechanics.Rotation.RotVelocity",
displayUnit="rpm") "Desired angular speed of 2 motor" annotation(Placement(
transformation(extent={{-10,-10},{10,10}}),
iconTransformation(extent={{90,15},{110,35}})));
Modelica.Blocks.Interfaces.RealOutput Motor3Rate(
quantity="Mechanics.Rotation.RotVelocity",
displayUnit="rpm") "Desired angular speed of 3 motor " annotation(Placement(
transformation(extent={{-10,-10},{10,10}}),
iconTransformation(extent={{90,-35},{110,-15}})));
Modelica.Blocks.Interfaces.RealOutput Motor4Rate(
quantity="Mechanics.Rotation.RotVelocity",
displayUnit="rpm") "Desired angular speed of 4 motor" annotation(Placement(
transformation(extent={{-10,-10},{10,10}}),
iconTransformation(extent={{90,-85},{110,-65}})));
Real M4[4,4] "Control effectiveness model matrix M";
parameter Real d(
quantity="Basics.Length",
displayUnit="m")=0.33 "Parameter d";
parameter Real cT(
quantity="Mechanics.Translation.Force",
displayUnit="N")=3.438e-7 "Parameter cT";
parameter Real coef_cT(
quantity="Mechanics.Rotation.RotVelocity",
displayUnit="rpm")=0.10471975511965977 "coefficient cT";
parameter Real cM(
quantity="Mechanics.Rotation.Torque",
displayUnit="Nm")=5.7e-9 "Parameter cM";
parameter Real coef_cM(
quantity="Mechanics.Rotation.RotVelocity",
displayUnit="rpm")=0.10471975511965977 "coefficient cM";
Real AngVelVector[4](
quantity="Mechanics.Rotation.RotVelocity",
displayUnit="rpm") "Vector of desired angular velocities";
Real TMomVector[4] "Totat thust and moments vector";
Real ParamCosSin "Parameter Cos Sin 45";
equation
// enter your equations here
ParamCosSin = sqrt(2) / 2;
TMomVector = {TotalThrust, MomentumConsign[1], MomentumConsign[2], MomentumConsign[3]};
M4 = {{cT / coef_cT ^ 2, cT / coef_cT ^ 2, cT / coef_cT ^ 2, cT / coef_cT ^ 2}, {d * (cT / coef_cT ^ 2) * ParamCosSin, -d * (cT / coef_cT ^ 2) * ParamCosSin, -d * (cT / coef_cT ^ 2) * ParamCosSin, d * (cT / coef_cT ^ 2) * ParamCosSin}, {d * (cT / coef_cT ^ 2) * ParamCosSin, d * (cT / coef_cT ^ 2) * ParamCosSin, -d * (cT / coef_cT ^ 2) * ParamCosSin, -d * (cT / coef_cT ^ 2) * ParamCosSin}, {cM / coef_cM ^ 2, -cM / coef_cM ^ 2, cM / coef_cM ^ 2, -cM / coef_cM ^ 2}};
M4*AngVelVector = TMomVector;
Motor1Rate = sqrt(abs(AngVelVector[1]));
Motor2Rate = sqrt(abs(AngVelVector[2]));
Motor3Rate = sqrt(abs(AngVelVector[3]));
Motor4Rate = sqrt(abs(AngVelVector[4]));
annotation(Icon(
coordinateSystem(extent={{-100,-125},{100,125}}),
graphics={
Rectangle(
fillColor={255,255,255},
fillPattern=FillPattern.Solid,
extent={{-100,126.7},{103.3,-126.7}}),
Text(
textString="%name",
fillPattern=FillPattern.None,
extent={{-39,15},{39,-15}},
origin={-9,5})}));
end ComputeMotorRate;

235
SimulationModels/AIDAModelica/ComputePositionAndTime.mo

@ -0,0 +1,235 @@ @@ -0,0 +1,235 @@
// CP: 65001
// SimulationX Version: 3.8.2.45319 x64
within AIDAModelica;
model ComputePositionAndTime "Compute drone position and time "
Modelica.Blocks.Interfaces.RealOutput Drone_position[3](
quantity="Basics.Length",
displayUnit="mm") "'output Real' as connector" annotation(Placement(
transformation(extent={{-10,-10},{10,10}}),
iconTransformation(extent={{90,40},{110,60}})));
Modelica.Blocks.Interfaces.RealOutput Time(
quantity="Basics.Time",
displayUnit="s") "'output Real' as connector" annotation(Placement(
transformation(extent={{-10,-10},{10,10}}),
iconTransformation(extent={{90,-10},{110,10}})));
Modelica.Blocks.Interfaces.RealInput Measured_positioning_signal[4] "'input Real' as connector" annotation(Placement(
transformation(extent={{-20,-20},{20,20}}),
iconTransformation(extent={{-120,30},{-80,70}})));
algorithm
equation
// enter your equations here
Drone_position[1] = Measured_positioning_signal[1];
Drone_position[2] = Measured_positioning_signal[2];
Drone_position[3] = Measured_positioning_signal[3];
Time = Measured_positioning_signal[4];
annotation(Icon(graphics={
Rectangle(
fillColor={255,255,255},
fillPattern=FillPattern.Solid,
extent={{-100,100},{100,-100}}),
Bitmap(
imageSource="iVBORw0KGgoAAAANSUhEUgAAAP8AAADFCAYAAACb6SQBAAAABGdBTUEAALGPC/xhBQAAFlBJREFU
eF7tnX+MZtVZx++GWItJNeGfjWvspk1r1JSldlsrASVkK6S7m8AGcCWbbegCBYSydqmRVatBNwht
R0kjBEqLEILSsLZII+maQgEroUgwbWg1u4W/NLGlK2haqkvxej7nvc/lvHfueX/MvD+f+/0kJzPz
zjuzzDCf59c5975FKWbO333z1fLKzw1f+w9/v/zOyyeqrxJiskj+OfCJLz5fFr/3UrnxhldaV7H/
tbjOufNVyS+mhuSfE0jdtu792qsxMCA/7wsxLST/AvHcf/yozvwSX0wbyb8gkPVNfMr9aUBwYQkB
kn9BYLg37T7/0lufLa9feaD6SHQdyb8AxD4/iE/m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2}})}));
end ComputePositionAndTime;

61
SimulationModels/AIDAModelica/ComputeThrustAndAttitudeConsign.mo

@ -0,0 +1,61 @@ @@ -0,0 +1,61 @@
// CP: 65001
// SimulationX Version: 3.8.2.45319 x64
within AIDAModelica;
model ComputeThrustAndAttitudeConsign "[SF2.1.4] Compute thrust and attitude consign"
import Modelica.Math;
Modelica.Blocks.Interfaces.RealInput AccelerationConsign[3](
quantity="Mechanics.Translation.Accel",
displayUnit="m/s²") "Acceleration consign" annotation(Placement(
transformation(extent={{-20,-20},{20,20}}),
iconTransformation(extent={{-120,30},{-80,70}})));
Modelica.Blocks.Interfaces.RealInput Attitude[3](
quantity="Mechanics.Rotation.Angle",
displayUnit="rad") "Real drone attitude feedback " annotation(Placement(
transformation(extent={{-20,-20},{20,20}}),
iconTransformation(extent={{-120,-70},{-80,-30}})));
Modelica.Blocks.Interfaces.RealOutput AttitudeAPConsigns[2](
quantity="Mechanics.Rotation.Angle",
displayUnit="rad") "Desired drone attitude autopilot mode consign" annotation(Placement(
transformation(extent={{-10,-10},{10,10}}),
iconTransformation(extent={{86.7,40},{106.7,60}})));
Modelica.Blocks.Interfaces.RealOutput TotalThrustAP(
quantity="Mechanics.Translation.Force",
displayUnit="N") "Total thrust autopilot mode" annotation(Placement(
transformation(extent={{-10,-10},{10,10}}),
iconTransformation(extent={{90,-60},{110,-40}})));
Real HAC[2](
quantity="Mechanics.Translation.Velocity",
displayUnit="m/s") "Horizontal acceleration consign";
Real Rpsi[2,2] "Rpsi matrix";
Real Apsi[2,2] "Apsi martix";
Real InvApsi[2,2] "Inverse Apsi matrix";
parameter Real ConstMatr[2,2]={{0, -1}, {1, 0}} "Constant Matrix";
parameter Real g(
quantity="Mechanics.Translation.Accel",
displayUnit="m/s²")=9.8 "Parameter g";
parameter Real m(
quantity="Basics.Mass",
displayUnit="kg")=1.8 "Parameter m";
Real AAC(
quantity="Mechanics.Translation.Velocity",
displayUnit="m/s") "Altitude autopilot consign";
equation
// enter your equations here
HAC = {AccelerationConsign[1], AccelerationConsign[2]};
Rpsi = {{cos(Attitude[3]), -sin(Attitude[3])}, {sin(Attitude[3]), cos(Attitude[3])}};
Apsi = Rpsi * ConstMatr;
InvApsi = Modelica.Math.Matrices.inv(Apsi);
AttitudeAPConsigns = 1 / g * InvApsi * HAC;
AAC = AccelerationConsign[3];
TotalThrustAP = if AAC < 0 then -m * AAC else 0;
annotation(Icon(graphics={
Rectangle(
fillColor={255,255,255},
fillPattern=FillPattern.Solid,
extent={{-100,100},{100,-100}}),
Text(
textString="%name",
fillPattern=FillPattern.None,
extent={{-31,10},{31,-10}},
origin={-3,4})}));
end ComputeThrustAndAttitudeConsign;

23
SimulationModels/AIDAModelica/ComputeTotalThrust.mo

@ -0,0 +1,23 @@ @@ -0,0 +1,23 @@
within AIDAModelica;
model ComputeTotalThrust "[SimuD1 CEM] Compute total thrust"
// CP: 65001
// SimulationX Version: 3.8.2.45319 x64
Modelica.Blocks.Interfaces.RealInput Motor1AngularVelocity(quantity = "Mechanics.Rotation.RotVelocity", displayUnit = "rpm") "'input Real' as connector" annotation(
Placement(transformation(extent = {{-20, -20}, {20, 20}}), iconTransformation(extent = {{-95, 55}, {-55, 95}})));
Modelica.Blocks.Interfaces.RealInput Motor2AngularVelocity(quantity = "Mechanics.Rotation.RotVelocity", displayUnit = "rpm") "'input Real' as connector" annotation(
Placement(transformation(extent = {{-20, -20}, {20, 20}}), iconTransformation(extent = {{-95, 5}, {-55, 45}})));
Modelica.Blocks.Interfaces.RealInput Motor3AngularVelocity(quantity = "Mechanics.Rotation.RotVelocity", displayUnit = "rpm") "'input Real' as connector" annotation(
Placement(transformation(extent = {{-20, -20}, {20, 20}}), iconTransformation(extent = {{-95, -45}, {-55, -5}})));
Modelica.Blocks.Interfaces.RealInput Motor4AngularVelocity(quantity = "Mechanics.Rotation.RotVelocity", displayUnit = "rpm") "'input Real' as connector" annotation(
Placement(transformation(extent = {{-20, -20}, {20, 20}}), iconTransformation(extent = {{-95, -95}, {-55, -55}})));
Modelica.Blocks.Interfaces.RealOutput TotalThrust(quantity = "Mechanics.Translation.Force", displayUnit = "N") "'output Real' as connector" annotation(
Placement(transformation(extent = {{-10, -10}, {10, 10}}), iconTransformation(extent = {{65, 15}, {85, 35}})));
parameter Real cT(quantity = "Mechanics.Translation.Force", displayUnit = "N") = 3.438e-7 "parameter cT";
parameter Real coef_cT(quantity = "Mechanics.Rotation.RotVelocity", displayUnit = "rpm") = 0.10471975511965977 "parameter";
equation
// enter your equations here
TotalThrust = cT / coef_cT ^ 2 * (Motor1AngularVelocity ^ 2 + Motor2AngularVelocity ^ 2 + Motor3AngularVelocity ^ 2 + Motor4AngularVelocity ^ 2);
annotation(
Icon(coordinateSystem(extent = {{-75, -125}, {75, 125}}, initialScale = 0.1), graphics = {Rectangle(fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid, extent = {{-76.7, 126.7}, {76.7, -126.7}}), Text(origin = {-2, -3}, extent = {{-12, 9}, {12, -9}}, textString = "%name")}));
end ComputeTotalThrust;

57
SimulationModels/AIDAModelica/ComputeTotalThrustCA.mo

@ -0,0 +1,57 @@ @@ -0,0 +1,57 @@
// CP: 65001
// SimulationX Version: 3.8.2.45319 x64
within AIDAModelica;
model ComputeTotalThrustCA "[SF2.4.2] Compute total thrust"
Modelica.Blocks.Interfaces.RealInput AccelerationConsign(
quantity="Mechanics.Translation.Accel",
displayUnit="m/s²") "Acceleration consign" annotation(Placement(
transformation(extent={{-20,-20},{20,20}}),
iconTransformation(extent={{-120,-20},{-80,20}})));
Modelica.Blocks.Interfaces.RealOutput TotalThrustAP(
quantity="Mechanics.Translation.Force",
displayUnit="N") "Total thrust autopilot mode" annotation(Placement(
transformation(extent={{-10,-10},{10,10}}),
iconTransformation(extent={{90,-10},{110,10}})));
parameter Real m(
quantity="Basics.Mass",
displayUnit="kg")=1.8 "Parameter m";
Real AC(
quantity="Mechanics.Translation.Velocity",
displayUnit="m/s") "Altitude consign";
parameter Real N=-1 "Acceleration linear threshold";
equation
// enter your equations here
AC = AccelerationConsign;
//TotalThrustAP =if AC<0 then -m*AC else 0;
//to prevent loss of attitude control due to a nul thrust
TotalThrustAP =if AC<N then -m*AC else -m*N*exp(1/N*(AC-N));
annotation(
Icon(graphics={
Rectangle(
fillColor={255,255,255},
fillPattern=FillPattern.Solid,
extent={{-100,100},{100,-100}}),
Text(
textString="* m",
fillPattern=FillPattern.None,
extent={{-70,26.7},{73.3,-30}}),
Line(
points={{-3.3,76.7},{-3.3,76.7},{0,-76.7}},
color={192,192,192},
arrow={Arrow.Filled,Arrow.None}),
Line(
points={{-1.1,51.1},{-1.1,51.1},{8.4,-104.1}},
color={192,192,192},
arrow={Arrow.Filled,Arrow.None},
origin={24.4,-63.7},
rotation=-93),
Line(
points={{-81.09999999999999,95.59999999999999},{8.9,-47.8},{72.2,-47.8}},
origin={-8.9,-18.9})}),
experiment(
StopTime=1,
StartTime=0,
Interval=0.002,
MaxInterval="0.001"));
end ComputeTotalThrustCA;

33
SimulationModels/AIDAModelica/ComputeTotalThrustMM.mo

@ -0,0 +1,33 @@ @@ -0,0 +1,33 @@
// CP: 65001
// SimulationX Version: 3.8.2.45319 x64
within AIDAModelica;
model ComputeTotalThrustMM "[SF2.4.2] Compute total thrust"
Modelica.Blocks.Interfaces.RealInput SpeedConsign(
quantity="Mechanics.Translation.Accel",
displayUnit="m/s²") "Speed consign" annotation(Placement(
transformation(extent={{-20,-20},{20,20}}),
iconTransformation(extent={{-120,-20},{-80,20}})));
Modelica.Blocks.Interfaces.RealOutput TotalThrustManualConsign(
quantity="Mechanics.Translation.Force",
displayUnit="N") "Total thrust manual mode" annotation(Placement(
transformation(extent={{-10,-10},{10,10}}),
iconTransformation(extent={{90,-10},{110,10}})));
parameter Real g(
quantity="Mechanics.Translation.Accel",
displayUnit="m/s²")=9.8 "Parameter g";
parameter Real m(
quantity="Basics.Mass",
displayUnit="kg")=1.8 "Parameter m";
Real AC(
quantity="Mechanics.Translation.Velocity",
displayUnit="m/s") "Altitude consign";
equation
// enter your equations here
AC = SpeedConsign;
TotalThrustManualConsign = m*(g+AC);
annotation(Icon(graphics={
Rectangle(
fillColor={255,255,255},
fillPattern=FillPattern.Solid,
extent={{-100,100},{100,-100}})}));
end ComputeTotalThrustMM;

92
SimulationModels/AIDAModelica/ControlAltitude.mo

@ -0,0 +1,92 @@ @@ -0,0 +1,92 @@
// CP: 65001
// SimulationX Version: 3.8.2.45319 x64
within AIDAModelica;
model ControlAltitude "[SF2.4] Control altitude"
Modelica.Blocks.Interfaces.RealOutput TotalThrustManual(
quantity="Mechanics.Translation.Force",
displayUnit="N") "Desired total thrust autopilot mode output" annotation(Placement(
transformation(extent={{20,20},{40,40}}),
iconTransformation(
origin={100,0},
extent={{-10,-10},{10,10}})));
Modelica.Blocks.Interfaces.RealInput VSpeed(
quantity="Mechanics.Translation.Velocity",
displayUnit="m/s") "Real drone speed feedback" annotation(Placement(
transformation(extent={{-105,-5},{-65,35}}),
iconTransformation(extent={{-120,30},{-80,70}})));
Modelica.Blocks.Interfaces.RealInput RCVerticalSpeedCommand(
quantity="Mechanics.Translation.Velocity",
displayUnit="m/s") "'input Real' as connector" annotation(Placement(
transformation(extent={{-105,25},{-65,65}}),
iconTransformation(
origin={-100,-50},
extent={{-20,-20},{20,20}})));
ComputeTotalThrustCA computeTotalThrustCA1 annotation(Placement(transformation(extent={{-10,20},{10,40}})));
ComputeAltitudeConsign computeAltitudeConsign1 annotation(Placement(transformation(extent={{-55,20},{-35,40}})));
equation
connect(computeAltitudeConsign1.VSpeed,VSpeed) annotation(Line(
points={{-54,26},{-76,26},{-76,16},{-84,16}},
color={0,0,127}));
connect(computeTotalThrustCA1.AccelerationConsign,computeAltitudeConsign1.AccelerationConsign) annotation(Line(
points={{-10,30},{-15,30},{-30,30},{-35,30}},
color={0,0,127},
thickness=0.0625));
connect(computeAltitudeConsign1.RCVerticalSpeedCommand,RCVerticalSpeedCommand) annotation(Line(
points={{-55,35},{-60,35},{-80,35},{-80,45},{-85,45}},
color={0,0,127},
thickness=0.0625));
connect(computeTotalThrustCA1.TotalThrustAP,TotalThrustManual) annotation(Line(
points={{10,30},{15,30},{25,30},{30,30}},
color={0,0,127},
thickness=0.0625));
annotation(
Speed(flags=2),
TotalThrustManual(flags=2),
RCVerticalSpeedCommand(flags=2),
computeTotalThrustCA1(
AccelerationConsign(flags=2),
TotalThrustAP(flags=2),
AC(flags=2)),
computeAltitudeConsign1(
RCVerticalSpeedCommand(flags=2),
AccelerationConsign(flags=2),
PID1(
u(flags=2),
y(flags=2),
P(
u(flags=2),
y(flags=2)),
I(
u(flags=2),
y(flags=2)),
D(
u(flags=2),
y(flags=2),
x(flags=2)),
Gain(
u(flags=2),
y(flags=2)),
Add(
u1(flags=2),
u2(flags=2),
u3(flags=2),
y(flags=2))),
speedErrorModelSAC1(
SpeedConsign(flags=2),
Speed(flags=2),
SpeedError(flags=2),
vzd(flags=2),
vz(flags=2),
ASE(flags=2))),
Icon(graphics={
Rectangle(
fillColor={255,255,255},
fillPattern=FillPattern.Solid,
extent={{-100,100},{100,-100}})}),
experiment(
StopTime=1,
StartTime=0,
Interval=0.002,
MaxInterval="0.001"));
end ControlAltitude;

44
SimulationModels/AIDAModelica/ControlAltitudeEx.mo

@ -0,0 +1,44 @@ @@ -0,0 +1,44 @@
within AIDAModelica;
model ControlAltitudeEx "[SF2.4] Control altitude Ex"
// CP: 65001
// SimulationX Version: 3.8.2.45319 x64
Modelica.Blocks.Interfaces.RealOutput TotalThrustManual(quantity = "Mechanics.Translation.Force", displayUnit = "N") "Desired total thrust autopilot mode output" annotation(
Placement(transformation(extent = {{80, -20}, {100, 0}}), iconTransformation(origin = {100, 0}, extent = {{-10, -10}, {10, 10}})));
Modelica.Blocks.Interfaces.RealInput VSpeed(quantity = "Mechanics.Translation.Velocity", displayUnit = "m/s") "Real drone speed feedback" annotation(
Placement(transformation(extent = {{-145, -15}, {-105, 25}}), iconTransformation(origin = {-50, -100}, extent = {{-20, -20}, {20, 20}}, rotation = 90)));
Modelica.Blocks.Interfaces.RealInput RCVerticalSpeedCommand(quantity = "Mechanics.Translation.Velocity", displayUnit = "m/s") "'input Real' as connector" annotation(
Placement(transformation(extent = {{-145, 35}, {-105, 75}}), iconTransformation(origin = {-100, 0}, extent = {{-20, -20}, {20, 20}})));
Modelica.Blocks.Interfaces.RealInput Acceleration(quantity = "Acceleration", displayUnit = "m/s²") "To prevent PID derivation of speed" annotation(
Placement(transformation(extent = {{-125, -75}, {-85, -35}}), iconTransformation(origin = {50, -100}, extent = {{-20, -20}, {20, 20}}, rotation = 90)));
ComputeTotalThrustCA computeTotalThrustCA1 annotation(
Placement(transformation(extent = {{25, -20}, {45, 0}})));
AIDAModelica.ComputeAltitudeConsign computeAltitudeConsign1 annotation(
Placement(visible = true, transformation(extent = {{-11, 28}, {9, 48}}, rotation = 0)));
PID_2 pID_2 annotation(
Placement(transformation(extent = {{-15, -20}, {5, 0}})));
equation
connect(computeAltitudeConsign1.VSpeed, VSpeed) annotation(
Line(points = {{-11, 33}, {-120, 33}, {-120, 5}, {-125, 5}}, color = {0, 0, 127}));
connect(computeAltitudeConsign1.RCVerticalSpeedCommand, RCVerticalSpeedCommand) annotation(
Line(points = {{-11, 43}, {-120, 43}, {-120, 55}, {-125, 55}}, color = {0, 0, 127}, thickness = 0.0625));
connect(computeTotalThrustCA1.TotalThrustAP, TotalThrustManual) annotation(
Line(points = {{45, -10}, {50, -10}, {85, -10}, {90, -10}}, color = {0, 0, 127}, thickness = 0.0625));
connect(RCVerticalSpeedCommand, pID_2.Consign) annotation(
Line(points = {{-125, 55}, {-120, 55}, {-20, 55}, {-20, -10}, {-15, -10}}, color = {0, 0, 127}, thickness = 0.0625));
connect(VSpeed, pID_2.u) annotation(
Line(points = {{-125, 5}, {-120, 5}, {-120, -25}, {-10, -25}, {-10, -20}}, color = {0, 0, 127}, thickness = 0.0625));
connect(Acceleration, pID_2.du) annotation(
Line(points = {{-105, -55}, {-100, -55}, {0, -55}, {0, -25}, {0, -20}}, color = {0, 0, 127}, thickness = 0.0625));
connect(pID_2.y, computeTotalThrustCA1.AccelerationConsign) annotation(
Line(points = {{6, -10}, {11, -10}, {20, -10}, {25, -10}}, color = {0, 0, 127}, thickness = 0.0625));
annotation(
Speed(flags = 2),
TotalThrustManual(flags = 2),
RCVerticalSpeedCommand(flags = 2),
computeTotalThrustCA1(AccelerationConsign(flags = 2), TotalThrustAP(flags = 2), AC(flags = 2)),
computeAltitudeConsign1(RCVerticalSpeedCommand(flags = 2), AccelerationConsign(flags = 2), PID1(u(flags = 2), y(flags = 2), P(u(flags = 2), y(flags = 2)), I(u(flags = 2), y(flags = 2)), D(u(flags = 2), y(flags = 2), x(flags = 2)), Gain(u(flags = 2), y(flags = 2)), Add(u1(flags = 2), u2(flags = 2), u3(flags = 2), y(flags = 2))), speedErrorModelSAC1(SpeedConsign(flags = 2), Speed(flags = 2), SpeedError(flags = 2), vzd(flags = 2), vz(flags = 2), ASE(flags = 2))),
Icon(graphics = {Rectangle(fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid, extent = {{-100, 100}, {100, -100}}), Text(origin = {0, 3}, extent = {{-40, 13}, {40, -13}}, textString = "Control Altitude")}, coordinateSystem(initialScale = 0.1)),
experiment(StopTime = 1, StartTime = 0, Interval = 0.002, MaxInterval = "0.001"),
Diagram(graphics = {Text(origin = {26, 54}, extent = {{-8, 4}, {72, -26}}, textString = "Initial solution, with no acceleration as input"), Text(origin = {32, 27}, extent = {{-10, -3}, {76, 23}}, textString = "Need for speed derivation, bad choice in cosimulation")}));
end ControlAltitudeEx;

54
SimulationModels/AIDAModelica/ControlDroneNavigation.mo

@ -0,0 +1,54 @@ @@ -0,0 +1,54 @@
within AIDAModelica;
model ControlDroneNavigation "[SF4] Control drone navigation"
// CP: 65001
// SimulationX Version: 3.8.2.45319 x64
Modelica.Blocks.Interfaces.RealOutput YawConsign(quantity = "Mechanics.Rotation.Angle", displayUnit = "rad") "Yaw consign" annotation(
Placement(transformation(extent = {{45, -15}, {65, 5}}), iconTransformation(extent = {{90, -10}, {110, 10}})));
Modelica.Blocks.Interfaces.RealOutput DronPositionConsign[3](quantity = "Mechanics.Translation.Displace", displayUnit = "m") "Dron position consign" annotation(
Placement(transformation(extent = {{0, 20}, {20, 40}}), iconTransformation(extent = {{90, 40}, {110, 60}})));
Modelica.Blocks.Interfaces.BooleanInput APEngagement "'input Boolean' as connector" annotation(
Placement(visible = true,transformation(extent = {{-113, -63}, {-73, -23}}, rotation = 0), iconTransformation(extent = {{-120, 30}, {-80, 70}}, rotation = 0)));
Modelica.Blocks.Interfaces.BooleanOutput SelectedControlMode "'output Boolean' as connector" annotation(
Placement(transformation(extent = {{10, -45}, {30, -25}}), iconTransformation(extent = {{90, -60}, {110, -40}})));
Modelica.Blocks.Interfaces.BooleanInput IndicatorYawConsign "'input Boolean' as connector" annotation(
Placement(visible = true,transformation(extent = {{-118, 5}, {-78, 45}}, rotation = 0), iconTransformation(extent = {{-120, -20}, {-80, 20}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealInput Yaw "'input Real' as connector" annotation(
Placement(transformation(extent = {{-120, -35}, {-80, 5}}), iconTransformation(extent = {{-120, -70}, {-80, -30}})));
AIDAModelica.RunFlightPlan runFlightPlan1 annotation(
Placement(transformation(extent = {{-42, 19}, {-22, 39}})));
Modelica.Blocks.Logical.Switch SelectYawConsign annotation(
Placement(transformation(extent = {{10, -15}, {30, 5}})));
AIDAModelica.YawConsignProducing yawConsignProducing1 annotation(
Placement(transformation(extent = {{-48, -20}, {-28, 0}})));
equation
connect(yawConsignProducing1.YRC, APEngagement) annotation(
Line(points = {{-48, -4}, {-80, -4}, {-80, -42}, {-92, -42}}, color = {255, 0, 255}));
connect(SelectYawConsign.u2, APEngagement) annotation(
Line(points = {{8, -5}, {-22, -5}, {-22, -43}, {-93, -43}}, color = {255, 0, 255}));
connect(APEngagement, SelectedControlMode) annotation(
Line(points = {{-93, -43}, {-22, -43}, {-22, -34}, {20, -34}}, color = {255, 0, 255}));
connect(yawConsignProducing1.Yaw, Yaw) annotation(
Line(points = {{-48, -15}, {-100, -15}}, color = {0, 0, 127}, thickness = 0.0625));
connect(runFlightPlan1.DronPositionConsign[:], DronPositionConsign[:]) annotation(
Line(points = {{-22, 34}, {-4, 34}, {-4, 30}, {10, 30}}, color = {0, 0, 127}, thickness = 0.0625));
connect(SelectYawConsign.y, YawConsign) annotation(
Line(points = {{31, -5}, {36, -5}, {50, -5}, {55, -5}}, color = {0, 0, 127}, thickness = 0.0625));
connect(yawConsignProducing1.DesiredYaw, SelectYawConsign.u3) annotation(
Line(points = {{-28, -10}, {3, -10}, {3, -13}, {8, -13}}, color = {0, 0, 127}, thickness = 0.0625));
connect(SelectYawConsign.u1, runFlightPlan1.YawConsign) annotation(
Line(points = {{8, 3}, {3, 3}, {-17, 3}, {-17, 24}, {-22, 24}}, color = {0, 0, 127}));
annotation(
selectControlMode1(SelectedControlMode(flags = 2), APEngagement(flags = 2), Main_State(flags = 2)),
YawConsign(flags = 2),
DronPositionConsign(flags = 2),
APEngagement(flags = 2),
SelectedControlMode(flags = 2),
IndicatorYawConsign(flags = 2),
Yaw(flags = 2),
runFlightPlan1(DronPositionConsign(flags = 2), YawConsign(flags = 2), X_coordinate_map(u(flags = 2), y(flags = 2)), timeSource1(TimeOutput(flags = 2)), Y_coordinate_map(u(flags = 2), y(flags = 2)), Z_coordinate_map(u(flags = 2), y(flags = 2)), YawAngle(u(flags = 2), y(flags = 2))),
SelectYawConsign(u1(flags = 2), u2(flags = 2), u3(flags = 2), y(flags = 2)),
yawConsignProducing1(Yaw(flags = 2), DesiredYaw(flags = 2), YRC(flags = 2), YawOld(flags = 2)),
Icon(graphics = {Rectangle(fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid, extent = {{-103.3, 100}, {100, -100}}), Text(origin = {-7, 2}, extent = {{-49, 10}, {49, -10}}, textString = "%name")}, coordinateSystem(initialScale = 0.1)),
experiment(StopTime = 1, StartTime = 0, Interval = 0.002, MaxInterval = "0.001"));
end ControlDroneNavigation;

54
SimulationModels/AIDAModelica/ControlEffectivenessModel.mo

@ -0,0 +1,54 @@ @@ -0,0 +1,54 @@
within AIDAModelica;
model ControlEffectivenessModel "Control effectiveness model"
// CP: 65001
// SimulationX Version: 3.8.2.45319 x64
Modelica.Blocks.Interfaces.RealInput Motor1AngularVelocity(quantity = "Mechanics.Rotation.RotVelocity", displayUnit = "rpm") "Angular velocity of 1 motor input" annotation(
Placement(transformation(extent = {{-135, 40}, {-95, 80}}), iconTransformation(extent = {{-120, 55}, {-80, 95}})));
Modelica.Blocks.Interfaces.RealInput Motor2AngularVelocity(quantity = "Mechanics.Rotation.RotVelocity", displayUnit = "rpm") "Angular velocity of 2 motor input" annotation(
Placement(transformation(extent = {{-135, 10}, {-95, 50}}), iconTransformation(extent = {{-120, 5}, {-80, 45}})));
Modelica.Blocks.Interfaces.RealInput Motor3AngularVelocity(quantity = "Mechanics.Rotation.RotVelocity", displayUnit = "rpm") "Angular velocity of 3 motor input" annotation(
Placement(transformation(extent = {{-135, -20}, {-95, 20}}), iconTransformation(extent = {{-120, -45}, {-80, -5}})));
Modelica.Blocks.Interfaces.RealInput Motor4AngularVelocity(quantity = "Mechanics.Rotation.RotVelocity", displayUnit = "rpm") "Angular velocity of 4 motor input" annotation(
Placement(transformation(extent = {{-135, -50}, {-95, -10}}), iconTransformation(extent = {{-120, -95}, {-80, -55}})));
Modelica.Blocks.Interfaces.RealOutput TotalThrust(quantity = "Mechanics.Translation.Force", displayUnit = "N") "Total thrust output" annotation(
Placement(transformation(extent = {{55, -35}, {75, -15}}), iconTransformation(extent = {{90, 65}, {110, 85}})));
Modelica.Blocks.Interfaces.RealOutput Moments[3](quantity = "Mechanics.Rotation.Torque", displayUnit = "Nm") "Moments output" annotation(
Placement(transformation(extent = {{55, 45}, {75, 65}}), iconTransformation(extent = {{90, -85}, {110, -65}})));
ComputeMoments computeMoments1 annotation(
Placement(transformation(extent = {{-20, 45}, {-5, 70}})));
ComputeTotalThrust computeTotalThrust1 annotation(
Placement(transformation(extent = {{-20, -40}, {-5, -15}})));
equation
connect(computeMoments1.Motor1AngularVelocity, Motor1AngularVelocity) annotation(
Line(points = {{-20, 65}, {-25, 65}, {-110, 65}, {-110, 60}, {-115, 60}}, color = {0, 0, 127}, thickness = 0.0625));
connect(computeMoments1.Motor2AngularVelocity, Motor2AngularVelocity) annotation(
Line(points = {{-20, 60}, {-25, 60}, {-110, 60}, {-110, 30}, {-115, 30}}, color = {0, 0, 127}, thickness = 0.0625));
connect(computeMoments1.Motor3AngularVelocity, Motor3AngularVelocity) annotation(
Line(points = {{-20, 55}, {-25, 55}, {-110, 55}, {-110, 0}, {-115, 0}}, color = {0, 0, 127}, thickness = 0.0625));
connect(computeMoments1.Motor4AngularVelocity, Motor4AngularVelocity) annotation(
Line(points = {{-20, 50}, {-25, 50}, {-110, 50}, {-110, -30}, {-115, -30}}, color = {0, 0, 127}, thickness = 0.0625));
connect(computeTotalThrust1.Motor1AngularVelocity, Motor1AngularVelocity) annotation(
Line(points = {{-20, -20}, {-25, -20}, {-110, -20}, {-110, 60}, {-115, 60}}, color = {0, 0, 127}, thickness = 0.0625));
connect(computeTotalThrust1.Motor2AngularVelocity, Motor2AngularVelocity) annotation(
Line(points = {{-20, -25}, {-25, -25}, {-110, -25}, {-110, 30}, {-115, 30}}, color = {0, 0, 127}, thickness = 0.0625));
connect(computeTotalThrust1.Motor3AngularVelocity, Motor3AngularVelocity) annotation(
Line(points = {{-20, -30}, {-25, -30}, {-110, -30}, {-110, 0}, {-115, 0}}, color = {0, 0, 127}, thickness = 0.0625));
connect(computeTotalThrust1.Motor4AngularVelocity, Motor4AngularVelocity) annotation(
Line(points = {{-20, -35}, {-25, -35}, {-110, -35}, {-110, -30}, {-115, -30}}, color = {0, 0, 127}, thickness = 0.0625));
connect(computeMoments1.Moments[:], Moments[:]) annotation(
Line(points = {{-5, 55}, {0, 55}, {60, 55}, {65, 55}}, color = {0, 0, 127}, thickness = 0.0625));
connect(computeTotalThrust1.TotalThrust, TotalThrust) annotation(
Line(points = {{-5, -25}, {0, -25}, {60, -25}, {65, -25}}, color = {0, 0, 127}, thickness = 0.0625));
annotation(
Motor1AngularVelocity(flags = 2),
Motor2AngularVelocity(flags = 2),
Motor3AngularVelocity(flags = 2),
Motor4AngularVelocity(flags = 2),
TotalThrust(flags = 2),
Moments(flags = 2),
computeMoments1(Motor1AngularVelocity(flags = 2), Motor2AngularVelocity(flags = 2), Motor3AngularVelocity(flags = 2), Motor4AngularVelocity(flags = 2), Moments(flags = 2)),
computeTotalThrust1(Motor1AngularVelocity(flags = 2), Motor2AngularVelocity(flags = 2), Motor3AngularVelocity(flags = 2), Motor4AngularVelocity(flags = 2), TotalThrust(flags = 2)),
Icon(coordinateSystem(extent = {{-100, -125}, {100, 125}}, initialScale = 0.1), graphics = {Rectangle(fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid, extent = {{-100, 106.7}, {100, -106.7}}), Text(origin = {-7, 3}, extent = {{-15, 11}, {15, -11}}, textString = "%name")}),
experiment(StopTime = 10, StartTime = 0, Interval = 0.02, MaxInterval = "0.001"));
end ControlEffectivenessModel;

17
SimulationModels/AIDAModelica/ControlMotor.mo

@ -0,0 +1,17 @@ @@ -0,0 +1,17 @@
within AIDAModelica;
model ControlMotor "[SF1.1/2/3/4.1] Control motor"
// CP: 65001
// SimulationX Version: 3.8.2.45319 x64
Modelica.Blocks.Interfaces.RealInput DAngVel(quantity = "Mechanics.Rotation.RotVelocity", displayUnit = "rpm") "Desired angular velocity" annotation(
Placement(transformation(extent = {{-20, -20}, {20, 20}}), iconTransformation(extent = {{-120, -20}, {-80, 20}})));
Modelica.Blocks.Interfaces.RealOutput ComdKD "Desired command of k-ht motor" annotation(
Placement(transformation(extent = {{-10, -10}, {10, 10}}), iconTransformation(extent = {{90, -10}, {110, 10}})));
parameter Real cR(quantity = "Mechanics.Rotation.RotVelocity", displayUnit = "rpm") = 626.51735092990043 "Parameter cR";
parameter Real wb(quantity = "Mechanics.Rotation.RotVelocity", displayUnit = "rpm") = 222.30956814352572 "Parameter wb";
equation
// enter your equations here
ComdKD = (DAngVel - wb) / cR;
annotation(
Icon(graphics = {Rectangle(fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid, extent = {{-100, 100}, {103.3, -100}}), Text(origin = {-7, 44}, extent = {{-39, 12}, {39, -12}}, textString = "%name")}, coordinateSystem(initialScale = 0.1)));
end ControlMotor;

38
SimulationModels/AIDAModelica/ControlPitchAngle.mo

@ -0,0 +1,38 @@ @@ -0,0 +1,38 @@
within AIDAModelica;
model ControlPitchAngle "[SF2.3.3] Control pitch angle"
// CP: 65001
// SimulationX Version: 3.8.2.45319 x64
Modelica.Blocks.Interfaces.RealInput PitchCosign(quantity = "Mechanics.Rotation.Angle", displayUnit = "rad") "Choosed pitch consign" annotation(
Placement(transformation(extent = {{-105, 60}, {-65, 100}}), iconTransformation(extent = {{-120, 30}, {-80, 70}})));
Modelica.Blocks.Interfaces.RealInput Pitch(quantity = "Mechanics.Rotation.Angle", displayUnit = "rad") "Real drone pitch angle feedback" annotation(
Placement(transformation(extent = {{-105, 15}, {-65, 55}}), iconTransformation(extent = {{-120, -20}, {-80, 20}})));
Modelica.Blocks.Interfaces.RealInput AngularSpeedY(quantity = "Mechanics.Rotation.RotVelocity", displayUnit = "rad/s") "Real drone angular Y speed feedback" annotation(
Placement(transformation(extent = {{-135, -25}, {-95, 15}}), iconTransformation(extent = {{-120, -70}, {-80, -30}})));
Modelica.Blocks.Interfaces.RealOutput MomentumY(quantity = "Mechanics.Rotation.Torque", displayUnit = "Nm") "Desired momentum at axe Y" annotation(
Placement(transformation(extent = {{107, -19}, {127, 1}}), iconTransformation(extent = {{90, -10}, {110, 10}})));
YAngularSpeedErrorModel yAngularSpeedErrorModel1 annotation(
Placement(transformation(extent = {{-25, 25}, {-5, 45}})));
Modelica.Blocks.Continuous.PID PID1(k = 0.09, Ti = 1.5, Td = 0.03, initType = Modelica.Blocks.Types.InitPID.InitialState, Add(k1 = -1, k2 = -1, k3 = -1)) annotation(
Placement(transformation(extent = {{16, 25}, {36, 45}})));
equation
connect(AngularSpeedY, yAngularSpeedErrorModel1.AngularSpeedY) annotation(
Line(points = {{-115, -5}, {-110, -5}, {-30, -5}, {-30, 30}, {-25, 30}}, color = {0, 0, 127}));
connect(PID1.u, yAngularSpeedErrorModel1.AngularSpeedYError) annotation(
Line(points = {{14, 35}, {-5.3, 35}}, color = {0, 0, 127}, thickness = 0.0625));
connect(yAngularSpeedErrorModel1.PitchCosign, PitchCosign) annotation(
Line(points = {{-25, 40}, {-80, 40}, {-80, 80}, {-85, 80}}, color = {0, 0, 127}, thickness = 0.0625));
connect(yAngularSpeedErrorModel1.Pitch, Pitch) annotation(
Line(points = {{-25, 35}, {-30, 35}, {-80, 35}, {-85, 35}}, color = {0, 0, 127}, thickness = 0.0625));
connect(PID1.y, MomentumY) annotation(
Line(points = {{37, 35}, {42, 35}, {112, 35}, {112, -9}, {117, -9}}, color = {0, 0, 127}, thickness = 0.0625));
annotation(
PitchCosign(flags = 2),
Pitch(flags = 2),
AngularSpeedY(flags = 2),
MomentumY(flags = 2),
yAngularSpeedErrorModel1(PitchCosign(flags = 2), Pitch(flags = 2), AngularSpeedY(flags = 2), AngularSpeedYError(flags = 2), eteta(flags = 2), wyd(flags = 2)),
PID1(u(flags = 2), y(flags = 2), P(u(flags = 2), y(flags = 2)), I(u(flags = 2), y(flags = 2)), D(u(flags = 2), y(flags = 2), x(flags = 2)), Gain(u(flags = 2), y(flags = 2)), Add(u1(flags = 2), u2(flags = 2), u3(flags = 2), y(flags = 2))),
Icon(graphics = {Rectangle(fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid, extent = {{-100, 100}, {100, -100}}), Text(textString = "%name", fillPattern = FillPattern.None, extent = {{-12, 8}, {12, -8}}, origin = {-4, 0})}),
experiment(StopTime = 1, StartTime = 0, Interval = 0.002, MaxInterval = "0.001"));
end ControlPitchAngle;

75
SimulationModels/AIDAModelica/ControlPosition.mo

@ -0,0 +1,75 @@ @@ -0,0 +1,75 @@
// CP: 65001
// SimulationX Version: 3.8.2.45319 x64
within AIDAModelica;
model ControlPosition "[SF2.1.1] Control position"
Modelica.Blocks.Interfaces.RealInput DronePositionConsign[3](
quantity="Mechanics.Translation.Displace",
displayUnit="m") "Desired drone position consign" annotation(Placement(
transformation(extent={{-20,-20},{20,20}}),
iconTransformation(extent={{-120,-20},{-80,20}})));
Modelica.Blocks.Interfaces.RealInput Position[3](
quantity="Mechanics.Translation.Displace",
displayUnit="m") "Real drone position feedback" annotation(Placement(
transformation(extent={{-20,-20},{20,20}}),
iconTransformation(
origin={0,-100},
extent={{-20,-20},{20,20}},
rotation=90)));
Modelica.Blocks.Interfaces.RealOutput NavigationSpeedConsign[3](
quantity="Mechanics.Translation.Velocity",
displayUnit="m/s") "Desired drone speed consign" annotation(Placement(
transformation(extent={{-10,-10},{10,10}}),
iconTransformation(extent={{85,-15},{115,15}})));
Real DHP[2](
quantity="Mechanics.Translation.Displace",
displayUnit="m") "Desired horizontal position of the drone";
Real HP[2](
quantity="Mechanics.Translation.Displace",
displayUnit="m") "Real horizontal position of the drone";
Real DZP(
quantity="Mechanics.Translation.Displace",
displayUnit="m") "Desired altitude position";
Real ZP(
quantity="Mechanics.Translation.Displace",
displayUnit="m") "Real altitude position";
Real HNSC[2](
quantity="Mechanics.Translation.Velocity",
displayUnit="m/s") "Horizontal Navigation Speed Consign";
Real ASC(
quantity="Mechanics.Translation.Velocity",
displayUnit="m/s") "AltitudeSpeedConsign";
parameter Real Kph[2,2]={{1,0},{0,1}} "Proportional regulator gain attitude chanel";
parameter Real kpz=1.5 "Proportional regulator gain altitude chanel";
equation
// enter your equations here
DHP = {DronePositionConsign[1],DronePositionConsign[2]};
HP = {Position[1],Position[2]};
HNSC = Kph*(DHP-HP);
DZP = DronePositionConsign[3];
ZP = Position[3];
ASC = kpz*(DZP-ZP);
NavigationSpeedConsign = {HNSC[1],HNSC[2],ASC};
annotation(Icon(graphics={
Rectangle(
fillColor={255,255,255},
fillPattern=FillPattern.Solid,
extent={{-100,100},{100,-100}}),
Ellipse(
fillColor={255,255,255},
fillPattern=FillPattern.Solid,
extent={{-35,37},{35,-33}}),
Text(
textString="+",
fillPattern=FillPattern.None,
extent={{-33.8,17},{-0.4,-19.6}}),
Text(
textString="-",
fillPattern=FillPattern.None,
extent={{-15,-6.6},{18.4,-43.2}}),
Text(
textString="kh/kz",
fillPattern=FillPattern.None,
extent={{33.5,30.5},{93.5,-22.9}}),
Line(points={{-36.7,0},{-86.7,0.3}}),
Line(points={{0,-83.3},{0,-31.7}})}));
end ControlPosition;

50
SimulationModels/AIDAModelica/ControlPositionSAC.mo

@ -0,0 +1,50 @@ @@ -0,0 +1,50 @@
// CP: 65001
// SimulationX Version: 3.8.2.45319 x64
within AIDAModelica;
model ControlPositionSAC "[SF2.1.1] Control position SAC"
Modelica.Blocks.Interfaces.RealInput DronePositionConsign[3](
quantity="Mechanics.Translation.Displace",
displayUnit="m") "Desired drone position consign" annotation(Placement(
transformation(extent={{-20,-20},{20,20}}),
iconTransformation(extent={{-120,-20},{-80,20}})));
Modelica.Blocks.Interfaces.RealInput Position[3](
quantity="Mechanics.Translation.Displace",
displayUnit="m") "Real drone position feedback" annotation(Placement(
transformation(extent={{-20,-20},{20,20}}),
iconTransformation(extent={{-120,-70},{-80,-30}})));
Modelica.Blocks.Interfaces.RealOutput NavigationSpeedConsign[3](
quantity="Mechanics.Translation.Velocity",
displayUnit="m/s") "Desired drone speed consign" annotation(Placement(
transformation(extent={{-10,-10},{10,10}}),
iconTransformation(extent={{90,-10},{110,10}})));
Modelica.Blocks.Interfaces.RealInput RCVErticalSpeedCommand(
quantity="Mechanics.Translation.Velocity",
displayUnit="m/s") "RC vertical speed consign" annotation(Placement(
transformation(extent={{-20,-20},{20,20}}),
iconTransformation(extent={{-120,30},{-80,70}})));
Real DHP[2](
quantity="Mechanics.Translation.Displace",
displayUnit="m") "Desired horizontal position of the drone";
Real HP[2](
quantity="Mechanics.Translation.Displace",
displayUnit="m") "Real horizontal position of the drone";
Real HNSC[2](
quantity="Mechanics.Translation.Velocity",
displayUnit="m/s") "Horizontal Navigation Speed Consign";
Real ASC(
quantity="Mechanics.Translation.Velocity",
displayUnit="m/s") "AltitudeSpeedConsign";
parameter Real Kph[2,2]={{1,0},{0,1}} "Proportional regulator gain attitude chanel";
equation
// enter your equations here
DHP = {DronePositionConsign[1],DronePositionConsign[2]};
HP = {Position[1],Position[2]};
HNSC = Kph*(DHP-HP);
ASC = RCVErticalSpeedCommand;
NavigationSpeedConsign = {HNSC[1],HNSC[2],ASC};
annotation(Icon(graphics={
Rectangle(
fillColor={255,255,255},
fillPattern=FillPattern.Solid,
extent={{-100,100},{100,-100}})}));
end ControlPositionSAC;

290
SimulationModels/AIDAModelica/ControlPositionV0.mo

@ -0,0 +1,290 @@ @@ -0,0 +1,290 @@
// CP: 65001
// SimulationX Version: 3.8.2.45319 x64
within AIDAModelica;
model ControlPositionV0 "ControlPosition_Modelica.ism"
Modelica.Blocks.Interfaces.RealOutput Position_command[3] "'output Real' as connector" annotation(Placement(
transformation(extent={{40,50},{60,70}}),
iconTransformation(extent={{90,-10},{110,10}})));
Modelica.Blocks.Interfaces.RealInput Drone_position_consign[3] "'input Real' as connector" annotation(Placement(
transformation(extent={{-140,40},{-100,80}}),
iconTransformation(extent={{-120,-70},{-80,-30}})));
Modelica.Blocks.Interfaces.RealInput Drone_position[3] "'input Real' as connector" annotation(Placement(
transformation(extent={{-85,-15},{-45,25}}),
iconTransformation(extent={{-120,30},{-80,70}})));
Modelica.Blocks.Continuous.LimPID PID[3](
controllerType=Modelica.Blocks.Types.SimpleController.P,
k={1.26,1.26,1.26},
Ti={0.5,0.5,0.5},
Td={0.1,0.1,0.1},
yMax={1000,1000,1000},
initType=Modelica.Blocks.Types.InitPID.SteadyState,
limitsAtInit={false, false, false},
y_start={1,58,0}) "P, PI, PD, and PID controller with limited output, anti-windup compensation and setpoint weighting" annotation(Placement(transformation(extent={{-30,50},{-10,70}})));
equation
connect(PID.y,Position_command[:]) annotation(Line(
points={{-9,60},{-4,60},{45,60},{50,60}},
color={0,0,127},
thickness=0.0625));
connect(Drone_position_consign[:],PID.u_s) annotation(Line(
points={{-120,60},{-115,60},{-37,60},{-32,60}},
color={0,0,127},
thickness=0.0625));
connect(Drone_position[:],PID.u_m) annotation(Line(
points={{-65,5},{-60,5},{-20,5},{-20,43},{-20,48}},
color={0,0,127},
thickness=0.0625));
annotation(
Icon(graphics={
Rectangle(
fillColor={255,255,255},
fillPattern=FillPattern.Solid,
extent={{-100,100},{100,-100}}),
Bitmap(
imageSource="iVBORw0KGgoAAAANSUhEUgAAAtYAAAG6CAIAAACjrJYtAAAABGdBTUEAALGOfPtRkwAAACBjSFJN
AACHDwAAjA8AAP1SAACBQAAAfXkAAOmLAAA85QAAGcxzPIV3AAAKOWlDQ1BQaG90b3Nob3AgSUND
IHByb2ZpbGUAAEjHnZZ3VFTXFofPvXd6oc0wAlKG3rvAANJ7k15FYZgZYCgDDjM0sSGiAhFFRJoi
SFDEgNFQJFZEsRAUVLAHJAgoMRhFVCxvRtaLrqy89/Ly++Osb+2z97n77L3PWhcAkqcvl5cGSwGQ
yhPwgzyc6RGRUXTsAIABHmCAKQBMVka6X7B7CBDJy82FniFyAl8EAfB6WLwCcNPQM4BOB/+fpFnp
fIHomAARm7M5GSwRF4g4JUuQLrbPipgalyxmGCVmvihBEcuJOWGRDT77LLKjmNmpPLaIxTmns1PZ
Yu4V8bZMIUfEiK+ICzO5nCwR3xKxRoowlSviN+LYVA4zAwAUSWwXcFiJIjYRMYkfEuQi4uUA4EgJ
X3HcVyzgZAvEl3JJS8/hcxMSBXQdli7d1NqaQffkZKVwBALDACYrmcln013SUtOZvBwAFu/8WTLi
2tJFRbY0tba0NDQzMv2qUP91829K3NtFehn4uWcQrf+L7a/80hoAYMyJarPziy2uCoDOLQDI3fti
0zgAgKSobx3Xv7oPTTwviQJBuo2xcVZWlhGXwzISF/QP/U+Hv6GvvmckP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EySUd96WEdnRltt2LsjhJ69vhwSBhUgQqLacIGG328Vt
jzH9CPxy5ZbPRQ0SBBYiQaDaeIJwEwkCC5EgUEkQuiQILESCQCVB6JIgsBAJApUEoUuCwEIkCFQS
hC4JAguRIFBJELokCCxEgkAlQeiSILAQCQKVBKFLgsBCJAhUEoQuCQILkSBQSRC6JAgsRIJAJUHo
kiCwEAkClQShS4LAQiQIVBKELgkCC5EgUEkQuiQILESCQCVB6JIgsBAJApUEoUuCwEIkCFQShC4J
AguRIFBJELokCCxEgkAlQeiSILAQCQKVBKFLgsBCJAhUEoQuCQILkSBQSRC6JAgsRIJAJUHokiCw
EAkClQShS4LAQiQIVBKELgkCC5EgUEkQuiQILESCQCVB6JIgsBAJApUEoUuCwEIkCFQShC4JAguR
IFBJELokCCxEgkAlQeiSILAQCQKVBKFLgsBCJAhUEoQuCQILkSBQSRC6JAgsRIJAJUHokiCwEAkC
lQShS4LAQiQIVCVB3rx6/favvw2jjbhLSBBYggSB6uflZaw0htEdcfeodxTgJP797/8H9iJ/3lrZ
9jUAAAAASUVORK5CYII=",
extent={{-100,-60.9},{100,60.9}})}),
experiment(
StopTime=1,
StartTime=0,
Interval=0.002,
MaxInterval="0.001"));
end ControlPositionV0;

38
SimulationModels/AIDAModelica/ControlRollAngle.mo

@ -0,0 +1,38 @@ @@ -0,0 +1,38 @@
within AIDAModelica;
model ControlRollAngle "[SF2.3.4] Control roll angle"
// CP: 65001
// SimulationX Version: 3.8.2.45319 x64
Modelica.Blocks.Interfaces.RealInput RollConsign(quantity = "Mechanics.Rotation.Angle", displayUnit = "rad") "Choosed roll consign" annotation(
Placement(transformation(extent = {{-130, 45}, {-90, 85}}), iconTransformation(extent = {{-120, 30}, {-80, 70}})));
Modelica.Blocks.Interfaces.RealInput Roll(quantity = "Mechanics.Rotation.Angle", displayUnit = "rad") "Real drone roll angle feedback" annotation(
Placement(transformation(extent = {{-125, 10}, {-85, 50}}), iconTransformation(extent = {{-120, -20}, {-80, 20}})));
Modelica.Blocks.Interfaces.RealInput AngularSpeedX(quantity = "Mechanics.Rotation.RotVelocity", displayUnit = "rad/s") "Real drone angular X speed feedback" annotation(
Placement(transformation(extent = {{-125, -15}, {-85, 25}}), iconTransformation(extent = {{-120, -70}, {-80, -30}})));
Modelica.Blocks.Interfaces.RealOutput MomentumX(quantity = "Mechanics.Rotation.Torque", displayUnit = "Nm") "Desired momentum at axe X" annotation(
Placement(transformation(extent = {{60, 20}, {80, 40}}), iconTransformation(extent = {{86.7, -10}, {106.7, 10}})));
XAngularSpeedErrorModel xAngularSpeedErrorModel1(Kwphi = 1) "X angular speed error calculation model" annotation(
Placement(transformation(extent = {{-30, 20}, {-10, 40}})));
Modelica.Blocks.Continuous.PID PID(k = 0.09, Ti = 1.5, Td = 0.03, initType = Modelica.Blocks.Types.InitPID.InitialState, Add(k1 = -1, k2 = -1, k3 = -1)) annotation(
Placement(transformation(extent = {{20, 20}, {40, 40}})));
equation
connect(PID.y, MomentumX) annotation(
Line(points = {{41, 30}, {46, 30}, {65, 30}, {70, 30}}, color = {0, 0, 127}, thickness = 0.0625));
connect(xAngularSpeedErrorModel1.RollConsign, RollConsign) annotation(
Line(points = {{-30, 35}, {-35, 35}, {-105, 35}, {-105, 65}, {-110, 65}}, color = {0, 0, 127}, thickness = 0.0625));
connect(xAngularSpeedErrorModel1.Roll, Roll) annotation(
Line(points = {{-30, 30}, {-35, 30}, {-100, 30}, {-105, 30}}, color = {0, 0, 127}, thickness = 0.0625));
connect(xAngularSpeedErrorModel1.AngularSpeedX, AngularSpeedX) annotation(
Line(points = {{-30, 25}, {-35, 25}, {-100, 25}, {-100, 5}, {-105, 5}}, color = {0, 0, 127}, thickness = 0.0625));
connect(xAngularSpeedErrorModel1.AngularSpeedXError, PID.u) annotation(
Line(points = {{-10.3, 30}, {-5.3, 30}, {13, 30}, {18, 30}}, color = {0, 0, 127}, thickness = 0.0625));
annotation(
RollConsign(flags = 2),
Roll(flags = 2),
AngularSpeedX(flags = 2),
MomentumX(flags = 2),
xAngularSpeedErrorModel1(RollConsign(flags = 2), Roll(flags = 2), AngularSpeedX(flags = 2), AngularSpeedXError(flags = 2), ephi(flags = 2), wxd(flags = 2)),
PID(u(flags = 2), y(flags = 2), P(u(flags = 2), y(flags = 2)), I(u(flags = 2), y(flags = 2)), D(u(flags = 2), y(flags = 2), x(flags = 2)), Gain(u(flags = 2), y(flags = 2)), Add(u1(flags = 2), u2(flags = 2), u3(flags = 2), y(flags = 2))),
Icon(graphics = {Rectangle(fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid, extent = {{-100, 100}, {100, -100}}), Text(origin = {19, -5}, extent = {{-45, 19}, {1, 1}}, textString = "%name")}, coordinateSystem(initialScale = 0.1)),
experiment(StopTime = 1, StartTime = 0, Interval = 0.002, MaxInterval = "0.001"));
end ControlRollAngle;

49
SimulationModels/AIDAModelica/ControlSpeed.mo

@ -0,0 +1,49 @@ @@ -0,0 +1,49 @@
within AIDAModelica;
model ControlSpeed "[SF2.1.3] Control Speed"
// CP: 65001
// SimulationX Version: 3.8.2.45319 x64
Modelica.Blocks.Interfaces.RealInput SpeedConsign[3](quantity = "Mechanics.Translation.Velocity", displayUnit = "m/s") "Choosed drone speed consign " annotation(
Placement(transformation(extent = {{-120, 30}, {-80, 70}}), iconTransformation(extent = {{-120, 30}, {-80, 70}})));
Modelica.Blocks.Interfaces.RealInput Speed[3](quantity = "Mechanics.Translation.Velocity", displayUnit = "m/s") "Real drone speed feedback" annotation(
Placement(visible = true,transformation(extent = {{-122, -28}, {-82, 12}}, rotation = 0), iconTransformation(extent = {{-120, -70}, {-80, -30}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealOutput AccelerationConsign[3](quantity = "Mechanics.Translation.Accel", displayUnit = "m/s²") "Drone acceleration consign " annotation(
Placement(transformation(extent = {{65, 20}, {85, 40}}), iconTransformation(extent = {{90, -10}, {110, 10}})));
AIDAModelica.SpeedErrorModel speedErrorModel1 annotation(
Placement(visible = true, transformation(extent = {{-60, 22}, {-40, 42}}, rotation = 0)));
Modelica.Blocks.Continuous.PID PID(Td = 1.5, Ti = 8, initType = Modelica.Blocks.Types.InitPID.InitialState, k = 1.5) "PID-controller in additive description form" annotation(
Placement(transformation(extent = {{15, 50}, {35, 70}})));
Modelica.Blocks.Continuous.PID PID2(Td = 1.5, Ti = 8, initType = Modelica.Blocks.Types.InitPID.InitialState, k = 1.5) annotation(
Placement(transformation(extent = {{15, 20}, {35, 40}})));
Modelica.Blocks.Continuous.PID PID1(Td = 1, Ti = 3, initType = Modelica.Blocks.Types.InitPID.InitialState, k = 1.8) annotation(
Placement(transformation(extent = {{15, -10}, {35, 10}})));
equation
connect(PID1.u, speedErrorModel1.SpeedError[3]) annotation(
Line(points = {{14, 0}, {-40, 0}, {-40, 32}}, color = {0, 0, 127}));
connect(PID2.u, speedErrorModel1.SpeedError[2]) annotation(
Line(points = {{14, 30}, {-15, 30}, {-15, 32}, {-40, 32}}, color = {0, 0, 127}));
connect(PID.u, speedErrorModel1.SpeedError[1]) annotation(
Line(points = {{14, 60}, {-40, 60}, {-40, 32}}, color = {0, 0, 127}));
connect(speedErrorModel1.Speed, Speed) annotation(
Line(points = {{-50, 22}, {-98, 22}, {-98, -8}, {-102, -8}}, color = {0, 0, 127}));
connect(speedErrorModel1.SpeedConsign, SpeedConsign) annotation(
Line(points = {{-60, 32}, {-92, 32}, {-92, 50}, {-100, 50}}, color = {0, 0, 127}));
connect(PID1.y, AccelerationConsign[3]) annotation(
Line(points = {{36, 0}, {68, 0}, {68, 30}, {76, 30}}, color = {0, 0, 127}));
connect(PID2.y, AccelerationConsign[2]) annotation(
Line(points = {{36, 30}, {70, 30}, {70, 30}, {76, 30}}, color = {0, 0, 127}));
connect(PID.y, AccelerationConsign[1]) annotation(
Line(points = {{36, 60}, {68, 60}, {68, 30}, {76, 30}}, color = {0, 0, 127}));
// enter your equations here
equation
annotation(
SpeedConsign(flags = 2),
Speed(flags = 2),
AccelerationConsign(flags = 2),
speedErrorModel1(SpeedConsign(flags = 2), Speed(flags = 2), SpeedError(flags = 2), vhd(flags = 2), vh(flags = 2), vzd(flags = 2), vz(flags = 2), HSE(flags = 2), ASE(flags = 2)),
PID(u(flags = 2), y(flags = 2), P(u(flags = 2), y(flags = 2)), I(u(flags = 2), y(flags = 2)), D(u(flags = 2), y(flags = 2), x(flags = 2)), Gain(u(flags = 2), y(flags = 2)), Add(u1(flags = 2), u2(flags = 2), u3(flags = 2), y(flags = 2))),
PID2(u(flags = 2), y(flags = 2), P(u(flags = 2), y(flags = 2)), I(u(flags = 2), y(flags = 2)), D(u(flags = 2), y(flags = 2), x(flags = 2)), Gain(u(flags = 2), y(flags = 2)), Add(u1(flags = 2), u2(flags = 2), u3(flags = 2), y(flags = 2))),
PID1(u(flags = 2), y(flags = 2), P(u(flags = 2), y(flags = 2)), I(u(flags = 2), y(flags = 2)), D(u(flags = 2), y(flags = 2), x(flags = 2)), Gain(u(flags = 2), y(flags = 2)), Add(u1(flags = 2), u2(flags = 2), u3(flags = 2), y(flags = 2))),
Icon(graphics = {Rectangle(fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid, extent = {{-100, 100}, {100, -100}}), Text(origin = {-23, 130}, extent = {{-33, 12}, {95, -22}}, textString = "%name")}, coordinateSystem(initialScale = 0.1)),
experiment(StopTime = 1, StartTime = 0, Interval = 0.002, MaxInterval = "0.001"));
end ControlSpeed;

96
SimulationModels/AIDAModelica/ControlYawAngle.mo

@ -0,0 +1,96 @@ @@ -0,0 +1,96 @@
within AIDAModelica;
model ControlYawAngle "[SF2.3.5] Control yaw angle"
Modelica.Blocks.Interfaces.RealInput YawConsign(
quantity="Mechanics.Rotation.Angle",
displayUnit="rad") "Desired momentum at axe Z" annotation(Placement(
transformation(extent={{-135,30},{-95,70}}),
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={{-135,0},{-95,40}}),
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={{-135,-30},{-95,10}}),
iconTransformation(extent={{-120,-70},{-80,-30}})));
Modelica.Blocks.Interfaces.RealOutput MomentumZ(
quantity="Mechanics.Rotation.Torque",
displayUnit="Nm") "'output Real' as connector" annotation(Placement(
transformation(extent={{30,10},{50,30}}),
iconTransformation(extent={{86.7,-10},{106.7,10}})));
ZAngularSpeedErrorModel zAngularSpeedErrorModel1 "Z angular speed error calculation model" annotation(Placement(transformation(extent={{-55,10},{-35,30}})));
Modelica.Blocks.Continuous.PID PID2(
k=0.1,
Ti=2,
Td=0.1,
initType=Modelica.Blocks.Types.InitPID.InitialState,
Add(
k1=-1,
k2=-1,
k3=-1)) "PID-controller in additive description form" annotation(Placement(transformation(extent={{-10,10},{10,30}})));
equation
connect(PID2.y,MomentumZ) annotation(Line(
points={{11,20},{16,20},{35,20},{40,20}},
color={0,0,127},
thickness=0.0625));
connect(zAngularSpeedErrorModel1.YawCosign,YawConsign) annotation(Line(
points={{-55,25},{-60,25},{-110,25},{-110,50},{-115,50}},
color={0,0,127},
thickness=0.0625));
connect(zAngularSpeedErrorModel1.Yaw,Yaw) annotation(Line(
points={{-55,20},{-60,20},{-110,20},{-115,20}},
color={0,0,127},
thickness=0.0625));
connect(zAngularSpeedErrorModel1.AngularSpeedZ,AngularSpeedZ) annotation(Line(
points={{-55,15},{-60,15},{-110,15},{-110,-10},{-115,-10}},
color={0,0,127},
thickness=0.0625));
connect(PID2.u,zAngularSpeedErrorModel1.AngularSpeedZError) annotation(Line(
points={{-12,20},{-17,20},{-30.3,20},{-35.3,20}},
color={0,0,127},
thickness=0.0625));
annotation(
YawConsign(flags=2),
Yaw(flags=2),
AngularSpeedZ(flags=2),
MomentumZ(flags=2),
zAngularSpeedErrorModel1(
YawCosign(flags=2),
Yaw(flags=2),
AngularSpeedZ(flags=2),
AngularSpeedZError(flags=2),
eyaw(flags=2),
wzd(flags=2)),
PID2(
u(flags=2),
y(flags=2),
P(
u(flags=2),
y(flags=2)),
I(
u(flags=2),
y(flags=2)),
D(
u(flags=2),
y(flags=2),
x(flags=2)),
Gain(
u(flags=2),
y(flags=2)),
Add(
u1(flags=2),
u2(flags=2),
u3(flags=2),
y(flags=2))),
Icon(graphics = {Rectangle(fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid, extent = {{-100, 100}, {100, -103.3}}), Text(origin = {-4, 0}, extent = {{-16, 8}, {16, -8}}, textString = "%name")}, coordinateSystem(initialScale = 0.1)),
experiment(
StopTime=1,
StartTime=0,
Interval=0.002,
MaxInterval="0.001"));
end ControlYawAngle;

54
SimulationModels/AIDAModelica/Cosim_Sim_m.mo

@ -0,0 +1,54 @@ @@ -0,0 +1,54 @@
// CP: 65001
// SimulationX Version: 3.8.2.45319 x64
within AIDAModelica;
model Cosim_Sim_m
parameter Modelica.SIunits.Time Cosim_step(start=0.02);
parameter Boolean Cosim_activ=false;
parameter Integer N=1;
Modelica.Blocks.Discrete.ZeroOrderHold zeroOrderHold1[N](samplePeriod=Cosim_step) annotation(Placement(transformation(extent={{-10,-10},{10,10}})));
Modelica.Blocks.Logical.Switch logicalSwitch1[N] annotation(Placement(transformation(extent={{-10,-10},{10,10}})));
Modelica.Blocks.Interfaces.RealInput u[N] annotation(Placement(
transformation(
origin={-74,8},
extent={{-20,-20},{20,20}}),
iconTransformation(
origin={-74,8},
extent={{-20,-20},{20,20}})));
Modelica.Blocks.Interfaces.RealOutput[N] y annotation(Placement(
transformation(
origin={78,6},
extent={{-10,-10},{10,10}}),
iconTransformation(
origin={85,13},
extent={{-17,-17},{17,17}})));
equation
for i in 1:N loop
connect(u[i], zeroOrderHold1[i].u) ;
logicalSwitch1[i].u2 = Cosim_activ;
connect(zeroOrderHold1[i].y, logicalSwitch1[i].u1) ;
connect(u[i], logicalSwitch1[i].u3) ;
connect(logicalSwitch1[i].y, y[i]) ;
end for;
annotation(
Icon(graphics={
Text(
textString="Discretisation par zero hold",
fillPattern=FillPattern.None,
extent={{-30,10},{90,-30}},
origin={-32,44}),
Line(
points={{-72,-28},{-54,-28},{-54,-6},{-34,-6},{-34,16},{-12,
16},{-12,-6},{12,-6},{12,-16},{32,-16},{32,28},{52,
28},{52,16},{72,16},{72,-2}},
origin={-2,-30}),
Text(
textString="Cosim port model",
fillPattern=FillPattern.None,
extent={{-23,8},{87,-28}},
origin={-35,80})}),
experiment(
StopTime=1,
StartTime=0,
Interval=0.002,
MaxInterval="0.001"));
end Cosim_Sim_m;

30
SimulationModels/AIDAModelica/CreateMotion.mo

@ -0,0 +1,30 @@ @@ -0,0 +1,30 @@
within AIDAModelica;
model CreateMotion "[SF1.1/2/3/4.2] Create motion"
// CP: 65001
// SimulationX Version: 3.8.2.45319 x64
Modelica.Blocks.Interfaces.RealInput ThrottleCommandK "Throttle command of k-th motor" annotation(
Placement(transformation(extent = {{-125, -10}, {-85, 30}}), iconTransformation(extent = {{-120, -20}, {-80, 20}})));
Modelica.Blocks.Interfaces.RealOutput MotorKAngularVelocity(quantity = "Mechanics.Rotation.RotVelocity", displayUnit = "rpm") "Angular velocity of k-th motor" annotation(
Placement(transformation(extent = {{75, 0}, {95, 20}}), iconTransformation(extent = {{86.7, -10}, {106.7, 10}})));
Modelica.Blocks.Continuous.FirstOrder W(T = 0.2, initType = Modelica.Blocks.Types.Init.InitialState, y_start = 377.59565222) annotation(
Placement(transformation(extent = {{30, 0}, {50, 20}})));
AIDAModelica.WSSModel wSSModel1 annotation(
Placement(transformation(extent = {{-40, 0}, {-20, 20}})));
equation
connect(wSSModel1.WSSOut, W.u) annotation(
Line(points = {{-20, 10}, {-15, 10}, {23, 10}, {28, 10}}, color = {0, 0, 127}, thickness = 0.0625));
//le moteur tourne dans un seul sens
/*MotorKAngularVelocity=max(0,W.y);*/
connect(wSSModel1.CmdKIn, ThrottleCommandK) annotation(
Line(points = {{-40, 10}, {-45, 10}, {-100, 10}, {-105, 10}}, color = {0, 0, 127}, thickness = 0.0625));
connect(W.y, MotorKAngularVelocity) annotation(
Line(points = {{51, 10}, {56, 10}, {80, 10}, {85, 10}}, color = {0, 0, 127}, thickness = 0.0625));
annotation(
ThrottleCommandK(flags = 2),
MotorKAngularVelocity(flags = 2),
W(u(flags = 2), y(flags = 2)),
wSSModel1(CmdKIn(flags = 2), WSSOut(flags = 2)),
Icon(coordinateSystem(extent = {{-100, -50}, {100, 50}}, initialScale = 0.1), graphics = {Rectangle(fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid, extent = {{-100, 50}, {100, -50}}), Text(origin = {-4, 0}, extent = {{-36, 8}, {36, -8}}, textString = "%name")}),
experiment(StopTime = 1, StartTime = 0, Interval = 0.002, MaxInterval = "0.001"));
end CreateMotion;

153
SimulationModels/AIDAModelica/GeneratePositioningSignal.mo

@ -0,0 +1,153 @@ @@ -0,0 +1,153 @@
// CP: 65001
// SimulationX Version: 3.8.2.45319 x64
within AIDAModelica;
model GeneratePositioningSignal "Generate Positioning Signal"
Modelica.Blocks.Interfaces.RealInput Drone_coordinates[3] "'input Real' as connector" annotation(Placement(
transformation(extent={{-20,-20},{20,20}}),
iconTransformation(extent={{-120,-20},{-80,20}})));
Modelica.Blocks.Interfaces.RealOutput Positioning_signal[4] "'output Real' as connector" annotation(Placement(
transformation(extent={{-10,-10},{10,10}}),
iconTransformation(extent={{90,-10},{110,10}})));
equation
// enter your equations here
Positioning_signal[1:3] = Drone_coordinates[1:3];
Positioning_signal[4] = time;
annotation(Icon(graphics={
Rectangle(
fillColor={255,255,255},
fillPattern=FillPattern.Solid,
extent={{-100,100},{100,-103.3}}),
Bitmap(
imageSource="iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAABGdBTUEAALGPC/xhBQAAAAlwSFlz
AAAOvAAADrwBlbxySQAAACVJREFUaEPtwTEBAAAAwqD1T+1nCiAAAAAAAAAAAA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idiQhD6ExEGEJnIsIQuvLw8H/vk37U14oq1AAAAABJRU5ErkJggg==",
extent={{-100,-100},{100,100}})}));
end GeneratePositioningSignal;

127
SimulationModels/AIDAModelica/LowLevelFlightControlSystem.mo

@ -0,0 +1,127 @@ @@ -0,0 +1,127 @@
within AIDAModelica;
model LowLevelFlightControlSystem "Low level Flight Control System"
Modelica.Blocks.Interfaces.RealInput DronePositionConsign[3](quantity = "Mechanics.Translation.Displace", displayUnit = "m") "Desired position input" annotation(
Placement(transformation(extent = {{-55, 84}, {-35, 105}}), iconTransformation(extent = {{-160, 64.5}, {-140, 85.5}})));
Modelica.Blocks.Interfaces.RealInput Accelerations[3] "Accelerations in Ground reference" annotation(
Placement(visible = true, transformation(extent = {{-135, 35}, {-115, 60}}, rotation = 0), iconTransformation(origin = {95, -125.333}, extent = {{-10, -10.5}, {10, 10.5}}, rotation = 90)));
Modelica.Blocks.Interfaces.RealInput AngularSpeed[3](quantity = "Mechanics.Rotation.RotVelocity", displayUnit = "rad/s") "Real angular velocities feedback input" annotation(
Placement(transformation(extent = {{20, -71}, {40, -50}}), iconTransformation(origin = {-100, -125}, extent = {{-10, -10.5}, {10, 10.5}}, rotation = 90)));
Modelica.Blocks.Interfaces.RealInput Position[3](quantity = "Mechanics.Translation.Displace", displayUnit = "m") "Real position feedback input" annotation(
Placement(transformation(extent = {{-71, 75}, {-51, 96}}), iconTransformation(origin = {0, -125}, extent = {{-10, -10.5}, {10, 10.5}}, rotation = 90)));
Modelica.Blocks.Interfaces.RealInput YawConsign(quantity = "Mechanics.Rotation.Angle", displayUnit = "rad") "Desired yaw angle input" annotation(
Placement(transformation(extent = {{-10, 4}, {10, 25}}), iconTransformation(extent = {{-160, -35.5}, {-140, -14.5}})));
Modelica.Blocks.Interfaces.RealInput Attitude[3](quantity = "Mechanics.Rotation.Angle", displayUnit = "rad") "Real attitude feedback input" annotation(
Placement(transformation(extent = {{40, -96}, {60, -75}}), iconTransformation(origin = {-50, -125}, extent = {{-10, -10.5}, {10, 10.5}}, rotation = 90)));
Modelica.Blocks.Interfaces.RealInput Speed[3](quantity = "Mechanics.Translation.Velocity", displayUnit = "m/s") "Real velocity feedback input" annotation(
Placement(visible = true, transformation(extent = {{-72, 59}, {-52, 80}}, rotation = 0), iconTransformation(origin = {46, -125}, extent = {{-10, -10.5}, {10, 10.5}}, rotation = 90)));
Modelica.Blocks.Interfaces.RealOutput ThrottleCommand1 "Command 1 output" annotation(
Placement(transformation(extent = {{160, 70}, {180, 90}}), iconTransformation(extent = {{140, 65}, {160, 85}})));
Modelica.Blocks.Interfaces.RealOutput ThrottleCommand2 "Command 2 output" annotation(
Placement(transformation(extent = {{160, 50}, {180, 70}}), iconTransformation(extent = {{140, 15}, {160, 35}})));
Modelica.Blocks.Interfaces.RealOutput ThrottleCommand3 "Command 3 output" annotation(
Placement(transformation(extent = {{160, 30}, {180, 50}}), iconTransformation(extent = {{140, -35}, {160, -15}})));
Modelica.Blocks.Interfaces.RealOutput ThrottleCommand4 "Command 4 output" annotation(
Placement(transformation(extent = {{160, 10}, {180, 30}}), iconTransformation(extent = {{140, -85}, {160, -65}})));
Modelica.Blocks.Interfaces.RealInput RCVerticalSpeedCommand(quantity = "Mechanics.Translation.Velocity", displayUnit = "m/s") "RC vertical speed consign" annotation(
Placement(transformation(extent = {{-125, 79}, {-105, 100}}), iconTransformation(origin = {-75, 125}, extent = {{-10, -10.5}, {10, 10.5}}, rotation = -90)));
Modelica.Blocks.Interfaces.RealInput RCAttitudeCommands[2](quantity = "Mechanics.Rotation.Angle", displayUnit = "rad") "RC attitude consign" annotation(
Placement(transformation(extent = {{-135, 19}, {-115, 40}}), iconTransformation(origin = {-25, 125}, extent = {{-10, -10.5}, {10, 10.5}}, rotation = -90)));
Modelica.Blocks.Interfaces.RealInput RCYawCommand(quantity = "Mechanics.Rotation.Angle", displayUnit = "rad") "RC yaw consign" annotation(
Placement(transformation(extent = {{-120, -41}, {-100, -20}}), iconTransformation(origin = {25, 125}, extent = {{-10, -10.5}, {10, 10.5}}, rotation = -90)));
Modelica.Blocks.Interfaces.BooleanInput SelectedControlMode "Control mode" annotation(
Placement(transformation(extent = {{110, -30}, {130, -10}}), iconTransformation(extent = {{-170, -95}, {-130, -55}})));
MotorControl motorControl1 annotation(
Placement(transformation(extent = {{115, 75}, {135, 85}})));
MotorControl motorControl2 "Motor Control Model" annotation(
Placement(transformation(extent = {{115, 55}, {135, 65}})));
MotorControl motorControl3 annotation(
Placement(transformation(extent = {{115, 35}, {135, 45}})));
MotorControl motorControl4 annotation(
Placement(transformation(extent = {{115, 15}, {135, 25}})));
AIDAModelica.AllocationControl allocationControl1 annotation(
Placement(visible = true, transformation(extent = {{82, 46}, {102, 71}}, rotation = 0)));
AIDAModelica.ControlAltitudeEx controlAltitude1 annotation(
Placement(visible = true, transformation(extent = {{1, 53}, {21, 73}}, rotation = 0)));
AttitudeControl attitudeControl1 annotation(
Placement(transformation(extent = {{45, 20}, {65, 40}})));
PositionControl positionControl1 annotation(
Placement(transformation(extent = {{-20, 80}, {0, 100}})));
equation
connect(allocationControl1.SelectedControlMode, SelectedControlMode) annotation(
Line(points = {{82, 51}, {75, 51}, {75, -20}, {120, -20}}, color = {255, 0, 255}, thickness = 0.0625));
connect(allocationControl1.Motor4Rate, motorControl4.MotorKRate) annotation(
Line(points = {{102, 51}, {110, 51}, {110, 20}, {115, 20}}, color = {0, 0, 127}, thickness = 0.0625));
connect(allocationControl1.Motor1Rate, motorControl1.MotorKRate) annotation(
Line(points = {{102, 66}, {110, 66}, {110, 80}, {115, 80}}, color = {0, 0, 127}, thickness = 0.0625));
connect(allocationControl1.Motor2Rate, motorControl2.MotorKRate) annotation(
Line(points = {{102, 61}, {110, 61}, {110, 60}, {115, 60}}, color = {0, 0, 127}, thickness = 0.0625));
connect(allocationControl1.Motor3Rate, motorControl3.MotorKRate) annotation(
Line(points = {{102, 56}, {108.5, 56}, {108.5, 40}, {115, 40}}, color = {0, 0, 127}, thickness = 0.0625));
connect(attitudeControl1.MomentumsConsign[:], allocationControl1.MomentumsConsign[:]) annotation(
Line(points = {{65, 30}, {75, 30}, {75, 56}, {82, 56}}, color = {0, 0, 127}, thickness = 0.0625));
connect(positionControl1.TotalThrustAP, allocationControl1.TotalThrustAP) annotation(
Line(points = {{0, 95}, {75, 95}, {75, 66}, {82, 66}}, color = {0, 0, 127}, thickness = 0.0625));
connect(controlAltitude1.TotalThrustManual, allocationControl1.TotalThrustManual) annotation(
Line(points = {{21, 63}, {54.5, 63}, {54.5, 61}, {82, 61}}, color = {0, 0, 127}));
connect(attitudeControl1.RCYawCommand, RCYawCommand) annotation(
Line(points = {{46, 36}, {-106, 36}, {-106, -30}, {-110, -30}}, color = {0, 0, 127}));
connect(controlAltitude1.Acceleration, Accelerations[3]) annotation(
Line(points = {{16, 53}, {16, 47.7}, {-125, 47.7}}, color = {0, 0, 127}, thickness = 0.0625));
connect(controlAltitude1.VSpeed, Speed[3]) annotation(
Line(points = {{6, 53}, {6, 50}, {-23.3, 50}, {-23.3, 69.7}, {-62, 69.7}}, color = {0, 0, 127}));
connect(controlAltitude1.RCVerticalSpeedCommand, RCVerticalSpeedCommand) annotation(
Line(points = {{1, 63}, {-110, 63}, {-110, 90}, {-114, 90}}, color = {0, 0, 127}));
connect(attitudeControl1.SelectedControlMode, SelectedControlMode) annotation(
Line(points = {{60, 20}, {60, 15}, {60, -20}, {115, -20}, {120, -20}}, color = {255, 0, 255}, thickness = 0.0625));
connect(positionControl1.Position[:], Position[:]) annotation(
Line(points = {{-20, 90}, {-25, 90}, {-56, 90}, {-56, 85.7}, {-61, 85.7}}, color = {0, 0, 127}, thickness = 0.0625));
connect(positionControl1.Speed[:], Speed[:]) annotation(
Line(points = {{-20, 85}, {-25, 85}, {-57, 85}, {-57, 69.7}, {-62, 69.7}}, color = {0, 0, 127}, thickness = 0.0625));
connect(motorControl1.ThrottleCommandK, ThrottleCommand1) annotation(
Line(points = {{135, 80}, {140, 80}, {165, 80}, {170, 80}}, color = {0, 0, 127}, thickness = 0.0625));
connect(motorControl2.ThrottleCommandK, ThrottleCommand2) annotation(
Line(points = {{135, 60}, {140, 60}, {165, 60}, {170, 60}}, color = {0, 0, 127}, thickness = 0.0625));
connect(motorControl3.ThrottleCommandK, ThrottleCommand3) annotation(
Line(points = {{135, 40}, {140, 40}, {165, 40}, {170, 40}}, color = {0, 0, 127}, thickness = 0.0625));
connect(motorControl4.ThrottleCommandK, ThrottleCommand4) annotation(
Line(points = {{135, 20}, {140, 20}, {165, 20}, {170, 20}}, color = {0, 0, 127}, thickness = 0.0625));
connect(attitudeControl1.AngularSpeed[:], AngularSpeed[:]) annotation(
Line(points = {{50, 20}, {50, 15}, {50, -60.3}, {35, -60.3}, {30, -60.3}}, color = {0, 0, 127}, thickness = 0.0625));
connect(attitudeControl1.Attitude[:], Attitude[:]) annotation(
Line(points = {{55, 20}, {55, 15}, {55, -85.3}, {50, -85.3}}, color = {0, 0, 127}, thickness = 0.0625));
connect(attitudeControl1.YawConsign, YawConsign) annotation(
Line(points = {{45, 25}, {40, 25}, {5, 25}, {5, 14.7}, {0, 14.7}}, color = {0, 0, 127}, thickness = 0.0625));
connect(positionControl1.DronPositionConsign[:], DronePositionConsign[:]) annotation(
Line(points = {{-20, 95}, {-25, 95}, {-40, 95}, {-40, 94.7}, {-45, 94.7}}, color = {0, 0, 127}, thickness = 0.0625));
connect(positionControl1.Attitude[:], Attitude[:]) annotation(
Line(points = {{-15, 80}, {-15, 75}, {-15, -85.3}, {45, -85.3}, {50, -85.3}}, color = {0, 0, 127}, thickness = 0.0625));
connect(positionControl1.AttitudeConsignAP[:], attitudeControl1.AttitudeConsignAP[:]) annotation(
Line(points = {{0, 85}, {5, 85}, {50, 85}, {50, 45}, {50, 40}}, color = {0, 0, 127}, thickness = 0.0625));
connect(RCAttitudeCommands[:], attitudeControl1.AttitudeRCConsign[:]) annotation(
Line(points = {{-125, 29.7}, {-120, 29.7}, {40, 29.7}, {40, 30}, {45, 30}}, color = {0, 0, 127}, thickness = 0.0625));
annotation(
DronePositionConsign(flags = 2),
AngularSpeed(flags = 2),
Position(flags = 2),
YawConsign(flags = 2),
Attitude(flags = 2),
Speed(flags = 2),
ThrottleCommand1(flags = 2),
ThrottleCommand2(flags = 2),
ThrottleCommand3(flags = 2),
ThrottleCommand4(flags = 2),
RCVerticalSpeedCommand(flags = 2),
RCAttitudeCommands(flags = 2),
RCYawCommand(flags = 2),
SelectedControlMode(flags = 2),
motorControl1(MotorKRate(flags = 2), ThrottleCommandK(flags = 2), controlMotor1(DAngVel(flags = 2), ComdKD(flags = 2))),
motorControl2(MotorKRate(flags = 2), ThrottleCommandK(flags = 2), controlMotor1(DAngVel(flags = 2), ComdKD(flags = 2))),
motorControl3(MotorKRate(flags = 2), ThrottleCommandK(flags = 2), controlMotor1(DAngVel(flags = 2), ComdKD(flags = 2))),
motorControl4(MotorKRate(flags = 2), ThrottleCommandK(flags = 2), controlMotor1(DAngVel(flags = 2), ComdKD(flags = 2))),
allocationControl1(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))),
controlAltitude1(TotalThrustManual(flags = 2), RCVerticalSpeedCommand(flags = 2), computeTotalThrustCA1(AccelerationConsign(flags = 2), TotalThrustAP(flags = 2), AC(flags = 2)), computeAltitudeConsign1(RCVerticalSpeedCommand(flags = 2), AccelerationConsign(flags = 2), PID1(u(flags = 2), y(flags = 2), P(u(flags = 2), y(flags = 2)), I(u(flags = 2), y(flags = 2)), D(u(flags = 2), y(flags = 2), x(flags = 2)), Gain(u(flags = 2), y(flags = 2)), Add(u1(flags = 2), u2(flags = 2), u3(flags = 2), y(flags = 2))), speedErrorModelSAC1(SpeedConsign(flags = 2), Speed(flags = 2), SpeedError(flags = 2), vzd(flags = 2), vz(flags = 2), ASE(flags = 2)))),
attitudeControl1(AttitudeConsignAP(flags = 2), AttitudeRCConsign(flags = 2), YawConsign(flags = 2), AngularSpeed(flags = 2), Attitude(flags = 2), MomentumsConsign(flags = 2), RCYawCommand(flags = 2), SelectedControlMode(flags = 2), controlRollAngle1(RollConsign(flags = 2), Roll(flags = 2), AngularSpeedX(flags = 2), MomentumX(flags = 2), xAngularSpeedErrorModel1(RollConsign(flags = 2), Roll(flags = 2), AngularSpeedX(flags = 2), AngularSpeedXError(flags = 2), ephi(flags = 2), wxd(flags = 2)), PID(u(flags = 2), y(flags = 2), P(u(flags = 2), y(flags = 2)), I(u(flags = 2), y(flags = 2)), D(u(flags = 2), y(flags = 2), x(flags = 2)), Gain(u(flags = 2), y(flags = 2)), Add(u1(flags = 2), u2(flags = 2), u3(flags = 2), y(flags = 2)))), controlPitchAngle1(PitchCosign(flags = 2), Pitch(flags = 2), AngularSpeedY(flags = 2), MomentumY(flags = 2), yAngularSpeedErrorModel1(PitchCosign(flags = 2), Pitch(flags = 2), AngularSpeedY(flags = 2), AngularSpeedYError(flags = 2), eteta(flags = 2), wyd(flags = 2)), PID1(u(flags = 2), y(flags = 2), P(u(flags = 2), y(flags = 2)), I(u(flags = 2), y(flags = 2)), D(u(flags = 2), y(flags = 2), x(flags = 2)), Gain(u(flags = 2), y(flags = 2)), Add(u1(flags = 2), u2(flags = 2), u3(flags = 2), y(flags = 2)))), controlYawAngle1(YawConsign(flags = 2), Yaw(flags = 2), AngularSpeedZ(flags = 2), MomentumZ(flags = 2), zAngularSpeedErrorModel1(YawCosign(flags = 2), Yaw(flags = 2), AngularSpeedZ(flags = 2), AngularSpeedZError(flags = 2), eyaw(flags = 2), wzd(flags = 2)), PID2(u(flags = 2), y(flags = 2), P(u(flags = 2), y(flags = 2)), I(u(flags = 2), y(flags = 2)), D(u(flags = 2), y(flags = 2), x(flags = 2)), Gain(u(flags = 2), y(flags = 2)), Add(u1(flags = 2), u2(flags = 2), u3(flags = 2), y(flags = 2)))), SelectRollConsign(u1(flags = 2), u2(flags = 2), u3(flags = 2), y(flags = 2)), SelectPitchConsign(u1(flags = 2), u2(flags = 2), u3(flags = 2), y(flags = 2)), computeYawConsign(u1(flags = 2), u2(flags = 2), y(flags = 2))),
positionControl1(DronPositionConsign(flags = 2), Position(flags = 2), TotalThrustAP(flags = 2), AttitudeConsignAP(flags = 2), Attitude(flags = 2), Speed(flags = 2), controlPosition1(DronePositionConsign(flags = 2), Position(flags = 2), NavigationSpeedConsign(flags = 2), DHP(flags = 2), HP(flags = 2), DZP(flags = 2), ZP(flags = 2), HNSC(flags = 2), ASC(flags = 2)), controlSpeed1(SpeedConsign(flags = 2), Speed(flags = 2), AccelerationConsign(flags = 2), speedErrorModel1(SpeedConsign(flags = 2), Speed(flags = 2), SpeedError(flags = 2), vhd(flags = 2), vh(flags = 2), vzd(flags = 2), vz(flags = 2), HSE(flags = 2), ASE(flags = 2)), PID(u(flags = 2), y(flags = 2), P(u(flags = 2), y(flags = 2)), I(u(flags = 2), y(flags = 2)), D(u(flags = 2), y(flags = 2), x(flags = 2)), Gain(u(flags = 2), y(flags = 2)), Add(u1(flags = 2), u2(flags = 2), u3(flags = 2), y(flags = 2))), PID2(u(flags = 2), y(flags = 2), P(u(flags = 2), y(flags = 2)), I(u(flags = 2), y(flags = 2)), D(u(flags = 2), y(flags = 2), x(flags = 2)), Gain(u(flags = 2), y(flags = 2)), Add(u1(flags = 2), u2(flags = 2), u3(flags = 2), y(flags = 2))), PID1(u(flags = 2), y(flags = 2), P(u(flags = 2), y(flags = 2)), I(u(flags = 2), y(flags = 2)), D(u(flags = 2), y(flags = 2), x(flags = 2)), Gain(u(flags = 2), y(flags = 2)), Add(u1(flags = 2), u2(flags = 2), u3(flags = 2), y(flags = 2)))), computeThrustAndAttitudeConsign1(AccelerationConsign(flags = 2), Attitude(flags = 2), AttitudeAPConsigns(flags = 2), TotalThrustAP(flags = 2), HAC(flags = 2), Rpsi(flags = 2), Apsi(flags = 2), InvApsi(flags = 2), AAC(flags = 2)), selectSpeedConsign1(NavigationVelocityConsign(flags = 2), VelocityConsign(flags = 2))),
Icon(coordinateSystem(extent = {{-150, -125}, {150, 125}}, initialScale = 0.1), graphics = {Rectangle(fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid, extent = {{-150, 126.7}, {150, -126.7}}), Text(origin = {0, 18}, extent = {{-88, 26}, {88, -26}}, textString = "%name")}),
experiment(StopTime = 1, StartTime = 0, Interval = 0.002, MaxInterval = "0.001"));
end LowLevelFlightControlSystem;

514
SimulationModels/AIDAModelica/ModelicaLicense2.mo

@ -0,0 +1,514 @@ @@ -0,0 +1,514 @@
within AIDAModelica;
class ModelicaLicense2 "Modelica License 2"
annotation (Documentation(info="<html>
<head>
<title>The Modelica License 2</title>
<style type=\"text/css\">
* { font-size: 10pt; font-family: Arial,sans-serif; }
code { font-size: 9pt; font-family: Courier,monospace;}
h6 { font-size: 10pt; font-weight: bold; color: green; }
h5 { font-size: 11pt; font-weight: bold; color: green; }
h4 { font-size: 13pt; font-weight: bold; color: green; }
address { font-weight: normal}
td { solid #000; vertical-align:top; }
th { solid #000; vertical-align:top; font-weight: bold; }
table { solid #000; border-collapse: collapse;}
</style>
</head>
<body lang=\"en-US\">
<p>All files in this directory and in all subdirectories are released under
the &quot;Modelica License&nbsp;2&quot; (if not explicitly noted
otherwise).</p>
<p><a href=\"#The_Modelica_License_2-outline\">The Modelica
License&nbsp;2</a><br>
<a href=\"#How_to_Apply_the_Modelica_License_2-outline\">How to Apply the
Modelica License&nbsp;2</a><br>
<a href=\"#Frequently_Asked_Questions-outline\">Frequently Asked
Questions</a><br></p>
<hr>
<h4><a name=\"The_Modelica_License_2-outline\" id=
\"The_Modelica_License_2-outline\"></a>The Modelica License&nbsp;2</h4>
<p><strong>Preamble.</strong> The goal of this license is that Modelica
related model libraries, software, images, documents, data files etc. can
be used freely in the original or a modified form, in open source and in
commercial environments (as long as the license conditions below are
fulfilled, in particular sections&nbsp;2c) and 2d). The Original Work is
provided free of charge and the use is completely at your own risk.
Developers of free Modelica packages are encouraged to utilize this license
for their work.</p>
<p>The Modelica License applies to any Original Work that contains the
following licensing notice adjacent to the copyright notice(s) for this
Original Work:</p>
<p><strong>Licensed by &lt;name of Licensor&gt; under the Modelica
License&nbsp;2</strong></p>
<p><strong>1. Definitions.</strong></p>
<ol type=\"a\">
<li>&quot;License&quot; is this Modelica License.</li>
<li>&quot;Original Work&quot; is any work of authorship, including
software, images, documents, data files, that contains the above
licensing notice or that is packed together with a licensing notice
referencing it.</li>
<li>&quot;Licensor&quot; is the provider of the Original Work who has
placed this licensing notice adjacent to the copyright notice(s) for
the Original Work. The Original Work is either directly provided by the
owner of the Original Work, or by a licensee of the owner.</li>
<li>&quot;Derivative Work&quot; is any modification of the Original
Work which represents, as a whole, an original work of authorship. For
the matter of clarity and as examples:
<ol type=\"a\">
<li>Derivative Work shall not include work that remains
separable from the Original Work, as well as merely extracting
a part of the Original Work without modifying it.</li>
<li>Derivative Work shall not include (a) fixing of errors
and/or (b) adding vendor specific Modelica annotations and/or
(c) using a subset of the classes of a Modelica package, and/or
(d) using a different representation, e.g., a binary
representation.</li>
<li>Derivative Work shall include classes that are copied from
the Original Work where declarations, equations or the
documentation are modified.</li>
<li>Derivative Work shall include executables to simulate the
models that are generated by a Modelica translator based on the
Original Work (of a Modelica package).</li>
</ol>
</li>
<li>&quot;Modified Work&quot; is any modification of the Original
Work with the following exceptions: (a) fixing of errors and/or (b)
adding vendor specific Modelica annotations and/or (c) using a subset
of the classes of a Modelica package, and/or (d) using a different
representation, e.g., a binary representation.</li>
<li>&quot;Source Code&quot; means the preferred form of the Original
Work for making modifications to it and all available documentation
describing how to modify the Original Work.</li>
<li>&quot;You&quot; means an individual or a legal entity exercising
rights under, and complying with all of the terms of, this
License.</li>
<li>&quot;Modelica package&quot; means any Modelica library that is
defined with the
&quot;<code><strong>package</strong>&nbsp;&lt;Name&gt;&nbsp;...&nbsp;<strong>end</strong>&nbsp;&lt;Name&gt;;</code>&quot;
Modelica language element.</li>
</ol>
<p><strong>2. Grant of Copyright License.</strong> Licensor grants You a
worldwide, royalty-free, non-exclusive, sublicensable license, for the
duration of the copyright, to do the following:</p>
<ol type=\"a\">
<li>
<p>To reproduce the Original Work in copies, either alone or as
part of a collection.</p>
</li>
<li>
<p>To create Derivative Works according to Section&nbsp;1d) of this
License.</p>
</li>
<li>
<p>To distribute or communicate to the public copies of the
<u>Original Work</u> or a <u>Derivative Work</u> under <u>this
License</u>. No fee, neither as a copyright-license fee, nor as a
selling fee for the copy as such may be charged under this License.
Furthermore, a verbatim copy of this License must be included in
any copy of the Original Work or a Derivative Work under this
License.<br>
For the matter of clarity, it is permitted A) to distribute or
communicate such copies as part of a (possible commercial)
collection where other parts are provided under different licenses
and a license fee is charged for the other parts only and B) to
charge for mere printing and shipping costs.</p>
</li>
<li>
<p>To distribute or communicate to the public copies of a
<u>Derivative Work</u>, alternatively to Section&nbsp;2c), under
<u>any other license</u> of your choice, especially also under a
license for commercial/proprietary software, as long as You comply
with Sections&nbsp;3, 4 and 8 below.<br>
For the matter of clarity, no restrictions regarding fees, either
as to a copyright-license fee or as to a selling fee for the copy
as such apply.</p>
</li>
<li>
<p>To perform the Original Work publicly.</p>
</li>
<li>
<p>To display the Original Work publicly.</p>
</li>
</ol>
<p><strong>3. Acceptance.</strong> Any use of the Original Work or a
Derivative Work, or any action according to either Section&nbsp;2a) to 2f)
above constitutes Your acceptance of this License.</p>
<p><strong>4. Designation of Derivative Works and of Modified
Works.</strong> The identifying designation of Derivative Work and of
Modified Work must be different to the corresponding identifying
designation of the Original Work. This means especially that the
(root-level) name of a Modelica package under this license must be changed
if the package is modified (besides fixing of errors, adding vendor
specific Modelica annotations, using a subset of the classes of a Modelica
package, or using another representation, e.g. a binary
representation).</p>
<p><strong>5. Grant of Patent License.</strong> Licensor grants You a
worldwide, royalty-free, non-exclusive, sublicensable license, under patent
claims owned by the Licensor or licensed to the Licensor by the owners of
the Original Work that are embodied in the Original Work as furnished by
the Licensor, for the duration of the patents, to make, use, sell, offer
for sale, have made, and import the Original Work and Derivative Works
under the conditions as given in Section&nbsp;2. For the matter of clarity,
the license regarding Derivative Works covers patent claims to the extent
as they are embodied in the Original Work only.</p>
<p><strong>6. Provision of Source Code.</strong> Licensor agrees to provide
You with a copy of the Source Code of the Original Work but reserves the
right to decide freely on the manner of how the Original Work is
provided.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;For the matter of clarity, Licensor
might provide only a binary representation of the Original Work. In that
case, You may (a) either reproduce the Source Code from the binary
representation if this is possible (e.g., by performing a copy of an
encrypted Modelica package, if encryption allows the copy operation) or (b)
request the Source Code from the Licensor who will provide it to You.</p>
<p><strong>7. Exclusions from License Grant.</strong> Neither the names of
Licensor, nor the names of any contributors to the Original Work, nor any
of their trademarks or service marks, may be used to endorse or promote
products derived from this Original Work without express prior permission
of the Licensor. Except as otherwise expressly stated in this License and
in particular in Sections&nbsp;2 and 5, nothing in this License grants any
license to Licensor&apos;s trademarks, copyrights, patents, trade secrets or any
other intellectual property, and no patent license is granted to make, use,
sell, offer for sale, have made, or import embodiments of any patent
claims.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;No license is granted to the trademarks
of Licensor even if such trademarks are included in the Original Work,
except as expressly stated in this License. Nothing in this License shall
be interpreted to prohibit Licensor from licensing under terms different
from this License any Original Work that Licensor otherwise would have a
right to license.</p>
<p><strong>8. Attribution Rights.</strong> You must retain in the Source
Code of the Original Work and of any Derivative Works that You create, all
author, copyright, patent, or trademark notices, as well as any descriptive
text identified therein as an &quot;Attribution Notice&quot;. The same
applies to the licensing notice of this License in the Original Work. For
the matter of clarity, &quot;author notice&quot; means the notice that
identifies the original author(s).<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;You must cause the Source Code for any
Derivative Works that You create to carry a prominent Attribution Notice
reasonably calculated to inform recipients that You have modified the
Original Work.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;In case the Original Work or Derivative
Work is not provided in Source Code, the Attribution Notices shall be
appropriately displayed, e.g., in the documentation of the Derivative
Work.</p>
<p><strong>9. Disclaimer of Warranty.<br></strong> <u><strong>The Original
Work is provided under this License on an &quot;as is&quot; basis and
without warranty, either express or implied, including, without limitation,
the warranties of non-infringement, merchantability or fitness for a
particular purpose. The entire risk as to the quality of the Original Work
is with You.</strong></u> This disclaimer of warranty constitutes an
essential part of this License. No license to the Original Work is granted
by this License except under this disclaimer.</p>
<p><strong>10. Limitation of Liability.</strong> Under no circumstances and
under no legal theory, whether in tort (including negligence), contract, or
otherwise, shall the Licensor, the owner or a licensee of the Original Work
be liable to anyone for any direct, indirect, general, special, incidental,
or consequential damages of any character arising as a result of this
License or the use of the Original Work including, without limitation,
damages for loss of goodwill, work stoppage, computer failure or
malfunction, or any and all other commercial damages or losses. This
limitation of liability shall not apply to the extent applicable law
prohibits such limitation.</p>
<p><strong>11. Termination.</strong> This License conditions your rights to
undertake the activities listed in Section&nbsp;2 and 5, including your
right to create Derivative Works based upon the Original Work, and doing so
without observing these terms and conditions is prohibited by copyright law
and international treaty. Nothing in this License is intended to affect
copyright exceptions and limitations. This License shall terminate
immediately and You may no longer exercise any of the rights granted to You
by this License upon your failure to observe the conditions of this
license.</p>
<p><strong>12. Termination for Patent Action.</strong> This License shall
terminate automatically and You may no longer exercise any of the rights
granted to You by this License as of the date You commence an action,
including a cross-claim or counterclaim, against Licensor, any owners of
the Original Work or any licensee alleging that the Original Work infringes
a patent. This termination provision shall not apply for an action alleging
patent infringement through combinations of the Original Work under
combination with other software or hardware.</p>
<p><strong>13. Jurisdiction.</strong> Any action or suit relating to this
License may be brought only in the courts of a jurisdiction wherein the
Licensor resides and under the laws of that jurisdiction excluding its
conflict-of-law provisions. The application of the United Nations
Convention on Contracts for the International Sale of Goods is expressly
excluded. Any use of the Original Work outside the scope of this License or
after its termination shall be subject to the requirements and penalties of
copyright or patent law in the appropriate jurisdiction. This section shall
survive the termination of this License.</p>
<p><strong>14. Attorneys&apos; Fees.</strong> In any action to enforce the terms
of this License or seeking damages relating thereto, the prevailing party
shall be entitled to recover its costs and expenses, including, without
limitation, reasonable attorneys&apos; fees and costs incurred in connection
with such action, including any appeal of such action. This section shall
survive the termination of this License.</p>
<p><strong>15. Miscellaneous.</strong></p>
<ol type=\"a\">
<li>If any provision of this License is held to be unenforceable, such
provision shall be reformed only to the extent necessary to make it
enforceable.</li>
<li>No verbal ancillary agreements have been made. Changes and
additions to this License must appear in writing to be valid. This also
applies to changing the clause pertaining to written form.</li>
<li>You may use the Original Work in all ways not otherwise restricted
or conditioned by this License or by law, and Licensor promises not to
interfere with or be responsible for such uses by You.</li>
</ol>
<hr>
<h4><a name=\"How_to_Apply_the_Modelica_License_2-outline\" id=
\"How_to_Apply_the_Modelica_License_2-outline\"></a> How to Apply the
Modelica License&nbsp;2</h4>
<p>At the top level of your Modelica package and at every important
subpackage, add the following notices in the info layer of the package:</p>
<p>Licensed by &lt;Licensor&gt; under the Modelica License&nbsp;2<br>
Copyright &copy; &lt;year1&gt;-&lt;year2&gt;, &lt;name of copyright
holder(s)&gt;.</p>
<p><em>This Modelica package is <u>free</u> software and the use is
completely at <u>your own risk</u>; it can be redistributed and/or modified
under the terms of the Modelica License&nbsp;2. For license conditions
(including the disclaimer of warranty) see <a href=
\"modelica://Modelica.UsersGuide.ModelicaLicense2\">Modelica.UsersGuide.ModelicaLicense2</a>
or visit <a href=
\"http://www.modelica.org/licenses/ModelicaLicense2\">http://www.modelica.org/licenses/ModelicaLicense2</a>.</em></p>
<p>Include a copy of the Modelica License&nbsp;2 under
<strong>&lt;library&gt;.UsersGuide.ModelicaLicense2</strong> (use <a href=
\"http://www.modelica.org/licenses/ModelicaLicense2.mo\">http://www.modelica.org/licenses/ModelicaLicense2.mo</a>).
Furthermore, add the list of authors and contributors under
<strong>&lt;library&gt;.UsersGuide.Contributors</strong> or
<strong>&lt;library&gt;.UsersGuide.Contact</strong>.</p>
<p>For example, sublibrary Modelica.Blocks of the Modelica Standard Library
may have the following notices:</p>
<p>Licensed by Modelica Association under the Modelica License&nbsp;2<br>
Copyright &copy; 1998-2008, Modelica Association.</p>
<p><em>This Modelica package is <u>free</u> software and the use is
completely at <u>your own risk</u>; it can be redistributed and/or modified
under the terms of the Modelica License&nbsp;2. For license conditions
(including the disclaimer of warranty) see <a href=
\"modelica://Modelica.UsersGuide.ModelicaLicense2\">Modelica.UsersGuide.ModelicaLicense2</a>
or visit <a href=
\"http://www.modelica.org/licenses/ModelicaLicense2\">http://www.modelica.org/licenses/ModelicaLicense2</a>.</em></p>
<p>For C-source code and documents, add similar notices in the
corresponding file.</p>
<p>For images, add a &quot;readme.txt&quot; file to the directories where
the images are stored and include a similar notice in this file.</p>
<p>In these cases, save a copy of the Modelica License&nbsp;2 in one
directory of the distribution, e.g., <a href=
\"http://www.modelica.org/licenses/ModelicaLicense2.html\">http://www.modelica.org/licenses/ModelicaLicense2.html</a>
in directory
<strong>&lt;library&gt;/Resources/Documentation/ModelicaLicense2.html</strong>.</p>
<hr>
<h5><a name=\"Frequently_Asked_Questions-outline\" id=
\"Frequently_Asked_Questions-outline\"></a> Frequently Asked Questions</h5>
<p>This section contains questions/answer to users and/or distributors of
Modelica packages and/or documents under Modelica License&nbsp;2. Note, the
answers to the questions below are not a legal interpretation of the
Modelica License&nbsp;2. In case of a conflict, the language of the license
shall prevail.</p>
<h6>Using or Distributing a Modelica <u>Package</u> under the Modelica
License&nbsp;2</h6>
<p><strong>What are the main differences to the previous version of the
Modelica License?</strong></p>
<ol>
<li>
<p>Modelica License&nbsp;1 is unclear whether the licensed Modelica
package can be distributed under a different license.
Version&nbsp;2 explicitly allows that &quot;Derivative Work&quot;
can be distributed under any license of Your choice, see examples
in Section&nbsp;1d) as to what qualifies as Derivative Work (so,
version&nbsp;2 is clearer).</p>
</li>
<li>
<p>If You modify a Modelica package under Modelica License&nbsp;2
(besides fixing of errors, adding vendor specific Modelica
annotations, using a subset of the classes of a Modelica package,
or using another representation, e.g., a binary representation),
you must rename the root-level name of the package for your
distribution. In version&nbsp;1 you could keep the name (so,
version&nbsp;2 is more restrictive). The reason of this restriction
is to reduce the risk that Modelica packages are available that
have identical names, but different functionality.</p>
</li>
<li>
<p>Modelica License&nbsp;1 states that &quot;It is not allowed to
charge a fee for the original version or a modified version of the
software, besides a reasonable fee for distribution and
support&quot;. Version&nbsp;2 has a similar intention for all
Original Work under <u>Modelica License&nbsp;2</u> (to remain free
of charge and open source) but states this more clearly as
&quot;No fee, neither as a copyright-license fee, nor as a selling
fee for the copy as such may be charged&quot;. Contrary to
version&nbsp;1, Modelica License&nbsp;2 has no restrictions on fees
for Derivative Work that is provided under a different license (so,
version&nbsp;2 is clearer and has fewer restrictions).</p>
</li>
<li>
<p>Modelica License&nbsp;2 introduces several useful provisions for
the licensee (articles&nbsp;5, 6, 12), and for the licensor
(articles&nbsp;7, 12, 13, 14) that have no counter part in
version&nbsp;1.</p>
</li>
<li>
<p>Modelica License&nbsp;2 can be applied to all type of work,
including documents, images and data files, contrary to
version&nbsp;1 that was dedicated for software only (so,
version&nbsp;2 is more general).</p>
</li>
</ol>
<p><strong>Can I distribute a Modelica package (under Modelica
License&nbsp;2) as part of my commercial Modelica modeling and simulation
environment?</strong></p>
<p>Yes, according to Section&nbsp;2c). However, you are not allowed to
charge a fee for this part of your environment. Of course, you can charge
for your part of the environment.</p>
<p><strong>Can I distribute a Modelica package (under Modelica
License&nbsp;2) under a different license?</strong></p>
<p>No. The license of an unmodified Modelica package cannot be changed
according to Sections&nbsp;2c) and 2d). This means that you cannot
<u>sell</u> copies of it, any distribution has to be free of charge.</p>
<p><strong>Can I distribute a Modelica package (under Modelica
License&nbsp;2) under a different license when I first encrypt the
package?</strong></p>
<p>No. Merely encrypting a package does not qualify for Derivative Work and
therefore the encrypted package has to stay under Modelica
License&nbsp;2.</p>
<p><strong>Can I distribute a Modelica package (under Modelica
License&nbsp;2) under a different license when I first add classes to the
package?</strong></p>
<p>No. The package itself remains unmodified, i.e., it is Original Work,
and therefore the license for this part must remain under Modelica
License&nbsp;2. The newly added classes can be, however, under a different
license.</p>
<p><strong>Can I copy a class out of a Modelica package (under Modelica
License&nbsp;2) and include it</strong> <u><strong>unmodified</strong></u>
<strong>in a Modelica package under a</strong>
<u><strong>commercial/proprietary</strong></u>
<strong>license?</strong></p>
<p>No, according to article&nbsp;2c). However, you can include model,
block, function, package, record and connector classes in your Modelica
package under <u>Modelica License&nbsp;2</u>. This means that your Modelica
package could be under a commercial/proprietary license, but one or more
classes of it are under Modelica License&nbsp;2.<br>
Note, a &quot;type&quot; class (e.g., type Angle =
Real(unit=&quot;rad&quot;)) can be copied and included unmodified under a
commercial/proprietary license (for details, see the next question).</p>
<p><strong>Can I copy a type class or</strong> <u><strong>part</strong></u>
<strong>of a model, block, function, record, connector class, out of a
Modelica package (under Modelica License&nbsp;2) and include it modified or
unmodified in a Modelica package under a</strong>
<u><strong>commercial/proprietary</strong></u>
<strong>license?</strong></p>
<p>Yes, according to article&nbsp;2d), since this will in the end usually
qualify as Derivative Work. The reasoning is the following: A type class or
part of another class (e.g., an equation, a declaration, part of a class
description) cannot be utilized &quot;by its own&quot;. In order to make
this &quot;usable&quot;, you have to add additional code in order that
the class can be utilized. This is therefore usually Derivative Work and
Derivative Work can be provided under a different license. Note, this only
holds, if the additional code introduced is sufficient to qualify for
Derivative Work. Merely, just copying a class and changing, say, one
character in the documentation of this class would be no Derivative Work
and therefore the copied code would have to stay under Modelica
License&nbsp;2.</p>
<p><strong>Can I copy a class out of a Modelica package (under Modelica
License&nbsp;2) and include it in</strong> <u><strong>modified</strong></u>
<strong>form in a</strong> <u><strong>commercial/proprietary</strong></u>
<strong>Modelica package?</strong></p>
<p>Yes. If the modification can be seen as a &quot;Derivative Work&quot;,
you can place it under your commercial/proprietary license. If the
modification does not qualify as &quot;Derivative Work&quot; (e.g., bug
fixes, vendor specific annotations), it must remain under Modelica
License&nbsp;2. This means that your Modelica package could be under a
commercial/proprietary license, but one or more parts of it are under
Modelica License&nbsp;2.</p>
<p><strong>Can I distribute a &quot;save total model&quot; under my
commercial/proprietary license, even if classes under Modelica
License&nbsp;2 are included?</strong></p>
<p>Your classes of the &quot;save total model&quot; can be distributed
under your commercial/proprietary license, but the classes under Modelica
License&nbsp;2 must remain under Modelica License&nbsp;2. This means you
can distribute a &quot;save total model&quot;, but some parts might be
under Modelica License&nbsp;2.</p>
<p><strong>Can I distribute a Modelica package (under Modelica
License&nbsp;2) in encrypted form?</strong></p>
<p>Yes. Note, if the encryption does not allow &quot;copying&quot; of
classes (in to unencrypted Modelica source code), you have to send the
Modelica source code of this package to your customer, if he/she wishes it,
according to article&nbsp;6.</p>
<p><strong>Can I distribute an executable under my commercial/proprietary
license, if the model from which the executable is generated uses models
from a Modelica package under Modelica License&nbsp;2?</strong></p>
<p>Yes, according to article&nbsp;2d), since this is seen as Derivative
Work. The reasoning is the following: An executable allows the simulation
of a concrete model, whereas models from a Modelica package (without
pre-processing, translation, tool run-time library) are not able to be
simulated without tool support. By the processing of the tool and by its
run-time libraries, significant new functionality is added (a model can be
simulated whereas previously it could not be simulated) and functionality
available in the package is removed (e.g., to build up a new model by
dragging components of the package is no longer possible with the
executable).</p>
<p><strong>Is my modification to a Modelica package (under Modelica
License&nbsp;2) a Derivative Work?</strong></p>
<p>It is not possible to give a general answer to it. To be regarded as
&quot;an original work of authorship&quot;, a derivative work must be
different enough from the original or must contain a substantial amount of
new material. Making minor changes or additions of little substance to a
preexisting work will not qualify the work as a new version for such
purposes.</p>
<h6>Using or Distributing a Modelica <u>Document</u> under the Modelica
License&nbsp;2</h6>
<p>This section is devoted especially for the following applications:</p>
<ol type=\"a\">
<li>
<p>A Modelica tool extracts information out of a Modelica package
and presents the result in form of a &quot;manual&quot; for this
package in, e.g., html, doc, or pdf format.</p>
</li>
<li>
<p>The Modelica language specification is a document defining the
Modelica language. It will be licensed under Modelica
License&nbsp;2.</p>
</li>
<li>
<p>Someone writes a book about the Modelica language and/or
Modelica packages and uses information which is available in the
Modelica language specification and/or the corresponding Modelica
package.</p>
</li>
</ol>
<p><strong>Can I sell a manual that was basically derived by extracting
information automatically from a Modelica package under Modelica
License&nbsp;2 (e.g., a &quot;reference guide&quot; of the Modelica
Standard Library)?</strong></p>
<p>Yes. Extracting information from a Modelica package, and providing it in
a human readable, suitable format, like html, doc or pdf format, where the
content is significantly modified (e.g. tables with interface information
are constructed from the declarations of the public variables) qualifies as
Derivative Work and there are no restrictions to charge a fee for
Derivative Work under alternative&nbsp;2d).</p>
<p><strong>Can I copy a text passage out of a Modelica document (under
Modelica License&nbsp;2) and use it</strong>
<u><strong>unmodified</strong></u> <strong>in my document (e.g. the
Modelica syntax description in the Modelica Specification)?</strong></p>
<p>Yes. In case you distribute your document, the copied parts are still
under Modelica License&nbsp;2 and you are not allowed to charge a license
fee for this part. You can, of course, charge a fee for the rest of your
document.</p>
<p><strong>Can I copy a text passage out of a Modelica document (under
Modelica License&nbsp;2) and use it in</strong>
<u><strong>modified</strong></u> <strong>form in my document?</strong></p>
<p>Yes, the creation of Derivative Works is allowed. In case the content is
significantly modified this qualifies as Derivative Work and there are no
restrictions to charge a fee for Derivative Work under
alternative&nbsp;2d).</p>
<p><strong>Can I sell a printed version of a Modelica document (under
Modelica License&nbsp;2), e.g., the Modelica Language
Specification?</strong></p>
<p>No, if you are not the copyright-holder, since article&nbsp;2c) does not
allow a selling fee for a (in this case physical) copy. However, mere
printing and shipping costs may be recovered.</p>
</body>
</html>"));
end ModelicaLicense2;

22
SimulationModels/AIDAModelica/MotorControl.mo

@ -0,0 +1,22 @@ @@ -0,0 +1,22 @@
within AIDAModelica;
model MotorControl "Motor Control Model"
// CP: 65001
// SimulationX Version: 3.8.2.45319
Modelica.Blocks.Interfaces.RealInput MotorKRate(quantity = "Mechanics.Rotation.RotVelocity", displayUnit = "rpm") "Desired angular velocity of k-th motor" annotation(
Placement(transformation(extent = {{-65, -40}, {-25, 0}}), iconTransformation(origin = {-100, 0}, extent = {{-20, -20}, {20, 20}})));
Modelica.Blocks.Interfaces.RealOutput ThrottleCommandK(quantity = "Basics.Unitless", displayUnit = "-") "K-th command output" annotation(
Placement(transformation(extent = {{60, -30}, {80, -10}}), iconTransformation(extent = {{90, -10}, {110, 10}})));
ControlMotor controlMotor1 annotation(
Placement(transformation(extent = {{10, -30}, {30, -10}})));
equation
connect(controlMotor1.ComdKD, ThrottleCommandK) annotation(
Line(points = {{30, -20}, {35, -20}, {65, -20}, {70, -20}}, color = {0, 0, 127}, thickness = 0.0625));
connect(controlMotor1.DAngVel, MotorKRate) annotation(
Line(points = {{10, -20}, {5, -20}, {-40, -20}, {-45, -20}}, color = {0, 0, 127}, thickness = 0.0625));
annotation(
MotorKRate(flags = 2),
ThrottleCommandK(flags = 2),
Icon(coordinateSystem(extent = {{-100, -50}, {100, 50}}, initialScale = 0.1), graphics = {Rectangle(fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid, extent = {{-100, 50}, {103.3, -50}}), Text(origin = {-3, 0}, extent = {{-31, 8}, {31, -8}}, textString = "%name")}),
experiment(StopTime = 1, StartTime = 0, Interval = 0.002, MaxInterval = "0.001"));
end MotorControl;

23
SimulationModels/AIDAModelica/MotorPropellerModel.mo

@ -0,0 +1,23 @@ @@ -0,0 +1,23 @@
within AIDAModelica;
model MotorPropellerModel "Motor-Propeller model"
// CP: 65001
// SimulationX Version: 3.8.2.45319 x64
Modelica.Blocks.Interfaces.RealInput ThrottleCommandK "K-th command input" annotation(
Placement(transformation(extent = {{-140, 40}, {-100, 80}}), iconTransformation(extent = {{-120, -20}, {-80, 20}})));
Modelica.Blocks.Interfaces.RealOutput MotorKAngularVelocity(quantity = "Mechanics.Rotation.RotVelocity", displayUnit = "rpm") "Angular velocity of the k-th motor-propeller system" annotation(
Placement(transformation(extent = {{-35, 50}, {-15, 70}}), iconTransformation(extent = {{90, -10}, {110, 10}})));
CreateMotion createMotion1 annotation(
Placement(transformation(extent = {{-75, 55}, {-55, 65}})));
equation
connect(createMotion1.ThrottleCommandK, ThrottleCommandK) annotation(
Line(points = {{-75, 60}, {-80, 60}, {-115, 60}, {-120, 60}}, color = {0, 0, 127}, thickness = 0.0625));
connect(createMotion1.MotorKAngularVelocity, MotorKAngularVelocity) annotation(
Line(points = {{-55.3, 60}, {-50.3, 60}, {-30, 60}, {-25, 60}}, color = {0, 0, 127}, thickness = 0.0625));
annotation(
ThrottleCommandK(flags = 2),
MotorKAngularVelocity(flags = 2),
createMotion1(ThrottleCommandK(flags = 2), MotorKAngularVelocity(flags = 2), W(u(flags = 2), y(flags = 2)), wSSModel1(CmdKIn(flags = 2), WSSOut(flags = 2))),
Icon(coordinateSystem(extent = {{-100, -125}, {100, 125}}, initialScale = 0.1), graphics = {Rectangle(fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid, extent = {{-99.9, 49.9}, {100, -50}}), Text(origin = {-5, 2}, extent = {{-33, 12}, {33, -12}}, textString = "%name")}),
experiment(StopTime = 1, StartTime = 0, Interval = 0.002, MaxInterval = "0.001"));
end MotorPropellerModel;

120
SimulationModels/AIDAModelica/PID_2.mo

@ -0,0 +1,120 @@ @@ -0,0 +1,120 @@
// CP: 65001
// SimulationX Version: 3.8.2.45319 x64
//Licensed by 2000-2019 Modelica Association & al. under the Modelica License 2
//Copyright © 2000-2019, Modelica Association & al.
within AIDAModelica;
model PID_2 "PID_2"
import Modelica.Blocks.Types.InitPID;
import Modelica.Blocks.Types.Init;
import Modelica.Blocks;
Modelica.Blocks.Interfaces.RealInput u "'input Real' as connector" annotation(Placement(
transformation(
origin={-126,86},
extent={{-14,-14},{14,14}}),
iconTransformation(
origin={-50,-100},
extent={{-20,-20},{20,20}},
rotation=90)));
Modelica.Blocks.Interfaces.RealInput du "'input Real' as connector" annotation(Placement(
transformation(
origin={-116,-82},
extent={{-14,-14},{14,14}}),
iconTransformation(
origin={50,-100},
extent={{-20,-20},{20,20}},
rotation=90)));
Blocks.Interfaces.RealOutput y annotation(Placement(
transformation(
origin={110,0},
extent={{-10,-10},{10,10}}),
iconTransformation(
origin={110,0},
extent={{-10,-10},{10,10}})));
Modelica.Blocks.Interfaces.RealInput Consign "'input Real' as connector" annotation(Placement(
transformation(
origin={-126,30},
extent={{-12,-12},{12,12}}),
iconTransformation(
origin={-100,0},
extent={{-20,-20},{20,20}})));
parameter Real k(unit="1")=1 "Gain";
parameter Real Ti(
min=Modelica.Constants.small,
start=0.5) "Time Constant of Integrator";
parameter Real Td(
min=0,
start=0.1) "Time Constant of Derivative block";
parameter Blocks.Types.InitPID initType=Blocks.Types.InitPID.DoNotUse_InitialIntegratorState "Type of initialization (1: no init, 2: steady state, 3: initial state, 4: initial output)" annotation(
Evaluate=true,
Dialog(group="Initialization"));
parameter Real xi_start=0 "Initial or guess value value for integrator output (= integrator state)" annotation(Dialog(group="Initialization"));
parameter Real xd_start=0 "Initial or guess value for state of derivative block" annotation(Dialog(group="Initialization"));
parameter Real y_start=0 "Initial value of output" annotation(Dialog(
group="Initialization",
enable=initType==InitPID.InitialOutput));
constant Real unitTime=1 annotation(HideResult=true);
Modelica.Blocks.Math.Gain P(k=1) "Proportional part of PID controller" annotation(Placement(transformation(
origin={-28,68},
extent={{-10,-10},{10,10}})));
Modelica.Blocks.Math.Gain D(k=Td) "Derivative part of PID controller, with derivate received at input du" annotation(Placement(transformation(
origin={-27,-41},
extent={{-9,-9},{9,9}})));
Modelica.Blocks.Continuous.Integrator I(
k=unitTime / Ti,
initType=if initType == InitPID.SteadyState then Init.SteadyState else if initType == InitPID.InitialState or initType == InitPID.DoNotUse_InitialIntegratorState then Init.InitialState else Init.NoInit,
y_start=xi_start) "Integral part of PID controller" annotation(Placement(transformation(
origin={-28,30},
extent={{-10,-10},{10,10}})));
Blocks.Math.Gain Gain(k=k) "Gain of PID controller" annotation(Placement(transformation(extent={{60,-10},{80,10}})));
Blocks.Math.Add3 Add annotation(Placement(transformation(extent={{20,-10},{40,10}})));
Modelica.Blocks.Math.Feedback feedback1 annotation(Placement(transformation(
origin={-68,30},
extent={{-14,14},{14,-14}})));
Modelica.Blocks.Math.Feedback feedback2 annotation(Placement(transformation(
origin={-64,-42},
extent={{-10,-10},{10,10}})));
Modelica.Blocks.Continuous.Derivative derivative1 annotation(Placement(transformation(
origin={-90,-42},
extent={{-10,-10},{10,10}})));
initial equation
if initType == InitPID.InitialOutput then
y = y_start;
end if;
equation
connect(derivative1.y, feedback2.u1) annotation(
Line(points = {{-79, -42}, {-79, -44}, {-72, -44}, {-72, -42}}, color = {0, 0, 127}));
connect(Consign, derivative1.u) annotation(
Line(points = {{-126, 30}, {-102, 30}, {-102, -42}}, color = {0, 0, 127}));
connect(du, feedback2.u2) annotation(
Line(points = {{-116, -82}, {-64, -82}, {-64, -50}}, color = {0, 0, 127}));
connect(feedback2.y,D.u) annotation(Line(
points={{-55,-42},{-50,-42},{-42.7,-42},{-42.7,-41},{-37.7,-41}},
color={0,0,127}));
connect(D.y, Add.u3) annotation(
Line(points = {{-17, -41}, {0, -41}, {0, -8}, {18, -8}}, color = {0, 0, 127}));
connect(Consign,feedback1.u1) annotation(Line(
points={{-126,30},{-121,30},{-84.3,30},{-79.3,30}},
color={0,0,127}));
connect(u,feedback1.u2) annotation(Line(
points={{-126,86},{-121,86},{-68,86},{-68,46.3},{-68,41.3}},
color={0,0,127}));
connect(feedback1.y,P.u) annotation(Line(
points={{-55.3,30},{-50.3,30},{-45,30},{-45,68},{-40,68}},
color={0,0,127}));
connect(I.u,feedback1.y) annotation(Line(
points={{-40,30},{-45,30},{-50.3,30},{-55.3,30}},
color={0,0,127}));
connect(I.y, Add.u2) annotation(
Line(points = {{-17, 30}, {-0.5, 30}, {-0.5, 0}, {18, 0}}, color = {0, 0, 127}));
connect(P.y, Add.u1) annotation(
Line(points = {{-17, 68}, {0, 68}, {0, 8}, {18, 8}}, color = {0, 0, 127}));
connect(y,Gain.y) annotation(Line(
points={{110,0},{105,0},{86,0},{81,0}},
color={0,0,127}));
connect(Add.y, Gain.u) annotation(
Line(points = {{41, 0}, {58, 0}}, color = {0, 0, 127}));
annotation(experiment(
StopTime=1,
StartTime=0,
Interval=0.001));
end PID_2;

134
SimulationModels/AIDAModelica/PID_discrete.mo

@ -0,0 +1,134 @@ @@ -0,0 +1,134 @@
within AIDAModelica;
block PID_discrete "PID-controller in additive description form"
import Modelica.Blocks.Types.InitPID;
import Modelica.Blocks.Types.Init;
extends Modelica.Blocks.Interfaces.SISO;
parameter Real k(unit = "1") = 1 "Gain";
parameter SIunits.Time Ti(min = Modelica.Constants.small, start = 0.5) "Time Constant of Integrator";
parameter SIunits.Time Td(min = 0, start = 0.1) "Time Constant of Derivative block";
parameter Real Nd(min = Modelica.Constants.small) = 10 "The higher Nd, the more ideal the derivative block";
parameter Modelica.Blocks.Types.InitPID initType = Modelica.Blocks.Types.InitPID.DoNotUse_InitialIntegratorState "Type of initialization (1: no init, 2: steady state, 3: initial state, 4: initial output)" annotation(
Evaluate = true,
Dialog(group = "Initialization"));
parameter Real xi_start = 0 "Initial or guess value value for integrator output (= integrator state)" annotation(
Dialog(group = "Initialization"));
parameter Real xd_start = 0 "Initial or guess value for state of derivative block" annotation(
Dialog(group = "Initialization"));
parameter Real y_start = 0 "Initial value of output" annotation(
Dialog(enable = initType == InitPID.InitialOutput, group = "Initialization"));
constant SI.Time unitTime = 1 annotation(
HideResult = true);
Blocks.Math.Gain P(k = 1) "Proportional part of PID controller" annotation(
Placement(transformation(extent = {{-60, 60}, {-20, 100}})));
Blocks.Continuous.Integrator I(k = unitTime / Ti, y_start = xi_start, initType = if initType == InitPID.SteadyState then Init.SteadyState else if initType == InitPID.InitialState or initType == InitPID.DoNotUse_InitialIntegratorState then Init.InitialState else Init.NoInit) "Integral part of PID controller" annotation(
Placement(transformation(extent = {{-60, -20}, {-20, 20}})));
Blocks.Continuous.Derivative D(k = Td / unitTime, T = max([Td / Nd, 100 * Modelica.Constants.eps]), x_start = xd_start, initType = if initType == InitPID.SteadyState or initType == InitPID.InitialOutput then Init.SteadyState else if initType == InitPID.InitialState then Init.InitialState else Init.NoInit) "Derivative part of PID controller" annotation(
Placement(transformation(extent = {{-60, -100}, {-20, -60}})));
Blocks.Math.Gain Gain(k = k) "Gain of PID controller" annotation(
Placement(transformation(extent = {{60, -10}, {80, 10}})));
Blocks.Math.Add3 Add annotation(
Placement(transformation(extent = {{20, -10}, {40, 10}})));
initial equation
if initType == InitPID.InitialOutput then
y = y_start;
end if;
equation
connect(u, P.u) annotation(
Line(points = {{-120, 0}, {-80, 0}, {-80, 80}, {-64, 80}}, color = {0, 0, 127}));
connect(u, I.u) annotation(
Line(points = {{-120, 0}, {-64, 0}}, color = {0, 0, 127}));
connect(u, D.u) annotation(
Line(points = {{-120, 0}, {-80, 0}, {-80, -80}, {-64, -80}}, color = {0, 0, 127}));
connect(P.y, Add.u1) annotation(
Line(points = {{-18, 80}, {0, 80}, {0, 8}, {18, 8}}, color = {0, 0, 127}));
connect(I.y, Add.u2) annotation(
Line(points = {{-18, 0}, {18, 0}}, color = {0, 0, 127}));
connect(D.y, Add.u3) annotation(
Line(points = {{-18, -80}, {0, -80}, {0, -8}, {18, -8}}, color = {0, 0, 127}));
connect(Add.y, Gain.u) annotation(
Line(points = {{41, 0}, {58, 0}}, color = {0, 0, 127}));
connect(Gain.y, y) annotation(
Line(points = {{81, 0}, {110, 0}}, color = {0, 0, 127}));
annotation(
defaultComponentName = "PID",
Icon(coordinateSystem(preserveAspectRatio = true, extent = {{-100.0, -100.0}, {100.0, 100.0}}), graphics = {Line(points = {{-80.0, 78.0}, {-80.0, -90.0}}, color = {192, 192, 192}), Polygon(lineColor = {192, 192, 192}, fillColor = {192, 192, 192}, fillPattern = FillPattern.Solid, points = {{-80.0, 90.0}, {-88.0, 68.0}, {-72.0, 68.0}, {-80.0, 90.0}}), Line(points = {{-90.0, -80.0}, {82.0, -80.0}}, color = {192, 192, 192}), Polygon(lineColor = {192, 192, 192}, fillColor = {192, 192, 192}, fillPattern = FillPattern.Solid, points = {{90.0, -80.0}, {68.0, -72.0}, {68.0, -88.0}, {90.0, -80.0}}), Line(points = {{-80, -80}, {-80, -20}, {60, 80}}, color = {0, 0, 127}), Text(lineColor = {192, 192, 192}, extent = {{-20.0, -60.0}, {80.0, -20.0}}, textString = "PID"), Text(extent = {{-150.0, -150.0}, {150.0, -110.0}}, textString = "Ti=%Ti")}),
Documentation(info = "<html>
<p>
This is the text-book version of a PID-controller.
For a more practically useful PID-controller, use
block LimPID.
</p>
<p>
The PID block can be initialized in different
ways controlled by parameter <b>initType</b>. The possible
values of initType are defined in
<a href=\"modelica://Modelica.Blocks.Types.InitPID\">Modelica.Blocks.Types.InitPID</a>.
This type is identical to
<a href=\"modelica://Modelica.Blocks.Types.Init\">Types.Init</a>,
with the only exception that the additional option
<b>DoNotUse_InitialIntegratorState</b> is added for
backward compatibility reasons (= integrator is initialized with
InitialState whereas differential part is initialized with
NoInit which was the initialization in version 2.2 of the Modelica
standard library).
</p>
<p>
Based on the setting of initType, the integrator (I) and derivative (D)
blocks inside the PID controller are initialized according to the following table:
</p>
<table border=1 cellspacing=0 cellpadding=2>
<tr><td valign=\"top\"><b>initType</b></td>
<td valign=\"top\"><b>I.initType</b></td>
<td valign=\"top\"><b>D.initType</b></td></tr>
<tr><td valign=\"top\"><b>NoInit</b></td>
<td valign=\"top\">NoInit</td>
<td valign=\"top\">NoInit</td></tr>
<tr><td valign=\"top\"><b>SteadyState</b></td>
<td valign=\"top\">SteadyState</td>
<td valign=\"top\">SteadyState</td></tr>
<tr><td valign=\"top\"><b>InitialState</b></td>
<td valign=\"top\">InitialState</td>
<td valign=\"top\">InitialState</td></tr>
<tr><td valign=\"top\"><b>InitialOutput</b><br>
and initial equation: y = y_start</td>
<td valign=\"top\">NoInit</td>
<td valign=\"top\">SteadyState</td></tr>
<tr><td valign=\"top\"><b>DoNotUse_InitialIntegratorState</b></td>
<td valign=\"top\">InitialState</td>
<td valign=\"top\">NoInit</td></tr>
</table>
<p>
In many cases, the most useful initial condition is
<b>SteadyState</b> because initial transients are then no longer
present. If initType = InitPID.SteadyState, then in some
cases difficulties might occur. The reason is the
equation of the integrator:
</p>
<pre>
<b>der</b>(y) = k*u;
</pre>
<p>
The steady state equation \"der(x)=0\" leads to the condition that the input u to the
integrator is zero. If the input u is already (directly or indirectly) defined
by another initial condition, then the initialization problem is <b>singular</b>
(has none or infinitely many solutions). This situation occurs often
for mechanical systems, where, e.g., u = desiredSpeed - measuredSpeed and
since speed is both a state and a derivative, it is natural to
initialize it with zero. As sketched this is, however, not possible.
The solution is to not initialize u or the variable that is used
to compute u by an algebraic equation.
</p>
</html>"));
end PID_discrete;

201
SimulationModels/AIDAModelica/PositionControl.mo

@ -0,0 +1,201 @@ @@ -0,0 +1,201 @@
// CP: 65001
// SimulationX Version: 3.8.2.45319 x64
within AIDAModelica;
model PositionControl "Position Control Model"
Modelica.Blocks.Interfaces.RealInput DronPositionConsign[3](
quantity="Mechanics.Translation.Displace",
displayUnit="m") "Desired drone position consign" annotation(Placement(
transformation(extent={{-163,56},{-123,96}}),
iconTransformation(extent={{-120,30},{-80,70}})));
Modelica.Blocks.Interfaces.RealInput Position[3](
quantity="Mechanics.Translation.Displace",
displayUnit="m") "Real drone position feedback" annotation(Placement(
transformation(extent={{-125,15},{-85,55}}),
iconTransformation(extent={{-120,-20},{-80,20}})));
Modelica.Blocks.Interfaces.RealOutput TotalThrustAP(
quantity="Mechanics.Translation.Force",
displayUnit="N") "Desired total thrust autopilot mode output" annotation(Placement(
transformation(
origin={71,29},
extent={{-16,-16},{16,16}}),
iconTransformation(
origin={100,50},
extent={{-10,-10},{10,10}})));
Modelica.Blocks.Interfaces.RealOutput AttitudeConsignAP[2](
quantity="Mechanics.Rotation.Angle",
displayUnit="rad") "Desired attitude autopilot mode consign" annotation(Placement(
transformation(
origin={81,61},
extent={{-16,-16},{16,16}}),
iconTransformation(
origin={100,-50},
extent={{-10,-10},{10,10}})));
Modelica.Blocks.Interfaces.RealInput Attitude[3](
quantity="Mechanics.Rotation.Angle",
displayUnit="rad") "Real drone attitude feedback" annotation(Placement(
transformation(extent={{-15,-25},{25,15}}),
iconTransformation(
origin={-50,-100},
extent={{-20,-20},{20,20}},
rotation=90)));
Modelica.Blocks.Interfaces.RealInput Speed[3](
quantity="Mechanics.Translation.Velocity",
displayUnit="m/s") "Real drone speed feedback" annotation(Placement(
transformation(extent={{-60,-25},{-20,15}}),
iconTransformation(extent={{-120,-70},{-80,-30}})));
ControlPosition controlPosition1 annotation(Placement(transformation(extent={{-75,60},{-55,80}})));
ControlSpeed controlSpeed1 annotation(Placement(transformation(extent={{-5,55},{15,75}})));
ComputeThrustAndAttitudeConsign computeThrustAndAttitudeConsign1 annotation(Placement(transformation(extent={{25,50},{45,70}})));
SelectSpeedConsign selectSpeedConsign1 annotation(Placement(transformation(extent={{-45,65},{-25,75}})));
equation
connect(computeThrustAndAttitudeConsign1.AttitudeAPConsigns,AttitudeConsignAP) annotation(Line(
points={{44.7,64.7},{49.7,64.7},{76,64.7},{76,61},{81,61}},
color={0,0,127},
thickness=0.0625));
connect(computeThrustAndAttitudeConsign1.TotalThrustAP, TotalThrustAP) annotation(
Line(points = {{45, 55}, {60, 55}, {60, 29}, {71, 29}}, color = {0, 0, 127}, thickness = 0.0625));
connect(controlPosition1.DronePositionConsign,DronPositionConsign) annotation(Line(
points={{-75,69.3},{-80,69.3},{-138,69.3},{-138,76},{-143,76}},
color={0,0,127},
thickness=0.0625));
connect(selectSpeedConsign1.NavigationVelocityConsign,controlPosition1.NavigationSpeedConsign) annotation(Line(
points={{-45,69.3},{-50,69.3},{-50,70.3},{-55,70.3}},
color={0,0,127},
thickness=0.0625));
connect(controlSpeed1.SpeedConsign,selectSpeedConsign1.VelocityConsign) annotation(Line(
points={{-5,69.3},{-10,69.3},{-20,69.3},{-20,69.7},{-25,69.7}},
color={0,0,127},
thickness=0.0625));
connect(controlPosition1.Position,Position) annotation(Line(
points={{-66,60},{-66,55},{-66,35},{-100,35},{-105,35}},
color={0,0,127},
thickness=0.0625));
connect(controlSpeed1.Speed,Speed) annotation(Line(
points={{-5,59.3},{-10,59.3},{-35,59.3},{-35,-5},{-40,-5}},
color={0,0,127},
thickness=0.0625));
connect(computeThrustAndAttitudeConsign1.AccelerationConsign,controlSpeed1.AccelerationConsign) annotation(Line(
points={{25,64.3},{20,64.3},{20,64.7},{15,64.7}},
color={0,0,127},
thickness=0.0625));
connect(computeThrustAndAttitudeConsign1.Attitude,Attitude) annotation(Line(
points={{25,54.3},{20,54.3},{10,54.3},{10,-5},{5,-5}},
color={0,0,127},
thickness=0.0625));
annotation(
DronPositionConsign(flags=2),
Position(flags=2),
TotalThrustAP(flags=2),
AttitudeConsignAP(flags=2),
Attitude(flags=2),
Speed(flags=2),
controlPosition1(
DronePositionConsign(flags=2),
Position(flags=2),
NavigationSpeedConsign(flags=2),
DHP(flags=2),
HP(flags=2),
DZP(flags=2),
ZP(flags=2),
HNSC(flags=2),
ASC(flags=2)),
controlSpeed1(
SpeedConsign(flags=2),
Speed(flags=2),
AccelerationConsign(flags=2),
speedErrorModel1(
SpeedConsign(flags=2),
Speed(flags=2),
SpeedError(flags=2)),
PID(
u(flags=2),
y(flags=2),
P(
u(flags=2),
y(flags=2)),
I(
u(flags=2),
y(flags=2)),
D(
u(flags=2),
y(flags=2),
x(flags=2)),
Gain(
u(flags=2),
y(flags=2)),
Add(
u1(flags=2),
u2(flags=2),
u3(flags=2),
y(flags=2))),
PID2(
u(flags=2),
y(flags=2),
P(
u(flags=2),
y(flags=2)),
I(
u(flags=2),
y(flags=2)),
D(
u(flags=2),
y(flags=2),
x(flags=2)),
Gain(
u(flags=2),
y(flags=2)),
Add(
u1(flags=2),
u2(flags=2),
u3(flags=2),
y(flags=2))),
PID1(
u(flags=2),
y(flags=2),
P(
u(flags=2),
y(flags=2)),
I(
u(flags=2),
y(flags=2)),
D(
u(flags=2),
y(flags=2),
x(flags=2)),
Gain(
u(flags=2),
y(flags=2)),
Add(
u1(flags=2),
u2(flags=2),
u3(flags=2),
y(flags=2)))),
computeThrustAndAttitudeConsign1(
AccelerationConsign(flags=2),
Attitude(flags=2),
AttitudeAPConsigns(flags=2),
TotalThrustAP(flags=2),
HAC(flags=2),
Rpsi(flags=2),
Apsi(flags=2),
InvApsi(flags=2),
AAC(flags=2)),
selectSpeedConsign1(
NavigationVelocityConsign(flags=2),
VelocityConsign(flags=2)),
Icon(graphics={
Rectangle(
fillColor={255,255,255},
fillPattern=FillPattern.Solid,
extent={{-100,100},{100,-100}}),
Text(
textString="%name",
fillPattern=FillPattern.None,
extent={{5,-7},{105,-31}},
origin={-57,21})}),
experiment(
StopTime=1,
StartTime=0,
Interval=0.002,
MaxInterval="0.001"));
end PositionControl;

64
SimulationModels/AIDAModelica/PositionConvector.mo

@ -0,0 +1,64 @@ @@ -0,0 +1,64 @@
// CP: 65001
// SimulationX Version: 3.8.2.45319 x64
within AIDAModelica;
model PositionConvector "PositionConvector"
Modelica.Blocks.Interfaces.RealInput Latitude(
quantity="Mechanics.Rotation.Angle",
displayUnit="deg") "'input Real' as connector" annotation(Placement(
transformation(extent={{-20,-20},{20,20}}),
iconTransformation(
origin={-50,-100},
extent={{-20,-20},{20,20}},
rotation=90)));
Modelica.Blocks.Interfaces.RealInput Longitude(
quantity="Mechanics.Rotation.Angle",
displayUnit="deg") "'input Real' as connector" annotation(Placement(
transformation(extent={{-20,-20},{20,20}}),
iconTransformation(
origin={50,-100},
extent={{-20,-20},{20,20}},
rotation=90)));
Modelica.Blocks.Interfaces.RealOutput XCoordinate(
quantity="Mechanics.Translation.Displace",
displayUnit="m") "'output Real' as connector" annotation(Placement(
transformation(extent={{-10,-10},{10,10}}),
iconTransformation(
origin={-50,100},
extent={{-10,-10},{10,10}},
rotation=90)));
Modelica.Blocks.Interfaces.RealOutput YCoordinate(
quantity="Mechanics.Translation.Displace",
displayUnit="m") "'output Real' as connector" annotation(Placement(
transformation(extent={{-10,-10},{10,10}}),
iconTransformation(
origin={50,100},
extent={{-10,-10},{10,10}},
rotation=90)));
parameter Real a(
quantity="Basics.Length",
displayUnit="m")=6378137 "Radius semi-major axis";
parameter Real e2=0.00669437999 "First numerical eccentricity of the elipsoid";
parameter Real pi=3.14159265359 "Parameter pi";
Real Lat(
quantity="Mechanics.Rotation.Angle",
displayUnit="rad") "Latitude";
Real Lon(
quantity="Mechanics.Rotation.Angle",
displayUnit="rad") "Longitude";
Real R(
quantity="Basics.Length",
displayUnit="m") "The prime vertical radius of curvature";
parameter Real h=0 "Height above the elipsoide";
equation
// enter your equations here
Lat = Latitude*(pi/180);
Lon = Longitude*(pi/180);
R = a/sqrt(1-e2*((1-cos(2*Lat))/2));
XCoordinate = (R+h)*cos(Lat)*cos(Lon);
YCoordinate = -1*((R+h)*cos(Lat)*sin(Lon));
annotation(Icon(graphics={
Rectangle(
fillColor={255,255,255},
fillPattern=FillPattern.Solid,
extent={{-100,100},{100,-100}})}));
end PositionConvector;

234
SimulationModels/AIDAModelica/ProSIVICToSimXInterface.mo

@ -0,0 +1,234 @@ @@ -0,0 +1,234 @@
// CP: 65001
// SimulationX Version: 3.8.2.45319 x64
within AIDAModelica;
model ProSIVICToSimXInterface "Pro-SIVIC to Simulation X Interface"
Modelica.Blocks.Interfaces.RealInput roll(
quantity="Mechanics.Rotation.Angle",
displayUnit="rad") "IMU roll" annotation(Placement(
transformation(extent={{-140,15},{-100,55}}),
iconTransformation(
origin={-275,-100},
extent={{-20,-20},{20,20}},
rotation=90)));
Modelica.Blocks.Interfaces.RealInput pitch(
quantity="Mechanics.Rotation.Angle",
displayUnit="rad") "IMU pitch" annotation(Placement(
transformation(extent={{-105,15},{-65,55}}),
iconTransformation(
origin={-175,-100},
extent={{-20,-20},{20,20}},
rotation=90)));
Modelica.Blocks.Interfaces.RealInput yaw(
quantity="Mechanics.Rotation.Angle",
displayUnit="rad") "IMU yaw" annotation(Placement(
transformation(extent={{-135,-10},{-95,30}}),
iconTransformation(
origin={-225,-100},
extent={{-20,-20},{20,20}},
rotation=90)));
Modelica.Blocks.Interfaces.RealInput rollRate(
quantity="Mechanics.Rotation.RotVelocity",
displayUnit="rad/s") "IMU roll rate" annotation(Placement(
transformation(extent={{-70,15},{-30,55}}),
iconTransformation(
origin={-125,-100},
extent={{-20,-20},{20,20}},
rotation=90)));
Modelica.Blocks.Interfaces.RealInput pitchRate(
quantity="Mechanics.Rotation.RotVelocity",
displayUnit="rad/s") "IMU pitch rate" annotation(Placement(
transformation(extent={{-35,15},{5,55}}),
iconTransformation(
origin={-75,-100},
extent={{-20,-20},{20,20}},
rotation=90)));
Modelica.Blocks.Interfaces.RealInput yawRate(
quantity="Mechanics.Rotation.RotVelocity",
displayUnit="rad/s") "IMU yaw rate" annotation(Placement(
transformation(extent={{-65,-10},{-25,30}}),
iconTransformation(
origin={-25,-100},
extent={{-20,-20},{20,20}},
rotation=90)));
Modelica.Blocks.Interfaces.RealInput accelerationX(
quantity="Mechanics.Translation.Accel",
displayUnit="m/s²") "IMU acceleration X" annotation(Placement(
transformation(extent={{5,-15},{45,25}}),
iconTransformation(
origin={25,-100},
extent={{-20,-20},{20,20}},
rotation=90)));
Modelica.Blocks.Interfaces.RealInput accelerationY(
quantity="Mechanics.Translation.Accel",
displayUnit="m/s²") "IMU acceleration Y" annotation(Placement(
transformation(extent={{35,-15},{75,25}}),
iconTransformation(
origin={75,-100},
extent={{-20,-20},{20,20}},
rotation=90)));
Modelica.Blocks.Interfaces.RealInput accelerationZ(
quantity="Mechanics.Translation.Accel",
displayUnit="m/s²") "IMU acceleration Z" annotation(Placement(
transformation(extent={{15,-40},{55,0}}),
iconTransformation(
origin={125,-100},
extent={{-20,-20},{20,20}},
rotation=90)));
Modelica.Blocks.Interfaces.RealInput accurateLatitude(
quantity="Geometry.Angle",
displayUnit="deg") "GPS accurate latitude" annotation(Placement(
transformation(extent={{70,-15},{110,25}}),
iconTransformation(
origin={175,-100},
extent={{-20,-20},{20,20}},
rotation=90)));
Modelica.Blocks.Interfaces.RealInput accurateLongitude(
quantity="Geometry.Angle",
displayUnit="deg") "GPS accurate longitude" annotation(Placement(
transformation(extent={{100,-40},{140,0}}),
iconTransformation(
origin={225,-100},
extent={{-20,-20},{20,20}},
rotation=90)));
Modelica.Blocks.Interfaces.RealInput distance(
quantity="Geometry.Length",
displayUnit="m") "Lidar distance" annotation(Placement(
transformation(extent={{110,-15},{150,25}}),
iconTransformation(
origin={275,-100},
extent={{-20,-20},{20,20}},
rotation=90)));
Modelica.Blocks.Interfaces.RealOutput Attitude[3](
quantity="Mechanics.Rotation.Angle",
displayUnit="rad") "'output Real' as connector" annotation(Placement(
transformation(extent={{-80,70},{-60,90}}),
iconTransformation(
origin={-225,100},
extent={{-10,-10},{10,10}},
rotation=90)));
Modelica.Blocks.Interfaces.RealOutput AngularVelocities[3](
quantity="Mechanics.Rotation.RotVelocity",
displayUnit="rad/s") "'output Real' as connector" annotation(Placement(
transformation(extent={{-10,70},{10,90}}),
iconTransformation(
origin={-75,100},
extent={{-10,-10},{10,10}},
rotation=90)));
Modelica.Blocks.Interfaces.RealOutput Speed[3](
quantity="Mechanics.Translation.Velocity",
displayUnit="m/s") "'output Real' as connector" annotation(Placement(
transformation(extent={{50,70},{70,90}}),
iconTransformation(
origin={225,100},
extent={{-10,-10},{10,10}},
rotation=90)));
Modelica.Blocks.Interfaces.RealOutput Position[3](
quantity="Mechanics.Translation.Displace",
displayUnit="m") "'output Real' as connector" annotation(Placement(
transformation(extent={{150,70},{170,90}}),
iconTransformation(
origin={75,100},
extent={{-10,-10},{10,10}},
rotation=90)));
AccelerationToSpeed accelerationToSpeed1 annotation(Placement(transformation(extent={{40,30},{60,50}})));
PositionConvector positionConvector1 annotation(Placement(transformation(extent={{110,30},{130,50}})));
equation
connect(roll,Attitude[1]) annotation(
Line(
points={{-120,35},{-115,35},{-100,35},{-100,80},{-70,80}},
color={0,0,127},
thickness=0.0625));
connect(pitch,Attitude[2]) annotation(
Line(
points={{-85,35},{-80,35},{-90,35},{-90,80},{-70,80}},
color={0,0,127},
thickness=0.0625));
connect(yaw,Attitude[3]) annotation(
Line(
points={{-115,10},{-110,10},{-95,10},{-95,80},{-70,80}},
color={0,0,127},
thickness=0.0625));
connect(rollRate,AngularVelocities[1]) annotation(
Line(
points={{-50,35},{-45,35},{-30,35},{-30,80},{0,80}},
color={0,0,127},
thickness=0.0625));
connect(pitchRate,AngularVelocities[2]) annotation(
Line(
points={{-15,35},{-10,35},{-20,35},{-20,80},{0,80}},
color={0,0,127},
thickness=0.0625));
connect(yawRate,AngularVelocities[3]) annotation(
Line(
points={{-45,10},{-40,10},{-25,10},{-25,80},{0,80}},
color={0,0,127},
thickness=0.0625));
connect(accelerationToSpeed1.Speed[:],Speed[:]) annotation(Line(
points={{50,50},{50,55},{50,80},{55,80},{60,80}},
color={0,0,127},
thickness=0.0625));
connect(accelerationX,accelerationToSpeed1.Acceleration[1]) annotation(Line(
points={{25,5},{30,5},{49.3,5},{49.3,25},{49.3,30}},
color={0,0,127},
thickness=0.0625));
connect(accelerationY,accelerationToSpeed1.Acceleration[2]) annotation(Line(
points={{55,5},{50,5},{50,25},{50,30}},
color={0,0,127},
thickness=0.0625));
connect(accelerationZ,accelerationToSpeed1.Acceleration[3]) annotation(Line(
points={{35,-20},{40,-20},{50.3,-20},{50.3,25},{50.3,30}},
color={0,0,127},
thickness=0.0625));
connect(accurateLatitude,positionConvector1.Latitude) annotation(Line(
points={{90,5},{95,5},{115,5},{115,25},{115,30}},
color={0,0,127},
thickness=0.0625));
connect(accurateLongitude,positionConvector1.Longitude) annotation(Line(
points={{120,-20},{125,-20},{125,25},{125,30}},
color={0,0,127},
thickness=0.0625));
connect(positionConvector1.XCoordinate,Position[1]) annotation(Line(
points={{115,50},{115,55},{115,80},{155,80},{160,80}},
color={0,0,127},
thickness=0.0625));
connect(positionConvector1.YCoordinate,Position[2]) annotation(Line(
points={{125,50},{125,55},{125,80},{155,80},{160,80}},
color={0,0,127},
thickness=0.0625));
connect(distance,Position[3]) annotation(
Line(
points={{130,5},{150,5},{150,42.3},{150,80},{160,80}},
color={0,0,127},
thickness=0.0625));
annotation(
roll(flags=2),
pitch(flags=2),
yaw(flags=2),
rollRate(flags=2),
pitchRate(flags=2),
yawRate(flags=2),
accelerationX(flags=2),
accelerationY(flags=2),
accelerationZ(flags=2),
accurateLatitude(flags=2),
accurateLongitude(flags=2),
distance(flags=2),
Attitude(flags=2),
AngularVelocities(flags=2),
Speed(flags=2),
Position(flags=2),
accelerationToSpeed1(
Acceleration(flags=2),
Speed(flags=2)),
Icon(
coordinateSystem(extent={{-325,-100},{325,100}}),
graphics={
Rectangle(
fillColor={255,255,255},
fillPattern=FillPattern.Solid,
extent={{-326,100},{326.7,-100}})}),
experiment(
StopTime=1,
StartTime=0,
Interval=0.001));
end ProSIVICToSimXInterface;

183
SimulationModels/AIDAModelica/ProSIVICToSimXInterfaceTest.mo

@ -0,0 +1,183 @@ @@ -0,0 +1,183 @@
// CP: 65001
// SimulationX Version: 3.8.2.45319 x64
within AIDAModelica;
model ProSIVICToSimXInterfaceTest "Pro-SIVIC to Simulation X Interface Test"
Modelica.Blocks.Interfaces.RealInput roll(
quantity="Mechanics.Rotation.Angle",
displayUnit="rad") "IMU roll" annotation(Placement(
transformation(extent={{-140,15},{-100,55}}),
iconTransformation(
origin={-275,-100},
extent={{-20,-20},{20,20}},
rotation=90)));
Modelica.Blocks.Interfaces.RealInput pitch(
quantity="Mechanics.Rotation.Angle",
displayUnit="rad") "IMU pitch" annotation(Placement(
transformation(extent={{-105,15},{-65,55}}),
iconTransformation(
origin={-225,-100},
extent={{-20,-20},{20,20}},
rotation=90)));
Modelica.Blocks.Interfaces.RealInput yaw(
quantity="Mechanics.Rotation.Angle",
displayUnit="rad") "IMU yaw" annotation(Placement(
transformation(extent={{-135,-10},{-95,30}}),
iconTransformation(
origin={-175,-100},
extent={{-20,-20},{20,20}},
rotation=90)));
Modelica.Blocks.Interfaces.RealInput rollRate(
quantity="Mechanics.Rotation.RotVelocity",
displayUnit="rad/s") "IMU roll rate" annotation(Placement(
transformation(extent={{-70,15},{-30,55}}),
iconTransformation(
origin={-125,-100},
extent={{-20,-20},{20,20}},
rotation=90)));
Modelica.Blocks.Interfaces.RealInput pitchRate(
quantity="Mechanics.Rotation.RotVelocity",
displayUnit="rad/s") "IMU pitch rate" annotation(Placement(
transformation(extent={{-35,15},{5,55}}),
iconTransformation(
origin={-75,-100},
extent={{-20,-20},{20,20}},
rotation=90)));
Modelica.Blocks.Interfaces.RealInput yawRate(
quantity="Mechanics.Rotation.RotVelocity",
displayUnit="rad/s") "IMU yaw rate" annotation(Placement(
transformation(extent={{-65,-10},{-25,30}}),
iconTransformation(
origin={-25,-100},
extent={{-20,-20},{20,20}},
rotation=90)));
Modelica.Blocks.Interfaces.RealInput SpeedX(
quantity="Mechanics.Translation.Accel",
displayUnit="m/s²") "IMU acceleration X" annotation(Placement(
transformation(extent={{0,15},{40,55}}),
iconTransformation(
origin={25,-100},
extent={{-20,-20},{20,20}},
rotation=90)));
Modelica.Blocks.Interfaces.RealInput SpeedY(
quantity="Mechanics.Translation.Accel",
displayUnit="m/s²") "IMU acceleration Y" annotation(Placement(
transformation(extent={{30,15},{70,55}}),
iconTransformation(
origin={75,-100},
extent={{-20,-20},{20,20}},
rotation=90)));
Modelica.Blocks.Interfaces.RealInput SpeedZ(
quantity="Mechanics.Translation.Accel",
displayUnit="m/s²") "IMU acceleration Z" annotation(Placement(
transformation(extent={{5,-10},{45,30}}),
iconTransformation(
origin={125,-100},
extent={{-20,-20},{20,20}},
rotation=90)));
Modelica.Blocks.Interfaces.RealInput X(
quantity="Geometry.Angle",
displayUnit="deg") "GPS accurate latitude" annotation(Placement(
transformation(extent={{65,15},{105,55}}),
iconTransformation(
origin={175,-100},
extent={{-20,-20},{20,20}},
rotation=90)));
Modelica.Blocks.Interfaces.RealInput Y(
quantity="Geometry.Angle",
displayUnit="deg") "GPS accurate longitude" annotation(Placement(
transformation(extent={{75,-10},{115,30}}),
iconTransformation(
origin={225,-100},
extent={{-20,-20},{20,20}},
rotation=90)));
Modelica.Blocks.Interfaces.RealInput Z(
quantity="Geometry.Length",
displayUnit="m") "Lidar distance" annotation(Placement(
transformation(extent={{100,15},{140,55}}),
iconTransformation(
origin={275,-100},
extent={{-20,-20},{20,20}},
rotation=90)));
Modelica.Blocks.Interfaces.RealOutput Attitude[3](
quantity="Mechanics.Rotation.Angle",
displayUnit="rad") "'output Real' as connector" annotation(Placement(
transformation(extent={{-80,70},{-60,90}}),
iconTransformation(
origin={-225,100},
extent={{-10,-10},{10,10}},
rotation=90)));
Modelica.Blocks.Interfaces.RealOutput AngularVelocities[3](
quantity="Mechanics.Rotation.RotVelocity",
displayUnit="rad/s") "'output Real' as connector" annotation(Placement(
transformation(extent={{-10,70},{10,90}}),
iconTransformation(
origin={-75,100},
extent={{-10,-10},{10,10}},
rotation=90)));
Modelica.Blocks.Interfaces.RealOutput Speed[3](
quantity="Mechanics.Translation.Velocity",
displayUnit="m/s") "'output Real' as connector" annotation(Placement(
transformation(extent={{50,70},{70,90}}),
iconTransformation(
origin={225,100},
extent={{-10,-10},{10,10}},
rotation=90)));
Modelica.Blocks.Interfaces.RealOutput Position[3](
quantity="Mechanics.Translation.Displace",
displayUnit="m") "'output Real' as connector" annotation(Placement(
transformation(extent={{150,70},{170,90}}),
iconTransformation(
origin={75,100},
extent={{-10,-10},{10,10}},
rotation=90)));
parameter Real Longitude0 "Long repère AIDA";
parameter Real Latitude0 "Lat repère AIDA";
parameter Real Rt=6378.137 "Rayon terre en m";
constant Real Pi=3.14159 "Pi";
parameter Real K;
Real Xn;
Real Yw;
initial equation
Latitude0=X;
Longitude0=Y;
K=Rt*Pi/180;
equation
// enter your equations here
Attitude = {roll,-1*pitch,-1*yaw};
AngularVelocities = {rollRate,-1*pitchRate,-1*yawRate};
//convertion lat/long
Xn=(X-Latitude0)*K;
Yw=cos(X*Pi/180)*(Longitude0-Y)*K;
Position = {Xn,-Yw,-1*Z};
Speed = {K*SpeedX,K*SpeedY*cos(X*Pi/180),-1*SpeedZ};
annotation(
roll(flags=2),
pitch(flags=2),
yaw(flags=2),
rollRate(flags=2),
pitchRate(flags=2),
yawRate(flags=2),
SpeedX(flags=2),
SpeedY(flags=2),
SpeedZ(flags=2),
X(flags=2),
Y(flags=2),
Z(flags=2),
Attitude(flags=2),
AngularVelocities(flags=2),
Speed(flags=2),
Position(flags=2),
Icon(
coordinateSystem(extent={{-325,-100},{325,100}}),
graphics={
Rectangle(
fillColor={255,255,255},
fillPattern=FillPattern.Solid,
extent={{-326,100},{326.7,-100}})}),
experiment(
StopTime=1,
StartTime=0,
Interval=0.002,
MaxInterval="0.001"));
end ProSIVICToSimXInterfaceTest;

1930
SimulationModels/AIDAModelica/QuadcopterModel.mo

File diff suppressed because it is too large Load Diff

215
SimulationModels/AIDAModelica/RemoteControl.mo

@ -0,0 +1,215 @@ @@ -0,0 +1,215 @@
within AIDAModelica;
// CP: 65001
// SimulationX Version: 3.8.2.45319 x64
model RemoteControl "RemoteControl"
Real VerticalSpeedCommand_i(start=0) "commande interne non filtree";
Modelica.Blocks.Interfaces.RealOutput VerticalSpeedCommand(
quantity="Mechanics.Translation.Velocity",
displayUnit="m/s") "'output Real' as connector" annotation(Placement(
transformation(extent={{12,28},{32,48}}),
iconTransformation(
origin={-75,-100},
extent={{-10,-10},{10,10}},
rotation=-90)));
Real RollCommand_i(start=0) "commande interne non filtree";
Modelica.Blocks.Interfaces.RealOutput RollCommand(
quantity="Mechanics.Rotation.Angle",
displayUnit="rad") "'output Real' as connector" annotation(Placement(
transformation(extent={{56,8},{76,28}}),
iconTransformation(
origin={-25,-100},
extent={{-10,-10},{10,10}},
rotation=-90)));
Real PitchCommand_i(start=0) "commande interne non filtree";
Modelica.Blocks.Interfaces.RealOutput PitchCommand(
quantity="Mechanics.Rotation.Angle",
displayUnit="rad") "'output Real' as connector" annotation(Placement(
transformation(extent={{-38,-46},{-18,-26}}),
iconTransformation(
origin={25,-100},
extent={{-10,-10},{10,10}},
rotation=-90)));
Real YawCommand_i(start=0) "commande interne non filtree";
Modelica.Blocks.Interfaces.RealOutput YawCommand(
quantity="Mechanics.Rotation.Angle",
displayUnit="rad") "'output Real' as connector" annotation(Placement(
transformation(extent={{18,-52},{38,-32}}),
iconTransformation(
origin={75,-100},
extent={{-10,-10},{10,10}},
rotation=-90)));
Modelica.Blocks.Interfaces.BooleanOutput ControlMode "'output Boolean' as connector" annotation(Placement(
transformation(extent={{-10,-10},{10,10}}),
iconTransformation(
origin={-125,-50},
extent={{-10,-10},{10,10}},
rotation=180)));
Modelica.Blocks.Interfaces.BooleanOutput IndicatorYawConsign "'output Boolean' as connector" annotation(Placement(
transformation(
origin={-45,45},
extent={{-17,-17},{17,17}}),
iconTransformation(
origin={-125,0},
extent={{-10,-10},{10,10}},
rotation=-180)));
parameter Real VS_cmd=0.5;
parameter Real[2] VS_cmd_t={3, 5} "Instants de démarrage et fin du step";
parameter Real Pitch_cmd=0.03;
parameter Real[2] Pitch_cmd_t={1, 4} "Instants de démarrage et fin du step, après stabilisation verticale";
parameter Real Yaw_cmd=0.5;
parameter Real[2] Yaw_cmd_t={6, 8} "Instants de démarrage et fin du step";
parameter Real Roll_cmd=0.2 "Amplitude step ";
parameter Real Roll_cmd_t[2]={1, 100} "Instants de démarrage et fin du step";
parameter Real Tcst=0.1 "constante de temps pour filter les sorties du remote ctl";
Boolean Auto_Ctl_Enabled(start=true);
parameter Real Auto_Ctl_t=0.1 "Instant de déclenchement du mode auto";
initial equation
PitchCommand = 0;
RollCommand = 0;
YawCommand = 0;
VerticalSpeedCommand = 0;
PitchCommand_i = 0;
RollCommand_i = 0;
YawCommand_i = 0;
VerticalSpeedCommand_i = 0;
ControlMode = false;
IndicatorYawConsign = false;
Auto_Ctl_Enabled=true;
algorithm
when time > Auto_Ctl_t and Auto_Ctl_Enabled==true then
ControlMode:=true;
end when;
when time > VS_cmd_t[1] then
VerticalSpeedCommand_i := VS_cmd;
ControlMode:=false;
Auto_Ctl_Enabled:=false;
end when;
when time > VS_cmd_t[2] then
VerticalSpeedCommand_i := 0;
end when;
when time > VS_cmd_t[2]+ Pitch_cmd_t[1] then
PitchCommand_i := Pitch_cmd;
ControlMode:=false;
end when;
when time > VS_cmd_t[2]+ Pitch_cmd_t[2] then
PitchCommand_i := 0;
end when;
when time > VS_cmd_t[2]+ Roll_cmd_t[1] then
RollCommand_i := Roll_cmd;
ControlMode:=false;
end when;
when time > VS_cmd_t[2]+ Roll_cmd_t[2] then
RollCommand_i := 0;
end when;
//Yaw command
when time > VS_cmd_t[2]+ Yaw_cmd_t[1] then
YawCommand_i := Yaw_cmd;
ControlMode:=false;
IndicatorYawConsign:=true;
end when;
//IndicatorYawConsign := true;
when time > VS_cmd_t[2]+ Yaw_cmd_t[2] then
YawCommand_i := 0;
end when;
//IndicatorYawConsign := false;
/*if time>Yaw_cmd_t[2] then
int_yaw := 0;
IndicatorYawConsign := false;
elseif time>Yaw_cmd_t[1] then
int_yaw := DYaw_cmd;
IndicatorYawConsign := true;
else
int_yaw := 0;
IndicatorYawConsign := false;
end if;*/
equation
// remote control filter with Tcst time constant
der(VerticalSpeedCommand) = (VerticalSpeedCommand_i - VerticalSpeedCommand) / Tcst;
der(RollCommand) = (RollCommand_i - RollCommand) / Tcst;
der(PitchCommand) = (PitchCommand_i - PitchCommand) / Tcst;
der(YawCommand) = (YawCommand_i - YawCommand) / Tcst;
/* initial code of Andrii VAKULKO, destined to be used with manual button included in the SimulationX interface
if VSCommand1 > 0 then
VerticalSpeedCommand = -1;
elseif VSCommand2 > 0 then
VerticalSpeedCommand = -0.8;
elseif VSCommand3 > 0 then
VerticalSpeedCommand = -0.6;
elseif VSCommand4 > 0 then
VerticalSpeedCommand = -0.4;
elseif VSCommand5 > 0 then
VerticalSpeedCommand = -0.2;
elseif VSCommand6 > 0 then
VerticalSpeedCommand = 0.2;
elseif VSCommand7 > 0 then
VerticalSpeedCommand = 0.4;
elseif VSCommand8 > 0 then
VerticalSpeedCommand = 0.6;
elseif VSCommand9 > 0 then
VerticalSpeedCommand = 0.8;
elseif VSCommand10 > 0 then
VerticalSpeedCommand = 1;
else
VerticalSpeedCommand = 0;
end if;
if YCommandP > 0 then
der(YawCommand) = 0.01;
//IndicatorYawConsign = true;
elseif YCommandM > 0 then
der(YawCommand) = -0.01;
//IndicatorYawConsign = true;
else
YawCommand = 0;
//IndicatorYawConsign = false;
end if;
if RCommandP > 0 then
RollCommand = 0.0261799; //15 deg
elseif RCommandM > 0 then
RollCommand = -0.0261799;
else
RollCommand = 0;
end if;
if PCommandP > 0 then
PitchCommand = 0.0261799;
elseif PCommandM > 0 then
PitchCommand = -0.0261799;
else
PitchCommand = 0;
end if;*/
annotation(
VerticalSpeedCommand(flags=2),
RollCommand(flags=2),
PitchCommand(flags=2),
YawCommand(flags=2),
ControlMode(flags=2),
IndicatorYawConsign(flags=2),
Icon(
coordinateSystem(extent={{-125,-100},{125,100}}),
graphics={
Rectangle(
fillColor={255,255,255},
fillPattern=FillPattern.Solid,
extent={{-123.3,100},{123.3,-100}}),
Text(
textString="%name",
fillPattern=FillPattern.None,
extent={{-86,20},{86,-20}},
origin={-2,6})}),
experiment(
StopTime=10,
StartTime=0,
Interval=0.02,
MaxInterval="0.001"));
end RemoteControl;

184
SimulationModels/AIDAModelica/RemoteControlForIntegration.mo

@ -0,0 +1,184 @@ @@ -0,0 +1,184 @@
// CP: 65001
// SimulationX Version: 3.8.2.45319 x64
within AIDAModelica;
model RemoteControlForIntegration "Remote Control For Integration"
Modelica.Blocks.Interfaces.RealOutput VerticalSpeedCommand(
quantity="Mechanics.Translation.Velocity",
displayUnit="m/s") "'output Real' as connector" annotation(Placement(
transformation(extent={{-10,65},{10,85}}),
iconTransformation(
origin={-75,-100},
extent={{-10,-10},{10,10}},
rotation=-90)));
Modelica.Blocks.Interfaces.RealOutput RollCommand(
quantity="Mechanics.Rotation.Angle",
displayUnit="rad") "'output Real' as connector" annotation(Placement(
transformation(extent={{-10,35},{10,55}}),
iconTransformation(
origin={-25,-100},
extent={{-10,-10},{10,10}},
rotation=-90)));
Modelica.Blocks.Interfaces.RealOutput PitchCommand(
quantity="Mechanics.Rotation.Angle",
displayUnit="rad") "'output Real' as connector" annotation(Placement(
transformation(extent={{-10,5},{10,25}}),
iconTransformation(
origin={25,-100},
extent={{-10,-10},{10,10}},
rotation=-90)));
Modelica.Blocks.Interfaces.RealOutput YawCommand(
quantity="Mechanics.Rotation.Angle",
displayUnit="rad") "'output Real' as connector" annotation(Placement(
transformation(extent={{-9.699999999999999,-24.7},{10.3,-4.7}}),
iconTransformation(
origin={75,-100},
extent={{-10,-10},{10,10}},
rotation=-90)));
Modelica.Blocks.Interfaces.BooleanOutput ControlMode "'output Boolean' as connector" annotation(Placement(
transformation(extent={{-10,-65},{10,-45}}),
iconTransformation(
origin={-125,-50},
extent={{-10,-10},{10,10}},
rotation=180)));
Modelica.Blocks.Interfaces.BooleanOutput IndicatorYawConsign "'output Boolean' as connector" annotation(Placement(
transformation(extent={{-10,-50},{10,-30}}),
iconTransformation(
origin={-125,0},
extent={{-10,-10},{10,10}},
rotation=-180)));
Modelica.Blocks.Tables.CombiTable1Ds VerticalSpeedCommandCurve(
table={{0,0},{8.517197272438,0},{8.517197272439,-0.6},{20.94728806169,-0.6},{20.94873106169,0},{121.801046301399,0},{121.802489301399,0},{129.0944818387,0},{129.0959258387,0},{134.215124194368,0},{134.216567194368,0},{134.628815476324,0},{134.630258476324,0},{138.533727217968,0},{138.535170217968,0},{245.054,0}},
smoothness=Modelica.Blocks.Types.Smoothness.LinearSegments) annotation(Placement(transformation(extent={{-40,65},{-20,85}})));
RunFlightPlan.TimeSource timeSource1 annotation(Placement(transformation(extent={{-95,45},{-75,65}})));
Modelica.Blocks.Tables.CombiTable1Ds RollCommandCurve(
table={{0,0},{25.786492253237,0},{25.787935253237,0},{32.204791441651,0},{32.206234441651,0},{32.79902904655,0},{32.800616390534,0},{37.687626723901,0},{37.689069723901,0},{39.778866585705,0},{39.780309585705,0},{44.391515243107,0},{44.392958243107,0},{64.219238055642,0},{64.220681055642,0},{65.533297453724,0},{65.534849785025,0},{69.167337517444,0},{69.168780517444,0},{71.233189315965,0},{71.234632315965,0},{91.730954881384,0},{91.732397881384,0},{92.176860934385,0},{92.177950148563,0},{94.097230193319,0},{94.098673193319,0},{94.54309811646,0},{94.544187128709,0},{99.301664560029,0},{99.303107560029,0},{99.93640873338,0},{99.93785173338,0},{174.525661337499,0},{174.527104337499,0},{183.942664820241,0},{183.944107820241,0},{184.868730074659,0},{184.870173074659,0},{191.639185376725,0},{191.640628376725,0},{192.552594341689,0},{192.554037341689,0},{193.161855687393,0},{193.162941723513,0},{194.102624172672,0},{194.104067172672,0},{196.058768109232,0},{196.060211109232,0},{197.235529291973,0},{197.236972291973,0},{198.205941202781,0},{198.207384202781,0},{200.86348599772,0},{200.86492899772,0},{201.473218912813,0},{201.474306538157,0},{202.648655689236,0},{202.650098689236,0},{203.258139206362,0},{203.25922614281,0},{218.761788196219,0},{218.763231196219,0},{218.97331230055,0},{218.974959657084,0},{245.054,0}},
smoothness=Modelica.Blocks.Types.Smoothness.LinearSegments) annotation(Placement(transformation(extent={{-40,35},{-20,55}})));
Modelica.Blocks.Tables.CombiTable1Ds PitchCommandCurve(
table={{0,0},{48.094293681429,0},{48.095736681429,0},{54.591834225423,0},{54.593277225423,0},{55.513370691687,0},{55.514813691687,0},{61.182904112935,0},{61.184347112935,0},{72.633378124442,0},{72.634821124442,0},{75.836703739009,0},{75.838146739009,0},{76.190291946595,0},{76.191899584097,0},{83.746287567012,0},{83.747730567012,0},{86.669911803152,0},{86.671354803152,0},{89.874386081548,0},{89.875829081548,0},{101.945717413619,0},{101.947160413619,0},{103.004541167946,0},{103.005984167946,0},{103.504697052053,0},{103.505784233044,0},{108.546832048665,0},{108.548275048665,0},{110.016958010245,0},{110.018524511934,0},{111.926708452288,0},{111.928151452288,0},{114.939234058818,0},{114.940677058818,0},{116.125168170284,0},{116.126611170284,0},{147.483847367729,0},{147.485290367729,0},{153.311386368157,0},{153.312829368157,0},{154.803428193241,0},{154.804871193241,0},{159.76161430756,0},{159.76305730756,0},{162.187547920928,0},{162.188990920928,0},{163.20323940764,0},{163.204323638944,0},{164.809861537178,0},{164.811304537178,0},{165.419382090795,0},{165.420469212077,0},{169.085130283014,0},{169.086573283014,0},{169.438735267897,0},{169.440342125828,0},{170.306359413346,0},{170.307802413346,0},{170.420024802715,0},{170.421519033579,0},{205.811730926797,0},{205.813173926797,0},{206.312227312983,0},{206.313315922167,0},{236.060403881501,0},{236.061846881501,0},{236.560902101512,0},{236.561990711112,0},{245.054,0}},
smoothness=Modelica.Blocks.Types.Smoothness.LinearSegments) annotation(Placement(transformation(extent={{-40,5},{-20,25}})));
Modelica.Blocks.Tables.CombiTable1Ds YawCommandCurve(
table={{0,0},{245.054,0}},
smoothness=Modelica.Blocks.Types.Smoothness.LinearSegments) annotation(Placement(transformation(extent={{-40,-25},{-20,-5}})));
equation
// enter your equations here
ControlMode = true;
IndicatorYawConsign = false;
/*if VSCommand1 > 0 then
VerticalSpeedCommand = -1;
elseif VSCommand2 > 0 then
VerticalSpeedCommand = -0.8;
elseif VSCommand3 > 0 then
VerticalSpeedCommand = -0.6;
elseif VSCommand4 > 0 then
VerticalSpeedCommand = -0.4;
elseif VSCommand5 > 0 then
VerticalSpeedCommand = -0.2;
elseif VSCommand6 > 0 then
VerticalSpeedCommand = 0.2;
elseif VSCommand7 > 0 then
VerticalSpeedCommand = 0.4;
elseif VSCommand8 > 0 then
VerticalSpeedCommand = 0.6;
elseif VSCommand9 > 0 then
VerticalSpeedCommand = 0.8;
elseif VSCommand10 > 0 then
VerticalSpeedCommand = 1;
else
VerticalSpeedCommand = 0;
end if;
if YCommandP > 0 then
der(YawCommand) = 0.01;
IndicatorYawConsign = true;
elseif YCommandM > 0 then
der(YawCommand) = -0.01;
IndicatorYawConsign = true;
else
YawCommand = 0;
IndicatorYawConsign = false;
end if;
if RCommandP > 0 then
RollCommand = 0.0261799; //15 deg
elseif RCommandM > 0 then
RollCommand = -0.0261799;
else
RollCommand = 0;
end if;
if PCommandP > 0 then
PitchCommand = 0.0261799;
elseif PCommandM > 0 then
PitchCommand = -0.0261799;
else
PitchCommand = 0;
end if;*/
equation
connect(VerticalSpeedCommandCurve.u,timeSource1.TimeOutput) annotation(Line(
points={{-42,75},{-47,75},{-70,75},{-70,55},{-75,55}},
color={0,0,127},
thickness=0.0625));
connect(RollCommandCurve.u,timeSource1.TimeOutput) annotation(Line(
points={{-42,45},{-47,45},{-70,45},{-70,55},{-75,55}},
color={0,0,127},
thickness=0.0625));
connect(PitchCommandCurve.u,timeSource1.TimeOutput) annotation(Line(
points={{-42,15},{-47,15},{-70,15},{-70,55},{-75,55}},
color={0,0,127},
thickness=0.0625));
connect(YawCommandCurve.u,timeSource1.TimeOutput) annotation(Line(
points={{-42,-15},{-47,-15},{-70,-15},{-70,55},{-75,55}},
color={0,0,127},
thickness=0.0625));
connect(VerticalSpeedCommandCurve.y[1],VerticalSpeedCommand) annotation(Line(
points={{-19,75},{-14,75},{-5,75},{0,75}},
color={0,0,127},
thickness=0.0625));
connect(RollCommandCurve.y[1],RollCommand) annotation(Line(
points={{-19,45},{-14,45},{-5,45},{0,45}},
color={0,0,127},
thickness=0.0625));
connect(PitchCommandCurve.y[1],PitchCommand) annotation(Line(
points={{-19,15},{-14,15},{-5,15},{0,15}},
color={0,0,127},
thickness=0.0625));
connect(YawCommandCurve.y[1],YawCommand) annotation(Line(
points={{-19,-15},{-14,-15},{-4.7,-15},{-4.7,-14.7},{0.3,-14.7}},
color={0,0,127},
thickness=0.0625));
annotation(
VerticalSpeedCommand(flags=2),
RollCommand(flags=2),
PitchCommand(flags=2),
YawCommand(flags=2),
ControlMode(flags=2),
IndicatorYawConsign(flags=2),
VerticalSpeedCommandCurve(
u(flags=2),
y(flags=2)),
timeSource1(TimeOutput(flags=2)),
RollCommandCurve(
u(flags=2),
y(flags=2)),
PitchCommandCurve(
u(flags=2),
y(flags=2)),
YawCommandCurve(
u(flags=2),
y(flags=2)),
Icon(
coordinateSystem(extent={{-125,-100},{125,100}}),
graphics={
Rectangle(
fillColor={255,255,255},
fillPattern=FillPattern.Solid,
extent={{-123.3,100},{123.3,-100}})}),
experiment(
StopTime=1,
StartTime=0,
Interval=0.002,
MaxInterval="0.001"));
end RemoteControlForIntegration;

53
SimulationModels/AIDAModelica/RigidBodyDynamicModel.mo

@ -0,0 +1,53 @@ @@ -0,0 +1,53 @@
within AIDAModelica;
model RigidBodyDynamicModel "Rigid body dynamic model"
// CP: 65001
// SimulationX Version: 3.8.2.45319 x64
Modelica.Blocks.Interfaces.RealInput Moments[3](quantity = "Mechanics.Rotation.Torque", displayUnit = "Nm") "Moments" annotation(
Placement(transformation(extent = {{-75, 55}, {-35, 95}}), iconTransformation(extent = {{-120, -70}, {-80, -30}})));
Modelica.Blocks.Interfaces.RealInput TotalThrust(quantity = "Mechanics.Translation.Force", displayUnit = "N") "Total Thrust" annotation(
Placement(transformation(extent = {{-75, -15}, {-35, 25}}), iconTransformation(extent = {{-120, 30}, {-80, 70}})));
Modelica.Blocks.Interfaces.RealInput Attitude[3](quantity = "Mechanics.Rotation.Angle", displayUnit = "rad") "Attitude input" annotation(
Placement(transformation(extent = {{-75, 25}, {-35, 65}}), iconTransformation(origin = {0, 100}, extent = {{-20, -20}, {20, 20}}, rotation = -90)));
Modelica.Blocks.Interfaces.RealOutput DroneAngularVelocities[3](quantity = "Mechanics.Rotation.RotAccel", displayUnit = "rad/s²") "Drone angular velocities" annotation(
Placement(transformation(extent = {{0, 50}, {20, 70}}), iconTransformation(extent = {{90, 40}, {110, 60}})));
Modelica.Blocks.Interfaces.RealOutput DroneVelocity[3](quantity = "Mechanics.Translation.Accel", displayUnit = "m/s²") "Drone velocity" annotation(
Placement(transformation(extent = {{70, 20}, {90, 40}}), iconTransformation(extent = {{90, -10}, {110, 10}})));
Modelica.Blocks.Interfaces.RealInput ExternalForce[3] annotation(
Placement(transformation(extent = {{-75, -50.7}, {-35, -10.7}}), iconTransformation(extent = {{-20, -120}, {20, -80}})));
Modelica.Blocks.Interfaces.RealOutput Accelerations[3] "'output Real' as connector" annotation(
Placement(transformation(extent = {{65, 5}, {85, 25}}), iconTransformation(extent = {{90, -60}, {110, -40}})));
ComputeDroneVelocity computeDroneVelocity1 annotation(
Placement(transformation(extent = {{-20, 10}, {0, 35}})));
ComputeDroneAngularsVelocities computeDroneAngularsVelocities1 annotation(
Placement(transformation(extent = {{-30, 70}, {-15, 80}})));
equation
// enter your equations here
equation
connect(computeDroneVelocity1.Attitude, Attitude[:]) annotation(
Line(points = {{-9.333328247070313, 35}, {-15, 35}, {-50, 35}, {-50, 45}, {-55, 45}}, color = {0, 0, 127}, thickness = 0.0625),
AutoRoute = false);
connect(computeDroneVelocity1.TotalThrust, TotalThrust) annotation(
Line(points = {{-20, 28.7}, {-25, 28.7}, {-50, 28.7}, {-50, 5}, {-55, 5}}, color = {0, 0, 127}, thickness = 0.0625));
connect(computeDroneAngularsVelocities1.Moments[:], Moments[:]) annotation(
Line(points = {{-30, 75}, {-35, 75}, {-50, 75}, {-55, 75}}, color = {0, 0, 127}, thickness = 0.0625));
connect(computeDroneAngularsVelocities1.DroneAngularVelocities[:], DroneAngularVelocities[:]) annotation(
Line(points = {{-15.3, 75}, {-10.3, 75}, {5, 75}, {5, 60}, {10, 60}}, color = {0, 0, 127}, thickness = 0.0625));
connect(computeDroneVelocity1.DroneVelocity[:], DroneVelocity[:]) annotation(
Line(points = {{0, 28.7}, {5, 28.7}, {75, 28.7}, {75, 30}, {80, 30}}, color = {0, 0, 127}, thickness = 0.0625));
connect(ExternalForce[:], computeDroneVelocity1.ExternalForce[:]) annotation(
Line(points = {{-55, -30.7}, {-50, -30.7}, {-25, -30.7}, {-25, 16.3}, {-20, 16.3}}));
connect(computeDroneVelocity1.Accelerations[:], Accelerations[:]) annotation(
Line(points = {{0, 16.3}, {5, 16.3}, {70, 16.3}, {70, 15}, {75, 15}}, color = {0, 0, 127}, thickness = 0.0625));
annotation(
Moments(flags = 2),
TotalThrust(flags = 2),
Attitude(flags = 2),
DroneAngularVelocities(flags = 2),
DroneVelocity(flags = 2),
ExternalForce(flags = 2),
computeDroneVelocity1(TotalThrust(flags = 2), Attitude(flags = 2), DroneVelocity(flags = 2), ExternalForce(flags = 2), computationAccelerationModel1(TotalThrust(flags = 2), Attitude(flags = 2), DroneAcceleration(flags = 2), ExternalForce(flags = 2), Reb(flags = 2), Rz(flags = 2), Ry(flags = 2), Rx(flags = 2)), integrator4(u(flags = 2), y(flags = 2)), integrator5(u(flags = 2), y(flags = 2)), integrator6(u(flags = 2), y(flags = 2))),
computeDroneAngularsVelocities1(Moments(flags = 2), DroneAngularVelocities(flags = 2), computationAngularAccelerationModel1(Moments(flags = 2), DroneAngularAcceleration(flags = 2), invJ(flags = 2)), integrator1(u(flags = 2), y(flags = 2)), integrator2(u(flags = 2), y(flags = 2)), integrator3(u(flags = 2), y(flags = 2))),
Icon(graphics = {Rectangle(fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid, extent = {{-100, 100}, {103.3, -100}}), Text(origin = {-3, 10}, extent = {{-23, 10}, {23, -10}}, textString = "%name")}, coordinateSystem(initialScale = 0.1)),
experiment(StopTime = 1, StartTime = 0, Interval = 0.002, MaxInterval = "0.001"));
end RigidBodyDynamicModel;

41
SimulationModels/AIDAModelica/RigidBodyKinematicModel.mo

@ -0,0 +1,41 @@ @@ -0,0 +1,41 @@
within AIDAModelica;
model RigidBodyKinematicModel "Rigid body kinematic model"
// CP: 65001
// SimulationX Version: 3.8.2.45319 x64
Modelica.Blocks.Interfaces.RealInput DroneAngularVelocities[3](quantity = "Mechanics.Rotation.RotVelocity", displayUnit = "rad/s") "Angulars velocities" annotation(
Placement(transformation(extent = {{-120, 50}, {-80, 90}}), iconTransformation(extent = {{-120, 30}, {-80, 70}})));
Modelica.Blocks.Interfaces.RealInput Velocity[3](quantity = "Mechanics.Translation.Velocity", displayUnit = "m/s") "Velocity" annotation(
Placement(transformation(extent = {{-120, -20}, {-80, 20}}), iconTransformation(extent = {{-120, -70}, {-80, -30}})));
Modelica.Blocks.Interfaces.RealInput AttitudeFB[3] "Drone attitude feedback" annotation(
Placement(transformation(extent = {{-120, 25}, {-80, 65}}), iconTransformation(origin = {-50, 100}, extent = {{-20, -20}, {20, 20}}, rotation = -90)));
Modelica.Blocks.Interfaces.RealOutput Attitude[3](quantity = "Mechanics.Rotation.RotVelocity", displayUnit = "rad/s", start = {0, 0, 0}) "Attitude derivated" annotation(
Placement(transformation(extent = {{-45, 50}, {-25, 70}}), iconTransformation(extent = {{90, 40}, {110, 60}})));
Modelica.Blocks.Interfaces.RealOutput Position[3](quantity = "Mechanics.Translation.Displace", displayUnit = "m", start = {0, 0, 0}) "Position derivated" annotation(
Placement(transformation(extent = {{-45, -15}, {-25, 5}}), iconTransformation(extent = {{90, -60}, {110, -40}})));
ComputeDronePosition computeDronePosition1(integrator10(initType = Modelica.Blocks.Types.Init.NoInit, y_start = -0.04)) annotation(
Placement(transformation(extent = {{-70, -5}, {-55, 5}})));
ComputeDroneAttitude computeDroneAttitude1 annotation(
Placement(transformation(extent = {{-75, 65}, {-60, 75}})));
equation
connect(computeDroneAttitude1.AttitudeFB[:], AttitudeFB[:]) annotation(
Line(points = {{-70, 65}, {-70, 60}, {-70, 45}, {-95, 45}, {-100, 45}}, color = {0, 0, 127}, thickness = 0.0625));
connect(computeDroneAttitude1.Attitude[:], Attitude[:]) annotation(
Line(points = {{-60.3, 70}, {-55.3, 70}, {-40, 70}, {-40, 60}, {-35, 60}}, color = {0, 0, 127}, thickness = 0.0625));
connect(computeDronePosition1.DronVelocity[:], Velocity[:]) annotation(
Line(points = {{-70, 0}, {-75, 0}, {-95, 0}, {-100, 0}}, color = {0, 0, 127}, thickness = 0.0625));
connect(computeDronePosition1.Position[:], Position[:]) annotation(
Line(points = {{-55.3, 0}, {-50.3, 0}, {-40, 0}, {-40, -5}, {-35, -5}}, color = {0, 0, 127}, thickness = 0.0625));
connect(computeDroneAttitude1.DroneAngularVelocities[:], DroneAngularVelocities[:]) annotation(
Line(points = {{-75, 70}, {-80, 70}, {-95, 70}, {-100, 70}}, color = {0, 0, 127}, thickness = 0.0625));
annotation(
DroneAngularVelocities(flags = 2),
Velocity(flags = 2),
AttitudeFB(flags = 2),
Attitude(flags = 2),
Position(flags = 2),
computeDronePosition1(DronVelocity(flags = 2), Position(flags = 2), integrator10(u(flags = 2), y(flags = 2)), integrator11(u(flags = 2), y(flags = 2)), integrator12(u(flags = 2), y(flags = 2))),
computeDroneAttitude1(DroneAngularVelocities(flags = 2), AttitudeFB(flags = 2), Attitude(flags = 2), computationChangeAngleVelocity1(DronAngularVelocities(flags = 2), Attitude(flags = 2), ChangeAngleVelocity(flags = 2), W(flags = 2)), integrator7(u(flags = 2), y(flags = 2)), integrator8(u(flags = 2), y(flags = 2)), integrator9(u(flags = 2), y(flags = 2))),
Icon(graphics = {Rectangle(fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid, extent = {{-100, 100}, {100, -100}}), Text(origin = {-7, 1}, extent = {{-19, 11}, {19, -11}}, textString = "%name")}, coordinateSystem(initialScale = 0.1)),
experiment(StopTime = 1, StartTime = 0, Interval = 0.002, MaxInterval = "0.001"));
end RigidBodyKinematicModel;

2011
SimulationModels/AIDAModelica/RunFlightPlan.mo

File diff suppressed because it is too large Load Diff

37
SimulationModels/AIDAModelica/SelectAttitudeConsign.mo

@ -0,0 +1,37 @@ @@ -0,0 +1,37 @@
// CP: 65001
// SimulationX Version: 3.8.2.45319 x64
within AIDAModelica;
model SelectAttitudeConsign "[SF2.3.2] Select attitude consign"
Modelica.Blocks.Interfaces.RealInput AttitudeAPConsign[2](
quantity="Mechanics.Rotation.Angle",
displayUnit="rad") "Attitude autopilot mode consign" annotation(Placement(
transformation(extent={{-85,10},{-45,50}}),
iconTransformation(extent={{-120,30},{-80,70}})));
Modelica.Blocks.Interfaces.RealInput AttitudeSACConsign[2](
quantity="Mechanics.Rotation.Angle",
displayUnit="rad") "Attitude SAC mode consign" annotation(Placement(
transformation(extent={{-20,-20},{20,20}}),
iconTransformation(extent={{-120,-70},{-80,-30}})));
Modelica.Blocks.Interfaces.RealOutput AttitudeConsign[2](
quantity="Mechanics.Rotation.Angle",
displayUnit="rad") "Drone attitude consign" annotation(Placement(
transformation(extent={{-10,20},{10,40}}),
iconTransformation(extent={{90,-10},{110,10}})));
equation
connect(AttitudeAPConsign[:],AttitudeConsign) annotation(Line(
points={{-65,30},{-60,30},{-5,30},{0,30}},
color={0,0,127},
thickness=0.0625));
annotation(
AttitudeAPConsign(flags=2),
AttitudeConsign(flags=2),
Icon(graphics={
Rectangle(
fillColor={255,255,255},
fillPattern=FillPattern.Solid,
extent={{-100,100},{100,-100}})}),
experiment(
StopTime=1,
StartTime=0,
Interval=0.001));
end SelectAttitudeConsign;

152
SimulationModels/AIDAModelica/SelectControlMode.mo

File diff suppressed because one or more lines are too long

37
SimulationModels/AIDAModelica/SelectSpeedConsign.mo

@ -0,0 +1,37 @@ @@ -0,0 +1,37 @@
// CP: 65001
// SimulationX Version: 3.8.2.45319 x64
within AIDAModelica;
model SelectSpeedConsign "[SF2.1.2] Select speed consign"
Modelica.Blocks.Interfaces.RealInput NavigationVelocityConsign[3](
quantity="Mechanics.Translation.Velocity",
displayUnit="m/s") "Autopilot velocity consign " annotation(Placement(
transformation(extent={{-130,15},{-90,55}}),
iconTransformation(extent={{-120,-20},{-80,20}})));
Modelica.Blocks.Interfaces.RealOutput VelocityConsign[3](
quantity="Mechanics.Translation.Velocity",
displayUnit="m/s") "Choosed velocity consign" annotation(Placement(
transformation(extent={{-45,25},{-25,45}}),
iconTransformation(extent={{90,-10},{110,10}})));
equation
connect(NavigationVelocityConsign[:],VelocityConsign[:]) annotation(Line(
points={{-110,35},{-105,35},{-40,35},{-35,35}},
color={0,0,127},
thickness=0.0625));
annotation(
NavigationVelocityConsign(flags=2),
VelocityConsign(flags=2),
Icon(
coordinateSystem(extent={{-100,-50},{100,50}}),
graphics={
Rectangle(
fillColor={255,255,255},
fillPattern=FillPattern.Solid,
extent={{-99.5,50},{100.5,-50}}),
Line(points={{-33.3,13.3},{16.7,13.3}}),
Line(points={{-33.1,-3.4},{16.9,-3.4}})}),
experiment(
StopTime=1,
StartTime=0,
Interval=0.002,
MaxInterval="0.001"));
end SelectSpeedConsign;

35
SimulationModels/AIDAModelica/SelectTotalThrustConsign.mo

@ -0,0 +1,35 @@ @@ -0,0 +1,35 @@
// CP: 65001
// SimulationX Version: 3.8.2.45319 x64
within AIDAModelica;
model SelectTotalThrustConsign "[SF2.4.3] Select total thrust consign"
Modelica.Blocks.Interfaces.RealInput TotalThrustAP(
quantity="Mechanics.Translation.Force",
displayUnit="N") "Total thrust autopilot mode" annotation(Placement(
transformation(extent={{-110,30},{-70,70}}),
iconTransformation(extent={{-120,30},{-80,70}})));
Modelica.Blocks.Interfaces.RealInput TotalThrustSAC "Total thrust SAC mode" annotation(Placement(
transformation(extent={{-20,-20},{20,20}}),
iconTransformation(extent={{-120,-70},{-80,-30}})));
Modelica.Blocks.Interfaces.RealOutput TotalThrust(
quantity="Mechanics.Translation.Force",
displayUnit="N") "Total thrust" annotation(Placement(
transformation(extent={{-30,40},{-10,60}}),
iconTransformation(extent={{90,-10},{110,10}})));
equation
connect(TotalThrustAP,TotalThrust) annotation(Line(
points={{-90,50},{-85,50},{-25,50},{-20,50}},
color={0,0,127},
thickness=0.0625));
annotation(
TotalThrustAP(flags=2),
TotalThrust(flags=2),
Icon(graphics={
Rectangle(
fillColor={255,255,255},
fillPattern=FillPattern.Solid,
extent={{-100,100},{100,-100}})}),
experiment(
StopTime=1,
StartTime=0,
Interval=0.001));
end SelectTotalThrustConsign;

99
SimulationModels/AIDAModelica/SimXToProSIVICInterface.mo

@ -0,0 +1,99 @@ @@ -0,0 +1,99 @@
// CP: 65001
// SimulationX Version: 3.8.2.45319 x64
within AIDAModelica;
model SimXToProSIVICInterface "Simulation X to ProSIVIC Interface"
Modelica.Blocks.Interfaces.RealInput Position[3](
quantity="Mechanics.Translation.Displace",
displayUnit="m") "'input Real' as connector" annotation(Placement(
transformation(extent={{-80,60},{-40,100}}),
iconTransformation(
origin={-75,100},
extent={{-20,-20},{20,20}},
rotation=-90)));
Modelica.Blocks.Interfaces.RealInput Attitude[3](
quantity="Mechanics.Rotation.Angle",
displayUnit="rad") "'input Real' as connector" annotation(Placement(
transformation(extent={{20,60},{60,100}}),
iconTransformation(
origin={75,100},
extent={{-20,-20},{20,20}},
rotation=-90)));
Modelica.Blocks.Interfaces.RealOutput translation_x(
quantity="Mechanics.Translation.Displace",
displayUnit="m") "Tracking translation x" annotation(Placement(
transformation(extent={{-95,30},{-75,50}}),
iconTransformation(
origin={-125,-100},
extent={{-10,-10},{10,10}},
rotation=-90)));
Modelica.Blocks.Interfaces.RealOutput translation_y(
quantity="Mechanics.Translation.Displace",
displayUnit="m") "Tracking translation y" annotation(Placement(
transformation(extent={{-70,30},{-50,50}}),
iconTransformation(
origin={-75,-100},
extent={{-10,-10},{10,10}},
rotation=-90)));
Modelica.Blocks.Interfaces.RealOutput translation_z(
quantity="Mechanics.Translation.Displace",
displayUnit="m") "Tracking translation z" annotation(Placement(
transformation(extent={{-30,30},{-10,50}}),
iconTransformation(
origin={-25,-100},
extent={{-10,-10},{10,10}},
rotation=-90)));
Modelica.Blocks.Interfaces.RealOutput rotation_xi(
quantity="Mechanics.Rotation.Angle",
displayUnit="rad") "Tracking rotation xi " annotation(Placement(
transformation(extent={{10,30},{30,50}}),
iconTransformation(
origin={125,-100},
extent={{-10,-10},{10,10}},
rotation=-90)));
Modelica.Blocks.Interfaces.RealOutput rotation_theta(
quantity="Mechanics.Rotation.Angle",
displayUnit="rad") "Tracking rotation theta" annotation(Placement(
transformation(extent={{40,30},{60,50}}),
iconTransformation(
origin={75,-100},
extent={{-10,-10},{10,10}},
rotation=-90)));
Modelica.Blocks.Interfaces.RealOutput rotation_phi(
quantity="Mechanics.Rotation.Angle",
displayUnit="rad") "Tracking rotation phi" annotation(Placement(
transformation(extent={{70,30},{90,50}}),
iconTransformation(
origin={25,-100},
extent={{-10,-10},{10,10}},
rotation=-90)));
equation
// enter your equations here
translation_x = Position[1];
translation_y = -1*Position[2];
translation_z = -1*Position[3];
rotation_phi = Attitude[1];
rotation_theta = -1*Attitude[2];
rotation_xi = -1*Attitude[3];
annotation(
Position(flags=2),
Attitude(flags=2),
translation_x(flags=2),
translation_y(flags=2),
translation_z(flags=2),
rotation_xi(flags=2),
rotation_theta(flags=2),
rotation_phi(flags=2),
Icon(
coordinateSystem(extent={{-175,-100},{175,100}}),
graphics={
Rectangle(
fillColor={255,255,255},
fillPattern=FillPattern.Solid,
extent={{-173.3,100},{173.3,-100}})}),
experiment(
StopTime=1,
StartTime=0,
Interval=0.002,
MaxInterval="0.001"));
end SimXToProSIVICInterface;

171
SimulationModels/AIDAModelica/SimXToProSIVICInterfaceTest.mo

@ -0,0 +1,171 @@ @@ -0,0 +1,171 @@
// CP: 65001
// SimulationX Version: 3.8.2.45319 x64
within AIDAModelica;
model SimXToProSIVICInterfaceTest "Simulation X to ProSIVIC Interface Test"
Modelica.Blocks.Interfaces.RealInput Position[3](
quantity="Mechanics.Translation.Displace",
displayUnit="m") "'input Real' as connector" annotation(Placement(
transformation(extent={{-80,60},{-40,100}}),
iconTransformation(
origin={-75,100},
extent={{-20,-20},{20,20}},
rotation=-90)));
Modelica.Blocks.Interfaces.RealInput Attitude[3](
quantity="Mechanics.Rotation.Angle",
displayUnit="rad") "'input Real' as connector" annotation(Placement(
transformation(extent={{20,60},{60,100}}),
iconTransformation(
origin={75,100},
extent={{-20,-20},{20,20}},
rotation=-90)));
Modelica.Blocks.Interfaces.RealInput Speed[3](
quantity="Mechanics.Translation.Velocity",
displayUnit="m/s") "'input Real' as connector" annotation(Placement(
transformation(extent={{-20,-20},{20,20}}),
iconTransformation(
origin={-275,100},
extent={{-20,-20},{20,20}},
rotation=-90)));
Modelica.Blocks.Interfaces.RealInput AngularSpeed[3](
quantity="Mechanics.Rotation.RotVelocity",
displayUnit="rad/s") "'input Real' as connector" annotation(Placement(
transformation(extent={{-20,-20},{20,20}}),
iconTransformation(
origin={275,100},
extent={{-20,-20},{20,20}},
rotation=-90)));
Modelica.Blocks.Interfaces.RealOutput translation_x(
quantity="Mechanics.Translation.Displace",
displayUnit="m") "Tracking translation x" annotation(Placement(
transformation(extent={{-95,30},{-75,50}}),
iconTransformation(
origin={-125,-100},
extent={{-10,-10},{10,10}},
rotation=-90)));
Modelica.Blocks.Interfaces.RealOutput translation_y(
quantity="Mechanics.Translation.Displace",
displayUnit="m") "Tracking translation y" annotation(Placement(
transformation(extent={{-70,30},{-50,50}}),
iconTransformation(
origin={-75,-100},
extent={{-10,-10},{10,10}},
rotation=-90)));
Modelica.Blocks.Interfaces.RealOutput translation_z(
quantity="Mechanics.Translation.Displace",
displayUnit="m") "Tracking translation z" annotation(Placement(
transformation(extent={{-30,30},{-10,50}}),
iconTransformation(
origin={-25,-100},
extent={{-10,-10},{10,10}},
rotation=-90)));
Modelica.Blocks.Interfaces.RealOutput rotation_xi(
quantity="Mechanics.Rotation.Angle",
displayUnit="rad") "Tracking rotation xi " annotation(Placement(
transformation(extent={{10,30},{30,50}}),
iconTransformation(
origin={125,-100},
extent={{-10,-10},{10,10}},
rotation=-90)));
Modelica.Blocks.Interfaces.RealOutput rotation_theta(
quantity="Mechanics.Rotation.Angle",
displayUnit="rad") "Tracking rotation theta" annotation(Placement(
transformation(extent={{40,30},{60,50}}),
iconTransformation(
origin={75,-100},
extent={{-10,-10},{10,10}},
rotation=-90)));
Modelica.Blocks.Interfaces.RealOutput rotation_phi(
quantity="Mechanics.Rotation.Angle",
displayUnit="rad") "Tracking rotation phi" annotation(Placement(
transformation(extent={{70,30},{90,50}}),
iconTransformation(
origin={25,-100},
extent={{-10,-10},{10,10}},
rotation=-90)));
Modelica.Blocks.Interfaces.RealOutput rollRate(
quantity="Mechanics.Rotation.RotVelocity",
displayUnit="rad/s") "'output Real' as connector" annotation(Placement(
transformation(extent={{-10,-10},{10,10}}),
iconTransformation(
origin={175,-100},
extent={{-10,-10},{10,10}},
rotation=-90)));
Modelica.Blocks.Interfaces.RealOutput pitchRate(
quantity="Mechanics.Rotation.RotVelocity",
displayUnit="rad/s") "'output Real' as connector" annotation(Placement(
transformation(extent={{-10,-10},{10,10}}),
iconTransformation(
origin={225,-100},
extent={{-10,-10},{10,10}},
rotation=-90)));
Modelica.Blocks.Interfaces.RealOutput yawRate(
quantity="Mechanics.Rotation.RotVelocity",
displayUnit="rad/s") "'output Real' as connector" annotation(Placement(
transformation(extent={{-10,-10},{10,10}}),
iconTransformation(
origin={275,-100},
extent={{-10,-10},{10,10}},
rotation=-90)));
Modelica.Blocks.Interfaces.RealOutput SpeedX(
quantity="Mechanics.Translation.Displace",
displayUnit="m") "'output Real' as connector" annotation(Placement(
transformation(extent={{-10,-10},{10,10}}),
iconTransformation(
origin={-275,-100},
extent={{-10,-10},{10,10}},
rotation=-90)));
Modelica.Blocks.Interfaces.RealOutput SpeedY(
quantity="Mechanics.Translation.Displace",
displayUnit="m") "'output Real' as connector" annotation(Placement(
transformation(extent={{-10,-10},{10,10}}),
iconTransformation(
origin={-225,-100},
extent={{-10,-10},{10,10}},
rotation=-90)));
Modelica.Blocks.Interfaces.RealOutput SpeedZ(
quantity="Mechanics.Translation.Displace",
displayUnit="m") "'output Real' as connector" annotation(Placement(
transformation(extent={{-10,-10},{10,10}}),
iconTransformation(
origin={-175,-100},
extent={{-10,-10},{10,10}},
rotation=-90)));
equation
// enter your equations here
translation_x = Position[1];
translation_y = -1*Position[2];
translation_z = -1*Position[3];
rotation_phi = Attitude[1];
rotation_theta = -1*Attitude[2];
rotation_xi = -1*Attitude[3];
rollRate = AngularSpeed[1];
pitchRate = -1*AngularSpeed[2];
yawRate = -1*AngularSpeed[3];
SpeedX = Speed[1];
SpeedY = -1*Speed[2];
SpeedZ = -1*Speed[3];
annotation(
Position(flags=2),
Attitude(flags=2),
translation_x(flags=2),
translation_y(flags=2),
translation_z(flags=2),
rotation_xi(flags=2),
rotation_theta(flags=2),
rotation_phi(flags=2),
Icon(
coordinateSystem(extent={{-325,-100},{325,100}}),
graphics={
Rectangle(
fillColor={255,255,255},
fillPattern=FillPattern.Solid,
extent={{-323.2,100},{326.7,-100}})}),
experiment(
StopTime=1,
StartTime=0,
Interval=0.002,
MaxInterval="0.001"));
end SimXToProSIVICInterfaceTest;

53
SimulationModels/AIDAModelica/SpeedErrorModel.mo

@ -0,0 +1,53 @@ @@ -0,0 +1,53 @@
// CP: 65001
// SimulationX Version: 3.8.2.45319 x64
within AIDAModelica;
model SpeedErrorModel "Speed error calculate model"
Modelica.Blocks.Interfaces.RealInput SpeedConsign[3](
quantity="Mechanics.Translation.Velocity",
displayUnit="m/s") "'input Real' as connector" annotation(Placement(
transformation(extent={{-20,-20},{20,20}}),
iconTransformation(extent={{-120,-20},{-80,20}})));
Modelica.Blocks.Interfaces.RealInput Speed[3](
quantity="Mechanics.Translation.Velocity",
displayUnit="m/s") "'input Real' as connector" annotation(Placement(
transformation(extent={{-20,-20},{20,20}}),
iconTransformation(
origin={0,-100},
extent={{-20,-20},{20,20}},
rotation=90)));
Modelica.Blocks.Interfaces.RealOutput SpeedError[3](
quantity="Mechanics.Translation.Velocity",
displayUnit="m/s") "'output Real' as connector" annotation(Placement(
transformation(extent={{-10,-10},{10,10}}),
iconTransformation(extent={{85,-15},{115,15}})));
equation
// enter your equations here
/*vh = {Speed[1],Speed[2]};
vhd = {SpeedConsign[1],SpeedConsign[2]};
HSE = vhd-vh;
vz = Speed[3];
vzd = SpeedConsign[3];
ASE = vzd-vz;
SpeedError = {HSE[1],HSE[2],ASE};*/
SpeedError = SpeedConsign - Speed;
annotation(Icon(graphics={
Rectangle(
fillColor={255,255,255},
fillPattern=FillPattern.Solid,
extent={{-99.8,99.7},{100.2,-103.6}}),
Ellipse(
fillColor={255,255,255},
fillPattern=FillPattern.Solid,
extent={{-43.3,39.9},{43.4,-40.1}}),
Text(
textString="+",
fillPattern=FillPattern.None,
extent={{-46.6,13.2},{-9.9,-16.8}}),
Text(
textString="-",
fillPattern=FillPattern.None,
extent={{-20,-13.4},{16.7,-43.4}}),
Line(points={{-43.3,-0.1},{-100,-0.1}}),
Line(points={{90,0},{43.3,0}}),
Line(points={{0,-93.3},{0,-40}})}));
end SpeedErrorModel;

40
SimulationModels/AIDAModelica/SpeedErrorModelMM.mo

@ -0,0 +1,40 @@ @@ -0,0 +1,40 @@
// CP: 65001
// SimulationX Version: 3.8.2.45319 x64
within AIDAModelica;
model SpeedErrorModelMM "Speed error calculate model Manual mode"
Modelica.Blocks.Interfaces.RealInput SpeedConsign(
quantity="Mechanics.Translation.Velocity",
displayUnit="m/s") "'input Real' as connector" annotation(Placement(
transformation(extent={{-20,-20},{20,20}}),
iconTransformation(extent={{-120,30},{-80,70}})));
Modelica.Blocks.Interfaces.RealInput Speed(
quantity="Mechanics.Translation.Velocity",
displayUnit="m/s") "'input Real' as connector" annotation(Placement(
transformation(extent={{-20,-20},{20,20}}),
iconTransformation(extent={{-120,-70},{-80,-30}})));
Modelica.Blocks.Interfaces.RealOutput SpeedError(
quantity="Mechanics.Translation.Velocity",
displayUnit="m/s") "'output Real' as connector" annotation(Placement(
transformation(extent={{-10,-10},{10,10}}),
iconTransformation(extent={{90,-10},{110,10}})));
Real vzd(
quantity="Mechanics.Translation.Velocity",
displayUnit="m/s") "Desired altitude speed";
Real vz(
quantity="Mechanics.Translation.Velocity",
displayUnit="m/s") "Real altitude speed";
Real ASE(
quantity="Mechanics.Translation.Velocity",
displayUnit="m/s") "Altitude speed error";
equation
// enter your equations here
vz = Speed;
vzd = SpeedConsign;
ASE = vz-vzd;
SpeedError = ASE;
annotation(Icon(graphics={
Rectangle(
fillColor={255,255,255},
fillPattern=FillPattern.Solid,
extent={{-100,100},{100,-103.3}})}));
end SpeedErrorModelMM;

61
SimulationModels/AIDAModelica/SpeedErrorModelSAC.mo

@ -0,0 +1,61 @@ @@ -0,0 +1,61 @@
// CP: 65001
// SimulationX Version: 3.8.2.45319 x64
within AIDAModelica;
model SpeedErrorModelSAC "Speed error calculate model SAC"
Modelica.Blocks.Interfaces.RealInput SpeedConsign(
quantity="Mechanics.Translation.Velocity",
displayUnit="m/s") "'input Real' as connector" annotation(Placement(
transformation(extent={{-20,-20},{20,20}}),
iconTransformation(extent={{-120,-20},{-80,20}})));
Modelica.Blocks.Interfaces.RealInput Speed(
quantity="Mechanics.Translation.Velocity",
displayUnit="m/s") "'input Real' as connector" annotation(Placement(
transformation(extent={{-20,-20},{20,20}}),
iconTransformation(
origin={0,-100},
extent={{-20,-20},{20,20}},
rotation=90)));
Modelica.Blocks.Interfaces.RealOutput SpeedError(
quantity="Mechanics.Translation.Velocity",
displayUnit="m/s") "'output Real' as connector" annotation(Placement(
transformation(extent={{-10,-10},{10,10}}),
iconTransformation(extent={{90,-10},{110,10}})));
Real vzd(
quantity="Mechanics.Translation.Velocity",
displayUnit="m/s") "Desired altitude speed";
Real vz(
quantity="Mechanics.Translation.Velocity",
displayUnit="m/s") "Real altitude speed";
Real ASE(
quantity="Mechanics.Translation.Velocity",
displayUnit="m/s") "Altitude speed error";
equation
// enter your equations here
vz = Speed;
vzd = SpeedConsign;
ASE = vzd-vz;
SpeedError = ASE;
annotation(
Icon(graphics={
Rectangle(
fillColor={255,255,255},
fillPattern=FillPattern.Solid,
extent={{-100,100},{100,-103.3}}),
Ellipse(
fillColor={255,255,255},
fillPattern=FillPattern.Solid,
extent={{-53.3,40},{40,-40}}),
Text(
textString="+",
fillPattern=FillPattern.None,
extent={{-46.7,10},{-13.3,-16.7}}),
Text(
textString="-",
fillPattern=FillPattern.None,
extent={{-26.7,-16.7},{10,-40}})}),
experiment(
StopTime=1,
StartTime=0,
Interval=0.002,
MaxInterval="0.001"));
end SpeedErrorModelSAC;

177
SimulationModels/AIDAModelica/Step_analysis.mo

@ -0,0 +1,177 @@ @@ -0,0 +1,177 @@
// CP: 65001
// SimulationX Version: 3.8.2.45319 x64
within AIDAModelica;
model Step_analysis "Step_analysis.mo"
Modelica.Blocks.Interfaces.RealInput Consign "'input Real' as connector" annotation(Placement(
transformation(extent={{-105,40},{-65,80}}),
iconTransformation(extent={{-120,30},{-80,70}})));
Modelica.Blocks.Interfaces.RealInput State "'input Real' as connector" annotation(Placement(
transformation(extent={{-105,-15},{-65,25}}),
iconTransformation(extent={{-120,-70},{-80,-30}})));
Modelica.Blocks.Interfaces.RealOutput Stabilized(start=0) "'output Real' as connector" annotation(Placement(
transformation(extent={{65,35},{85,55}}),
iconTransformation(extent={{80,30},{120,70}})));
Modelica.Blocks.Interfaces.BooleanOutput Success(start=false) "'output Boolean' as connector" annotation(Placement(
transformation(extent={{64.7,2.3},{84.7,22.3}}),
iconTransformation(extent={{80,-70},{120,-30}})));
parameter Boolean Desactivate(start=false);
parameter Real Precision(start=0.05);
parameter Real Trigger(start=0.1);
parameter Real Nb_Osc(start=3.0)=1.5;
Boolean Step_Activ(fixed=false);
Real Step_Size(start=0);
Real Step_Start(start=0);
Real Maximum_Overshot(start=0);
Real Semi_Period(start=0);
Real Last_Osc(start=0);
parameter Real period_cst(start=0.2);
Real Prev_Consign(start=0);
Boolean Inside(start=false);
Real Top[2](start={0,0});
Real Prev_Top[2](start={0,0});
Real First(start=0);
Real x(start=0);
Real DerS;
parameter Real T(start=100*Modelica.Constants.eps) "time constant for input State derivation";
algorithm
if Desactivate then
Step_Start:=0;
Step_Size:=0;
First:=0;
Inside:=false;
Success:=false;
Maximum_Overshot:=0;
Semi_Period:=0;
Prev_Top:={0,0};
Top:={0,0};
Stabilized:=0;
else
//détection d'un step de consign
if not Step_Activ then
when abs(Consign-Prev_Consign) > Trigger then
Step_Activ:=true;
Step_Start:=time;
Step_Size:=Consign-Prev_Consign;
end when;
Prev_Consign:=Consign;
elseif Step_Activ then
//il faut surveiller que la consign ne varie plus
/*if abs(Consign-Prev_Consign) > Trigger then
Step_Start:=time;
Step_Size:=Consign-Prev_Consign;
First:=0;
Inside:=false;
Success:=false;
Maximum_Overshot:=0;
Semi_Period:=0;
Prev_Top:={0,0};
Top:={0,0};
Stabilized:=0;
end if ;*/
//Détermination du temps de réponse pour un réponse non oscillatoire
when abs(State-Consign) < Precision*abs(Step_Size) then
First:=time-Step_Start;
Stabilized:=First;
Inside:=true;
elsewhen abs(State-Consign) >= Precision*abs(Step_Size) then
Inside:=false;
Success:=false;
end when;
//si on est à la consigne au bout de N période, la réponse est Inside
when time-(First+Step_Start)>Semi_Period*Nb_Osc and Inside and Semi_Period>0 then
Success:=true;
end when;
//calcul de la semi-période d'oscillation, si on est passé une fois autour de la consign (First>0)
when not Success and abs(DerS)<abs(Step_Size)/1000 and First>0 then //si success, la réponse est stabilisée : on ne calcule plus la période
//premier passage
if Last_Osc==0 then
Maximum_Overshot:= (State - Consign)/Step_Size;
//deuxième passage
elseif Last_Osc<>0 and Semi_Period==0 then
Semi_Period:=2*(time-Last_Osc);
//troisième passage et plus
elseif Last_Osc<>0 then
Semi_Period:=(1-period_cst)*Semi_Period+2*period_cst*(time-Last_Osc);
end if;
Last_Osc:=time;
//enregistrement des sommets successifs
if (State-Consign)*sign(Step_Size)>0 then
Prev_Top:=Top;
Top[1]:=time-Step_Start;
Top[2]:=State-Consign;
end if;
// estimation par interpolation du temps de réponse : en prenant le dernier instant ou on passe sous le seuil, le résultat est discontinu car dépend de la localisation extact de la dernière oscillation
if Stabilized==First and Inside and Prev_Top[1]>0 and State-Consign>0 then
Stabilized:=Top[1]+(Precision*Step_Size-Top[2])*(Top[1]-Prev_Top[1])/(Top[2]-Prev_Top[2]);
end if;
end when;
end if;
end if;
initial equation
x=0;
equation
//calcul de la dérivée de l'entrée State (sinon ne fonctionne pas en FMU, car on ne peux avoir un bloc dérivé directement sur une entrée : Error type DerOfInput)
if Desactivate then
DerS=0;
else
der(x)=(State-x)/T;
DerS=(State-x)/T;
end if;
annotation(
Diagram(graphics={
Line(
points={{-50,5},{-35,5},{-25,70},{-20,45},{-15,55},{-10,
50},{-5,50},{40,50}},
smooth=Smooth.Bezier),
Line(points={{40,55},{-60,55}}),
Line(points={{40,45},{-60,45}}),
Text(
textString="x % of target",
fillPattern=FillPattern.Solid,
extent={{-5,30},{35,20}}),
Line(points={{-20,55},{-20,5}}),
Line(points={{-40,15},{-40,5}}),
Text(
textString="Time to reach",
fillPattern=FillPattern.Solid,
extent={{-15,35},{35,25}}),
Line(
points={{-50,5},{-35,5},{-25,70},{-20,45},{-15,55},{-10,
50},{-5,50},{40,50}},
smooth=Smooth.Bezier),
Line(points={{40,55},{-60,55}}),
Line(points={{40,45},{-60,45}}),
Text(
textString="x % of target",
fillPattern=FillPattern.Solid,
extent={{-5,30},{35,20}}),
Line(points={{-20,55},{-20,5}}),
Line(points={{-40,15},{-40,5}}),
Text(
textString="Time to reach",
fillPattern=FillPattern.Solid,
extent={{-15,35},{35,25}})}),
experiment(
StopTime=1,
StartTime=0,
Interval=0.001));
end Step_analysis;

1846
SimulationModels/AIDAModelica/TrajectoryManagement.bak

File diff suppressed because it is too large Load Diff

5285
SimulationModels/AIDAModelica/TrajectoryManagement.ism

File diff suppressed because it is too large Load Diff

1860
SimulationModels/AIDAModelica/TrajectoryManagement.mo

File diff suppressed because it is too large Load Diff

42
SimulationModels/AIDAModelica/XAngularSpeedErrorModel.mo

@ -0,0 +1,42 @@ @@ -0,0 +1,42 @@
// CP: 65001
// SimulationX Version: 3.8.2.45319 x64
within AIDAModelica;
model XAngularSpeedErrorModel "X angular speed error calculation model"
Modelica.Blocks.Interfaces.RealInput RollConsign(
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 Roll(
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 AngularSpeedX(
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 AngularSpeedXError(
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 Kwphi=1.5 "Proportional gain Kwphi";
Real ephi(
quantity="Mechanics.Rotation.Angle",
displayUnit="rad") "Phi error";
Real wxd(
quantity="Mechanics.Rotation.RotVelocity",
displayUnit="rad/s") "Desired angular speed X";
equation
// enter your equations here
ephi = Roll-RollConsign;
wxd = -Kwphi*ephi;
AngularSpeedXError = wxd-AngularSpeedX ;
annotation(Icon(graphics={
Rectangle(
fillColor={255,255,255},
fillPattern=FillPattern.Solid,
extent={{-100,100},{100,-100}})}));
end XAngularSpeedErrorModel;

46
SimulationModels/AIDAModelica/YAngularSpeedErrorModel.mo

@ -0,0 +1,46 @@ @@ -0,0 +1,46 @@
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;

27
SimulationModels/AIDAModelica/YawConsignProducing.mo

@ -0,0 +1,27 @@ @@ -0,0 +1,27 @@
within AIDAModelica;
model YawConsignProducing "Yaw consign producing"
Modelica.Blocks.Interfaces.RealInput Yaw(
quantity="Mechanics.Rotation.Angle",
displayUnit="rad") "Yaw feenback for logical algo" annotation(Placement(
transformation(extent={{-20,-20},{20,20}}),
iconTransformation(extent={{-120,-70},{-80,-30}})));
Modelica.Blocks.Interfaces.RealOutput DesiredYaw(
quantity="Mechanics.Rotation.Angle",
displayUnit="rad") "Desired yaw produced point" annotation(Placement(
transformation(extent={{-10,-10},{10,10}}),
iconTransformation(extent={{90,-10},{110,10}})));
Modelica.Blocks.Interfaces.BooleanInput YRC "Yaw RC command from remote control indication" annotation(Placement(
transformation(extent={{-20,-20},{20,20}}),
iconTransformation(
origin={-100,50},
extent={{-20,-20},{20,20}})));
initial equation
DesiredYaw=0;
equation
// when a yaw order is commanded from the remote control, the current yaw position is recorded into DesiredYaw, which is added to the remote control order
//this is to prevent a return to 0 heading at manual mode transition
when YRC == false then
DesiredYaw = Yaw;
end when;
annotation(Icon(graphics = {Rectangle(fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid, extent = {{-100, 100}, {100, -100}}), Text(origin = {-8, 0}, extent = {{-40, 10}, {40, -10}}, textString = "%name")}, coordinateSystem(initialScale = 0.1)));
end YawConsignProducing;

46
SimulationModels/AIDAModelica/ZAngularSpeedErrorModel.mo

@ -0,0 +1,46 @@ @@ -0,0 +1,46 @@
// 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;

64
SimulationModels/AIDAModelica/modele_complet_RC.mo

File diff suppressed because one or more lines are too long

14697
SimulationModels/AIDAModelica/package.mo

File diff suppressed because it is too large Load Diff

70
SimulationModels/AIDAModelica/package.order

@ -0,0 +1,70 @@ @@ -0,0 +1,70 @@
WSSModel
ComputationAngularAccelerationModel
drone_feets
RealArrayPassThrough
AccelerationToSpeed
AcquirePositioningSignal
AllocationControl
AttitudeControl
AttitudeControl_PID2
ComputationAccelerationModel
ComputationChangeAngleVelocity
ComputeAltitudeConsign
ComputeDroneAngularsVelocities
ComputeDroneAttitude
ComputeDronePosition
ComputeDroneVelocity
ComputeMoments
ComputeMotorRate
ComputePositionAndTime
ComputeThrustAndAttitudeConsign
ComputeTotalThrust
ComputeTotalThrustCA
ComputeTotalThrustMM
ControlAltitude
ControlAltitudeEx
ControlDroneNavigation
ControlEffectivenessModel
ControlMotor
ControlPitchAngle
ControlPosition
ControlPositionSAC
ControlPositionV0
ControlRollAngle
ControlSpeed
ControlYawAngle
Cosim_Sim_m
CreateMotion
GeneratePositioningSignal
LowLevelFlightControlSystem
modele_complet_RC
MotorControl
MotorPropellerModel
PID_2
PID_discrete
PositionControl
PositionConvector
ProSIVICToSimXInterface
ProSIVICToSimXInterfaceTest
QuadcopterModel
RemoteControl
RemoteControlForIntegration
RigidBodyDynamicModel
RigidBodyKinematicModel
RunFlightPlan
SelectAttitudeConsign
SelectControlMode
SelectSpeedConsign
SelectTotalThrustConsign
SimXToProSIVICInterface
SimXToProSIVICInterfaceTest
SpeedErrorModel
SpeedErrorModelMM
SpeedErrorModelSAC
Step_analysis
TrajectoryManagement
XAngularSpeedErrorModel
YAngularSpeedErrorModel
YawConsignProducing
ZAngularSpeedErrorModel
ModelicaLicense2
Loading…
Cancel
Save