Skip to content

Repository files navigation

OpenSync

An open source synchronizer for the velocimetry of fluids using a Raspberry Pi microcontroller.

Example Timing Graph for Diode Laser

Notice

The first batches of PCBs were ordered from JLCPCB for testing. If and when the PCBs pass testing and an initial PIV experiment is performed, the 1.0 milestone and initial release will be made along with a journal submission to HardwareX or JOH for publishment. Additionally, complete replication instructions will be included during the 1.0 milestone.

Purpose

OpenSync is a simple and low-cost synchronizer based on microcontroller technology. Due to the intrinsic nature of microcontrollers compared to more advanced devices (e.g., field programmable gate arrays), sub-cycle accuracy and come complex features that are typical of commercial propietary devices are not implemented. However, OpenSync remains sufficiently flexible and provides enough support for most users' needs when performing a PIV experiment. This is because OpenSync is a digital delay/pulse generator capable of having each output channel individually programmed. In adition to an all-microcontroller platform and a custom PCB, OpenSync devices provides a low-cost means to deterministic controll of laboratory equipment.

Basic Specs

  • System Frequency: 250 MHz (4 ns resolution)
  • Output Channels: 8
  • Input Channels: 2
  • I/O Channel Voltage: 3.3V or 5V @ high impedance

For a more detailed specification, please read the datasheet.

Documentation

Complete instructions to construct and use OpenSync are provided in [imaginary link to notebook-based rtd website]. User's interested in the development process of OpenSync are kindly refered to the SDLC documentation. There is a lot of information on the development process including some quirks from the pico microcontroller platform.

Quick Start

Compilation

OpenSync uses the RP2350 microcontroller and Pico SDK as the basis for developing devices that require precise timing with great flexibility. However, there currently isn't an official IDE like the arduino IDE for this microcontroller. Instead, Microsoft Visual Code with the Pico SDK plugin will be used as the IDE to compile the software. Compilation is extremely simple in this context as the IDE and CMake files take care of all the compilation steps. Simply open the root directory of the OpenSync source code with Microsoft Visual Code and click on >>Compile<< on the bottom right corner. This will generate the .uf2 file necessary for flashing firmware to the microcontroller.

Flashing

Flashing firmware to OpenSync is extremely simple. Make sure OpenSync is disconnected from the computer. With the top cover off, press down on the white button on the Pico 2 development board and plug in OpenSync to a computer containing the .uf2 file generated during the compilation process. OpenSync will register itself as a storage device on most computers. Open the folder for OpenSync and drag the .uf2 file into the root directory. OpenSync should then disconnect and reconnect with the computer. During the first bootup, all status LEDs will turn on which indicated that the firmware has been successfully flashed.

Self Test

Import the Python library opensync and type in the following command:

import opensync

# Find all open ports
ports = opensync.device_comm_search()
print(ports)

# Open serial connection with the first opensync device
with opensync.device_comm_managed(ports[0], fast=True) as device:
    # Print manufacturer, model, serial number, and firmware version
    print(opensync.device_system_version(device))

    # Perform a system operation test (raises if something goes wrong)
    opensync.device_system_test(sync_device)

If successfull, no errors or warnings should be produced. Please note that all commands to and from opensync are terminated with CRLF. Additionally, all used output terminals should be validated on an osciliscope for peace-of-mind, allthough this is not strictly necessary.

Acknowledgments

I would like to acknowledge Dr. Ivan Nepomnyashchikh and Professor Alex Liberzon for spearheading development of open source, open hardware equipment for the OpenPIV project (see the original thread that started this project). Additionally, certain inspirations of the OpenSync project are from relatively low-cost hardware produced by Optolution and MicroVec Pte Ltd.

TODO

  • Add timing plot utilities
  • Add device containerization for customization
  • Add the ability to change channel names
  • Add the ability to disable output channels (necessary?)
  • Add three internal timers that can be mapped to pulse sequences
  • Add the ability to count and skip external triggers (usefull for phase-locked stuff like rotor blades)
  • Add second external trigger and output port masking
  • Update firmware and software to reflect new design
  • Get the damn production PCB produced (keep pushing it off to a later date, umpf)
  • Validate PCB against an osciliscope
  • Add video examples on YouTube

References

  1. Radim Hošák, & Miroslav Ježek. (2018). Arbitrary digital pulse sequence generator with delay-loop timing. Review of Scientific Instruments, 89(4). https://doi.org/10.1063/1.5019685
  2. Scallon, A. (2017, June 18). Arduino TTL Pulse Generator and Controller. Optogenetics and Neural Engineering Core. https://optogeneticsandneuralengineeringcore.gitlab.io/ONECoreSite/projects/Arduino%20TTL%20Pulse%20Generator%20and%20Controller/
  3. Starkey, P. T., Turnbaugh, C., Miller, P., LeBlanc, K.-J., & Meyer, D. H. (2024). Experimental timing and control using microcontrollers. Review of Scientific Instruments, 95(10). https://doi.org/10.1063/5.0225550
  4. Stasicki, B. and Ehrenfried, K. and Dieterle, L. and Ludwikowski, K. and Raffel, M. (2001) Advanced syncronization techniques for complex flow field investigations by means of PIV . 4th Intern. Symposium on Particle Image Velocimetry, Göttingen, Germany, September 17-19, 2001.

Licensing

Licenses OSHWA UID
osls N/A
  • Software: All firmware and software components are covered by the GNU GPLv3 license.
  • Hardware: All hardware is covered by the CERN-OHL-S-v2 license.

About

An open source synchronizer for velocimetry of fluids.

Topics

Resources

Stars

4 stars

Watchers

3 watching

Forks

Contributors

Languages