Next Article in Journal
Energy-Efficient CO2 Conversion for Carbon Utilization Using a Gliding Arc/Glow Discharge with Magnetic Field Acceleration—Optimization and Characterization
Previous Article in Journal
Optimal Scheduling of Integrated Energy Systems Considering Oxy-Fuel Power Plants and Carbon Trading
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Incorporating a Deep Neural Network into Moving Horizon Estimation for Embedded Thermal Torque Derating of an Electric Machine

1
Teaching and Research Area Mechatronics in Mobile Propulsion, RWTH Aachen University, Forckenbeckstr. 4, 52074 Aachen, Germany
2
IMTEK—Department of Microsystems, University of Freiburg, Georges-Köhler-Allee 103, 79108 Freiburg im Breisgau, Germany
3
Donadeo Innovation Centre for Engineering, Department of Mechanical Engineering, University of Alberta, 10th Floor, Edmonton, AB T6G 1H9, Canada
*
Author to whom correspondence should be addressed.
Energies 2025, 18(14), 3813; https://doi.org/10.3390/en18143813
Submission received: 20 March 2025 / Revised: 18 June 2025 / Accepted: 21 June 2025 / Published: 17 July 2025
(This article belongs to the Section F5: Artificial Intelligence and Smart Energy)

Abstract

This study presents a novel state estimation approach integrating Deep Neural Networks (DNNs) into Moving Horizon Estimation (MHE). This is a shift from using traditional physics-based models within MHE towards data-driven techniques. Specifically, a Long Short-Term Memory (LSTM)-based DNN is trained using synthetic data derived from a high-fidelity thermal model of a Permanent Magnet Synchronous Machine (PMSM), applied within a thermal derating torque control strategy for battery electric vehicles. The trained DNN is directly embedded within an MHE formulation, forming a discrete-time nonlinear optimal control problem (OCP) solved via the acados optimization framework. Model-in-the-Loop simulations demonstrate accurate temperature estimation even under noisy sensor conditions and simulated sensor failures. Real-time implementation on embedded hardware confirms practical feasibility, achieving computational performance exceeding real-time requirements threefold. By integrating the learned LSTM-based dynamics directly into MHE, this work achieves state estimation accuracy, robustness, and adaptability while reducing modeling efforts and complexity. Overall, the results highlight the effectiveness of combining model-based and data-driven methods in safety-critical automotive control systems.

Graphical Abstract

1. Introduction

State estimation has been a critical area of research for several decades, playing a fundamental role in various engineering disciplines by providing robust and reliable feedback for control systems [1]. The mathematical foundations of state estimation can be traced back to Carl Gauss in the early 1800s, with further advancements in the 20th century, including Maximum Likelihood Estimation [2] and Linear Minimum Mean-Square Estimation [3]. However, the applicability of these early formulations to real-time systems was limited by available computational resources. As the focus of both academia and industry moved to non-linear systems, extensions such as the Extended Kalman Filter (EKF) and Unscented Kalman Filter (UKF) were developed to address non-linearities in state estimation [4,5]. More recently, research has focused on state estimation techniques that can incorporate constraints on states and parameters, like Moving Horizon Estimation (MHE) [6,7,8,9,10,11].
The main idea of MHE is to compute a state estimate x by solving an optimization problem over a finite time horizon. At each sample time, as soon as a measurement y is made available, the horizon is shifted ahead in time in a receding horizon fashion and a new estimate is calculated. Figure 1 illustrates the MHE’s operating principle using the receding horizon.
Compared to Kalman-based approaches, MHE offers improved handling of constraints, disturbances, and system non-linearities, making it a powerful tool for advanced estimation tasks [12].
A critical aspect of modern state estimation is data assimilation, which integrates sensor measurements with dynamic process models to improve the accuracy of the estimation [13]. Traditional approaches rely on physics-based models, which require detailed system knowledge and intricate mathematical formulations. However, as systems become increasingly complex, the development of precise mathematical models becomes a challenge. In addition, accurate models might be computationally too expensive in particular for real-time applications [14]. These models often involve high-dimensional equations that demand significant computational resources, making them less practical for embedded control systems with stringent latency constraints. To address these challenges, data-driven approaches such as system identification, machine learning, and deep learning have gained prominence [15,16,17,18].
Deep learning architectures, inspired by biological neural networks, progressively build representations of input data while minimizing the need for manual feature engineering [19,20]. The layers in a Deep Neural Network (DNN) consist of neurons that integrate weighted inputs via activation functions. This function introduces non-linearity that is essential for learning complex tasks. While the basic calculations within the neurons remain consistent, the arrangement of the neurons plays a crucial role in how the information is processed, giving rise to various neural network architectures. Among these, Recurrent Neural Networks (RNNs) are particularly suited for dynamic systems due to their ability to retain temporal information [21]. Long Short-Term Memory (LSTM) networks, a variant of RNNs, are especially effective for time-series modeling, as they mitigate vanishing gradient issues and capture long-term dependencies [22].
The rapid advancement of DNNs has enabled the modeling of complex non-linear relationships without explicit system equations, making them invaluable for state estimation in systems where deriving accurate mathematical models is challenging. DNN-based models provide a scalable alternative by learning system behavior directly from data, eliminating the need for complex physics-based formulations and enabling efficient real-time deployment. Several studies have successfully integrated DNNs into other state estimation frameworks, with applications in pseudo-measurement generation, parameterized EKF formulations, and RNN-based non-linear system identification [23,24,25].
Since DNNs can learn complex dependencies without prior advanced feature engineering, problems like MHE stand to benefit directly from data-driven predictors. Incorporating DNNs into the MHE framework has broadly be categorized under three categories, i.e., improving the model quality, adapting the optimization cost, or leveraging the universal approximation capabilities of DNNs to replace the MHE itself [26]. Promising results from previous studies have successfully applied this approach to different applications [27,28,29,30]. Ref. [29] developed a two-step optimization strategy where an offline learnt autoregressive LSTM model is used to estimate the state of charge of lithium-ion batteries, which is later improved using MHE through online optimization. Ref. [28] incorporated the MHE estimates obtained using a feed-forward network for unknown heating, ventilation, and air conditioning (HVAC) dynamics into an model predictive control (MPC). Despite the common optimization-based foundations of MPC and MHE, the direct integration of learned dynamic models, particularly using LSTM and DNN architectures, has predominantly been explored within control applications. Notable examples include MPC for combustion engines [31] and rapid development toolchains for low-temperature combustion processes [32]. However, directly embedding a learned dynamics model in the form of a DNN into MHE remains unexplored.
In previous work [33], an MPC was introduced for thermal torque derating of Permanent Magnet Synchronous Machines (PMSMs) in Battery Electric Vehicles (BEVs). PMSMs are widely used for automotive propulsion due to their high torque, power density, and efficiency. However, these advantages come with substantial localized heat generation, particularly under high-load scenarios, increasing the risk of permanent magnet demagnetization and insulation damage. To prevent component failures and avoid cooling system over-dimensioning, thermal derating strategies limit torque output as critical temperatures are approached [34]. Conventional, rule-based derating methods, such as linear mappings, are straightforward but neglect the thermal dynamics, resulting in overly conservative operation [35,36]. Effective thermal derating thus requires anticipation of future driving conditions and accurate modeling of the machine’s thermal response to prevent dangerous temperature overshoots. Previous research [33] focused on optimizing torque commands with a DNN-based MPC, ensuring adherence to PMSM temperature constraints within a Model-in-the-Loop (MiL) simulation, guided by a reference velocity profile derived from a Nürburgring Nordschleife lap.
Furthermore, these control methods are highly dependent on accurate sensor feedback data. Therefore, accurate state estimation is crucial. Building upon the prior work, this study proposes a DNN-based MHE to provide reliable feedback, enhance control accuracy, and ensure robust protection of the machine. The novelty of this study lies in using a learned LSTM-based dynamics model within MHE, replacing traditional white- or grey-box approaches as the MHE dynamics model. This integration aims to enhance state estimation accuracy, adaptability, and robustness, while simultaneously reducing modeling complexity and computational effort.
To provide a high-level overview of the approach and methodology, the graphical abstract in Figure 2 illustrates the key components of the proposed MHE framework. It shows the workflow of synthetic data generation using a high-fidelity, experimentally validated Lumped Parameter Thermal Network (LPTN) model, followed by DNN training for thermal state prediction of the PMSM. The trained DNN model is then integrated into the MHE within the MiL simulation setup, where the estimator processes noisy sensor measurements to reconstruct accurate system states for the MPC. The MHE, implemented using the acados optimal control framework for embedded compatibility, is then deployed on an embedded platform to assess its real-time capability.
The central objective and nature of this research is to demonstrate the feasibility of a DNN-based MHE framework. Rather than conducting quantitative comparisons of vehicle performance under MPC control, this study provides a qualitative assessment of the DNN-based MHE’s effectiveness in estimating temperature states and its robustness against injected sensor faults.
By demonstrating the feasibility of integrating DNN-based MHE within an MPC-controlled system, this research paves the way for next-generation data-driven state estimation strategies. The fusion of deep learning with real-time optimal control unlocks new potential for intelligent, adaptive, and computationally efficient estimation frameworks, bridging the gap between model-based and purely data-driven approaches.
The paper is divided into the DNN modeling (Section 2.1), the MHE development (Section 2.2), and the subsequent simulative and embedded integration for validation (Section 3 and Section 3.2, respectively) sections as shown schematically in Figure 2.
This research makes the following key contributions:
  • Integration of DNN with MHE: This work represents one of the first attempts to directly integrate a DNN-based model within MHE, offering a novel framework for state estimation. Instead of relying on DNNs externally to provide Supplementary Information, the MHE leverages the DNN’s learned dynamics directly within the optimization.
  • Deployment and validation on embedded systems: The feasibility of implementing a DNN-based MHE framework in real time is demonstrated. This research is also one of the first to test and validate the deployment of DNN-based state estimation on real-time hardware using the acados optimal control framework [37].

2. Materials and Methods

This section describes the development of the DNN model for thermal state prediction and its subsequent integration into the MHE framework. First, the LSTM network architecture, synthetic data generation, and training procedure are detailed. Then, the trained DNN model is incorporated into the estimator by reformulating both driving dynamics and thermal dynamics into a discrete-time optimization structure compatible with acados.

2.1. Deep Neural Network Modeling

2.1.1. Long Short-Term Memory Network

LSTMs, one of the most popular variants of RNN, have the ability to maintain a form of memory, enabling them to influence current inputs and outputs based on past sequence information [21]. To regulate the flow of data, LSTMs introduce memory cells and gate units [22]. The core computational unit of the LSTM network is called the memory cell (or simply “cell”), and these networks are primarily designed for sequence modeling while addressing the vanishing gradient problem [21,38].
Each LSTM cell consists of three gates: the forget gate, the input gate, and the output gate that regulate information flow using sigmoid ( σ ) and hyperbolic tangent (tanh) activation functions to maintain stable outputs [21]. The following equations mathematically define the operations within an LSTM cell, where each gate contributes to memory updates and output generation:
i k = σ W u , i T u k + W h , i T h k 1 + b i , f k = σ W u , f T u k + W h , f T h k 1 + b f , g k = tanh W u , g T u k + W h , g T h k 1 + b g , o k = σ W u , o T u k + W h , o T h k 1 + b o , c k = f k c k 1 + i k g k , h k = o k tanh c k ,
where W u , ( f , g , i , o ) are the weighting matrices applied to the input vector u k . W h , ( f , g , i , o ) are weight matrices of the previous hidden state  h k 1 . In this equation, ⊙, is an element-wise multiplication and b ( f , g , i , o ) are the biases. i k is the input gate, f k is the forget gate, g k is the cell candidate, o k is the output gate, c k is the cell state, and h k is the hidden state. Two activation functions are used in Equation (1) which are given as
  • tanh ( z ) hyperbolic tangent activation function:
    tanh ( z ) = e 2 z 1 e 2 z + 1 ,
  • σ ( z ) sigmoid activation function:
    σ ( z ) = 1 1 + e z .
These activation functions are used to introduce non-linearity into the otherwise linear layers. Figure 3 shows a visualization of the information flow depicted in Equation (1).
Due to the temporal dependencies in LSTMs, storing both the cell and hidden states across timesteps increases memory requirements.

2.1.2. Experimental Setup and Data Generation

