It includes an illustration of the proposed framework and a description of the methodology used to achieve real-time simulation of a digital twin-driven smart factory. The system is designed to be flexible, support growth, and protect user privacy through the integration of Edge AI and federated learning.8. The following subsections provide an overview of both the main features of the architecture and the operational processes.
Platform overview
The proposed architecture consists of three layers. Physical layer is a term used for manufacturing floor systems. At this level, sensors, actuators, PLCs and industrial machines constantly provide current data on temperature, vibration, torque and throughput.9. Together, these nodes on the edge make up the edge intelligence layer. Edge nodes such as Jetson Nano, Raspberry Pi, and industrial IoT gateways are physical assets that allow them to host AI models and simulators that are lightweight enough to run on them. These machines operate within an environment, perform computations, and collaborate to learn from each other through federated learning. Functional Mockup Units (FMUs) for real-time physical modeling are also implemented in this area using engines that follow the Functional Mockup Interface (FMI) standard.10. At the heart of the model is a cloud server that coordinates model training, shares global updates, and organizes the system. It also stores a digital version of the factory and provides a dashboard to view and analyze data.
Physics-based engine for co-simulating in real time
The behavior of specific factory equipment is accurately mimicked through a co-simulation engine developed using FMI standards. All subsystems within the factory (robotic arms, conveyors, milling machines, etc.) are modeled using functional mockup units that enable multi-domain simulation (mechanical, thermal, electrical) on many edge devices.
The following are particularly important aspects.
-
Ensures that there are no timing differences between the physical and virtual parts of the system.
-
Hybrid modeling uses both continuous equations and logical discrete controls.
-
Manage latency: Adjust simulation resolution as needed to improve prediction accuracy depending on task severity.
Integrating FMU with edge AI models:
All Functional Mock-up Units (FMUs) are deployed on the same edge device (such as Jetson Nano or Raspberry Pi) along with a lightweight Edge AI module. Integrated according to the Functional Mock-up Interface (FMI) standard. Provides real-time sensor data and simulation state to the AI module via an event bus. This bidirectionality streamlines physical measurements and simulations at each time step. AI models typically use low-latency MobileNet or Tiny-YOLO models (3-5 convolutional layers, ReLU activation) and are trained with the Adam optimizer (0.0010.005 learning rate, batch size 32). These edge models are used to provide local updates through Federated Learning. This allows global optimization without exchanging raw data.
Edge AI Converter
The Edge AI module is leveraged on all edge nodes for problem detection, prediction, and workflow optimization. This type of application uses lightweight neural networks (such as MobileNet or Tiny-YOLO) to classify or measure sensory data.11. Millisecond response times can be achieved through inference running directly on the device. Adaptive low-power method: Allows the model to adjust both accuracy and power consumption.
Federated learning module
We employ a federated learning approach, which allows distributed edge nodes to collaborate without sharing data. How training works: All edge nodes learn using the data and only upload gradients to the central node for aggregation.12. Aggregation strategy: The cloud controls model updates by aggregating updates and redistributing the merged global model. Data privacy is enhanced using differential privacy and homomorphic encryption during gradient exchange. Nodes participate in the training process when possible and leverage the asynchronous FL version when other nodes are unavailable. In addition to distributed training, the proposed federated learning model can be extended to organize product lifecycle processes across multiple factories. FL enables continuous improvement of production strategies by securely accumulating lifecycle data, including design changes and maintenance results, without compromising valuable intellectual property. This idea is consistent with recent research on federated learning-enabled smart manufacturing and product lifecycle management. Model updates capture product evolution, design intent, and performance feedback to ensure global optimization of distributed plants and protection of proprietary data.
Communication middleware
Communication between systems using different hardware and software is easy, and the system integrates:
-
OPC integrated architecture: To enable different industrial equipment and digital twins to communicate with each other on a regular basis.
-
MQTT/CoAP: Enables edge devices to quickly and reliably communicate messages with cloud aggregators.
-
simulation event bus: This custom middleware ensures that all FMUs start and end their tests at the same time.

