Preprint
Article

This version is not peer-reviewed.

Modeling and Control Design of Port-Hamiltonian Systems in Discrete-Time

Submitted:

28 July 2026

Posted:

31 July 2026

You are already at the latest version

Abstract
This paper aims to describe a synthesis procedure for discrete-time, energy-based regulators for continuous-time port-Hamiltonian systems. The methodology consists of three steps. The first deals with the definition of a discrete-time approximation of the plant, which is subsequently employed in the development of the control law. The discrete-time model is obtained from the continuous-time dynamics by replacing the gradient of the Hamiltonian function with a discrete gradient. In this way, passivity, with the energy as storage function, is preserved, although the resulting state equation is in implicit form. The second step concerns the control synthesis and extends the continuous-time energy-shaping plus damping injection design technique to the proposed class of discrete-time port-Hamiltonian systems. Finally, the last step addresses the interconnection between the digital controller and the continuous-time plant. The coupling is implemented via a zero-order hold and relies on the solution of an optimisation problem that determines the “best” and “minimal” correction to be applied to the nominal control action in order to achieve the same performance as that obtained when the regulator is connected in closed loop with the discrete-time model of the plant. This is the reference scenario used to develop and tune the control law. The complete procedure (time discretisation, control design, and coupling implementation) is illustrated through an example.
Keywords: 
;  ;  ;  ;  

1. Introduction

Port-Hamiltonian systems were introduced about thirty years ago to provide a unified framework for modeling lumped-parameter continuous-time physical systems, [1]. Over the past decades, several control synthesis methodologies have been developed, [2,3,4]. More recently, their discrete-time extension has become a popular framework for the geometric integration of ordinary differential equations (ODEs), paving the way for digital control system design. Time-integration schemes are designed to preserve either the “structure” or the “energy” of continuous-time systems, and the literature distinguishes between two main categories: symplectic and energy-preserving integrators. Discrete-time Hamiltonian and port-Hamiltonian systems based on symplectic integrators have been extensively employed, for example, in [5,6,7,8,9]. This work instead focuses on a class of port-Hamiltonian systems belonging to the family of energy-preserving integrators, [10,11], with a particular emphasis on discrete-time control design.
The discrete-time port-Hamiltonian systems considered in this paper constitute a simple extension of those proposed in [12,13,14,15,16,17,18] and are characterised by dynamics that depend on the discrete gradient of the Hamiltonian, ([10], Definition 3.1). Further details can be found in [19,20], while the extension to distributed-parameter systems is presented in [21,22]. This particular dynamic structure is useful for control synthesis because it directly yields an energy-balance relation for the discrete-time system, thereby simplifying both the design procedure and Lyapunov-based stability analysis. Its main drawback is that the state equation is implicit.
The control design procedure consists of three steps. The first is devoted to developing a discrete-time port-Hamiltonian approximation of the plant that belongs to the class illustrated before. Based on this discrete-time model, the second design step addresses the definition of the control action. One option is to rely on an extension of the energy-shaping plus damping-injection paradigm, [2], for which several contributions have already been presented in the literature, [9,12,19,20]. Here, we propose an extension of the Interconnection and Damping Assignment Passivity-based Control (IDA-PBC) framework, [3]. It is worth mentioning that notable contributions in this research area can also be found in [18,23,24]. The idea is to determine a state-feedback law capable of modifying the internal and dissipative structures of the open-loop system, as well as its Hamiltonian function. In particular, the “new” Hamiltonian is characterised by a (global) minimum at the desired configuration (energy shaping), while the dissipative structure is modified to introduce sufficient dissipation to make this minimum attractive (damping injection). As in continuous time, mapping the open-loop system into the desired closed-loop system requires solving a matching equation. In continuous time, this equation is a nonlinear partial differential equation (PDE), whereas in the digital case it is algebraic in the discrete gradient.
The feedback action acts on the system by modifying its energy function and “structure”. These are two effective degrees of freedom for shaping steady-state and transient behaviour. Since the design and tuning of the regulator are performed in discrete time, the remaining problem is to develop a strategy to couple the digital controller with the continuous-time plant. This constitutes the third and final step of the synthesis procedure. Within energy- or passivity-based frameworks, the problem of interfacing digital and physical systems is usually addressed by preserving the passivity of the interconnection, [25,26]. The idea, instead, is to design an interface that guarantees performance similar to that achieved when the (digital) controller is interconnected with the discrete-time approximation of the plant (i.e., in the reference design scenario), while introducing minimal variations in the nominal control action, [27]. One way to “measure” performance is to consider the variation of the closed-loop Hamiltonian (energy) function along system trajectories. If, at each sampling instant, it decreases at least as much as in discrete time, then no performance degradation occurs. These considerations lead to an optimization problem in which the cost function is the amplitude of the perturbation applied to the nominal control action, while the constraints are given by the continuous-time plant dynamics and an upper bound on the “desired” energy level at the end of the sampling interval. The design procedure is illustrated through the example of a two-degree-of-freedom planar manipulator.
The paper is organized as follows. In Section 2, a summary on discrete-time port-Hamiltonian systems is presented, while an overview of the energy-based control design and the IDA-PBC framework in discrete-time are discussed in Section 3. Section 4 contains the digital-to-analog interfaces arising from the solution of different optimization problems. The example is discussed in Section 5, where the complete design procedure is illustrated in detail. Conclusions are in Section 6.

2. Discrete-Time Port-Hamiltonian Systems