The proposed state estimator, akin to the approach of previous works in [33] uses one-dimensional white-box driving dynamics and thermal black-box DNN dynamics to predict the thermal states of a PMSM and generate accurate and robust estimates [33,39]. The DNN, integrated with the state estimator, predicts the temperature gradients of the PMSM to calculate accurate thermal states of the system. For simplification, the PMSM is represented by two thermal masses ( θ w , θ r ) corresponding to measurable real-world temperatures at the test-bench of the windings and the rotor, respectively. When combined with the MPC framework, the resulting MiL simulation enables safe thermal derating of a BEV by effectively handling noisy PMSM temperature measurements while ensuring compliance with thermal constraints.
The performance and accuracy of the DNN models heavily depend on the quality and quantity of training data. To efficiently generate the required data without relying on extensive test-bench experiments, a simulation framework is employed. Within this framework, a proportional–integral (PI) driver controller computes the torque requests to the Electric Machine (EM) and friction brake based on the vehicle velocity v. These include ( T EM , acc , T EM , brk , T fric , brk ), where the torque of the EM ( T EM ) is split into acceleration and braking components: T EM = T EM , acc + T EM , brk . A one-dimensional longitudinal model utilizes these torque values to calculate vehicle velocity v veh utilizing the ordinary differential equation (ODE):
v ˙ veh = m veh 1 · ( ( T EM , acc + T EM , brk + T fric , brk ) · i diff · r dyn 1 m veh · g · sin ( ϕ ) 0.5 · c d · A c · ρ · v veh 2 m veh · g · cos ( ϕ ) · c r ) ,
where m veh = 1160 kg is the vehicle mass (including the driver), c d = 0.32 is the drag coefficient, c r = 0.011 is the rolling friction coefficient, r dyn = 0.293 m is the dynamic tire radius, and A c = 2.21 m 2 is the car’s cross-sectional area. The transmission ratio is given by i diff = 9.3 , while the maximum vehicle speed is v max = 130 km/h. ϕ depicts an external parameter and input as the road inclination defined by the driving cycle, while ρ and g are the air density and gravitational acceleration, respectively. In this study, a typical minicar BEV is used, and its parameters have been validated in previous works [39].
The relation between the vehicle speed v in Equation (4) and the rotational speed of the electric machine n EM is as follows: n EM = ( 30 · v veh · i diff ) / ( π · r dyn ) . Thus, the primary operating point of the EM, the torque T EM , and the rotational speed n EM serve as the primary inputs to the high-fidelity LPTN model, determining the rotor and winding temperature ( θ w , θ r ) of the machine, with their derivatives ( θ ˙ w , θ ˙ r ) being monitored as well. The 70-node high-fidelity LPTN model is provided by the PMSM’s manufacturer DENSO, and its parameters have been fitted using extensive experimental test-bench data. The full simulation model, implemented in MATLAB/Simulink, is depicted in Figure 4 and operates at a sample rate of 100 Hz.
A driving cycle serves as the primary predefined input for the data generation model, providing the reference velocity v ref for the PI controller and the respective road inclination ϕ . To achieve higher and thus safety critical PMSM temperatures, the WLTP Class 3 driving cycle is customized, deliberately influencing the data distribution. Figure 5 illustrates the velocity profile of the customized cycle and the corresponding temperature response, where only the winding temperature θ w is shown, as the rotor temperature remains below critical levels and is therefore omitted. The figure also highlights that a significant portion of the data lies within the machine’s safety-critical temperature range, between 150 °C and 160 °C, where permanent damage can occur.

2.1.3. Neural Network Training

The network architecture comprises four layers: the input, LSTM, Fully Connected (FC), and output layer. The LSTM layer consists of 8 LSTM cells that compute the temporal dependencies between the inputs. Figure 6 shows the architecture of the DNN used for training.
Drawing inspiration from LPTNs and the physical intuition behind heat transfer, this work models temperature evolution by predicting temperature change rates rather than absolute temperatures. Subsequently, the input features to the DNN are rotational speed of the EM n EM , torque of the EM T EM , winding temperature θ w , and rotor temperature θ r of the EM. The DNN’s output features are the gradients θ ˙ w and θ ˙ r , at timestep k. This can be summarized as follows in Equation (5):
X Train = n EM ( k ) T EM ( k ) θ w ( k ) θ r ( k ) T R 4 , Y Train = θ ˙ w ( k ) θ ˙ r ( k ) T R 2 .
The depth of a DNN directly influences computational complexity, as each additional layer increases the number of learnable parameters and matrix operations. To ensure real-time feasibility, particularly for integration with optimization techniques like MPC and MHE, the DNN’s depth and the number of recurrent nodes are constrained. The distribution of the synthetic training data generated in Section 2.1.2 is shown in Figure 7 for the two outputs θ ˙ w and θ ˙ r . The dataset, comprising 180,000 data points, is divided into a training set ( D train ) and a validation set ( D val ) in an 80:20 ratio.
The training is conducted using the hyperparameters listed in Table 1, with mean squared error (MSE) as the performance metric for supervised learning.
The algorithm of the DNN training is depicted in Algorithm 1.
Algorithm 1:Pseudo-code: LSTM network training procedure using Adam optimizer.
Require: 
Training dataset D train (80% of total dataset), validation dataset D val (20% of total dataset)
Require: 
Network architecture as defined in Figure 6
Require: 
L MSE
Ensure: 
Trained network parameters θ * (best validation loss)
1:
Initialize network parameters θ randomly
2:
Set optimizer, learning rate schedule, learning rate
3:
Set training hyperparameters: maxEpochs, miniBatchSize, gradientThreshold
4:
Initialize record: L val best , θ * θ
5:
for epoch = 1 to maxEpochs do
6:
   for each mini-batch B D (sequential mini-batches) do
7:
     Pad sequences in B to equal length
8:
     Forward pass: compute predictions y pred = f θ ( x train ) for all sequences in B
9:
     Compute loss L ( y pred , y true ) over mini-batch
10:
     Backpropagate gradients θ L (with gradient clipping at threshold 1)
11:
     Update parameters θ using Adam optimizer
12:
   end for
13:
   if current iteration is multiple of 10 then
14:
     Evaluate validation loss L val on D val
15:
     if  L val < L val best  then
16:
        Update best parameters: θ * θ , L val best L val
17:
     end if
18:
   end if
19:
end for
20:
return best-performing network parameters θ *
The resulting loss-epoch plot of the training is shown in Figure 8, while the prediction results of the final network on the unseen test dataset are depicted in Figure 9. The unseen test dataset consists of data for a simulated lap on the Nürburgring Nordschleife with its high power requirements, thus posing a major challenge to the electric drivetrain and its thermal constraints. To solve the trade-off between the DNN’s depth and thus the computational complexity and the DNN’s prediction performance, empirical studies are performed, which are omitted here for brevity. The results in Figure 9 show a good correspondence with the ground truth from the high-fidelity model, achieving an RMSE of 0.0373 °C/s and 0.0282 °C/s , and an NRMSE of 2.77% and 9.39% for θ ˙ w and θ ˙ r , respectively. Further performance metrics are depicted in Table 2.
The lower accuracy in predicting θ ˙ r can be attributed to the complexity of the high-fidelity thermal model and the weaker influence of the selected features. To be more precise, the network struggles with lower rotor temperatures due to a lack of training data in that range (see Figure 7). However, since the focus of data generation was on higher, critical temperatures, this limitation is acceptable, and the network is considered sufficiently accurate due to its superior performance on θ ˙ w .
The presentation of the DNN predictions in the time-domain of the unseen test dataset of the Nürburgring Nordschleife in Figure 10 underlines the good performance of the chosen network.
Since the neural network predicts temperature gradients, explicit first-order Euler integration with an initial temperature of θ w , r , 0 = 60   °C for both the winding and the rotor is used to visualize the absolute temperatures.

2.2. Estimator Formulation

MHE is employed to reconstruct system states by solving an optimization problem at each timestep. The optimization problem has a similar structure as an Optimal Control Problem (OCP) such that tailored solvers for OCP-structured problems can be used. Following successful training of the DNN model, the next step involves formulating the estimator and implementing it within the OCP-structure of the acados framework. Therefore, both the driving dynamics and the DNN-based thermal model are reformulated in a discrete-time, optimization-compatible form.

2.2.1. MHE Problem Formulation

