Giter Site home page Giter Site logo

vco-calibration's Introduction

Measuring VCO frequency as a function of VCO control voltage

This repository includes scripts for measuring frequency as a function of control voltage and an attempt to fit the calibration data using both ODR and least squares methods.

Hardware

  1. LabJack T7 with a $\pm$ 10V DAC attachment. The LabJack is used to sweep the control voltage. It also measures the control voltage seen by the VCO.
  2. Battery pack for producing a 6V offset.
  3. B&K 1856D frequency counter.
  4. VCO
  5. Voltage divider

Calibration code

This repository includes the following scripts:

  • makeCalibration.py: This script makes the calibration by first setting an output voltage on the LabJack, measuring the voltage after the battery and voltage divider and measuring the VCO frequency using the frequency counter.
  • FrequencyCounter/main.cpp: Code for communicating with the frequency counter using a serial port. This can "in theory" be done in python but I ran into some issues on Linux and python where the frequency counter would not be recognized by the device. It turns out that this is because for the counter to send a signal, the USB pins need to be configured properly (DTR needs to be on, and RTS needs to be off. Both are always on by default, which prevents the device from being seen).
    • Uses serialib which is a C++ library for communicating with serial devices.
    • The code should work fine on Windows and Linux, barring the issue of the DTR and RTS ports
  • dividerError.py: This is not a script but more of a calculation of the division ratio of the voltage divider and its associated error.

Analysis code

To convert the measured data to a voltage-frequency calibration I tried different methods of fitting the data with polynomials (linear, quadratic and sixth order):

  • completeCalibration_LeastSquares.py
    • Fit using least squares. Does not take errors of measured voltage into account (x-errors).
  • completeCalibration_ODR.py
    • Fit using ODR (Orthogonal Distance or Deming Regression). Does take errors of measured voltage into account (x-errors). Aside from the fitting method and the implementation of the model functions the two scripts are virtually identical. A comparison between the two methods can be found in my report.

Setup

Setup

vco-calibration's People

Contributors

fklose 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.