In this paper, we refer to the following class of continuous-time port-Hamiltonian systems, [1]:
x ˙ ( t ) = J ( x ( t ) ) R ( x ( t ) ) H ( x ( t ) ) + G ( x ( t ) ) u ( t ) y ( t ) = G ( x ( t ) ) H ( x ( t ) ) x ( 0 ) = x 0 .
In (1), t 0 and x ( t ) X n are the time and state variable, u ( t ) U and y ( t ) Y , with U , Y m , are the input and output, J ( x ) , R ( x ) n × n are such that J ( x ) = J ( x ) and R ( x ) = R ( x ) 0 for all x X , G ( x ) n × m is full-rank, H : X is the Hamiltonian (energy) function, and x 0 X the initial condition. The matrix-valued functions J and R represent the interconnection and the dissipative structures of the system, respectively. Along system’s trajectories we have that
H ˙ ( x ( t ) ) = H ( x ( t ) ) R ( x ( t ) ) H ( x ( t ) ) + y ( t ) u ( t ) y ( t ) u ( t ) ,
so if H is lower-bounded, (1) is passive and H is the storage function.
The design of a digital control law for (1) relies on the discrete-time approximation proposed in [19,20]. In brief, such a discrete-time model is obtained at first by replacing the time derivative by the finite difference
x ˙ ( t k ) 1 τ ( x k + 1 x k ) ,
being t k = k τ the time samples and x k = x ( t k ) , with τ > 0 and k . Secondly, a discrete approximation of the gradient operator is adopted, see e.g. ([10], Definition 3.1).
Definition 1. 
Let Φ : p be a continuously differentiable function. A discrete gradient Φ : p × p p is a continuous map such that for all φ , φ + p we have
φ + φ Φ ( φ , φ + ) = Φ ( φ + ) Φ ( φ ) ,
lim φ + φ Φ ( φ , φ + ) = Φ ( φ ) .
Typical examples are the mean value discrete gradient [28] defined as
Φ ( φ , φ + ) = 0 1 Φ ( 1 σ ) φ + σ φ + σ ,
or the Gonzalez discrete gradient, [10]. For a quadratic function Φ ( φ ) = φ Q φ with Q = Q , it is easy to check that Φ ( φ , φ + ) = Q ( φ + φ + ) .
If we combine (1), (3) and Definition 1, for any k , the discrete-time formulation of the port-Hamiltonian dynamics for control design is, [19,20]:
x k + 1 = x k + τ J ¯ ( x k , x k + 1 ) R ¯ ( x k , x k + 1 ) H ( x k , x k + 1 ) + τ G ¯ ( x k , x k + 1 ) u k y k = G ¯ ( x k , x k + 1 ) H ( x k , x k + 1 ) ,
with u k = u ( t k ) and initial condition x 0 . This class of discrete-time systems can be seen as an extension of [12,15,18]. The functions J ¯ , R ¯ : X × X n × n and G ¯ : X × X n × m are discrete approximations of J, R and G. More precisely, for all x , x + X , we require that J ¯ ( x , x + ) = J ¯ ( x , x + ) , J ¯ ( x , x ) = J ( x ) , R ¯ ( x , x + ) = R ¯ ( x , x + ) 0 , R ¯ ( x , x ) = R ( x ) , and G ¯ ( x , x ) = G ( x ) . Admissible choices for J ¯ are J 1 2 x + x + , 1 2 J ( x ) + 1 2 J ( x + ) or simply J ( x ) , and similarly for R ¯ and G ¯ . From (4) and (7), we get the discrete-time version of (2):
H ( x k + 1 ) H ( x k ) = T H ( x k , x k + 1 ) ( x k + 1 x k ) = τ T H ( x k , x k + 1 ) R ¯ ( x k , x k + 1 ) H ( x k , x k + 1 ) + τ y k u k τ y k u k .
Example 1. 
In the linear case, the port-Hamiltonian system (1) takes the following form:
x ˙ ( t ) = J R Q x ( t ) + G u ( t ) y ( t ) = G Q x ( t ) x ( 0 ) = x 0 ,
where J , R n × n are constant and such that J = J and R = R 0 , while G n × m is constant and full rank. In (9), the Hamiltonian function is quadratic, more precisely H ( x ) = 1 2 x Q x , with Q = Q > 0 , which implies that H ( x ) = Q x . It is immediate to see that the discrete-time version of (9) is given by
x k + 1 = x k + τ 2 J R Q ( x k + x k + 1 ) + τ G u k y k = 1 2 G Q ( x k + x k + 1 ) .
Now, since the matrix I τ 2 ( J R ) Q is invertible because the eigenvalues of the matrix ( J R ) Q cannot have positive real part, the implicit state equation can be made explicit. Consequently, the state equation in (10) can be rewritten as
x k + 1 = I τ 2 ( J R ) Q I + τ 2 ( J R ) Q x k + τ I τ 2 ( J R ) Q G u k
since H ( x , x + ) = 1 2 Q ( x + x + ) , thus the explicit dynamics is described by a linear system with feedthrough.
Example 2. 
Let us consider a mechanical system locally described by n configuration variables q = ( q 1 , , q n ) n . The kinetic energy is 1 2 q ˙ M ( q ) q ˙ , being M ( q ) = M ( q ) > 0 for all q the generalized mass matrix, while we let V ( q ) to denote the potential energy. As illustrated in [1], if no constraints are present, the dynamics can be described by a port-Hamiltonian system in the form (1), more precisely:
q ˙ ( t ) p ˙ ( t ) = 0 I I D H q ( q ( t ) , p ( t ) ) α H α p ( q ( t ) , p ( t ) ) + 0 B ( q ) u ( t ) y ( t ) = B T ( q ) H p ( q ( t ) , p ( t ) ) ,
where p = M ( q ) q ˙ are the generalized momenta, the Hamiltonian function is the total energy
H ( q , p ) = 1 2 p T M ( q ) p + V ( q ) ,
u , y m are the generalized forces and velocities, respectively. Besides, in (11), we assume that B ( q ) is full rank, while D = D T 0 takes into account the viscous friction forces, if present. It is easy to see that the discrete-time approximation of (11) is
q k + 1 = q k + τ p H ( q k , p k , q k + 1 , p k + 1 ) p k + 1 = p k τ q H ( q k , p k , q k + 1 , p k + 1 ) D p H ( q k , p k , q k + 1 , p k + 1 ) + τ B ¯ ( q k , q k + 1 ) u k y k = B T ( q k , q k + 1 ) p H ( q k , p k , q k + 1 , p k + 1 ) ,
where B is a discrete approximation of B. For simplicity, we can set B ( q k , q k + 1 ) = B ( q k ) . Since the Hamiltonian function in (12) is non-quadratic, it is not always possible to employ the mean value discrete gradient, as obtaining an explicit expression for the integral in (6) may be difficult or even impossible. In such cases, one may either resort to an approximation of the integral or adopt a different discrete gradient, such as the Gonzalez discrete gradient, which is constructed by sampling the continuous one. Finally, note that the state equation in (13) is given in implicit form. Consequently, unlike the linear case discussed in Example 1, an explicit state-update equation cannot, in general, be derived.
Remark 1. 
System (7) is not based on a particular discrete gradient, which turns out to be a degree-of-freedom at disposal to the designer, together with the expression of J , R and G . Such a model for control design is a compromise between accuracy in the response and (numerical) complexity of the final control law. The drawback is that the state equation is implicit: this is the price to pay to have “for free” the energy-balance relation (8), which is the starting point for control design and stability analysis.
Remark 2. 
As mentioned in Remark 1 and reported in Examples 1 and 2, the state equation in (7) is in implicit form. It can be made explicit, i.e. solved for x k + 1 in the linear case discussed in Example 1 because H is quadratic and J, R and G in (1) are constants. This approach has been followed in [12,18]. In the nonlinear case, however, it is necessary to keep such an implicit formulation. Based on passivity arguments and inspired by [29], under mild conditions on the structure of the system and on the discrete gradient, in [20] has been shown that trajectories exist independently from the sampling time. This is the same rationale pursued in [15] where a similar result has been proved under the hypothesis that the sampling time is sufficiently small. In this paper we assume that the dynamical equations are well-posed, so the next state can be always (at least numerically) computed.

