09-06-2019 02:31 AM
Hi all,
I am trying to make a soft start subVI for DC motor PWM control. (I added a while node to the attached example to make it run on its own - to be removed later).
However the error I see is that the feedback node (unlike if using shift registers) does not pass exactly the number I save in it, meaning that the equal comparator never becomes true. I tried subtracting the feedback number from the setpoint and it gives -1,38778E-17. Is there an execution speed efficient solution to this?
Kind regards,
Claus
Solved! Go to Solution.
09-06-2019 02:44 AM
Your problem is simply one of comparing floating point values for equality. This is often a difficult/impossible problem.
One option would be to consider using "abs(current-set) < 1e-10" or similar instead of "current = set" for your case conditional.
You can adjust the tolerance according to your increment size, and so on.