View Single Post
  #1   Spotlight this post!  
Unread 26-01-2016, 09:29
curtis0gj curtis0gj is offline
Registered User
FRC #5033 (Beavertronics)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2015
Location: Canada
Posts: 121
curtis0gj will become famous soon enough
Drive train PID control

Hello, my team this is looking at solutions for driving more accurately in autonomous. At this moment we are using this to drive a certain distance in autonomous.

Code:
if (encoderDistanceReading >= distance) {
				tankDrive.drive(0, 0);
				return;
			} else if (distance > encoderDistanceReading) {
				tankDrive.drive(-0.25, 0);
			} else {
				tankDrive.drive(0.25, 0);
			}
I am curious about using PID control to drive in autonomous with an encoder for input. I have looked at the Potentiometre PID example and read a bit about PID control (https://wpilib.screenstepslive.com/s...s-pid-control).

Our team is currently using the iterative robot template. The drive train is a four motored tank drive with 8 inch pneumatic tires. I have one encoder setup on the left small output shaft. We have a second encoder coming soon.
Reply With Quote