![]() |
Re: Drive train PID control
1: you don't need the .get() in auto init. you might want to make it a .reset().
2: you also probably want to set a defined Max and Min output. In auto periodic, you need to set a distance for the PID to get to, but before all that, you have to tune your PID. PID tries to get to it's target with as little error as possible, but it uses coefficients to multiply by this error to get to this point. Now, for your use, it's likely you can get away with PD control, and leave I at 0. First thing you're going to need to do, is set it up such that your bot goes back and forth on it's own. ((be VERY careful with this. you might want the robot on blocks first, as I've had bad experiences with a run away robot while tuning PID)) you do this by using 2 set points, say, 100 and -100. it will set this set point every, say 10 seconds. now, the bot will get to that point, and either over shoot it, or slow down too early and never reach it. you want to only set 1 PID variable at a time. So I typically start with P, and small values like 0.1 should be close. increase this until it starts to over shoot, or decrease it until it no longer overshoots, (then go back up one tick) now you increase D until it no longer overshoots. |
Re: Drive train PID control
PROGRESS! Sorry for doing a double post.
So I just enable autonomous and the robot drove backwards very quickly right. I guess I need to change the direction the robot drives, so going forwards instead of backwards and then make the leftPID mask the rightPID so it drives straight. Code:
public class Robot extends IterativeRobot { |
Re: Drive train PID control
Splendid! Sounds like you're on the right track. Shoot me a msg if you have any more issues, either PM here, or the skype that is connected to this account.
|
| All times are GMT -5. The time now is 11:54. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi