Our main programming mentor (who can’t make it today) said he found a voltage input we could use that would go to 80 millivolts (through the analog breakout). As far as I can see, the only inputs are +10 volts. Is it possible to use a more precise input, sacrificing range? If so, how? Thank you.
The NI 9201 has 12 bits of resolution over a 20V input range - ie 5mV resolution. If you need more precision, you’ll need to consider an amplifier to increase the signal level or, perhaps, a SPI or I2C A/D converter or similar. Or is 5mV resolution sufficient?
NI offers a number of analog converters similar to the 9201 but designed for greater precision. Unfortunately, these aren’t available for FIRST teams to use (at least for this year since the FPGA is fully locked-down).
Russ
Unfortunately, we probably need about 1mV precision. Since we probably don’t have access to amplifiers and we don’t have access to I2C A/D converters, I might have to use a different method. Maybe I can use a higher resistance=.02 Ohms, which would give just enough resolution (I’m calculating motor current).
You can also try to over sample to get the extra resolution, but that will get hairy quickly.
What do you mean by oversample?
Are all analog to digital conversions handled through the
FPGA, whether they are direct reads or not?
Eugene
The A/D converter resides in the 9201 module. I believe that there is a serial interface between the FPGA in the cRIO chassis and the converter in the 9201 module. The FPGA is hard-coded to simply stream conversion values from all 8 channels and store them on the FPGA for you to query.
Oversampling refers to using the full 62kish samples/sec that the FPGA acquires from each 9201 and averaging, for example, 1000 at a time to effectively produce 1000x the resolution. This CAN work but it requires that the low-level signal has > 5mV peak-to-peak noise and that the noise is somewhat well-behaved.
Eric’s suggestion can work in many instances but it requires that your sensor be a little noisy (it’s obviously a bit counterintuitive since noise is almost always undesirable). You should DEFINITELY give it a try.
The only downside to oversampling is that it’s a filtering process. You won’t get the full 31kHz bandwidth as you would when using the raw 62k sample/sec stream. How much bandwidth do you need? If you only need about 100 samples per second from the sensor, you could consider averaging about 300 samples at a time for 62k/(300*2) = 100Hz bandwidth. That could also, theoretically, reduce your resolution from 5mV to 5/300mV = 17uV.
I’d recommend that you give oversampling a chance!
Russ
I am only using LabVIEW this year, since I don’t know it yet. Hopefully a C++ user can chime in with the complement to this post.
In order to use Oversampling, you will need to use GetAverageVoltage instead of GetVoltage. You may also want to use SetAveraging from the advanced palette in order to dictate exactly how much oversampling you want. Use oversampling, not averaging.
This takes a number of bits rather than a number of sampling. If you choose (for example) 8 bits of oversampling, it will take (2^8=)256 samples at a time and theoretically give you 5mV/256 = 20uV resolution. Bear in mind that this makes huge assumptions about the quality of the noise, so don’t think of oversampling as the golden hammer with which to solve all resolution problems.
Okay, I’ll try oversampling. The signal is from a motor, so there may be too much noise. I’ll see if it works. Hopefully it does, as we have almost no other option. Also, what rate should I use (I will be sampling one ADC on each analog breakout) to get the best resolution? I’m confused, as there are several numbers and I want to know which to use. Is 62K as Russ Beavis says the fastest sampling you can get if you only need one signal, or can we go faster if we aren’t using all the signals? Thank you.