Hello, I am not the best at programming and am unsure how to set up PID control for my x drive base with Omni wheels. I understand how PID control works with a tank drive setup. This is a blank state of what I understand, but am unsure how to implement this for x drive. If anyone could explain how I could go about setting up my PID for x-drive that would be great, thank you.

Kp = ;

Ki = ;

Kd = ;

error = 0;

lastError = 0;

integral = 0;

derivative = 0;

while ( leftEncoderClicks < targetClicks ) {

error = leftEncoderClicks - rightEncoderClicks;

integral = integral + error;

derivative = error - lastError;

rightPower = leftPower + (error * Kp)

+ (integral * Ki)

+ (derivative * Kd);

wait1Msec(20);

}

rightPower = 0;

leftPower = 0;