05-06-2010 09:12 AM
hello everyone, i'm using the tone measurment.vi to measure the frequency of a square wave from 0-15Hz. when i start my program, the frequency of my square wave is zero, but the output
of the tone measurment is 1.268, while the program is running i can get the value to zero. but it is very important that the value in the beginning is zero. i hope someone can help me with this.
thanks in advance
kapoew
Solved! Go to Solution.
05-07-2010 08:57 AM
Hello,
I don't really see a problem in the jpeg.
Can you put the specific VI online?
05-07-2010 10:16 AM
hello, here is my VI, just so you know it's a program for a PMSM motor. the problem occurs when you move the slide bar from the "hall sensor speed". i've also noticed that the value only becomes zero when you move the slide bar really fast to zero otherwise i still get a value.
thanks in advance
05-10-2010 07:49 AM
05-10-2010 08:25 AM
05-10-2010 08:54 AM
kapoew,
How do you define zero frequency ... from a finite measurement perspective?
A frequency is defined as the number of cycles of the waveform during a specified time period. If less than one cycle occurs during that time period, the frequency will be considered to be zero. From the error you got, it sounds as though the signal may have been sitting at zero volts throughout the measurement period. If this happens, any measurement scheme will be unable to determine whether the frequency is low, the connection to sensor is broken, or whether the sensor is just putting out zero volts.
You have to detect these conditions in your own code to supplement the results from the Pulse Measurements VI or Tone Measurements. If you are confident that broken connections will not be an issue, then look for the -20308 or the -20309 errors. When they occur, clear the error and define the frequency as zero. If the sensor output stays high throughout one measurement cycle, does the Pulse Measurements VI produce a different error? You may need to detect more than just those two error codes.
Lynn
05-10-2010 09:43 AM
hi, i don't really know what i did, but the 20309 error is gone, but now i get the 20308 error. but there are no broken connections because for the moment i'm simulating the sensor (later on this will be replaced by a real sensor). how do i clear the error and define the frequency as zero?
also i'm measuring the period i'd rather have the frequency. because the period would give me another problem (because frequency = 1/period, and if period=0 well that's infinite)
i've played with the reference levels, changing the polarity. but nothing works. it can't be this difficult to measure a zero frequency...
thanks for the reply
kapoew
05-10-2010 09:51 AM
To handle the error you can wire the error out from the VI to a case structure. In the "error" case unbundle the error code and compare it to -20309 (sign is important). If you get that error, set the frequency to zero and set the error cluster to the default no error condition. Just wire everything straight through the "no error" case.
If you have trouble with this, please post your VI. It is much easier to trouble shoot a real VI than to guess from a written description.
Lynn
05-10-2010 10:06 AM
hello, i did what you do. and it's almost solved. i get a zero frequency output like i wanted. but i still have a small problem. the frequency above zero only gets stable from about 1.5Hz. any solution to this? i posted my VI so maybe you can check it out. it's a program for a PMSM motor.
thanks a lot
kapoew
05-10-2010 10:07 AM
ow yeah, and off-topic: what are kudos? ^^
thanks