No worries, Mark Time since error occured means- the time (in minutes) since the error was last zero i.e. PV = SP. The integral multiplies the 'GAIN constant' by the ERROR. The result is then multiplied by the 'INTEGRAL constant' (repeats/minute) and then multiplied by the TIME since the PV "last" equalled the SP. The TIME for this calculation should be in minutes or any part of. i.e. 2.039 minutes. As you can see the integral component corrects for the offset over time. I hope this helps Let us know of your progress Justin Grimm reaper@southwest.com.au ---------- > From: Mark Lezama > To: PICLIST@MITVMA.MIT.EDU > Subject: Re: PID question. > Date: Saturday, 7 March 1998 22:45 > > Thanks Justin. I will try to implement. I think is the problem is the # of > bit I have to use a floting point rutine. BTW, in the formula I dont know > what means "Time since error ocurred", maybe Is a fool question but I am > trying to understand anything before implement the code. > > Mark Lezama. > > Justin Grimm escribis: > > > Funny you should ask, Im working on the same project at the moment. > > The only problem Im having is the maths routines, they seem to be getting > > up to > > 64 bit. > > The actual calculation is- > > dMV=G[dE + E*T1*I + D* (dE/T2)] > > where- > > dMV = change in Manipulated Variable > > G = Gain (100/Proportional Band) > > E = Error (SetPoint - ProcessVariable) for reverse action, > > Error (ProcessVariable - Setpoint) for direct action > > dE = ErrorThisScan - ErrorLastScan > > T2 = Time between scans (in minutes) > > T1 = Time since error occured (in minutes) > > I = Integral time (R/M) > > D = Derivative time (minutes) > > > > There are other things to consider as well, integral windup, bumpless > > transfer > > from manual to auto, etc > > > > Anyone knowing any alterations to this equation or anything else > > that might make writing this code easier are most welcome to reply > > > > Justin Grimm reaper@southwest.com.au > > > > ---------- > > > From: Mark Lezama > > > To: PICLIST@MITVMA.MIT.EDU > > > Subject: PID question. > > > Date: Friday, 6 March 1998 21:09 > > > > > > I have working with RTU designe base in PIC16c74. I have to control a > > > valve with a 4-20 ma signal, but I want to implement a digital PID > > > controller, anyone here have a PID code or can explain me how I have to > > > implement. > > > > > > Thanks in advance! > > > > > > Mark Lezama