QUOTE(perfectly.insane @ 10 Jul, 2008 - 04:31 PM)

With what part? Understanding and applying a PID equation? Implementing it in an environment outside of Mathematica?
P is simple:
P = Kp * e
Where e is SP - PV (setpoint - process variable).
I is a little tougher. I is the integral, which optimally will be zero:
I = I + (Ki * e * delta)
delta is the amount of time between loop updates. e is the error, like above.
Integral is simply the area under the PV curve, with respect to SP (areas below sp will be negative, and above will be positive). This is simply using a sum of rectangles approximation.
D = Kd * slope
slope = (PV - PREV_PV) / delta
Again, this is an approximation of the slope using two points.
Your output will be P + I + D, which in the real world, should be scaled according to the application's control variable range (since the bounds are not finite, there will be a cutoff point (MAX_CV)). But that's the basic idea of how one would program such a thing. Of course, it should run in it's own thread.
wow! seems like u familiar with this thing..
is this your field??
actually i want to control the speed of dc motor by pc based(PID controller)..
and the task must be done by vb
could u help with it??
This post has been edited by madmedme: 11 Jul, 2008 - 07:13 AM