Open Access Article
Xuan
Cao
*a,
Yuxin
Wu
a and
Michael L.
Whittaker
*ab
aEnergy Geosciences Division, Lawrence Berkeley National Laboratory, Berkeley, CA 94720, USA. E-mail: caoxuan8872@gmail.com
bMaterials Science Division, Lawrence Berkeley National Laboratory, Berkeley, CA 94720, USA. E-mail: mwhittaker@lbl.gov
First published on 12th January 2026
Despite the rapidly growing applications of robots in industry, the use of robots to automate tasks in scientific laboratories is less prolific due to the lack of generalized methodologies and the high cost of hardware. This paper focuses on the automation of characterization tasks necessary for reducing cost while maintaining generalization and proposes a software architecture for building robotic systems in scientific laboratory environments. A dual-layer (Socket.IO and ROS) action server design is the basic building block, which facilitates the implementation of a web-based front end for user-friendly operation and the use of ROS Behavior Trees for convenient task planning and execution. A robotic platform for automating mineral and material sample characterization is built upon the architecture, with an open-source, low-cost three-axis computer numerical control gantry system serving as the main robot. A handheld laser induced breakdown spectroscopy (LIBS) analyzer is integrated with a 3D printed adapter, enabling (1) automated 2D chemical mapping and (2) autonomous sample measurement (with the support of an RGB-Depth camera). We demonstrate the utility of automated chemical mapping by scanning the surface of a spodumene-bearing pegmatite core sample with a 1071-point dense hyperspectral map acquired at a rate of 1520 bits per second. Furthermore, we showcase the autonomy of the platform in terms of perception, dynamic decision-making, and execution, through a case study of LIBS measurement of multiple mineral samples. The platform enables controlled and autonomous chemical quantification in the laboratory that complements field-based measurements acquired with the same handheld device, linking resource exploration and processing steps in the supply chain for lithium-based battery materials.
Similarly, robotic automation in research laboratories has become an emerging field, since “Robotics and automation can enable scientific experiments to be conducted faster, more safely, more accurately, and with greater reproducibility, allowing scientists to tackle large societal problems in domains such as health and energy on a shorter timescale”.5 Although there have been successful applications of robotic automation in laboratories,6–10 the use of robots to automate laboratory operations is still limited in general due to the automation gap caused by the variety of tasks and protocols,11 ultimately resulting in high costs.
This work sheds some light on the automation of characterization tasks in labs, which determine the properties, composition, and behavior of substances (e.g. spectrometry, microscopy, thermal analysis, etc.), and hence are essential in scientific research. One common pattern in characterization tasks is sample-move-instrument-stay (SMIS), where a sample is placed at a specific position for an analytical instrument to start working. Automating this pattern using robots requires precise pick-and-place operations and enough degrees of freedom.
By contrast, this paper focuses on the sample-stay-instrument-move (SSIM) pattern, where an instrument is held by a robot and moved around a sample during characterization. Automating this pattern does not require pick-and-place operations since the instrument is mounted on the robot all the time. Sample standardization, such as positioning on a 2D horizontal plane, reduces the robot's required degrees of freedom to reach the samples, which could potentially lower the hardware cost.
Towards this end, this paper introduces a robotic platform for automating SSIM characterization tasks for mineral and material samples. The platform consists of (1) a low-cost 3D (translational movements in X, Y, and Z directions) gantry system commonly used in traditional computer numerical control (CNC) machining as the primary robot, (2) an analytical instrument mounted to the gantry system for sample characterization, and (3) a stereo camera capable of depth sensing for locating samples to be measured. All components and samples to be measured are placed on a benchtop. The general workflow consists of the following steps: (1) a sample location is either predefined or identified by the camera; (2) the gantry system moves the analytical instrument to the sample location; (3) the instrument starts characterization and collects raw data; (4) the raw data are processed and optional feedback is generated.
The core of the software is a generalized custom-designed architecture for automation systems in laboratory environments. The basis of the architecture is a dual-layer action server design for every hardware component, which monitors incoming operation requests through both Socket.IO12 and Robot Operating System (ROS)13 communication protocols and commands the hardware to act accordingly. On top of all action servers lies a Behavior Tree (BT)14 which orchestrates the hardware components by interacting with their action servers to automate the characterization workflow. A web-based front end is developed to ensure user-friendly operations of the platform, including both manual control of each individual hardware and execution of the BT.
To showcase the efficacy of the platform, we integrate a handheld laser induced breakdown spectroscopy (LIBS) analyzer with the gantry system and use the platform in two case studies. In the first case study, dense LIBS scanning is performed on the surface of a spodumene-bearing pegmatite core sample with 1071 measurement points, each containing optical emission spectra between 190 nm and 950 nm with 0.03 nm resolution, corresponding to 22
800 data channels per measurement. The resulting 2 × 107 data are automatically quantified using a custom algorithm, yielding spatially resolved, comprehensive chemical analysis with parts-per-million levels for most chemical elements. In the second case study, autonomous perception, dynamic decision-making, and execution are demonstrated by measuring mineral samples, one of which is moved from inside to outside of the platform's hypothetical reachable area during the measurement. The platform is capable of identifying which samples have been measured and which have not, recognizing changes in sample locations, dynamically adjusting its plan, and executing the plan accordingly. The autonomous LIBS characterization (1) frees researchers from tedious operations, (2) accelerates LIBS characterization by at least 3 times the rate of manual operations, and (3) provides crucial information about downstream processing chemistry.
This paper makes three contributions. First, a generalized software architecture for building robotic automation systems in scientific laboratory environments is proposed. Second, a low-cost gantry system commonly used in CNC machining is shown to be capable of working as a robot for the automation of SMIS characterization tasks. Third, automated dense LIBS scanning using the developed robotic platform and automatic data reduction is achieved.
Industrial robotic arms, installed either on benchtops6 or mobile bases,9,10 have been used to automate lab-level experimental protocols, by handling samples, transferring samples between instruments, and operating instruments. Though these applications of robotic arms were successful, few technical details were reported in ref. 6, 9 and 10 with respect to the automation systems, such as individual instrument control, multi-instrument integration, and high-level planning and execution. There have been other automation systems for more narrowed down tasks in laboratory environments with more technical details reported, such as solid dispensing,7 liquid handling,15 operating reactors,8 simple sample pre-treatments followed by mass spectrometry characterization,16 and mobile robot navigation in a distributed lab.17 However, the approaches introduced in ref. 7, 8 and 15–17 are ad hoc and can be difficult to generalize. In contrast to these studies, this work explores replacing industrial robotic arms with a low-cost 3D translation gantry system for SSIM-pattern characterization tasks based on a generalized software architecture for laboratory automation systems.
This work chooses LIBS18 as the characterization probe to validate the robotic platform's competency. Plain LIBS measurement is point-wise19 and some extra effort must be made to achieve LIBS scanning. Some LIBS devices can perform a small step raster pattern within their laser aperture20 but will not suffice for large samples. Another common approach is putting a sample on a 2D or 3D (X–Y or X–Y–Z) translation stage and moving the sample with respect to the laser beam,21–23 which in theory can handle large samples, but falls into the SMIS pattern, which can be challenging to automate. By contrast, this work presents SSIM-pattern LIBS scanning, which is suitable for large samples and easier to automate with a lower budget.
operated in a laboratory environment. A device can be either a scientific instrument (e.g. a furnace, a balance, a spectrometer, etc.) or a robotic tool (e.g. a robotic arm, a gripper, a camera, etc.). Each device
can perform a set of actions, denoted by
, where
indicates that devices may have different numbers of actions. For example, a balance's action set can be
and a gripper's action set can be
. Let
be the set of all actions of all devices. Then, the automation of an experimental protocol
, a sequence of sets of actions, can be denoted by
. In other words, at any step t, there can be either one action or multiple actions running. One automation system may need to handle multiple protocols. Let
be the set of protocols handled by one automation system.
We propose that the software for orchestrating
to achieve
should satisfy the following properties: modularity, adaptability, scalability, distributed system support, ROS integration, and user-friendly operation. Explanations of these properties are listed in Table 1. Next, we introduce the dual-layer action server software design as a basic building block and justify the complete software architecture built upon it.
| Desired property | Explanation | Software architecture justification |
|---|---|---|
| Modularity | The software can be separated into independent modules to enable flexible and reusable implementations | The dual-layer action server blocks, BT and front end have minimal connections with each other |
| Adaptability | The software can be adapted easily for changes in experiments or protocols | The system achieves different experimental protocols by simply executing different BTs |
| Scalability | It should be convenient to add more devices to the existing system | New dual-layer action server blocks can be easily added without changing existing action server blocks |
| Distributed system support | The software can be deployed to separate machines since devices can take a high space span | The dual-layer action server blocks, BT and front end can all run on separate machines within the same local area network |
| ROS integration | ROS is a widely used set of software libraries and tools for building robotic applications and the software should allow easy integration with ROS for using existing resources | The ROS layer allows convenient integration with ROS |
| User-friendly operation | The software should be easy to learn and use, especially for non-experts of computer science | The front end allows user-friendly operation |
and handles a set of experimental protocols
. Then, the dual-layer action server block for each device
(pink dashed box) builds up the foundation of the software architecture. On top of all action server blocks lies a BT14 for planning and executing an experimental protocol
by incorporating ROS action clients corresponding to the ROS action servers and structuring the switching between action sets in
. In other words, the BT orchestrates
and tells each device
what to do in real time according to
by interacting with the ROS action servers. In practice, multiple BTs are implemented beforehand to account for various experimental protocols in
and users can choose the one to execute that best fits their needs. The last piece of the architecture is a web-based front end to ensure user-friendly operations of the automation system. The front end has dual responsibilities: it (1) communicates with the devices via the Socket.IO layer to allow efficient monitoring and manual control of the system and (2) connects with the ROS layer through roslibjs25 to enable convenient execution of the BT, which is usually implemented within ROS. The designed software architecture is justified in Table 1 according to the desired properties proposed in Section 3.1.
An analytical instrument is mounted to the gantry head and approaches samples placed on the working area and performs measurement. A handheld LIBS analyzer (Z300, SciAps) is used as the analytical instrument for validating the experiment efficacy of the platform (see details in Section 5). Other characterization probes, such as handheld X-ray fluorescence (XRF) and Raman spectroscopy, can be mounted to the gantry with custom 3D printed adapters. The LIBS analyzer is capable of quantifying the presence of any element on the periodic table, subject to limits of detection that depend on the absolute and relative concentrations, with a spectral range of 190 to 950 nm. We use LIBS to show lithium-rich regions of a mineral sample that will undergo further processing into lithium-ion battery cathode materials.
A stereo depth camera (ZED 2i, StereoLabs) is used to provide the gantry with visual information of samples. It outputs red, green and blue (RGB) images with a resolution of 1920 × 1080 at a frequency of 30 frames per second (FPS) and depth images with a depth range of 0.3 to 20 m at a frequency of up to 100 FPS.
![]() | ||
| Fig. 4 The web-based front end of the robotic platform implemented specially for the experiment described in Sections 5 and 6. | ||
Formally, let [u, v]⊺ denote the point's 2D pixel location in the camera's RGB image, Pc = [xc, yc, zc]⊺ denote that point's 3D location in the camera's coordinate frame Fc, and Pw = [xw, yw, zw]⊺ denote the point's 3D location in the world coordinate frame Fw. The values of u and v are already known from the camera's RGB image. The value of zc is also known from the camera's depth image. The values of u, v and zc need to be converted to Pw so that the gantry can carry the LIBS analyzer to the sample location to complete measurement.
First, the values of xc and yc are computed based on the classic pinhole camera model using the following equations:
| xc = (u − cx) × zc/fx, |
| yc = (v − cy) × zc/fy, |
Second, Pc is transformed back to Pw with a linear transformation using the following equation:
and
are the rotational and translational transformation matrices from Fw to Fc and can be computed by the OpenCV32
function. The
function requires a set of points with world coordinates and corresponding image pixel coordinates as inputs. A way to prepare those inputs is to image a black-and-white chessboard pattern with known world coordinates of corners and use the OpenCV
function to compute the corresponding image pixel coordinates of corners.
One drawback of LIBS is that it only measures one point at one time and would be inefficient for nonhomogeneous samples. To address that issue, we demonstrate a dense LIBS scan of a sample surface using the developed platform. This is a particularly useful technique for materials containing lithium, such as the spodumene (LiAlSi2O6)-bearing pegmatite core sample shown in 5, because LIBS is one of only a few techniques that provide both high fidelity and spatial localization for lithium.
![]() | ||
| Fig. 5 The surface of the spodumene-bearing pegmatite core sample cut using a diamond saw for the LIBS scan experiment. The dashed box indicates the area for the LIBS scan. | ||
The LIBS analyzer uses a Nd:YAG laser source with a wavelength of 1064 nm and a pulse energy of 5 mJ for sample ablation. It is equipped with an on-board spectrometer covering a spectral range of 190 to 950 nm. Before laser ablation argon is flushed to purge the sample surface as well as create an atmosphere that enhances LIBS signals.33
Data is automatically reduced in four steps. First, peaks are found and the background is identified and subtracted from the raw spectrum to produce a data spectrum. Then, peaks are fit with Voigt profiles. Third, the fitted profile is subtracted from the data spectrum and peaks are fit to the residuals to identify interfering peaks. Finally, peaks are indexed to specific elements using an iterative refinement. Fig. 6 shows an example of the automated data reduction.
The automated scan process is planned and executed by a specially designed BT (shown in Fig. 7). At the beginning, the BT stores the locations of all points to be measured. For one single point, the gantry first moves up to a safe level, then carries the LIBS analyzer to the location of the point, and finally moves down to align the analyzer's aperture with the point. After that, the analyzer triggers a laser pulse and collects raw LIBS data, which is exported to a csv file and further analyzed by the algorithm described in the previous paragraph. Then, the BT removes that location from the list of all locations. The BT ends when all points have been measured. Note that the BT is designed in a way that it would pick up any previously failed action before moving forward, ensuring the stability of the scan.
The primary hardware components, including the gantry, camera, and computer (but excluding the LIBS analyzer), cost about $3000, $550, and $1100, respectively, which is much more affordable than a commonly used robotic arm alone (e.g., a UR5e robotic arm manufactured by Universal Robots costs around $40000). However, the tradeoff is that a commercial robotic arm usually has at least 6 degrees of freedom (3D translational movements + 3D rotational movements) and can handle a wider range of automation tasks. Even so, the gantry-based approach would be a better choice for tasks with lower requirements of degrees of freedom and prototyping new automation systems with lower budgets.
The function of the robotic platform is not limited to LIBS characterization; rather, it depends on the tool(s) that can be integrated with the platform. It is possible, and future work should explore integrating other analytical instruments like a handheld XRF analyzer and tools like an electronically controlled pipette with the platform to cover a wider range of laboratory tasks.
The software architecture is derived from a general scenario of laboratory automation problems and should work well for other laboratory systems in addition to the developed platform. Future work should further validate the generalizability of the software architecture by developing other robotic systems or expanding the current platform.
Future work may also include the quantitative reduction of LIBS measurements to absolute concentrations and its inclusion in the feedback loop of the platform's decision-making process. In-depth LIBS data analysis is a separate task and is outside the scope of the current study, but its integration into the workflow described here would enable sample identification based on chemical composition and downstream planning based on chemical labels, in addition to location and dimensional labels.
Future work should add other or more analytical instruments, like an XRF analyzer, to the robotic platform to perform more types of characterization tasks. Future work should also combine other types of tools, like an electronically controlled pipette, with the platform. Another interesting direction for future work is integrating the platform into larger laboratory automation systems to complete more complex experimental protocols in parallel with a focus on workflow management and device orchestration. Lastly, future work should obtain quantitative results from raw LIBS spectra and use those in the feedback loop of the platform's decision-making process.
| This journal is © The Royal Society of Chemistry 2026 |