02-16-2024 05:13 AM
Hi everyone,
I use an encoder to measure linear position. The actual displacement is from 0 to 150mm, corresponding to an output from 3.51 to 14.61 of the encoder. I want to scale and map the output of the encoder to displace the actual position. How can i do this in labview?
Thanks in advance
02-16-2024 06:15 AM
Hi Son,
@Sonnguyen023 wrote:
The actual displacement is from 0 to 150mm, corresponding to an output from 3.51 to 14.61 of the encoder. I want to scale and map the output of the encoder to displace the actual position. How can i do this in labview?
How would you do that in another programming language?
You have an input range of 3.51...14.61 and you want to scale to 0...150: this is a simple linear equation with parameters offset and gain.
You should have learned the equation in school! (y = gain * x + offset)...
Determine gain/offset, then you just need a multiply&add node in LabVIEW!
02-16-2024 12:49 PM
@Sonnguyen023 wrote:
... corresponding to an output from 3.51 to 14.61 of the encoder.
While Gerd is of course correct, I don't quite understand your question, because an "encoder" typically provides digital counts, i.e. integers as raw data. Fractional values as you list here apparently already have some scaling applied. Can you clarify where these values come from?