07-12-2011 09:08 AM
Hi,
I am a beginner labview user, I have access to three modules, two NI9201 and one NI9401.
I have an angular encoder that is used to measure the angular position of a motors crankshaft, what I'm trying to do is use the encoder to trigger a digital out (spark event in the engine) at a certain angular position. For example, I would like to trigger at top dead center (or 0 degrees on the encoder), then I want to be able to change this to +5 degrees on the encoder, etc.
So far I am able to read in the angular encoder when the motor is running, I am also able to output digital out signals although I can't find a way to link the two together.
If anyone has any idea how to do this, it would be greatly appreciated, I have attached my VI.
Thanks in advance,
Nick
Solved! Go to Solution.
07-12-2011 09:54 AM
Can you save your current VI for a previous version? (i.e. 8.5)
I can't open your VI with v 8.5.
Thanks,
Bill
07-12-2011 09:58 AM
Hi Bill,
Here's the earlier version (8.5).
Nick
07-12-2011 10:47 AM
Hi Nick,
I hope the attached vi will get you on track. It's just a general concept.
The while loop will run until you hit the stop button.
I take it you will need one spark per revoultion.
This VI is really just an If/Then
If the encoder value is equal to (in this example ) zero,
Then trigger the digital output.
I know I have a broken wire, but I didn't know how to get the angular position from you DAQmx.
Let me know if this help. (Also let me know if I'm off target)
Good luck,
Bill
07-12-2011 12:08 PM
Hi Bill,
Yes the concept you provided was exactly what I needed to do, it all seems easier now that I've seen it.
So I have implemented the concept and got a working function, now I am wondering if there's any way to do it faster. I am trying to trigger the spark for the engine and the fact that I have to stop tasks every spark iteration slows my sampling down tremendously. If there's any way you know that can do this without start/stop task blocks I would be very interested.
Thanks Again for the help,
Nick
07-12-2011 12:25 PM
I'm not that familiar with start/stop tasks.
Can you place the start and dtop outside of the while loop?
For example, start your task before the loop and stop after you exit the loop?
Bill
07-12-2011 12:32 PM