Existing machine software taken over: sorting machine buildable again, faults fixed, development continued
EPSIA took over the existing software of a sorting machine for a technology group in precious metal processing. Several external developers had worked on the software before; the existing source code could no longer be turned reliably into a working release version.
EPSIA first established a reproducible build and release environment, then analysed the machine sequences and software architecture, and developed a diagnostic version for faults during live operation. Based on the data collected, faults were fixed in a targeted way. Today EPSIA maintains and develops the machine software on a continuous basis.
- 32,791lines of existing C++ code taken over and developed further
- 2,654changes in the inherited code history since 2022
- 10assemblies with their own state machines
- 90I/O signals and 4 servo axes on one control PC
The case study follows the project in seven steps: takeover, machine, system analysis, diagnostics, fault fixing, further development and result.
1 Takeover: source code without a reproducible build
The software of the sorting machine had been worked on over several years by a changing cast of external developers. The operator had the source code, but no longer a reliable way to produce a reproducible, working version of the machine software from it.
This made further development and systematic troubleshooting considerably harder. Even small changes to the machine sequences carried the risk of not being able to ship a reliably reproducible software version.
In 2024, EPSIA took over the existing software, reviewed and archived the source code and dependencies, and built its own reproducible build and release environment from them with the existing range of functions.
This first created a defined technical baseline for all further work.
2 Machine: measuring and sorting precious metal balls
The machine sorts small precious metal balls by diameter. Feeding and separation bring the balls one by one onto a sorting wheel, which carries them in cycles to a camera with its own flash control.
Image processing measures each ball. The control software then assigns it to a collection container depending on the article and the measured diameter class. Which classes apply to an article and which container is assigned to which class is set in the relevant process configuration.

The existing system includes the following, among others:
- Control
- Linux-based control PC with C++ and Qt; ten assemblies are controlled by their own state machines.
- Drives
- Four Elmo servo drives via EtherCAT for feeding, separation, sorting wheel and lift.
- Inputs and outputs
- 90 I/O signals via six Beckhoff terminals on EtherCAT, for doors, signal lights, push buttons, vacuum, compressed air and valves, among others.
- Safety
- Emergency stop and door monitoring are implemented through separate safety equipment; the machine software processes the states relevant to operation.
- Image processing
- MVTec HALCON for measuring the balls and a separate flash control based on an ESP32.
- Other components
- Serial communication with the electronics of the collection containers, another microcontroller and a power supply.
Scope of the inherited software
- Machine software
- 32,791 lines of C++ in 372 files, plus 9,150 lines of Qt user interfaces
- Flash control
- 1,951 lines of C++ for the ESP32 with PlatformIO
- Changes
- 2,654 in the code history since 2022
- Assemblies
- 10 with state machines
- Axes
- 4 Elmo servo drives via EtherCAT
- I/O signals
- 90 on 6 Beckhoff terminals
3 System analysis: understanding machine sequences together with the operator
After the technical takeover of the software, EPSIA analysed the behaviour of the real machine together with the operator.
In November 2024, machine sequences, assemblies, interfaces and known faults were worked through systematically on site. In the process, the existing source code was compared with the actual behaviour of the machine.
This analysis produced a development agenda. It set out which areas of the system needed closer investigation first and which existing problems had the highest priority for production.
4 Diagnostics: reconstructing machine states after a fault
A large share of the reported faults occurred only during live production and could not be reproduced on demand. The available information was therefore not enough for a sound fault analysis.
In 2025, EPSIA developed a new software version with extended diagnostics and logging. The software records relevant states, transitions and sequences of the individual assemblies so that the machine's behaviour after a fault can be traced over time.
Faults no longer had to be investigated from their visible effects alone. The diagnostic information showed which states and events had actually occurred immediately before a fault.
5 Fault fixing: changes based on measured sequences
Based on the diagnostic information, EPSIA fixed existing faults step by step. Each change was implemented in its own software version and then checked in the live production environment.
The changes made include, for example:
- After a production stop, the lift is returned to its home position in a defined way.
- Lift positioning takes a corrected offset into account.
- A defined service position can be approached directly, which makes maintenance easier.
- Additional diagnostic messages record critical machine states and sequence transitions.
The extended diagnostics remain part of the software and so also support the analysis of future faults.
6 Further development: modernising existing software step by step
Once the existing system had been stabilised, EPSIA took on the ongoing maintenance and further development of the machine software.
New requirements are assessed together with the operator and implemented as defined software versions. In parallel, a technical plan for a wider modernisation of the system was drawn up.
It covers, among other things, step-by-step adaptation of the hardware connection, camera and network communication, a virtual development and test environment, communication with the collection containers, machine sequence and production control, as well as build, release and test processes.
This allows the modernisation to proceed in clearly defined steps without having to replace the existing system all at once.
7 Result: from non-reproducible legacy software to continuous development
EPSIA has turned software that was hard to maintain back into a defined technical basis for the continued operation and further development of the sorting machine.
- The existing source code once again produces a software version that can be built reproducibly and shipped.
- Architecture, machine sequences and technical interfaces were analysed systematically.
- Extended diagnostics make states and sequences traceable when sporadic faults occur.
- On this basis, specific faults in the control software were identified and fixed.
- EPSIA now maintains and develops the machine software on a continuous basis.
- A technical implementation plan is in place for a wider modernisation.
What does this project stand for?
The project shows the typical course of a software takeover by EPSIA: first, the existing software is secured and made buildable reproducibly again. Then the architecture, interfaces and the behaviour of the real machine are analysed.
Where the available information is not enough for troubleshooting, EPSIA adds targeted diagnostic functions to the software. Faults are fixed and further changes made only on the basis of the data collected.
Step by step, legacy software that was initially hard to maintain becomes a software system again that can be built, diagnosed and developed further in a traceable way.
How does a software takeover with EPSIA start?
At EPSIA, the takeover of existing machine or system software starts with an assessment of the legacy system at an agreed fixed price.
EPSIA takes over and analyses the existing software and, where technically possible, first produces a reproducible, working version. The assessment documents the technical condition of the software, relevant dependencies and risks, and the steps needed for further maintenance or modernisation.
The results of the assessment belong to the customer and can be used even if EPSIA is not commissioned with the subsequent implementation.
More on this service under Takeover and modernisation of existing software.
Key facts
- Industry
- precious metal technology and special-purpose machine building
- Period
- since July 2024, ongoing
- Technology
- C++, Qt, Linux, MVTec HALCON, EtherCAT, Elmo servo drives, Beckhoff I/O, serial interfaces, ESP32, PlatformIO.
