02-09-2024 05:21 AM
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?
Solved! Go to Solution.
02-09-2024 06:18 AM
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!
02-09-2024 06:35 AM
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?
02-09-2024 06:53 AM
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...
02-09-2024 07:20 AM
All I need is one iteration per loop
02-09-2024 07:21 AM
do you have an example on how to do this please?
02-09-2024 09:55 AM - edited 02-09-2024 02:12 PM
Maybe all you need is an exponential filter.
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.
02-09-2024 02:16 PM
@altenbach wrote:
... but you could easy create a VIM that accepts scalars and arrays.
Here's how that could look like: