Skip to content

Commit

Permalink
finish flywheel constants
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewChoulas committed Jan 21, 2024
1 parent c3aa23c commit b165996
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<Velocity<Radian>, Volt> = 0.001.volts / 1.0.rotations.perMinute
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b165996

Please sign in to comment.