From b165996f5456e4e0ce9ce385825d05becb33dc7b Mon Sep 17 00:00:00 2001 From: Matthew Choulas Date: Sun, 21 Jan 2024 04:36:39 -0500 Subject: [PATCH] finish flywheel constants --- .../config/constants/FlywheelConstants.kt | 23 +++++++++---------- .../subsystems/flywheel/FlywheelIOSim.kt | 2 +- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/src/main/kotlin/com/team4099/robot2023/config/constants/FlywheelConstants.kt b/src/main/kotlin/com/team4099/robot2023/config/constants/FlywheelConstants.kt index 1b12a0a1..678ae65e 100644 --- a/src/main/kotlin/com/team4099/robot2023/config/constants/FlywheelConstants.kt +++ b/src/main/kotlin/com/team4099/robot2023/config/constants/FlywheelConstants.kt @@ -25,18 +25,17 @@ object FlywheelConstants { val VOLTAGE_COMPENSATION = 12.volts - val LEFT_INERTIA = 0.0.kilo.grams * 1.0.meters.squared - val RIGHT_INERTIA = 0.0.kilo.grams * 1.0.meters.squared - - val RIGHT_FLYWHEEL_SUPPLY_CURRENT_LIMIT = 0.0.amps - val RIGHT_FLYWHEEL_THRESHOLD_CURRENT_LIMIT = 0.0.amps - val RIGHT_flywheel_TRIGGER_THRESHOLD_TIME = 0.0.seconds - val RIGHT_FLYWHEEL_STATOR_CURRENT_LIMIT = 0.0.amps - - val LEFT_FLYWHEEL_SUPPLY_CURRENT_LIMIT = 0.0.amps - val LEFT_FLYWHEEL_THRESHOLD_CURRENT_LIMIT = 0.0.amps - val LEFT_flywheel_TRIGGER_THRESHOLD_TIME = 0.0.seconds - val LEFT_FLYWHEEL_STATOR_CURRENT_LIMIT = 0.0.amps + val INERTIA = 0.0014550597.kilo.grams * 1.0.meters.squared + + val RIGHT_FLYWHEEL_SUPPLY_CURRENT_LIMIT = 50.0.amps + val RIGHT_FLYWHEEL_THRESHOLD_CURRENT_LIMIT = 1.0.amps + val RIGHT_flywheel_TRIGGER_THRESHOLD_TIME = 10.0.seconds + val RIGHT_FLYWHEEL_STATOR_CURRENT_LIMIT = 50.0.amps + + val LEFT_FLYWHEEL_SUPPLY_CURRENT_LIMIT = 50.0.amps + val LEFT_FLYWHEEL_THRESHOLD_CURRENT_LIMIT = 1.0.amps + val LEFT_flywheel_TRIGGER_THRESHOLD_TIME = 10.0.seconds + val LEFT_FLYWHEEL_STATOR_CURRENT_LIMIT = 50.0.amps object PID { val REAL_KP: ProportionalGain, Volt> = 0.001.volts / 1.0.rotations.perMinute diff --git a/src/main/kotlin/com/team4099/robot2023/subsystems/flywheel/FlywheelIOSim.kt b/src/main/kotlin/com/team4099/robot2023/subsystems/flywheel/FlywheelIOSim.kt index e7dcddd8..e7cdc90f 100644 --- a/src/main/kotlin/com/team4099/robot2023/subsystems/flywheel/FlywheelIOSim.kt +++ b/src/main/kotlin/com/team4099/robot2023/subsystems/flywheel/FlywheelIOSim.kt @@ -22,7 +22,7 @@ object FlywheelIOSim : FlywheelIO { FlywheelSim( DCMotor.getNEO(1), FlywheelConstants.LEFT_GEAR_RATIO, - FlywheelConstants.LEFT_INERTIA.inKilogramsMeterSquared + FlywheelConstants.INERTIA.inKilogramsMeterSquared ) private var appliedVoltage = 0.volts