Welcome to Dream.In.Code
Become a VB Expert!

Join 150,163 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 2,386 people online right now. Registration is fast and FREE... Join Now!




PID controller

 
Reply to this topicStart new topic

PID controller

madmedme
10 Jul, 2008 - 10:18 AM
Post #1

New D.I.C Head
*

Joined: 9 Jul, 2008
Posts: 6

i've got task in designing PID controller using vb6..
anyone familiar/can help with it??
happy.gif
User is offlineProfile CardPM
+Quote Post

AdamSpeight2008
RE: PID Controller
10 Jul, 2008 - 02:25 PM
Post #2

LINQ D.I.C.
Group Icon

Joined: 29 May, 2008
Posts: 863



Thanked: 54 times
Dream Kudos: 2250
My Contributions
What's a PID? Programmer In Disguise
User is offlineProfile CardPM
+Quote Post

gabehabe
RE: PID Controller
10 Jul, 2008 - 02:31 PM
Post #3

better than jam.
Group Icon

Joined: 6 Feb, 2008
Posts: 5,837



Thanked: 104 times
Dream Kudos: 2700
Expert In: slobbing.

My Contributions
Pacman Is Dead
User is offlineProfile CardPM
+Quote Post

perfectly.insane
RE: PID Controller
10 Jul, 2008 - 03:31 PM
Post #4

D.I.C Addict
Group Icon

Joined: 22 Mar, 2008
Posts: 581



Thanked: 46 times
Dream Kudos: 25
Expert In: C/C++

My Contributions
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.
User is offlineProfile CardPM
+Quote Post

madmedme
RE: PID Controller
10 Jul, 2008 - 06:06 PM
Post #5

New D.I.C Head
*

Joined: 9 Jul, 2008
Posts: 6

biggrin.gif

This post has been edited by madmedme: 11 Jul, 2008 - 07:10 AM
User is offlineProfile CardPM
+Quote Post

madmedme
RE: PID Controller
11 Jul, 2008 - 07:10 AM
Post #6

New D.I.C Head
*

Joined: 9 Jul, 2008
Posts: 6

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.. biggrin.gif
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
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/9/09 02:48AM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month