View Single Post
  #29   Spotlight this post!  
Unread 21-03-2004, 23:47
Larry Barello Larry Barello is offline
http://www.barello.net
#0492 (Titan Robotics Club)
Team Role: Mentor
 
Join Date: Jan 2002
Location: Bellevue, WA
Posts: 85
Larry Barello has a spectacular aura aboutLarry Barello has a spectacular aura about
Re: PID control loops - closed loop feedback

Quote:
Originally Posted by Jay Lundy
We use 2 PI loops to maintain target velocities on our 2 arm joints. The integral is essential for our loop because it is what keeps the arms from falling due to gravity. For the proportional to work, it needs to have a speed error. So in order for the proportional to prevent the arm from dropping, the arm needs to drop a little first. The integral is non-zero when the arm is stationary, which is what keeps the motor at stall torque.
...
There is nothing wrong with your code, but terminology is a little hashed.

You state you are controlling velocity, yet what you are really controlling is position, but by a round-about way.

Velocity is the first derivative of position. Your code takes the velocity error + the integral of the velocity error. Well, that can also read as: The first derivative of position error + Position error. Hence, in fact, you have a classic PD controller for position.

As your controller integrates the velocity error, you get, essentially, an error term that grows as the position error grows. That is the "proportional" error term.

Cheers!