Sign in to follow this  
Followers 0
tbp

Non Linear Curve

12 posts in this topic

Hi, I am showing inches values on Touch screen based on what i am getting from analog card. I am using Scale function to get the respective inch values. I am getting inch values in linear fashion. I have attached a word document in which graph is illustrated. Please let me know if you have any ideas or feedback. Thanks Tushar NonLinearCurve.doc

Share this post


Link to post
Share on other sites
I believe the Arithmetic Process APR(069) function will work for you. You have to 'create' your curve by selecting x,y points on the curve and setting them up in a table.

Share this post


Link to post
Share on other sites
Thanks for you help. Appreciated. Regrads Tushar

Share this post


Link to post
Share on other sites
if that dosnt work for you. I have done a similar thing using streight lines to follow the curve. It depends on how accurate you want as to how many lines you use. using the compare or zcompare statement I will cut the curve up into aproximate straight lines. This will enable me to use straight mulipy and divide functions to get a realy good aproximation of where you are on the line. Again this is not perfect but it does work in a pinch. go with ECSI's suggestion of the APR if it works for you this is just a second option. Peace

Share this post


Link to post
Share on other sites
In regards to the APR function look at this link Function Tool

Share this post


Link to post
Share on other sites
tbp, I have had a closer look at your attached document....I will post a sample use of the APR function if you like but in the meantime examing your plot, with out the raw data any ways it appears to follow the relation ship of a simple polynominal equation of y= Kx^2 where K is a constant which will determine the steepnees of the curve. See attached diagram. It is then a case of scaling the results. In the CJ plc i know that you have the SQRT (square root function) or alternatively you can raise a number to the power etc... If you would like an APR example then let me know and i will post one.

Share this post


Link to post
Share on other sites
Thanks for your feedback ,Sleepy. Let me explain application in detail. I am getting analog value of 260H at 0 inch. And 275H for 1 inch, so on and so forth. I got all the value pretty accurate using APR function except 0 value. After calibration, at no pressure at all I should have something around 0 inch . This is not happening. I am taking 12 values and 11 out of them are correct. It messed up only at 0. At no pressure analog value is 260H, that is 0 inch , but I am getting 0.8 inch. I believe I am entering wrong values in the beginning of the APR table . Can you send me APR application , Please. I appreciated your help. Tushar

Share this post


Link to post
Share on other sites
sleepy would like to see a sample posted for the apr function. thanks

Share this post


Link to post
Share on other sites
Here is the attached prints.... I am using a CJ1MCPU22 to test.... Note that i needed to specify signed 16bit data to get to work therefore D3 in this case was in Hex #0407 (i had 8 samples therefore 7 is used) Did you also know that if you wanted something more accurate then by knowing the x-y coordinates from measured data you can actually derive a polynominal equation that can approximate the profile probably more accurately then the APR function ??? Excel has a neat feature to help you calc this polynominal, then you just have to code it in the PLC and vola !!!! Anyways, heres how to do it....

Share this post


Link to post
Share on other sites
And here is the code....

Share this post


Link to post
Share on other sites
I had another looka at you data and i suggest the following. This will work....

Share this post


Link to post
Share on other sites
Thanks to all of you for your feedback and help. Regards tbp

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0