Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

discrete PID control, PID toolkid is a discrete control?

Hello all people i want to know if the pid toolkit is a DISCRETE PID because actually i make a control using a serial interfase (VISA) where i take data from microcontroler (ATmega8), this data goes through the serial, then this value must to enter to a PID controler like a variable controler (VC) but in a discrete time, and i really confuse it because i dont know how to make this controller, I know i need PID in a discrete form then i need a (T) sample period and of course Set point. But i really confuse when i make this in a LAb view program Somebody help me please i need. Thanks
0 Kudos
Message 1 of 9
(5,518 Views)
Hi

The way you measure your actual value and the way you control the instrument are indeed digital if send by a serial line.
But your PID algoritm is running inside the pc and is only dependend on how fast you get these values and do a calculation for a new control value.
The setpoint is in the PID algoritm not really in the instrument.

try to separate the way you get these values from the calculation.

greetings from the Netherlands
0 Kudos
Message 2 of 9
(5,494 Views)
Hello, yes all the data is digital and i want to all the PID algorithm runs in a PC; but when you said that " only dependend on how fast you get these values" I think you refer to a sample time (T) for example: I am controled the environment temperature with a sensor lm35, then i was programing the microcontroler for sending the temperature  each second (1s) to a 9600 bits per second, this data  is acquiered for the PC in this moment this value is the process variable (VP) for the PID but How can I implement this PID in a simple time or a discrete time (T=1s.) in the PC?
 
simple time: the formula widelyknown:
 
out= Kc [ e(t) 1/Ti integral e(t) dt]
 
Discrete time:
 
out= Kc [ e(K) + T/Ti sumatoria e(k)]
 
where: T=sample time ; K= numer of sample 
 
Do you think is good to implement the PID.VI ? but i think this pid make the calculation in a simple time, ( i attach below).
 
or i´m in a completely wrong.
 
 
 
0 Kudos
Message 3 of 9
(5,466 Views)
Your vi seems ok, but please get rid of this sequence frame.
You don't need it in LabVIEW.
The compiler makes sure that a calculation only will be executed when all values needed for that calculation are available.

Or use a flat sequence frame. In that way you can better see and change your code when needed.

(ps  i forgot if a flat sequence frame is already available in 7.0)

greetings from the Netherlands
0 Kudos
Message 4 of 9
(5,456 Views)
Thanks friends i`ll do it!!! but in general the control whit this PID is ok ? because this PID is in the time if you see the calculation of the "dt" it makes with a block of clock (in miliseconds) not a confuse whit discrete time? because i didn´t use in my Vi code the sample period (T)....  and don´t you think its a error calculate the PID in time? or its ok ? and why? I attach my code whit a pid toolkit,
0 Kudos
Message 5 of 9
(5,449 Views)
Hi,

Your code looks fine, but like Albert said you could get rid or most of your sequence structures.  I don't think I understand what you mean by "calculate the PID in time".  But like I said I think your code is OK.  If you are unsure about how to use the PID toolkit it may be helpful to look at some of the examples.  Go to Help>>Find Examples.  Then in the example finder go to Toolkits and Modules>>PID Control.  There are several example using the PID functions, that can help you see what the best ways to use them is.  I hope this helps.

Have a great day,
GG
0 Kudos
Message 6 of 9
(5,411 Views)

Yes i was looking for the examples about PID toolkit but i saw that the "dt" is calculated by a reloj but for my control i need a dsicrete control no more somebody know if this variable of PID (dt) "is sample period (T) in PID discrete"? please only answer YES or NOt and explain why? because if somebody answer other things confuse more Please si simple Questin ¿ PID toolkit made calculations in discrete time ? YES OR NOT? WHY? and Variable dt in PID is in discrete time? Please answer because my control is in real time and its like a embeed control.

PD i read  all pdf manual of PID and i didn´t find the question that i did. 

THANKS IF SOMEBODY WANTS TO ANSwER ,really

0 Kudos
Message 7 of 9
(5,369 Views)

NANDo666,

    We can't answer your question unless we know what you mean by discrete time.  What do you mean when you ask if PID makes calculations in discrete time?  Please explain what you mean by that and we will do our best to answer you.

-Allison S.
Calibration Services
Product Support Engineer
0 Kudos
Message 8 of 9
(5,345 Views)
It looks as though you are asking if the PID loop can be guranteed to update exactly once every 1 second (or whatever other time period you decide on) with no variation whatsoever: at least that is what I think you mean by 'discrete time'. If it is absolutely critical that your device be updated at precise intervals you should consider some other control solution; perhaps even the one you mentioned: embedded. There is no way to guarantee that a pc-based system will never experience lags in communications, and let's not forget that Windows is not the most stable platform in the world! In short, the timing of data flow to and from your loops may well fluctuate from scan to scan. Will that cause your process to become unstable??? Only you know the answer to that.
0 Kudos
Message 9 of 9
(4,777 Views)