LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Scaling position

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

0 Kudos
Message 1 of 3
(394 Views)

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!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 3
(365 Views)

@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?

0 Kudos
Message 3 of 3
(310 Views)