LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Rpm measurement

Hei! I have a school project on making a steering system on a scale model boat. Now we been working around the clock to get this thing working but there is one problem/challenge left.

 

So i have a Myrio, hall sensor and a dc motor and im trying to measure the rpm on the motor.

The Hall sensor gives a pulse when the motor turns one round. I have conected the hall sensor to a digital input on MyRio and from there i get a True/False signal for the sensor.
I guess if i measure how many pulses i got in one secund and multiply that by 60, i get the rpm? but im not sure how do to that i labview.

Does anyone have some idea on how to do this?   Thanks:)

 

 


 

0 Kudos
Message 1 of 13
(5,074 Views)

It sounds like you already have the logic understood.  What part of the task are you having troubles with?  What have you tried?  Post some code if you can.

0 Kudos
Message 2 of 13
(5,067 Views)

I acquire an analog signal for about 0.3 seconds and send the waveform to Extract Single Tone VI (located in Signal Processing -> Waveform Measurements).  It will return the frequency value of the waveform.

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 3 of 13
(5,059 Views)

@aputman wrote:

I acquire an analog signal for about 0.3 seconds and send the waveform to Extract Single Tone VI (located in Signal Processing -> Waveform Measurements).  It will return the frequency value of the waveform.


This will work for some applications but not all.  If I am trying to measure a slow signal, say only 100RPM, and it only pulses once per rotation (like the question) then that is 100/60 = 1.6 pulses per second, or only 0.5 pulses per 0.3 seconds.  Your tone detection will fail in this case and get bad readings likely returning NaN.

0 Kudos
Message 4 of 13
(5,057 Views)

Valid point Hooovahh.  I am measuring 5-12 pulses per revolution (depending on the application) and speeds upwards of 5000 RPM. 

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 5 of 13
(5,051 Views)

I dont have labview on this computer but to this point i have only conected a led til the digital input so that i can see the signal.

Then send the signal to this true/false function (picture) with 1/true and 0 to false so that every time the hallsensor send a signal the output on the function wil be 1. So i was thinking if i could store number of times the signal was true in one secund or whatever i can get the rpm. But i have not find a way to do this yet. I hope i make sense

Capture.PNG

0 Kudos
Message 6 of 13
(5,045 Views)

There are many ways to go about doing what you are asking.  With the information you suggested you could use a shift register to hold the previous number of pulses seen.  Then update this in each run of your loop adding to it or leaving it the same if no new pulses are seen.  Of course without knowing more I'd say there are probably better ways to do the same thing like looking at the time between pulses, or detecting the frequency of the buffered read instead of an on demand read which I assume you are doing.

0 Kudos
Message 7 of 13
(5,042 Views)

I will try with a shift registerer tomorrow and se how it goes:)  its possible that there are better solutions, like looking at the time between pulses are better but im not realy sure on how to do that. Do you have an labview code example or something maybe?  I can post my labview program tomorrow so maybe its easier to see:)  And thanks again for the respons. it helps alot

0 Kudos
Message 8 of 13
(5,026 Views)

I did not get that to work so i must find a nother solution.
Maybe something like this (picture)  the teori is that the encoder resets every secunds and counts the number of pulses, but its not working..  Any solutions? 

0 Kudos
Message 9 of 13
(4,994 Views)

@PetterMartin wrote:

I did not get that to work so i must find a nother solution.
Maybe something like this (picture)  the teori is that the encoder resets every secunds and counts the number of pulses, but its not working..  Any solutions? 


What didn't work with the other solution?  What isn't working in this?

 

So lets say you get that counter reading the pulses.  Do you know how much time has elapsed between pulses?  That is the other half of the equation.  You must have a way to read pulses, and know the time that they came in at.  Reading with DAQ will give you this.  Are you assuming that the loop that this code runs in will iterate once every millisecond?  If so then this could be a working solution.  Use a single sycle timed loop, on a deterministic OS (myRIO is one) to force it to run at a specified rate.

0 Kudos
Message 10 of 13
(4,984 Views)