Git Product home page Git Product logo

gtambara / dac-nonlinearity-resistor-analysis Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 106 KB

When working with converters, precision is important, and it's known that commercial resistors tend to vary in their resistors values. This code is a tool based on the Monte Carlo algorithm to analise how adequate the chosen tolerance is to your project.

Python 100.00%
circuit tolerance carlo monte resistor linearity

dac-nonlinearity-resistor-analysis's Introduction

dac-nonlinearity-resistor-analysis

When working with converters, precision is important, and it's known that commercial resistors tend to vary in their resistors values. This code is a tool to analise how adequate the chosen tolerance is to your project, based on hte Monte Carlo simulation.

This code works on the r2r topology, and all you have to do is define the value of vref (the voltage reference, or maximum voltage value); vectors r (vector of resistors in the position of the R value); vectors rb (vector of resistors in the position of the 2R value); rx (resistor representing the first 2R resistor grounded on the left of the picture); tol (the commercial tolerance for the resistors). To simplify the calculations, the nonlinearity caused by the inverter amplifier is not considered.

Here, there is a generalized model of the circuit:

fig1

The model of DAC utilized here uses up to 10 bits to represent a binary value and a maximum output 10.23 Volts, correlating to the number of 1023 (maximum value from 0 bits). By calculating in a recursive way the Thevenin equivalent, the code is capable of finding how much the final value differs from the expected (10.23 in this case).

The result is a graph like the one below.

fig1

dac-nonlinearity-resistor-analysis's People

Contributors

gtambara avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.