LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to convert timing to floating number

Solved!
Go to solution

hi everyone, i want to do a time measurement of hall sensor and use this value to set a frequency and also to use as process value in a PID controller. the problem is that i get an dynamic data output and i'd like to have this in a floating number, is this possible? or another way is also good... hereby a jpeg to make it more clear.

 

untitled.JPG 

 

i also get more problems with this, when i change the throttle (0-100%) is doesn't do anything and my while loop also doesn't end anymore. this is just a small part of the complete program, maybe it's to heavy for my comp? (single core 1,6Ghz, 1,5gig ram) 

 

hope it's a little bit clear what i mean

 

thanks in advance ! 

 

P.S: i know that the divide by one is useless because you can directly measure the frequency, this has allready changed.

       the program is meant to drive a PMSM motor 

 

 

0 Kudos
Message 1 of 5
(2,779 Views)
Solution
Accepted by topic author kapoew

You can change the Dynamic Data type to a scaler by using the To Double Precision Float function found in the Numeric - Conversion palette.  For your other question, you don't display your entire While Loop so I can't help you there.  What stops the loop?

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 2 of 5
(2,775 Views)

hi thanks for the reply, the answer you gave helped me out.

now i've noticed that when i ad the the pid loop (even when nothing of it is connected) the program doesn't respond anymore. is this because of my computer? the while loops (both the normal and pid loop) are stopped by a single switch...

i have uploaded my VI so maybe someone could check it out, be aware it's totally not finished ^^. if you delete the pid control you'll see what i mean.

 

 

thanks in advance 

0 Kudos
Message 3 of 5
(2,767 Views)
ok, problem solved, just had to delete the while loop of the PID control. stupid mistake ^^
0 Kudos
Message 4 of 5
(2,745 Views)

You are correct in that you didn't need the while loop for your PID code.  However, I want to answer your question as to why the loop doesn't stop.  You have a wire from the Stop button to your PID loop.  When the code executes, the Stop button value, which is False, is fed into the loop.  This is like wiring a False constant to the loop stop sign.  The loop executes forever.  The outer loop will execute once, and it will wait forever for the PID loop to finish.  It cannot go on to the next iteration until all code inside the loop is completed, including the forever running PID loop.  So the stop button never gets updated.  By removing the loop for the PID code, the outer loop can complete iterations and continue until stop is pressed.

- tbob

Inventor of the WORM Global
0 Kudos
Message 5 of 5
(2,725 Views)