From 275485bf60ff90c1a19724834363abcf71083bc7 Mon Sep 17 00:00:00 2001 From: Apple Pi Date: Sun, 19 May 2024 08:20:08 -0400 Subject: [PATCH 1/4] adjusted PIDs and current limits for kraken drive motors. --- src/main/java/frc/robot/RobotContainer.java | 5 +++-- src/main/java/frc/robot/subsystems/swerve/DriveMotor.java | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 7fec32e..02bbf05 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -77,8 +77,8 @@ public RobotContainer() { m_drivetrain::getRobotRelativeChassisSpeeds, m_drivetrain::driveRobotRelative, new HolonomicPathFollowerConfig( - new PIDConstants(3.0), - new PIDConstants(11.0), + new PIDConstants(2.65), + new PIDConstants(8.2), DriveMotor.MAX_SPEED_METERS_PER_SEC, Drivetrain.CENTER_TO_WHEEL_OFFSET_METERS, new ReplanningConfig() @@ -99,6 +99,7 @@ public RobotContainer() { autoChooser.addOption("Jim auto", new PathPlannerAuto("Jim auto")); autoChooser.addOption("Center 4 note close", new PathPlannerAuto("Close 4 note")); autoChooser.addOption("Close shot", new ZeroShoulder().andThen(new AimShoot(true))); + autoChooser.addOption("Anti Aces auto", new PathPlannerAuto("Anti-Aces Auto")); SmartDashboard.putData("Auto chooser", autoChooser); diff --git a/src/main/java/frc/robot/subsystems/swerve/DriveMotor.java b/src/main/java/frc/robot/subsystems/swerve/DriveMotor.java index 70f26de..482e087 100644 --- a/src/main/java/frc/robot/subsystems/swerve/DriveMotor.java +++ b/src/main/java/frc/robot/subsystems/swerve/DriveMotor.java @@ -22,9 +22,9 @@ public class DriveMotor { // Motor settings. private static final CurrentLimitsConfigs CURRENT_LIMITS_CONFIGS = new CurrentLimitsConfigs() - .withSupplyCurrentThreshold(80) + .withSupplyCurrentThreshold(75) .withSupplyTimeThreshold(4.5) - .withSupplyCurrentLimit(40); + .withSupplyCurrentLimit(60); private static final double PERCENT_DEADBAND = 0.001; // Conversion constants. @@ -33,7 +33,7 @@ public class DriveMotor { // PID. private static final int K_TIMEOUT_MS = 10; - private static final Slot0Configs PID_GAINS = new Slot0Configs().withKP(2.0).withKV(0.8); + private static final Slot0Configs PID_GAINS = new Slot0Configs().withKP(2.5).withKV(0.4); private static final double FALCON_500_MAX_SPEED_RPS = 6380.0 / 60.0; private static final MotionMagicConfigs MOTION_MAGIC_CONFIGS = new MotionMagicConfigs() From 51d894d9785595358f31c3537852168d9dd62191 Mon Sep 17 00:00:00 2001 From: Apple Pi Date: Sun, 19 May 2024 08:22:38 -0400 Subject: [PATCH 2/4] added counter auto for aces high in elims --- .../pathplanner/autos/Anti-Aces Auto.auto | 112 ++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 src/main/deploy/pathplanner/autos/Anti-Aces Auto.auto diff --git a/src/main/deploy/pathplanner/autos/Anti-Aces Auto.auto b/src/main/deploy/pathplanner/autos/Anti-Aces Auto.auto new file mode 100644 index 0000000..396c79b --- /dev/null +++ b/src/main/deploy/pathplanner/autos/Anti-Aces Auto.auto @@ -0,0 +1,112 @@ +{ + "version": 1.0, + "startingPose": { + "position": { + "x": 1.454549670868242, + "y": 6.476092609817173 + }, + "rotation": -178.63607246839726 + }, + "command": { + "type": "sequential", + "data": { + "commands": [ + { + "type": "named", + "data": { + "name": "CloseAimShoot" + } + }, + { + "type": "deadline", + "data": { + "commands": [ + { + "type": "path", + "data": { + "pathName": "Amp note 2" + } + }, + { + "type": "named", + "data": { + "name": "Pickup" + } + } + ] + } + }, + { + "type": "named", + "data": { + "name": "AimShoot" + } + }, + { + "type": "deadline", + "data": { + "commands": [ + { + "type": "path", + "data": { + "pathName": "Amp midline note path 2" + } + }, + { + "type": "named", + "data": { + "name": "Pickup" + } + } + ] + } + }, + { + "type": "path", + "data": { + "pathName": "Amp return path" + } + }, + { + "type": "named", + "data": { + "name": "AimShoot" + } + }, + { + "type": "deadline", + "data": { + "commands": [ + { + "type": "path", + "data": { + "pathName": "Amp midline note path 2" + } + }, + { + "type": "named", + "data": { + "name": "Pickup" + } + } + ] + } + }, + { + "type": "path", + "data": { + "pathName": "Amp return path" + } + }, + { + "type": "named", + "data": { + "name": "AimShoot" + } + } + ] + } + }, + "folder": null, + "choreoAuto": false +} \ No newline at end of file From 14f97bf3b2cf99b68233e8641a70cbbd370b6bd2 Mon Sep 17 00:00:00 2001 From: Apple Pi Date: Sun, 19 May 2024 18:05:25 -0400 Subject: [PATCH 3/4] wheel offsets to be fixed next shop session --- src/main/java/frc/robot/subsystems/swerve/SwerveModule.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/frc/robot/subsystems/swerve/SwerveModule.java b/src/main/java/frc/robot/subsystems/swerve/SwerveModule.java index 1e63924..91ce411 100644 --- a/src/main/java/frc/robot/subsystems/swerve/SwerveModule.java +++ b/src/main/java/frc/robot/subsystems/swerve/SwerveModule.java @@ -14,7 +14,7 @@ public class SwerveModule { // Back left, back right, front left, front right convention. // Calibration procedure: set all offsets to 0.0, redeploy, align all wheels to face forwards, // use CANCoder reading as offset, add 180.0 if wheel drives backwards. - private static final double[] STEER_WHEEL_ZERO_OFFSET_DEGREES = {298.04, 260.33, 161.37, -0.44}; + private static final double[] STEER_WHEEL_ZERO_OFFSET_DEGREES = {298.04, 260.33, 161.37, -0.44}; //adjust wheel offsets. private static final DecimalFormat rounder = new DecimalFormat("0.0000"); From 6e6b794e2bb7bd72782ee6fa15d838d256e523fd Mon Sep 17 00:00:00 2001 From: ApplePiRobot Date: Thu, 23 May 2024 19:38:00 -0400 Subject: [PATCH 4/4] drive kp changed. old 2.5, new 2.2 --- src/main/java/frc/robot/subsystems/swerve/DriveMotor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/frc/robot/subsystems/swerve/DriveMotor.java b/src/main/java/frc/robot/subsystems/swerve/DriveMotor.java index 482e087..8629b6d 100644 --- a/src/main/java/frc/robot/subsystems/swerve/DriveMotor.java +++ b/src/main/java/frc/robot/subsystems/swerve/DriveMotor.java @@ -33,7 +33,7 @@ public class DriveMotor { // PID. private static final int K_TIMEOUT_MS = 10; - private static final Slot0Configs PID_GAINS = new Slot0Configs().withKP(2.5).withKV(0.4); + private static final Slot0Configs PID_GAINS = new Slot0Configs().withKP(2.2).withKV(0.4); private static final double FALCON_500_MAX_SPEED_RPS = 6380.0 / 60.0; private static final MotionMagicConfigs MOTION_MAGIC_CONFIGS = new MotionMagicConfigs()