|
Re: PID Control Loop Assistance
You have to leave the PID enabled. You need to tune it by adjusting the three gains so that it settles into place. In the past, we have used three analog inputs (scaled of course) to adjust the gains. We cranked the knobs until it worked as well as it could, and then read the values and put them into code. Looks like you have 0 for Kp, definitely need Kp. Ki is probably too large. You can set Kd to 0 to start.
The proportional gain should get it close. If its too high, then it will oscillate around the set point. Once its close, the integral gain kicks in and will slowly increase the power to the motor to counteract gravity and hold it in place.
A word of caution - Cim motors holding like that will get hot. You cant do that forever. Depending on the mechanics of your system, you might get away with it for a match and then it will have to cool down.
The best solution is to have enough gearing (work drive, etc), so that the lifter will stay in place with the motor off.
__________________
Brian K
Team 1225 Robotics Mentor
|