LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to create Crankshaft Hall sensor waveform

Solved!
Go to solution

I want to create a waveform with LabVIEW 8.6 and output to oscilloscope via NI PCI-6221, but I don't know how to create.

So I would like to seek you advise and technical support, thank you. The waveform is attached for you reference.

0 Kudos
Message 1 of 14
(6,762 Views)

Hi 855,

 

You could always use the squarewave generator vi. Not sure if it installed on all versions of Labview or is part of a toolkit. I wrote a little VI that might do the job for you, will attach:

 

Crankshaft waveform generator.png

 

 

You can run it in a while loop. It does not pause the application so you can run other tasks in the while loop without any delays. It runs like:

 

Demo VI Snippet.png

 

You just need to ensure that the while loop runs fast enough to provide the square wave you need. Im assuming that it will be running at a fast frequency. The vi has inputs for the low time and high time of the square wave. You can enter a value in Cycles, this will then add the low part of the crankshaft waveform for x amount of seconds, input by the 'Off period' input. The whole thing will then loop. This should be able to replicate the drawing you attached with a bit of playing around.

 

How will you be sending this signal out? you will most probably need to add an interlock to ensure that you only send the data out once per change. This vi constantly outputs a value per iteration, so it can be used with a waveform chart. If you are actually sending a pulse out of a computer you will want to catch the change in value and then just send this once, rather then transmitting every iteration. If this is what you are after and you are stuck on doing it i can modify the vi for you, no probs. Cant garauntee when though.

 

Have attached a folder, should have everything you need. Is in LV 2009 and LV 8.6

------------------------------------------------------------------------------------------------------
"Everything should be made as simple as possible but no simpler"
0 Kudos
Message 2 of 14
(6,732 Views)

Hi Again,

 

Just thought, i should of added a bit of logic that said if you input 0 for number of cycles the square wave runs indefinately without adding the low period. If you do need to have a square wave without the low period just make the 'Off period' the same value as your 'Low Cycle', this will do the same.

 

Rgs,

 

Lucither

------------------------------------------------------------------------------------------------------
"Everything should be made as simple as possible but no simpler"
0 Kudos
Message 3 of 14
(6,731 Views)

You need the very known 60-2 or 36-1 signal. Having seen your jpg, I assume the first.

 

I would fill a 1D array Boolean (true/false) with 120 elements, 101000001010101010.....

Then programming->Array->rotate 1D-array.

Put this in a separate loop, you can adjust the frequency by timing it.

 

 

Maybe some waveform generations look better, but you will need a workaround to delete that 2 pulses,

needing a counter, case stucture,...

 

 

Message Edited by ST5 on 03-22-2010 11:14 AM
0 Kudos
Message 4 of 14
(6,725 Views)
and here's the vi
0 Kudos
Message 5 of 14
(6,713 Views)

Dear Lucither

 

Thank you for your prompt reply and help. But my LaVIEW8.6 can't open version9.0's file.

My 8.6 just can open the file (Demo VI.vi). After opening the file that the program can't running and appear some error.

I am so sorry, I just a novice respect to LabVIEW. I don't know why the program can't running. The situation of error has been attached for your reference, could you help me again?

0 Kudos
Message 6 of 14
(6,664 Views)

Hi,

 

Have just taken a look and all appears to be good this end. I am just on my way out to work, will take a look at this tonight for you when i get back.

 

 

Lucither

Message Edited by Lucither on 03-24-2010 06:31 PM
------------------------------------------------------------------------------------------------------
"Everything should be made as simple as possible but no simpler"
0 Kudos
Message 7 of 14
(6,645 Views)
Dear Lucither Hi Lucither, How are you? Thank you for your previous help. Unfortunately, the problem has not been solved yet; the waveform can’t still run in my Lab view 8.6. I tried my best for two months already but not success. Presently, I just can made a simple square waveform that voltage values are max 5v and min 0v, 50% duty cycle, and the frequency is adjustable. However, I can’t make two 0v (missing) in every sixty 5v. So I would like to seek your help again. Could you help me and teach me how to make it, just make a two 0v (missing) in a simple square waveform, please! please! please! The waveform I made is attached for your reference.  

Regards

 

Kin
0 Kudos
Message 8 of 14
(6,474 Views)

Hi 855,

 

Try this version

 

If it does not work again let me know and i will look into doing it another way.

 

Rgs,

 

Lucither

Message Edited by Lucither on 05-05-2010 07:37 AM
Message Edited by Lucither on 05-05-2010 07:38 AM
------------------------------------------------------------------------------------------------------
"Everything should be made as simple as possible but no simpler"
0 Kudos
Message 9 of 14
(6,452 Views)

Hi 855,

 

You might also want to have a look at ST5's solution. He actually had a better idea of what you wanted as he knew what a crankshaft was. Mine was more generic, it allows you to build what you want but his is very specific to your cause. Seems a really neat way of doing it. If you need to alter the amplitude just add a multiply function to the integer comeing from the boolean to number function.

 

Rgs,

 

Lucither

------------------------------------------------------------------------------------------------------
"Everything should be made as simple as possible but no simpler"
0 Kudos
Message 10 of 14
(6,443 Views)