Author Topic: PID tuning?  (Read 636 times)

zahc

  • friend
  • Senior Member
  • ***
  • Posts: 5,809
PID tuning?
« on: March 07, 2010, 01:45:55 PM »
I have a motor with an optoencoder on it, and I want to keep it matching a certain speed using a an Arduino PI loop. I'm not sure what the units of the P, I and D are or if they are even standard but I hope they are. I have found that using a P of 2-3 makes it ramp up and converge on the process variable in a couple seconds which is ok. But since there is some stiction in the motor, there is some oscillation around the setpoint and I think I need to change the I parameter to damp that out. Is there any kind of guideline for how you should set the I parameter depending on the system or the P parameter? For example, I know there is some stiction at one point in the motor's rotation and i know that happens about 3 times per second because of the motor's speed, so knowing that can I make a swag as to what I should set the I to? Or is there a rule of thumb that says that I should be no more than X fraction of P or anything?
Maybe a rare occurence, but then you only have to get murdered once to ruin your whole day.
--Tallpine

RocketMan

  • Mad Rocket Scientist
  • friend
  • Senior Member
  • ***
  • Posts: 13,683
  • Semper Fidelis
Re: PID tuning?
« Reply #1 on: March 07, 2010, 02:17:31 PM »
Back in the day (20+ years ago) I used to adjust PID on temperature controls for GaAs crystal growth.  There were some software tools available that would help get things in the ballpark.  Have you looked for tools like that for PID motor control?
If there really was intelligent life on other planets, we'd be sending them foreign aid.

Conservatives see George Orwell's "1984" as a cautionary tale.  Progressives view it as a "how to" manual.

My wife often says to me, "You are evil and must be destroyed." She may be right.

Liberals believe one should never let reason, logic and facts get in the way of a good emotional argument.

zahc

  • friend
  • Senior Member
  • ***
  • Posts: 5,809
Re: PID tuning?
« Reply #2 on: March 07, 2010, 02:31:18 PM »
The PID controllers I use in the lab always have magic fuzzy logic tuning routines where it will ramp the process variable itself and then get an picture of what the lag time and damping and stuff is. As far as I know there is no "autotune" available for the setup I'm using here. If I knew how those autotuning routines worked what I would do is  basically do the same thing with manual tuning where I measure the system and get some characteristic times and so on. But since I don't have very good output data, I cant do a rigorous tuning. I've set the P value so that it reacts fast enough, but now I think I need to set a nonzero I so that the oscillation goes away. I'm not even sure if these values have industry-standard units either.
Maybe a rare occurence, but then you only have to get murdered once to ruin your whole day.
--Tallpine

Physics

  • ∇xE=-1/c·∂B/∂t, ∇·E=4πρ, ∇·B=0, ∇xB=1/c·∂E/∂t, F=q(E+v/cxB)
  • friend
  • Senior Member
  • ***
  • Posts: 1,315
Re: PID tuning?
« Reply #3 on: March 07, 2010, 02:53:58 PM »
I found the PID Controller page for wikipedia to be helpful when I built a CVD system out of a tube furnace. 

http://en.wikipedia.org/wiki/PID_controller

If you need more than that, I know some people I could ask for more information, considering they deal with stepper motors and PID loops in an AFM. 
In the world of science, there is physics.  Everything else is stamp collecting.  -Ernest Rutherford