Robotic-3D-DIC is an automated imaging acquisition system designed for high-throughput studies. It integrates robotic automation with imaging hardware to capture images at predefined sample positions. The system facilitates synchronized movements and image captures between an ABB robot, Basler cameras, and an Arduino microcontroller.
- System Requirements
- Installation and Setup
- Usage
- Signal Mapping and Communication Flow
- Acknowledgments
- Operating System: Windows (required for Basler Pylon Software)
- Cameras: Basler cameras compatible with the Pylon SDK
- Microcontroller: Arduino Uno or a compatible board
- Robot: ABB robot with RAPID programming capability
- Software:
- Basler Pylon Software
- Anaconda Python Distribution
- Arduino IDE
Download and install the Basler Pylon Software from the official website:
Installation Steps:
- Profiles: Select Developer during installation.
- Interfaces: Choose USB as the interface type.
Download and install Anaconda for Python 3.x from the official website:
-
Open Anaconda Prompt.
-
Execute the following commands:
conda create --name Robotic-3D-dic python=3.8 conda activate Robotic-3D-dic pip install pypylon opencv-python pyfirmata reportlab
Download and install the Arduino IDE from the official website:
- Open the Arduino IDE.
- Navigate to Tools > Manage Libraries.
- Search for Firmata and install it.
- Go to File > Examples > Firmata > StandardFirmata.
- Upload the StandardFirmata sketch to your Arduino board.
Before running the experiment, you must set up a configuration file (typically named config.json) that specifies system parameters. The configuration is validated at startup, so ensure all required keys are provided and are of the correct type.
Top-Level Keys:
-
experiment_name(string):
The name of the experiment.
Example:'TestExperiment' -
number_of_samples(integer):
The number of sample positions to capture images from during each run.
Example:9 -
interval_minutes(integer, default:30):
The break interval (in minutes) between consecutive runs. -
total_runs(integer, default:-1):
The total number of runs to perform. Use-1for an indefinite number of runs until manually terminated. -
output_folder(string):
The directory where captured images, CSV logs, and the PDF report will be saved. -
display_scale_factor(number, default:0.5):
Factor used to scale images for display. -
display_images(boolean, default:true):
Whether to display images during acquisition. -
turn_off_cameras_between_runs(boolean, default:true):
If set totrue, the cameras will be turned off during the break interval between runs. -
interval_calculation_mode(string, default:'constant_interval'):
Defines how the break interval is calculated. Allowed values are'constant_interval'and'constant_break'.
Camera Settings (camera_settings object):
-
width(integer):
The image width in pixels. -
height(integer):
The image height in pixels. -
exposure_time(number):
The exposure time in microseconds. -
exposure_mode(string, default:'Manual'):
Sets the exposure mode. Allowed values:'Manual': Uses the specifiedexposure_time.'Continuous': Enables auto-exposure continuously.'SetOnce': Auto-exposes once per sample capture and then uses the learned exposure.
-
scale_factor(number):
(If needed) Scale factor used for generating the PDF report’s camera settings section.
Arduino Settings (arduino_settings object):
-
input_pins(object):
A mapping of Arduino digital input pins. Must include:DO_CAPTURE(integer): Pin used to detect a capture signal from the robot.DO_RUN_COMPLETE(integer): Pin used to detect when a run is complete.
-
output_pins(object):
A mapping of Arduino digital output pins. Must include:DI_RUN(integer): Pin used to signal the robot to start a run.DI_CAPTURE_COMPLETE(integer): Pin used to signal the robot that image capture is complete.
-
auto_detect_port(boolean, default:false):
If set totrue, the system will attempt to auto-detect the Arduino port. -
port(string, required ifauto_detect_portisfalse):
The COM port or device file for the Arduino connection.
Below is an example config.json file:
{
"experiment_name": "TestExperiment",
"number_of_samples": 9,
"total_runs": -1,
"interval_minutes": 30,
"interval_calculation_mode": "constant_interval",
"turn_off_cameras_between_runs": false,
"output_folder": "captured_images",
"display_scale_factor": 0.25,
"display_images": true,
"camera_settings": {
"width": 2448,
"height": 2048,
"exposure_time": 100000,
"exposure_mode": "Manual"
},
"arduino_settings": {
"port": "COM3",
"auto_detect_port": true,
"input_pins": {
"DO_RUN_COMPLETE": 6,
"DO_CAPTURE": 7
},
"output_pins": {
"DI_RUN": 2,
"DI_CAPTURE_COMPLETE": 3
}
}
}Note: Adjust the parameters to match your experimental setup, including the number of samples, camera settings, and Arduino pin configurations.
-
Connect Hardware:
- Ensure that the Basler cameras are connected via USB.
- Connect the Arduino to your computer via USB.
- Set up the ABB robot and ensure it is connected to the Arduino via the appropriate I/O channels.
-
Activate the Anaconda Environment:
conda activate Robotic-3D-dic
-
Run the Main Script:
python main.py
-
Follow On-Screen Instructions:
- The script will display a header and prompt you to start the experiment.
- Type
'start'to begin or'quit'to exit. - The experiment will run according to the configuration settings.
- The script provides logging information about the experiment's progress.
The Robotic-3D-DIC system uses digital signals to synchronize operations between the ABB robot, the Arduino microcontroller, and the Python software. This section explains how these signals are mapped, their directions, and how they facilitate communication between the components.
DO_CAPTURE: The robot sets this signal HIGH to indicate that it is in position and ready for the Python software to capture images.DO_RUN_COMPLETE: The robot sets this signal HIGH to indicate that it has completed a run.
DI_RUN: The Arduino sets this signal HIGH to tell the robot to start a run.DI_CAPTURE_COMPLETE: The Arduino sets this signal HIGH to tell the robot that image capture is complete, and it can proceed to the next position.
The following table summarizes the signals, their Arduino pin assignments, directions, corresponding variables in the Python code, and descriptions:
| Signal Name (Robot) | Arduino Pin | Direction | Python Variable | Description |
|---|---|---|---|---|
DI_DIC_0 |
Pin 2 | Arduino → Robot | DI_RUN |
Arduino signals the robot to start the run |
DI_DIC_1 |
Pin 3 | Arduino → Robot | DI_CAPTURE_COMPLETE |
Arduino signals that image capture is complete |
DO_DIC_0 |
Pin 6 | Robot → Arduino | DO_RUN_COMPLETE |
Robot signals that the run is complete |
DO_DIC_1 |
Pin 7 | Robot → Arduino | DO_CAPTURE |
Robot signals to start image capture |
Notes:
- Direction: Indicates the flow of the signal. For example, "Robot → Arduino" means the robot sets the signal, and the Arduino reads it.
- Arduino Pin: The digital pin number on the Arduino board where the signal is connected.
- Python Variable: The variable name used in the Python code (
main.py) to reference the pin.
- Arduino: Sets
DI_RUNHIGH to signal the robot to start the run. - Robot: Waits for
DI_RUNto be HIGH before beginning the run.
-
Robot: Moves to the first sample position.
-
Robot: Sets
DO_CAPTUREHIGH to signal the Arduino/Python that it is ready for image capture. -
Arduino/Python:
- Detects
DO_CAPTURErising edge (0 -> 1). - Initiates image capture and save using the cameras.
- Sets
DI_CAPTURE_COMPLETEHIGH to signal the robot that image capture is complete.
- Detects
-
Robot:
- Waits for
DI_CAPTURE_COMPLETEto be HIGH before moving to the next position. - Resets
DO_CAPTUREto LOW after acknowledgingDI_CAPTURE_COMPLETE.
- Waits for
-
This process repeats for each sample position.
- Robot: After completing movements to all sample positions, sets
DO_RUN_COMPLETEHIGH to indicate the run is complete. - Arduino/Python:
- Detects
DO_RUN_COMPLETErising edge (0 -> 1). - Resets
DI_RUNto LOW to acknowledge the run completion.
- Detects
- Robot:
- Waits for
DI_RUNto be LOW before resettingDO_RUN_COMPLETEto LOW. - Ends the run and returns to the home position.
- Waits for
- Python Software:
- Enters a break period as configured (e.g., 30 minutes).
- After the break, repeats the process starting from step 1 for the next run, if applicable.
- Author: Özgüç B. Çapunaman
- Maintainers: Özgüç B. Çapunaman, Alale Mohseni
- Institution: ForMatLab @ Penn State University
- Year: 2025
Please cite our work if you use our codebase in your research.
@article{Capunaman2025,
author = {Çapunaman, Özgüç Bertuğ and Mohseni, Alale and Dombrovskij, Dennis and Yin, Kaiyang and Gürsoy, Benay and Mylo, Max D.},
title = {A Robotic Framework for High-Throughput and Multi-View 3D Digital Image Correlation (3D-DIC): Increasing Measurement Volume and Versatility for Deformation Analysis},
journal = {SSRN Electronic Journal},
year = {2025},
doi = {10.2139/ssrn.5384450},
url = {https://ssrn.com/abstract=5384450}
}