The case of the hidden inversion

Josh is setting up a behavioral experiment where the subject has to press a button as part of their response during the experiment. He was writing some code in Matlab to drive his experiment hardware and called me over. “I have a problem. My button gives output high when not touched and output low when closed (touched). The software is expecting that the input is low when open (not touching switch) and high when the subject touches the switch. How do you get this to work, I know Churly’s rig has the same button and the software works with it.”

Image

I wasn’t very familiar with touch buttons, but I remembered helping Churly out with an experiment and I thought I recalled his switch was active-high, that is, when the subject touched the button the voltage went high. We went to investigate and discovered that, indeed, Churly’s switch behaved as if it were active high. But it was the same model as Josh’s switch. So, somewhere, the signal was being inverted.

We traced the connections to Churly’s rig. (I should mention here one of the cardinal rules of experimental setups: if you leave, other scientists can and will steal parts from your rig to repair/build their own. Churly left the lab about a week or so ago, and his rig is already showing signs of being cannibalized.) Anyhow, after tracing the crows nest of wires  that is standard for experimental rigs we became very puzzled.

The circuit was hooked up as follows:

Image

The BNC coax plug went into a National Instruments breakout box.

After a little thought we decided that the only way this could work was if the two grounds (C, the power supply ground/negative and B, the Coax/system ground ) were isolated from each other. Churly was using a separate power supply for the switch, but it was a cheap looking one and nothing on the faceplate said ‘Isolated supply’, which is something you advertize, since it is expensive to build one.

We went in with a multimeter and started to poke around. Our hypothesis was that the power supply ground (C) was floating with respect to the system ground (B) and so, since A and B were tied together through a resistor, C would be at -10V with respect to the rest of the world. We stuck one end of the voltmeter in C and the other end on another BNC plug shield on the NI break out box. No voltage difference.

This was very vexing, but fit with our intuition that this was a cheap ass power supply and everything was tied to ground. Now that our leading hypothesis was discarded we were left free in the wind. We started to measure voltages across random pairs of points in the circuit. Nothing of interest happened until we put our voltmeter across the BNC shield (B) and the power supply ground (C). 9.6 V. WHAT!??

We pressed the switch. The voltage went to 0V. We started to putter around some more.We had already measured the voltage across the system ground and (C) before, or so we thought. Just to make sure, we went through each BNC shield terminal and measured the voltage with respect to C. All 0V. Really!?

It turns out that that particular input on the NI break out box was configured as differential. Now, we knew about differential modes. What we expected was that the differential signal pair was the central signal lines of the paired BNC channels.

What we learned new was that when you switch a pair of inputs to differential mode, the National Instruments BNC breakout board ties the shield of the BNC input to the reference input, thereby decoupling it from the system ground (and the other BNC shield terminals) which is what threw us off at the start.

I had expected that, in differential mode, the shields would still remain attached to system ground, and you would introduce the signal and reference through the ‘signal’ wires (the center conductors). I’m still not sure about the wisdom of passing the reference signal through the shield of the BNC cable since the frequency characteristics of the shield are different from that of the core, but perhaps this is only significant way beyond the digitizing bandwidth of the cards and is therefore irrelevant.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s