![]() |
PID Controller Code
My team is using 3 PID contollers in our code this year, and after searching Chief Delphi, usfirst.org, and Google, I have been unable to find out how to write a PID control loop or another type of PID function. I have the pointers, enable and reset functions, and the input/output statements (the input is a potentiometer, and the output is a talon). Can anyone provide me with a base function for PIDs?
|
Re: PID Controller Code
Quote:
|
Re: PID Controller Code
Hey thanks for the information, we did not realize what was under our noses; however, might you know how to also apply such information to a theoretical arm, and if said arm is to run autonomously, whether it can be run directly in autonomous mode or must be linked from the teleoperated component of the code?::ouch:: ::rtm::
|
Re: PID Controller Code
Quote:
|
Re: PID Controller Code
Also, we believe we have the neccessary statements and pointers to begin writing the function itself, however we have found that the PID function is illusive and we do not know where to start...while the source files are useful, they are somewhat complicated to understand. We would appreciate a model function using variables, if possible, as opposed to the pseudocode we have found on the Internet. Thank you for your assistance.
|
Re: PID Controller Code
Look in this programmers guide for an example of how the PidController class can be used. There is a code example in there.
http://first.wpi.edu/Images/CMS/Firs...sers_Guide.pdf |
Re: PID Controller Code
Quote:
If you look here: http://www.youtube.com/user/bradamiller there is a video on command based programming (one with and one without using RobotBuilder). In either one there are a few examples of writing code that will control an arm using PID control. The RobotBuilder version of the video shows how you can tune the PID controller using the SmartDashboard test mode widgets. Brad |
Re: PID Controller Code
When we were using C++, we used the PID controller class a few times. You can find our working 2009 code on my FRC resources page. The custom servo classes used it heavily if I remember correctly... http://www.virtualroadside.com/FRC/
|
Re: PID Controller Code
Brad,
The PID controller requires a PID source for inputs. Is there a way to use the output of a SmartDashboard widget as the input to the PIDController? |
Re: PID Controller Code
Quote:
Code:
|
Re: PID Controller Code
Quote:
|
| All times are GMT -5. The time now is 13:24. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi