??? 05/16/08 18:41 Modified: 05/16/08 18:43 Read: times |
#154829 - Start by cleaning up the supply ... Responding to: ???'s previous message |
Robert Revens said:
Richard Erlacher said:
If your adc is an 8-bitter, you need your analog power supply and, particularly, your reference, to be no noisier than 1%. That means that, under full load and maximal external perturbation, the variation on the supply is still less than 5 mV.
I'm guessing a 39mV sawtooth straight out of my PSU isn't helping much. >>edit: Isn't that 1.2% though? Yes, 1.2% is what it is ... Is that close enough? Actually, 1/256 of 3.3 volts is about 13 mV, so 39mV is about 3 bits. You seem to be concerned with less significant artifacts up to now. A two-bit error on the ADC is more than a percent. Two of those bits being error, possibly random, and two possibly an offset, suggests the best raw output you can bet on is worse than ~2%. If you add error by varying the input voltage from which the internal reference is presumably derived, it's not going to improve the accuracy (repeatability) of the results you get. Further, the error spec for the ADC indicates that the precision is likely to be "off" by as much as two bits due to its offset, and is likely to contain up to two bits of error, which is not necessarily random. Some of these "error" bits are knowable, however, in that you can determine what that offset is, and compensate it out of the equation. I'd recommend you try operating this circuit with a linear supply that actually lacks that 5 MHz ripple, and see what that looks like. You may find that it makes very little difference, but, OTOH, it may make more than you think. You can attempt to improve the noise at the reference by minimizing the noise originating at the supply. This MCU doesn't use a lot of power, so you can probably help yourself quite a bit by putting a series resistor in the Vcc path to the MCU, bypassing it very thoroughly at the Vcc pin and at the other end of the resistor. When the MCU "sucks" on the Vcc rail, it will lower the potential at its Vcc pin, causing the local capacitors to release charge onto that rail. That will help to confine the power-to-ground noise caused within the MCU to that part of the circuit. Likewise, at the "other" end of that resistor, the caps will source current to keep the Vcc rail where it is. It won't be perfect, but it will help a bit. If you do that same thing at the POT, where there's nothing causing the pot to increase or decrease its current flow, it will quiet down that wiper. The key is that decoupling resistor, so it can be quite sizeable, though I wouldn't recommend anything larger than 10% of the pot value. I'd even suggest you try a resistor at both ends of the POT, but with the same combined resistance, i.e. not more than 10% of the POT value. I'm guessing, of course, but I suspect this will have minimal impact on the behavior of your POT's wiper. The reason it's worth going to some trouble to improve the voltage at the POT is that there's likely a phase-shift between the voltage on the POT and the reference in the MCU, as both experience the minor changes that they "see." 40 mV of noise at the supply means 40 mV of potential variation at the POT. If you can quiet that down to less than 10 mV then you've already improved things by 4x, or, ratiometrically, two bits, right? What's more, since there is that phase-shift I mentioned, it introduces an additional error, which will be minimized if you reduce the PSU ripple's effect on the current in the POT. You can study that for a while and you'll learn what its relationship to the nominal Vcc, and to the ostensibly controlled reference within the MCU is. If you allow "things" to happen to the supply, their effects will appear on your readings of the wiper voltage. The more you know about your data acquisition system, the better you can process its output. Richard Erlacher said: A small cap on the wiper of your POT might be a big help, too, BTW.
In series with the wiper, or to ground (sorry if that's a dumb question).
Thanks for your comprehensive reply Richard. I think this is a good place for me to start from the look of things. Interestingly, the output from the pot wiper shows this intereference varying with position. Sometimes the output voltage is dead flat, other times it has this ripple on it. A function of RC? I have a bypass cap straight across both ends of the pot. I'm not familiar with the MCU you're using, but I don't see a reference input. I suppose that's because they needed the pins for something else. If you clean up the Vcc at the MCU, however, it wont hurt anything. What's more, if you have a noisy input supply, you need to know how its ripple affects your conversions. A 5 MHz ripple of 40 mV is not terrible for a switcher. However, if you're going to study your circuit, you probably want a quieter supply, for experimentation, anyway. If that 5 MHz ripple is really the cause of a lot of grief, then you can do something about it, though I think the measures I've suggested you experiment with may help to reduce it to neglegible. Keep in mind that the spec's are written for circumstances that are perfect, and your work environment never is perfect. RE |