• Increase font size
  • Default font size
  • Decrease font size

PID regulator

A proportional-integral-derivative controller (PID controller) is a loop feedback controller (mechanism).

 

There are a few types of feedback controllers. The most simple is a thermostat. That is the controller that just turns the heat on if the temperature falls below a certain value and off it exceeds a certain value (on-off controller).

Another type of controller is a proportional controller. With this type of controller, the output of the controller (control action) is proportional to the error in the measured variable.

In feedback control, it is standard to define the error as the difference between the desired value (refference) and the current value (measured). If the error is large, then the control action is large.

u(t) = (K * e(t)) + u_0
 
u(t)  - control action at the time 't' = output from the controller
K     - gain. Sign may be positive or negative, depending on type of the system - reverse acting vs. direct acting.
e(t)  - error at the time 't' = difference between measured and wanted value
u_0   - bias = action that is done when e(t) = 0

A typical example of a reverse-acting system is control of temperature by an electrical current. In this case the process gain is positive, so if the temperature increases, the current must be decreased to maintain the desired temperature. Conversely, a typical example of a direct-acting system is control of temperature using cooling water. In this case the process gain is negative, so if the temperature increases, the cooling water flow must be increased to maintain the desired temperature.

Alternates to proportional control are proportional-integral (PI) control and proportional-integral-derivative (PID) control.

A PID controller calculates an "error" value as the difference between a measured (current) value and a reference (desired) value. The controller attempts to minimize the error by adjusting the process control inputs. By tuning the three parameters in the PID controller algorithm, the controller can provide control action designed for specific process requirements. The three parameters are hidden in the name of the controller:

- P (proportional) parameter - depends on the present error

- I (integral) parameter - accumulates past error. It is useful when error value is small but still non-zero.

- D (derivation) parameter - predicts future errors, based on current rate of change of the error

PID controller diagram

Pseudocode

previous_error = 0
integral = 0
start:
 error = setpoint - measured_value
 integral = integral + error*dt
 derivative = (error - previous_error)/dt
 output = Kp*error + Ki*integral + Kd*derivative
 previous_error = error
 wait(dt)
goto start

 

Demo

The demo below demonstrates difference between on-off controller (a ball overshoots the desired position) and PID controller. Please notice how I component of the PID regulator 'pushes' the ball to the desired position.

 

 

Comments  

 
0 #66 Anemonalove 2017-07-11 15:00
Hello guys! Who wants to chat with me? I have profile at HotBabesCams.com, we can chat, you can watch me
live for free, my nickname is Anemonalove , here is my
photo:

https://3.bp.blogspot.com/-u5pGYuGNsSo/WVixiO8RBUI/AAAAAAAAAFA/JWa2LHHFI2AkHParQa3fwwHhVijolmq8QCLcBGAs/s1600/hottest%2Bwebcam%2Bgirl%2B-%2BAnemonalove.jpg
Quote
 
 
0 #65 Www.5Ijjh.cn 2017-07-02 08:18
Hey there! I'm at work browsing your blog from my new iphone 3gs!
Just wanted to say I love reading through your blog and
look forward to all your posts! Carry on the excellent work!



Look into my site :: Www.5Ijjh.cn: http://Www.5Ijjh.cn/space.php?uid=12635&do=blog&id=916762
Quote
 
 
0 #64 Benício 2017-06-26 22:16
Seu blog recorda muito um que eu gostava muito ler alguns anos
atrás. Parabéns pelos materiais
Quote
 
 
0 #63 haircut 2017-06-25 06:24
If yoս don't run a salon, would yyou use spray tans yourself
to allow a bit of colour. Your first move could be to flourish
all tɦe different serѵices you currently offer. As the requiгement of salons have been increasing also to print the invoices, many cosmetic salons uѕe computeг
operateԁ billing ѕystem and stіll have а sϲheⅾuled appointment book.


Aⅼso isit mmy wwеb site; ɦaircut: https://www.wildcardhaircuts.com
Quote
 
 
0 #62 Paulo Miguel 2017-05-31 21:15
É agora que a cabala inicia a acontecer.
Quote
 
 
0 #61 Pope francis 2017-05-12 01:42
I read this post completely about the resemblance of newest and earlier
technologies, it's awesome article.

Also visit my homepage ... Pope
francis: http://adventmessenger.org/category/terrorism/
Quote
 
 
0 #60 Alyssa 2017-05-10 02:21
Its like you read my mind! You appear to know a lot about this, like you wrote the
book in it or something. I think that you could do with some pics to drive the message home a
bit, but other than that, this is fantastic blog. A
great read. I'll definitely be back.

Feel free to visit my web blog: Alyssa: http://connect.lulu.com/t5/user/viewprofilepage/user-id/2253467
Quote
 
 
0 #59 manicure 2017-05-06 15:01
Does your website have a contact page? I'm having a tough time locating it but, I'd
like to send you an email. I've got some suggestions for your
blog you might be interested in hearing. Either way, great blog and I look forward
to seeing it grow over time.
Quote
 
 
0 #58 locksmith service 2017-05-04 10:00
What's up friends, good article and good urging commented at this place,
I am truly enjoying by these.

Feel free to surf to my web-site: locksmith service: https://www.planning.dot.gov/PageRedirect.asp?RedirectedURL=http://www.locksmithservice.us.com/
Quote
 
 
0 #57 Irish 2017-04-30 22:18
Does your blog have a contact page? I'm having problems locating it but, I'd
like to shoot you an email. I've got some ideas for your blog
you might be interested in hearing. Either way, great website and I look forward to seeing it develop over time.
Quote
 

Add comment

No bad words.


Security code
Refresh


Design by i-cons.ch / etosha-namibia.ch