BoardRepo electronics project sharing
100%
Open file
micromanipulatorstepper ball_alignment_disc_pcb view

Imported from GitHub: 0x23/MicroManipulatorStepper · commit 9d18a57 · license MIT

Description

A sub-micrometer 3D motion control plattform.

README

Python API

This folder contains a lightweight Python interface for the Open Micro-Manipulator serial protocol, plus two small example scripts:

  • usage_example.py: homes the device, performs a simple move, and prints device state information.
  • calibration_plotter.py: runs joint calibration for the first three actuators and plots the returned data.

Requirements

Install the Python dependencies with:

python -m venv env
source env/bin/activate
pip install -r requirements.txt

The API itself is implemented in open_micro_stage_api.py.

Serial Port Selection

Both scripts support:

  • --list-ports: list detected serial devices and exit
  • --port <PORT>: explicitly select a serial port

If --port is not provided, the scripts try to choose a port automatically:

  1. If exactly one detected device contains Pico in its name, that port is used.
  2. Otherwise, if there is exactly one detected serial device, that port is used.
  3. Otherwise, the script lists the available ports and exits.

Running The Example Script

From this folder:

python usage_example.py --list-ports
python usage_example.py --port /dev/ttyACM0

On Windows, a typical command looks like:

python usage_example.py --port COM3

Running The Calibration Plotter

From this folder:

python calibration_plotter.py --list-ports
python calibration_plotter.py --port /dev/ttyACM0

The calibration script opens a matplotlib window with the measured calibration curves.

Running From The Repository Root

If you prefer to run the scripts from the repository root, use:

python software/PythonAPI/usage_example.py --port /dev/ttyACM0
python software/PythonAPI/calibration_plotter.py --port /dev/ttyACM0