Hello
I have an application where a linear wire encoder is used to measure the sliding of an object: the longer the wire the further away the object gets and the shorter the wire the closer the object gets.
The problem is that due to mounting limitations the wire encoder is not perpendicular to the object and therefore I would have to apply the Pythagorean theorem to calculate the exact position of the object.
It would be very useful to be able to insert a formula into the reading to calculate the exact value.
thanks for any support
regards
Ezio
- supportsyt asked 8 months ago
- You must login to post comments
Hello,
This kind of calculation can be done with our Virtual Sensor Lua Script.
Please see an example setup and the attached script below.
In this example, I created a Virtual Sensor “VS 19 Find C Using Pythagorean” using the script I attached.
The script calculates the C side using Pythagorean from the length of the A and B sides from sensors on the SP+ (Can be configured in the “User setting” section of the script).
Note : The Sensor ID can be found in the last part of the browser’s URL of the sensor setting page.
To create Vitual Sensor Lua Script, do the following.
Go to Sensors => Virtual Sensors => Select an empty Virtual Sensor slot
Sensor Type => Lua Script Sensor => Next => Import => Browse to the attached PythagoreanCalculation.lua then follow the Virtual Sensor wizard.
For more information about the Lua Script mathematic calculations, please visit this site.
https://www.tutorialspoint.com/lua/lua_math_library.htm
AKCP Support Team
- asfscott answered 8 months ago
- You must login to post comments
Hello,
This kind of calculation can be done with our Virtual Sensor Lua Script.
Please see an example setup and the attached script below.
In this example, I created a Virtual Sensor “VS 19 Find C Using Pythagorean” using the script I attached.
The script calculates the C side using Pythagorean from the length of the A and B sides from sensors on the SP+ (Can be configured in the “User setting” section of the script).
Note : The Sensor ID can be found in the last part of the browser’s URL of the sensor setting page.
To create Vitual Sensor Lua Script, do the following.
Go to Sensors => Virtual Sensors => Select an empty Virtual Sensor slot
Sensor Type => Lua Script Sensor => Next => Import => Browse to the attached PythagoreanCalculation.lua then follow the Virtual Sensor wizard.
For more information about the Lua Script mathematic calculations, please visit this site.
https://www.tutorialspoint.com/lua/lua_math_library.htm
AKCP Support Team
- asfscott answered 8 months ago
- You must login to post comments
Please login first to submit.