
24-04-2016, 01:18
|
 |
"Cool" Squad
AKA: Mitchel Stokes
 FRC #5817 (Uni-Rex)
Team Role: Mentor
|
|
Join Date: Aug 2013
Rookie Year: 2014
Location: Clovis, CA
Posts: 337
|
|
|
Re: Using PID in autonomous to keep straight
Quote:
Originally Posted by Dpurry23
Need help figuring out how to use PID to go over an obstacle turn to a certain point. (ex. The position that the robot calibrates at)
This is the code I have so far.
Code:
myRobot.SetSafetyEnabled(false);
myRobot.Drive(-.5,0.0);
Wait(1.5);
myRobot.Drive(0.0, 0.0);
turnController->SetSetpoint(0.0f);
Wait(2.0); // Have to wait till the bot turns
Language is C++
|
You can't use a PID loop without a feedback source, e.g. a gyro or encoders. Do you have a gyro or encoders on your drive?
__________________
My FRC History:
2014 - Team 1671: Central Valley Regional Finalist and Chairman's Award Winner, Sacramento Regional Finalist, Archimedes Quarterfinalist
2015 - Team 1671: Central Valley Regional Semifinalist, Sacramento Regional Semifinalist and Chairman's Award Winner, Newton Winner, Einstein Winner
2016 - Team 5817: Central Valley Regional Finalist and Rookie All-Star, Orange County Regional Quarterfinalist and Rookie All-Star, Newton Division
|