Log in

View Full Version : Photoeye's not working-Difference between RoboRIO and Digital Side Card?


tr6scott
25-01-2015, 11:01
We have been using the Banner DS18VN6LP photoeyes for a few years now, and absolutely love them, the packaging, the polarized light, the multiple mounting options.

http://www.bannerengineering.com/en-US/support/partref/17406#wiring

The DSC and roboRio have pull up resistors, so when nothing is wired, all inputs read TRUE, high value. When you want to get a signal, you need to short the signal pin of the PWM to ground.

On the DSC, these sensors worked find when powered from the 12v PDP, and were NPN so would short the signal to the negative of the battery.

Yesterday we stripped two bots of controls and were testing the sensors pulled off to put back into stock for this year on the roboRio.

We were powering them from the VRM 12V 2A connectors, and all of these Banner sensors tested bad, they would not read changing states on the roboRIO.

We also had some Allen-Bradely units similar to the logomotion line following sensors, but in a different tubular packaging that worked fine.

I fine it really odd that all of the banner sensors tested bad, so I do not have faith in the test.

So now I am thinking maybe the VRM has some circuitry that may isolated the ground being shorted by the sensor?

I did not think to test sensors when powered from a PDP channel.

Any hardware guys can explain what is going on, or what power source I should be used to power the sensors so the RoboRIO can sense the ground state?

Jared
25-01-2015, 11:36
I'll bet that the 12 volt supply on the VRM is isolated for some reason.

We've always powered our yellow banner sensors straight from the PDB with no regulator, and we've never had any issues. You may want to try this.

ozrien
25-01-2015, 12:29
The VRM is not isolated. If you measure the voltage difference between the VRM ground and the Rio ground you should find it to be very close to zero .

Measure the light sensors input voltage to confirm its powered properly. Then measure the signal voltage to see why the readings from the Rio don't match your expectations. That might reveal what's going on.

Lightfoot26
25-01-2015, 12:57
You are not alone! We were testing our banners on the new control system and experienced the exact same thing! The similar Allen-Bradley sensors that came in the KOP in 2012 worked fine! I did find (and this is a weird observation that may or may not have anything to do with the problem) when I probed for continuity across the signal line at the roboRIO while it was plugged in, and the negative terminal the sensor was plugged into at the PDP, the sensor began functioning properly both on the meter and in code. Weird I know, but it was something I noticed.

tr6scott
25-01-2015, 13:37
Omar,

Is the power supply leg to the roboRio isolated ground?
Seeing there is another team having issues with Banner sensors, I am going to and wire the sensor power from the same source as the roboRio power and test on Tuesday.

I could also drop one of these sensors off to you for testing Monday on my way home from work.

Scott.

Al Skierkiewicz
25-01-2015, 15:43
I did find when I probed for continuity across the signal line at the roboRIO while it was plugged in, and the negative terminal the sensor was plugged into at the PDP, the sensor began functioning properly both on the meter and in code. Weird I know, but it was something I noticed.
Seth,
Can you tell us which meter you were using and I am guessing you were in continuity mode and not resistance mode? It is possible that there is a component in series with the negative lead on one or more of the control components. Your meter might have reduced the impedance sufficiently to allow the sensor to turn on. Depending on the component and the series impedance, it is possible that the sensors are not receiving sufficient power supply to operate. As I remember, the Banner sensors require a specific power supply voltage.

Alan Anderson
25-01-2015, 17:06
We plan to use Banner sensors this year. I had expected to use the VRM's 12 volt supply to power them. Testing them on our robot-in-progress is now high on my to-do list for our next work session on Tuesday.

Lightfoot26
25-01-2015, 17:19
Seth,
Can you tell us which meter you were using and I am guessing you were in continuity mode and not resistance mode? It is possible that there is a component in series with the negative lead on one or more of the control components. Your meter might have reduced the impedance sufficiently to allow the sensor to turn on. Depending on the component and the series impedance, it is possible that the sensors are not receiving sufficient power supply to operate. As I remember, the Banner sensors require a specific power supply voltage.