3. Energy-Based Control Design in Discrete-Time

This section aims at generalising the Interconnection and Damping Assignment Passivity-Based Control (IDA-PBC) design methodology [3], originally developed for continuous-time port-Hamiltonian systems, to the discrete-time setting. Remarkable contributions in this direction include [18,23] and [24], the latter being specifically focused on mechanical systems. These methodologies aim at assigning an equilibrium x n to (7) by means of state feedback, while preserving the port-Hamiltonian structure. If the closed-loop system retains the port-Hamiltonian form, asymptotic convergence to x can be established by relying on a balance relation similar to (8).
We start from the balance relation (8) for the open-loop dynamics (7), which can be compactly rewritten as
τ 1 H ( x k + 1 ) H ( x k ) = y k T u k d ( x k , x k + 1 ) ,
where d ( x k , x k + 1 ) 0 takes into account the dissipated power during the k-th sampling interval. Similarly to the continuous-time case [2,3], the idea behind the design of an energy-based state-feedback controller is to find
u k = β ( x k , x k + 1 ) + v k
so that the closed-loop dynamics obey the “new” balance relation
τ 1 H d ( x k + 1 ) H d ( x k ) = z k T v k d d ( x k , x k + 1 ) ,
in which H d ( x k ) is a “desired” energy with a (local) minimum at x , d d ( x k , x k + 1 ) 0 replaces the natural dissipation, increased to improve the convergence rate, and z k is the new passive output.
For simplicity, we assume that the matrix-valued functions J, R and G in (1) are constant, and consequently that their discrete-time counterparts J , R and G ¯ in (7) are also constant. The general case, in which these matrices depend on the state, is more involved. Nevertheless, most of the results and considerations developed for the simplified setting can be extended to the state-dependent case. The most natural extension of the IDA-PBC approach to the discrete-time setting requires to determine the feedback law β ( x k , x k + 1 ) in (14) so that the state equation in (7) is mapped to
x k + 1 = x k + τ J d R d H d ( x k , x k + 1 ) + τ G v k ,
which represents the “target” or “desired” dynamics. In (16), we have that
H d ( x k ) = H ( x k ) + H a ( x k ) J d = J + J a , with J a = J a T R d = R + R a , with R a = R a T 0 ,
are the desired Hamiltonian function, interconnection matrix and dissipative structure, respectively. It is immediate to see that, if we let
z k = G T H d ( x k , x k + 1 ) = y k + G T H a ( x k , x k + 1 )
the target system (16) equipped with the output z k satisfies the balance relation (15).
The comparison between the open-loop dynamics (7) and the target one (16) shows that the control action β ( x k , x k + 1 ) modifies the energy and the interconnection and dissipative structures of the original system. As far as the so-called energy-shaping action is concerned, the function H a ( x k ) selected so that the closed-loop energy H d ( x k ) in (17) has a minimum in x . Besides, R a is chosen to improve the convergence rate towards the minimum of the closed-loop energy function. A similar effect is achievable via output feedback (damping injection) by imposing that v k = φ ( z k ) in (14), with the function φ such that z T φ ( z ) 0 for all z m , and z k defined in (18). The simplest damping injection law is
v k = K z z k = K z G T H d ( x k , x k + 1 ) = K z y k + G T H a ( x k , x k + 1 ) ,
with K z m × m and K z = K z T 0 . Note that such a control action can be also applied to the open-loop system (7) by setting u k = φ ( y k ) . If x is the only invariant solution of the steady state, the “new” dissipative structure in the system forces the asymptotic stability of the equilibrium. With simple calculations, we get that H a ( x k ) , J a , R a and β ( x k , x k + 1 ) have to satisfy the matching equation:
G β ( x k , x k + 1 ) = ( J a R a ) ¯ H ( x k , x k + 1 ) + ( J d R d ) ¯ H a ( x k , x k + 1 )
In the next proposition, sufficient conditions for the solution of (20) so that the state-feedback action (14) asymptotically stabilises a (forced) equilibrium x n of (7) are presented. This result is an immediate extension of [20].
Proposition 1. 
Denote by x n a (forced) equilibrium for (7), and let K ¯ a : n × n n be a function such that
G ( J a R a ) ¯ H ( x k , x k + 1 ) + ( J d R d ) K ¯ a ( x k , x k + 1 ) = 0
being G the full-rank left annihilator of G, i.e. G G = 0 . If
K a x ( x ) = T K a x ( x ) ,
with K a ( x ) K ¯ a ( x , x ) , then there exists H a : n for which K a ( x ) = H a q ( x ) . Besides, if for all x , ξ n , we have that
( ξ x ) K ¯ a ( x , ξ ) = H a ( ξ ) H a ( x ) ,
then K ¯ a is the discrete gradient of H a , i.e. ¯ H a ( x , ξ ) = K ¯ a ( x , ξ ) , and the control action (14) with
β ( x k , x k + 1 ) = G + ( J a R a ) H ( x k , x k + 1 ) + ( J d R d ) K ¯ a ( x k , x k + 1 ) = G + ( J a R a ) ¯ H ( x k , x k + 1 ) + ( J d R d ) ¯ H a ( x k , x k + 1 ) ,
being G+ the pseudo-inverse of G, maps (7) to the discrete-time system (16) with Hamiltonian function, interconnection and dissipative structures defined in (17), and output (18). Finally, if
H ( x , x ) + K ¯ a ( x , x ) = 0 ( x x ) H ( x , x ) + K ¯ a ( x , x ) 0
for all x B δ ( x ) = { ξ n : x ξ δ } and for some δ > 0 , then x is a locally stable equilibrium for the closed-loop system with v k = 0 . Furthermore, if the largest invariant set contained in
x n ξ n s . t . T H d ( x , ξ ) R d H d ( x , ξ ) = 0 B δ ( x )
is { x } , then x is a locally asymptotically stable equilibrium for the closed-loop system with v k = 0 .
Proof. 
The result can be proved in the same way as ([20], Proposition 3.1). Note that asymptotic stability is a consequence of the La Salle’s invariance principle. In fact, for the closed-loop system we have H d ( x k + 1 ) H d ( x k ) = T H d ( x k , x k + 1 ) R d H d ( x k , x k + 1 ) 0 , thus the corresponding energy function decrease until the trajectories evolve inside the set (24). Since the largest invariant set contained in (24) equals { x } , the result immediately follows. □
A crucial point in the methodology of Proposition 1 is the solvability of the matching equation (21), which can be re-written in terms of the discrete gradient of H a as
G ( J a R a ) H ( x k , x k + 1 ) + ( J d R d ) H a ( x k , x k + 1 ) = 0 .
The simplest approach is to rely on the PDE that follows from (25) once x k + 1 x k x , i.e.:
G ( J a R a ) H x ( x ) + ( J d R d ) H a x ( x ) = 0 .
When the matrix-valued functions J, R, and G in (1) depend on the state variable x, it is not straightforward to derive a solution to (25) from its continuous-time counterpart (26). However, in the constant case considered in this paper, the function H a and the matrices J a and R a that satisfy (26) also satisfy (25). This result is summarized in the following corollary.
Corollary 1. 
Let us assume that there exists H a : X , J a , R a n × n and G m × n such that the continuous-time matching equation (26) holds for the port-Hamiltonian system (1). Then, H a , J a and R a are solution also of the discrete-time reformulation (25).
Proof. 
If we consider, for example, the mean value discrete gradient (6), since (26) holds for all x X , the result follows by replacing x with ( 1 σ ) x k + σ x k + 1 , where σ , and then integrating with respect to σ . □
Remark 3. 
Since the control action (14) with β ( x k , x k + 1 ) defined in (22) and v k in (19) depends on x k + 1 , we have to investigate how to compute u k at step k. The first important assumption is that the closed-loop dynamics obtained from (7), (14) and (19) is well-posed, see ([20], Proposition 2.1). The corresponding state equation is
x k + 1 = x k + τ J d R d + G K z G T H d ( x k , x k + 1 ) .
For (27) at each step k, we let
F d , k ( ξ ) x k + τ J d R d + G K z G T H d ( x k , ξ ) ,
where ξ n . So, ξ is the solution of ξ = F d , k ( ξ ) , with ξ x k + 1 only in the nominal case, i.e. when the plant exactly behaves as (27), while (14) and (19) provide u k . This approach is conceptually similar to [9], where the control design problem is tackled for discrete-time models of mechanical systems in port-Hamiltonian form arising from symplectic integration schemes (i.e., the implicit midpoint rule). On the other hand, it differs from [12,18] where the implicit state equation is approximated with an explicit one.
Remark 4. 
The key step in the procedure of Proposition 1 is to solve (21) for suitable matrices K ¯ a , J a , and R a , where K ¯ a must be the discrete gradient of a function H a . If the structure matrices of the port-Hamiltonian system (1) are not constant, Corollary 1 cannot be applied, and solving the matching equation may become considerably more involved. A different approach has been discussed in [20]. The idea is to exploit the algebraic nature of (21) to derive a broader class of control laws of the form (22), capable of performing an (approximate) energy-shaping action on the open-loop system (7) without requiring K ¯ a to be the discrete gradient of an energy function. This approach is the discrete-time extension of the technique proposed in [30]. This topic is beyond the scope of the present paper.

4. “Performance-Preserving” Coupling Strategies

The aim of this section is to present a strategy for coupling the discrete-time regulator designed according to the procedure illustrated in Section 3 with the continuous-time plant (1). Since the controller is designed on the basis of the discrete-time model (7), its performance is typically assessed through numerical simulations using the same model as a reference. The proposed coupling strategy therefore aims at applying the “smallest” perturbation to the nominal stabilising control law that guarantees performance as close as possible to that of the reference case. In particular, the transient and steady-state behaviours are preserved if the variation of the closed-loop Hamiltonian function H d defined in (17) along the system trajectories remains unchanged. These considerations lead to an optimization problem that must be solved at each step k , resulting in a novel digital-to-analog interface.
For any energy-based control synthesis methodology such as the ones that fit into the framework illustrated in Section 3, let us consider a coupling algorithm based on the solution of the following nonlinear optimization problem at each step k N ,27]:
min u δ , x ( t ) u δ 2 s . t . x ˙ ( t ) = J ( x ( t ) ) R ( x ( t ) ) H ( x ( t ) ) + G ( x ( t ) ) β ( x k , x k + 1 ) + u δ x ( t k ) = x k β ( x k , x k + 1 ) + u δ U u δ 2 Δ H d ( x ( t k + 1 ) ) H d ( x k + 1 ) .
The idea is simple. At each t k , the state variable of (1) is acquired, and the control action (14) is computed by relying on the discrete-time model (7) in which x k = x ( t k ) . For simplicity and without loss of generality, in (14) we assume that v k = 0 , i.e. the required dissipation is introduced via the state feedback law β . As discussed in Remark 3, the design procedure provides the “next” state x k + 1 and u k = β ( x k , x k + 1 ) so, in the ideal case, the value of the closed-loop energy in t k + 1 is known and equal to H d ( x k + 1 ) . The digital-to-analog interface requires to compute the “smallest” perturbation u δ R m to the nominal control input β ( x k , x k + 1 ) so that the control action u ( t ) = β ( x k , x k + 1 ) + u δ applied to (1) during [ t k , t k + 1 ) is admissible, i.e. it belongs to the set U, and the value of H d in x ( t k + 1 ) is not greater than H d ( x k + 1 ) . The result is that the closed-loop energy function decreases at least as in the reference discrete-time case. The parameter Δ > 0 is an upper bound for u δ .
Remark 5. 
The feasibility of (28) is not always guaranteed. This is the major issue of the approach since at every t k the perturbation u δ has to be computed to obtain the control action u k . As in ([31] Theorem 2.5]), thanks to the Gronwall-Bellman inequality, it is possible to show that there could be sampling instants for which H d does not decrease as expected, i.e. that x ( t k + 1 ) does not belong to the “desired” level set, as specified by the last inequality constraint in (28). A similar problem has been tackled in [25] by dissipating the difference between achieved and desired energy at t k + 1 in the next sampling interval(s). This strategy is applicable here, but this topic is not addressed in this paper. Soft constraints are a simple way to tackle the feasibility issue of (28) in a simple way. The corresponding optimization problem is
min u δ , ε , x ( t ) u δ 2 + K ε ε 2 s . t . x ˙ ( t ) = J ( x ( t ) ) R ( x ( t ) ) H ( x ( t ) ) + G ( x ( t ) ) β ( x k , x k + 1 ) + u δ x ( t k ) = x k H d ( x ( t k + 1 ) ) H d ( x k + 1 ) + ε 2 .
where we have removed the amplitude constraint on u δ and assumed that U R m . In (29), we let K ε 1 and U R m , so the variable ε R allows to dynamically relax the constraint on the closed-loop energy function H d at t k + 1 . The idea is to compute the “smallest” correction u δ to the nominal control action β ( x k , x k + 1 ) so that the H d ( x ( t k + 1 ) ) is as close as possible to the target value H d ( x k + 1 ) . The mismatch is reduced by selecting K ε sufficiently large. It is easy to see that (29) is always feasible, and that existence of solution follows from the cost function being lower-bounded.
Noticeable limitations of (28) and (29) are that the constraint on x ( t ) depends on a nonlinear ODE and that the closed-loop Hamiltonian function H d ( x ) is, in general, non-quadratic. Consequently, the real-time implementation of the coupling mechanism is potentially computationally demanding. Under a few conditions, an explicit solution is possible when the plant is linear and the closed-loop Hamiltonian is quadratic. The result is based on ([32], Proposition 1), reported below.
Proposition 2. 
Let a R n , P R n × n and such that P = P T > 0 , and r R , with r > 0 . The solution v of the convex optimization problem
min v ( v a ) T P ( v a ) s . t . ( v c ) T P ( v c ) r 2
is
v = a if ( a c ) T P ( a c ) r 2 r ( a c ) ( a c ) P ( a c ) + c otherwise .
Let us consider the linear port-Hamiltonian system (9), which can be rewritten in the ( A , B , C ) form with A = ( J R ) Q , B = G , and C = G T Q . Let us also assume that the discrete-time control design procedure assigns target dynamics in port-Hamiltonian form with quadratic Hamiltonian
H d ( x ) = 1 2 ( x x ) T Q d ( x x ) , Q d = Q d T > 0 .
With simple computations, it is easy to see that, at the end of the k-th sampling interval, starting from x ( t k ) = x k and under the control input u k = β ( x k , x k + 1 ) + u δ , (9) reaches
x ( t k + 1 ) = A k + B δ u δ ,
where
A k = e A τ x k + 0 τ e A σ σ B β ( x k , x k + 1 ) B δ = e A τ 0 τ e A σ σ B .
Consequently, the energy constraint H d ( x ( t k + 1 ) ) H d ( x k + 1 ) in (28) takes the form of the quadratic constraint in (30), with P = B δ T Q d δ , c = B δ + x k , and r 2 = 2 H d ( x k + 1 ) . Thus, the coupling strategy is recast as the optimization problem of Proposition 2, in which a = 0 . Consequently,
u δ = 0 if 1 2 x A k Q d 2 H d ( x k + 1 ) 1 2 H d ( x k + 1 ) x A k Q d x k otherwise ,
where x A k Q d 2 = ( x A k ) T Q d ( x k ) . Note that this result can be used to address the general nonlinear case approximately, by relying, at each sampling interval k N , on a linear approximation of the plant dynamics around x k .

5. Numerical Example: The 2-Dof Planar Robotic Manipulator

Let us consider the two degrees-of-freedom planar manipulator of Figure 1, which belongs to the class illustrated in Example 2.
The generalised coordinates are q = ( q 1 , q 2 ) R 2 , and the total energy is (12) in which the inertia matrix is
M ( q ) = j 1 + j 2 + m 1 a 1 2 + m 2 l 2 2 + a 2 2 + 2 a 2 l 1 cos q 2 j 2 + m 2 a 2 2 + a 2 l 1 cos q 2 j 2 + m 2 a 2 2 + a 2 l 1 cos q 2 j 2 + m 2 a 2 2
and the potential energy is
V ( q ) = m 1 g a 1 sin q 1 + m 2 g l 1 sin q 1 + a 2 sin ( q 1 + q 2 ) ,
with g the gravity acceleration. The continuous-time model is (11), with B ( q ) = I and D = d I , where d 0 . The inputs u ( t ) R 2 are the torques at each joint. The parameters are reported in Table 1.
The discrete-time approximation of the plant model is (13), and in the numerical examples, the mean value discrete gradient (6) is employed. Note that from (34), for any q , q + 2 , we have that
V ( q , q + ) = ¯ q 1 V ( q , q + ) ¯ q 2 V ( q , q + ) ,
where q + = ( q 1 + , q 2 + ) and
¯ q 1 V ( q , q + ) = m 1 g a 1 + m 2 g l 1 sin q 1 + sin q 1 q 1 + q 1 + m 2 g a 2 sin ( q 1 + + q 2 + ) sin ( q 1 + q 2 ) q 1 + + q 2 + q 1 q 2 ¯ q 2 V ( q , q + ) = m 2 g a 2 sin ( q 1 + + q 2 + ) sin ( q 1 + q 2 ) q 1 + + q 2 + q 1 q 2 .
Based on the general framework summarized in Proposition 1, it is easy to check that the matching equation (21) with J a = R a = 0 is satisfied if H a depends on the displacements q k only. As a consequence, the control action β only shapes the potential energy. The simplest choice is to have H a ( q ) = V ( q ) + 1 2 ( q q ) K p ( q q ) , with K p = K p > 0 , so that the desired Hamiltonian function H d ( q , p ) = H ( q , p ) + H a ( q ) has a global minimum in x , which means that the conditions (23) are satisfied.. It is interesting to note that an explicit expression for β can be computed based on (35) and on the fact that the further term in H a is quadratic. This leads to the PD plus gravity compensation controller. Asymptotic convergence to the global minimum x of H d ( q , p ) is obtained via the damping injection law (19), where z k = y k = ¯ p H ( x k , x k + 1 ) is the output of either the plant and of the closed-loop system. As far as the controller parameters are concerned, we have that K p = 60 I and K z = 20 I .
The block diagram of the complete system resulting from the coupling of the discrete-time controller and the continuous-time plant is reported in Figure 2 to show how the control action is implemented in practice.
Since the stabilising law is based on state-feedback, the starting point is to sample the state x ( t ) of the plant in t = t k . The sampled variable x k is used to determine the “desired” next state ξ k according to the target dynamics. As discussed in Remark 3, the discrete variable ξ k has been introduced to distinguish from x k + 1 that denotes the sampled value of x ( t ) in t = t k + 1 . Getting ξ k requires the solution of an implicit equation. This step is represented by the grey box. Based on x k and ξ k , the control action β is computed, while the “corrective” term u δ follows from the strategies discussed in Section 4. In both the cases, we let x k + 1 ξ k .
At first, the behaviour obtained in the discrete-time case, i.e. when the control law is applied to the discrete-time formulation (13) of the plant, is reported in Figure 3.
As a matter of fact, this represent the desired response that the designer aims at achieving when the digital controller is coupled with the “real” plant or, in this case, to its continuous-time model (11). The synthesis of the control law and the tuning of the regulator parameters is carried out in the discrete-time setting, and the idea is to get analogous performances in the real-world scenario. Starting from the top graph of Figure 3, the evolution of the discrete displacements q k , of the control input u k and of the closed-loop Hamiltonian function H d ( x k ) are reported. This latter response summarizes the transient behaviour of the controlled system and it is the main information required by the coupling techniques discussed in Section 4.
We analyse the coupling strategy based on the optimization problem (29) in which K ε = 10 4 . This sub-optimal formulation of (28) has been preferred because it does not suffer from any feasibility issue. It is worth mentioning, however, that for the specific case discussed here (28) is always feasible. The closed-loop system behaviour is reported in Figure 4 and Figure 5. A comparison between Figure 3 and Figure 4 shows that the performances obtained when the discrete-time controller is coupled with the continuous-time plant are practically the same as in the reference case. The role of the interconnection mechanism is summarized in Figure 5. The correction term u δ is different from 0 only in the initial part of the transitory and its amplitude is noticeably lower than the nominal control action β . The design procedure carried out in discrete-time by relying on the class of implicit port-Hamiltonian systems (7) or (13), in this specific case, ensures very good performances by its own. Consequently, the constraint on the amplitude of u δ , i.e. the parameter Δ that appears in the optimization problem (28), is not strictly necessary from a “practical” point of view in a real-world scenario. In some sense, this motivates the choice carried out to define the optimization problem (29) with the goal of not having any feasibility issues.
In the graph at the bottom of Figure 5, the evolution of Δ H d ( t k ) = H d ( ξ k 1 ) H d ( x ( t k ) ) is reported. Such a quantity represents the difference between target and achieved closed-loop Hamiltonian at each sample instant. In other words, at each sampling interval k, the ξ k variable is computed. It represents the next state according to the desired evolution of the controlled system in discrete-time. This means that H d ( ξ k ) is the target value for the closed-loop energy to be reached at the end of the sampling interval, i.e. in t k + 1 . The coupling strategy should assure that H d ( x ( t k + 1 ) ) is lower or equal than H d ( ξ k ) . Note that Δ H d ( t k ) in Figure 5 is coherent with such a desired behaviour, which means that the reference performances of the discrete-time scenario are obtained in the mixed discrete-continous-time case.

6. Conclusions and Future Activities

This paper presented a complete synthesis procedure for the design and implementation of energy-based digital controllers for port-Hamiltonian systems. The procedure consists of three main steps. First, a discrete-time port-Hamiltonian approximation of the plant is obtained by “replacing” the Hamiltonian gradient with a discrete gradient. This construction preserves the energy-balance relation of the continuous-time system, although it generally leads to implicit state equations. Second, an extension of the IDA-PBC methodology to the resulting class of discrete-time systems is presented. The proposed design reshapes the Hamiltonian function and modifies the interconnection and dissipative structures in order to assign a desired equilibrium and guarantee its asymptotic stability under suitable conditions. The third step addresses the interconnection between the digital controller and the continuous-time plant. A performance-preserving digital-to-analog interface is proposed, based on the solution of an optimization problem that computes the smallest correction to the nominal control action required to enforce a desired decrease of the closed-loop Hamiltonian over each sampling interval. A soft-constrained formulation is also considered to address possible feasibility issues. For linear systems with quadratic desired Hamiltonians, the optimization problem admits an explicit solution. The complete procedure was illustrated using a two-degree-of-freedom planar manipulator. The numerical results show that the proposed interface allows the mixed discrete-continuous-time closed-loop system to reproduce closely the response obtained in the reference discrete-time design scenario, while requiring only a small correction to the nominal control action, mainly during the initial transient.
Future work will focus on extending the proposed discrete-time IDA-PBC framework to systems with state-dependent structure matrices, for which solving the matching equation is more challenging. Further research will also address computationally efficient implementations of the coupling strategy for nonlinear systems, the treatment of feasibility issues over successive sampling intervals, and experimental validation on physical systems.

References

  1. van der Schaft, A. L2-Gain and Passivity Techniques in Nonlinear Control. In Communication and Control Engineering, 3rd ed.; Springer International Publishing AG: Cham, Switzerland, 2017. [Google Scholar]
  2. Ortega, R.; van der Schaft, A.; Mareels, I.; Maschke, B. Putting energy back in control. In Control Systems Magazine; IEEE, 2001; pp. 18–33. [Google Scholar]
  3. Ortega, R.; van der Schaft, A.; Maschke, B.; Escobar, G. Interconnection and damping assignment passivity-based control of port-controlled Hamiltonian systems. Automatica 2002, 38, 585–596. [Google Scholar] [CrossRef]
  4. Fujimoto, K.; Sugie, T. Canonical transformation and stabilization of generalized Hamiltonian systems. Syst. Control Lett. 2001, 42, 217–227. [Google Scholar] [CrossRef]
  5. Ruth, R. A Canonical Integration Technique. Nucl. Sci. IEEE Trans. 1983, 30, 2669–2671. [Google Scholar]
  6. Gonzalez, O.; Simo, J. On the stability of symplectic and energy-momentum algorithms for non-linear Hamiltonian systems with symmetry. Comput. Methods Appl. Mech. Eng. 1996, 134, 197–222. [Google Scholar] [CrossRef]
  7. Marsden, J.; West, M. Discrete mechanics and variational integrators. Acta Numer. 2001, 10, 357–514. [Google Scholar] [CrossRef]
  8. Kotyczka, P.; Lefèvre, L. Discrete-time port-Hamiltonian systems: A definition based on symplectic integration. Syst. Control Lett. 2019, 113, 104530. [Google Scholar] [CrossRef]
  9. Kotyczka, P.; Thoma, T. Symplectic discrete-time energy-based control for nonlinear mechanical systems. Automatica 2021, 133, 109842. [Google Scholar] [CrossRef]
  10. Gonzalez, O. Time integration and discrete Hamiltonian systems. J. Nonlinear Sci. 1996, 6, 449–467. [Google Scholar] [CrossRef]
  11. Quispel, G.; Turner, G. Discrete gradient methods for solving ODEs numerically while preserving a first integral. J. Phys. A Math. General. 1996, 29, L341. [Google Scholar] [CrossRef]
  12. Gören-Sümer, L.; Yalçin, Y. Gradient Based Discrete-Time Modeling and Control of Hamiltonian Systems. In Proceedings of the 17th IFAC World Congress, Seoul, Korea, July 6-11 2008; pp. 212–217. [Google Scholar]
  13. Monaco, S.; Normand-Cyrot, D.; Tiefensee, F. Nonlinear port controlled Hamiltonian systems under sampling. In Proceedings of the 49th IEEE Conference on Decision and Control (CDC 2010), Atlanta, Georgia, USA, Dec. 15-17 2010; pp. 1782–1787. [Google Scholar]
  14. Celledoni, E.; Høiseth, E. Energy-Preserving and Passivity-Consistent Numerical Discretization of Port-Hamiltonian Systems. arXiv 2017, arXiv:1706.08621. [Google Scholar]
  15. Aoues, S.; Di Loreto, M.; Eberard, D.; Marquis-Favre, W. Hamiltonian systems discrete-time approximation: Losslessness, passivity and composability. Syst. Control Lett. 2017, 110, 9–14. [Google Scholar] [CrossRef]
  16. Moreschini, A.; Mattioni, M.; Monaco, S.; Normand-Cyrot, D. Discrete port-controlled Hamiltonian dynamics and average passivation. In Proceedings of the IEEE 58th Annual Conference on Decision and Control (CDC), Nice, France, Dec. 11-13 2019; pp. 1430–1435. [Google Scholar]
  17. Moreschini, A.; Monaco, S.; Normand-Cyrot, D. Gradient and Hamiltonian dynamics under sampling. In Proceedings of the 11th IFAC Symposium on Nonlinear Control Systems, NOLCOS 2019; Jadachowski, L., Ed.; Vienna, 4-6 Sep 2019. [Google Scholar]
  18. Moreschini, A.; Mattioni, M.; Monaco, S.; Normand-Cyrot, D. Stabilization of discrete port-Hamiltonian dynamics via interconnection and damping assignment. IEEE Control Syst. Lett. 2021, 5, 103–108. [Google Scholar] [CrossRef]
  19. Macchelli, A. Trajectory Tracking for Discrete-Time Port-Hamiltonian Systems. IEEE Control Syst. Lett. 2022, 6, 3146–3151. [Google Scholar] [CrossRef]
  20. Macchelli, A. Control Design for a Class of Discrete-Time Port-Hamiltonian Systems. Autom. Control IEEE Trans. 2023, 68, 8224–8231. [Google Scholar] [CrossRef]
  21. Macchelli, A. A Discrete-Time Formulation of Nonlinear Distributed-Parameter Port-Hamiltonian Systems. IEEE Control Syst. Lett. 2024, 8, 802–807. [Google Scholar] [CrossRef]
  22. Macchelli, A. Port-Hamiltonian Boundary Control Systems in Discrete-Time. Modelling and Control Design. Autom. Control IEEE Trans. 2026, 71, 722–736. [Google Scholar] [CrossRef]
  23. Gören-Sümer, L.; Yalçin, Y. A Direct Discrete-time IDA-PBC Design Method for a Class of Underactuated Hamiltonian Systems. In Proceedings of the 18th IFAC World Congress, Milan, Aug.-1 Sep. 2011. [Google Scholar]
  24. Aoues, S.; Eberard, D.; Marquis-Favre, W. Discrete IDA-PBC control law for Newtonian mechanical port-Hamiltonian systems. In Proceedings of the IEEE 54th Annual Conference on Decision and Control (CDC), Osaka, Japan, Dec. 15-18 2015; pp. 4388–4393. [Google Scholar]
  25. Stramigioli, S.; Secchi, C.; van der Schaft, A.; Fantuzzi, C. Sampled Data Systems Passivity and Discrete Port-Hamiltonian Systems. Robot. IEEE Trans. 2005, 21, 574–587. [Google Scholar] [CrossRef]
  26. Costa-Castelló, R.; Fossas, E. On Preserving Passivity in Sampled-data Linear Systems. Eur. J. Control 2007, 13, 583–590. [Google Scholar] [CrossRef]
  27. Macchelli, A. On the Synthesis of Discrete-time Energy-based Regulators for Port-Hamiltonian Systems. In Proceedings of the 22nd IFAC World Congress, Yokohama, Japan, July 9-14 2023; pp. 2889–2894. [Google Scholar]
  28. Harten, A.; Lax, P.; Van Leer, B. On Upstream Differencing and Godunov-Type Schemes for Hyperbolic Conservation Laws. SIAM Rev. 1983, 25, 35–61. [Google Scholar] [CrossRef]
  29. Ehrhardt, M.; Riis, E.; Ringholm, T.; Schönlieb, C.B. A geometric integration approach to smooth optimisation: Foundations of the discrete gradient method. arXiv 2020, arXiv:1805.06444. [Google Scholar]
  30. Nunna, K.; Sassano, M.; Astolfi, A. Constructive Interconnection and Assignment for Port-Controlled Hamiltonian Systems. Autom. Control IEEE Trans. 2015, 60, 2350–2361. [Google Scholar] [CrossRef]
  31. Khalil, H. Nonlinear Systems, 2nd ed.; Prentice Hall, 1996. [Google Scholar]
  32. Krupa, P.; Jaouani, R.; Limon, D.; Alamo, T. A Sparse ADMM-Based Solver for Linear MPC Subject to Terminal Quadratic Constraint. Control Syst. Technol. IEEE Trans. 2024, 32, 2376–2384. [Google Scholar] [CrossRef]
