NI Home > Community > NI Discussion Forums

LabVIEW

Showing results for 
Search instead for 
Do you mean 
Reply
Member
Rafa06
Posts: 27
0 Kudos

Bounce time

Hi

I am facing the same problem posted 5 years ago at this forum (see link below)

I need to know the exact time (+/- 1 mS) that the relay takes to switch from open to close or vice versa. That means that I need to monitor bouncing time and be able to determine when relay stops bouncing and the time that it takes to stabilizes at its close or open position (switching time). But in my case, I don't want to capture the entire waveform but I want to take instant measurements from the acquired data directly.

thanks

http://forums.ni.com/t5/LabVIEW/read-relay-switching-time-with-scope-tds1002/m-p/591455/highlight/tr...

Proven Zealot
mikeporter
Posts: 5,111
0 Kudos

Re: Bounce time

What do you mean by not wanting to acquire the entire waveform? The best way to do it is to tie the relay input to ground and the output to power through a pullup. Now trigger your acquisition on the signal falling edge. Stop acquisition 300msec later and starting at the end of the data search backwards for the first rising edge.


Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."
Member
Rafa06
Posts: 27
0 Kudos

Re: Bounce time

If I will do like you said how to make my vi able to separate between a single pulse as noise (maybe more) and the bouncing of the signal?

Knight of NI
johnsold
Posts: 10,132
0 Kudos

Re: Bounce time

We cannot answer a question like that without seeing some data.  How much noise do you get? How many times does the contact bounce? Can you tell the difference when you look at a graph of the data?

 

By definition you cannot get instant measurement of relay contact bounce.  This is because you do not know which bounce transition is the last one until "some time" has elapsed and you become convinced that it wll not bounce again.  The best you can do is something like what Mike suggested.  You can use a acquisition duration shorter or longer than the 300 ms he suggested, depending on your knowledge of your relay.

 

Since you want to know the time it takes to open or close as well as bounce, I suggest that you acquire two channels.  One is the control signal to the relay coil.  The second is the contact voltage.  Acquire at a sampling rate of 1 kS/s or faster on each channel so that you get 1 ms timing resolution. Then switching time is the number of samples between the rising (falling) edge of the control signal and the first transition on the contact signal multiplied by the sample period.  The bounce time is found from the indexes of the first and last contact transitions. 

 

Lynn

Member
Rafa06
Posts: 27
0 Kudos

Re: Bounce time

Thank you all for your ansewers,

The photo 'pic1' attached shows real data from an oscilloscope but I don't have a picture that shows the noise, I've drawn an approximative one 'pic2'

Ok then, I will tell my supervisor that we won't be able to get  instant measurement of contact bounce as he was asking me to do, so we have to use the solution that you have proposed.

 

 

Member
Rafa06
Posts: 27
0 Kudos

Re: Bounce time

Hi again

I forgot to mention that the amplitude of the noise can be either positve or negative and can be greater than I've drawn, also if its width is less than 15 msec so the noise is ignored else the product is rejected.

Knight of NI
johnsold
Posts: 10,132
0 Kudos

Re: Bounce time

That data looks very strange.  What kind of relay are you testing? What circuit do you have connected to produce the voltages you show in pic1?

 

Why do you define the end of Toff at 0,8 rather than 0,765?  What causes the "tail" in the voltage between 0,765 and 0,9?

 

What produces the noise that you show in pic2? Can the noise overlap in time with the switching process?

 

Lynn

Member
Rafa06
Posts: 27
0 Kudos

Re: Bounce time

Hi Lynn,

Well I am not testing relays, I am testing  steering column switch module (it contains many contacts) , but since the post that I've found with the same problem is talking about relays I thought It might be the same case.

I have defined the end of Toff at 0,8 because the signal must enter the interval [4.8 , 5.2] when my signal is going up and when it is going to low level it must enter the interval [-0.2 , 0.2]

I don't really know what produces the noise. Yes it can overlap in time with the switching process, if after 5 msec of bouncing a new pulse occurs it will be counted with the bouncing time.

 

 

Knight of NI
johnsold
Posts: 10,132
0 Kudos

Re: Bounce time

How do you actuate the switches? Solenoids? Pneumatic cylinders? If you have an electrical signal which triggers or controls the actuation, you can trigger your acquisition with that signal or use it to "gate" the data around the time when switching actually occurs.

 

I wonder if both the noise and the "tails" are due to poor contacts?  Testing at very low currents might produce results which are different than the switch performance at the actual loads.  Although these days steering column switches probably do not handle lamp currents directly, I suppose.  The noise could also be due to inductive pick up in the wiring, but that seems unlikely in a test setup.  The fact that you get any intermediate voltages (such as the gradual decrease during Ton) makes me wonder if there is something in your test setup which is producing values other than open or closed.

 

Lynn

Member
Rafa06
Posts: 27
0 Kudos

Re: Bounce time

[ Edited ]

After the assemblage of steering column switches, it must be tested using Labview, and the switches will be actuated manually by an operator. The program must do the following steps:

read signal

if the signal starts to drop, I must check if it is a noise or it is going to bounce and than change its status to low level

if it is a noise: I must compare the width with 15 msec, if it is greater than 15 msec ==> the product is rejected else the VI continue reading data

if it is bouncing then I must calculate bounce time and compare it to 50 msec, if it is greater than 50 msec ==> the product is rejected else I must check that after bouncing the signal stays in range [-0.2, 0.2] for 100 msec without any noise if true continue reading else product is rejected

since I am new at labview I think it won't be easy for me to do it but I am trying