LookUp Table/Interpolation

cyoung120

Member
Join Date
Jul 2013
Location
OH
Posts
92
Hi All,
So I am using an Automation Direct BRX PLC (Do-More Designer 2.5), in which I need to calculate the Log Inactivation of Giardia. I am able to get the whole way to Step 10 before I hit a block wall.
So Step 10 is where you determine the CT 1-log Giardia. In order to get this number, I was given 6 charts (a different one for different temperatures). The top row of each chart is pH and the left column is Chlorine. You take your pH value and your Chlorine value and where the two intersect is your CT value.
So for example, using the attached image, if the Temperature is 5 degrees C, the pH is 8.0, the Chlorine is 1 the CT value is 72.


I could probably do this brute force with a ton of rungs and compares/limits but I feel that is messy and there is a better way. Hoping someone can help me think of it.

LogInActivation.PNG
 
Thank You everyone for your responses.

@cwal61
Thank you for the link to the forum thread. The BRX doesn't support multidimensional arrays, however, I will keep this in mind for future AB projects.


@parky
Thanks for the link to Log Giardia pdf.



After some digging and Googlin yesterday I was able to find the formula that is used to obtain the values in the chart and can calculate it via the PLC.


Just in case anyone stumbles onto this thread with the same problem, here is the magic equation:


If Chlorine Residual is >.4:


CT Actual/(0.2828*(pH^2.69)*(Chlorine Residual^0.15)*(0.933^($Temp-5)))


IF Chlorine Residual is <=.4:
CT Actual/(0.2828*(pH^2.69)*(.4^0.15)*(0.933^($Temp-5)))


Once again, thanks for all who responded.
 
It's good that you found a couple of equations that give you what you need. While probably a bit more processor intensive it is much more direct.

However, keep in mind that even in plcs that support arrays memory is not laid out in array format. Memory is linear so an array simply occupies a given memory space in a deterministic format. You can do the same thing yourself assuming the plc at least supports indirect/indexed memory access.

Assume you want to implement a three-dimensional array of format Array[a,b,c]. The total size of the array is a_size * b_size * c_size elements. Any given memory address can be determined as:

Address = ArrayBaseAddress + (a * b_size * c_size) + (b * c_size) + c

If you have the available memory you can make things a little easier by using "round" numbers instead of the array level sizes but the idea is the same.

Keith
 

Similar Topics

Hello all, I am working on a project with an s7-1200 and I am controlling three stepper motors using this controller. I will be receiving input...
Replies
5
Views
2,395
Hello all, I need to do something and I'm not sure if it's possible.. some aspects I know how to do but not quite on the scale of this project. A...
Replies
5
Views
2,531
Hi guys, I want to program map tracking using factorytalk view site edition ver9. I have map which shows vehicle on it, the vehicle location...
Replies
1
Views
2,019
Hi all, I would like to generate a lookup table (Time vs Speed) or (Position vs Speed) in rslogix5000, and looking for some idea on how to...
Replies
20
Views
10,109
Hey everyone, can anyone point me in a direction on setting up a lookup table in Codesys 2.3. I have never done it and it looks like I may have...
Replies
2
Views
4,689
Back
Top Bottom