No description
Find a file
2026-05-18 15:06:46 +07:00
eld2 Reworked structure 2026-04-01 12:29:26 +07:00
em2rs Reworked structure 2026-04-01 12:29:26 +07:00
icpcon Reworked structure 2026-04-01 12:29:26 +07:00
lir Reworked structure 2026-04-01 12:29:26 +07:00
rf256 Reworked structure 2026-04-01 12:29:26 +07:00
standa Reworked structure 2026-04-01 12:29:26 +07:00
trid Reworked structure 2026-04-01 12:29:26 +07:00
utilities Reworked structure 2026-04-01 12:29:26 +07:00
.gitignore Reworked structure 2026-04-01 12:29:26 +07:00
Cargo.toml fix: remove stale workspace members moved to ngtu_1_2 2026-05-18 15:06:46 +07:00
README.md Reworked structure 2026-04-01 12:29:26 +07:00

Slit Controller

A system for controlling four motors with encoder feedback, designed for slit control in optical systems.

Project Overview

  • rf256: Library for communicating with RF256 linear encoder
  • standa: Library for controlling Standa motor controllers
  • slit_controller: Main application that combines these libraries to control a multi-axis slit system

Architecture

The system is designed with a multi-threaded architecture:

+-----------------------------+
| 1. Communication Thread     |  <-- Async, handles client commands
| 2. Controller Thread        |  <-- Owns MultiAxis, executes actions
| 3. State Monitor Thread     |  <-- Polls controller for positions/states
+-----------------------------+
           Shared via channels
  • Communication Layer: Handles Unix domain socket connections, parses commands, and sends them to the controller
  • Controller: Owns the MultiAxis controller, executes actions like move, stop, etc.
  • State Monitor: Polls the controller for positions and states of axes, makes them available to clients

Client Communication

Clients can connect to the Unix domain socket and send commands in the following format:

  • move:{axis}:{position} - Move an axis to a specific position
  • stop:{axis} - Stop movement of an axis
  • get:{axis}:{property} - Get a property of an axis
  • set:{axis}:{property}:{value} - Set a property of an axis

Where:

  • {axis} is the axis index (0-3)
  • {property} can be: position, state, velocity, acceleration, deceleration, or position_window
  • {value} is the new value for the property

Client Command Examples

You can communicate with the slit controller using standard Unix tools like nc (netcat) or socat:

Using netcat (nc)

$ nc -U /tmp/slit_controller.sock
get:0:position
move:1:10.5
stop:2

Using socat

$ socat - UNIX-CONNECT:/tmp/slit_controller.sock
get:0:position
move:1:10.5
stop:2