Added indexer support, with stall detection.
Re-tuned some other loops while I was learning more about the indexer.
Change-Id: I893f1f273b31357ae9137601ca27322fc3b09d98
diff --git a/y2017/control_loops/python/shooter.py b/y2017/control_loops/python/shooter.py
index 25e4b24..64732b5 100755
--- a/y2017/control_loops/python/shooter.py
+++ b/y2017/control_loops/python/shooter.py
@@ -58,6 +58,10 @@
self.PlaceControllerPoles([.90])
+ glog.debug('K %s', repr(self.K))
+ glog.debug('Poles are %s',
+ repr(numpy.linalg.eig(self.A - self.B * self.K)[0]))
+
self.PlaceObserverPoles([0.3])
self.U_max = numpy.matrix([[12.0]])
@@ -128,9 +132,9 @@
self.A, self.B = self.ContinuousToDiscrete(
self.A_continuous, self.B_continuous, self.dt)
- q_pos = 2.0
- q_vel = 0.001
- q_voltage = 10.0
+ q_pos = 0.01
+ q_vel = 2.0
+ q_voltage = 0.2
self.Q = numpy.matrix([[(q_pos ** 2.0), 0.0, 0.0],
[0.0, (q_vel ** 2.0), 0.0],
[0.0, 0.0, (q_voltage ** 2.0)]])
@@ -226,8 +230,6 @@
self.t.append(initial_t + i * shooter.dt)
self.u.append(U[0, 0])
- glog.debug('Time: %f', self.t[-1])
-
def Plot(self):
pylab.subplot(3, 1, 1)
pylab.plot(self.t, self.v, label='x')