|
|
|
|
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;
|