Design and Control of Modular Magnetic Millirobots for Multimodal Locomotion, Shape Reconfiguration and Grasping
The project presents a modular magnetic millirobotic platform capable of:
- Single-module locomotion using Helmholtz and Maxwell coil inputs.
- Multimodal reconfiguration into chains, squares, and grippers.
- Closed-loop navigation with real-time vision feedback and A* path planning.
All functions are achieved at low magnetic field strengths (<13 mT) using a compact 2-D electromagnetic setup.
The framework consists of three layers:
- Arduino firmware for low-level current control of electromagnetic coils.
- Python framework for experiment orchestration, computer vision, recording, and autonomous path planning.
- MATLAB tools for post-processing and statistical analysis of recorded trajectories.
- Magnetic actuation control via serial communication with external drivers.
- Vision-based module detection (
moduleDetection.py) using OpenCV for real-time tracking. - Finite State Machine (FSM) (
FiniteStateMachine.py) for handling motion commands and transformations. - Path planning mode with goal setting and automated trajectory visualization.
- Sequence execution (
Sequences/) for predefined current input patterns. - Automated recording and analysis with trajectory overlays, merge detection, and reconfiguration logging.
MIP/
├── Arduino/
│ ├── EMS.ino # Arduino code for coil current control
│ └── originalPWM.ino # Legacy version
├── MATLAB/
│ ├── Trials/ # Raw trial data
│ ├── DataAnalysis.m # Post-processing and plotting
│ ├── *.png / *.xlsx # Analysis figures and datasets
├── Python/
│ ├── Images/ # Module configuration dataset
│ ├── Basic Interfacing/ # Camera, calibration, serial tools
│ ├── Sequences/ # Predefined coil actuation sequences
│ ├── main.py # Main entry point (control + recording)
│ ├── pathPlanning.py # Path planning and trajectory execution
│ ├── FiniteStateMachine.py # FSM for command-based motion simulation
│ ├── moduleDetection.py # Vision-based module detection and tracking
│ ├── README.md # Project documentation
- Modular robot platform with electromagnetic coil actuation.
- Arduino microcontroller controlling 4 coil channels.
- USB camera for live vision-based tracking.
- DC power supply with current-limiting enabled (safety-critical).
- Gaussmeter (optional) for magnetic field calibration.
Safety: Ensure coil currents do not exceed 10 A on HX/HY channels. Always enable current limiting on the power supply.
-
Arduino IDE (to flash
EMS.ino) -
Python 3.9+ with:
opencv-pythonnumpymatplotlibpyserial
-
MATLAB (for analysis & plotting)
Install Python dependencies with:
pip install -r requirements.txtFlash Arduino/EMS.ino to the Arduino board. This program receives serial commands to set coil currents.
Use Python/Basic Interfacing/fieldCalibration.py to generate calibration curves with a gaussmeter. Alternatively, serial_interface.py provides direct manual current control.
Launch:
python Python/main.pyFeatures include:
- Manual control: enter custom current values.
- Predefined sequences: run stored coil actuation sequences.
- Autonomous path planning: select goals in live workspace view; system computes A* path and executes movements.
- All experiments can be recorded (AVI format).
- Trajectories and merge/reconfiguration events are detected automatically.
- After each run, playback allows saving/discarding videos and generating trajectory overlays.
Run MATLAB analysis with:
DataAnalysis.mThis script:
- Loads CSV files generated during experiments.
- Computes statistics across experiments.
- Generates publication-ready plots (e.g., displacement, trajectory variance, time to merge).
-
Upload firmware to Arduino.
-
Start main control:
python Python/main.py
-
Select a sequence (e.g.,
seq1) or enter manual currents. -
Record and replay the experiment.
-
Save trajectory outputs (PNG overlays, merge/reconfiguration logs).
-
Analyze results in MATLAB with
DataAnalysis.m.
Each experiment can produce:
- Videos (AVI) – raw and annotated recordings.
- Trajectory plots (PNG) – full and interval-based overlays.
- Merge/reconfiguration logs (TXT) – timing of module interactions.
- CSV files – displacement, centroid coordinates, and experimental metadata.
- MATLAB figures – summary statistics and comparative plots.
