summaryrefslogtreecommitdiff
path: root/digital/asserv/models/inductance.m
diff options
context:
space:
mode:
authorNicolas Schodet2007-08-06 10:52:37 +0200
committerNicolas Schodet2007-08-06 10:52:37 +0200
commit597eb3821de45a02fe5820266dbc87069162211a (patch)
treee0545a692bc3772c674bd1324148355074de5b3e /digital/asserv/models/inductance.m
parent22351b5b3dcec28ec052eb70010bef53a39ef670 (diff)
Added motor models.
Diffstat (limited to 'digital/asserv/models/inductance.m')
-rw-r--r--digital/asserv/models/inductance.m37
1 files changed, 37 insertions, 0 deletions
diff --git a/digital/asserv/models/inductance.m b/digital/asserv/models/inductance.m
new file mode 100644
index 00000000..edc8b777
--- /dev/null
+++ b/digital/asserv/models/inductance.m
@@ -0,0 +1,37 @@
+% Show influence of inductance when not doing PWM.
+motor;
+
+%global to_file = 1;
+
+function u = control (t)
+ global sys;
+ if (t < 1)
+ u = sys.motor.u;
+ else
+ u = 0;
+ end
+end
+
+global sys;
+sys.motor = re40g;
+sys.gear = gear4x;
+sys.load = robot10w80;
+sys.load.J /= 2; % Two motors.
+sys.control.func = "control";
+
+% With inductance.
+plotterm ("w_induct");
+sys_plot (2);
+
+% With inductance zoom.
+plotterm ("w_inductz");
+sys_plot (2 / 100);
+
+% Without inductance.
+sys.motor.L = 0;
+plotterm ("wo_induct");
+sys_plot (2);
+
+% Without inductance zoom.
+plotterm ("wo_inductz");
+sys_plot (2 / 100);