On Sat, 22 Dec 2012, Viesturs L?cis wrote: > > BTW what velocity should I set, when tuning pid loop? As fast as > possible to ensure that it is stable, when going at full speeds or > something very slow to make it stable, when there are very few encoder > pulses per servo period? > > -- > Viesturs
You use different motions to tune different PID parameters For an HBridge (and all this advice is for an HBridge) I would first tune FF1. This sets the output voltage to a voltage proportional to velocity, counteracting the motors back EMF. This is done by setting a small P term and then doing long slews at say 1/2 full speed and adjusting FF1 for minimum PID error with halscope (too much FF1 will cause motion to lead the trajectory, too little will cause motion to lag the trajectory) Next I would tune P and D (this must be done with motors coupled to the load the machine) For tuning P and D I would start with the small P from above and gradually increase D until you get high frequency oscillations, then back of D to about 1/2 of this value. Then I would gradually increase P while jogging back and forth until it again becomes unstable (with a low frequency oscillation this time) Then back off the P term again to about 1/2 of this value This should be an fairly good tuning at ths point. The next step is to add a very little bit of FF2 to correct the error during accelration/decceleration FF2 is like FF1 but only applies during accelration and deccelration. Too much FF2 will cause motion to lead during acceleration and too much FF2 will cause motion to lead during acceleration) At this point (and only this point), you can start adding some I term The I term will improve the static accuracy against fixed or slowly varying loads. The I term can bw increased until (very low frequency) oscillations start and again us about 1/2 of this value The I Term should be tuned last (it will make things worse if the tuning is not almost perfect to begin with) and should be temporarily set to 0 when tuning other PID parameters as it will mask the effects of changes in the other parameters. > > If you can't fix it, you don't own it. > http://www.ifixit.com/Manifesto Peter Wallace Mesa Electronics (\__/) (='.'=) This is Bunny. Copy and paste bunny into your (")_(") signature to help him gain world domination. ------------------------------------------------------------------------------ LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial Remotely access PCs and mobile devices and provide instant support Improve your efficiency, and focus on delivering more value-add services Discover what IT Professionals Know. Rescue delivers http://p.sf.net/sfu/logmein_12329d2d _______________________________________________ Emc-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/emc-users
