Skip to content
doomke edited this page Jul 10, 2023 · 23 revisions

Welcome to the XR Twin Lab wiki, where you can find everything concerning the physical side of our twin lab setups.

General

XRTL strives to make standard optical lab equipment like mirrors and lasers remote controllable by adding cheap electronics including actuators, sensors and cameras. We provide 3D-printable attachments that allow to secure the electronics to the equipment without permanently altering it. The components are capable to communicate their current state and any changes with a remote server using socket.io.

graph TB
    hardware(hardware)
    ESP32(ESP32)
    server[server]

    ESP32 -- controls --> hardware
    hardware -- reads --> ESP32
    ESP32 -- status --> server[server]
    ESP32 <-- command --> server
Loading

We chose espressifs ESP32 family to act as the bridge between the physical and virtual world in our setups, as those microcontrollers are comparably cheap, powerful and easy to use due to the widespread availability of dev boards. The dev boards are very flexible and offer a large number of input and output pins, a variable number of different actuators and sensors might therefore be connected to each individual microcontroller depending on the setup. To accomodate this variability, this project is organized in modules that can be dynamically added to an individual dev board.

Each module is independent and encapsulates a specific task, e.g. driving a motor, by keeping track of all necessary parameters and handling events (including instructions by external sources). The currently available modules along a short description can be found below. Details about the communication protocol are described on the module design page.

Setting up a specific component poses three particular challenges:

  1. installing the necessary hardware including power supplies and wiring
  2. flash the firmware
  3. configure modules

Firmware

The firmware is the software that gets installed on the ESP32 and handles all interactions with the server and the hardware. It comes as a pre-compiled binary file that needs to be flashed onto the ESP32 prior to use. The firmware is hardware specific only in the way that different versions are needed for a specific types of dev board to accomodate major board differences like pin configurations. Other than the board type no further adjustment to the firmware have to be made, every other adjustment to fit the experiment is done by configuring the settings of the ESP32. Essentially, after the firmware has been flashed, modules can be added, deleted or edited by simply changing the settings.

You can find a short guide to flash a pre-compiled binary in our guide section or you can compile the binary yourself using platform.io by cloning this repository (recommended for experienced users only).

Modules

Name Description
camera stream camera images to the server
infoLED simple display device indicating information like connection status or active movement
input read and convert voltages, monitor and relay values
macro group other modules by defining more complex states and executing several instructions at once
output switch a voltage to control actuators directly or by PWM
servo manage position, speed and power state of a servo motor
socket establish connection to the socket server, send and receive events
stepper manage position, speed and power state of a stepper motor
wifi establish and maintain connection to a wireless network

Installing the Hardware

Depending on the task at hand, requirements of how to connect the hardware elements to the ESP32 microcontrollers vary. Though connecting all actuators and sensors "by hand" is the fastest way to get started, using a connection PCB is highly recommended:

  • supply voltage and ground are routed to the connectors automatically
  • common USB power supplies can be used to power equipment
  • routing errors are much less likely
  • easier to maintain, modify and re-use than soldered connections
  • low cost even for small numbers of PCBs

Details on how to connect a certain module to the existing hardware can be found on the individual module hardware pages.

General

Guides

Principle of Operation

Modules

Software Hardware
camera camera
infoLED infoLED
input input
macro macro
output output
servo servo
socket socket
stepper stepper
WiFi wifi

Clone this wiki locally