LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Voltage vs time acquisiton

Solved!
Go to solution

Hello everyone!

I have a question about acquiring voltage vs time samples with the NI USB 6001 device.

I could easily make a voltage vs time graph with the help of the example program, however the task i would like to complete is a bit more tricky than this.

This is the problem:

I have built a simple circuit to switch a power relay and i would like to examine the lifetime of this relay as I control it with a simple transistor. This is how it looks like:

relayswitch circuit.png

So I am using one of the digital outputs of my NI USB 6001 device to switch the transistor
- I am using an external power supply for the relay.

-I am using one of the AO channels of the DAQ device to lead through some voltage on the relay, which i then measure with one of the AI channels.

The point is that i should measure how much time it takes for the relay to switch.

(Measuring on and off times)

With the voltage vs time graph i can only calculate the switching times by extracting the time values (for example : 10.325-9.432), but i wonder if there is a solution where a function can simply tell if the buffer that contains the voltage samples reaches a certain voltage level (for example 2,5 volts) and then i start another thread with a simple time counter ( Of course it goes vice-versa : When the voltage drops below 2,5 the counter stops and another starts), whose value then i save to a variable. The best solution would be to save the large amount of data to an excel file, where i can work with it.

 

(I also put 1 second delays in between the switchings)

 

Here is how it looks like now:

voltageVStime.png

I would like to know that as time passes if the relay's switching times are getting slower or not.

I am sorry if could not draw up the point, but i hope someone gets the idea and has some useful advices for me.


Thank you in advance!

0 Kudos
Message 1 of 5
(2,915 Views)
Solution
Accepted by topic author Kugelkopf

I could think to a couple solutions but not with the 6001: that board is a very limited one and does not integrate useful capabilities like an analog trigger and 2-edge separator ability.

The first one would trigger your analog acquisition on the analog signal, thus making the work for you. The second one, provided you connect both the transistor control and the relay switch to digital inputs, will give you directly the time between the action and the output.

Given board possibilities, working in post.processing on the analog signal is the best you can obtain. The only improvement could be to acquire in analog both the transistor control signal and the relay contact and calculate the time as the difference between those signals: since the acquisition timebase is constant and reliable, the time difference is proportional to sample indexes difference. This will avoid relying on OS timing that is notoriously not deterministic.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 5
(2,875 Views)

If this is a power relay you are testing, shouldn't you also try to look at the contact lifetime as well at the mechanical movement lifetime? Which can only be done with a simulation of real-life switching: Put on the contacts a proper voltage, current &  a realistic load (possibly highly inductive if you want to be cruel to the contacts by simulating typical loads, e.g. motors or solenoid valves with no flyback diode.

 

With the length of time this is likely to take, I suggest temperature & humidity stable conditions, or at least monitor those parameters.

 

Of course, a single sample may not tell you much. You may need a sample of 5, 10 or even 100 individual relays from different production batches for statistically meaningful results.

 

Message 3 of 5
(2,866 Views)

Thank you for your answer Roberto!
Well, I have been thinking about it, and you were right about the post-processing. The array which cointains the measured values, also has indexes with the measured voltage values, and those indexes represent the time, as i have taken 20000 samples over 20 seconds. Now there is only to find out how to distinguish between the "high" periods and the "low" periods, and extract their index number, which would essentially give back the relay switchtime.

If you have any idea to start, I would appreciate that.

 

0 Kudos
Message 4 of 5
(2,824 Views)

I made a small sample project to measure on-off timinig plotting it on graph, you can find it attached to this message. It's the simplest of all: you may find alternatives that better suit your situation



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 5 of 5
(2,810 Views)