Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

USB 6008 relay switching speed? Delay through software?

Solved!
Go to solution

Hi guys,

 

I have a setup with an USB6008 that controls some relays. However, I am unable to get the relays to switch fast enough. I can see by the USB6008 that the digital output ports have a speed of 150Hz, which equates to 6 ms. I would like to be able to control the relays in 10ms intervals. The relays have a bounce-time of 10ms. So in theory, it should just be possible. However, I am getting some issues in timing. The relay ports are open for way too long, often in the low hundres of miliseconds. This makes me wonder, if there is some sort of delay in turning the relays on or off.. My VI is basically a state machine that in one state turns on the relay and then wait an appropriate amount of milliseconds, then moves to the next state, which turns off the relay. The relay is set by simple true-false bools. Im sorry, but I am unable to share the VI. But it is also more of a theoretical question into the delay that is present when talking to DAQ boxes through USB, I guess.

 

 In NI MAX, where I set up the relay tasks, I can select various "Generation modes". "on-demand" and "hardware timed". How does this affect the speed of the digital outputs?

 

Thank you in advance,

 

Sincerely,

Peter

0 Kudos
Message 1 of 12
(4,672 Views)

Quick follow-up:

 

It seems to me that I am able to switch with milli-second precision, but with an relay on-time no lower than 100ms. That is, when telling the program to keep the relay closed for 1 ms, its closed for 100 ms. This 100ms is constant regardless of what on-time I enter, as long as its lower than about 50ms. When I enter a value of 50ms+x, the relay on-time will be 100ms +x. So I am able to optain ms timing, but not millisecond minimum on-time. 

0 Kudos
Message 2 of 12
(4,663 Views)
Solution
Accepted by topic author pecor

When it comes to software timing, you will not get much accuracy.  But it is sounding like you are using the Next ms Multiple set to 50ms somewhere in your state machine.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 3 of 12
(4,657 Views)
Solution
Accepted by topic author pecor

Are these mechanical relays? If so, there will be a delay between removal of power and opening of the contacts. It will take time for the magnetic field to collapse to release the armature.

Do you have the spec sheets for them?

 

-AK2DM

~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 4 of 12
(4,650 Views)

Hi guys,

 

Thank you for your answers. Im afraid to admit that I missed a 50ms wait that I had implemented in the main loop. That solved almost everything. I am now down to about 50ms. minimal time. I can have a lower on-time, but the steps are unreliable. At about 50ms on-time, the delay error is small enough and the increase in on-time is approximately corresponding to what I tell the program(e.g. a rise of 10ms in "program time" corresponds to about 10ms in actual relay time).

 

Thank you for your inputs, everyone!

0 Kudos
Message 5 of 12
(4,642 Views)

Sounds like a relay live time test 😄

To get the fast as possible switching, wire it like a Wagner hammer .. (self interupting)  and use the analog input for counting...

 

Usually there are other ways to avoid such a relay waste. So why do you want to switch that fast with a relay?

 

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 6 of 12
(4,613 Views)

The use of this setupis to test a products ability to withstand issues/glitches in the power supplied to the unit. 

0 Kudos
Message 7 of 12
(4,607 Views)

You are using a USB 6008 for a product testing??

 

I'm afraid that your relay solution will be far from repeatability....

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 8 of 12
(4,590 Views)

Do you have diode snubbers across the relay coils? They are commonly used to protect the coil driver circuitry but they do slow down the turn off of the coil because they permit the current to continue to flow through the coil until the energy stored in the magnetic field is dissipated in the resistances of the coil and diode. If you want fast switching, you need to do something else with that energy.

 

Most likely this effect is smaller than the timing jitter of the USB-6008.

 

Lynn

Message 9 of 12
(4,579 Views)

@Henrik_Volkers wrote:

You are using a USB 6008 for a product testing??

 

I'm afraid that your relay solution will be far from repeatability....


Why is that?

0 Kudos
Message 10 of 12
(4,567 Views)