Initial tuning on the DT and Shooter
Change-Id: I68fc6d3055c3568b24248f022911ce0113728793
diff --git a/y2017/control_loops/python/drivetrain.py b/y2017/control_loops/python/drivetrain.py
index 8a65128..e722c86 100755
--- a/y2017/control_loops/python/drivetrain.py
+++ b/y2017/control_loops/python/drivetrain.py
@@ -31,7 +31,7 @@
# Moment of inertia of the drivetrain in kg m^2
self.J = 2.0
# Mass of the robot, in kg.
- self.m = 24
+ self.m = 50
# Radius of the robot, in meters (requires tuning by hand)
self.rb = 0.59055 / 2.0
# Radius of the wheels, in meters.
diff --git a/y2017/control_loops/python/polydrivetrain.py b/y2017/control_loops/python/polydrivetrain.py
index df1f18f..f20ec2f 100755
--- a/y2017/control_loops/python/polydrivetrain.py
+++ b/y2017/control_loops/python/polydrivetrain.py
@@ -129,7 +129,7 @@
# FF * X = U (steady state)
self.FF = self.B.I * (numpy.eye(2) - self.A)
- self.PlaceControllerPoles([0.85, 0.85])
+ self.PlaceControllerPoles([0.90, 0.90])
self.PlaceObserverPoles([0.02, 0.02])
self.G_high = self._drivetrain.G_high
diff --git a/y2017/control_loops/python/shooter.py b/y2017/control_loops/python/shooter.py
index 0858e45..917470a 100755
--- a/y2017/control_loops/python/shooter.py
+++ b/y2017/control_loops/python/shooter.py
@@ -39,7 +39,7 @@
# Moment of inertia of the shooter wheel in kg m^2
# 1400.6 grams/cm^2
# 1.407 *1e-4 kg m^2
- self.J = 0.00080
+ self.J = 0.00120
# Resistance of the motor, divided by 2 to account for the 2 motors
self.R = 12.0 / self.stall_current
# Motor velocity constant
@@ -64,7 +64,7 @@
self.A, self.B = self.ContinuousToDiscrete(
self.A_continuous, self.B_continuous, self.dt)
- self.PlaceControllerPoles([.90])
+ self.PlaceControllerPoles([.75])
glog.debug('K %s', repr(self.K))
glog.debug('Poles are %s',
@@ -147,12 +147,12 @@
q_pos = 0.01
q_vel = 2.0
- q_voltage = 0.2
+ q_voltage = 0.3
self.Q_continuous = 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)]])
- r_pos = 0.001
+ r_pos = 0.0003
self.R_continuous = numpy.matrix([[(r_pos ** 2.0)]])
_, _, self.Q, self.R = controls.kalmd(
@@ -256,6 +256,7 @@
self.u.append(U[0, 0])
def Plot(self):
+ pylab.figure()
pylab.subplot(3, 1, 1)
pylab.plot(self.t, self.v, label='x')
pylab.plot(self.t, self.x_hat, label='x_hat')
@@ -270,7 +271,6 @@
pylab.plot(self.t, self.a, label='a')
pylab.legend()
- pylab.figure()
pylab.draw()