Skip to content

Commit

Permalink
Update PID Values 1/27/24
Browse files Browse the repository at this point in the history
  • Loading branch information
Laythdabos committed Jan 28, 2024
1 parent c012e51 commit 85c6970
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions MotionMagic/src/main/java/frc/robot/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,21 @@ public void robotInit() {

/* Configure current limits */
MotionMagicConfigs mm = cfg.MotionMagic;
mm.MotionMagicCruiseVelocity = 5; // 5 rotations per second cruise
mm.MotionMagicAcceleration = 10; // Take approximately 0.5 seconds to reach max vel
mm.MotionMagicCruiseVelocity = 60; // 5 rotations per second cruise
mm.MotionMagicAcceleration = 325; // Take approximately 0.5 seconds to reach max vel
// Take approximately 0.2 seconds to reach max accel
mm.MotionMagicJerk = 50;
mm.MotionMagicJerk = 0;

Slot0Configs slot0 = cfg.Slot0;
slot0.kP = 60;
slot0.kP = 0;
slot0.kI = 0;
slot0.kD = 0.1;
slot0.kV = 0.12;
slot0.kS = 0.25; // Approximately 0.25V to get the mechanism moving
slot0.kD = 0;
slot0.kA = 0.0202;
slot0.kV = 0.109;
slot0.kS = 0.2; // Approximately 0.25V to get the mechanism moving

FeedbackConfigs fdb = cfg.Feedback;
fdb.SensorToMechanismRatio = 12.8;
fdb.SensorToMechanismRatio = 12.8; //6.75:1

StatusCode status = StatusCode.StatusCodeNotInitialized;
for(int i = 0; i < 5; ++i) {
Expand Down

0 comments on commit 85c6970

Please sign in to comment.