This thread is privately moderated by shoutchen, who may elect to delete unwanted replies.
 Oct 28, 2008, 11:35 PM Registered User mudville Joined Nov 2002 980 Posts Discussion PID control basics If you wanted to learn something about control systems used all over the place in the real world,. then you ought to invest some time learning about PID (proportional, integral, derivative ) control systems. One popular use of this control system is in positioning servos, like the ones we use in our models. The basic concept is that there are 3 things that play a part in deciding what to to tell your servo at any point in time to reduce the differnce between the current servo position and where you want to be. The first is how far are is the servos current position from the desired position. The further away it id, the bigger the "shove" you give to it to get it to go to the right place. This piece of the puzzle of referred to as the "P" or proportional part. The second is determining if you are getting closer to the desired position, or further away from it. If you go further away instead of closer, or even if you did not move at all, you would give it and even bigger shove... The way you do this is to keep track of a running total of the error and see if it gets bigger or smaller. This piece of the puzzle is referred to as the "I" or integral part. The third component determines how far you moved since the last time you looked. If you made a really big move, you may want to not give as big a shove the next time, so you dont do past the spot you want to go to. (overshoot) This piece of the puzzle is referred to as the "D" or deriviative part., and this component would act in the oppostiite manner than the other two... Another notion here is that there may be some amount of "shove" needed to get the output arm to move at all, to overcome being at rest. We will refer to that as "offset" It sound hards to do, but is is more or less a simple math problem when you break it down into manageable pieces.,,, The beauty of this type of system is you can apply those concepts to lots of different type of real world problems, like managing the temperature in a building, the positon of a servo, or your yaw rate what you have requested in a rate demand HH gyro). All you need is the concept of an "error" and a "setpoint" and then periodicaly uses the P, I and D components to determine a new "shove: to give... The concept of PID "gains" basically allows you to give a different weight to each component when you are computing the size of the "shove". If you have over shoot, you may want to lower the P componet, or if the thing moves real slow, you may want to have a bigger P component,,, If you are interested at all in this, then you should check out the app notes from atmel ( avr221 ) and microchip (an964) that deal with taking the PID concept and breaking it down into a processing problem... If you absorb that material , and the ideas of "integral windup" and "derivative kick", you could write code to control servoactuators (magnetic actuators with feedback), 1/2 gram pager motor based servos, o r the control software for a rate demand HH gyro;;;; Hope this is useful to somebody. SteveH Last edited by shoutchen; Oct 31, 2008 at 05:47 PM.
 Dec 02, 2008, 06:27 PM just Some Useless Geek Chicagoland Joined Oct 2008 2,573 Posts Got any clue as to whether or not current digital servo offerings use PID in their internal software? It would be nice to get rid of the servos that just hum when there isn't enough position delta to overcome the propo term (since that's all the analog servos use).
 Dec 02, 2008, 07:53 PM Registered User mudville Joined Nov 2002 980 Posts I am a little unclear about your question. A lot of R/C servos use H/W only solutions to control the servo movement. Are these what you consider to be analog servos? What would you consider to be a "current digital servo"
Dec 03, 2008, 01:16 PM
just Some Useless Geek
Chicagoland
Joined Oct 2008
2,573 Posts
Quote:
 Originally Posted by shoutchen I am a little unclear about your question.
Well, analog servos just use an amplifier to kick up the proportional difference between the immediate and commanded positions. If the difference is small enough the servo will command a very small motor movement, but that commanded movement is too small to overcome the intertial moment of the motor, gears, et al.

I am wondering if any of the digital servos currently being offered have built-in PID so that the integral term eventually overcomes this small error inertia problem. If not then there is really no reason to go with a digital servo versus a traditional analog one.
 Dec 05, 2008, 05:07 PM Registered User mudville Joined Nov 2002 980 Posts I dont know what the digital servos use for a control system. SteveH
 Dec 23, 2008, 11:53 PM just Some Useless Geek Chicagoland Joined Oct 2008 2,573 Posts Even after doing a bunch of looking around I can't find any data on the internal control systems of digital servos used in R/C. It could very well be that these servos are simply too cheap to justify the manufacturers putting a real PID into the servo. That would be too bad, since the software is really off the shelf and the processing is pretty cheap, too. These servos are already using some kind of ASIC or masked PIC or some other microcontroller, so why not use a bit more silicon and throw a PID at the control loop? Edit: It seems that most, perhaps all, digital servos for R/C do have some sort of PID processing. They remember cumulative error, so there is at least an integral component of the error correction loop. This is why digital servos will never sit there and hum the way analog servos will if the error offset is too low. Last edited by A Useless Geek; Mar 25, 2009 at 10:55 AM. Reason: Expansion