|
Re: Running multiple PID loops on the drivetrain
Quote:
Originally Posted by F22Rapture
Is it possible to use more than one PID controller for a subsystem like the drivetrain? Example: An encoder PID loop to drive to a distance setpoint, while a gyro PID loop keeps the robot going straight.
You could also substitute encoder with Ultrasonic sensor, etc.
If you can't run them simultaneously, is there a way to switch between PID controllers to, say, drive forward 5 meters distance (via encoder), then turn 90 degrees (via gyro), then drive forward again, etc?
|
Yes. Feed the output of the PIDs into Arcade Drive. Use the output of the angle control PID as the joystick input that makes the robot turn, and use the output of the distance PID as the joystick input that makes the robot drive forward.
__________________
-
An ounce of perception is worth a pound of obscure.
|