Skip to content

add ratios and MOI for each subsystem#31

Merged
Sid220 merged 4 commits intomainfrom
ty/real_ratios
Feb 27, 2026
Merged

add ratios and MOI for each subsystem#31
Sid220 merged 4 commits intomainfrom
ty/real_ratios

Conversation

@tytremblay
Copy link
Contributor

@tytremblay tytremblay commented Feb 25, 2026

Describe your changes

Issue ticket number and link

PR Yes/No List

Note: Exceptions can be made by the Software Director or a Mentor.

1. Scope

  • Does this change clearly correspond to one specific task or card?
  • Are there no unrelated changes mixed into this PR?

2. Build & Deploy

  • Does the code compile successfully?
  • Does the code deploy successfully to the simulator or robot?
  • If deployed to a robot: Does the robot start up normally with this code?

3. Safety & Enable Behavior

  • If deployed to a robot: When enabled, does nothing move unexpectedly?
  • No safety checks, limits, or interlocks are removed or bypassed?

4. Testing & Verification

  • Has this change been tested in simulation, on the real robot, or both?
  • Was the new or changed behavior actually exercised during testing?
  • Did the robot behave the way it was intended to?

5. Behavior & Integration

  • Does existing (unchanged) robot behavior still work as expected?
  • Could this change conflict with other recent or active changes?

6. Code Quality & Maintainability

  • Can another student reasonably read and understand this code?
  • Are variable and method names clear and meaningful?
  • Is temporary debug code, print spam, or commented-out code removed?
  • Are new constants placed in a reasonable, consistent location?
  • Would I be comfortable debugging this code at competition?

7. Readiness to Merge

  • Has a mentor or the Software Director reviewed this, if required?
  • If this code were merged right now, would I feel confident enabling the robot?

@Sid220
Copy link
Contributor

Sid220 commented Feb 26, 2026

@tytremblay The launcher flywheels don't get to target in sim using the same gains as on the real robot. Should we use different gains for sim or do you think there's a way to make the sim more like real life?

@tytremblay
Copy link
Contributor Author

@Sid220 use sim gains for now until we tune the launcher on the real robot. Is this with the new moi?

@Sid220
Copy link
Contributor

Sid220 commented Feb 26, 2026

Yeah, that was using this MOI

@tytremblay
Copy link
Contributor Author

I might have gotten the MOI wrong, or the ratio

@Sid220
Copy link
Contributor

Sid220 commented Feb 26, 2026

There could also be some weirdness arising from creating two DCMotorSims, each with one motor. Also, SimTalonFXIO doesn't implement follow

  public SimTalonFXIO(TalonFXSubsystemConfig config) {
    // the TalonFX in the parent class will store and update the motor charecteristics in simulation
    // the DCMotorSim has the plant model that lets up update the motor state while running in
    // simulation.
    // The gearing parameter is the gear ratio (rotor rotations per mechanism rotation).
    // DCMotorSim outputs mechanism-side position/velocity when gearing is applied.
    this(
        config,
        new DCMotorSim(
            LinearSystemId.createDCMotorSystem(
                DCMotor.getKrakenX60Foc(1),
                config.momentOfInertia.in(KilogramSquareMeters),
                config.unitToRotorRatio),
            DCMotor.getKrakenX60Foc(1),
            0.001,
            0.001));
  }

@Sid220 Sid220 merged commit 7861124 into main Feb 27, 2026
2 checks passed
@Sid220 Sid220 deleted the ty/real_ratios branch February 27, 2026 02:19
@tytremblay
Copy link
Contributor Author

tytremblay commented Mar 1, 2026

@tytremblay The launcher flywheels don't get to target in sim using the same gains as on the real robot. Should we use different gains for sim or do you think there's a way to make the sim more like real life?

@Sid220 this is because we changed the ratios and it blew up all the gains. Sorry. I should have caught this.

@Sid220
Copy link
Contributor

Sid220 commented Mar 1, 2026

@tytremblay That's ok, makes sense. I'll do some work tonight cleaning up all the sim implementations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants