VingVing Robot LogoVingVing Robot

Documentation v0.0.3

VingVing Robot Docs

Automatic Tuning

Automatically measure robot velocities and accelerations for optimal performance

Velocity Tuners

Measure maximum forward and lateral velocities at full power

Zero-Power Acceleration

Measure natural deceleration when power is cut for better path following

Why Automatic Tuning?

These values are crucial for accurate path following. The automatic tuners measure your robot's actual performance rather than relying on theoretical calculations.

Without tuning: Robot may lag behind paths, overshoot turns, or brake too early/late
With tuning: Smooth, accurate path following with proper acceleration and braking

Forward Velocity Tuner

Measures your robot's maximum forward velocity at full power. Critical for feedforward control.

How It Works:

  1. Robot drives forward at full power
  2. Measures velocity over the last 48 inches
  3. Averages the last 10 velocity readings
  4. Displays the maximum forward velocity

Running the Tuner:

1.Ensure battery is FULLY charged (tuning on low battery gives inaccurate results)
2.Clear at least 6 feet (72 inches) of space ahead
3.Run: Tuning → Automatic → Forward Velocity Tuner
4.Robot will accelerate and run forward
5.Press B on gamepad to stop at any time
6.Read "Forward Velocity" value from telemetry
7.Run 2-3 times and average the results

Update RobotConfig:

RobotConfig.java
.xVelocity(52.3)  // Replace with your measured value

Typical values: 45-60 in/s depending on motors and battery

Lateral Velocity Tuner

Measures maximum lateral (strafe) velocity. Usually lower than forward velocity due to mecanum wheel friction.

Running the Tuner:

1.Clear 6 feet of space to the LEFT of robot
2.Run: Tuning → Automatic → Lateral Velocity Tuner
3.Robot will strafe left at full power
4.Read "Strafe Velocity" from telemetry
5.Average multiple runs
RobotConfig.java
.yVelocity(48.5)  // Replace with your measured value

Note: Lateral velocity is typically 85-95% of forward velocity

Zero-Power Acceleration

Measures how quickly your robot naturally decelerates when power is cut. This helps the follower predict braking distances and stop precisely at path endpoints.

Forward Zero-Power Acceleration

Measures forward deceleration when coasting.

1.Run: Tuning → Automatic → Forward Zero Power Acceleration
2.Robot accelerates to 30 in/s
3.Power cuts, robot coasts to stop
4.Measures deceleration rate
5.Value will be NEGATIVE (deceleration)
.forwardZeroPowerAcceleration(-38.2)  // Typical: -30 to -50

Lateral Zero-Power Acceleration

Measures lateral deceleration when coasting.

1.Run: Tuning → Automatic → Lateral Zero Power Acceleration
2.Robot strafes left to 30 in/s
3.Power cuts, measures coast-down
4.Read negative acceleration value
.lateralZeroPowerAcceleration(-42.1)  // Typical: -35 to -55

Important Tips

💡 Always Use Full Battery

Battery voltage significantly affects velocity. Always tune with a fully charged battery and use the same battery level during competitions.

💡 Run Multiple Trials

Run each tuner 3 times and average the results. This accounts for variations in motor performance and floor surface.

💡 Re-tune After Changes

Re-run tuners if you change motors, wheels, battery, or robot weight. These all affect velocity and acceleration.

💡 Press A to Apply Values

After each tuner finishes, press A on gamepad to temporarily apply values (until robot restarts). This lets you test without redeploying code.

Complete RobotConfig Example

RobotConfig.java - After Automatic Tuning
public static MecanumConstants driveConstants = new MecanumConstants()
    .maxPower(1.0)
    // ... motor names and directions ...
    .xVelocity(52.3)  // From Forward Velocity Tuner
    .yVelocity(48.5); // From Lateral Velocity Tuner

public static FollowerConstants followerConstants = new FollowerConstants()
    .mass(10.0)
    .forwardZeroPowerAcceleration(-38.2)  // From Forward ZPA Tuner
    .lateralZeroPowerAcceleration(-42.1)  // From Lateral ZPA Tuner
    // ... PID coefficients ...

Next Steps

With velocity and acceleration values tuned, you're ready to tune PID controllers!

Tune PID Controllers →