04-05-2010 05:41 PM
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.
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
Solved! Go to Solution.
04-05-2010 06:12 PM
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?
04-05-2010 07:58 PM
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
04-06-2010 07:43 AM
04-06-2010 10:49 AM
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.