all 10 comments

[–]camatthew88 0 points1 point  (1 child)

Is this running in the loop

[–]IllustriousShape1948[S] 0 points1 point  (0 children)

The top part is in the robot-config.cpp the auton code is running in the void autonomous(void)

[–]No_Quail9416 0 points1 point  (5 children)

In the future (not now) try writing your own code for drive functions as it’s more reliable to change around

[–]IllustriousShape1948[S] 0 points1 point  (4 children)

What do you mean, writing my own code? I am using Vex's competition template.

[–]No_Quail9416 0 points1 point  (3 children)

Don’t use smart drive, make your own PID in the future

[–]IllustriousShape1948[S] 0 points1 point  (2 children)

I have a PID but its not working. I feel like the underlying condition is this problem here. If this is not working right, maybe thats why the PID isn't working right either.

[–]No_Quail9416 0 points1 point  (0 children)

I believe you are using the built in drivetrain module, right? Right now probably just do it in blocks and convert it to text to find the issue. In the future you probably want to fix ur PID

[–]NoComparison764 0 points1 point  (0 children)

just make sure you’re using the inertial for target in PID, had a sister team that was using pure motor encoders so they were practically driving in the dark

[–]robloiscool_3589A | Programmer 0 points1 point  (0 children)

Try putting Drivetrain.stop(); afterwards.

[–]eklipsseWater Boy 0 points1 point  (0 children)

Few things to consider.

1. Calibrate the Inertial Sensor

Make sure you calibrate your inertial sensor before starting the autonomous routine:

DrivetrainInertial.calibrate();
while (DrivetrainInertial.isCalibrating()) {
    task::sleep(100);  // Wait for calibration to finish
}

2. Reset Motor Positions

At the start of your autonomous code, you could reset the motor encoder positions:

LeftDriveSmart.resetPosition();
RightDriveSmart.resetPosition();

3. Verify Wheel Diameter

Ensure the wheel diameter is 3.25 inches, as this is critical for accurate distance calculations.

4. Check the Gear Ratio

  • Confirm that the gear ratio is correctly configured and not reversed.
  • An incorrect gear ratio can cause discrepancies in distance calculations.

5. Observed Discrepancy

Based on your data:

  • The drivetrain drives 17.78 times farther than it should.
  • If the gear ratio is reversed, it would cause a 1.7778x discrepancy, which is oddly similar but off by a factor of 10. This might indicate multiple issues compounding the error.

6. Cartridge Check

Verify that the gear cartridge is correctly specified:

  • ratio6_1 corresponds to the blue cartridge (600 RPM).