# function generator or polynomial block in PLC5

## 9 posts in this topic

How can I create a function generator or polynomial in PLC5/80?
By this I mean I need a eleven point curve that changes the output based on the input.
I do this all the time with DCS logic, but I don't see a "Polynomial" of "Function" block in RSLogix5.
A simple curve might look like this.

 input output x1= 0 y1= 0 x2= 10 y2= 20 x3= 20 y3= 31 x4= 30 y4= 49 x5= 40 y5= 59 x6= 50 y6= 79 x7= 60 y7= 101 x8= 70 y8= 142 x9= 80 y9= 178 x10= 90 y10= 224 x11= 100 y11= 300

Edited by gromit

##### Share on other sites

With any margin of error that's a linear graph.

##### Share on other sites

Thanks NevergoldMel.
You are correct, the first curve was very linear, but this curve is more in line with actual characteristics.
So, is there a way to create a poly in PLC5?

##### Share on other sites

See link.. It is an online curve software to generate a formula for you.

Then just use a compute instruction.

##### Share on other sites
39 minutes ago, Mickey said:

See link.. It is an online curve software to generate a formula for you.

Then just use a compute instruction.

Thanks Mickey.
Using the mycurvefit website, I was able to plot a 2nd order polynomial curve with five breakpoints, and then put the calculation into the CPT-compute instruction.
Take a look at the pic, if you have time, and let me know if this is what you had in mind.

Thanks!

##### Share on other sites

There was a post a few months ago, by a moderator, where he used Excel to do the same thing. I think it goes out to 5th order but I don’t have access to a computer right now (typing this in my phone, more than once :/ )

##### Share on other sites
Just now, Michael Lloyd said:

There was a post a few months ago, by a moderator, where he used Excel to do the same thing. I think it goes out to 5th order but I don’t have access to a computer right now (typing this in my phone, more than once :/ )

Thanks Michael, I plan to test it out tomorrow and hope the 5 breakpoints and the 2nd-order poly is accurate enough.

much appreciated

##### Share on other sites
Quote

Take a look at the pic, if you have time, and let me know if this is what you had in mind

Yup

##### Share on other sites

I was able to create the 2nd order polynomial equation in Excel and used it in the CPT (Compute) instruction.

Then, tested it and it works great.

THANKS FOR THE ASSISTANCE!