LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Measuring speed with incremental single counter

Hi,

 

I need to measure the rotational speed and acceleration of a wheel that has 3 hall sensors on it. I will use only 1 of them en it gives 24 pulses 0-5V for a 360° rotation. How can I measure the speed with only a pulse train. I dont have the Quadric encoder...

Now I'd like to measure the rotational speed using a counter of some sort, but the software I tried writing for it isnt working.

 

Thank you for your help

0 Kudos
Message 1 of 10
(7,489 Views)
Can you post the software you wrote or at least a screen shot of it?
0 Kudos
Message 2 of 10
(7,466 Views)

Nitch,

 

What hardware are you using to capture the pulses? For speed/acceleration you will need to resolve some sort of "time" associated with your data - not all of NI's hardware is particularly good at this although there are many ways to get close...

 

Thanks,

0 Kudos
Message 3 of 10
(7,456 Views)

Hey Nitch,

 

 

With only one pulse train you can calculate the rotation speed without any problem.  If you also want to know the rotational direction, then you need a quadrature decoder.

If you then measure the number of pulses within a certain time frame and when knowing you have 24 pulses per revolutions you can calculate the RPM.

 

Best way to measure  is as you indicate by using a counter.  That way the data acquisition board will simply provide you with the number of counted pulses within a certain time frame and you only need to do the RPM calculation within your application.  

 

Best is to upload your application so we can have a look at it.
Also very important is to know which hardware you are using.

 

 

Best regards,
Joeri

National Instruments
Servicesg
Message 4 of 10
(7,439 Views)

Thanks for the fast response,

 

The hardware I am using is the USB 6008. I found out it has a counter on it and I tried writing a program with that. Actually I found a simular problem on the forum. By adapting it I thought it would be perfect for me. I first installed a bike speedometer on the wheel zo I can put that one on the counter. Now it seems that its showing pulses per second as it should but there are still a couple of problems with it.

 

When the wheel starts spinning very fast the measurements mak very strange jumps upwards and downwards. So it seems that is turning at incredible high speeds... Wich is impossible. Also,the meter doesnt give a constant number when the weel is turning at a constant rate. Maybe the switch isnt working properly and I just have to fix that more secure.

 

I have then a couple of extra questions for you.

 

How do I get a indicator out of the case loop into a signal thats in another while loop, (actually, what do I put on it in the false case? ). That is written to a Measurement file afterwards and I should be able to know what speed the weel is turning at every measurement point...

 

Thanks allot in advance and I hope you can help me

0 Kudos
Message 5 of 10
(7,402 Views)

I can't quite read the image you posted.  You may want to repost as a PNG file instead.

 

Bizarre jumps: (I was hoping to check this from the image)  Make sure you are reading all of the bits of your encoder properly.  I fixed one test setup once where they had put in a 17-bit encoder but were only reading 8-bits.  Whenever the eighth bit flipped, they also got bizzare jumps.

 

Not sure if it will help, but that's the best I can do right now.

-Matt Bradley

************ kudos always appreciated, but only when deserved **************************




0 Kudos
Message 6 of 10
(7,386 Views)

Hey Nitch,

 

Concerning the measurements errors:

As you get error when speeding up, it looks like the pulses coming from the hall sensors are to short to get measured by the counter.

Following the USB-6008 specifications, the pulse needs to have a minimum lenght of 100ns (both in high and low state).

As a counter is using edges to count the pulses (for USB-6008 only the falling edge) the edges need to comply with the TTL specifications which means that the rise and fall time of the pulse needs to be within the 50ns range. 

So please have a look at the pulse lenght at higher speeds (are they at least 100ns?) and make sure the pulse comply with the TTL specifications.

 If not you will have to add some additional electronics to reshape the pulses.

 

Looking at your program.

It's not nescesarry to have two loops.  It's very well possible to have two DAQ tasks within the same look.
Have a look at the Examples which come with LabVIEW --> Exampled Finder --> Hardware Input/Output --> DAQmx --> Synchronization --> Multi-Function.

There are some examples which so the combination of analog and digital input.

Anyhow you will have to remove the right while loop as the DAQ Express VI which apparently gives you the "spanning, stroom, gashendel" values will only start once you have done the counter measurements.  I assume that you would like to have the "spanning", "stroom", "gashendel" and"speed" synchronized measured.

 

Then you have the choice to log to file during acquisition or after the acquisition.

If you would like to log on the fly don't use the express VI's, but use the lower lever "File I/O" functions. These are faster (less processor time usage).

 

As you VI is written now, the left while loop will only output the lastest counter value measured to the next loop when you click the stop button for example.
You have to "Enable Indexing" of the m/s output tunnel.  Right click on the tunnel and you will be able to select "Enable Indexing".
This way the application will automatically create an array and each loop iteration the measured value will be added.  One the measurements have been done you can do analysis and save the data using the full array instead of point by point.

Again, also bring your "spanning, stroom and gashendel" inputs to the left loop.

 

In your right loop you also have a loop counter.
You can simply use the loop iteraction counter (the square box in the left bottom corner with the i).  This is also counting from 0 and incrementing by 1 each loop iteration.
Again, you can do this in the left loop and forget the second loop completely.

 

Hopes this will bring you a step further.

Don't hesitate to post the VI itself.  This is always easier to look at than an image.

This way we can also make some modications and post it back.

Best regards,
Joeri

National Instruments
Servicesg
0 Kudos
Message 7 of 10
(7,377 Views)

Thanks allot for the help. Ill check the lengths of the pulses. I now use a bike speedometer that gives only one puls every 360°. Hopefully this is slower and therefore more accurate. Ill attach the files that should be put together, maybe its easier to see change for you.

 

I tried making the speed measurement a subVI but that wasnt as easy as I hoped...

 

Kindest regards

 

Nitch

Download All
0 Kudos
Message 8 of 10
(7,356 Views)

Hoi Nitch

Is je probleem opgelost want ik wil eigenlijk het zelfde  een fiets wiel max snelheid 70 km/h  .

Ik wilde het ook met een 6008  heb je nu wel goede waarden  ?

 

Cees 

 

 

0 Kudos
Message 9 of 10
(7,011 Views)


 

Hoi Nitch

Is je probleem opgelost want ik wil eigenlijk het zelfde  een fiets wiel max snelheid 70 km/h  .

Ik wilde het ook met een 6008  heb je nu wel goede waarden  ?

 

Cees 


Please try posting in english here
0 Kudos
Message 10 of 10
(6,975 Views)