![]() |
Using PID in autonomous to keep straight
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); |
Re: Using PID in autonomous to keep straight
Quote:
|
Re: Using PID in autonomous to keep straight
Sorry for not explaining, we are using a gyro as a source with the output being our drivetrain.
|
Re: Using PID in autonomous to keep straight
Quote:
Code:
double angle = robot.getAngle();If you want to get more complex than that, you could use a PI loop, but that's another story. |
Re: Using PID in autonomous to keep straight
Here is the problem:
PID presumes continuous measurements. If you are crossing the low bar with no jerky movements, then PID works ok for driving straight (our robot drives like a slightly drunken sailor). Over the other Defenses, the jerkiness throws off PID. You will eventually head in the right direction (gyro), but you may be off track to the left/right. |
Re: Using PID in autonomous to keep straight
Quote:
We used proportional control to drive straight in auto, and we didn't have any problems. |
Re: Using PID in autonomous to keep straight
Quote:
|
Re: Using PID in autonomous to keep straight
We did not use a PID just the Proportional part of it... and it is good enough to cross the ramparts in auto, then spin 180 and cross them again during lab work. We never had any issues staying straight on any of the defenses.
There are some items that we will be cleaning up in the off season but it did work. As a matter of fact auto was better then telle-op. https://github.com/WhitmoreLakeTroBo.../CMDdrive.java https://github.com/WhitmoreLakeTroBo...tCaluator.java |
Re: Using PID in autonomous to keep straight
Here is a link to our entire code https://github.com/Dpurry23/FRC-Team.../src/Robot.cpp
|
| All times are GMT -5. The time now is 05:03. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi