A Discrete-Time Extended Kalman Filter Approach Tailored for Multibody Models: State-Input Estimation

Model-based force estimation is an emerging methodology in the mechatronic community given the possibility to exploit physically inspired high-fidelity models in tandem with ready-to-use cheap sensors. In this work, an inverse input load identification methodology is presented combining high-fidelity multibody models with a Kalman filter-based estimator and providing the means for an accurate and computationally efficient state-input estimation strategy. A particular challenge addressed in this work is the handling of the redundant state-description encountered in common multibody model descriptions. A novel linearization framework is proposed on the time-discretized equations in order to extract the required system model matrices for the Kalman filter. The presented framework is experimentally validated on a slider-crank mechanism. The nonlinear kinematics and dynamics are well represented through a rigid multibody model with lumped flexibilities to account for localized interaction phenomena among bodies. The proposed methodology is validated estimating the input torque delivered by a driver electro-motor together with the system states and comparing the experimental data with the estimated quantities. The results show the stability and accuracy of the estimation framework by only employing the angular motor velocity, measured by the motor encoder sensor and available in most of the commercial electro-motors.


Introduction
In mechatronic systems, operational forces and moments are essential quantities in the different stages of the development cycle and strongly impact the design, durability, diagnostic, prognostic, maintenance, and advanced control strategies [1]. However, forces and moments are also difficult, even impossible, quantities to measure. This is due to high force sensor costs and the geometrical constraints (space limitations) that would make the sensor integration impossible without influencing the overall system design and behavior.
In past decades, different test-driven and model-based inverse force methods have been presented in the literature to overcome these limitations. Initially, the challenge of inverse load identification was tackled in offline test-based strategies. One of the most commonly used technique for mechanical applications relates to the field of Transfer Path Analysis (TPA) [2].
TPA summarizes the family of test-based methodologies to study the vibration transmission in mechanical systems where the Matrix Inversion and Mount Stiffness approaches are the most commonly used to estimate inputs and transmitted forces respectively. Despite the wide variety of methods and extensive use in the industrial world, TPA still remains quite expensive from an experimental point of view in terms of preparation and execution time.
The growing computational power of modern computers opened new opportunities to exploit numerical model-based methods. These models can be exploited in virtual sensing approaches [3] which enable the exploitation of low cost, accessible and non-collocated measurements together with first-principle/physically inspired models to obtain state and input estimates.
State estimation techniques such as the Kalman Filter (KF) methods allow the joint estimation of unknown inputs and model states [4] in an efficient manner. By regularly feeding back the measurements on a physical asset, KF techniques enable the compensation of drift in the model while reducing the noise from the direct measurements.
Multibody (MB) modeling approaches are regularly used in the literature and industry [5][6][7] for full scale rigid and flexible mechanical systems where conventional Finite Element (FE)based methods would be unnecessarily expensive. The MB methods establish a good trade-off between model fidelity and computational cost. Moreover, MB models disclose 3D system-level information, enabling dynamic interaction phenomena among bodies due to distributed and/or localized flexibilities.
However, the link between MB models and estimation algorithms is nontrivial since most estimators require an ordinary differential state-space representation of the system dynamics. Instead, the MB model dynamics, depicted by the Equations of Motion (EOMs), are generally described by a set of Implicit-Differential Algebraic Equations (I-DAEs) that makes the state-space representation difficult to be met. On the other hand, Explicit-Ordinary Differential Equations (E-ODEs) are well suited for a state-space representation but specific MB formulations should be employed to obtain this structure (e.g., [8]), otherwise, dedicated manipulations of the EOMs are demanded to achieve an ODE form.
In [9] the Matrix-R method was proposed to eliminate the constraint equations of the MB model reducing the initial EOMs to an ODE form in independent coordinates. The aim of this work was to combine an extended KF estimator with detailed MB models to obtain an automotive real-time observer. Despite the high accuracy of the estimated quantities, the real-time target was not achieved due to the costly solver iterations.
Similarly in [10][11][12] the Matrix-R method was used to deal with the DAE structure of the EOMs. Here, different KF estimators are compared in terms of accuracy and performance on a rigid 4 and 5-bar linkage mechanisms.
Alternatively, in [13] a kinematic state observer is presented. It combines the constrained kinematic MB equations with nonlinear estimators. Here, the dynamic equations of the MB system are not considered therefore leading to an estimation which is less sensitive to input and mechanical (properties) uncertainties. Moreover the system accelerations are treated as random walk models and augmented to the kinematic discrete state vector that imply the use of a more extensive number of measurement sensors.
In [14,15] an interesting approach based on the combination of deep learning and MB dynamics information was proposed to achieve this transformation. It allows reducing a generic MB model to minimal coordinates allowing the description of the EOMs through E-ODEs while not requiring a specific formulation or access to the constraint equations. However, the methodology depends on a reference numerical simulation as training data which must cover the mechanism workspace; moreover only rigid MB systems can be tackled by the technique.
In [16] an Augmented Discrete Extended Kalman filter (ADE-KF) approach tailored for flexible MB models to construct a state-input estimator is presented.The methodology demonstrates the advantages of using analytical expressions to cover the necessary linearized and explicit EOMs. However, this approach relies on the use of a penalty constraint formulation to achieve E-ODE type of equations. This leads to a relatively poorly conditioned problem and introducing additional model parameters, namely the penalty factors, in comparison to a Lagrange-multiplier approach.
In this work, a generalization of the methodology described in [16] is presented which is compatible with a Lagrange multiplier approach for the constraint equations.
The proposed methodology starts from a novel linearization approach of the EOMs that includes the algebraic variables (Lagrange multipliers) to the system states. Consequently, the resulting unconstrained discrete-time state-space model is employed in a constraint KF scheme where the kinematic constraints are enforced trough the augmented measurement equations, therefore eliminating the effort of selecting effective penalty factors.
The scientific contribution is structured as follows: in Section 2 a general overview of the governing EOMs of the MB system dynamics is given; in Section 3 the implicit constrained EOMs are linearized and made explicit through a first order Taylor expansion; in Section 4 the system and measurement Kalman filter equations are introduced. Here, the system and measurement matrices are analytically assembled thanks to the use of the in-house Multibody Research Code (MBRC) [17]; finally, in Section 5 the methodology is validated on an industrial relevant application comparing the estimated quantities with the experimentally measured one.

Multi-Body Model and Time-Disretization
This section summarizes the derivation of the EOMs of flexible multibody systems, as they will be employed in this work.

The Multibody Equations of Motion
The mathematical description of the system dynamics can be derived by means of the Lagrange's equations for constrained mechanical systems [18]: with the Lagrangian defined as: L represents the Lagrangian functional, T the kinetic energy, V the potential energy, φ(q) T λ the constraint contribution with the Lagrange multipliers λ, and u e is the vector of the external actions. MB models describe the dynamics of several rigid and/or flexible interacting bodies linked together through the definition of kinematic joints which are mathematically represented by the constraint equations φ(q) while J = ∂φ(q)/∂q represent the Jacobian of the constraint equations. q ∈ R n q is the generalized coordinates vector, λ ∈ R n λ is known as Lagrange multipliers and u ∈ R n u is the input vector. Through the definition of the assembled body coordinates and the motion parametrization Equation (1) can be written in a residual form as a fully implicit real-valued non-linear function:

The Differential-Algebraic form of the EOMs
A set of natural coordinates q n ∈ R n qn was proposed in [18], where redundant degrees of freedom are employed to define the system coordinates of the assembled bodies. Moreover, including the motion parameterization employed in the Flexible Natural Coordinate Formulation (FNCF) [19] allows deriving a constant singular mass matrix M ∈ R n qn ×n qn . Assuming this formulation, Equation (3) can be written in the so-called index-3 form: Here, f nl ∈ R n qn is the non-linear generalized force vector expressed as: f nl (q n , q n , u) = f v (q n , q n ) + f int (q n , q n ) + f ext (q n , q n , u).
f v represents the quadratic velocity vector related to the gyroscopic forces of the bodies, which is zero for FNCF formulation. f int is the internal force vectors which accounts for the elastic energy stored by deformable bodies and if rigid bodies are assumed f int vanishes; f ext is the external force vector and can be spilt in the sum of two contributions, the interaction forces among bodies f b (i.e., contact and friction forces) and the input forces f u . They can be summarized as follows: Here, f u can be written as f u (q n , u) = U t (q n )u, where U t is tangent input matrix defined as: Due to the structure of the EOM, Equation (4), for the FNCF formulation, derivatives can be more readily obtained than for may alternative flexible multibody formulations. Therefore, the above mentioned coordinates definition and motion parameterization will be considered in this work. For the sake of brevity, we omit the subscript n referred to the natural coordinate formulation for the remainder of this manuscript.
Despite the computational advantages of the above mentioned MB approach, the methodologies that will be introduced in the next sections can be easily extended to alternative MB formulation, such as the floating-frame of reference component mode synthesis approach or the generalized component mode synthesis [5,20].
The I-DAEs form of Equation (4) are generally not suitable for estimation algorithms such as the Kalman Filter family, since these have been designed to handle E-ODEs type of equations.
In the next section, we present a new methodology to directly linearize the I-DAEs starting from its discrete form but without employing any explicit constraint elimination technique.

EOMs: The Discrete Index-3 Form
To transform the second order differential equation into first-order differential equations, it is common to introduce the velocity variableq = v, allowing to write Equation (4) in a first-order form as: These equations represent a system of constrained-DAEs of index 3 [21]. Numerical differentiation is generally employed [22] to convert Equation (8) into a discrete form.
In this work, a first order, constant time-step Backward Differentiation Formula (BDF-1), also known as Backward Euler, is employed. This choice does not imply that other differentiation schemes cannot be applied to discretize the EOMs in time. However, the time-discretization must be consistent with the defined estimation sampling and particular attention should be paid to choosing the differentiation schemes (e.g., forward or backward) because it influences the achievement of the discrete-time E-ODE form of the EOMs, as will be discussed in Section 3.
The single step method BDF-1 can be written as where h represents the constant time step size and k ∈ Z the k − th time instance. By substituting Equation (9) into Equation (8) the discrete-time EOMs g d are obtained: This can be summarized as Assuming the generalized coordinates q k and velocities v k at the time instance k to be known and given the input u k+1 at the time instance k + 1, Equation (10) is solved for q k+1 and λ k+1 by substituting g d1 in g d2 , and applying a Newton-Raphson-based iterative algorithm with iteration gradient J NR : Here, K t , C t and M t are the tangent stiffness, damping and mass matrices obtained from the partial derivatives of the continuous g 2 equations in Equation (8) evaluated at time step k + 1: and β and γ are matrix coefficients function of the defined integration rule, which are given for the BDF-1 scheme by: This time integration scheme will be exploited in the following section to set up a suitable solver structure for use in an ODE-base estimation framework.

An Explicit Linearized Approximation for Use of the Multibody Model in State-Estimation
The aim of this work is to combine MB models with a Kalman filter-based estimator to concurrently estimate the system states and unknown forces of a mechanism. These presented estimators, as will be discussed in Section 4, require the linearized time-discrete model matrices. In this section, a new approach to linearize the EOMs of a MB model starting from an ID-DAE form is presented. Subsequently, the linearized system matrices are analytically assembled.
By introducing the state vector x ∈ R n x for a time step k the ID-DAE form of the EOMs in Equation (11) can be re-written as: In this work we assume the function g d of Equation (17) to be continuously differentiable in all its variables. Therefore, an explicit discrete function f d locally exists by applying the implicit function theorem. Through a first order Taylor expansion, g d can be approximated as where (x 0 k+1 ,x 0 k ,u 0 k+1 ) represents the linearization set point while g 0 d = g d (x 0 k+1 ,x 0 k ,u 0 k+1 ) for convenience of notation. Manipulating Equation (18) and neglecting the higher order terms, it can be made explicit as In compact form Equation (19) becomes: are the linearized system and input matrices around the linearization set point. Starting from Equation (19) and differentiating Equation (10), the Jacobians for the backward Euler implicit time-integrator can be computed as: where U t represents the tangent input matrix of Equation (7).
The linearized system and input matrices can be computed for any working point at the time step k + 1 as: These equations enable the evaluation of the linearized time-discretized explicit description of the EOMs suitable for estimation methods such as the extended Kalman filter. Their deployment of this estimation scheme is discussed in the next section.
It is important to note that the invertibility of the matrix G x k+1 is guaranteed thanks to the choice of BDF-1 differentiation scheme and that in contrast, it would not be possible. For completeness, the limitations of a forward differentiation scheme is demonstrated in the Appendix A.

State-Input Estimation for MB Models
The augmented discrete extended Kalman filter (ADE-KF) tailored for MB models is discussed in this section. In this section we discuss all the required components to set up a Kalman filter for assimilating the different multibody states and unknown inputs. More in details, in Section 4.1, the general form of the discrete-time system and measurement model equations are summarized. In Section 4.2, the measurement equations are augmented with the constraint equations φ, to deal with the constrained nature of the MB EOMs, leading to a constrained estimation problem. Moreover, in Section 4.3 the adopted approach to compute the linearized measurement matrices C and D are presented since they are required in the estimation framework and not directly available. Finally, in Section 4.4 the ADE-KF is assembled to deal with the estimation of states and unknown inputs, and the Kalman filter steps tailored for MB models are reported.

Model and Measurement Equations with Uncertainty
The system of EOMs in Equation (4) described in the previous section are assumed as deterministic. However, in practice, various noise sources will disturb the behavior of the system. For the dynamic model equations, the process noise vector ν * x,k+1 influences the response: whereν x,k+1 is associated with the noise term ν x,k+1 described by the following equation: Here, x * k+1 is the deterministically varying state vector while ν x,k+1 is a zero-mean noise term with a (possibly time-varying) covariance Q k .
The estimation framework relies on combining the prior model information with measurements y ∈ R n y on the physical process. To compare the prediction of the model with these measurements, a set of measurement equations h are necessary which are affected by measurement noise ν y,k+1 : where again ν y,k+1 is assumed to be zero-mean with a (time-varying) covariance R k . Similar to the model measurement equations y, the concept of virtual sensor (VS) y vs ∈ R n yvs is introduced: A virtual sensor represents model-based information; more specifically, it is a physical quantity that can be expressed as a function of the system variables, such as joint forces, body motion trajectories (e.g., linear and angular positions, velocities, and accelerations) and body strains/stresses. A VS equation can be treated similarly to a measurement equation but evaluated after the a posteriori Kalman filter step and hence to exploited in the estimation process itself.

The Augmented Constraint Measurement Equations
In [23] different approaches have been proposed to deal with constrained state estimation, although the authors deem it impossible to give a general guideline for constrained filtering because each individual problem is unique and dependent on how the constraints are handled.
In this work, the combination of hard and soft constraint methods is considered [23], where the constraint measurement equations are implemented in the Kalman filter scheme by augmenting the measurement equations y of Equation (28) with the constraint equations: Here, ν φ,k+1 is a small zero-mean noise term added to the idealized constraint equations φ(q k+1 ) if small constraints violation is allowed (soft constraints method). In the case ν φ,k+1 is assumed to be zero, the constraint equations are treated as perfect measurements (hard constraint method).

An Efficient Strategy for the Measurement Sensitivities Computation
To evaluate the EKF equations at each filter step, the linearized measurement sensitivity matrices C k+1 and D k+1 are required and they are defined as: Generally, the measurement equations can be expressed as a function of the generalized accelerations, velocities, positions, Lagrange multipliers, and inputs, Equation (30).
However, due to the state-space description presented in Section 3, the explicit relationship of the sensor equations with respect to the generalized accelerations is lost. More in particular, when considering acceleration sensors, their sensitivity with respect to the generalized accelerations is non zero, thus it must be indirectly included. Acceleration sensors are really common in the mechanical engineering community due to their noninvasive and simple installation requirements. Within the estimation framework, they can be used either in form of measurements or in form of VSs.
Similarly, the sensitivity of the measurement equations with respect to the system inputs are not always available or nontrivial to obtain.
Therefore, an approach to explicitly obtain these dependencies is here derived by means of the acceleration level constraints.
Introducing the auxiliary variables z ∈ R 3n q +n λ for a generic measurement sensor y, the sensitivities ∂y ∂z with respect to the auxiliary variable z can be analytically computed starting from their fundamental equations. (34) Applying the chain rule, the non-augmented linear measurement matrix dy dx for a generic time step can be written as And the full derivative dz dx can be expressed as To analytically compute the unknown terms of Equation (36), we introduce the acceleration level constraintsφ defined as the second time derivative of the position level constraints. Starting from the velocity level constraintsφ: the acceleration level constraint equations are obtained as follows: By means of the continuous dynamic equations g 2 of Equation (8) and the acceleration level constraint of Equation (38), a new set of equations p ∈ R n q +n λ can be constructed: Equations (39) represent the governing set of equations that implicitly determines the relation between the different coordinates v, q,v and the Lagrange multipliers λ.
Therefore, the unknown terms of Equation (36) where the third order partial derivative of the constraint equations φ(q) with respect to the generalized coordinates q is zero for FNCF. Another important ingredient to fulfill the Kalman filter requirements is the measurement input matrix dy du of Equation (32). However, this matrix is not directly available and it is computed similarly to Equation (35) but with respect to input u: dy du = ∂y ∂z Here, the full derivative dz du represents how the vector z varies when the input u is perturbed obtaining: From Equation (42) can be seen that only the sensitivities of the acceleration and Lagrange multipliers are non-zero terms. A second order system is fully defined by the position coordinates, velocity coordinates, and time. An external force only influences the force balance of that system and thus the acceleration coordinates and Lagrangian multipliers while only through time-integration the velocity and position coordinates. However, these derivatives are evaluated at a single time instance. Therefore, in Equation (36), the acceleration coordinates and Lagrangian multipliers depend on the position and velocity coordinates, but not the other way around: the position and velocity coordinates do not depend on the acceleration coordinates, Lagrangian multipliers, or the external forces.
In Figure 1 a schematic summary of the followed steps required for the computation of the system and measurement matrices is reported.

Augmented Discrete Extended Kalman Filter
The goal of this work is to estimate the unknown input forces, often referred to as disturbances, d ∈ R n d , concurrently with the system states x through the augmented state vectorx ∈ R n x +n d defined as:x As the estimation algorithm also needs a model for the unknown inputs, a random walk model is associated with the unknown input: with ν d,k also being zero-mean, random noise with covariance matrix Q d,k .
In this work, the random walk model is chosen for the unknown disturbance. This approach is chosen as in general no prior information on the input is assumed to be known. However, if useful information is available, e.g., periodicity of the input, other input models can be employed, as in [24].
The augmented discrete-time state-space system of equations can be written combining Equations (26) and (45): The linearized system matrix F refers to the augmented system of equations Equation (46) at the time step k + 1 and it is assembled as wheref d is the augmented explicit ODEs associated with Equation (46), is obtained from Equation (24), while B d k+1 is the linear disturbance matrix obtained similarly to B k+1 in Equation (25) but with respect to the unknown input d.
Subsequently, the linearized augmented measurement matrix H associated with the augmented state vectorx is assembled as: where the matrix D d k+1 is computed in a similar fashion as for D k+1 in Equation (32) but with respect to the unknown input d.
Starting from these model, measurement and tangent matrices, an extended Kalman filter (EKF) procedure can be set up in order to estimate both the states and the unknown input forces. The application of this estimation approach is discussed in the following section.

The Adopted Extended Kalman Filter Scheme
In this work, we employ an extended Kalman filter (EKF) [25] to perform the stateestimation. With the various model and measurement equations, and their respective derivatives, defined for a MB model in the previous sections this EKF can be run efficiently. As all terms have been defined analytically it is not necessary to resort to numerical derivatives, which allows for an effective application of the EKF. Several researchers have shown the applicability of the estimators even for the strongly nonlinear case of MB systems [9,12,26].
In general, we can group the EKF scheme in two main steps: the a-priori and a posteriori steps. • A-priori step: Assuming that the augmented statesx + k at the previous filter step and the input u k+1 are known, the a-priori state predictionx − k+1 and generalized accelerationṡ v − k+1 can be computed solving the ID-DAEs of Equation (17): Knowing the estimated state covariance matrix P + k for the previous timestep, the apriori covariance at the current time (k + 1) step can be approximated from Equation (47) as whereQ k is the process noise matrix of the augmented state-space model. The predicted measurementỹ − k+1 can then be evaluated from Equation (30) as: The Kalman filter gain K allows achieving a desireable trade-off between the confidence in the model and the available measurements, and can be evaluated as: where H is obtained from Equation (48) andR k is the measurement covariance matrix of the augmented measurement equations. • A-posteriori step: When the real measurement y * k+1 becomes available together with the predicted measurementỹ − k+1 , the a posteriori state vectorx + k+1 is obtained as: The inclusion of the actual measurements also affects the posterior covariance matrix P + k+1 and can be evaluated as: In Figure 2 a block diagram scheme summarizing a generic kth step of the recursive ADE-KF is shown. With this scheme the entire state-input estimation can be performed for an arbitrary (flexible) multibody model. In the following section we will validate it on an experimental setup.
In practical applications the performance of the estimation scheme will strongly depend on the tuning of the model covarianceQ and measurement covarianceR. Unfortunately this tuning is also highly case dependent, which makes it difficult to set up general guidelines. For the particular validation case considered in this work, a detailed discussion on a possible tuning strategy is presented in the following section.

Validation: Joint State-Input Estimation
In this section, the presented joint state-input estimation methodology is experimentally validated on a slider-crank mechanism.

The Slider-Crank System
The slider-crank system in Figure 3 is a mechanism widely used in industry to transform a rotational motion in a linear motion as for instance in pick and place operations or in car engines.    Table 1. Even though the presented slider-crank mechanism is an academic example it combines several challenging phenomena such as non-linear kinematics and complex slidertrack interaction phenomena. The various bodies are connected trough fixed, revolute, spherical, and universal joints to allow the desired kinematics. The slider and track bodies are connected through a contact stiffness k c along the perpendicular directions to the sliding trajectory. The Pacejka friction model [27] defines the friction coefficient µ as a function of the sliding velocity ∆v: where the friction force f f is evaluated as where f n is the resultant normal force acting on the slider and, δ is the local compliance between the slider and track rail interfaces projected onto the normal direction to the sliding direction. The adopted (identified) Pacejka friction model parameters are listed in Table 2. The system motion is driven by a brushless servomotor "MAC3000"' with integrated controller MAC00-B4 from JVL (www.jvl.dk, accessed on 1 March 2021). It includes a motor encoder sensor allowing the measurement of the rotation angle and velocity of the motor shaft, indicated by θ andθ respectively.As can be seen in Figures 3 and 4, the slider is equipped with a mono-axial MEMS accelerometer (3711D1FB200G) from PCB (www.pcb.com) to measure its translational acceleration along the sliding direction indicated byŸ. The entire system is controlled via the motor using a closed-loop PID controller targeting a desired rotational motor velocity while adapting the determined motor torque T.

Results
After the setup of the MB model of the slider-crank mechanism, it is embedded into the ADE-KF estimation framework presented in Section 4.
The input torque delivered by the motor is assumed unknown, and jointly estimated with the model states as introduced in Section 4.4. It is assumed that all model uncertainties is dominated by the augmented state, representing the unknown input, while the model is considered perfect.
The a posteriori Kalman filter step is computed using the augmented measurements discussed in Section 4.2. These combine the angular motor velocityθ together with the model constraint equations φ. The angular motor velocity is directly available on many mechatronic drives since they are equipped with relatively accurate encoders for control or monitoring purposes.
For the validation of our estimation framework, summarized in Figure 5, we compare the estimates (virtual sensors) of the motor position θ, motor velocityθ, slider acceleration Y and motor torque T with measurements directly obtained from the experimental setup. Besides the motor encoder, an accelerometer on the slider is employed and motor torques can be directly extracted from the drive unit. The performed experiments span 9.4 s and are executed for three levels of desired angular motor velocity, which are provided to the motor controller as desired set points: 40, 50 and 60 rad/sec. Note that, due to the non-ideal behavior of the system and the limitations of the PID controller, the desired set point results in practice in a varying angular velocity.
The measured and the estimated motor angle θ, rotational velocityθ, and the slider translational accelerationŸ are compared in Figure 6.
Three subsets of this full timespan are shown in Figure 7 to better appreciate the transient effects during the start-up and the two velocity transitions.
It is clear from Figures 6 and 7 that the ADE-KF with the MB model tracks these various (derivative) states very well, underlining the well represented system kinematics.
In Figure 8 the estimated motor torque is compared to the measured motor torque. This comparison shows a good prediction over the full time series (on the left) and on the angular velocity transitions (zoom-in figures on the right) thanks to the proposed methodology.   In Table 3 the root mean square error of the estimated virtual sensors and input torque are reported, underlying the relatively high accuracy of the estimated quantities.

It is defined as
where χ m and χ e are the measured and estimated variables respectively, while n k is the total number of data samples. Table 3. Accuracy of the estimated quantities in terms of root mean square error.

θ [rad]θ [rad/s]Ÿ [m/s 2 ] T [Nm]
Error RMS 0.005 0.051 13.651 0.334 The choice of performing the experiments for a relatively long timespan was made to demonstrate the filter stability in terms of both mean value and covariance prediction. For these kind of applications, where the uncertainty is dominated by difficult to model load effects (friction, etc.), the choice of focussing the model covariance on the input load allows effectively propagating the uncertainties. The dashed blue curves in Figure 8 represent the estimated expected variation of the augmented average state estimate within the 70% of confidence. It is expressed in terms of the standard deviations σ d = P + d computed for each k th filter step where P + d is the diagonal term of the a posteriori estimated covariance associated with the augmented state (disturbance). It is important to notice that the experimental motor torque (in red) remains bounded by the estimated input uncertainty therefore being an accurate estimation of the real covariance.
These results for the estimated torques show a significantly larger error than those obtained for the (derivative) states. For multibody problems in general, the state-estimates can be expected to be dominated by the kinematics of the system, which are generally well known. For the load estimates however, the dynamics of the system will play a crucial role. Besides key dynamic quantities such as the system inertia which can be modelled very accurately, other effects such as friction forces also influence this outcome. In this work we employed the friction model from Equation (56), but any error on this model is also propagated to the torque estimates. Due to the complex nature of the interface conditions for the slider and the rail (and the other bearings in the system), some errors are to be expected here. Key for future research will therefore be to examine how these complex load phenomena can be accounted for as effectively as possible. Moreover, by only employing one physical measurement (θ) in the ADE-KF scheme, it is guarantied that the accuracy of the estimated input torque would be less accurate for a poorly identified model. This can be observed in [15] where the same validation case was considered. Here, Angeli et al. proposed a deep learning methodology to reduce the initial MB equations from redundant to minimal coordinates where the resulting equations are then employed in an augmented extended Kalman filter scheme. Alternatively to what is presented in the current contribution, the supposed unknown motor torque is estimated employing the slider acceleration (Ÿ) and no slider-track friction model was considered which has led to slightly less accurate input and virtual sensors estimation as compared to the currently proposed approach and model. An important aspect in estimation problems is the choice of the Kalman filter parameters such as the process and measurement noise covarince matrices,Q k andR k . It is recurrent while dealing with KF-based estimators that the accuracy of the estimated quantities is highly influenced by the selection of those parameters. However, general rules are not available since the filter parameters and influence strongly depend on the application case. Therefore, it is common to resort to a tuning step as the process of investigating and selecting these parameters. In the context of this work, the adopted strategy is described in the following section.

Kalman Filter Tuning
To attain the best accuracy from the presented estimation scheme, the model and measurement covariances need to be judiciously selected. In this work we have started with the selection of the measurement covariance matrixR k associated with the augmented measurement equationsỹ. In lack of other information, We assume this measurement covariance constant over time. The covariance results from the combination of two main measurement contributions: the (motor) angular velocityθ and the augmented constraint measurements φ, which reads asR where Rθ is generally tuned based on reference noise measurements while for this application, since no noise reference was available, the author has chosen a value which is representative of the encoder measurement noise: Rθ = 10 −2 (rad 2 /s 2 ). Moreover, the authors have experienced that the influence of the measurement noise parameter Rθ is relative to the value of the process noise covarianceQ k . R φ instead is linked to the mathematical and physical meaning of the constraint equations. In MB applications, we can distinguish two types of constraint equations: the ones that come from the inherent coordinates formulations, i.e., φ c (e.g., Euler parameters should be unit vector and rotation matrix should be orthogonal), and the ones that come from joints definition, i.e., φ j , as for instance the spherical and/or revolute joints. In this work, for the latter a small noise term is allowed (i.e., all diagonal terms of R φ j are set to 10 −9 while the off-diagonal terms are set to zero) representing the joint imperfections typical of real systems, whereas for the former, they are treated as perfect measurements (i.e., R φ c = 0), otherwise the kinematics and the mathematical principles that are used to describe the MB system are no longer valid.
Similarly to the augmented measurement covarianceR k , the augmented process noise matrixQ k is assumed constant for all filter steps and it can be written as combination of the system and augmented states contributions as As we assume the model to be practically perfect compared to the high uncertainty on the unknown inputs, the process noise matrix Q x associated with the system states is set to zero.
The remaining parameter Q d associated with the unknown input torque (disturbance) is obtained in a brute-force optimization fashion. Since in this case there is only a single value to be chosen, an exhaustive search is therefore not computationally prohibitive. In this regard a grid of Q d values have been selected, going from 10 −5 to 10 5 sampled exponentially in eleven increments, leading to a corresponding eleven performed estimations. The choice of the Q d is based on the L-curve method proposed by [28] where its nearly optimal value (Not optimal in absolute sense due to discrete evaluation points Q d and the user defined Rθ) is such that the best trade-off is achieved between the Error norm and Smoothing error. These norms are defined as and, where d(k) and T(k) are the estimated (disturbance) and measured torque respectively, while n k is the total number of sampling point k. On the left side of Figure 9 the L-curve for the evaluated Q d grid points is shown where the blue marked point is the chosen value corresponding to Q d = 10 0 . This value have been used for the results shown in Figures 6-8. As expected, it is observed that the error norm decreases with an increasing smoothing error which corresponds to an increasing Q d till a saturation is reached. This occurs when a further increase of process noise value does not show significant improvements to the estimation results (Q d > 10 0 ).
On the right side of Figure 9 the estimated torque with the chosen Q d (marked in blue) is compared to a sub-optimal value (marked in orange) on the velocity transitions zones while in Figure 10 the full time series are compared. In Figures 9 and 10, it can be seen that despite a relatively similar tracking of the input (more delayed), at low rotational speed using a smaller covariance than the "optimal" one, the estimation accuracy degrades over time with a worse tracking of estimated torque. Although this study does not address the full scope of noise covariance tuning, the author deemed it sufficient to explain the methodological developments considered in this contribution. Further research on covariance tuning might be necessary to obtain a more holistic approach.

Discussion and Conclusions
This work presents a new estimation methodology tailored for MB models to enable the definition of virtual sensors for various system states and inputs.
Through the choice of a general MB modeling approach various key physical effects can be accurately accounted for, ranging from nonlinear kinematics to complex dynamic effects. The developed framework allows using these multibody models in an estimation framework without particular additional modeling assumptions or reformulations. More specifically, no constraint elimination methods are required to employ the defined MB model into the estimation framework, reducing the preparation time and the user effort to setup the estimation problem while ensuring the correct physical and mathematical interpretation of the system under investigation. As the proposed methodology has no particular assumptions with respect to the multibody model formulation it can be easily extended to any of the commonly available (flexible) MB approaches, e.g., FNCF, FFR-CMS, or GCMS. However, to fully benefit from the proposed approach the equations of motion and tangent stiffness matrices of the system should be analytically available to efficiently assemble the linearized system and measurement matrices.
In the present work, we exploited the FNCF MB approach, as this methodology inherently enables an easy and efficient evaluation of the different tangent model matrices required for the estimation framework.
Finally, the developed methodology has been experimentally validated on a slidercrank mechanism. Very high accuracy is obtained for the estimated states with respect to the available measurements. Good accuracy is also obtained for the estimated input torque, but due to the larger dynamic model errors in e.g., friction effects the resulting errors are higher than those obtained for the states. The validation has been performed over a relatively large time-span which also demonstrates the capability of the presented framework to obtain long-term stable estimates with a bounded uncertainty, in the form of a bounded covariance.
The presented methodology has some drawbacks since a large number of states (including the Lagrange multipliers) and measurements (including the constraints equations) are employed. These lead to a computationally less efficient approach as compared to other state of the art techniques (e.g., using minimal coordinates [15]). A possible solution to mitigate this issue might come from a wise selection of the number of bodies and constraints equations to construct the high-fidelity model. For instance, in this contribution, the choice of redundant number of bodies and constraints was made in purpose to stress the potential of the proposed methodology while dealing with redundant set of DAEs equations. More precisely, not all bodies and hence constraints were required to achieve the estimated motor torque with the same level of accuracy (e.g., the motor housing and the different supports). Nevertheless, if computational efficiency is not a limiting factor, i.e., if an online estimation is not required, this approach has the potential to enable a very generic deployment of (flexible) multibody-based state-input estimation.
Future work will focus on how these methodologies can be employed to obtain more accurate descriptions for key dynamic effects such as the friction present in these multibody systems. Funding: This work has been carried out within the framework of the Flanders Make ICON project: Virtual Sensing on Flexible systems using distributed parameter models (VSFlex). The research was partially supported by Flanders Make, the strategic research center for the manufacturing industry. Internal Funds KU Leuven are gratefully acknowledged for their support. VLAIO (Flanders Innovation & Entrepreneurship Agency) is also acknowledged for its support.
Institutional Review Board Statement: Not applicable.
Informed Consent Statement: Not applicable.

Data Availability Statement:
The data presented within this study are resulting from activities within the acknowledged projects and are available therein.

Conflicts of Interest:
The authors declare no conflict of interest.

Abbreviations
The following abbreviations are used in this manuscript: T ∈ R n a1 +n a 2 vertical vector concatenation A ∈ R n 1 ×n 2 matrix I a ∈ Z n a ×n a identity matrix 0 a 1 ∈ Z n a 1 zero vector 0 a 1 ,a 2 ∈ Z n a 1 ×n a 2 zero matrix da 2 ∈ R n a 1 ×n a 2 total derivative ∂a 1 ∂a 2 ∈ R n a 1 ×n a 2 partial derivative ∂ 2 a 1 ∂a 2 ∂a 3 ∈ R n a 1 ×n a 2 ×n a 3 second partial derivative || || 2 2-norm operator

Appendix A. Influence of the Forward Differentiation Scheme to the Linearization of the EOMs
In Section 3, the single step backward differentiation formula (BDF-1) was introduced to derive the fully explicit discrete-time linearized form of the EOMs (Equation (19)). In this appendix, the influence of another differentiation scheme, namely the single step forward differentiation scheme, is reported, demonstrating the limitations introduced by such differentiation formula to the proposed linearization approach.
The single step forward differentiation scheme can be written as with h representing the constant time step size as shown in Figure A1. By substituting Equation (A1) into Equation (8) the discrete-time EOMs g d are obtained: Similarly to Equation (21) the Jacobian for the forward Euler time-integrator can be computed as: Here, C t and M t are the tangent damping and mass matrices obtained from the partial derivatives of the continuous g 2 equations in Equation (8) evaluated at time step k: and β and γ are matrix coefficients function of the defined integration rule, which are given for the forward Euler scheme by: As it can be seen from Equation (A3), the matrix G x k+1 is singular and therefore not invertible to compute the linearized system matrix A of Equation (24) required for the KF-based estimation framework. Based on the above demonstration, the forward Euler differentiation scheme is not applicable to the proposed linearization approach.
This can be better understood looking at the fundamental assumptions behind the choice of the differentiation scheme. If a forward differentiation scheme is chosen, it practically means that Equation (19) will be derived starting from x k looking forward in time to x k+1 as graphically depicted in Figure A1, but due to the implicit nature of the problem there are not enough information in x k to invert the problem with respect to x k+1 .