The dynamics depicted here are based on a discrete-time, non-linear, time-invariant system [41]:
x k + 1 = f ˜ ( x k , w k ) , y k = g ( x k ) + v k ,
with state x X R n , measurement y Y R p , process disturbance w W R g , measurement disturbance v V R p . The non-linear function f ˜ ( x k , w k ) describing the system dynamics and the measurement model g ( x ) are now developed, bringing the DNN-based thermal model and the one-dimensional driving dynamics model in a common, discrete form.
Firstly, the driving dynamics in Equation (4) can be further summarized and discretized using explicit Euler integration of first order with integration interval δ k as
v veh , k + 1 = v veh , k + f DD ( v veh , k , T EM , acc , k , T EM , brk , k , T fric , brk , k , ϕ k ) · δ k ,
with f D D summarizing the driving dynamics equation.
Equation (1) presents the equations for an LSTM unit. This formulation is transformed into a forward-propagating process model by representing operations as equations incorporating stored weights and biases. The LSTM internal memory states—the hidden and cell states ( c , h ) —are included in the network inputs and outputs due to the unrolling of the recurrent layer. Adding the FC layer of the DNN provides the full dynamics representation of the DNN:
δ θ w , k + 1 δ θ r , k + 1 h k + 1 c k + 1 T = f DNN ( θ w , k , θ r , k , h k , c k ) ,
where function f DNN thus summarizes the complete DNN dynamics.
Finally, the absolute temperature predictions for the next timestep using explicit first-order Euler integration are defined as
θ w , k + 1 θ r , k + 1 T = θ w , k θ r , k T + δ θ w , k + 1 δ θ r , k + 1 T · δ k .
Following the dynamics from Equations (7) and (9), the functions within the MHE dynamics in Equation (6) can be further defined as
f ˜ ( x k , w k ) = f DNN f DD ( x k ) , x k + w k , g ( x k ) = f DNN ( x k ) .
Furthermore, using these dynamics, the MHE optimization problem including the objective function is defined as:
minimize x T N , x T , w T N , w T 1   1 2 x T N x - T N P 0 1 2 α k ( x k ) + k = T N T 1 1 2 w k Q 1 2 + 1 2 g ( x k ) y k R 1 2 subject   to x k + 1 = f ~ ( x k , w k ) , k = T N , T 1 ,
Here, x = ( x k , , x k + N + 1 ) represents the optimization variables, while y = ( y k , , y N ) forms the measurement window. The weighting matrices Q and R are positive definite diagonal matrices corresponding to process and measurement variances; P 0 is the weighting matrix of the arrival cost. MHE operates by optimizing on a fixed horizon of N past measurements [ T N , T ] , where past information outside the estimation window is not directly included in the optimization (see also Figure 1). The arrival cost, α k ( x k ) , addresses this by approximately incorporating information from prior states [ 0 , T N 1 ] .
This concludes the formulation of the MHE and sets the stage for the implementation into an OCP-structured NLP in the framework acados in the following subsection.

2.2.2. Implementation in Acados

State estimation is performed by minimizing the variance between system predictions and measurements. To solve the MHE optimization problem, the optimal value of the additive process noise w must be determined to yield the most accurate estimate. The noise w is thus treated explicitly as an optimization variable.
This leads to the optimization problem to be formulated as an OCP, where the process noise w is considered as the controls input. Here, the OCP is structured around four sets of variables: states x, controls u, parameters p, and measurements y, each of which is defined below.
The primary states to be estimated include the winding and rotor temperatures ( θ w , θ r ), with state evolution governed by the DNN-based thermal model. Given the recurrent nature of an RNN, its hidden and cell states ( c k , h k ) are incorporated into the state vector, resulting in an increased state dimension that depends on the number of LSTM units (here 8):
x k = θ w , k θ r , k c k h k T , R 18 .
With the process noise w k defined as an additive term, the state evolution as seen in Equation (10) can be stated as
x k + 1 = θ w , k + 1 + w θ , w , k θ r , k + 1 + w θ , r , k h k + 1 c k + 1 T = f ˜ ( x k , w k ) , R 4 .
Further, the control vector can be represented as
u k = w k = w θ , w , k w θ , r , k T , w k N ( 0 , Q ( α ) ) , R 2 .
The process noise follows a Gaussian distribution N with a variance Q ( α ) , a diagonal matrix derived from the variance of the states. This variance matrix also serves as a weighting matrix in the optimization of state estimation accuracy (see Equation (Section 2.2.1)). The MHE model utilizes past control inputs from the MPC, including T EM , acc , T EM , brk , T fric , brk , along with road inclination ϕ , and vehicle velocity v veh as inputs to predict the states. Thus, the parameter vector is defined as
p = T EM , acc , k T EM , brk , k T fric , brk , k ϕ v veh , k T , R 5 .
The measurements y, as defined in Equation (6), incorporate additive sensor noise to account for real-world inaccuracies such as offset and sensitivity errors. These errors are modeled using additive white Gaussian noise [42], along with a time delay to represent thermal lag in sensor response. Consequently, the noisy measurements ( θ w , meas , θ r , meas ) serve as inputs to the MHE:
y = θ w , meas θ r , meas T .
The term α k ( x k ) from Equation (Section 2.2.1) in the acados OCP framework encapsulates the information required for the initial node computation and arrival cost. The vectors are defined as
x 0 = θ w , k θ r , k w θ , w w θ , r θ w , k θ w , k T , x ¯ 0 = θ w , meas θ r , meas 0 0 θ ^ w , k θ ^ r , k T .
Here, θ w , k , θ r , k , w θ , w , k 1 , w θ , r , k 1 form the vector for the first node and the remaining terms serve as input for the arrival cost. In the recursive online simulation, the optimizer continuously refines the state trajectory over a moving horizon.
acados performs simulation in a forward time manner, progressing from timestep k to ( k + N ) , which corresponds to ( T N ) to T as illustrated in Figure 1. The estimated state at the final node ( k + N ) serves as the current timestep estimate T, while the state at the first node k contributes to the arrival cost for the next OCP iteration with a shifted horizon.
The control variables u k are optimized to align predictions with available measurements while accounting for uncertainty. A key feature of this approach is that the optimizer autonomously determines the optimal noise added to the state, eliminating the necessity for explicit constraints on controls. Constraints on the physical states ( θ ̲ w , θ ̲ r , θ ¯ w , θ ¯ r ) remain enforced. The various parameters settings, weighting matrices, and constraints on the OCP model are detailed in Section 3 along with the results.

3. Results and Discussion

This section presents the results of the proposed framework, beginning with the MiL simulation used to evaluate the performance and robustness of the DNN-based MHE through fault injection tests. The results also include the implementation of the MHE on an embedded platform, demonstrating its real-time capability and embedded compatibility. All findings are critically discussed to highlight both strengths and limitations of the approach.

3.1. Model-in-Loop Simulation

