View Single Post
  #15   Spotlight this post!  
Unread 12-01-2007, 12:36
Joe Johnson's Avatar Unsung FIRST Hero
Joe Johnson Joe Johnson is online now
Engineer at Medrobotics
AKA: Dr. Joe
FRC #0088 (TJ2)
Team Role: Engineer
 
Join Date: May 2001
Rookie Year: 1996
Location: Raynham, MA
Posts: 2,648
Joe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond repute
Re: Potentiometer PID

Quote:
Originally Posted by DustinB_3 View Post
I have searched and read everything I could find on PID loops. I am still very confused. How would I create use a potentiometer with a PID loop. It will be used so that all the driver has to do is hit a button so that our arm will go to a certain height. Any help is appreciated.
You can not create a potentiometer with a PID loop any more than you can create a pressure sensor or yaw rate sensor with a PID loop.

A PID loop is short hand for a particular type of closed loop control system that uses information about actual position and the desired position to determine the input to system (in this case a motor that drives your arm).

The idea of PID control is that you calculate an error (Desired Position - Actual Position) then you calculate two additional values, the rate of change of the error (the derivative of the error) and the added sum of all the errors over time (the integral of the error).

In PID control, you multiply each of these three numbers by 3 constants and, hey presto, out pops the input to the motor.

There is some magic (i.e. math) involved in making sure your system in stable and optimal (in some sense to be defined) but that is the basic idea. The hardest part is implementing it in C code and picking your constants.

The whole business depends on you system having a method of measuring position. That is where your potentiometer comes in. You have to somehow design your arm such that it rotates the pot as it moves. It is better if you can make the pot move linearly with respect to the arm movement but even some non-linearity can be worked around (at a minimum you can always linearize the pot values in C code).

There is a good Chiefdelphi.com thread on this subject called PID without Ph.D. Check it out.

Good luck.

Joe J.
that
__________________
Joseph M. Johnson, Ph.D., P.E.
Mentor
Team #88, TJ2