DriveVelocityPIDTuner

This routine is designed to tune the PID coefficients used by the REV Expansion Hubs for closed- loop velocity control. Although it may seem unnecessary, tuning these coefficients is just as important as the positional parameters.

Like the other manual tuning routines, this op mode relies heavily upon the dashboard. To access the dashboard, connect your computer to the RC's WiFi network. In your browser, navigate to https://192.168.49.1:8080/dash if you're using the RC phone or https://192.168.43.1:8080/dash if you are using the Control Hub. Once you've successfully connected, start the program, and your robot will begin moving forward and backward according to a motion profile. Your job is to graph the velocity errors over time and adjust the PID coefficients (note: the tuning variable will not appear until the op mode finishes initializing). Once you've found a satisfactory set of gains, add them to the DriveConstants.java file under the MOTOR_VELO_PID field.

Recommended tuning process: 1. Increase kP until any phase lag is eliminated. Concurrently increase kD as necessary to mitigate oscillations. 2. Add kI (or adjust kF) until the steady state/constant velocity plateaus are reached. 3. Back off kP and kD a little until the response is less oscillatory (but without lag).

Pressing Y/Δ (Xbox/PS4) will pause the tuning process and enter driver override, allowing the user to reset the position of the bot in the event that it drifts off the path. Pressing B/O (Xbox/PS4) will cede control back to the tuning process.

Since

4.0.0

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
The distance the bot will travel back and forth.

Functions

Link copied to clipboard
open fun accept(opMode: LinearOpMode, telemetry: DualTelemetry, drive: RoadRunnerDrive)
Performs this operation on the given arguments.

Inherited functions

Link copied to clipboard
open fun andThen(after: TriConsumer<in T1, in T2, in T3>): TriConsumer<T1, T2, T3>
Returns a composed TriConsumer that performs, in sequence, this operation followed by the after operation.