A simplified diagram of the system model.
A simplified diagram of the system model is shown in Figure 3.
Workflow overview
-
1.
Receives information from sensors on factory machines in real time.
-
2.
Edge AI takes rapid actions on information at the point of data collection, such as fault detection.
-
3.
The FMU uses real, continuous sensor data to model the performance of the required parts.
-
4.
Federated training may apply updates to the model on all edge nodes.
-
5.
Both of these results and insights are available in a cloud dashboard so anyone can view them, plan for the long term, and provide feedback.

In Figure 4, the modular and hierarchical structure of the system allows it to achieve high performance, operate very quickly, and maintain data sovereignty, scalability, and the ability to handle tight constraints. All of these are necessary for today's smart factories.13. The system designed for digital twin-powered smart factories consists of three layers that support instant physics-based collaborative simulation using edge AI and federated learning. First, the physical layer consists of industrial robots, belt systems, and sensors that generate information in real time. Edge layer devices use AI and physics to access this data and perform simulations using functional mockup units. These sensors are automated so they can detect problems, predict system failures, and streamline processes with low-latency results.14. This layer aggregates distributed AI models through Federated Learning, ensures data privacy, and continuously improves the system's intelligence.15. The main dashboard allows operators to view system performance in real time. This architecture enhances manufacturing security, scalability, and responsiveness by incorporating distributed intelligence and high-quality simulation. In the proposed system, the physical layer, edge layer, and cloud layer all contribute to realizing a smart factory that protects privacy and can operate in real-time with controlled and intelligent functions.
physical layer:
This layer includes machines, sensors, actuators, and programmable logic controllers (PLCs) that continuously collect real-time data across the network. These are important for AI insights and also for physically-based computer modeling.
edge layer:
Edge nodes (such as Jetson Nano or Raspberry Pi) are placed close to the machine and enable local data processing. They not only provide real-time inference for AI models such as fault detection and anomaly detection, but also Functional Mock-up Units that enable simulation of systems using the Functional Mock-up Interface standard.16. Support quick decision making and keep your data private.
cloud layer:
The orchestration server receives new model updates from edge nodes that are working with Federated Learning. To create a global model, work with FedAvg or similar methods to distribute the model to edge devices. In the cloud, system metrics are displayed on dashboards, factories are digitally modeled, and long-term planning and analysis can be performed.17. This architecture provides continuous synchronization between factory equipment and its software twin, enabling rapid response and collaborative learning across factory units without impacting scalability or personal data privacy.
Pseudocode: Federated Edge-CoSim Optimizer (FECO).
input:
DI → The sensor signal is sent by edge node i in real time. Node i has a functional mockup unit that simulates physics. The model for node i is called M.I model.
Tsynchronize → How often simulations are synchronized.
Tflorida → How often updates generate new global models.
θI → represents the weight used at node i.
A → Ability to combine different models (e.g. FedAvg).
Initialize:
θI Pre-trained weights are set.
t=0.
Loop: When the factory is running.
Run for each edge node separately.
-
1.
Record the value Dthat) From physical sensors.
-
2.
Prediction: ythat) =MI(D that)).
-
3.
Simulate:S that)= f (S that)D that)).
-
4.
As mentioned above, Rthat) = α * y that) + (1 – α) * S that).
-
5.
When the coefficient of t is divided by TfloridaIt's 0:
-
a.
M requires local training.IIn DI.
-
b.
The output of the new computational model is θ.I new −θi.
Send the measurement from the instrument (denoted as Δθ).I to cloud aggregators.
As part of a cloud aggregator:
If the time in milliseconds
Aggregation: θ* = A({ΔθI})
Returns the updated angle θ* to all nodes.
Synchronize the simulation:
If the current time
Let each node send a delta state δSIVia the network.
Update: S i(t+1)=Sthat)+ β * (average supply – Sthat)).
Update time: t = t + 1.
Main features:
Sets the known interval for Tsynchronizesynchronization in simulation space, and for Tfloridathe update rate on the FL side.
-
Hybrid method: Uses both information from the AI and physical principles found in the FMU to determine actions. Ensure dispersion.
-
Simulation accuracy: Regular synchronization of virtual states ensures that multi-node co-simulations run accurately.