The MiL simulation is performed over a single lap of the Nürburgring Nordschleife test dataset, with the reference velocity v ref generated offline. The MPC tracks v ref while adhering to system constraints and determines the control variables, applied to the vehicle without any control disturbances. The resulting torque determines the vehicle velocity through the driving dynamics model, while the corresponding electric machine temperatures are computed using a high-fidelity 70-node LPTN model in the plant. To simulate realistic measurement conditions, a noise is added to the temperature values obtained from the high-fidelity plant model, yielding imprecise sensor readings. The overall simulation framework is illustrated in Figure 11.
Based on the properties and specifications of commonly used temperature sensors, a negative mean of −1 °C and variance 0.1 is applied to the added measurement noise thus resulting in ν N ( 1 , 0.1 ) . Additionally, to account for thermal lag, a 1.5  s delay is incorporated. The key parameters of the integration of the OCP-structured NLP in the acados framework are summarized in Table 3, using a linear least squares cost function. The prediction horizon T and the estimation horizon N are set to 1.5 s and 15 shooting nodes, respectively, ensuring a balance between prediction accuracy and computational feasibility. The weighting matrices ( Q , R ) are tuned based on training session data and modeled sensor noise, with a greater emphasis on arrival cost to ensure effective assimilation of past information into the estimation process.
Sequential Quadratic Programming (SQP) is used to solve the OCP-structured NLP, with a maximum number of SQP iterations of 20. The quadratic subproblems are solved using the High-Performance Interior Point Method (HPIPM) framework developed in [43] which is interfaced via acados. To further reduce computational complexity, the full estimation horizon N is condensed from 15 to 5 nodes using a partial condensing routine.
The primary focus of this study is to assess the feasibility of the MHE framework using a DNN-based plant model. Instead of quantitatively comparing vehicle performance under MPC control, the results are evaluated qualitatively to determine the effectiveness of the DNN-based state estimator in reconstructing temperature states. Given that only the winding temperature θ w is susceptible to reaching critical thresholds, the evaluation is centred on monitoring this key metric.
Figure 12 presents the winding temperature estimates generated by the MHE. A closer examination in Figure 13 focuses on the temperature range of 140 °C to 165 °C, where excessive heating poses a risk of PMSM damage. The estimated values are compared against ideal temperature profiles from the plant model and noisy sensor measurements. Despite deviations in raw sensor readings, the DNN-based MHE effectively optimizes state estimates, producing values that closely align with the ideal temperature profile.
To further evaluate the robustness of the DNN-based MHE, an experimental scenario is designed by introducing artificial sensor failures, including a high negative offset and increased noise amplitude. As shown in Figure 14, the left plot (a) illustrates the impact of a significant negative offset, while the right plot (b) demonstrates the effect of high noise amplitude.
Despite these extreme conditions, the MHE maintains stability in its outputs, preventing excessive oscillations or deviations from the true values. The ability of the DNN-based MHE to provide reliable state estimates under severe sensor disturbances underscores its robustness, reinforcing its suitability for safety-critical applications.
The results presented focus exclusively on the performance of the estimator, specifically the ability of the DNN-based MHE to reconstruct unmeasured temperature states under realistic measurement conditions and computational constraints. Metrics such as lap time or energy consumption, which characterize overall vehicle performance, are not evaluated in this study. This is a deliberate choice, as the primary objective of this work is to demonstrate a proof of concept for integrating DNNs within a MHE framework and to assess real-time feasibility. Accordingly, the vehicle dynamics are used as a validation environment rather than as benchmarks for overall system performance.
Future work could involve extending this approach by benchmarking multiple state estimation techniques—both model-based and data-driven—under identical control and vehicle simulation scenarios. This would enable a comprehensive evaluation not only of estimation accuracy and robustness, but also of their downstream impact on control performance, such as lap time, energy efficiency, and thermal safety margins.

3.2. Embedded Integration

The state estimator undergoes real-time validation following the successful MiL simulations. To assess its feasibility for real-world applications, the MHE’s real-time performance on an embedded system is evaluated, ensuring computational efficiency and compatibility with production code and control units.
For this purpose, the simulation is deployed on a SCALEXIO real-time embedded hardware-in-the-loop (HiL) system from dSPACE. The processing unit features a 3.8 GHz processor with four cores, three of which are dedicated to model computation. The MPC and MHE run as separate instances on two cores, while the third core handles the vehicle model, reference trajectory, and system interfacing. Although this system can be considered as more powerful than traditional processors in automotive engine, vehicle or sensor control units, the MHE problem itself remains computationally demanding due to its high state and control dimensions and horizon length. The necessary cross-compilation of the libraries is executed based on the embedded workflow, presented by the acados developers [44].
With a solver timestep of 100 ms, the performance of the solver is evaluated based on the corresponding processor calculation time. The solver executes a maximum of 20 SQP iterations per timestep, with a peak solver time of 28 ms and an average of 5.7 ms. Table 4 shows the relevant parameters and results of the real-time testing.
These results indicate that the DNN-based MHE achieves approximately threefold real-time capability, as each control interval permits up to 100 ms for computation, while the solver requires at most 28 ms per step. This substantial computational margin demonstrates the estimator’s suitability for real-time deployment under the tested configuration.
However, it is important to note that the real-time experiments were conducted on a powerful platform equipped with a 3.8 GHz multi-core processor. The hardware provides significantly greater computational resources than conventional automotive electronic control units (ECUs). While this setup is highly effective for prototyping and validating algorithms, it does not reflect the constraints of production-grade automotive hardware. Consequently, further evaluation on representative low-cost ECUs is essential to assess the estimator’s computational viability and optimize its implementation for series production.

4. Conclusions

This research introduces a novel state estimation framework that integrates DNNs into MHE, replacing conventional physics-based models with data-driven approaches. This innovation enhances adaptability and computational efficiency, making it suitable for real-time applications.
Using extensive synthetically generated data from a high-fidelity thermal model, a DNN featuring LSTM nodes to enhance its temporal prediction performance is trained. The MHE is then formulated by integrating the DNN thermal model with one-dimensional driving dynamics in a discrete form, employing forward propagation for the DNN dynamics. Additionally, the LSTM’s hidden and cell states, which capture the long-term dependencies, are incorporated to the MHE’s state vector to preserve the DNN’s dynamics. The OCP-structured NLP is then solved using the open-source framework acados. Through MiL simulations of thermal derating for a PMSM in a BEV, the framework demonstrated accurate estimation of critical temperatures, even under noisy sensor conditions and artificial sensor failures. Notably, it achieved a three-fold real-time capability on a real-time computer, confirming its feasibility for embedded systems.
However, several limitations remain. The framework’s performance depends heavily on the quality and coverage of the training data, and its generalization to other systems remains unverified. Additionally, the lack of interpretability in data-driven models may limit adoption in safety-critical applications. Furthermore, the current embedded implementation is evaluated on high-performance real-time hardware, which may not reflect the constraints of production-grade ECUs. Another limitation is the lack of physical performance evaluation metrics as this work primarily serves as a proof of concept for integrating MHE with DNN-based thermal modeling.
Future work will expand the evaluation of estimator designs, including comparisons with alternative state estimation methods. Exploring deeper architectures of the DNN may balance estimation quality with computational efficiency, while transfer learning could enhance generalization across systems with minimal retraining. Incorporating anomaly detection mechanisms may improve fault resilience, and self-learning approaches hold promise for adapting to dynamic system changes without relying on pre-collected data. Real-time deployment on production-grade ECUs will also advance practical adoption, enabling testing under realistic computational and memory constraints, and further validating the estimator’s efficiency and robustness.
Overall, this research highlights the potential of DNN-based MHE for complex, real-time control applications, particularly in scenarios where accurate mathematical models are difficult to obtain or computationally expensive. By bridging the gap between model-based and data-driven approaches, this work paves the way for rapidly developed, adaptive, and computationally efficient state estimation frameworks suitable for next-generation, safety-critical systems.

