LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Convert rotation to rpm in vi

Thanks everyone for the help. Lucither, your solution is very close. The issue I now have is when the actual signal from the sensor is input into the rpm meter loop the rpm meter starts over at 600 rpm. If you input an rpm of 60000 in the simulation (RPM Meter2 vi) it simulates what it does at 600 rpm when reading the actual sensor signal. What do you think.

 

Thanks again for all the help.

0 Kudos
Message 11 of 24
(1,408 Views)

Its hard to answer you question without having more info. One thing i can say is that the higher your expected RPM the higher you need to set you sample rate. This can be shown by the sample software i posted to you. If you have an RPM of 600 and only a sample rate of once every 100ms then you will get a reading of 0. This is because at a speed of 600 RPM the input device would of rotated exactly once within a time of 100ms. So basically your input device will give you exactly the same reading as the time before, this then will show as a reading of 0. You will see that if you keep the sample rate the same but up the RPM to 601, you will get a reading of 1 because the input device would of rotated once plus a small amount more.

 

I have a feeling that your sample rate is too low for the expected RPM. What is your sample rate? If you are expecting a max sample rate of 600 RPM then you need to get your sample rate under 100ms in order to calculate this.

 

You can used the software i posted you to see what minimum sample rates you need to achieve for a maximum RPM. You will see the output reading starting to give error readings once there isnt a good match.

 

If you can give me more information i might be able to provide more help.

 

Rgs,

 

Lucither

------------------------------------------------------------------------------------------------------
"Everything should be made as simple as possible but no simpler"
0 Kudos
Message 12 of 24
(1,405 Views)

Hi Again,

 

Forgot to mention. For your application a quick rule to follow in order to calculated maximum sample time is:

 

60/Max RPM +1 = Sample time in seconds

 

So for 600RPM, that would be:

 

60/601 = 0.99 = 99 ms.

 

Basically you need to sample the input device before it has had time to complete a full rotation. Once this happens the software has no way of knowing if the rotational device has gone a long way (one complete rotation and a bit) or a short way (just the bit). It actually just calculates the short way, this is when you start getting errors, the code will all of a sudden show a really slow RPM.

 

Hope this helps.

------------------------------------------------------------------------------------------------------
"Everything should be made as simple as possible but no simpler"
Message 13 of 24
(1,397 Views)
Just a quick point. What is the value of the signal you are inputting into the calculation. Are you converting the 0-10v signal to 0-360 degrees? If you are inputting the 0-10v you will get funny readings.
------------------------------------------------------------------------------------------------------
"Everything should be made as simple as possible but no simpler"
0 Kudos
Message 14 of 24
(1,376 Views)

Hi Lucither,

 

It is a 0 to 10V signal and I convert it to 0 to 360 multipling by 36 prior to sending it through the calculation loop. The sample time updates at 1ms. When reading the actual sensor it starts over at 600 rpm intervals. 601rpm  = 1rpm and it reads up to 600 again to 1200 rpm then 1201 rpm = 1rpm and so on. The rpm is correct if you know how many times you passed 600 rpm (If reading is 500rpm and you passed 600rpm once the actual rpm = 1100rpm). Do you think I somehow need to count revs between measurements to extend the time between measurements?

 

Thanks for your interest and help with this. I'm still learning.

 

Uddy

0 Kudos
Message 15 of 24
(1,370 Views)

Hi Uddy,

 

Are you saying that the reading from 0 - 600 RPM is good, but once you got to 601 RPM it reads 1 RPM. If so then this would indicate that your time between reads is approx 100ms. How do you know your sample rate? it may be that you have a 1ms 'Wait' command in your while loop but this doesnt necessarily mean that your sample rate is 1ms. This only means that your loop will wait for 1ms minimum, if your subvi that reads the sensor takes longer to actually read the sensor and process etc this will effect the time of your loop.

 

It really seems to me that the problem you are facing is down to the constraints of the maximum RPM that can be accurately read for a given sample rate. You are describing exactly what would happen if your sample rate was 100ms. You would be able to read up to 600 RPM but after this it would clock over and start again.

 

Can you post some code of what you have so far? Do you know how to time your sample rate? if not send me your code and i will implement a timer and send back to you.

 

Rgds,

 

Lucither

------------------------------------------------------------------------------------------------------
"Everything should be made as simple as possible but no simpler"
0 Kudos
Message 16 of 24
(1,363 Views)

Lucither,

 

That is correct, it reads up to 600 rpm then 601 = 1 and reads the next 600 rpm correct which is actually 601 to 1200 rpm and so on. I think I may have found the timing issue your refferring to. I hope to set it up again later Today and I will see if this takes care of it. If not I will send you a cleaned up copy of the code.

 

Thanks again for all the help.

Uddy

0 Kudos
Message 17 of 24
(1,358 Views)

uddy wrote:

Lucither,

 

That is correct, it reads up to 600 rpm then 601 = 1 and reads the next 600 rpm correct which is actually 601 to 1200 rpm and so on. I think I may have found the timing issue your refferring to. I hope to set it up again later Today and I will see if this takes care of it. If not I will send you a cleaned up copy of the code.

 

Thanks again for all the help.

Uddy


Yup- you found the Niquist limit for your sample rate!  Just like when you watch the Wheel rotation on a TV comercial and it looks like the spokes stand still (or watching a wheel with a strobe)


"Should be" isn't "Is" -Jay
0 Kudos
Message 18 of 24
(1,349 Views)
'Niquist limit', i knew there was a fancy name for it. Just couldnt think of it.
------------------------------------------------------------------------------------------------------
"Everything should be made as simple as possible but no simpler"
Message 19 of 24
(1,347 Views)
Yup, and "Ailiasing" is the term for the effect Smiley Wink

"Should be" isn't "Is" -Jay
0 Kudos
Message 20 of 24
(1,339 Views)