Today Team 2502 did a marathon of reading and writing values to Digital inputs and outputs, we blew some air with the pump, and implemented a steering wheel, etc. Our last pit stop was with the analog input.
I opened Analog Input, set the correct slot/channel and when I probed the wire, all I got was near-zero numbers. Things like 0.0001342837 or like -7.001327E23 (Very small numbers)
I’m guessing that something’s being read but not the correct values. This happens whether or not we have a sensor plugged in. We’ve tried numerous jumper positions. What we to simulate a sensor was plug in a 9V battery. Tomorrow we’ll try plugging in an actual sensor like ultrasonic (today we couldn’t find PWM female-to-female cable so we couldn’t plug it in).
Anyone have prelimary guesses?
Plugging in a 9 volt battery to one of the inputs was probably a very bad idea. The inputs are supposed to read voltages from 0 to 5 volts, and it is possible that you damaged ether the Analog Breakout Board, the Analog cRIO module, or both. I don’t know, but it is possible that only the one input you were using was damaged and the rest of the inputs are still good. I would try it again with a 0 to 5 volt signal on a different input. If that doesn’t work, then try a different module with a different breakout board.
Edit: This information is wrong. The input range is -10 to 10 volts. You cannot have done any harm with your 9 volt battery.
Thanks for letting me know about that. I will be on electrical leader’s tail for letting that slip. If they are damaged, would they display a red LED? Is there a way to test if those are damaged? (I guess we’d have to hook up a real sensor).
Thank you for correcting me. I don’t remember where, but I thought I read that some where. But now that I look at the datasheet, I see that the range is -10 to 10. So your 9V battery shouldn’t have done any harm, but that still doesn’t explain the values you get.
I apologize for spreading misinformation. I will always read before posting from now on.
For starters, is the green LED on the Analog Breakout module on? If not, then the module isn’t being properly powered.
HOWEVER, plugging in a 9V battery doesn’t require that the Analog Breakout module have power. The analog signals are directly passed (one-to-one) to the NI 9201 analog input module. As mentioned earlier, the 9201 does indeed have a +/-10V input range (survives even higher voltages, I believe) and I’m fairly certain that the FPGA software doesn’t limit readings to 0-5V.
Can you read the battery voltage with the jumper installed? You might want to try that first. The reading should even be passed all of the way back to the Driver Station.
You should also confirm that the 9201 is in the chassis slot that you’re expecting. You might be sampling the analog input from the other 9201 in your cRIO chassis.
Check that you have connected the common pin to ground (any black wire on the robot). The NI9201 analog inputs are single-ended, but you MUST connect at least one of the COM connections to chassis ground.
Wow! We looked a little closer at the 3-pin connection and found out that we were only connected to 2 of the pins. So the where white should’ve been was at red, and where red should’ve been was at black and black wasn’t even connected. Our PWM cable ends are keyed so they “click” but we realized that those PWM cable keys don’t actually work with the cRIO connections so we found cables without keys and it worked just wonderfully. Learned something valuable with this