Author Contributions

A.W.: Writing—Original Draft (lead), Conceptualization, Software, Validation, Visualization, Data Curation; P.S.: Methodology, Investigation, Software (lead), Writing—Original Draft, Data Curation; K.B.: Methodology, Writing—Review and Editing; V.S.: Validation, Writing—Review and Editing, Data Curation; D.G.: Supervision, Validation, Writing—Review and Editing; J.A.: Supervision, Project Administration, Funding Acquisition, Writing—Review and Editing. All authors have read and agreed to the published version of the manuscript.

Funding

The authors disclosed receipt of the following financial support for the research, authorship, and/or publication of this article: The research was performed as part of the Research Group (Forschungsgruppe) FOR 2401 “Optimization based Multiscale Control for Low Temperature Combustion Engines,” which is funded by the German Research Association (Deutsche Forschungsgemeinschaft, DFG).

Data Availability Statement

The datasets and scripts presented in this work are publicly available on Zenodo [45], accessed on 8 July 2025, at https://zenodo.org/records/15165902, including the synthetic training data, training scripts, code for MPC and MHE generation using acados, and the simulation.

Conflicts of Interest

The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.

References

  1. Simon, D. Optimal State Estimation: Kalman, H Infinity, and Nonlinear Approaches; John Wiley & Sons: Hoboken, NJ, USA, 2006. [Google Scholar]
  2. Aldrich, J.R.A. Fisher and the making of maximum likelihood 1912–1922. Stat. Sci. 1997, 12, 162–176. [Google Scholar] [CrossRef]
  3. Janacek, G.J. Estimation of the minimum mean square error of prediction. Biometrika 1975, 62, 175. [Google Scholar] [CrossRef]
  4. Ribeiro, M. Isabel, Kalman and Extended Kalman Filters: Concept, Derivation and Properties; Technical Report; Instituto de Sistemas e Robótica, Instituto Superior Técnico: Lisbon, Portugal, 2004; Available online: https://www.researchgate.net/publication/2888846_Kalman_and_Extended_Kalman_Filters_Concept_Derivation_and_Properties (accessed on 19 March 2025).
  5. Julier, S.; Uhlmann, J. New extension of the Kalman filter to nonlinear systems. In Proceedings of the SPIE 3068, Signal Processing, Sensor Fusion, and Target Recognition VI, Orlando, FL, USA, 28 July 1997. [Google Scholar] [CrossRef]
  6. Rao, C.V.; Rawlings, J.B.; Lee, J.H. Constrained linear state estimation—A moving horizon approach. Automatica 2001, 37, 1619–1628. [Google Scholar] [CrossRef]
  7. Vandersteen, J.; Diehl, M.; Aerts, C.; Swevers, J. Spacecraft Attitude Estimation and Sensor Calibration Using Moving Horizon Estimation. J. Guid. Control Dyn. 2013, 36, 734–742. [Google Scholar] [CrossRef]
  8. Bae, H.; Oh, J.H. Humanoid state estimation using a moving horizon estimator. Adv. Robot. 2017, 31, 695–705. [Google Scholar] [CrossRef]
  9. Baumgärtner, K.; Zanelli, A.; Diehl, M. Zero-Order Moving Horizon Estimation. In Proceedings of the IEEE Conference on Decision and Control, Nice, France, 11–13 December 2019. [Google Scholar]
  10. Baumgärtner, K.; Frey, J.; Hashemi, R.; Diehl, M. Zero-order moving horizon estimation for large-scale nonlinear processes. Comput. Chem. Eng. 2021, 154, 107433. [Google Scholar] [CrossRef]
  11. Girrbach, F. Moving Horizon Estimation for Inertial Motion Tracking: Algorithms and Industrial Applications. Ph.D. Thesis, Albert-Ludwigs-Universität Freiburg, Freiburg, Germany, 2021. [Google Scholar] [CrossRef]
  12. Rawlings, J.B.; Allan, D.A. Moving Horizon Estimation. In Encyclopedia of Systems and Control; Springer International Publishing: Cham, Switzerland, 2021; pp. 1352–1358. [Google Scholar] [CrossRef]
  13. Asch, M.; Bocquet, M.; Nodet, M. Data Assimilation: Methods, Algorithms, and Applications. Volume 11 of Fundamentals of Algorithms; Society for Industrial and Applied Mathematics (SIAM): Philadelphia, PA, USA, 2016; ISBN 978-1-61197-453-9. [Google Scholar] [CrossRef]
  14. Brunton, S.L.; Kutz, J.N. Data-Driven Science and Engineering; Cambridge University Press: Cambridge, UK, 2019. [Google Scholar] [CrossRef]
  15. Goodfellow, I.; Bengio, Y.; Courville, A. Deep Learning; MIT Press: Cambridge, MA, USA, 2016. [Google Scholar]
  16. Hewing, L.; Wabersich, K.P.; Menner, M.; Zeilinger, M.N. Learning-based model predictive control: Toward safe learning in control. Annu. Rev. Control. Robot. Auton. Syst. 2020, 3, 269–296. [Google Scholar] [CrossRef]
  17. Salzmann, T.; Arrizabalaga, J.; Andersson, J.; Pavone, M.; Ryll, M. Learning for CasADi: Data-driven models in numerical optimization. In Proceedings of the 6th Annual Learning for Dynamics and Control Conference, Oxford, UK, 15–17 July, 2024, Volume 242 of Proceedings of Machine Learning Research; pp. 541–553.
  18. Lahr, A.; Näf, J.; Wabersich, K.P.; Frey, J.; Siehl, P.; Carron, A.; Diehl, M.; Zeilinger, M.N. L4acados: Learning-based models for acados, applied to Gaussian process-based predictive control. arXiv 2025, arXiv:2411.19258. [Google Scholar]
  19. Lecun, Y.; Bottou, L.; Bengio, Y.; Haffner, P. Gradient-based learning applied to document recognition. Proc. IEEE 1998, 86, 2278–2324. [Google Scholar] [CrossRef]
  20. Bishop, C.M. Pattern Recognition and Machine Learning (Information Science and Statistics); Springer: Berlin/Heidelberg, Germany, 2006. [Google Scholar]
  21. Sarker, I.H. Deep Learning: A comprehensive overview on techniques, taxonomy, applications and research directions. SN Comput. Sci. 2021, 2, 420. [Google Scholar] [CrossRef]
  22. Hochreiter, S.; Schmidhuber, J. Long short-term memory. Neural Comput. 1997, 9, 1735–1780. [Google Scholar] [CrossRef] [PubMed]
  23. Bragantini, A.; Baroli, D.; Posada-Moreno, A.F.; Benigni, A. Neural-network-based state estimation: The effect of pseudo- measurements. In Proceedings of the 2021 IEEE 30th International Symposium on Industrial Electronics (ISIE), Kyoto, Japan, 20–23 June 2021. [Google Scholar] [CrossRef]
  24. Suykens, J.a.K.; De Moor, B.L.R.; Vandewalle, J. Nonlinear system identification using neural state space models, applicable to robust control design. Int. J. Control 1995, 62, 129–152. [Google Scholar] [CrossRef]
  25. Pan, Y.; Sung, S.W.; Lee, J.H. Nonlinear dynamic trend modeling using feedback neural networks and prediction error minimization. IFAC Proc. Vol. 2000, 33, 827–832. [Google Scholar] [CrossRef]
  26. Mobeen, S.; Cristobal, J.; Singoji, S.; Rassas, B.; Izadi, M.; Shayan, Z.; Yazdanshenas, A.; Sohi, H.K.; Barnsley, R.; Elliott, L.; et al. Neural Moving Horizon Estimation: A Systematic Literature Review. Electronics 2025, 14, 1954. [Google Scholar] [CrossRef]
  27. Song, R.; Fang, Y.; Huang, H. Reliable Estimation of Automotive States Based on Optimized Neural Networks and Moving Horizon Estimator. IEEE/ASME Trans. Mechatron. 2023, 28, 3238–3249. [Google Scholar] [CrossRef]
  28. Mostafavi, S.; Doddi, H.; Kalyanam, K.; Schwartz, D. Nonlinear Moving Horizon Estimation and Model Predictive Control for Buildings with Unknown HVAC Dynamics. IFAC-PapersOnLine 2022, 55, 71–76. [Google Scholar] [CrossRef]
  29. Chen, Y.; Li, C.; Chen, S.; Ren, H.; Gao, Z. A Combined Robust Approach Based on Auto-Regressive Long Short-Term Memory Network and Moving Horizon Estimation for State-of-Charge Estimation of Lithium-Ion Batteries. Int. J. Energy Res. 2021, 45, 12838–12853. [Google Scholar] [CrossRef]
  30. Alessandri, A.; Baglietto, M.; Battistelli, G.; Zoppoli, R. Moving-horizon state estimation for nonlinear systems using neural networks. In Proceedings of the 2008 47th IEEE Conference on Decision and Control, Cancun, Mexico, 9–11 December 2008; pp. 2557–2562. [Google Scholar] [CrossRef]
  31. Norouzi, A.; Shahpouri, S.; Gordon, D.; Winkler, A.; Nuss, E.; Abel, D.; Andert, J.; Shahbakhti, M.; Koch, C.R. Deep learning based model predictive control for compression ignition engines. Control Eng. Pract. 2022, 127, 105299. [Google Scholar] [CrossRef]
  32. Gordon, D.C.; Winkler, A.; Bedei, J.; Schaber, P.; Pischinger, S.; Andert, J.; Koch, C.R. Introducing a Deep Neural Network-Based Model Predictive Control Framework for Rapid Controller Implementation. In Proceedings of the 2024 American Control Conference (ACC), Toronto, ON, Canada, 10–12 July 2024; pp. 5232–5237. [Google Scholar] [CrossRef]
  33. Winkler, A.; Wang, W.; Norouzi, A.; Gordon, D.; Koch, C.; Andert, J. Integrating Recurrent Neural Networks into Model Predictive Control for Thermal Torque Derating of Electric Machines. IFAC-PapersOnLine 2023, 56, 8254–8259. [Google Scholar] [CrossRef]
  34. Engelhardt, T. Derating-Strategien für elektrisch angetriebene Sportwagen; Springer Fachmedien Wiesbaden: Wiesbaden, Germany, 2017. [Google Scholar] [CrossRef]
  35. Etzold, K.; Fahrbach, T.; Klein, S.; Scheer, R.; Guse, D.; Klawitter, M.; Pischinger, S.; Andert, J. Function Development with an Electric-Machine-in-the-Loop Setup: A Case Study. IEEE Trans. Transp. Electrif. 2019, 5, 1419–1429. [Google Scholar] [CrossRef]
  36. Wallscheid, O.; Böcker, J. (Eds.) Derating of Automotive Drive Systems Using Model Predictive Control. In Proceedings of the 2017 IEEE International Symposium on Predictive Control of Electrical Drives and Power Electronics (PRECEDE), Pilsen, Czech Republic, 4–6 September 2017; IEEE: Piscataway, NJ, USA, 2017. [Google Scholar] [CrossRef]
  37. Verschueren, R.; Frison, G.; Kouzoupis, D.; Frey, J.; van Duijkeren, N.; Zanelli, A.; Novoselnik, B.; Albin, T.; Quirynen, R.; Diehl, M. acados—A modular open-source framework for fast embedded optimal control. Math. Program. Comput. 2021, 14, 147–183. [Google Scholar] [CrossRef]
  38. Brownlee, J. Long Short-Term Memory Networks with Python; Machine Learning Mastery: Vermont, Victoria, VIC, Australia, 2017. [Google Scholar]
  39. Winkler, A.; Frey, J.; Fahrbach, T.; Frison, G.; Scheer, R.; Diehl, M.; Andert, J. Embedded Real-Time Nonlinear Model Predictive Control for the Thermal Torque Derating of an Electric Vehicle. IFAC-PapersOnLine 2021, 54, 359–364. [Google Scholar] [CrossRef]
  40. Kingma, D.P.; Ba, J. Adam: A Method for Stochastic Optimization. In Proceedings of the 3rd International Conference on Learning Representations, ICLR, San Diego, CA, USA, 7–9 May 2015. Conference Track Proceedings. [Google Scholar]
  41. Rawlings, J.; Mayne, D.; Diehl, M. Model Predictive Control: Theory, Computation, and Design; Nob Hill Publishing: Madison, WI, USA, 2017. [Google Scholar]
  42. Haykin, S.; Moher, M. Communication Systems, 5th ed.; Wiley: Hoboken, NJ, USA, 2009. [Google Scholar]
  43. Frison, G.; Diehl, M. HPIPM: A high-performance quadratic programming framework for model predictive control. IFAC-PapersOnLine 2020, 53, 6563–6569. [Google Scholar] [CrossRef]
  44. Frey, J.; Hänggi, S.; Winkler, A.; Diehl, M. Embedded Workflow—acados Documentation. Available online: https://docs.acados.org/embedded_workflow/index.html (accessed on 5 March 2025).
  45. Winkler, A. Deep Neural Network Based Moving Horizon Estimation: Data, Models, Scripts (feat. acados). 2025. Zenodo Repository. Available online: https://zenodo.org/records/15056784 (accessed on 10 June 2025).
