From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

RPM to Position

Your "Simulate Signal" vi hangs up your code for 1 second, so don't expect to be able to do something at msec level.

What is it exactly that you want to do?

 

You could use a triggerd acquisition so that your acquisition starts when the pulse comes up.

By just taking one sample at a sample rate of 1000S/s you already have a 1 msec delay.

 

 

So please elaborate a bit on what you exactly want to do every x msec after a pulse shows up.

0 Kudos
Message 11 of 22
(703 Views)

I would like to do two things.

 

1) I  would like to measure the RPM of my analog signal.

 

2) I would like to measure the position of my shaft from my analog signal.

 

3)  Once the position is known, this needs to trigger a separate VI to turn on a pulse at a certain angle every cycle, and turn it off after a certain angle every cycle.

 

1 and 2 is what i'm working on now.

0 Kudos
Message 12 of 22
(701 Views)

@kramerfrog wrote:

labview can sample things at 100khz...i don''t think this should be a problem. 


That all happens in HARDWARE!!!!!!

 

The software waits until the requested number of samples are acquired and then process the received data while the card starts a new acquisition, if it was a continous acquisition.

Assume you asked 100kHz sampling rate and requested 10.000 samples, that means that every 10msec a new bunch af data is available from the card.

If your code needs more than 10 msec to process the data you will end up with a problem!

0 Kudos
Message 13 of 22
(696 Views)

@kramerfrog wrote:

2) I would like to measure the position of my shaft from my analog signal.


Please don't say that again because you can't measure the position of the shaft, just calculate the position based on a time controlled loop and previously calculated speed of the shaft.

You have a 5V pulse signal every rotation, right?

Why don't you use that as a digital signal?

Did you look at the examples?

I think the "Read Dig Chan-Change Detection.vi" or "Cont Acq&Graph Voltage-Analog SW Trigger.vi" are good places to start to capture every single pulse of you shaft.

Once you're code can do that, you can think on further processing.

0 Kudos
Message 14 of 22
(687 Views)
did you even look at my code? i already pulled out the RPM from the signal.
0 Kudos
Message 15 of 22
(682 Views)

Yes I did but since you're "Generate Signal" holds your code for one second you can't do what you want with that code, except caculating the speed.

 

So, I suggested more suited code from the LV help you could use as a start.

 

An even better solution would be to place 2 notches on the shaft or use 2 proximity switches instead of one to trigger your new code.

Then you can use a triggered acquisition. Your code is always waiting from triggers coming from the hardware.

But of course I don't know if this is possible or not.

 

If you can't change the shaft and/or add switches, you better have a look at triggered acquisitions as I mentioned earlier.

I think your first step should be to try out those vi's so that each pulse from the shaft is detected at all times.

0 Kudos
Message 16 of 22
(678 Views)

yes, i did look at that.  it still requires the user to define sample and sample rate though...i don't see how it gets around the problem.

0 Kudos
Message 17 of 22
(674 Views)

With the 2 vi's I suggested you move the pulse detection from the software to the hardware.

The hardware is way faster than any code.

The software is doing nothing unless it's triggered from the hardware.

 

Sample rate depends on the application, so you have to set up the sample rate according to it.

0 Kudos
Message 18 of 22
(669 Views)

Well with one pulse per revolution you can measure the RPM 

Now you have an other event (have you?)  and want to find out at what position??

 

What exactly do you want to measure?

 

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 19 of 22
(660 Views)

Duplicate post.

 

http://forums.ni.com/t5/LabVIEW/quot-relative-quot-real-time/td-p/1667352

 

You still have people responding to your other post.  Why the second thread?

 

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
0 Kudos
Message 20 of 22
(651 Views)