Skip to content

GrussmayerLab/LaserController

Repository files navigation

Laser Controller Project

TL;DR (Quick Setup)

  1. Assemble the PCB:

    • Order the PCB from JLCPCB for ~$150 using the gerber.zip, bom.csv, and laser_controller-top-pos.csv files.
    • Use compatible JST cables.
  2. Install MicroManager 2.0:

  3. Copy Files:

    • Copy the precompiled EMU folder and mmgr_dal_GrussmayerLab-LaserController.dll into the root directory of MicroManager.
  4. Hardware Configuration:

    • Run MicroManager and open your hardware configuration.
    • Add the GrussmayerLab-LaserController driver in your configuration and make sure to select a baudrate of 115200.
    • Make sure maxVolts is set to 5.0 for DAC0 to DAC5 and 1.0 for PWM.
  5. Use the LaserControlGUI Plugin:

    • Open the LaserControlGUI plugin from EMU.

    • Configure the properties of the EMU plugin as follows:

      Lasers

      UI Property Device Property
      lasern enable LaserController-DACn State
      lasern enable – On value 1
      lasern enable – Off value 0
      lasern power percentage LaserController-DACn Volts
      lasern power percentage slope 0.05
      lasern power percentage offset 0.0

      Motor

      UI Property Device Property
      lasern enable LaserController-PWM State
      lasern enable – On value 1
      lasern enable – Off value 0
      lasern power percentage LaserController-PWM Volts
      lasern power percentage slope 0.01
      lasern power percentage offset 0.0

This repository consists of the hardware, firmware, and software design for the Laser Controller system. It is divided into four main sections:

  • Electronics: Schematic and PCB design files for the laser controller.
  • LaserControlFirmware: C/C++ firmware for the Raspberry Pi Pico.
  • GrussmayerLab-LaserController: C++ Micromanager Device Adapter to drive the laser controller.
  • LaserControlGUI: Java-based plugin for Micromanager, built upon the EMU plugin.

Table of Contents

Overview

The Laser Controller project integrates hardware and software components to control a laser system. It consists of:

  1. Hardware: Electronics, including a schematic and PCB design, for laser control.
  2. Firmware: Raspberry Pi Pico firmware (C/C++) managing communication with the hardware.
  3. Software: A Java plugin for MicroManager, based on the EMU plugin framework, along with a C++ Device Adapter for MicroManager.

Folders

Electronics

This folder contains the hardware designs for the laser controller:

  • Schematic: Electrical design for the laser control system.
  • PCB Design: Printed circuit board design files created using KiCAD.

Files in this folder:

  • schematic.kicad_sch: Schematic file.
  • pcb.kicad_pcb: PCB design file.

For more details, refer to the KiCAD Documentation.

LaserControlFirmware

Firmware for the Raspberry Pi Pico, written in C/C++, responsible for controlling the laser system.

Files in this folder:

  • main.cpp: Main program code.
  • CMakeLists.txt: CMake configuration.
  • README.md: Firmware setup instructions.

LaserControlGUI

Java-based plugin for Micromanager, allowing control of the laser system.

Files in this folder:

  • LaserPanel.java: Laser slide panel code.
  • MyFrame.java: Main plugin UI containing multiple LaserPanel instances.
  • MyPlugin.java: Main plugin class implementing the UIPlugin interface.

Getting Started

Hardware Setup

  1. Review Hardware Files: Use KiCAD to view schematic and PCB design files in the Electronics folder.
  2. Assemble the PCB: Using gerber.zip, bom.csv, and laser_controller-top-pos.csv, you can assemble your PCB at JLCPCB for approximately $100.
  3. Connect Components: The board has JST S3B-PH-K-S (LF)(SN) connectors. Buy compatible cables and modify them as needed.

Firmware Setup

  1. Flashing Precompiled Firmware:

    • The compiled UF2 firmware is already included in the repository.
    • Hold the BOOTSEL button on the Raspberry Pi Pico, connect it to a PC via USB, and it will appear as a USB drive.
    • Copy the UF2 file to the drive, and the Pico is programmed.
  2. Optional: Building from Source: If you wish to modify the firmware, install the following tools:

    Clone the repository and build:

    git clone https://github.com/GrussmayerLab/LaserController.git
    cd LaserControlFirmware
    mkdir build
    cd build
    cmake ..
    make

Software Setup

  1. Install MicroManager 2.0:

    • Download and install the latest version of MicroManager 2.0. Copy the precompiled EMU folder (provided) into the root directory of MicroManager.
  2. Install the EMU Plugin (for source code editing):

    • If you wish to modify or extend the plugin, follow the instructions on how to install EMU:
  3. Install LaserControlGUI Plugin:

    • To enable the LaserControlUI plugin, export the Java project from Eclipse into the EMU folder in MicroManager.
  4. Install the Device Adapter:

    • Copy the mmgr_dal_GrussmayerLab-LaserController.dll file in the root directory of MicroManager.
    • If you need to configure or extend the device adapter, follow the MicroManager Visual Studio setup guide. After setting up your project, place .h files in the header folder and .cpp files in the source folder. Compile the project, and place the resulting .dll file in the root directory of MicroManager.
  5. Hardware Configuration:

    • Run MicroManager and open your hardware configuration.
    • Add the GrussmayerLab-LaserController driver in your configuration and make sure to select a baudrate of 115200.
    • Make sure maxVolts is set to 5.0 for DAC0 to DAC5 and 1.0 for PWM.
  6. Use the LaserControlGUI Plugin:

    • Open the LaserControlGUI plugin from EMU.

    • Configure the properties of the EMU plugin as follows:

      Lasers

      UI Property Device Property
      lasern enable LaserController-DACn State
      lasern enable – On value 1
      lasern enable – Off value 0
      lasern power percentage LaserController-DACn Volts
      lasern power percentage slope 0.05
      lasern power percentage offset 0.0

      Motor

      UI Property Device Property
      lasern enable LaserController-PWM State
      lasern enable – On value 1
      lasern enable – Off value 0
      lasern power percentage LaserController-PWM Volts
      lasern power percentage slope 0.01
      lasern power percentage offset 0.0

Contribution

Contributions are welcome. Whether you're enhancing firmware stability, refining hardware design, or extending the MicroManager plugins, focused pull requests with clear explanations help keep the project maintainable. Open an issue if you'd like to discuss a feature or improvement before implementing it.

Usage

  1. Start MicroManager.
  2. Open the LaserControlGUI plugin.
  3. The plugin will interface with the Raspberry Pi Pico, allowing laser control via MicroManager.
  4. Use the sliders to set the lasers and motor.

License

Software in this project is licensed under the MIT License and hardware is licensed under CERN OHL - see LICENSE file for details in the licenses folder.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published