# How to tune a PI controller circuit through trial and error?

Status
Not open for further replies.

#### usernam

##### Full Member level 5
PI controller

Can anybody tell me how to tune a PI controller circuit through trial and error?
How do we arrive at the appropriate values for the proportional and integral gains.
I don't want to obtain these values through theory I want to do it through trial and error.

Thnx

#### JNekas

##### Member level 5
PI controller

Try this way. You begin from P network. In the closed loop system you increase the gain of this one till your system becomes self-excited. Then you decrease the gain of P network (it may be multiplier for example, if you don’t want to solder resistors over again), make it half as many. This gain is maximum value for your system. Next step – tuning of integrator gain. You do it similar.

#### usernam

##### Full Member level 5
Re: PI controller

What exactly do you mean by self-excited.
Do you mean the system must oscillate about a steady state final value.

#### JNekas

##### Member level 5
Re: PI controller

Yes, or it has small stability margin. I use circuit with one OP Amp. First I try to increase R2 and then decrease C.

#### is_razi

##### Full Member level 3
Re: PI controller

hi
you can use cohen or zigler-nichols method.
for zigler-nichols method you must increase the system gain untill the system start to oscillate.this is Kmax. and the oscillation period is T0.
now you can adjust Kc,Ti an Td (derivative term) with the help of following table:

| Kc | Ti | Td
---------------------------------------------------
P | Kmax/2 | - | -
----------------------------------------------------
PI | Kmax/2.2 | T0/1.2 | -
----------------------------------------------------
PID | Kmax/1.7 | T0/2 | T0/8
----------------------------------------------------
the controller transfer function will be:

K(s)=Kc*(1+(1/Ti S)+Td S)

for cohen method the step response is used.
if you interested i can send it.

hope to be usefull.

##### Member level 1
Re: PI controller

You can easily make trial and error PI controller if you use
microcontroller. Try to control a small dc motor speed with a pwm output.
You have to determine proportional (P) part first, from small value, and then
give a higer and higher value.
If you have get an optimal one, but it still ripples, give the integral (I) part,
usually Integral is a very small value but increasing or decreasing dynamically.

P = Kp.error
I = I + Ki.CE

out = P + I

where CE is Change of Error

Or you can do it with MATLAB.

Status
Not open for further replies.