Shaver foil machine for Procter & Gamble: developed on a digital twin
EPSIA developed the complete control software for an automated production machine at Procter & Gamble's Braun plant in Kronberg. The machine automates peeling the pre-nickel foil off shaver foils and coordinates 21 servo axes and 210 digital I/O signals to do so.
Even before the mechanical system was fully assembled, EPSIA developed and tested control sequences and operation on a digital twin. Simulation and real machine use the same control software; only the hardware connection is swapped.
- 21servo axes and 210 I/O signals in one control system
- 1control software for the real machine and the digital twin
- 97,181lines of C++ code generated from the machine description
- 9software packages since commissioning
The case study follows the project in seven steps: order, digital twin, architecture, machine description, commissioning, further development and result.
1 Order: Control software for a new automated production machine
In the electroplating of shaver foils, a pre-nickel layer must be separated from the foil strips before further processing. This step used to be done by hand and was to be automated with a new machine.
Procter & Gamble specified EPSIA as the developer of the control software for the new machine. The original order was placed through the machine builder. Since 2022, EPSIA has worked directly for the Braun plant in Kronberg and continues to maintain the software.
2 Digital twin: The machine was built virtually first
Based on the 3D design data, EPSIA created a digital twin of the machine in Unity. The simulation covered conveyor belts, stack lifts, singulation, gantry and gripper, as well as the separation station and shredder, among other things.
This allowed the control software to be developed while the real machine was still being mechanically assembled. On the digital twin, EPSIA developed and tested machine sequences, operating functions and defined fault cases before the corresponding real components were fully available.

3 Architecture: One control software for simulation and real machine
EPSIA built the control software on a hardware abstraction layer. Through configuration, the software connects either to the real inputs and outputs, drives and sensors or to the corresponding components of the digital twin.
Sequence control, business logic and user interface are identical in both modes. Large parts of the real software behaviour can therefore be developed and tested in simulation without maintaining a separate software version.


The control software integrates a range of components:
- Drives
- 21 Elmo servo axes via CANopen – from the stack conveyors to the separation station.
- Inputs and outputs
- 210 digital signals via 17 Beckhoff I/O terminals on EtherCAT. As specified by the customer, CANopen and EtherCAT run separately.
- Image processing
- MVTec HALCON detects foil strips and foil types; an additional tear-off check verifies the result.
- Machine access
- When the guard is unlocked, the affected drives are de-energised and their positions saved. After locking, the drives are re-enabled one after another in a controlled way.

4 Machine description: 8,733 lines of description become 97,181 lines of C++
EPSIA describes key parts of the machine declaratively: sequences, parameters, inputs and outputs and drives are defined in a structured machine description.
From this, iSDK, the base system developed by EPSIA, automatically generates large parts of the control system's C++ source code. 8,733 lines of machine description produce 97,181 lines of generated C++ code. When something changes, this code is regenerated reproducibly.
Recurring structures therefore do not have to be programmed by hand for every machine function, and they stay consistent across the whole machine.
Scope of the machine software
- Machine description
- 8,733 lines in 66 files, 278 sequences with 311 steps
- Generated from it
- 97,181 lines of C++ code in 316 files
- Developed by hand
- 13,782 lines of code in 118 files
- iSDK base system
- 88,562 lines of code, developed since 2016
- Total
- 199,525 lines of code, 976 classes, 3,377 changes
- Axes
- 21 Elmo servo drives via CANopen
- I/O signals
- 210, via 12 × EL1819 and 5 × EL2809
- Simulation
- Unity
5 Commissioning: Software development before the mechanics were finished
Thanks to the digital twin, key parts of the control software were developed and tested before the mechanical system was finished. Commissioning on the real machine could therefore focus more on the interaction with the actual mechanics, sensors and actuators.
In 2022, EPSIA carried out several partial commissionings at the Braun plant in Kronberg. The machine has been in production since 2022/23.
Besides the machine sequences themselves, the control software includes user and permission levels, recipe management, I/O and motor monitoring, automatic shift change, production counters and statistics per shift.

6 Further development: Testing changes on the digital twin first
Since commissioning, EPSIA has developed the control software further in nine software packages. These include additional service functions, statistical evaluations and optimisations of the machine control.
Changes are first tested on the digital twin before they are deployed on the production machine. Many software sequences can therefore be tested without taking the real machine out of production.
Procter & Gamble later also adopted the digital twin as its own virtual test system. This lets the customer check machine sequences and software versions independently of the production machine.
Maintenance and further development of the software by EPSIA is currently agreed until mid-2027.

7 Result: A manual production step automated
Since 2022/23, the software stack developed by EPSIA has controlled an automated production machine at the Braun plant in Kronberg, automating a step that was previously done by hand.
- The control software coordinates 21 servo axes and 210 digital I/O signals.
- The real machine and the digital twin use the same control software.
- Key machine sequences can be simulated and tested independently of the production machine.
- Since commissioning, nine further software packages have been integrated without having to redevelop the overall system.
- Procter & Gamble has its own virtual test system for software and machine sequences.
What does this project stand for?
The project shows how EPSIA decouples software development from mechanical machine building in time. Control logic and operation can take shape on the digital twin while the real machine is still being designed and assembled.
Thanks to the hardware abstraction, no separate simulation version of the control software is needed. The same application logic runs with simulated or real hardware. After commissioning, the digital twin remains available as a test environment for changes and extensions.
How long did it take to reach commissioning?
It took around one year from the order in May 2021 to the first partial commissionings at the Braun plant in Kronberg.
The main order was carried out as a fixed-price project with defined milestones. Extensions after commissioning were then offered and implemented as separate software packages.
How does a system project with EPSIA begin?
A system project with EPSIA can start with an architecture check at an agreed fixed price. In it, EPSIA analyses the hardware connection, machine sequences, interfaces and requirements for later operation.
The result describes the software components needed, how they interact and a sensible order for implementation. On this basis, a functional specification and a fixed-price quotation for the subsequent development can be drawn up.
For suitable machines and systems, hardware simulation can be part of the software architecture from the start.
More about this service under Software development for hardware systems.
Key facts
- Customer
- Procter & Gamble, Braun plant Kronberg
- Service
- Hardware-related systems
- Industry
- Consumer goods manufacturing and electroplating
- Period
- since 2021, maintenance currently until mid-2027
- Technology
- C++, Qt, iSDK, CANopen, EtherCAT, MVTec HALCON, MySQL, MongoDB, Electron, Unity.
