Skip to content

Commit

Permalink
Elevator Constants modifications
Browse files Browse the repository at this point in the history
  • Loading branch information
Zylve committed Feb 11, 2024
1 parent 20037f6 commit f18e2c7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
13 changes: 8 additions & 5 deletions src/main/java/frc/robot/constants/ElevatorConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ public class ElevatorConstants {
public static final IdleMode IDLE_MODE = IdleMode.kBrake;
public static final int CURRENT_LIMIT = 50;

public static final double GEAR_RATIO = 1.0;
public static final double GEAR_RATIO = 5.0;
public static final double SPOOL_DIAMETER = 1.440; // Inches

public static final boolean ENCODER_INVERTED = false;
public static final double ENCODER_POSITION_FACTOR = 1.0;
public static final double ENCODER_VELOCITY_FACTOR = 1.0 / 60.0;
public static final double ENCODER_POSITION_FACTOR = (SPOOL_DIAMETER * Math.PI) / GEAR_RATIO;
public static final double ENCODER_VELOCITY_FACTOR = ENCODER_POSITION_FACTOR / 60.0;

public static final double P = 0.04;
public static final double I = 0.0;
Expand All @@ -25,8 +26,10 @@ public class ElevatorConstants {
public static final double V = 0.0;
public static final double A = 0.0;

public static final double MAX_VELOCITY = 1.0;
public static final double MAX_ACCELERATION = 1.0;
public static final double MAX_VELOCITY = 55.0; // Inches per second
public static final double MAX_ACCELERATION = 550.0; // Inches per second squared. Assuming we can accelerate to max velocity in 0.1 seconds.

// Inches

public static final double MAX_HEIGHT = 28.0;
public static final double TARGET_HEIGHT = 28.0;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/frc/robot/constants/ModuleConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class ModuleConstants {
public static final double DRIVE_WHEEL_FREE_SPEED_RPS = (DRIVE_MOTOR_FREE_SPEED_RPS * WHEEL_CIRCUMFERENCE_METRES) / DRIVE_MOTOR_REDUCTION;

public static final double DRIVE_ENCODER_POSITION_FACTOR = (WHEEL_DIAMETER_METRES * Math.PI) / DRIVE_MOTOR_REDUCTION; // Metres
public static final double DRIVE_ENCODER_VELOCITY_FACTOR = ((WHEEL_DIAMETER_METRES * Math.PI) / DRIVE_MOTOR_REDUCTION) / 60.0; // Metres per second
public static final double DRIVE_ENCODER_VELOCITY_FACTOR = DRIVE_ENCODER_POSITION_FACTOR / 60.0; // Metres per second

public static final double TURN_ENCODER_POSITION_FACTOR = (2 * Math.PI); // Radians
public static final double TURN_ENCODER_VELOCITY_FACTOR = (2 * Math.PI) / 60.0; // Radians per second
Expand Down

0 comments on commit f18e2c7

Please sign in to comment.