LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help needed with RPM calculation in LabVIEW - Jumping to zero/Erratic readings

Hi everyone! 👋

I'm struggling with a VI where I'm trying to calculate RPM based on pulse counting. The main issue is that the indicator keeps flicking to zero every time the counter resets, or it shows erratic values.

My professor suggested implementing a logic to update the value every 9 cycles to keep the reading stable, using a Quotient & Remainder function to trigger the update.

Captura de pantalla 2026-05-12 190926.png

Captura de pantalla 2026-05-12 192022.png

Captura de pantalla 2026-05-12 192000.png

  

Any help would be greatly appreciated! 📈

0 Kudos
Message 1 of 4
(236 Views)

It is impossible to debug pictures. Please attach your VI.

0 Kudos
Message 2 of 4
(223 Views)

Here's the .vi

0 Kudos
Message 3 of 4
(173 Views)

Hello, Ninja-761.  What happened to the preceding 760?

 

Have you looked at your Block Diagram?  Do you see wires running "all over the place", frequently with lots of right-angle bends and not easy to follow from one node to the next?

 

Thank you for labeling your controls and indicators.  Unfortunately, the names aren't helpful -- "knob" doesn't tell us what the control means, just that you "turn it" like a knob (suggesting it might control a "speed", maybe a "loudness".  Some things are labeled in a language I don't speak "TEMPS TRANSCORREGUT" (this seems to be very important, since it is "IN ALL CAPITAL LETTERS").

 

So first, name your controls and indicators so we know something about the data flowing through the wires.

 

Now, let's clean up the Block Diagram so we can see where the wires are running.  Do you see the "broom" icon (the one at the right end of the Block Diagram settings)?  Push it (once).  Isn't it easier to see/understand your code?

 

The top While loop has a Shift Register initialized to the integer "0" that gets incremented by one each iteration of the While loop.  Do you see the indicator in the lower left corner of the While loop with "i" in a little box?  It is there for a reason, it "counts" the While loop -- you don't need to do it yourself.

 

You are using "Wait until Next ms Multiple".  This is a greatly-misunderstood function -- it is designed to synchronize two loops so they run at the same rate.  It is (now) almost never used, and when it is (as in your case), it almost always behaves not as the User intended.

 

Here's a suggestion.

  • Don't worry about LabVIEW and developing the Block Diagram.  Instead, try to write a description of what you want to do.  I'm "guessing" that you have a "speed control" ("knob"?) in some kind of units (RPM? Hz?).
  • The top loop does "something" (what?  describe it in words) to two things called "HALL NUM 1" and "HALL NUM 2".  What are these?  What are you trying to do with them?  Are they, perhaps, boolean variables related to a TTL ("pulse") signal?  
  • I wonder if you are driving a 2-bit counter (0, 1, 2, 3, 0, 1, 2, 3, ...).  Can you think how to take the Loop counter ("i") and convert it to 0, 1, 2, 3, 0, ...?  If this represents a Boolean counter, can you think how to convert this Integer into a Boolean array of size 2?  Index 0 would go 0, 1, 0, 1, 0, ... and Index 1 would go 0, 0, 1, 1, 0 ... .
  • You have two loops, and (I'm guessing) you want both to stop when you push a Boolean "Stop" control  [Do you know why "Rectangular Boolean controls" act differently from the oval Boolean controls?  Does "Mechanical Action" mean something to you?  You only need one Stop button, but there are some "tricks" to get this Boolean Control to register an "action" on the second While loop.  This should be discussed somewhere in the Core 1 LabVIEW material (which I haven't looked at in almost two decades ...).

Bob Schor

Message 4 of 4
(86 Views)