LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to code for measuring rpm of a motor pump using a laser sensor ?

Hello 

 

Im am currently doing an honours project and some section of my vi is to measure the rpm of a pump motor using a lasor sensor ( DK10-LAS/76a/110/124).

 

On the rotor blade of the pump motor there is a black strip located. The laser is calibrated to sense the black strip as it passes through the strip. I have created a vi to count the number of times the black strip passes through the beam and multiply it by 60 to give out an rpm. This will be displayed on a indictaor. As soon i run the vi the indicator does display values but they fluxuate up and down rapidly. Then once i stop the vi an error comes up. ( error - 200474). My aim was to run the vi and the indicator will start from zero and gradually increase as the pump speed increases.

 

The Dqmx driver used was the Ni 9401 module.

 

I have attached the vi i have. If someone can help me out thanks.

0 Kudos
Message 1 of 11
(4,598 Views)

How fast is your while loop running?  How fast do you want your screen to update?

 

My guess is that it is running very fast, you are getting counts from your counter in that Express VI that is very quantized.  Maybe you get 4 counts on this read, 5 on the next,  4 on the next, 5 on the next.  That would look like a lot of error each time the loop ran.   That or the fact it is executing as 1 sample on Demand means you are at the mercy of the software timing which is inaccurate.

 

Try looking in the Example Finder for examples that use real DAQmx subVI's rather than Express VI's to monitor a counter channel.

0 Kudos
Message 2 of 11
(4,583 Views)

how to measure the RPM of motor using laser sensor and also to show the nature of the graphical display. below is the graphical respose of what i obtained from the signal.

 

 

 

 

0 Kudos
Message 3 of 11
(4,541 Views)

Are you the same person as the original poster?  If so, why did you create a new user profile and nickname?

 

If not, then you should create your own new message thread with your question.

0 Kudos
Message 4 of 11
(4,535 Views)

That is a diffferent user. My original post is as stated from the beginning.   nickname dfranc200

 

thank you for your help. I will try to use the example finder.

0 Kudos
Message 5 of 11
(4,514 Views)

Hello,

 

I am currently doing my msc project and I have a similar problem to this.

 

I need to measure the rpm of a pump motor using a lasor sensor ( DK10-LAS/76a/110/124).

 

A white strip has been attached to the rotor blade of the pump's motor which the laser was calibrated to detect and my VI counts the number of times the white strip passes through the laser beam which is then multiplied by 60 to give the RPM.

 

I am only able to get '1 sample on demand' but i need to continuously sample the RPM also. I use an NI 9401 module for the drive the laser sensor.

 

I will appreciate any help. Thanks.

 

0 Kudos
Message 6 of 11
(3,609 Views)

I'm assuming you're using a standard PC for this?  This means that you can't rely on software timing to make sure you measure the exact moment your strip passes through the sensor.

 

You can either try to set something up that does continuous input and then you search for transitions from off to on to off again in a digital waveform, or you can set it up for change detection and have it save a time stamp each time a change is detected.

 

Either way, the best way to get started is with examples.  In your LabVIEW, go to the Help menu and choose "Find examples".  Then open the "Hardware Input and Output" category, then "DAQmx" under that, then "Digital input", then open both the "Change detection" and "Continuous input" examples and go from there.

Message 7 of 11
(3,604 Views)

Thanks for your response.

 

The PC I use is quite powerful, it was provided and maintained by the uni.

 

I have attached my VI.

 

thanks.

0 Kudos
Message 8 of 11
(3,598 Views)

The comment about "standard PC" has nothing to do with how powerful it is.  If it uses Windows, there's nothing stopping the OS from suspending LabVIEW for a few milliseconds to do something a bit more important.

 

Anyway, I looked at your VI, and I see two immediately notable issues.

 

First, the DAQ assistant and the "dynamic data wire" are things that are absolutely not recommended to use.

Second, it appears that you most likely are using the "Run continuously" button to loop your code.  This means that there is a period of time between each execution where nothing is happening.

 

If you use "proper" DAQmx VIs, then you can create a setup where you don't drop any data because it's collecting in the hardware and sending the data to LabVIEW to process whenever it's ready.  This is because the DAQmx VIs allow you to put the setup, start, and stop elements of the task outside of a loop while only the measurement VIs are inside the loop.  Right now, every time your VI runs it wastes time doing the setup, start, and stop tasks surrounding your measurement.

0 Kudos
Message 9 of 11
(3,591 Views)

Thanks for this.

 

I actually use a while loop for everything. I took out that portion to show you.

 

I think the laser sensor can't read more than 1 sample per second. I was hoping to get 1000 samples every second like my other sensors (on the NI 9472  module) read.

 

Thanks.

0 Kudos
Message 10 of 11
(3,576 Views)