Can anyone tell me the difference between integral time and integral gain? I am really confused between these two terms and it's extremely important for the software PID for motor speed control I am developing.
Difference Between Integral Time and Ki(Integral Gain)
pid controller
Related Solutions
It sounds like you have some things there that makes it hard to find a ready device that can do the work (but I'm not sure).
It sounds like you have to either write a PID yourself, or use a PID in some library (like the Arduino).
I am unsure about the stability of the Arduino solutions, will this solution still be stable after a year? Or do you need to reboot it every day? But maybe it is good enough? (Test it for a month a see what it can do)
If you decide to write a PID yourself, the paper called PID-without-a-PhD is a good start:
- http://www.eetimes.com/design/embedded/4211211/PID-without-a-PhD or
- http://www.eetimes.com/ContentEETimes/Documents/Embedded.com/2000/f-wescot.pdf
And you also have application notes on this topic from more or less every MCU maker out there.
The figure below shows the steps in order to find the \$K_{cr}\$(or \$K_u\$) and \$P_{cr}\$ (or \$P_u)\$, by changing the proportional gain only (with \$T_d=0\$ and \$T_i=\infty\$) - an example for temperature control:
The time unit to be used should be consistent with its response curve. The relationship with the sample period \$\Delta t\$ can be obtained, after the discretization of the PID controller. Using the standard form, in contrast with other implementations (for example, when the derivative term is taken from output):
$$u(t)=K_pe(t)+\frac{K_p}{T_i}\int_0^t{e(\tau)d\tau+K_pT_d\frac{de(t)}{dt}}$$
Taking the derivative of \$u(t)\$: $$u'(t)=K_pe'(t)+\frac{K_p}{T_i}e(t)+K_pT_de''(t)$$ A possible approach: To approximate the first and second derivatives using finite differences (eg backward), where \$k\$ is the sample id: $$x'(t)\approx\frac{x_k-x_{k-1}}{\Delta t}$$ $$x''(t)\approx\frac{x_k-2x_{k-1}+x_{k-2}}{\Delta t^2}$$ So, the discrete PID controller takes the form (velocity algorithm): $$u_k=u_{k-1}+K_p[(1+\frac{\Delta t}{T_i}+\frac{T_d}{\Delta t})e_k+(-1-\frac{2T_d}{\Delta t})e_{k-1}+\frac{T_d}{\Delta t}e_{k-2}]$$
Alternative definitions can include \$K_i=\frac{K_p}{T_i}\$ and \$K_d=K_pT_d\$. Also, the derivative term can be modified in order to reduce issues with high frequency noise - eg a low pass filter. Other discretization methods exist as well, such as Tustin, ZOH.
FURTHER EXPLANATION:
- Choose a sample time \$\Delta t\$ consistent with your process. There is extensive literature on the subject. For example, to avoid aliasing \$F_S > 2F_{BW}\$. In practice: Sampling frequency should be 10 to 30 times the bandwidth freq.
Set \$K_p\$ to some low value (with \$T_i=\infty\$ and \$T_d=0\$ at this stage). So, the above equation is simplified to: $$u_k=u_{k-1}+K_p(e_k-e_{k-1})$$
Implement the previous equation (a P controller) in your digital system along with that suitable \$\Delta t\$, testing \$K_p\$ to see if it causes continuum oscillation (marginally stable). If the oscillations decay, keep increasing \$K_p\$. If the oscillations increase in amplitude (unstable system), reduce \$K_p\$. Do this until the system is marginally stable. When you arrive at this point, you have found \$K_{cr}=K_p\$ and \$P_{cr}=\$oscillation period (see the figure above).
Using the table you have provided (also above), determine the \$K_p\$, \$T_i\$ and \$T_d\$ values from the \$K_{cr}\$ and \$P_{cr}\$ ones.
Implement the complete PID controller: $$u_k=u_{k-1}+K_p[(1+\frac{\Delta t}{T_i}+\frac{T_d}{\Delta t})e_k+(-1-\frac{2T_d}{\Delta t})e_{k-1}+\frac{T_d}{\Delta t}e_{k-2}]$$
Best Answer
There is no hard rule about the terms Integral time and Integral gain. It is up to individual manufacturers to decide what version to use, mostly based on custom or end application. In general, things like heater control use the term integral time (or 'Reset'), and faster operating devices like motor speed controllers will use the term integral gain.
For a parallel PID equation, using time as the integral term, the term is represented by 1/time, so the larger you make time, the slower the integrator will react.
When gain is the integral term, it is used to multiply the integral term with a fixed time period, so the larger you make gain, the faster the integrator will react. Then the term essentially is the sum of Gain * 1/time, but the time term is not adjustable.