From 3960f3ff55c45ae86a6e5c7a1a18dc314c319101 Mon Sep 17 00:00:00 2001 From: "Keenan D. Buckley" Date: Thu, 12 Mar 2020 19:15:36 -0600 Subject: [PATCH] Tune Shooter --- src/main/deploy/Robot Data - Distances.csv | 19 +- src/main/deploy/Robot Data - DistancesOLD.csv | 8 + .../driverStation/GOAT DRIVERSTATION.json | 615 +++++++----------- .../themes/Ridgbotics/ridgeboticstheme.css | 0 src/main/java/frc4388/robot/Constants.java | 11 +- .../frc4388/robot/subsystems/Shooter.java | 2 +- 6 files changed, 249 insertions(+), 406 deletions(-) create mode 100644 src/main/deploy/Robot Data - DistancesOLD.csv rename src/main/{deploy => }/driverStation/GOAT DRIVERSTATION.json (84%) rename src/main/{deploy => }/driverStation/themes/Ridgbotics/ridgeboticstheme.css (100%) diff --git a/src/main/deploy/Robot Data - Distances.csv b/src/main/deploy/Robot Data - Distances.csv index a63fa24..e33cc7b 100644 --- a/src/main/deploy/Robot Data - Distances.csv +++ b/src/main/deploy/Robot Data - Distances.csv @@ -1,14 +1,7 @@ Distance (in),Hood Ext. (u),Drum Velocity (u/ds),Center Displacment (deg) -1,10,8000,2 -70,21,8000,2, check -100,24,9000,2 -145,28,10000,1 -230,31,12000,0,Add a 270 -246,32,15000,0 -320,32,17000,0,change 17000 and mark them lower -331,33,17000,0 -397,33,16000,0 -415,33,16250,0 -436,31,18000,0 -500,33,18000,0 -501,33,18000,0 \ No newline at end of file +70,20,7000,2.5, +127,27,8467,2, +223,31.25,10398,2.75, +272,32.4,11776,2.5, +342,33,13733,2, +458,30.5,17000,0, \ No newline at end of file diff --git a/src/main/deploy/Robot Data - DistancesOLD.csv b/src/main/deploy/Robot Data - DistancesOLD.csv new file mode 100644 index 0000000..a15874a --- /dev/null +++ b/src/main/deploy/Robot Data - DistancesOLD.csv @@ -0,0 +1,8 @@ +Distance (in),Hood Ext. (u),Drum Velocity (u/ds),Center Displacment (deg) +1,10,7769,0 +70,21,7769,0, check +100,24,8580,0 +145,28,9390,0 +230,31,11010,0,Add a 270 +397,33,14250,0 +415,33,14452,0 \ No newline at end of file diff --git a/src/main/deploy/driverStation/GOAT DRIVERSTATION.json b/src/main/driverStation/GOAT DRIVERSTATION.json similarity index 84% rename from src/main/deploy/driverStation/GOAT DRIVERSTATION.json rename to src/main/driverStation/GOAT DRIVERSTATION.json index 8fa33b4..a191e6e 100644 --- a/src/main/deploy/driverStation/GOAT DRIVERSTATION.json +++ b/src/main/driverStation/GOAT DRIVERSTATION.json @@ -17,88 +17,11 @@ ], "content": { "_type": "Text View", - "_source0": "network_table:///SmartDashboard/Shooter Current", - "_title": "Shooter Current" + "_source0": "network_table:///SmartDashboard/limelight_Stream", + "_title": "limelight_Stream" } }, "1,0": { - "size": [ - 1, - 1 - ], - "content": { - "_type": "Text View", - "_source0": "network_table:///SmartDashboard/Delta Time", - "_title": "Delta Time" - } - }, - "2,0": { - "size": [ - 1, - 1 - ], - "content": { - "_type": "Text View", - "_source0": "network_table:///SmartDashboard/Time Seconds", - "_title": "Time Seconds" - } - }, - "3,0": { - "size": [ - 1, - 1 - ], - "content": { - "_type": "Text View", - "_source0": "network_table:///SmartDashboard/Shooter Temp C", - "_title": "Shooter Temp C" - } - }, - "4,0": { - "size": [ - 1, - 1 - ], - "content": { - "_type": "Text View", - "_source0": "network_table:///SmartDashboard/Auto?", - "_title": "Auto?" - } - }, - "5,0": { - "size": [ - 1, - 1 - ], - "content": { - "_type": "Text View", - "_source0": "network_table:///SmartDashboard/Fire Angle CSV", - "_title": "Fire Angle CSV" - } - }, - "6,0": { - "size": [ - 1, - 1 - ], - "content": { - "_type": "Text View", - "_source0": "network_table:///SmartDashboard/Drum Velocity", - "_title": "Drum Velocity" - } - }, - "7,0": { - "size": [ - 1, - 1 - ], - "content": { - "_type": "Text View", - "_source0": "network_table:///SmartDashboard/Drum Velocity CSV", - "_title": "Drum Velocity CSV" - } - }, - "8,0": { "size": [ 1, 1 @@ -109,7 +32,7 @@ "_title": "limelight_PipelineName" } }, - "9,0": { + "2,0": { "size": [ 1, 1 @@ -120,18 +43,18 @@ "_title": "limelight_Interface" } }, - "0,1": { + "3,0": { "size": [ 1, 1 ], "content": { "_type": "Text View", - "_source0": "network_table:///SmartDashboard/limelight_Stream", - "_title": "limelight_Stream" + "_source0": "network_table:///SmartDashboard/Auto?", + "_title": "Auto?" } }, - "1,1": { + "4,0": { "size": [ 2, 2 @@ -146,33 +69,7 @@ "Visuals/Counter clockwise": false } }, - "3,1": { - "size": [ - 1, - 1 - ], - "content": { - "_type": "Boolean Box", - "_source0": "network_table:///SmartDashboard/Climber Safety", - "_title": "Climber Safety", - "Colors/Color when true": "#7CFC00FF", - "Colors/Color when false": "#8B0000FF" - } - }, - "4,1": { - "size": [ - 1, - 1 - ], - "content": { - "_type": "Boolean Box", - "_source0": "network_table:///SmartDashboard/Rachet", - "_title": "Rachet", - "Colors/Color when true": "#7CFC00FF", - "Colors/Color when false": "#8B0000FF" - } - }, - "5,1": { + "6,0": { "size": [ 3, 2 @@ -186,7 +83,51 @@ "Visuals/Show velocity vectors": true } }, - "8,1": { + "9,0": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Left Motor Position Raw", + "_title": "Left Motor Position Raw" + } + }, + "0,1": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Right Motor Position Raw", + "_title": "Right Motor Position Raw" + } + }, + "1,1": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Average Motor Position Raw", + "_title": "Average Motor Position Raw" + } + }, + "2,1": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Avg Speed MPH", + "_title": "Avg Speed MPH" + } + }, + "3,1": { "size": [ 1, 1 @@ -205,11 +146,9 @@ 1 ], "content": { - "_type": "Boolean Box", - "_source0": "network_table:///SmartDashboard/Drum Ready", - "_title": "Drum Ready", - "Colors/Color when true": "#7CFC00FF", - "Colors/Color when false": "#8B0000FF" + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Drum Velocity", + "_title": "Drum Velocity" } }, "0,2": { @@ -218,11 +157,31 @@ 1 ], "content": { - "_type": "Boolean Box", - "_source0": "network_table:///SmartDashboard/Shooter Beam", - "_title": "Shooter Beam", - "Colors/Color when true": "#7CFC00FF", - "Colors/Color when false": "#8B0000FF" + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Drum Velocity CSV", + "_title": "Drum Velocity CSV" + } + }, + "1,2": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Shooter Temp C", + "_title": "Shooter Temp C" + } + }, + "2,2": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Shooter Current", + "_title": "Shooter Current" } }, "3,2": { @@ -232,13 +191,39 @@ ], "content": { "_type": "Boolean Box", - "_source0": "network_table:///SmartDashboard/Upper Beam", - "_title": "Upper Beam", + "_source0": "network_table:///SmartDashboard/Drum Ready", + "_title": "Drum Ready", "Colors/Color when true": "#7CFC00FF", "Colors/Color when false": "#8B0000FF" } }, "4,2": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Turret Angle Raw", + "_title": "Turret Angle Raw" + } + }, + "5,2": { + "size": [ + 2, + 2 + ], + "content": { + "_type": "Gyro", + "_source0": "network_table:///SmartDashboard/Turret Angle", + "_title": "Turret Angle", + "Visuals/Major tick spacing": 45.0, + "Visuals/Starting angle": 180.0, + "Visuals/Show tick mark ring": true, + "Visuals/Counter clockwise": false + } + }, + "7,2": { "size": [ 1, 1 @@ -252,6 +237,54 @@ } }, "8,2": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Fire Angle CSV", + "_title": "Fire Angle CSV" + } + }, + "9,2": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Hood Angle Raw", + "_title": "Hood Angle Raw" + } + }, + "0,3": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Boolean Box", + "_source0": "network_table:///SmartDashboard/Climber Safety", + "_title": "Climber Safety", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + } + }, + "1,3": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Boolean Box", + "_source0": "network_table:///SmartDashboard/Rachet", + "_title": "Rachet", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + } + }, + "2,3": { "size": [ 1, 1 @@ -264,7 +297,7 @@ "Colors/Color when false": "#8B0000FF" } }, - "9,2": { + "3,3": { "size": [ 1, 1 @@ -277,226 +310,31 @@ "Colors/Color when false": "#8B0000FF" } }, - "0,3": { - "size": [ - 1, - 1 - ], - "content": { - "_type": "Text View", - "_source0": "network_table:///SmartDashboard/Left Motor Position Raw", - "_title": "Left Motor Position Raw" - } - }, - "1,3": { - "size": [ - 1, - 1 - ], - "content": { - "_type": "Text View", - "_source0": "network_table:///SmartDashboard/Right Motor Position Raw", - "_title": "Right Motor Position Raw" - } - }, - "2,3": { - "size": [ - 1, - 1 - ], - "content": { - "_type": "Text View", - "_source0": "network_table:///SmartDashboard/Average Motor Position Raw", - "_title": "Average Motor Position Raw" - } - }, - "3,3": { - "size": [ - 1, - 1 - ], - "content": { - "_type": "Text View", - "_source0": "network_table:///SmartDashboard/Avg Speed MPH", - "_title": "Avg Speed MPH" - } - }, "4,3": { "size": [ 1, 1 ], "content": { - "_type": "Text View", - "_source0": "network_table:///SmartDashboard/Turret Angle Raw", - "_title": "Turret Angle Raw" + "_type": "Boolean Box", + "_source0": "network_table:///SmartDashboard/Upper Beam", + "_title": "Upper Beam", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" } }, - "5,3": { + "7,3": { "size": [ 1, 1 ], "content": { "_type": "Boolean Box", - "_source0": "network_table:///SmartDashboard/Aim Ready", - "_title": "Aim Ready", + "_source0": "network_table:///SmartDashboard/Shooter Beam", + "_title": "Shooter Beam", "Colors/Color when true": "#7CFC00FF", "Colors/Color when false": "#8B0000FF" } - }, - "6,3": { - "size": [ - 2, - 2 - ], - "content": { - "_type": "Gyro", - "_source0": "network_table:///SmartDashboard/Turret Angle", - "_title": "Turret Angle", - "Visuals/Major tick spacing": 45.0, - "Visuals/Starting angle": 180.0, - "Visuals/Show tick mark ring": true, - "Visuals/Counter clockwise": false - } - }, - "8,3": { - "size": [ - 1, - 1 - ], - "content": { - "_type": "Text View", - "_source0": "network_table:///SmartDashboard/Hood Angle Raw", - "_title": "Hood Angle Raw" - } - }, - "9,3": { - "size": [ - 1, - 1 - ], - "content": { - "_type": "Boolean Box", - "_source0": "network_table:///SmartDashboard/!Ball in Intake!", - "_title": "!Ball in Intake!", - "Colors/Color when true": "#7CFC00FF", - "Colors/Color when false": "#8B0000FF" - } - }, - "0,4": { - "size": [ - 1, - 1 - ], - "content": { - "_type": "Boolean Box", - "_source0": "network_table:///SmartDashboard/!Ball Storage!", - "_title": "!Ball Storage!", - "Colors/Color when true": "#7CFC00FF", - "Colors/Color when false": "#8B0000FF" - } - }, - "1,4": { - "size": [ - 1, - 1 - ], - "content": { - "_type": "Boolean Box", - "_source0": "network_table:///SmartDashboard/!Ball Shooter!", - "_title": "!Ball Shooter!", - "Colors/Color when true": "#7CFC00FF", - "Colors/Color when false": "#8B0000FF" - } - }, - "2,4": { - "size": [ - 1, - 1 - ], - "content": { - "_type": "Text View", - "_source0": "network_table:///SmartDashboard/Distance to Target", - "_title": "Distance to Target" - } - }, - "3,4": { - "size": [ - 1, - 1 - ], - "content": { - "_type": "Text View", - "_source0": "network_table:///SmartDashboard/Center Displacement", - "_title": "Center Displacement" - } - }, - "4,4": { - "size": [ - 1, - 1 - ], - "content": { - "_type": "Text View", - "_source0": "network_table:///SmartDashboard/Is Auto Start?", - "_title": "Is Auto Start?" - } - }, - "5,4": { - "size": [ - 1, - 1 - ], - "content": { - "_type": "Text View", - "_source0": "network_table:///SmartDashboard/Left Motor Pos Inches", - "_title": "Left Motor Pos Inches" - } - }, - "8,4": { - "size": [ - 1, - 1 - ], - "content": { - "_type": "Text View", - "_source0": "network_table:///SmartDashboard/Right Motor Pos Inches", - "_title": "Right Motor Pos Inches" - } - }, - "9,4": { - "size": [ - 1, - 1 - ], - "content": { - "_type": "Text View", - "_source0": "network_table:///SmartDashboard/Left Motor Pos Meters", - "_title": "Left Motor Pos Meters" - } - }, - "0,5": { - "size": [ - 1, - 1 - ], - "content": { - "_type": "Text View", - "_source0": "network_table:///SmartDashboard/Right Motor Pos Meters", - "_title": "Right Motor Pos Meters" - } - }, - "1,5": { - "size": [ - 1, - 1 - ], - "content": { - "_type": "Text View", - "_source0": "network_table:///SmartDashboard/Odometry Values Meters", - "_title": "Odometry Values Meters" - } } } } @@ -773,46 +611,6 @@ "hgap": 16.0, "vgap": 16.0, "tiles": { - "8,6": { - "size": [ - 2, - 2 - ], - "content": { - "_type": "Gyro", - "_title": "Gyro", - "Visuals/Major tick spacing": 45.0, - "Visuals/Starting angle": 180.0, - "Visuals/Show tick mark ring": true, - "Visuals/Counter clockwise": false - } - }, - "8,5": { - "size": [ - 2, - 1 - ], - "content": { - "_type": "Simple Dial", - "_title": "Simple Dial", - "Range/Min": 0.0, - "Range/Max": 100.0, - "Visuals/Show value": true - } - }, - "8,0": { - "size": [ - 2, - 1 - ], - "content": { - "_type": "Simple Dial", - "_title": "Simple Dial", - "Range/Min": 0.0, - "Range/Max": 100.0, - "Visuals/Show value": true - } - }, "0,0": { "size": [ 4, @@ -865,21 +663,6 @@ "Visuals/Show value": true } }, - "7,1": { - "size": [ - 3, - 3 - ], - "content": { - "_type": "Gyro", - "_source0": "network_table:///SmartDashboard/Pigeon Gyro", - "_title": "SmartDashboard/Pigeon Gyro", - "Visuals/Major tick spacing": 45.0, - "Visuals/Starting angle": 180.0, - "Visuals/Show tick mark ring": true, - "Visuals/Counter clockwise": false - } - }, "4,3": { "size": [ 1, @@ -1010,15 +793,73 @@ "Colors/Color when true": "#7CFC00FF", "Colors/Color when false": "#8B0000FF" } + }, + "8,6": { + "size": [ + 2, + 2 + ], + "content": { + "_type": "Gyro", + "_source0": "network_table:///SmartDashboard/Turret Angle", + "_title": "SmartDashboard/Turret Angle", + "Visuals/Major tick spacing": 45.0, + "Visuals/Starting angle": 180.0, + "Visuals/Show tick mark ring": true, + "Visuals/Counter clockwise": false + } + }, + "7,1": { + "size": [ + 3, + 3 + ], + "content": { + "_type": "Gyro", + "_source0": "network_table:///SmartDashboard/Pigeon Gyro", + "_title": "SmartDashboard/Pigeon Gyro", + "Visuals/Major tick spacing": 45.0, + "Visuals/Starting angle": 180.0, + "Visuals/Show tick mark ring": true, + "Visuals/Counter clockwise": false + } + }, + "8,0": { + "size": [ + 2, + 1 + ], + "content": { + "_type": "Simple Dial", + "_source0": "network_table:///SmartDashboard/Avg Speed MPH", + "_title": "SmartDashboard/Avg Speed MPH", + "Range/Min": 0.0, + "Range/Max": 100.0, + "Visuals/Show value": true + } + }, + "8,5": { + "size": [ + 2, + 1 + ], + "content": { + "_type": "Simple Dial", + "_source0": "network_table:///SmartDashboard/Hood Angle Raw", + "_title": "SmartDashboard/Hood Angle Raw", + "Range/Min": 0.0, + "Range/Max": 66.0, + "Visuals/Show value": true + } } } } } ], "windowGeometry": { - "x": -7.199999809265137, - "y": -7.199999809265137, - "width": 1550.4000244140625, - "height": 878.4000244140625 + "x": 40.0, + "y": 142.39999389648438, + "width": 1547.199951171875, + "height": 1481.5999755859375 } } \ No newline at end of file diff --git a/src/main/deploy/driverStation/themes/Ridgbotics/ridgeboticstheme.css b/src/main/driverStation/themes/Ridgbotics/ridgeboticstheme.css similarity index 100% rename from src/main/deploy/driverStation/themes/Ridgbotics/ridgeboticstheme.css rename to src/main/driverStation/themes/Ridgbotics/ridgeboticstheme.css diff --git a/src/main/java/frc4388/robot/Constants.java b/src/main/java/frc4388/robot/Constants.java index c6a8a3e..9956c75 100644 --- a/src/main/java/frc4388/robot/Constants.java +++ b/src/main/java/frc4388/robot/Constants.java @@ -117,7 +117,8 @@ public final class Constants { public static final int SHOOTER_PID_LOOP_IDX = 1; public static final int SHOOTER_TIMEOUT_MS = 30; public static final Gains DRUM_SHOOTER_GAINS = new Gains(1.5, 0.0, 100, 0.055, 0, 1.0); - public static final Gains SHOOTER_TURRET_GAINS = new Gains(0.0, 0.0, 0.0, 0.0, 0, 1.0); + //public static final Gains DRUM_SHOOTER_GAINS = new Gains(0.55, 0.0, 100, 0.0, 0, 1.0); + public static final Gains SHOOTER_TURRET_GAINS = new Gains(0.6, 0.0, 0.0, 0.0, 0, 1.0); public static final Gains SHOOTER_ANGLE_GAINS = new Gains(0.05, 0.0, 0.0, 0.0, 0, 0.3); public static final double SHOOTER_TURRET_MIN = -1.0; public static final double ENCODER_TICKS_PER_REV = 2048; @@ -131,8 +132,8 @@ public final class Constants { public static final int TURRET_LEFT_SOFT_LIMIT = -55; public static final double TURRET_SPEED_MULTIPLIER = 0.3; public static final double TURRET_CALIBRATE_SPEED = 0.075; - public static final double TURRET_MOTOR_ROTS_PER_ROT = 89.56696; - public static final double TURRET_MOTOR_POS_AT_ZERO_ROT = 0; //TODO: Find + public static final double TURRET_MOTOR_ROTS_PER_ROT = 101.04972; //89.56696; + public static final double TURRET_MOTOR_POS_AT_ZERO_ROT = -28.452166; public static final int HOOD_UP_SOFT_LIMIT = 33; public static final int HOOD_DOWN_SOFT_LIMIT = 3; @@ -208,9 +209,9 @@ public final class Constants { public static final double FOV = 29.8; //Field of view of limelight public static final double TARGET_HEIGHT = 71.5; public static final double LIME_ANGLE = 24.7; - public static final double TURN_P_VALUE = 0.6; + public static final double TURN_P_VALUE = 0.8; public static final double X_ANGLE_ERROR = 1.3; - public static final double MOTOR_DEAD_ZONE = 0.3; + public static final double MOTOR_DEAD_ZONE = 0.2; public static final double DISTANCE_ERROR_EQUATION_M = 1.1279; public static final double DISTANCE_ERROR_EQUATION_B = -15.0684; public static final double GRAV = 385.83; diff --git a/src/main/java/frc4388/robot/subsystems/Shooter.java b/src/main/java/frc4388/robot/subsystems/Shooter.java index 89e1bfb..890e0f7 100644 --- a/src/main/java/frc4388/robot/subsystems/Shooter.java +++ b/src/main/java/frc4388/robot/subsystems/Shooter.java @@ -54,7 +54,7 @@ public class Shooter extends SubsystemBase { m_shooterFalcon.setNeutralMode(NeutralMode.Coast); m_shooterFalcon.setInverted(true); m_shooterFalcon.configOpenloopRamp(1, ShooterConstants.SHOOTER_TIMEOUT_MS); - //m_shooterFalcon.configClosedloopRamp(1.0, ShooterConstants.SHOOTER_TIMEOUT_MS); + m_shooterFalcon.configClosedloopRamp(0.75, ShooterConstants.SHOOTER_TIMEOUT_MS); setShooterGains(); m_shooterFalcon.configPeakOutputReverse(0, ShooterConstants.SHOOTER_TIMEOUT_MS);