Hi
Annyone here know a good algorithm for linear interpolation. I know that oscat lib can provide a block that can do that. But i need the algorithm, so i can make a block my self. I need that bacause i'm making a PID regulator with a gain-scheduling option.
I'm programming the PID in Codesys structured text.
Best Regards
Henrik
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm pretty sure that the formula should be:
(ymax-ymin)/(xmax-xmin)*(value-xmin)+ymin
For me the formula worked perfectly and is used to interpolate values for special needs, w/o using the function from the OSCAT library called LINEAR_INT.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm pretty sure that the formula should be:
(ymax-ymin)/(xmax-xmin)*(value-xmin)+ymin
For me the formula worked perfectly and is used to interpolate values for special needs, w/o using the function from the OSCAT library called LINEAR_INT.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Originally created by: H87
Hi
Annyone here know a good algorithm for linear interpolation. I know that oscat lib can provide a block that can do that. But i need the algorithm, so i can make a block my self. I need that bacause i'm making a PID regulator with a gain-scheduling option.
I'm programming the PID in Codesys structured text.
Best Regards
Henrik
if you open the oscat.lib in your codesys as a library, you can see the source code complete it is open source.
easier way is download the txt version. and the pdf along.
If you tell us what you want, we will look into your problem.
btw if it is complicated you can always use fuzzy.
ymax/ymin*((value-xmin)/xmax-xmin)+ymin
I'm pretty sure that the formula should be:
(ymax-ymin)/(xmax-xmin)*(value-xmin)+ymin
For me the formula worked perfectly and is used to interpolate values for special needs, w/o using the function from the OSCAT library called LINEAR_INT.
I'm pretty sure that the formula should be:
(ymax-ymin)/(xmax-xmin)*(value-xmin)+ymin
For me the formula worked perfectly and is used to interpolate values for special needs, w/o using the function from the OSCAT library called LINEAR_INT.