Electronic – ADC error SPICE simulation

adcoffsetsimulation

I am attempting to do a Monte Carlo simulation of a basic current measurement circuit using SiMetrix. The current goes through a sense resistor, amplified by an op-amp and then to an ADC. I'm trying to include the error of the ADC in my simulation, but I can't figure out how to randomize it. I found that the total error contribution of the ADC is +/- 5mV. How can I add that error to the output of my op-amp for use in a Monte Carlo simulation? I would like to make it a Gaussian distribution, similar to what you do with resistor tolerances. The problem with gauss is that it is a multiplier, and therefore would not give me any results centered about 0 (0 * multiplier = 0). Here is the sim schematic:

Circuit Sim

Option 1: Sine wave voltage source in series with output

This option will add or subtract 5mV from the output signal in a transient analysis, but it is not random.

Option 2: Current source in parallel with a resistor with gauss tolerance

This option would give me the distribution I want, but I don't know how to get the current to randomly switch directions or magnitude (to give me +/- 5mV max).

Option 3: DC voltage source in series with the output

This option would give me a static 5mV offset, but this is not useful in Monte Carlo sims.

Option 4: Noise source?

Could a noise source accomplish this random behavior? I was ultimately trying to get a gauss distribution, but I would be happy with pseudo-random.

Option 5: Voltage controlled voltage source

I could use a voltage controlled voltage source with a gain set to 1 and some distribution about 1. The problem with this method is that it would have less effect at lower voltages since it is ratiometric.

Best Answer

The way to do this would be to put noise sources into the simulation, you don't need to put them all in, just the largest sources (so calculate what they will be and then add them in)

You can add in a noise source by using a voltage source and in SImetrix you can change a voltage source to be a noise source. Either calculate the amplitude and then use that for the amplitude of the voltage noise source.

noise interval rms_value [start_time [stop_time]]

Source generates a random value at interval with distribution such that spectrum of signal generated is approximately flat up to frequency equal to 1/(2*interval). Amplitude of noise is rms_value volts. start_time and stop_time provide a means of specifying a time window over which the source is enabled. Outside this time window, the source will be zero. If stop_time is omitted or zero a value of infinity will be assumed. Source: SImetrix voltage source

enter image description here Source: https://www.planetanalog.com/author.asp?section_id=483&doc_id=564068

Unless your doing really low level measurements (uV to nV) the resistors will proabably not make much of a difference. I would calculate the Input Refereed Noise and then put a voltage source on the positive terminal (you could also put a current noise source between terminals, but usually the input refereed noise is the largest noise source).

Remember that noise sources add by the sum of the squares, and you are also not simulating 1/f noise (which is hard to do).

Edit: Another way to do this with a Monte Carlo simulation is test the edge cases (which would be -5mV and 5mV). So if you know that the total error (or really in this case the DC offset of the amplifier) is max 5mV (on the input) then set the voltage source on the positive input to 5mV and run the monte carlo simulation, then do the same for -5mV. This way you only have to change 1 value of a parameter.