Added another pole to the flywheel
Scott, Adam and Campbel did a bunch of testing and concluded
that there is a second pole in the flywheel response. This
commit adds that pole to our system. We need to tune it,
but we need a robot first.
Change-Id: I5ba67db077bb709460c70f6df0164b8c3c1f700d
diff --git a/y2017/control_loops/superstructure/shooter/shooter.h b/y2017/control_loops/superstructure/shooter/shooter.h
index d9b6f45..d13d94c 100644
--- a/y2017/control_loops/superstructure/shooter/shooter.h
+++ b/y2017/control_loops/superstructure/shooter/shooter.h
@@ -33,7 +33,8 @@
double voltage() const;
// Returns the instantaneous velocity.
- double velocity() const { return loop_->X_hat(1, 0); }
+ double velocity() const { return loop_->X_hat(2, 0); }
+ double voltage_error() const { return loop_->X_hat(3, 0); }
double dt_velocity() const { return dt_velocity_; }
@@ -50,7 +51,7 @@
Eigen::Matrix<double, 1, 1> Y_;
// The control loop.
::std::unique_ptr<StateFeedbackLoop<
- 3, 1, 1, StateFeedbackHybridPlant<3, 1, 1>, HybridKalman<3, 1, 1>>>
+ 4, 1, 1, StateFeedbackHybridPlant<4, 1, 1>, HybridKalman<4, 1, 1>>>
loop_;
// History array for calculating a filtered angular velocity.
@@ -67,7 +68,7 @@
double min_velocity_ = 0.0;
double position_error_ = 0.0;
- Eigen::Matrix<double, 3, 1> X_hat_current_;
+ Eigen::Matrix<double, 4, 1> X_hat_current_;
bool ready_ = false;
bool needs_reset_ = false;