Figure 1. Schematic of MHE problem.
Figure 1. Schematic of MHE problem.
Energies 18 03813 g001
Figure 2. Graphical abstract summarizing the work, including synthetic data generation. DNN-based MPC as presented in Ref. [33].
Figure 2. Graphical abstract summarizing the work, including synthetic data generation. DNN-based MPC as presented in Ref. [33].
Energies 18 03813 g002
Figure 3. LSTM unit. ⊕ Element-wise addition, ⊗ element-wise multiplication, u: input, y: output, c: cell state, h: hidden state, σ : sigmoid function, tanh : hyperbolic tangent function.
Figure 3. LSTM unit. ⊕ Element-wise addition, ⊗ element-wise multiplication, u: input, y: output, c: cell state, h: hidden state, σ : sigmoid function, tanh : hyperbolic tangent function.
Energies 18 03813 g003
Figure 4. Simulation and model setup for synthetic training data generation.
Figure 4. Simulation and model setup for synthetic training data generation.
Energies 18 03813 g004
Figure 5. Synthetic data for BEV vehicle speed and electric machine winding temperature, utilizing multiple drive cycles.
Figure 5. Synthetic data for BEV vehicle speed and electric machine winding temperature, utilizing multiple drive cycles.
Energies 18 03813 g005
Figure 6. LSTM artificial neural network architecture using an LSTM and FC layer.
Figure 6. LSTM artificial neural network architecture using an LSTM and FC layer.
Energies 18 03813 g006
Figure 7. Data distribution of network output gradient of electrical machine winding (upper plot) and rotor (lower plot) temperature. Training and validation dataset, D train , D val (80:20 split). Total data points: 180,000.
Figure 7. Data distribution of network output gradient of electrical machine winding (upper plot) and rotor (lower plot) temperature. Training and validation dataset, D train , D val (80:20 split). Total data points: 180,000.
Energies 18 03813 g007
Figure 8. Loss-Epoch plot for the neural network training. The final network is chosen according to the best training loss.
Figure 8. Loss-Epoch plot for the neural network training. The final network is chosen according to the best training loss.
Energies 18 03813 g008
Figure 9. Predicted neural network outputs vs. the actual ground truth data for both network outputs for unseen test dataset, gradients of winding and rotor temperature of the electric machine.
Figure 9. Predicted neural network outputs vs. the actual ground truth data for both network outputs for unseen test dataset, gradients of winding and rotor temperature of the electric machine.
Energies 18 03813 g009
Figure 10. Predicted neural network outputs on the unseen test (Nürburgring Nordschleife) dataset over time domain: gradients of winding and rotor temperature of the electric machine.
Figure 10. Predicted neural network outputs on the unseen test (Nürburgring Nordschleife) dataset over time domain: gradients of winding and rotor temperature of the electric machine.
Energies 18 03813 g010
Figure 11. Simulation and model setup for MHE application and validation. DNN-based MPC as presented in Ref. [33].
Figure 11. Simulation and model setup for MHE application and validation. DNN-based MPC as presented in Ref. [33].
Energies 18 03813 g011
Figure 12. MHE utilizing LSTM neural network compared to true and measured value (incl. noise) for whole drive cycle run.
Figure 12. MHE utilizing LSTM neural network compared to true and measured value (incl. noise) for whole drive cycle run.
Energies 18 03813 g012
Figure 13. MHE utilizing LSTM neural network compared to true and measured value (incl. noise) for sensible temperature range (zoom).
Figure 13. MHE utilizing LSTM neural network compared to true and measured value (incl. noise) for sensible temperature range (zoom).
Energies 18 03813 g013
Figure 14. Zoom plots of estimator outputs for winding temperature compared to true and measured value (incl. noise) with heavy failure injection for robustness investigation.
Figure 14. Zoom plots of estimator outputs for winding temperature compared to true and measured value (incl. noise) with heavy failure injection for robustness investigation.
Energies 18 03813 g014
Table 1. Training hyperparameter settings.
Table 1. Training hyperparameter settings.
HyperparameterValue
Max epoch10,000
Performance metricMSE
OptimizerAdam [40]
Mini-batch size512
Initial learning rate0.02
Learn rate schedulePiecewise drop by 25% every 500 epochs
L2 regularization0.1
Validation frequency10
Table 2. Deep neural network prediction performance metrics on unseen test dataset. MAE: Mean Absolute Error, RMSE: Root MSE, NRMSE: Normalized RMSE.
Table 2. Deep neural network prediction performance metrics on unseen test dataset. MAE: Mean Absolute Error, RMSE: Root MSE, NRMSE: Normalized RMSE.
Metric θ ˙ w θ ˙ r
MAE/(° C/s)0.02880.0210
RMSE/(°C/s)0.03730.0282
NRMSE/-2.77%9.39%
Table 3. Tuning parameters for Optimal Control Problem.
Table 3. Tuning parameters for Optimal Control Problem.
SymbolParameterValue
θ ̲ w , θ ̲ r Minimum winding and rotor temperature0 °C
θ ¯ w , θ ¯ r Maximum winding and rotor temperature155 °C
P 0 Weighting matrix of the arrival costdiag(1, 1)
QWeighting matrix of mapped states diag ( 0.02 , 0.02 )
RWeighting matrix of controls diag ( 0.7 , 0.7 )
NEstimation horizon15
δ k Timestep size100 ms
THorizon length1.5 s
Table 4. Parameter settings and simulation results for embedded real-time testing of deep neural network-based moving horizon estimator.
Table 4. Parameter settings and simulation results for embedded real-time testing of deep neural network-based moving horizon estimator.
ParameterValue
Timestep100 ms
Horizon length (nodes)15, condensed to 5
Maximum number of SQP iterations20
Maximum number of iterations within the QP solver100
Maximum computation time per timestep28 ms
Average computation time per timestep5.7 ms
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Winkler, A.; Shah, P.; Baumgärtner, K.; Sharma, V.; Gordon, D.; Andert, J. Incorporating a Deep Neural Network into Moving Horizon Estimation for Embedded Thermal Torque Derating of an Electric Machine. Energies 2025, 18, 3813. https://doi.org/10.3390/en18143813

AMA Style

Winkler A, Shah P, Baumgärtner K, Sharma V, Gordon D, Andert J. Incorporating a Deep Neural Network into Moving Horizon Estimation for Embedded Thermal Torque Derating of an Electric Machine. Energies. 2025; 18(14):3813. https://doi.org/10.3390/en18143813

Chicago/Turabian Style

Winkler, Alexander, Pranav Shah, Katrin Baumgärtner, Vasu Sharma, David Gordon, and Jakob Andert. 2025. "Incorporating a Deep Neural Network into Moving Horizon Estimation for Embedded Thermal Torque Derating of an Electric Machine" Energies 18, no. 14: 3813. https://doi.org/10.3390/en18143813

APA Style

Winkler, A., Shah, P., Baumgärtner, K., Sharma, V., Gordon, D., & Andert, J. (2025). Incorporating a Deep Neural Network into Moving Horizon Estimation for Embedded Thermal Torque Derating of an Electric Machine. Energies, 18(14), 3813. https://doi.org/10.3390/en18143813

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop