-
Notifications
You must be signed in to change notification settings - Fork 1
Home
Welcome to the XR Twin Lab wiki, where you can find everything concerning the physical side of our twin lab setups.
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
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:
- installing the necessary hardware including power supplies and wiring
- flash the firmware
- configure modules
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).
| 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 |