Iterative equations

A

Thread Starter

Alok Khatlawala

i am using GE Fanuc PLC 90-30 series.
I have an application where I need to implement ASTM D-1250/80 standard for converting
Density at ambient temperature to density at 15 deg. C (Standard density).
Although I have a program written in C, I need to do this in ladders. This formula involves
exponential functions and is an iterative equation.
i am able to do the exponential part, but not able to implement the iteration function.
Can anyone please help?
 
S

Steve Bailey

The safest way would be to do one iteration per program scan.

If that's not possible, there is the JUMP - LABEL combination. The Label associated with the JUMP can be earlier in the program. The JUMP can be
conditional, so when your iteration converges on a solution, you exit the loop.

Be sure that you will converge in a reasonable amount of time. If you stay in the loop longer than the watchdog time (200 mS) the PLC will shut down. You should probably set up a counter to establish a maximum number of iterations
permitted. If you exceed the iteration limit, set a flag and jump out of the loop. Make sure you test this thoroughly on the bench before putting it into a PLC that's controlling anything.
 
K
> i am using GE Fanuc PLC 90-30 series.
> I have an application where I need to implement ASTM D-1250/80 standard
> for converting Density at ambient temperature to density at 15 deg. C
> (Standard density).

Maybe a lookup table, possibly augmented by linear interpolation, might be a good alternative?

> Although I have a program written in C, I need to do this in ladders.
> This formula involves exponential functions and is an iterative equation.
> i am able to do the exponential part, but not able to implement the
> iteration function.

I was going to suggest that you use the scan of the PLC to do the iterating while you maintain state in some variables, but it looks like you're probably wanting something acting more like a function call, so that it returns a value immediately during a single scan.

Doing iterative, blocking, things that are not at the scale of the PLCs scans are almost surely off limits, at least if the PLC is trying to guarantee some level of real-timedness.

I've used PLC-like systems (1) which allow iterating in application programs (which is what you say you want) or in user-defined fuctions
(which is what you need), but the scan time is allowed to be whatever it happens to be, 1/20 second or 5 seconds. The program would be halted
if over 5000 iterations were done, though.

> Can anyone please help?

Probably. Good luck!

--
Ken Irving <[email protected]>

(1) Andover Controls, Infinity system, Plain English (erk) Language
 
E

eligio palcich

Hi

Why dont you convert the exponential part of the equation into a series. The number terms in the series will determine the accuracy that you require and series can be programmed into a plc.

regards

Eligio
 
The PID algorithm would do the job. But you need a CPV (Composite Past Value). Those generaly found in systems are inadequate for this as well as for control___But____ I tried following the y=x^0.25 function. CPV is just perfect. Your accumulator needs to store last two past values.
 
Top