Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQ timing

Hello,

 

I'm trying to make a program that uses a switch to change between a low resistior and a high resistor. The object is to detect when a current has changed significantly to change to a different resistor to calculate the current. I'm using LabViiew 8.5 with a NI 9481 to use for the switch and a NI 9205 DAQ to acquire data. 

 

What I have right now is that the voltage signals are passed through some boolean conditions to determine when the switch needs to be turned on and off. During this time I view the data thats coming from the DAQ. With the circuit that I'm measuring, it frequently goes from a high current to a low current causing the switch to turn on and off repeaditly. So I want to be able to turn on the switch and leave it on for a certain amount of time while I still acquire data. I'm not familiar with using time delays within LabView and this has been difficult for me to figure out. I've attached my VI (sorry for it looking like a mess).

 

Could you please offer any suggestions to overcome this problem? 

 

Thanks

0 Kudos
Message 1 of 4
(4,771 Views)

One thing which is often done in such situations is to add some hysteresis to the switching decision-making.  Depending on the values of the two resistors and the effects they may have on the circuit being measured, this might make a substantial difference. 

 

From looking at your VI it is hard to tell exactly what you are trying to do.  It appears that you make the same calculation several times.  Why not just do it once and use the result where needed?  Are the two resistors 5.1 ohms and 10000 ohms?  It appears that your voltage switching points are at 1 mV and 2.5 V.  The ration are different and that may account for some of your repeated switching.

 

I would start by carefully defining the voltages and currents where you want to switch resistors.

 

2.5 V/5.1 ohms = 0.49 A

2.5 V/10000 ohms = 250 uA

1 mV/5.1 ohms = 196 uA

1 mV/10000 ohms = 100 nA

 

If you start with the 5.1 ohm resistor and switch to the 10000 ohm resistor at 1 mV (196 uA), the voltage will jump to 1.96 V, assuming the current stays the same. Going the other direction switching to the smaller resistor at 2.5 V (250 uA) will result in a voltage of 1.275 mV. The resolution of the NI 9205 at +/-10 V is ~0.3 mV and the noise is 0.24 mV rms, so the logic might think it needs to switch back immediately because it may not be able to resolve the difference between 1 mV and 1.275 mV.  How are you switching the resistors? Does the circuit open momentarily while switching? How does the circuit, specifically the current, react to changing the sensing resistance by a factor of nearly 2000? 

 

Lynn

0 Kudos
Message 2 of 4
(4,756 Views)

The program is to test a lock that has a “sleep current” between 14 μA to 60 μA and an “awake current” between 30 mA to 300 mA. This program is to verify that the lock is operating within these limits. There are two things that happen with my current set up.

  1. When a certain button is pressed on the lock, a light turns on. During this time, the current is observed to be fairly constant and thus the switch remains “on” with the 5.1 Ohm resistor being used in parallel with the 10 kOhm resistor.
  2. When a code is being entered in the lock, the switch goes “on” once a button is pressed and then goes “off”. Once the full code is entered, the motor unlocks the lock and the switch turns “on” and “off” frequently. This last about 5 seconds and then the motor runs once again to re-lock the lock. At this point, the switch remains off due to nothing happening.

The default resistor is the 10kOhm and after something happens with the lock then the switch turns on to the 5.1Ohm resistor pathway that is in parallel with the 10kOhm. Since the circuit is using the high resistor initially, when a button is pressed a large amount of voltage is detected due to more current being needed. The way the program is set now, sometimes a warning alarm sounds from the lock before the motor activates due to the lock sensing that there is not enough power. This is most likely due to the lock experiencing conditions with the 10 kOhm resistor.

To get around this “on” and “off” switching after a button or a code is fully entered to the lock, I want to activate the switch and leave it on for a certain period of time. I want to do this so someone can full enter a code and prevent the switch turning “on” and “off” after the motor runs.  

 

Thank you for your help

0 Kudos
Message 3 of 4
(4,740 Views)

It sounds as though the problem may be the response of the lock to the 10 kilohm resistor.

 

I think I would try something like this:

 

Current sense.png

You would need to measure two voltages, across R1 and across R2. In sleep mode the maximum voltage across R2 would be 600 mV so the conduction through two silicon diodes should be low. The diodes must be rated for at least 300 mA. Something like the 1N4001 would be suitable. In awake mode the diodes will conduct and the total voltage across the circuit at 300 mA would be less than 3 V. This might keep the lock from malfunctioning. The "switching" in this circuit is almost instantaneous and is certainly faster than your lock can wake up.

 

Lynn

0 Kudos
Message 4 of 4
(4,729 Views)