Al, I guessed that some circuitry internal to the meter was affecting my results but I couldn't quite put my finger on it. I was in continuity mode and I believe it was on one of our Extech MN35's (I am away from the shop and can't confirm this, but I am fairly confident that's the meter we used). It was very odd, but the sensor functioned perfectly with the meter in place and operated as Scott described in the original post when the meter wasn't being used. If it helps, the working Allen-Bradley sensors are the 42EF-D1MNAK-A2 and the Banners we tested were the QS30LV.

Al Skierkiewicz
26-01-2015, 08:52
Seth,
That meter, as most modern meters, apply a current to the probes when in the "diode" mode and then measure the voltage drop directly. In a normal diode or transistor junction, the meter would read 0.7v. The specs say that the current in this meter is limited to 1 ma when in the diode mode.
I have to ask, was the "ON" indicator on the sensor illuminated and the output was not sensed by the roboRio? The RoboRio has a 40k pullup resistor to 3.3 volts which may not be enough to pas current through the Banner sensor.

tr6scott
26-01-2015, 20:51
Did some more extensive testing tonight during our meeting.

The Working AB Part number was
42CA-P2MNB-A2

Another non-functioning Banner sensor was QS30LV

We also found the following Banner Switches to also work.
T18SN6FF50

T30SN6FF400

I tested with the sensors connected to the both the 12v 2a power rail, and also wired direct to the same power leads as the roboRIO without any impact on working state.

Both non-working Banner part numbers status lights work as expected, and I tested multiple sensors of each type, Power indicator works, and sensor tripped worked, just would not fire the roborio input.

crake
26-01-2015, 22:04
Questions:

- What are the properties of the Banner sensor? What clues does the sensor datasheet give you?
- What is the pull up/down configuration of the roboRIO for that particular DIO line? Hint, pg 15 of the user manual - or look above :)
- What does this circuit look like when "on"? "off"?
- Will this work?
- If not, how can you change the circuit to make this work?

Extra bonus

- Why did hooking up a multimeter make this work?

tr6scott
27-01-2015, 06:14
I guess it is no longer accepted to ask "Any hardware guys can explain what is going on, or what power source I should be used to power the sensors so the RoboRIO can sense the ground state?"

If you are not going to explain what is happening, could you at least give some links on where I could go to find the answer?

I'm just trying to figure out if I have spend another $600 on sensors that work with the roboRIO, so we have a functioning bot is the near future.

From your post, you obviously believe there is some way to make these sensors work with the roborio, yet I am no closer to finding that answer.

tr6scott
27-01-2015, 06:27
Looks like the roborio has 40kOhms to 3.3v pull ups, while the DSC has 10kOhms to 5v pull up.

tr6scott
27-01-2015, 06:37
Sensor Cut Sheets, DS18 non-working, T18 working.

FrankJ
27-01-2015, 08:17
We have not got this far yet so I really have not tested anything. But. The RoboRIO is actually 3.3V (5V compatable) (If I understand what the NI guys said.)& the side car was 5V? Assuming you are not seeing the 0V state, maybe the Banner is not pulling the pin low enough?

