Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions util/PIDFController.java
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ public void copyTo(SparkBase motorController, SparkBaseConfig motorConfig, Close
//need to check - if we just update a few parameters in SparkMaxConfig, do the rest stay the same as previously set?
//otherwise do we need to pull all the prior parameters out of the motorController's sparkmaxconfig and reapply them?
motorConfig.closedLoop.pid(this.getP(), this.getI(), this.getD(), slot);
motorConfig.closedLoop.feedForward.kV(this.getF(), slot);
motorConfig.closedLoop.feedForward.kV(this.getF() * 12.0, slot);
// sparkmax does not like POSITIVE_INFINITY, thows param erron on id 17... 0.0 should workaround
// minor hack: if izone is not set, base class defaults to POSITIVITE_INFINITY
double izone = (this.getIZone() == Double.POSITIVE_INFINITY) ? 0.0 : this.getIZone();
Expand Down Expand Up @@ -295,7 +295,7 @@ public void copyChangesTo(SparkBase motorController, SparkBaseConfig motorConfig
if (!m_changes || motorConfig == null || motorController == null) return;

motorConfig.closedLoop.pid(this.getP(), this.getI(), this.getD(), slot);
motorConfig.closedLoop.feedForward.kV(this.getF(), slot);
motorConfig.closedLoop.feedForward.kV(this.getF() * 12.0, slot);
motorConfig.closedLoop.iZone(getIZone(), slot);

// send to HW if we have a pid change, use async so robot loop isn't delayed
Expand Down