Coder Social home page Coder Social logo

aaopto-aotf's Introduction

AA OptoElectronics MPDSnCxx AOTF Driver

License

python driver to control MPDSnCxx AOTF devices.

Installation

To install this package from PyPI, invoke: pip install aaopto-aotf

To install this package from the Github in editable mode, from this directory invoke: pip install -e .

To install this package in editable mode with dependencies for building the docs, invoke: pip install -e .[dev]

Intro and Basic Usage

from aaopto_aotf.aotf import MPDS

aotf = MPDS("COM3")

Before writing values, you must first set the global blanking mode, and each channel's frequency, mode, and whether it is driven by external input or internal (software controlled) input.

from aaopto_aotf.aotf import MPDS, MAX_POWER_DBM
from aaopto_aotf.device_codes import DriverMode, BlankingMode, VoltageRange

aotf.set_blanking(BlankingMode.INTERNAL)  # disable blanking control from external input pin.
aotf.set_external_input_voltage_range(VoltageRange.ZERO_TO_FIVE_VOLTS)

# Note: device channels are 1-indexed to be consistent with the datasheet.
for channel in range(1, aotf.num_channels + 1):
    aotf.set_frequency(channel, 110.5)
    aotf.set_driver_mode(DriverMode.EXTERNAL)

If the driver mode is set to DriverMode.EXTERNAL, the device will take its output setpoint from the external input pin.

If set to DriverMode.INTERNAL, you can control the output with software settings:

for channel in range(1, aotf.num_channels + 1):
    aotf.set_driver_mode(DriverMode.INTERNAL)
    aotf.set_power_dbm(channel, MAX_POWER_DBM)
    aotf.enable_channel(channel)

Note that internal mode only enables a simple "On/Off" control scheme, and does not support linear scaling like external mode does vial the external analog input.

At this point, you might want to save the values set above to the current profile.

aotf.save_profile()  # Now, calling an aotf.reset() will start with the saved settings.

What's missing?

Here are the minor dangling features that are not implemented.

  • changing laser channel profiles at runtime. (These must be changed with the external input pins.)
  • automatic sweeping mode
    • automatic self-sweeping is a somewhat out-of-the-ordinary feature for most users.

Examples:

Have a look at the examples folder to see other examples and make use of a useful calibration script.

aaopto-aotf's People

Contributors

poofjunior avatar github-actions[bot] 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.