High-Speed Digitizers

cancel
Showing results for 
Search instead for 
Did you mean: 

Acquire shaft encoder signal using USB-5133

My USB-5133 is hooked up to 2 signals - Channel 0 to crank angle signal of a shaft encoder (360 pulse-per-revolution) and Channel 1 to cylinder pressure of a research engine.  I think both signals are analogue (as voltage).

 

The engine runs at an average speed of 1,000 rpm.  For my project work, I need to record the time period between each crank angle.  At present, I have an incomplete VI that records crank angle and cylinder pressure signals.  I would like to improve the attached VI to incorporate the time period of each crank angle.  I used NI-Scope SFP and was able to measure the period (as shown in the attached screen shot) but not able to record it.

 

In addition, I would like to find out how do I acquire the sample correctly if the duration is approximately 120 ms?

 

Your help will be much appreciated!

Download All
0 Kudos
Message 1 of 9
(9,567 Views)

Hi!

 

I am hoping that someone out there could take a look at my VI and give me some good advices.

Attached is a much simplified VI.  I am trying to acquire the crank angle signal and cylinder pressure of a research engine.  But I was not able to collect an entire set of data.  I need to record data for a duration of at least 120 ms.

 

The engine runs at an average speed of 1,000 rpm.  And the optical shaft encoder has a 360 pulse-per-revolution (ppr) resolution.  This means the average time between each crank angle is 1/6000 s or 6 kHz.  Minimally, I need to record data for 720 crank angle degrees which equates to 120 ms.

 

Your help will be much appreciated!

0 Kudos
Message 2 of 9
(9,549 Views)

Hello shefsteely,

 

I believe we have been working on this via email support and I wanted to post our progress with this in case another user needs a starting point for a similar situation.

Attached is the code for achieving to log the AI channel (1), the shaft encoder channel (0), and the period for every pulse off the encoder.

We will continue working on this together and post back here with further progress.

 

For the rest of our users, I hope this helps!

Kind Regards,

Michael S.
Applications Engineer
NI UK & Ireland

0 Kudos
Message 3 of 9
(9,502 Views)

Oops!

Apologies, I forgot to attach the code!

 

Kind Regards,

Michael S.
Applications Engineer
NI UK & Ireland

0 Kudos
Message 4 of 9
(9,459 Views)

That is very thoughtful of you!

Thanks for all your help!

0 Kudos
Message 5 of 9
(9,457 Views)

Hi!

 

I couldn't debug the VI to get it working correctly.  Therefore, I have to fall back on the simple VI to record raw signal.  As you know, I used TDC (top-dead-centre) signal as the trigger (PFI1), rightfully it should record data either at start of power stroke (peak pressure) or exhaust (no pressure).  But the plots (see attached figures) show that the recording is consistently offset (delay or lag?) by 90 or 270 crank angle degrees.

 

Is this due to a fixed offset or delay of the acquisition or recording of the high speed digitizer?

 

Your reply will be much appreciated!

Download All
0 Kudos
Message 6 of 9
(9,448 Views)

Hi shefsteely,

 

I just wanted to close out this forum for other members. I know you also called in to the office and it was determined you were seeing the offset due to the fact that you had a reference trigger setup for 50% of the acquisition. When this trigger was removed the signal was acquired at the correct point each time.

 

Regards
JamesC
NIUK and Ireland

It only takes a second to rate an answer 🙂

Message 7 of 9
(9,335 Views)

Can I re-open this forum? I'm afraid if I try to ask this as a new question I'll just get referred back to this anyway without an additional answer, which won't help any.

I'm also trying to use the PFI line on a NI-5133 as a trigger, but when I try using it as the trigger source into niScope Configure Trigger Edge, it tells me I can only use channels 0 or 1. I saw that you didn't use this function in your solution, triggering using a different method; can this be used for a program that triggers multiple times?
I want to collect data that requires the scope to use the maximum sampling rate but need to sample over several seconds (a ton of data, I know), and so obviously I can't just tell the scope to take measurements over the whole duration. Instead I want to trigger it from an external source that will occur at roughly 1kHz; so I would need the sampling to stop after a certain time (which I can do with the timing control) but I will need the trigger to reset, have a 100microsecond holdoff to be certain that the entire signal has passed so it doesn't trigger again off of one pulse, and be then available again to trigger another measurement. I need to make measurements from two lines at each trigger, which means that channels 0 and 1 are taken.
Will the method for triggering shown in the solution presented here work for this application? If so, how can I force the 0.1ms holdoff and be sure that trigger status doesn't remain 'high?' Why does my NI5133 think the PFI isn't a valid channel in the first place??
I've attached the simple VI I've built to test this, just in case there's some other silly mistake in there that is somehow making the trigger not believe in the existence of the PFI.

Thank you,

Wolley

0 Kudos
Message 8 of 9
(7,606 Views)

Wolley,

I'll help you for sure, but it almost always is better to start a new forum post, because its much more visible.  Since you've been doing the research, you can prevent people from just pointing you here by posting the link in your question stating you already looked here and had additional questions.  

 

So, to answer your question, in your code you setup an "Analog Edge Reference Trigger", and this type of trigger can only be used on your CH0 and CH1 lines.  From your description, you are wanting to trigger on a digital pulse/edge.  PFI lines only support digital Edge triggering, so you can't route an analog signal through your PFI line and expect to do window triggering or something more complex like that.  

 

Also, for preventing the recognition of a trigger for an amount of time, you would use the "Trigger Holdoff" attribute.  Unfortunately that attribute isn't supported on the NI 5133, so it causes the acquisition to error.  If you have control of the trigger pulses, you could not send a trigger for the constraints that you have.  

 

I hope this helps.  If you need further help, please don't post your questions here, but in a new thread, and leave a link here to your new thread.

Thanks,

Systems Engineer
SISU
Message 9 of 9
(7,582 Views)