|
Re: PID Problems
I am on mobile so I apologize for this being short. In teleopPeriodic, get rid of the line that says arm.set(). You do not want to directly control the motor that the PID is controlling as they will fight each other. The reason that the PID is not doing anything, is because you constructed it with a KP, kI, and kD of 0. Right above the constructor for the PID controller, you declare those variables but you never give them values. I would start with a P term of ...well I have no idea... but start with a P term that is small like .01 or even smaller like .005. Increase your P term until you get motion that is close to your desired result or perhaps a little bit of overshoot if that is OK. If your P term is too large then you will over shoot your target and it will oscillate. If you don't want it to over shoot the target make the P term smaller, in which case it might stall out. You can add a D term to help with oscillation or an I term to help a stalled out process.
Good luck.
__________________
2014 Las Vegas (Winners with 987, 2478; Excellence in Engineering)
2014 San Diego (Finalists with 987, 3250; Quality Award)
2013 Inland Empire (Winners with 1538, 968; Excellence in Engineering Award)
2013 San Diego (Finalists with 2984, 4322; Creativity Award)
2012 Las Vegas (Finalists with 2034, 3187; Quality Award)
|