LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Please Help me ! Hall effect sensor

Can you help me to make the programm ?

FASTEST = 800 RPM

0 Kudos
Message 21 of 28
(2,227 Views)

Assuming that the hall effect sensor is activiated for a whole 5 degrees during rotations you would only see the pulse on a single poll of the digital pin (this also assumes that everything is running at ideal speeds which is not going to happen).  This is way too small for me to say that it would be reliable.

So, I would say that this is not possibel with an unmodified LIFA.

You would be much better off using the interupts provided by the Arduino.  This requires writing custom firmware to set up a counter using the interupt pins along with custom functions in LabVIEW to get the information.  You could probably even do the speed calculation on the Arduino before sending it back if you set up the counter this way.

0 Kudos
Message 22 of 28
(2,227 Views)

hello

I have most the sampe problem. But I use a reedcontact to count RPM.

Do you have a example of counting digital Inputs?

tanks

0 Kudos
Message 23 of 28
(2,227 Views)

To do it accurately, you would want to modify LIFA to include use of an interrupt pin that would detect when the reed switch activates and then calculate the time between the two consecutive pulses.  Then, you would simply need to add a function to LIFA to send the rpm value back to LabVIEW.  Also, you would need to compensate if you have multiple pulses per revolution.  However, the accuracy of the measurements will depend on the speeds you will be expecting.

0 Kudos
Message 24 of 28
(2,227 Views)

Hey,

great to find a tread with the same problem...   I'm a Mechanical Engineering Student..

I want to measure the RPM of my Home made Dyno.

I have a Hall sensor and a perforatet disk with now 2 teeth.

Problem: Accurate Data only up to 700 RPM. No delay and so on. But over 700 RPM.. very noisy signal, missing signals and so on. (see picture)

@Nathan_B: Wow I'm a bit shocked. i thought that with the Baudrate of 115000 bit/s must be really enough..

Is there no other solution than modifiing the firmware? I don't think that i can do this^^..

When i start measuring i can go to 1000 RPM and get a good signal.. It seems there is more data speed. But after 5 - 10 seconds the signal gets noisy.. It seems that the memory gets full or so..

Regards PhilBild 007.jpgBild 2.jpg

0 Kudos
Message 25 of 28
(2,227 Views)

You are using a method known as "polling".  This can work if you are able to poll much faster than your signal changes.  But, if your signal is changing faster than you are able to poll, you get what is known as aliasing.  You can read about this by searching for the Nyquist theorm.

So, when you are polling using LabVIEW and Arduino, you are likely polling relatively slowly and will depend highly on your OS and everything else that is running on your computer.  Everytime that you send a command to Arduino, you are also sending overhead (the stuff that is required for the communication but not directly related to the measurement itself).  This overhead will slowdown your overall communication rate.  So, you have to take into account the overhead when determining if the 115200 baud rate is "enough".

Using an interrupt pin eliminates the need to poll.  It's how most incremental (including quadradure) encoders are implemented (afaik).  For the Arduino, this would require that you get a 5V pulse for every tick/tooth on your encoder disk.  You would then need to check the time between pulses (or you can measure the time for several pulses and adjust your formula accordingly).

0 Kudos
Message 26 of 28
(2,227 Views)

Hey Nathan, thanks!

ok that semes logic for an mechanical engineer.

Due to my understanding: So there is a lot of comunication. So the bottleneck ist the comunication between lifa and Labview.

1. Without labview as an Example with a LCD Display on the Arduino it will work with no problems.. Less comunication.. Seemes logic

2. With an CHip with more Power like the CHIPKIT or the new Arduino Due would it be possible because more CPU Clock and more SRAM?

3. I have to modifiy the firmware

4. Would it bring some advantage to use the digital read port instead of digital read pin (i remember i read something abaout the speed) or to use the "get timing data" block from arduino?

Best Regards

Learned a lot in the last days

0 Kudos
Message 27 of 28
(2,227 Views)
  1. I didn't say that.  However, you will probably be able to use polling with better success on lower speeds.  This still means that you are still limited to lower speeds.

  2. Processing "power" isn't really the issue here.  Using another microprocessor won't completely solve the issue.

  3. Yes.  To get the most accurate results, you would need to use an interrupt pin to count the pulses.  Then, you would need to calucate the angular speed based on the number of pulses counted in a certain amount of time.  In the past, I have done the second part in LabVIEW.  So, this would require only a single interrupt pin that would simply increase an integer variable (by one).  Then, you create a custom LIFA function to return the counter value to LabVIEW.  You would calculate the time since the last time that you read the value and use it along with the change in the value to get the angular frequency.

    For example:

    Two (2) pulses per revolution

    Read 1:  Value = 9; Time = 4.0 s

    Read 2:  Value = 19; Time = 14.0 s

    Angular velocity = ((19 - 9)/2)/(14.0 - 4.0) = 5/10 = 0.5 revolutions/second

  4. Digital Read Port is for reading all of the Arduino Uno digital pins at once.  It is faster than reading all digital pins individually.  This is not related to the current issue.
0 Kudos
Message 28 of 28
(2,227 Views)