Figure 1. The two degrees-of-freedom planar manipulator.
Figure 1. The two degrees-of-freedom planar manipulator.
Preprints 225367 g001
Figure 2. Schematic representation of the closed-loop system.
Figure 2. Schematic representation of the closed-loop system.
Preprints 225367 g002
Figure 3. Response in discrete-time (reference scenario).
Figure 3. Response in discrete-time (reference scenario).
Preprints 225367 g003
Figure 4. Response with u δ obtained thanks to (29).
Figure 4. Response with u δ obtained thanks to (29).
Preprints 225367 g004
Figure 5. Behaviour of the coupling strategy based on (29).
Figure 5. Behaviour of the coupling strategy based on (29).
Preprints 225367 g005
Table 1. Parameters of the robot in Figure 1.
Table 1. Parameters of the robot in Figure 1.
parameter value parameter value
m 1 = m 2 1 j 1 = j 2 0.1
l 1 = l 2 1 a 1 = a 2 0.5
d 0.01 τ 0.05
( q 0 , p 0 ) π , 2 3 π , 5 , 5 q π 3 , π 3
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.
Copyright: This open access article is published under a Creative Commons CC BY 4.0 license, which permit the free download, distribution, and reuse, provided that the author and preprint are cited in any reuse.
Prerpints.org logo

Preprints.org is a free preprint server supported by MDPI in Basel, Switzerland.

Subscribe

© 2026 MDPI (Basel, Switzerland) unless otherwise stated

Accessibility

Disclaimer

Terms of Use

Privacy Policy

Privacy Settings