EDI – Elektronikas un datorzinātņu institūts
Back to news

16 November 2026

Not a factory for the robot, but a robot for the factory

The EDI team meets Madara Cosmetics representative Raimonds Ziediņš.

EDI develops a reconfigurable robotic system, with its potential also assessed by Madara Cosmetics

Researchers at the Institute of Electronics and Computer Science (EDI) have developed an AI-based robotic system that finds bottles on its own, determines how to grasp them, tracks a moving target and places the bottle into a conveyor slot. Latvian cosmetics manufacturer Madara Cosmetics has also shown interest in the technology, assessing its potential from the perspective of real-world production.

Many factories still have jobs in which a person must repeat the same technical action for hours: pick up a product, position it, sort it or pass it on to the next production stage. Such tasks can be monotonous and physically exhausting, yet automating them is not always easy. Production changes: the same line may need to handle products of different sizes and shapes, and packaging, volumes and process configurations change too. A traditional robot is very good at repeating one precisely programmed movement, but every product change may require new programming and system adjustments. That is why one of the challenges of modern robotics is to create systems that can adapt to change, taking over repetitive and technically precise work while letting people focus more on process supervision, quality and tasks that require experience and decision-making. This is exactly the kind of more flexible automation EDI researchers are working to develop. At first glance, the task seems almost too simple: take a bottle from a box and place it in its designated spot on a conveyor. A person does it almost without thinking.

A section of the Madara Cosmetics production line, where a worker takes bottles out of boxes and places them into conveyor holders, or slots

For a robot, it is a completely different story

A bottle in the box may lie at a different angle from the previous one. There may be several other bottles next to it. Their shape, size, colour and weight vary. The place where the bottle must go is not fixed either: the slots move along the conveyor, may stop, start moving again or shift slightly.

And the margin of error is just a few millimetres

This is precisely the problem that a team of EDI researchers led by Dr. sc. comp. Kārlis Freivalds has been tackling in recent years, developing a reconfigurable, AI-based robotic conveyor feeding system within the European research project AIMS5.0. EDI is the lead partner of this demonstrator, working together with Harokopio University and the Budapest University of Technology and Economics.

The idea is relatively simple but technologically complex: to create a robot that does not need to start from scratch for every new bottle and production situation.

A robot that not only moves, but also sees

In traditional industrial automation, a robot is extremely precise as long as the environment stays the same: the object is always in the expected place, the conveyor runs at a set speed, and movements can be programmed in advance.

Modern manufacturing, however, increasingly demands smaller product batches, more frequent packaging changes and the ability to use one production line for several products. Here the advantage goes to a robot that does not merely repeat one programmed movement but can respond to what it “sees” at that moment.

In the EDI demonstrator, this vision is provided by cameras and several computer vision algorithms. First, the system finds the bottles in the image, separates the selected bottle from the background and, using depth information, builds a spatial, three-dimensional representation of it. The bottle’s position and orientation in space are then determined so that the robot can calculate a suitable grasp.

Next, the robotic arm grasps the bottle and moves it towards the conveyor. But that alone is not enough. As the robot approaches the conveyor, the system must at the same time find a free bottle slot and track its position. The vision algorithm developed can distinguish between empty and occupied slots, and their positions are re-estimated from consecutive camera frames. This is essential because the slots are not rigidly attached to the conveyor: they can move, stop and start again regardless of the conveyor’s nominal speed.

Bottle and slot perception: the system detects and segments bottles, then selects the bottle closest to the robot with the highest confidence score. Using spatial information, its pose is estimated and a grasp is prepared. The bottle slot is detected and marked with a bounding box, with particular attention paid to locating the slot’s centre so that the robotic arm can place the bottle as close to the centre as possible.

When two millimetres is a lot

The final stage of the movement, inserting the bottle into the slot, is one of the most difficult. In the tested configuration, the bottle diameter is about 32 millimetres and the slot is 36 millimetres. This leaves only about two millimetres of clearance on each side. If the camera or robot misjudges the target position by a few millimetres, the bottle can no longer drop freely into the slot. That is why it is not enough for the robot to look at the conveyor once, calculate a trajectory and then execute it “blindly”. It must be able to react while moving.

