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: 

Feedback node wierd rounding

Solved!
Go to solution

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

0 Kudos
Message 1 of 2
(2,176 Views)
Solution
Accepted by topic author melvad

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.


GCentral
Message 2 of 2
(2,165 Views)