Tune 2019 subsystems
Change-Id: I0b1d6bb26e70c01236a2f295e36896688c109442
diff --git a/y2019/control_loops/python/elevator.py b/y2019/control_loops/python/elevator.py
index 41c05c6..480ed50 100755
--- a/y2019/control_loops/python/elevator.py
+++ b/y2019/control_loops/python/elevator.py
@@ -2,6 +2,7 @@
from frc971.control_loops.python import control_loop
from frc971.control_loops.python import linear_system
+import copy
import numpy
import sys
import gflags
@@ -24,19 +25,22 @@
radius=2.25 * 0.0254 / 2.0,
mass=first_stage_mass + carriage_mass,
q_pos=0.070,
- q_vel=1.2,
+ q_vel=1.35,
kalman_q_pos=0.12,
kalman_q_vel=2.00,
kalman_q_voltage=35.0,
kalman_r_position=0.05,
dt=0.00505)
+kElevatorModel = copy.copy(kElevator)
+kElevatorModel.mass = carriage_mass + first_stage_mass + 1.0
def main(argv):
if FLAGS.plot:
R = numpy.matrix([[1.5], [0.0]])
- linear_system.PlotKick(kElevator, R)
- linear_system.PlotMotion(kElevator, R, max_velocity=5.0)
+ linear_system.PlotKick(kElevator, R, plant_params=kElevatorModel)
+ linear_system.PlotMotion(
+ kElevator, R, max_velocity=5.0, plant_params=kElevatorModel)
# Write the generated constants out to a file.
if len(argv) != 5:
diff --git a/y2019/control_loops/python/intake.py b/y2019/control_loops/python/intake.py
index 2ac139b..9f4f488 100755
--- a/y2019/control_loops/python/intake.py
+++ b/y2019/control_loops/python/intake.py
@@ -41,8 +41,8 @@
def main(argv):
if FLAGS.plot:
R = numpy.matrix([[numpy.pi / 2.0], [0.0]])
- angular_system.PlotMotion(kIntake, R)
angular_system.PlotKick(kIntake, R)
+ angular_system.PlotMotion(kIntake, R)
# Write the generated constants out to a file.
if len(argv) != 5:
diff --git a/y2019/control_loops/python/wrist.py b/y2019/control_loops/python/wrist.py
index 2e292a2..66b7b26 100755
--- a/y2019/control_loops/python/wrist.py
+++ b/y2019/control_loops/python/wrist.py
@@ -4,6 +4,7 @@
from frc971.control_loops.python import control_loop
from frc971.control_loops.python import angular_system
from frc971.control_loops.python import controls
+import copy
import numpy
import sys
from matplotlib import pylab
@@ -36,12 +37,15 @@
kalman_q_voltage=4.0,
kalman_r_position=0.05)
+kWristModel = copy.copy(kWrist)
+kWristModel.J = 0.1348
+
def main(argv):
if FLAGS.plot:
R = numpy.matrix([[numpy.pi / 2.0], [0.0]])
- angular_system.PlotMotion(kWrist, R)
- angular_system.PlotKick(kWrist, R)
+ angular_system.PlotKick(kWrist, R, plant_params=kWristModel)
+ angular_system.PlotMotion(kWrist, R, plant_params=kWristModel)
# Write the generated constants out to a file.
if len(argv) != 5: