ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sigmoid Function for a waveform chart that plots calculated data

Solved!
Go to solution

I want to add a sigmoid function to my waveform chart. Right now when I increase the throttle the chart shows that the amplitude changes to the new value straight away without  a delay. So I want to implement a sigmoid function that takes me from the initial value to the final value with a smooth S curve implemented. Is there any way to do this?

0 Kudos
Message 1 of 8
(1,741 Views)

Hi AJ,

 


@AJcpt wrote:

So I want to implement a sigmoid function that takes me from the initial value to the final value with a smooth S curve implemented. Is there any way to do this?


Yes, sure!

Write down the math on a sheet of paper, then implement the formula in LabVIEW!

Best regards,
GerdW


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

The issue is lets say I use y=1/(1+e^x) the x is a time value that is a part of the waveform chart rather than be in input so I am finding it difficult to implement this? I hope that makes sense

 

Any solutions to this?

0 Kudos
Message 3 of 8
(1,708 Views)

Hi AJ,

 


@AJcpt wrote:

The issue is lets say I use y=1/(1+e^x) the x is a time value that is a part of the waveform chart rather than be in input so I am finding it difficult to implement this?


"Time" is not a "part" of the chart...

 

As you run the code inside a loop: how much time does the loop need for one iteration?

"x" will be the same as "ierations * time_per_iteration"!

Or you simply determine the time difference between start of loop and current time...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 8
(1,701 Views)

All I need is one iteration per loop

0 Kudos
Message 5 of 8
(1,691 Views)

do you have an example on how to do this please?

0 Kudos
Message 6 of 8
(1,690 Views)
Solution
Accepted by AJcpt

Maybe all you need is an exponential filter.

 

ExponetialFilter.png

 

The entire "filter" can easily be wrapped into a subVI. An example for multiple channels can be found here, but you could easy create a VIM that accepts scalars and arrays.

 

 

0 Kudos
Message 7 of 8
(1,666 Views)

@altenbach wrote:

... but you could easy create a VIM that accepts scalars and arrays.

 

 


Here's how that could look like:

 

altenbach_2-1707509719461.png

 

 

 

0 Kudos
Message 8 of 8
(1,647 Views)