EDI’s solution combines classical robotics methods with machine learning. Picking up the bottle relies on pre-computed, collision-aware motion planning, while in the final stage the system switches to adaptive control. A neural network controller receives information about the robot’s state and the target slot’s position and continuously corrects the movement.

Learning first in a virtual world

One of the methods used by EDI researchers is so-called differentiable physics. Put simply, the computer builds a physical model of the robot and its surroundings and lets the algorithm “try out” movements in a virtual environment. If, in the end, the bottle has not reached the right place or its angle is wrong, the system can mathematically calculate how the earlier movements should have been changed. In this way, the neural network gradually learns how the robot should act in different situations.

Training uses both scenarios with a stationary target in various positions and situations where the slot moves and stops at a location unknown to the robot in advance. The benefit of this approach is not only speed. Some experiments can be done virtually, without stopping the factory line or risking damage to the robot or products.

But simulation is not a perfect copy of the real world. Friction, camera errors, mechanical tolerances and even a tiny mismatch between the virtual and physical environments can affect the result. That is why one of the researchers’ key tasks is the so-called sim-to-real problem: ensuring that movements learned in simulation work just as reliably on a real robot. In the EDI demonstrator, every command generated by the neural network is additionally checked by a safety layer before being sent to the physical UR5e robot. This layer limits the robot’s speed and acceleration and checks whether the planned movement poses a risk of collision. If a dangerous situation is detected, the command is not executed. In this way, the solution trained in simulation is complemented by the safety mechanisms needed to work with a real robot in a real production environment.

Tasks change, but there is no need to build a new system

Perhaps the most important word in the name of EDI’s solution is not “robot” or “artificial intelligence”, but “reconfigurable”.

In manufacturing, a product does not stay the same for years. New packaging appears, the bottle’s shape or size changes, or the conveyor layout is altered. If every such change means a new specialised machine and lengthy programming, automation can become economically unviable, especially for smaller product batches.

EDI’s architecture is therefore modular. Object recognition, pose estimation, grasp planning, slot detection and robot control each work separately. When one product element changes, the relevant part of the system can be reconfigured without rebuilding the whole solution.

For example, in tests the slot detection algorithm took less than 15 milliseconds to process a single image and achieved an overall detection accuracy of 98.7%. Adapting the system to a different slot type or camera angle, including image preparation and additional model training, took about three hours in the experiment.

This is not yet a universal robot that can be taken to any factory and start production five minutes later. But it shows the direction: from rigidly programmed automation towards systems that can be adapted much faster.

“The value of the solution is not the ability to perfectly repeat a single movement, but the ability of the robot to adapt to a changing situation.”

From the laboratory to cosmetics production

To keep the researchers’ technology from becoming a solution to a problem that exists only in the lab, dialogue with companies that could use such systems is essential. On 13 August, a representative of Madara Cosmetics saw the EDI demonstrator in person. During the visit, the researchers demonstrated the system and discussed its possible use in real production processes. The company representative gave a positive assessment of the work and shared practical observations on using the solution in an industrial setting. Possible future cooperation and tailoring the technology to specific production needs were also discussed.

The cosmetics industry illustrates the need for flexible automation particularly well. A single manufacturer may have many different bottles, vials and packaging shapes, and the product range changes over time. In such an environment, a robot that can adapt to new packaging with relatively small changes to software and object models can be more valuable than a very fast machine designed for just one product.

Robotic bottle placement demonstration: the robot places bottles into conveyor slots using the control and perception system developed by EDI.


Computer vision system in action: the monitor shows bottle and slot detection and position estimation used to control the robotic system.

Industry 5.0: not a robot instead of a person, but more flexible production

The EDI demonstrator was developed within the international project AIMS5.0 (Artificial Intelligence in Manufacturing leading to Sustainability and Industry 5.0). The project aims to promote the use of artificial intelligence in European manufacturing while increasing its sustainability, flexibility and competitiveness. EDI’s task in the project is to build a modular, reconfigurable robotic system that can handle bottles of different sizes, weights and types, and whose individual technologies can also be used in other settings.

It is also a broader story about the next generation of automation. Robots in factories are nothing new. What is new is that they increasingly no longer need to live in a world where everything has to be precisely positioned and programmed in advance. The camera lets the robot see. Artificial intelligence lets it interpret what it sees. Simulation lets it learn. And adaptive control lets it correct its actions when reality turns out to be a little different from what was planned.