summaryrefslogtreecommitdiff
path: root/PID_Practice_Cases/PulseDCMotorPID.mo
diff options
context:
space:
mode:
authorSiddharth112352019-09-03 18:09:16 +0530
committerSiddharth112352019-09-03 18:09:16 +0530
commitb4b6aa36e3486a3544acc52419149b5671f841e9 (patch)
tree66c1783158f23e6d21c77324156fc57e18d4ac67 /PID_Practice_Cases/PulseDCMotorPID.mo
parentf5266f634f4fb4fd39933a83551a01cf446256b8 (diff)
downloadOpenModelica_HIL-master.tar.gz
OpenModelica_HIL-master.tar.bz2
OpenModelica_HIL-master.zip
Pushing entire Modelica HIL Tasks repoHEADmaster
Diffstat (limited to 'PID_Practice_Cases/PulseDCMotorPID.mo')
-rw-r--r--PID_Practice_Cases/PulseDCMotorPID.mo37
1 files changed, 37 insertions, 0 deletions
diff --git a/PID_Practice_Cases/PulseDCMotorPID.mo b/PID_Practice_Cases/PulseDCMotorPID.mo
new file mode 100644
index 0000000..be2c6b8
--- /dev/null
+++ b/PID_Practice_Cases/PulseDCMotorPID.mo
@@ -0,0 +1,37 @@
+model PulseDCMotorPID"PID and Motor combine model with Pulse input"
+ Modelica.Blocks.Continuous.PID PID( Td = 0, Ti = 10 ^ 20, k = 15) annotation(
+ Placement(visible = true, transformation(origin = {-30, 10}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica.Blocks.Math.Feedback feedback1 annotation(
+ Placement(visible = true, transformation(origin = {-60, 10}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica.Mechanics.Rotational.Sources.Torque torque1 annotation(
+ Placement(visible = true, transformation(origin = {30, 10}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica.Mechanics.Rotational.Components.Inertia inertia1(J = 5) annotation(
+ Placement(visible = true, transformation(origin = {70, 10}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica.Mechanics.Rotational.Sensors.SpeedSensor speedSensor1 annotation(
+ Placement(visible = true, transformation(origin = {90, -28}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
+ Modelica.Blocks.Sources.Pulse pulse1(amplitude = 833, offset = 0, period = 20, startTime = 0) annotation(
+ Placement(visible = true, transformation(origin = {-90, 10}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+equation
+ connect(pulse1.y,feedback1.u1) annotation(
+ Line(points = {{-78, 10}, {-68, 10}}, color = {0, 0, 127}));
+ connect(PID.y, torque1.tau) annotation(
+ Line(points = {{-18, 10}, {16, 10}, {16, 10}, {18, 10}}, color = {0, 0, 127}));
+ connect(inertia1.flange_b, speedSensor1.flange) annotation(
+ Line(points = {{80, 10}, {90, 10}, {90, -18}, {90, -18}}));
+ connect(feedback1.u2, speedSensor1.w) annotation(
+ Line(points = {{-60, 2}, {-60, -46}, {90, -46}, {90, -38}}, color = {0, 0, 127}));
+ connect(feedback1.y, PID.u) annotation(
+ Line(points = {{-51, 10}, {-42, 10}}, color = {0, 0, 127}));
+ connect(torque1.flange, inertia1.flange_a) annotation(
+ Line(points = {{40, 10}, {60, 10}, {60, 10}, {60, 10}}));
+ annotation (Documentation(info= "<html>
+<p>
+<b>Inter Process Communication Library V1.0</b><br /><br />
+This is a combined model for PID and Motor model with square pulse input.
+</p>
+<p>
+<b>License:</b> OSMC-PL v1.2 2017<br /><br />
+</p>
+</html>"));
+
+end PulseDCMotorPID; \ No newline at end of file