Looking at the RoboRIO specification Low state is 0.0 V to 0.8 V. On state for the DS18 is <1.8 volts. So it working looks iffy. On state for the T18 is <1V The RoboRIO spec (https://decibel.ni.com/content/docs/DOC-30419) is on the NI web site.

Although looking at the NI 9403 (CRio DIO module) it has the same 0.8V max for V low Maybe it is more forgiving?

Alan Anderson
27-01-2015, 08:20
Sensor Cut Sheets, DS18 non-working, T18 working.

The suspicious difference I see is the "ON-state saturation voltage".
DS18: < 1.6V @ 100 mA
T18: < 1V at 10 mA dc, < 1.5V at 100 mA dc

Perhaps the roboRIO input's logic 0 threshhold is too low for the DS18 to satisfy without assistance. When I get to the workshop on Wednesday I plan to do some experimentation.

tr6scott
27-01-2015, 09:06
Thanks Guys, the delivery on the AB ones are 2/16 from the factory...

crake
27-01-2015, 09:17
Forgive me, I was channeling my physics professor there for a moment. He never told me the answer directly (team 900, am I right?)

There are a couple of differences between myRIO and cRIO.

myRIO DIO (for the most part - there are exceptions with DIO14 and DIO15 which are 2.2k to 3.3V) have 40k pull up to 3.3V

cRIO DIO with side car has a 10k pull up to 5V AND a weak >20k pull DOWN (internal to an ASIC on the NI 9403 module).

This means that the roboRIO has a far weaker pull up than the cRIO w/side car.

From the datasheets it isn't entirely clear to me how they have NPN circuit configured, but I suspect that if you had a strong pull up your sensor will start working. I agree that the differences in saturation voltages is a strong candidate as to why some sensors work with roboRIO as-configured while others don't.

Anyway, try placing a nice strong pull-up on DIO to 3.3V (say, 1k).

tr6scott
27-01-2015, 09:25
For the record, I was testing with DIO6 on the base interface, aka NOT MXP connector.

Thanks for the help.

Al Skierkiewicz
27-01-2015, 09:31
Chris,
I would suggest the same thing, although I think I would start with 10k to limit current. However, I am still trying to analyze why a meter, testing continuity, between two common points should make this work. The lights on the sensor indicate that switching is taking place. I would expect that the output of the Banner sensor is a photo transistor that includes a series resistor for over current protection. However, simply connecting a meter seems to indicate that the power common wiring is not as low impedance as one would expect. I would suggest someone with a scope actually check the operation of the sensor and report your findings.

tr6scott
27-01-2015, 10:00
Al, I don't have access to a scope.
Seeing I don't completely understand the circuitry of the sensor, or the roboRio, Let me state what I think I am to do to test.

Wire a resistor (1k, 10k) from the 3.3v+ which looks to be available on the MXP port pin 33, to the signal line of DIO6, along with the sensor output. Sensor still being powered from the 12v 2a rail of the VRM.

Did I follow that right?

ozrien
27-01-2015, 10:06
I tested using a QS30LV banner sensor on the roboRIO, powering it directly from the PDP, and then later with the VRM. I got the same negative results with each.

Again, the VRM is not isolated.

My banner sensor pulls the digital input rail on the RIO (from it's typical 3.3V) to 0.7V when in the "off" state [not ok]. Reading the banner sensor datasheet, I see it's "off" current is "<200uA". Reading the RIO user manual, the internal pullup in the RIO is 40Kohm. This suggests the sensor pulls about 65uA. (3.3V - 0.065mA X 40K = 0.7 V). This also matches the sensor data sheet (<200uA).

We want the voltage on the RIO digital input at least be above 2V when the sensor is "off". This is the minimum input high threshold of the RIO input. Otherwise we will always get a logic low [not ok] regardless of the beam breaking/or complete.

So... I added a 1K pullup from sensor ouput to the VRM's 5V rail. A 1K pullup to 5V along with the internal 40K pullup to 3.3V thevenizes to 4.958V with 0.975K impedence.
The roboRIO digital input rail only drops to 4.9V (really nothing at all). This follows assuming the sensor drew about 65uA in the off state.

This sounds like a simple case of checking the current leakage of your sensor against the strength of the pullup. Those sensors Scott mentioned that work have an "off" current of "<1uA" according to their data sheets.

Since the cRIO had a 10K pullup to 5V, and ~20K pulldown to ground, that thevenizes to 6.6K pullup to 3.3V. That means the roboRIO digital inputs (0 through 13) have weaker pullups, so having to add an external pullup makes sense to me, even if it is a little annoying :)

If that's a problem then read the datasheet of your sensors before purchasing. Or just buy some resistors. :)

I don't understand the poster who connected a continuity meter between sensor output and ground. Why would you do this? This is not a useful test. Also why was the system powered while doing continuity checks? Yes continuity adds current into the system. Probably was enough to makeup for the weak pull, hence the sensor started working. That's not a useful clue, especially when we have datasheets that tell us the impedances of all of our components.

FrankJ
27-01-2015, 10:13
So with the sensor connected, is the RobRIO reading true or false? (low volts or high volts?)

ozrien
27-01-2015, 10:19
My observation is low volts. (0.7V) even when the open-collector output of the banner sensor is "high-z" (off).

FrankJ
27-01-2015, 11:00
My observation is low volts. (0.7V) even when the open-collector output of the banner sensor is "high-z" (off).

Thanks. Makes sense. For some reason i didn't see your earlier post when I asked.

tr6scott
27-01-2015, 11:06
If that's a problem then read the datasheet of your sensors before purchasing. Or just buy some resistors. :)


Omar, Thanks for the write up and the investigation work.

I see this as a Chicken and a egg problem...
I purchased these sensors over 4 years ago, and have used them on every bot since then... How was I to check it against the roboRIO specs?

Seems to me the hardware design team on the roboRIO missed the mark, by not providing the same sensor interface we had on the cRio. I mean backward compatibility to existing sensor base would have been as easy as selecting a different resistor?

Al Skierkiewicz
27-01-2015, 11:31
Omar,
The continuity test was between the 0v terminal on the VRM and 0v terminal on the Roborio (my interpretation). While continuity necessarily provides a voltage, it really didn't make a lot of sense as to why this actually worked. The OP also stated he was using the NPN output of the Banner sensor which is an active low when sensed. My suspicion to this point is again the very low current provided by the 40k pullup. I would not, however, recommend a pull up to 5 volts in parallel with the internal pullup to 3.3 volts. That would tie both supplies together and would draw current dependent on the state of the input as connected. I was suggesting that a 10k resistor be used as an additional pullup to the 3.3 volt buss. The 10k (in parallel with 40k) to 3.3v would produce near the current of a single 10k in a 5 volt pullup. Certainly something between 1k and 10k should work.

Alan Anderson
27-01-2015, 11:32
Seems to me the hardware design team on the roboRIO missed the mark, by not providing the same sensor interface we had on the cRio. I mean backward compatibility to existing sensor base would have been as easy as selecting a different resistor?

It wouldn't quite have been that easy. The 3.3v input port would have changed things regardless of the pullup value chosen.

For this specific situation, we're fortunate. It takes very little effort to add an appropriate pullup resistor to the roboRIO end of the cable.

Alan Anderson
27-01-2015, 11:39
I would not, however, recommend a pull up to 5 volts in parallel with the internal pullup to 3.3 volts. That would tie both supplies together and would draw current dependent on the state of the input as connected.

I doubt 50 microamps between the 3.3v and 5v supplies is something to be worried about. Not knowing the detailed architecture of the supplies makes me less confident about that than I could be, though.

Al Skierkiewicz
27-01-2015, 11:43
Alan,
You know me, I work on failure mode and tying two different power supplies together is not something I recommend. A miswire or bad insulation job forces the two supplies together with some unknown consequences. I would suspect that the 5 volt supply might take out the RoboRio through over voltage on the 3.3 volt buss.

ozrien
27-01-2015, 11:45
Omar,
The continuity test was between the 0v terminal on the VRM and 0v terminal on the Roborio (my interpretation)...

I read it different...

when I probed for continuity across the signal line at the roboRIO while it was plugged in, and the negative terminal the sensor was plugged into at the PDP.

...but at any rate, I'm convinced we've root-caused the banner sensor.

Having 5V ---- 1K ----- rio dig in / sensor output -----40K -----3.3V seemed harmless to me when I was testing. That's 41K between the two supplies regardless of sensor output. When sensor low-side drives, it sinks 5mA from 5V rail and 82.5uA from 3.3. My VRM can handle 5mA and the RIO's internal can handle 82uA. Sensor can handle sinking 5.0825 mA.

adciv
27-01-2015, 11:48
From (alpha/beta) testing, 5V will not damage the 3.3v rail. From what I recall, all pins were tested against a lead acid battery.

tr6scott
27-01-2015, 12:03
Thanks guys, learning some more, so now looking the roboRIO diagram some more, is it wrong to just tie a 10kOhm-1KOhm resistor between the 3.3v of the DIO to the white of the DIO?

Isn't that the same solution and keeps the "custom circuit" on the end of the sensor pwm.

Then the next question is this a "legal" custom circuit, with regards to the rules.

ozrien
27-01-2015, 12:23
If that sensor has a max off current of 200uA (well <200uA but to be conservative) like the datasheet suggests then 10K X 0.2mA => a drop of 2V across the pullup. That means 3.3V - 2V = 1.3V at the input, that's not high enough (RIO needs at least 2V).

So I guess the biggest pullup would be 1.3V-drop @ 0.2mA => 6.5Kohm.
So anything less then 6.5Kohm should be good enough. And if not measure the voltage at the signal side of the pullup and see what's up.

Technically the 40K is still in-circuit so really the pullup would be (6.5K || 40K), so 6.5K is probably a good conservative threshold.

billbo911
27-01-2015, 12:31
.... I would not, however, recommend a pull up to 5 volts in parallel with the internal pullup to 3.3 volts. That would tie both supplies together and would draw current dependent on the state of the input as connected. I was suggesting that a 10k resistor be used as an additional pullup to the 3.3 volt buss. The 10k (in parallel with 40k) to 3.3v would produce near the current of a single 10k in a 5 volt pullup. Certainly something between 1k and 10k should work.

My concern and thoughts exactly!

I understand that connecting them together in this manner may not have caused a problem, yet. I doubt it would IF everything is built and valued correctly either. That said, why risk it?
Additionally, bridging them together with resistors will eat a small amount of available current from the +5vcd supply that would otherwise be available for other circuits. Granted this value is very small, but it is wasted none the less.
Adding a 1K-10K pull-up between the DIO pin(s) and +3.3vdc is just as easy as adding it to the +5vdc supply. So, why not just connect it to the +3.3vdc?

BTW, Thank you to everyone who has caught this and contributed to finding a solution this early!
New control systems will always have their quarks and nuances. Finding them and figuring out how to deal with them is vital to making them a success!

RufflesRidge
27-01-2015, 12:36
Adding a 1K-10K pull-up between the DIO pin(s) and +3.3vdc is just as easy as adding it to the +5vdc supply. So, why not just connect it to the +3.3vdc?


Because it's not just as easy? 5V is right there on the 3 pin DIO header, 3.3V is not.

billbo911
27-01-2015, 12:54
Because it's not just as easy? 5V is right there on the 3 pin DIO header, 3.3V is not.

It is if you connect to the MXP header with a passive breakout like the REV Protoboard (http://firstchoicebyandymark.com/fc15-029) as was available on FIRST Choice.

It is as simple as soldering the resistor to the correct supply rail. +5vdc or +3.3vdc, it's your call.

cgmv123
27-01-2015, 12:56
Then the next question is this a "legal" custom circuit, with regards to the rules.

Let's look at the rules:

R8 and R30 say CUSTOM CIRCUIT voltages can't exceed 24 volts. That won't happen with that setup.

R30 says any electrical item that isn't a motor/actuator or a control system part is a CUSTOM CIRCUIT. Photoswitches and resistors aren't motors are control system components, so we have a CUSTOM CIRCUIT.

R37 covers CUSTOM CIRCUITS that connect directly to the PDP. That doesn't apply here because the circuit isn't connected to the PDP.

R42 covers CUSTOM CIRCUITS that are controlled by speed controllers or relays. Again, that doesn't apply here.

R44 says CUSTOM CIRCUITS can't alter power pathways of control system components. The photoswitch/resistor combination does not connect to or alter any pathways.

R48 covers Ethernet CUSTOM CIRCUITS. That doesn't apply here.

R62 allows CUSTOM CIRCUITS to be connected to the CAN bus. That doesn't apply here.

Looks legal to me.

tkeil
27-01-2015, 16:00
Hi Guys,

I spent a little time looking into this. Omar is correct; the leakage current is the issue with the QS30 Banner sensor. Let me elaborate a bit...

This sensor uses an open collector output. Of the many things you need to be concerned with, the two biggest are leakage current (Ileak) and saturation voltage (Vce_sat). Both of these are specified in the datasheet, but sadly, only at the inconvenient operating point of 100mA:

http://info.bannerengineering.com/cs/groups/public/documents/literature/119167.pdf

NPN Ileak: <200uA
NPN Vce_sat: <1.6V @ 100mA
PNP Ileak: <10uA
PNP Vce_sat: <2V @100mA

There is a conflicting trade-off to be made in the selection of the pull-up resistor. Remember that the Vce_sat of a BJT is dependent upon many things including the collector current. You would like the Vce_sat to be very low since, to guarantee proper operation, it needs to be less than the low logic threshold of 0.8V for the roboRIO. The higher the value of the pull-up resistor (a weaker pull-up) the less collector current you will have and the Vce_sat will go down.

The trade-off is the leakage current. For this NPN BJT, the Ileak is specified to be lower than a massive 200uA. Omar measured this at 65uA for his particular part and operating temperature which is still very high. Through a large pull-up resistor this Ileak creates an offset voltage that makes the roboRIO read a logic low even when the BJT is off and the output should be reading high.

You need to make these trade-offs for any open collector sensor output. The reason it's difficult to work out in this case is that this sensor is meant for a high voltage (12V - 24V) industrial installation (like a factory floor) and not necessarily for interfacing to a low-voltage, high-speed FPGA (roboRIO).

That doesn't mean it can't work. It's just going to be harder than if the sensor and controller are well matched. Since the datasheet for the Banner sensor doesn't specify the Vce_sat at lower collector currents than 100mA, the best value for the pull-up resistor will need to be done through experimentation as many of you have been doing. I don't have one to play with myself.

A few recommendations:

I think adding a parallel pull-up to 3.3V is better than pulling up to the 5V rail. Please keep in mind that the circuitry inside the roboRIO is a lot more complicated than the picture with the FPGA and pull-up resistor. That's the functional view only and there are many more components for protection of the DIOs. I'm not trying to scare anyone out of being creative, but keeping the circuit simple and strait forward is best so nobody inadvertently disables a protection mechanism.

The PNP BJT is specified with a slightly higher Vce_sat, but a far lower leakage current. It might be interesting to see if you could invert the logic and wire for the PNP output. I believe some of the DIO have pull-downs which might be suitable for this inverted situation.

When you find a working circuit, use a DMM to measure the high and low levels at the DIO pin of the roboRIO. You want to make sure you are well under the logic low threshold and well above logic high to get consistent, reliable use. Remember that leakage currents are tricky and change from device to device and over different temperatures.

Tim

tr6scott
28-01-2015, 17:36
FWIW,
Yesterday we were able to test our DS18 sensors with a 4.7KOhm external pull up to the +5v DIO rail, and it worked.

After the meeting I saw the post above, and now we will work on getting the pull up to the +3.3v rail of the roboRIO.

I have two Rev robotics passive boards on order, so we will probably use the +3.3v screw terminal of the board for power supply and a small terminal strip for the resistors.

Alan Anderson
28-01-2015, 17:55
I tried two Banner QS18VN6D sensors, one we've had for several years and one we just bought this month. I powered them directly from battery voltage and connected the DARK and LIGHT output wires to individual Digital Input signal pins. Both of them worked perfectly without any extra pullup resistors.

I am still slightly paranoid about them, since so many other people have reported problems, but for now they're going to be wired exactly the way we've always done them in the past.

tr6scott
29-01-2015, 11:46
Alan,

You should be fine with the QS18 sensor.
From what I can tell the issue is identified in the V-Sat spec.

The sensors that have not worked, have a spec from banner of the V-Sat of " <1.6v"

This is the DS18 and QS30 family.

The sensors that have worked, have a V-Sat rating of "<1v"
This is the T18, T30, and now your QS30 families.

SuperBK
29-01-2015, 15:08
Thanks for this thread guys. I was going to use some QMRN-0N-0A sensors from Automation Direct. They will be powered by 12V and of course, I want to measure the input with a DIO pin. They are visible red, with an NPN. I was worried about ground isolation between the PDP, VRM, and RoboRio DIO pins, but according to the posts, that should not be an issue.

I hooked one up on a test bench, not yet to the robot control system.

The issue that I am having though is that the output pin of the senor only gets pulled down to 1.3 volts, which is not enough to reliably measure a low digital input. I tried with both a 40K input to simulate what the roboRio has and also a 4.7 K to give it more current. I am pulling it up to 5V, not 3.3.

Any thoughts as to how to make this senor work? What about connecting them to analog inputs and check for below 2.5 volts?

Should I power directly off the PDP, or the VRM?

billbo911
29-01-2015, 15:30
Thanks for this thread guys. I was going to use some QMRN-0N-0A sensors from Automation Direct. They will be powered by 12V and of course, I want to measure the input with a DIO pin. They are visible red, with an NPN. I was worried about ground isolation between the PDP, VRM, and RoboRio DIO pins, but according to the posts, that should not be an issue.

I hooked one up on a test bench, not yet to the robot control system.

The issue that I am having though is that the output pin of the senor only gets pulled down to 1.3 volts, which is not enough to reliably measure a low digital input. I tried with both a 40K input to simulate what the roboRio has and also a 4.7 K to give it more current. I am pulling it up to 5V, not 3.3.

Any thoughts as to how to make this senor work? What about connecting them to analog inputs and check for below 2.5 volts?

Should I power directly off the PDP, or the VRM?

If I am reading the Spec sheet for this sensor correctly, it needs to be connected to 10-30vdc. In addition, the pull-up, as shown in the wiring diagram, needs to be connected between the same supply and the output pin. If that is correct, and you also connect the sensor output to the RoboRio DIO which are 3.3v/5vtolerant, you may just destroy that input, or to whole controller.
More than likely there is an internal current limiting resistor in sensor that is also preventing the output from dropping below 1vdc.

Knufire
29-01-2015, 15:40
Thanks for this thread guys. I was going to use some QMRN-0N-0A sensors from Automation Direct. They will be powered by 12V and of course, I want to measure the input with a DIO pin. They are visible red, with an NPN. I was worried about ground isolation between the PDP, VRM, and RoboRio DIO pins, but according to the posts, that should not be an issue.

I hooked one up on a test bench, not yet to the robot control system.

The issue that I am having though is that the output pin of the senor only gets pulled down to 1.3 volts, which is not enough to reliably measure a low digital input. I tried with both a 40K input to simulate what the roboRio has and also a 4.7 K to give it more current. I am pulling it up to 5V, not 3.3.

Any thoughts as to how to make this senor work? What about connecting them to analog inputs and check for below 2.5 volts?

Should I power directly off the PDP, or the VRM?

We're using the same sensor. We've resorted to wiring signal into a analog port with a voltage divider and +/- to the VRM.

SuperBK
29-01-2015, 15:42
Other sensors like the ones from Banner also show the output being pulled up to the supply voltage. I think that's just a generic way of showing it needs to be pulled up. Without the pullup it just floats and goes nowhere near 12 volts, so I don't see that as hurting anything. It pulls up nicely to 5 volts, just doesn't go low enough.

Alan Anderson
29-01-2015, 15:47
If I am reading the Spec sheet for this sensor correctly, it needs to be connected to 10-30vdc.
Correct.
In addition, the pull-up, as shown in the wiring diagram, needs to be connected between the same supply and the output pin.
Not correct. The diagram shows how the sensor is typically used, but its outputs are open collector and will work with a pullup to any voltage.
If that is correct, and you also connect the sensor output to the RoboRio DIO which are 3.3v/5vtolerant, you may just destroy that input, or to whole controller.
Also not correct. The roboRIO signal pins will all tolerate battery voltage without being damaged.
More than likely there is an internal current limiting resistor in sensor that is also preventing the output from dropping below 1vdc.
I doubt it's an intentional current limit.

The idea of connecting the output to an analog input is probably the simplest. I would power the sensor from the VRM's 12 volt output, to protect it from brownouts.

billbo911
29-01-2015, 15:59
Correct.

Not correct. The diagram shows how the sensor is typically used, but its outputs are open collector and will work with a pullup to any voltage.

Also not correct. The roboRIO signal pins will all tolerate battery voltage without being damaged.

I doubt it's an intentional current limit.

The idea of connecting the output to an analog input is probably the simplest. I would power the sensor from the VRM's 12 volt output, to protect it from brownouts.

Thanks for fact checking me. I wasn't aware that "any voltage" is safe to be used with open collector. I can see how that diagram might be generic and the pull up could be connected to +5 or +3.3.
I also didn't know that the inputs on the RoboRio can tolerate battery voltage. That is excellent in our usage because, well, sometime that happens.

Agreed, connecting this to an analog input, with a voltage divider, would be the simplest way to make this sensor useful.

jfitz0807
29-01-2015, 20:34
Sorry, but I'm getting a little confused. I have an Allen-Bradley 42EF-D1MNAK-A2. I have wired the brown (+12) and blue(gnd) wires to a PDP channel for 12V. I then put the white wire to an Analog signal input (Analog channel 1). The black wire from the sensor is floating.

The white wire is sliced into the white wire of a PWM connector. The red and black wires are isolated from each other and floating as well. I was expecting that the ground on the Analog input channel was tied to the ground of the PDP.

The sensor seems to be doing something. As I move my hand back and forth under it, the LEDs come on and off. Soecifically, when the green LED is on, it's reading 0.7v. When the orange LED is on, it reads 0.4v. When the orange and red LEDs are both on, it also reads 0.4v. I guess I was expecting a little wider range of values.

I'm also trying to determine if we can use this to "see" when we get to the scoring platform. Any suggestions?

Alan Anderson
29-01-2015, 23:09
Sorry, but I'm getting a little confused. I have an Allen-Bradley 42EF-D1MNAK-A2. I have wired the brown (+12) and blue(gnd) wires to a PDP channel for 12V. I then put the white wire to an Analog signal input (Analog channel 1). The black wire from the sensor is floating.

The white wire is sliced into the white wire of a PWM connector. The red and black wires are isolated from each other and floating as well...

The output of the sensor does not produce any voltage. All it can do is sink current. You will need to add a pullup resistor. I suggest about 5k between the +5 and SIG pins (red and white wires) on the analog input.

SuperBK
30-01-2015, 01:25
We connected our sensor to an analog input with a pullup to 5V. In one state, it reads near 5V, and in the active state, it reads 1.3 volts. We split the difference to delineate on or off. We powered it from the VRM. Seems to work OK.

SuperBK
06-03-2015, 08:09
Just for completeness with the QMRN-0N-0A, we wound up using an opto-isolator to connect it to a digital input. I grabbed these from Sparkfun: https://www.sparkfun.com/products/314.

This separates the 12V and 5 volt side completely. The sensor's open collector input drives the input of the isolator through a 470 ohm resistor, and the collector output transistor of the isolator is connected to a digital input on the roboRio. That gives me a nice low logic low level.

Kevin Sevcik
06-03-2015, 11:58
Okay, I apologize for not coming across this thread earlier. I feel like someone should do a little testing and then write up a white paper on what sorts of sensor work with the roboRIO and how to safely connect them. I think this probably should have been FIRST or a beta team, but whatever.

For the record, I'm declaring it ridiculous to be concerned about connecting a DIO pullup resistor to 5V. RoboRio specs say the inputs are 3.3V/5V compatible, and ozrien's pullup was dumping 4.98V onto the signal pin with no ill effects. We have microswitches 3-wired to the DIOs, so we're shorting 5V directly onto the signal line with no ill effects.

You should have absolutely no concern about applying 5V to any of the DIO signal pins. The only path from the 5V to the 3.3V there is through the pull-up resistor, which is going to limit things to <1ma of boost on the 3.3V line. I would quite honestly be MUCH more concerned about connecting 3.3V through a pullup to the signal line. If you short around that 3.3V resistor and short to the 5V pin on the DIO header, you absolutely ARE shorting 5V directly onto 3.3V. Far better to keep potentially error-prone unprotected 3.3V wires far away from that 5V pin.

The only ways a short 5V pullup could possibly go wrong are if the internal pullup resistor is shorted already (in which case you're already in trouble), or if you accidentally end up shorting 5V directly to ground with no pullup. The latter is just as big a problem with a 3.3V pullup, and I suspect/hope the power supplies are short circuit protected.

So I'm declaring it 100% safe to connect 5V to the signal lines in whatever fashion you choose. You're all obviously welcome to continue with your 3.3V pullups and connecting things to analog inputs and whatever, but I think you're needlessly complicating and confusing things. And thus needlessly worrying and confusing teams.

Now, connecting 12V sensors into the 5V IO system is obviously trickier, but anything with an NPN open collector output should be connectable just like those Banner sensors with a 5V pullup. Opto-isolators shouldn't be necessary unless you're worried the output transistor is going to meltdown and dump 12V directly onto the output line. And the ground as well, since that's the third leg of the output transistor.

SuperBK
06-03-2015, 14:26
The reason I needed an opto isolator or at least a transistor in line with the sensor is that the NPN output in the transistor won't pull the DIO pin low enough for a logic low. In other words, its not a logic level sensor. I called Automation Direct support and confirmed it. As long as I was going to put something in between the sensor and the roborio, I figured I might as well use an opto-isolator. That way I don't have to worry about any ground differential voltage.

The last thing I wanted to do was do something to make reading the sensor unreliable.