Global Energy-Optimal Redundancy Resolution of Hydraulic Manipulators : Experimental Results for a Forestry Manipulator

This paper addresses the energy-inefficiency problem of four-degrees-of-freedom (4-DOF) hydraulic manipulators through redundancy resolution in robotic closed-loop controlled applications. Because conventional methods typically are local and have poor performance for resolving redundancy with respect to minimum hydraulic energy consumption, global energy-optimal redundancy resolution is proposed at the valve-controlled actuator and hydraulic power system interaction level. The energy consumption of the widely popular valve-controlled load-sensing (LS) and constant-pressure (CP) systems is effectively minimised through cost functions formulated in a discrete-time dynamic programming (DP) approach with minimum state representation. A prescribed end-effector path and important actuator constraints at the position, velocity and acceleration levels are also satisfied in the solution. Extensive field experiments performed on a forestry hydraulic manipulator demonstrate the performance of the proposed solution. Approximately 15–30% greater hydraulic energy consumption was observed with the conventional methods in the LS and CP systems. These results encourage energy-optimal redundancy resolution in future robotic applications of hydraulic manipulators.


Introduction
Hydraulic loaders are powerful, typically 4-degrees-of-freedom (4-DOF) manipulators, that are used for heavy-duty material handling on mobile machines, such as trucks and forest forwarders. Currently, hydraulic loaders are predominantly operated by humans, but loader manufacturers are interested in diversifying their offerings through robotic functionality to remain competitive. On the research side, and in the industry, subjects dealing with reducing reliance on the expertise of human operators in loader control have consequently received much attention. Several next-generation robotic semi-automated approaches, for example, have been proposed to help alleviate the operator's workload by automating the repetitive work tasks that would normally be the operator's responsibility [1,2]. On one hand, these semi-automated approaches discuss closed-loop control, and on the other hand, they involve redundancy resolution because hydraulic loaders are typically kinematically redundant. Although both problems are important, it is safe to estimate that redundancy resolution of hydraulic manipulators has received less and too little interest in academia in relation to the importance of redundancy resolution compared to closed-loop control problems. This is probably because so many different types of redundancy resolutions [3][4][5][6][7][8][9] have been proposed for general systems that the general understanding is that these redundancy resolutions can effectively reduce the energy consumption of hydraulic manipulators, for example, through the minimum velocity norm or weighted pseudo-inverse solutions [10]. One of the aims in this paper is to show that these general redundancy resolutions can be sub-optimal at the valve-controlled hydraulic system level.
Moreover, because there are many different redundancy resolution strategies for different objectives, choosing the most compelling objective for a hydraulic manipulator is not always straightforward. Looking at the handful of redundancy resolutions dealing with specific problems and objectives pertaining to hydraulic manipulators, however, it becomes evident that global energy-optimal redundancy resolutions are lacking. To explain the importance of global energy-optimal redundancy resolution, system energy inefficiency is a major problem in hydraulic manipulators [11]. Therefore, to address this problem, we resolve the redundancy in a highly desirable hydraulic energy-optimal manner and effectively treat the inherently limited joint motions of hydraulic manipulators by enforcing important actuator position, velocity and acceleration limits in our solution.
[1] addressed the joint-limited minimum-time redundancy resolution of hydraulic manipulators, and Löfgren [13] has also studied redundancy resolution which maximises load capacity. Furthermore, Beiner and Mattila [10] have derived a pseudo-inverse method for redundancy resolution in the hydraulic manipulator's actuator space to minimise the cylinder velocity norm or the weighted kinetic energy instantaneously. In addition, Flacco et al. [9] have proposed a joint-limited pseudo-inverse-based algorithm, which is also suitable for hydraulic applications, that saturates joint velocities in the null space. These different solutions, however, do not discuss hydraulic energy-optimality. In addition, generally minimising the energy consumption of actuators, as proposed by Vukobratovic and Kircanski [14] as a local solution and developed by Hirakawa and Kawamura [15] as an optimal control problem, can be a sub-optimal strategy for hydraulic manipulators. This is a direct consequence of the fact that the actuators' energy consumption does not equate to the energy consumption of the typical valve-controlled load-sensing (LS) and constant-pressure (CP) hydraulic systems because the pressure losses encountered in these systems are not considered. It is important to derive energy-optimal redundancy resolutions for these commonly used systems. Whereas LS systems are predominantly used in hydraulic commercial manipulators in general, CP systems are used mostly in robotic closed-loop controlled applications and next-generation energy-efficient secondary-controlled applications because of the systems' superior damping and simplicity compared with the LS systems [16][17][18].

Paper Contribution and Organization
In this paper, we minimise the energy consumption of the widely used LS and CP hydraulic systems through redundancy resolution to address the major problem of energy-inefficiency in hydraulic manipulators. This solution is in stark contrast to known conventional methods that are not energy-optimal at the valve-controlled actuator and hydraulic power system interaction level. To summarise, our redundancy resolution entails moving the manipulator hydraulic cylinders in an energy-optimal manner while the manipulator's end-effector follows a prescribed path, and actuator limits at the position, velocity and acceleration levels are satisfied. To address both of these hydraulic systems optimally, we propose a tailored cost function of the energy consumption for each. For example, the simpler CP system is shown to require minimisation of the pump flow rate. This objective leads to our effective solution in which the cylinder's effective areas scale the cylinder velocities in a discontinuous manner. Minimising the CP system energy cost, hence, intuitively amounts to minimising the cylinder volumes displaced in the solution. The cylinder areas among the manipulator's hydraulic cylinders, including the different piston and rod-side areas of the asymmetric cylinders, render minimisation of the CP system's energy consumption, in particular, a highly tractable objective.
With the objectives in place, the redundancy could obviously be resolved by formulating the optimal control problem so that the motions of all the joints are optimised subject to specific motion constraints. However, that approach would result in a high-dimensional problem, which would be unsuitable for a global dynamic programming (DP) solution and generally inconvenient. To reduce the problem dimensionality and computational complexity, in this study, only the motion of the redundant extension cylinder is directly optimised. The optimal non-redundant joint motions are, instead, resolved by employing non-singular inverse kinematics, motivated by the formulation used by Choi [19] and Flacco et al. [20]. Moreover, in the present study, hydraulic system properties are incorporated in the cost functions proposed in steady-state equations. This approach results in our desirable minimum-state problem, which requires only two states and one control and which uses the computational resources available much more sparingly than the approach of simultaneously optimising all of the joint motions. However, because of the modelling simplifications in our problem formulation, a natural concern that could arise is whether significant hydraulic aspects of the problem are neglected. Thus, extensive experiments, which compare the energy consumptions of the redundancy resolutions proposed in this study against other global and instantaneous strategies in the LS and CP systems is presented.
This energy-optimal solution is primarily suitable as an offline approach, much like the minimum-time solutions that were proposed by Ortiz Morales et al.
[1] and Mettin et al. [12], and it is practical as such. Extensive measurements by Ortiz Morales et al.
[1], Mettin et al. [12] and Westerberg [2] have shown that the typical workspace activity for 4-DOF manipulator is concentrated on specific areas, which consequently means that there are in practice a limited number of significant point-to-point movements to optimise with respect to energy consumption. However, at the implementation stage, it might be feasible to pre-compute the energy-optimal trajectories over a few time horizons for all of these significant point-to-point movements so that it would be possible to choose between slower and faster energy-optimal trajectories in real-time. Furthermore, with our proposed methodology, one significant implication is that only the redundant joint's trajectories are necessary for real-time applications. If having more storage space were considered more important than having more computational power reserve, then the non-redundant motion trajectories could be resolved online from the remaining non-singular inverse kinematics.
This paper is an extension of our previous work [21]. As an extension of previous work, redundancy resolution is expanded from vertical plane three-degrees-of-freedom (3-DOF) serial-link hydraulic manipulators to complex 4-DOF serial-link hydraulic manipulators, which include boom base motion. The system model proposed for the energy-optimal solution is also systematically presented in this study. A third contribution of this paper compared to our previous simulation study concerning 3-DOF serial-link hydraulic manipulators is the extensive field experimental evaluation of the redundancy resolution proposed for 4-DOF serial-link hydraulic manipulators and its comparison to existing conventional methods. In this experimental evaluation, the performance of the proposed DP solution is compared to a "bootstrapped" DIDO solution [22] by employing the proposed problem formulation. The performance of the globally hydraulic energy-optimised redundancy resolution has not been previously experimentally evaluated.
This paper is organized as follows. First, the test system, which is a commercial forestry hydraulic manipulator, is described in Section 2. Second, a simplified mathematical model of this complex manipulator is presented in Section 3. In Section 4, the hydraulic manipulator's optimal control problem is reduced to the bare essentials with the minimum-state formulation. The problem's desirable global dynamic programming solution is discussed in Section 5. Finally, we experimentally evaluate the proposed redundancy resolution by comparing its performance to that of conventional methods in Section 6. The experimental results are from the real test-bed introduced in Section 2. Conclusions are provided in Section 7.

Test-Bed
Our test-bed is the K70M hydraulic manipulator on the Ponsse Caribou S10 8-wheel forest forwarder (Figure 1). In the following, we describe this manipulator in more detail.  Figure 1. Kinematically redundant K70M hydraulic manipulator on Ponsse Caribou S10 forwarder, with log grapple end-effector.

System Description
The K70M hydraulic manipulator is a standard log-loader that has a grapple end-effector attached to the crane tip. The manipulator has four principal joints, which consist of the base, lift, tilt and extension joints shown in Figure 1. These joints are actuated by using proportional valve-controlled hydraulic cylinders (see Table 1). The manipulator also has two telescoping links in series to extend its reachability. Measuring from the base to the tip, the manipulator can extend to approximately 9.1 m, and at this distance, its load-carrying capacity is 650 kg. A two-stage, pressure-compensated Parker K170LS mobile hydraulic valve is used to control the manipulator's cylinders; see Figure 2, where the valve's spool types are illustrated. The mobile hydraulic valve also includes very complex in-built hydro-mechanical functionality, such as a standard counter pressure valve, which raises the tank pressure, and anti-cavitation valves in each actuator port (not shown in Figure 2). In the over-running load case, in particular, these anti-cavitation valves allow any fluid flow rate from the tank line to the non-loaded cylinder chamber to exist before the chamber pressure drops to a level below a preset minimum hydraulic cylinder pressure. This hydro-mechanical functionality can be significant since these anti-cavitation valves may reduce pump flow rate requirement.
The manipulator, as an industrial standard, is powered by a LS hydraulic pump; see [23][24][25]. Therefore, an electro-hydraulic CP system was built in parallel to allow comparison to the LS system for the experiments. Hence, the same hydraulic pump and pump LS regulator valve can be used to control the pump displacement. The hydraulic pump is an A11VLO130DRS variable axial piston pump from Bosch Rexroth with a maximum flow rate of 325 dm 3 /min at 2500 rotations per minute (including the charge pump flow) and 21.5 MPa maximum supply pressure. The LS system's conventional low-level operating principle, which is reported in [23], is illustrated in Figure 3a. In this system, the maximum driven chamber pressure among the base, lift, tilt and extension cylinders is fed back to the variable displacement pump's hydro-mechanical controller, which sets the pump supply pressure a LS pressure margin ∆p LS above this feedback value. With the CP electro-hydraulic control method of the hydro-mechanical feedback system shown in Figure 3b, on the other hand, the pressure reference for the variable displacement pump's hydro-mechanical controller is generated directly from the supply pressure based on the electrical input of the proportional pressure relief valve between the minor (0.7 mm) orifice and the tank-connected pressure valve. This control method is called "remote control" in the Bosch Rexroth catalog [26]. We have simplified the symbol of the metre-in side load control valve and omitted the metre-out side for clarity.

Instrumentation and Data Acquisition
The hydraulic manipulator was equipped with multiple sensors for the experiments: (1) the base angle was measured using an RCC absolute angle resolver from LTN with a resolution of 0.01 • ; (2) the lift and tilt angles were measured using incremental angle encoders ROD 456-5000 from Heidenhain with resolutions of 0.0072 • and 0.0029 • , after 10-fold and 25-fold interpolation; (3) the extension cylinder position was measured with a DG 60 L incremental position encoder from Stegmann with a resolution of 160 µm; (4) the pump supply pressure and, for identification purposes, cylinder pressures were measured using an NAH250 analogue pressure transducer from Trafag with an accuracy of ±0.1% from full-scale 25 MPa and (5) the pump flow rate was measured using a gear type flow meter VC 5 F2 PS from Kracht with a resolution of 0.005 dm 3 and a range of −250 to 250 dm 3 per minute.
The joint encoder installations are shown in Figure 4. These sensor measurements were recorded at a 2 ms sampling rate, and the hydraulic valves were controlled via CAN using a dSPACE MicroAutoBox II processing unit for the experimental evaluation.

Model of the Kinematically Redundant Four-Degrees-of-Freedom Hydraulic Manipulator
Next, the test-bed is described in more detail. For redundancy resolution of this test-bed manipulator, the mathematical model of the manipulator is systematically presented in the following, with particular attention paid to the applicability of the model for optimising energy consumption.

Forward Kinematics in the Joint Space
The hydraulic manipulator is shown in Figure 5. The joint-position vector of this manipulator can be defined as follows: where q 1 denotes the base angle, q 2 denotes the lift angle, q 3 denotes the tilt angle and q 4 is the total extension length (a prismatic joint). These are the principal hydraulically actuated joints. All q i are taken positive counter-clockwise. The manipulator's end-effector position can be expressed from the base frame 0 to frame 4 in accordance with the classical Denavit-Hartenberg (DH) convention [27]. By using the DH transformation matrix A i−1 i , which determines the coordinate transformation between successive frames, we get: as the overall coordinate transformation expressed in the base frame. The transformation matrix A i−1 i ∈ R 4x4 used consecutively is defined as: where, for example, c α i denotes cos(α i ) and s α i denotes sin(α i ). The DH parameters given in Table 2 determine these matrix elements. By transforming from the base frame to the x w , y w and z w coordinates, which denote the x-, yand z-positions of the end-effector expressed in the global frame, respectively, we get: x w = cos(q 1 ) L 1 cos(q 2 ) − L 2 sin(q 2 + q 3 ) + (L 3 + q 4 ) cos(q 2 + q 3 ) + o x (4) y w = L 1 sin(q 2 ) + L 2 cos(q 2 + q 3 ) + (L 3 + q 4 ) sin(q 2 + q 3 ) + o y and (5) as the final end-effector position, which we denote with x t = [x w y w z w ] T . Constants L 1 and L 3 denote the manipulator link lengths, L 2 is an offset between the tilt joint and the extension link and o x and o y are the offsets in the direction of the xand y-axes, respectively, from the global frame to the lift joint.
The workspace of the test-bed manipulator in the vertical plane is depicted in Figure 6 by using the parameters given in Table 2. Table 2. Denavit-Hartenberg parameters of the 4-DOF hydraulic manipulator.  Differentiating x t in view of Equations (4)-(6) with respect to time yields the end-effector velocity: whereẋ t = [ẋ wẏwżw ] T , the joint velocity vectorq = [q 1q2q3q4 ] T and the Jacobian matrix J(q) is the partial derivative of x t with respect to q. This equation was also expressed by using the column vectors J i , for i ∈ {1, 2, 3, 4}, for future reference. Differentiatingẋ t once more yields: with the end-effector accelerationẍ t and the joint acceleration vectorq defined similarly to Equation (7). The elements of the Jacobian time derivativeJ can be resolved from: over the workspace dimensions j ∈ {1, 2, 3} and the joint dimensions i ∈ {1, 2, 3, 4}. Because the Jacobian matrix J(q) ∈ R 3×4 is non-square, the inverse kinematics clearly have an infinite number of solutions inside the workspace. Thus, a redundancy resolution is required.

Joint Space to Actuator Space Transformations
Transformations, which yield the cylinder coordinates as a function of the joints, are presented next. By using the chain rule, we obtain: as the general equations, where c i (q i ), for the actuator index i ∈ {1, 2, 3, 4}, is the cylinder length, v i is the cylinder (piston) velocity, a i is the cylinder (piston) acceleration, not to be confused with the DH parameter, and r i is the cylinder torque arm. The joint space to actuator space transformations of the test-bed are presented in the following. Firstly, the base cylinder has a constant torque arm r 1 because a rack-and-pinion mechanism, as illustrated in Figure 7, is used Equation (11) . Furthermore, the torque arm r 2 of the lift cylinder can be written as: as a function of the lift angle q 2 and the lift cylinder length c 2 . The constants L 11 , L 12 , β 11 and β 12 and the joint angle q 2 are illustrated in Figure 8a.  Figure 7. Rack-and-pinion mechanism at the test-bed manipulator's base controlled using pressure- The four-bar linkage of the tilt cylinder is governed by more complex kinematic equations. These equations, from the tilt angle q 3 to tilt cylinder length c 3 , can be written as follows: where α 21 , α 22 , β 21 , L 21 , L 22 , L 23 , L 24 and L 25 are the constants and β 22 , β 23 , β 24 and L 26 are the variables (see Figure 8b, where q 3 is negative). Laws of cosines and sines were used. A quintic function f q (s, q 3 ), with s ∈ R 6 as the coefficient vector, can be fitted to the c 3 data to simplify the equation of the tilt torque arm r 3 . Hence, differentiating c 3 with respect to time in view of Equation (11) yields: as the tilt cylinder's piston velocity. Multiplication by minus one considers the opposite signs of the piston and angular velocities. The "torque arm" r 4 of the telescoping extension mechanism is 1/2 because the extension cylinder velocity is half of the joint velocity due to the telescope's mechanical multiplier.

Cylinder Forces
Manipulator dynamics are considered through the hydraulic cylinder forces, which can be resolved from the inverse rigid-body dynamics as follows: (16) where the cylinder force vector F equals [F 1 F 2 F 3 F 4 ] T , τ τ τ is the corresponding cylinder torque vector, M(q) ∈ R 4x4 denotes the positive definite, symmetric inertia matrix at joint position q, G(q) ∈ R 4 denotes the gravitational torque vector and F f (q,q) ∈ R 4 includes the hydraulic cylinder and joint friction forces. The inertia matrix and the gravitational load vector can be resolved via well-known Lagrangian conventions by summing the dynamical contributions of each link in the global frame [27]. Resolving these components regarding our test-bed is mostly standard practice, with the exception that the extension cylinder's gravitational component must be doubled to consider the mechanical disadvantage of the telescope mechanism (The mechanism doubles the extension cylinder stroke). Because the centrifugal and Coriolis forces are in low magnitude, their effects can be omitted. Conventional exponential friction force models can be primarily exploited (see [28]), but the extension joint's friction force is shown to be accurately represented by using the developed unconventional model (see Appendix B for the test-bed's cylinder force modelling results).
The inverse torque arm matrix is defined as in: Consequently, these positive matrix elements, denoted by r −1 i , are the inverses of the hydraulic cylinder torque arms. However, r −1 4 is a non-physical multiplier because the fourth joint is prismatic.

Steady-State Cylinder Pressures Using a Mobile Hydraulic Valve
Finally, moving on to the hydraulic system equations, we introduce simplifications to keep the system dimensionality at a manageable level for optimisation purposes. To introduce our subsequent simplifications, firstly, consider the pressure dynamics of the hydraulic cylinders denoted by [29]: where B eff is the effective bulk modulus, V 0A and V 0B are the dead volumes, x p is the piston position, v is the piston velocity, A A is the piston-side area, A B is the rod-side area and Q A and Q B are the flow rates to the cylinder chambers. Actuator indices were omitted for brevity. Solving the steady-state cylinder velocity from Equations (18) and (19) yields: Now, we omit these hydraulic system dynamics and focus on deriving the hydraulic system's steady-state pressure equations by utilising Equation (20). Because the flow rates to the hydraulic cylinders are controlled by using the mobile hydraulic valve's two vastly different spools, as shown in Figure 2, we derive the steady-state cylinder pressures in both cases.

Typical Pressure-Compensated Non-Differential Spool Valve
Firstly, for the asymmetric spool valve shown in Figure 2a, which is another typical pressure-compensated, hydro-mechanical valve, the turbulent flow equations are given by [29]: where I is the valve's control current, ∆p c is the constant pressure drop across the main spool due to the pressure compensation, p T is the tank pressure and K vPA , K vAT , K vBT and K vPB are the flow coefficients of the P-A, A-T, B-T and P-B control edges, respectively. The flow coefficients K vPA (I) and Utilising Equations (20)- (22) and the external force (which equals the cylinder force F = p ssA A A − p ssB A B ) to resolve the steady-state pressures yields [30]: Interestingly, the cylinder back-pressures can be approximated by multiplying the pressure compensator's constant pressure drop with a momentarily constant coefficient (labelled). These equations apply regardless of the load force direction. If the cylinder back-pressure is non-existent, as in single-acting lift cylinders, then these steady-state pressure approximations can be easily simplified.

Typical Pressure-Compensated Differential Spool Valve
The second spool type is the pressure-compensated differential spool valve (Figure 2b). Because of the spool's differential position, the fluid flows are regenerative from the cylinder chamber B to cylinder chamber A via the valve's P port in the cylinder extension case. This differential position reduces Q p , the required pump flow rate, to Q A − |Q B |. Hence, the actuator flow rates can be written as: where I > 0 and K vPA and K vBP are defined as positive functions of current, ∆p c is a constant-pressure drop over the control edge P-A due to the pressure compensation and the sum of p A and ∆p c equals the pressure in the valve's P port, omitting some pressure losses (Q B denotes the flow rate over the control edge B-P). Using Equations (20), (25) and (26), the steady-state cylinder chamber pressures can be resolved, yielding: Here, the flow coefficients and the external force are again momentarily constant. Pressure losses in pipes, hoses and filters were omitted. In contrast to the non-differential case, the cylinder back-pressure p ssB depends on the cylinder force. None of these derived steady-state pressures, however, depend explicitly on the supply pressure because of the pressure compensation.

Problem Formulation
Let us formulate our inherently continuous-time optimal control problem in discrete-time for numerical solution. By dividing the fixed optimisation time t f , which corresponds to the desired duration of the end-effector path, into N intervals of length t f /N, our optimal control problem can be expressed in discrete-time as follows: subject to:x where π u denotes the control policy and π U denotes the admissible control policies. The hydraulic power P h,k , defined at each time stage k ∈ {0, 1, 2, . . . , N − 1}, is the principal cost to be minimised, and the term k , which can be replaced by standard inequality constraints, penalises violations of actuator limits. For the performance cost P h,k , effective functions which minimise hydraulic energy consumption are proposed because the conventional cost functions may be sub-optimal.
In the above, the system dynamics have been discretised using the Euler method and T s as the integration step corresponding to the interval length t f /N. The state vectorx k = [c 4,kv4,k ] T , with initial statex 0 , contains the extension cylinder position and velocity. The extension cylinder accelerationā 4,k is used as the controlū k . To optimise movements of the extension cylinder at the acceleration level, we create a double integrator system F k (x k ,ū k ), denoted with: where the maximum extension cylinder position, velocity and acceleration, c 4,max , v 4,max and a 4,max , respectively, have been applied to normalise the physical units for the cylinder's position, velocity and acceleration. These normalised units can be transformed into conventional physical units by employing scaling equations x k = diag(c 4,max , v 4,max )x k and u k = a 4,maxūk . These extension cylinder coordinates can also be converted into joint coordinates by multiplying the cylinder motion by 1/r 4 , in view of Equations (10)- (12). This final transformation is required for the next stage.

Using Inverse Kinematics to Resolve the Motion of Non-Redundant Joints
Because our convenient method directly provides only the extension cylinder and joint motions for the cost functions, the method we propose includes the application of inverse kinematics to resolve the motions of the non-redundant joints. These motions are included in the vector: For example, the positions of the base, lift and tilt joints (the non-redundant joints) are denoted with q (r) k = [q 1,k q 2,k q 3,k ] T at time stage k. Because the extension joint's motion is known, these non-redundant joint positions can be resolved directly by inverting Equations (4)-(6), which yields [27]: Here, z wd,k and x wd,k denote the components of the end-effector's desired position x td at time stage k in the direction of the zand x-axes, respectively, in the global frame. The lengthy inverse kinematic functions h 2 and h 3 are omitted for brevity.
At the velocity level, the approach requires that we subtract the contribution of the extension joint from the desired end-effector velocityẋ td,k . Then, the joint velocities inq (r) k can be obtained by inverting Equation (7) as in: because the partial Jacobian inverse matrix J 1 (q k ) J 2 (q k ) J 3 (q k ) −1 is non-singular. This matrix can be symbolically computed in advance to possibly decrease the computational complexity. Similarly, accelerations of the non-redundant joint can be resolved by inverting Equation (8): where the right-hand term in the parentheses contains the Cartesian acceleration required from the non-redundant joints to maintain the desired end-effector accelerationẍ td,k . The Jacobian time derivativeJ(q,q) can be symbolically computed in advance using Equation (9). We are now in a position to apply the cylinder coordinate transformations presented to obtain the necessary motions of the cylinders of the non-redundant joints for the proposed cost functions. The proposed method optimises the dynamical motions of all the cylinders. However, our method reduces computational complexity by only computing the necessary extension cylinder motion to optimise the dynamical motions of all the cylinders. This is possible because the motion of the extension cylinder in the 4-DOF manipulator determines the motion of the base, lift and tilt cylinders along a certain end-effector path. We could have also chosen to directly optimise the motion of the lift or tilt cylinder and use the motion of that cylinder to compute the required optimal dynamical motions of the base, lift/tilt and extension joints for the cost functions.

Proposed Cost Function: Power Consumption of Load-Sensing System
We first propose the power consumption the LS system as the principal cost in view of Equation (29) to be minimised. The cost function of the LS system, at time stage k, can be written as: where p s,k denotes the pump supply pressure, Q p,k is the pump flow rate and η k is the total efficiency of the hydraulic pump and the driving motor, which depends on the operating point, i.e., the displacement, supply pressure and rotational speed of the pump. Thus, the energy consumption of the LS system can be optimised by minimising the hydraulic output power or by increasing the driving system's efficiency. Since pump and motor efficiency data is not usually available, without loss of generality, we assume the total efficiency is constant. The pump flow rate, which is a positive function without energy recuperation, can be approximated at time stage k by summing the cylinder flow rates as in: where v i,k is the velocity of cylinder i and H(v i,k ) denotes the piecewise Heaviside step function. The piston-side area is denoted with A Ai and the rod-side area with A Bi . For simplicity, the hydraulic fluid is assumed to be incompressible. The rod-side area is negatively signed to enforce a positive pump flow rate when the cylinder is retracting and has negative velocity. The Heaviside step function can be defined using: which introduces a discontinuity in the objective function. Because having a differentiable objective function is desirable, the discontinuous Heaviside step function can be approximated by a differentiable expression, after some mathematical manipulations: where s is a real positive number, such as 20,000. The pump supply pressure, according to the LS system's operating principle, can be calculated at steady-state at time stage k by using the maximum driven actuator pressure: p s,k = max p 1,k , p 2,k , p 3,k , p 4,k + ∆p LS (40) where p 1,k , p 2,k , p 3,k and p 4,k denote the chamber pressures of the base, lift, tilt and extension cylinders, respectively. The LS pressure margin ∆p LS is roughly 3 MPa in the test-bed. The chamber pressure p i,k of cylinder i is taken from the rod-or piston-side depending on the cylinder's direction of motion. The pressure is zero if the actuator is not driven. Hence, the chamber pressure p i,k at time stage k can be estimated by using: where the use of the minor positive constant ε in the Heaviside step functions assures zero chamber pressure when the cylinder is not driven and its velocity v i ∈ [−ε, ε]. Time indices were omitted for clarity. In addition, multiplying by the Heaviside value of the actuator power ensures a non-negative actuator pressure when the cylinder load is over-running. In this over-running load case, the cylinder velocity v i and the cylinder pressure force F i have opposite signs. The steady-state pressure equations are chosen according to the spool type used either from Equations (23)- (24) or Equations (27)- (28). A discontinuous maximum function has been used in Equation (40). This function can be approximated by applying the equation: max(p 1 , p 2 ) = 0.5 p 1 + p 2 + |p 1 − p 2 | thrice; i.e., max{p 1,k , p 2,k , p 3,k , p 4,k } can be computed as max(max(max(p 1,k , p 2,k ), p 3,k ), p 4,k ). The absolute function, in turn, can be approximated as the square root of (p 1 − p 2 ) 2 + . This should be a minor positive constant, such as 10 −6 , to improve the accuracy of the approximation. As a result of these approximations, the LS cost is desirably continuously differentiable, which allows us to more easily employ a standard optimal control solver for performance comparison. The pump flow rate and supply pressure modelling results achieved with the test-bed can be found from Appendix C.

Proposed Cost Function: Power Consumption of Constant-Pressure System
In our second application, we minimise the energy consumption of the CP system. The cost function of the CP system can be written as: where p s denotes the constant supply pressure and the pump flow rate Q p,k is given by Equation (37). Because of the constant pressure, the energy consumption of the CP system can generally be optimised load-independently without knowledge of manipulator dynamics through minimisation of the pump flow rate. By minimising the pump flow rate, the total volumes displaced by the hydraulic cylinders in the solution end up being minimised. Because the piston and piston-rod-side areas obviously affect the cylinder volumes displaced, minimising the energy consumption of the CP system does not equal to the actuator velocity norm minimisation, e.g., in [10]. The variation of cylinder areas among the manipulator's hydraulic cylinders, including the different piston and rod-side areas of these conventionally asymmetric cylinders, render the pump flow rate minimisation a highly tractable objective.

Actuator Limits
Because of the inherent physical limitations of the manipulator's cylinders, the cylinders' motions are limited. For this reason, we have introduced a mechanism through the optimal control problem's term k (q k ,q k ,q k ) to impose actuator constraints at the position, velocity and acceleration levels by issuing a significant penalty compared to the magnitude of the principal cost if the limits are violated.
Since the position limits depend on the cylinder stroke, they can be expressed effectively either in the joint or actuator space. In contrast, however, the velocity limits should be expressed in the actuator space because these limits cannot be expressed optimally from the perspective of the hydraulic system in the joint space. Based on the influential dimensions of the hydraulic pump and cylinders and the cylinders' non-constant torque arms these velocity limits are constant only in the actuator space to ensure that the total fluid flow rates for the actuator do not exceed the pump's maximum flow output. Assuming fluid incompressibility in these computations is the most convenient approach. Notice that by assuming constant velocity limits, the joint velocity limits vary if the torque arm is non-constant see Equation (11) . Only if a particular cylinder's torque arm is constant can the corresponding velocity limit be expressed optimally in the joint space. Hence, in the test-bed case, only the velocity limits for base and extension cylinders can be expressed in either space.
Lastly, we choose constant acceleration limits for the cylinders for simplicity. Consequently, the joint acceleration limits vary see Equation (12) . Selecting the proper acceleration limit magnitudes are important from at least two perspectives: firstly, to limit the occurrence of higher accelerations that might lower the manipulator wear life and secondly, to assure higher controller tracking performance. The actuator limits used in the experiments can be found in Table 3.

Dynamic Programming Solution
The complex optimal control problem of the hydraulic manipulator is solved to global optimality using the discrete-time DP algorithm (see Algorithm 1 [31][32][33]). The main advantage of the algorithm is that it can produce this solution considerably more effectively than a brute-force method, whose computational cost grows exponentially with the time stages N. However, the main disadvantage of the algorithm is that its computational cost grows exponentially with the states and controls due to the curse of dimensionality. Hence, our low-dimensional optimal control problem that we have reduced to the bare essentials makes this global DP algorithm applicable. Recall that we have reduced our optimal control problem size to only two states and one control.
The effectiveness of the DP algorithm over the brute-force method results from the principle of optimality, which states that "an optimal policy has the property that whatever the initial state and initial decision (control) are, the remaining decisions must constitute an optimal policy with regard to the state resulting from the first decision" [31]. The Bellman equation, which characterises this principle of optimality, can be written at time stage k, in view of our objective Equation (29), as: where the sum P h,k + k represents the running cost and the vectorF k represents the system dynamics see Equations (30)- (31) . The minimum cost-to-go J k is the minimum sum of the running costs from stage k ∈ {0, 1, . . . , N − 1} to the final stage at k = N − 1. This optimal cost-to-go J k x k is defined for each state vector combination such thatx k ∈ X X X = {X 1 × X 2 } and minimised over all possible controls at stage k such thatū k ∈ U. Here, (2) , . . . , u (N u ) } denote the discrete-state and control sets, respectively. The variables N x i and N u , in turn, determine the density of the state and control grids, respectively. Sufficiently dense grids are defined to reach the global optimum. These grid sizes, and suitable time-discretisation, can be found through trial and error, taking note that the computational and memory requirements of the algorithm scale linearly with the density of the grids.
The algorithm's implementation shown in Algorithm 1 entails two consecutive phases: a backwards phase followed by a forward simulation. During the computationally heavier backwards phase, the optimal controls are resolved at each position in the state grid while the algorithm iterates backwards in time. In greater detail, at any given time stage k, the system is simulated (line 5), subsequent computations are performed to evaluate the cost function (lines 6-8), the minimum cost-to-go J k (x k+1 ) computed at the previous iteration is interpolated because the system dynamics have likely transformed into a state unspecified in the grid (line 9) and the cost-to-go J k x k ,ū k is evaluated for all the states and controls by utilising the minimum cost-to-go J k+1 (x k+1 ) (line 10). From the cost-to-go evaluated at each control, the minimum cost-to-go J k x k is then stored for the next iteration (line 12) together with the optimal control u k x k , which minimised the cost-to-go (line 13). The backwards phase iterates in this manner until it reaches the initial time stage. At this point, with our system of two states and one control, the algorithm has produced a two-dimensional state grid at each time stage, and the optimal controls have been stored at each position in the state grid. The algorithm then simulates in the forward direction from the initial time stage and state by following the grid of the optimal controls produced in the backwards phase. Interpolation of the optimal control is used during the forward simulation because is it is unlikely that the optimal controls were evaluated at the optimal states. When the simulation has been completed, the algorithm has produced the optimal control sequence and state trajectories as outputs. In addition to producing the global solution, this algorithm has the significant advantage that different initial configurations of the manipulator can be considered with just a forward simulation. This advantage is in contrast to most other optimisation algorithms where new optimisations from scratch are required.
A demonstratively simple example of the DP algorithm has been presented, e.g., by Nurmi and Mattila [21]. The utilised general Matlab-coded DP algorithm can be found from Sundstrom and Guzzella [32]. Different DP algorithm varieties have been compared by van Berkel et al. [34] and Böhme and Frank [33], and a convergence proof of discrete-time DP has been presented by Shin and McKay [35].

Experimental Results
Before diving head-first into the experimental results from the real hydraulic manipulator introduced in Section 2, we describe the testing methodology. Firstly, the optimal control solutions compared consist of: (1) the proposed LS cost (36), which is minimised by using the DP algorithm and named DP (LS) according to the naming convention "method (minimised cost)"; (2) the proposed LS cost, which is minimised by using the DIDO algorithm [22] and named DIDO (LS); (3) the proposed CP cost (43), which is minimised according to DP (CP); (4) the proposed CP cost, which is minimised according to DIDO (CP); (5) a positive actuator energy cost, which is solved according to DP (A. En.) and which minimises P h,k = ∑ 4 i=1 F i,k v i,k for positive work, F i,k v i,k > 0, and (6) an extension cylinder use cost, which is solved according to DP (ext.) and which minimises P h,k = v 2 4,k .
Secondly, the instantaneously optimal solutions included in the comparison are (7) the joint-limited pseudo-inverse solution by Flacco et al. [20] named P-inv. (j.), which minimiseṡ q Tq , and (8) an actuator-limited pseudo-inverse solution named P-inv. (a.), which was derived by combining the solutions of Beiner and Mattila [10] and Flacco et al. [20] to minimise v T v.
The DP solution (A. En.) is formulated with positive actuator work only to obtain the best attainable performance in the test-bed, which did not have the possibility of recovering energy. The solution for minimising use of the extension cylinder is included in the comparison to evaluate whether the solution lowers energy consumption, presumably, by reducing the lift and tilt cylinder forces required.
The DP algorithm was parametrised by dividing the state and control grid into 356 × 101 × 151 (N x 1 × N x 2 × N u ) discrete values. With this grid size and by using a time discretisation of 0.05 s, we could nearly max out the 8 GB of RAM available. In the evaluation, the performance of the DP algorithm is compared to a "bootstrapped" DIDO solver by employing the proposed problem formulation. This DIDO algorithm is a commercial, pseudospectral and Matlab-based optimal control solver that has been extensively used in the solution for aerospace optimal control problems.
The energy consumption of the LS and CP systems was computed as the performance indices to be compared by measuring the pump supply pressure and the flow rate along three kinds of end-effector paths. The end-effector was controlled without payload along these paths. Firstly, we present the energy consumption in the horizontal and vertical point-to-point paths where the end-effector moves from point A to point B without a payload in a straight line (see Figure 9a). Jazar's quintic rest-to-rest polynomial algorithm [36] was used to generate the Cartesian motion profile between these points. The horizontal path was driven in 10 s, requiring a maximum end-effector velocity of 0.60 m/s along the x w -axis. The vertical path was driven in 6 s, and it required a higher maximum end-effector velocity of 0.95 m/s along the y w -axis. Secondly, we consider half of the log-loading cycle where the end-effector starts from the load space (or trailer) of the forwarder at point A and moves the empty log grapple back to the logs on the ground at point B (see Figure 9b). A cubic spline was used to generate the desired end-effector path via points in this case see e.g., Biagiotti and Melchiorri [37] . This path was driven in 15 s, and the maximum end-effector velocity was 0.75 m/s in the x w y w z w -space. The paths were driven three times using each redundancy resolution from (1) through (8), and the results were averaged. Two initial configurations of the manipulator at the beginning of each path were also considered: firstly, based on the smallest feasible extension cylinder length and subsequently based on the middle point between the smallest and largest feasible extension cylinder lengths. The supply pressure of the CP system was set to 20 MPa in the experiments, and the motion controller used is discussed in Appendix A.

Horizontal Path
The experimentally obtained energy consumption of the LS system of each redundancy resolution has been sorted by magnitude in Figure 10a. These results demonstrate that the pseudo-inverses clearly have a sub-optimal performance by yielding 25% greater energy consumption than the best proposed hydraulic-energy optimal solution. The DIDO and DP solutions produce comparable results. In this path, minimising the energy consumption of the actuators is also similar to minimising the energy consumption of the LS system. Another important observation is the adequate performance of the CP solution, considering that it is based on a simple model. In addition, because the extension joint use minimising cost yields a poor solution, minimising the use of the extension joint appears to be impractical for our goal of minimising the hydraulic energy consumption. (c) Figure 10. Horizontal path: (a) Experimental constant-pressure and load-sensing system energy consumptions (smallest feasible extension cylinder length at the initial configuration); (b) load-sensing system: energy-optimal DP (LS) joint trajectories ( ) and controller tracking performance ( ). Sub-optimal P-inv. (j.) joint trajectories ( ) and controller tracking performance ( ); and (c) Constant-pressure system: energy-optimal DIDO (CP) joint trajectories ( ) and controller tracking performance ( ). Sub-optimal P-inv. (a.) joint trajectories ( ) and controller tracking performance ( ).
As can be seen in Figure 10a, the CP system results are comparable to the LS results, but the main difference is the greater energy consumption. The pseudo-inverses, again, have an inferior performance from the perspective of the energy consumption of the CP system, and they require approximately 30% greater energy use than do the hydraulic energy-optimal methods in this case. Inferiority of the pseudo-inverses reinforces the notion that minimising the velocities of the actuators does not minimise the energy consumption of the CP system. In addition, the best solutions here consume the same amount of CP energy as do the pseudo-inverses in the LS case with the same path.
Two of the redundancy resolutions' joint trajectories and controller performances have been illustrated in Figure 10b,c. The DP joint references, as shown there, were always low-pass filtered (cutoff frequency 5 Hz) to smooth out the trajectories' slightly jagged edges. This filtering caused no apparent error in the desired end-effector path. The results with the second initial configuration can be found in Appendix D (see Figure A4).

Vertical Path
Continuing with the results of the vertical path, we firstly compare the sorted LS energy-consumption presented in Figure 11a. As previously, the energy-optimised solutions for the hydraulic manipulators are superior compared to the pseudo-inverses, which require almost twice the energy consumption. However, the DP energy-optimised solutions for hydraulic manipulators have not reached a global optimum because the DIDO method clearly fares better in this case. The DIDO solutions themselves are practically the same. This path also demonstrates that minimising the energy consumption of the actuators does not always minimise the energy consumption of the LS system. The proposed solutions minimising the CP cost, again, have an adequate performance.
The energy-consumptions rates of the CP system presented in Figure 11a are similar, but the energy-consumption rates are approximately double compared to the LS case. The pseudo-inverses, most evidently, have an inferior performance compared to the proposed solutions, which, in contrast, require the lowest energy consumption. A few optimal and sub-optimal joint trajectories and controller performances are illustrated in Figure 11b,c. Compared to the previous path, the controller tracking performances are slightly worse because the end-effector moves faster. The energy consumption with the second initial configuration is presented in Figure A5 in Appendix D. These energy consumption rates demonstrate that the initial manipulator configuration has a significant impact on the energy consumption. Figure A5 also shows that the algorithms, or DP (CP) specifically in this case, can sometimes yield an average result. We suspect that this result is related to a combination of the DP algorithm's grid size, closed-loop dynamics and modelling errors.

Half-Cycle
Finally, we have the "half-cycle" energy consumption. The energy-consumption rates of the LS system presented in Figure 12a demonstrate that the redundancy resolutions' perform fairly similarly in this case. The minimisation of the actuator energy is also optimal in this case. The joint-limited pseudo-inverse, surprisingly, produces an energy-consumption rate comparable to the consumption obtained using hydraulic energy-optimised redundancy resolutions. Because the simulations (not presented in this paper) predicted a greater difference between these solutions, the smaller difference originates from modelling errors and the behaviour of the closed-loop control. The energy-consumption rates for the CP system presented in Figure 12a differ from the LS results in that the pseudo-inverses are inferior.
Selected optimal and sub-optimal joint trajectories and controller performances from the half-cycle are illustrated in Figure 12b,c. Furthermore, the controller performances of each test case were evaluated according to the ISO 9283 standard, which contains a standardised general method for computing the maximum end-effector path tracking error (see Table 4). The controller performances are superior when the CP hydraulic system is used, particularly over the half-cycle path. This is not surprising because the LS system's actuator flow dynamics are slower due to the non-constant pressure level. The tracking errors, in general, are sufficiently insignificant and consistent for evaluating the proposed solution. Again, the result with the second initial configuration can be found in Appendix D ( Figure A6).  (c) Figure 12. Half-cycle: (a) Experimental constant-pressure and load-sensing system energy consumptions (smallest feasible extension cylinder length at the initial configuration); (b) load-sensing system: energy-optimal DP (LS) joint trajectories ( ) and controller tracking performance ( ). Sub-optimal P-inv. (a.) joint trajectories ( ) and controller tracking performance ( ); and (c) constant-pressure system: energy-optimal DP (CP) joint trajectories ( ) and controller tracking performance ( ). Sub-optimal P-inv. (j.) joint trajectories ( ) and controller tracking performance ( ).
As a conclusion of the evaluation, the pseudo-inverses, in particular, and actuator energy solutions, in some cases, were inferior compared to the proposed hydraulic energy-optimised redundancy resolutions. These inferior solutions should be used with caution when minimising hydraulic energy consumption. The DIDO solutions were, for the most part, comparable to the DP solutions. The CP optimal solutions, in turn, were often comparable to the LS optimal solutions. The vertical and horizontal paths demonstrated the greatest energy savings, but energy savings were also attainable in the half-cycle when energy-optimised redundancy resolution was used. A solution containing both halves of the log-loading cycle could be obtained from a combination of a minimum-time solution for the log-loading part and the energy-optimal solution proposed for this return part. The results were obtained with the assumption of constant pumping efficiency. In the conditions of the experiments, in which the pump flow rate was typically less than 25% of the maximum flow rate of the pump, it might have been advantageous to incorporate the variations in pumping efficiency in the optimisation to improve the results. However, the satisfactory results of our paper suggest that it might not be worthwhile to consider the efficiency map of the pump in the optimisation.

Conclusions and Future Work
This paper addressed the open problem of global energy-optimal redundancy resolution of 4-DOF hydraulic manipulators in robotic control applications, in which the highly repetitive manipulator movements are automated to improve work productivity and operator workload circumstances. To ensure the hydraulic energy-optimality of the redundancy resolution, the solution was formulated at the hydraulic system level by proposing effective cost functions for the commonly used LS and CP hydraulic systems. Furthermore, actuator constraints at the position, velocity and acceleration levels were imposed in the solution. To reduce the computational complexity and problem dimensionality, firstly, only the motion of the redundant extension cylinder was directly optimised. Secondly, hydraulic system properties were incorporated through steady-state equations in the proposed cost functions. The non-redundant actuator motions were resolved via non-singular inverse kinematics to obtain the full manipulator motion state for the cost functions. The global DP algorithm was applicable to our optimal control problem formulation due to the conveniently reduced problem dimensionality. A pseudocode implementation of the DP algorithm used in the optimal control problem solution was presented to discuss the properties of the algorithm and to showcase its relatively simple implementation. Field experiments that were performed on a 4-DOF forestry manipulator demonstrated the significant advantage of the new global optimal control problem solution. Around 15-30% greater hydraulic energy consumption was observed with the conventional solutions in the LS and CP systems. These experiments also showed that the CP system's cost function for basic energy consumption, most often, also led to minimised energy consumption by the LS system. Overall, these experimental results demonstrate energy-optimal redundancy resolution at the hydraulic system level in the prospective automated robotic applications. The existing practices in redundancy resolution of hydraulic manipulators are, therefore, significantly expanded. Experimental evaluation of the solution performance with an end-effector load was left for future work to limit the study's scope.
the mobile hydraulic valves are equipped with force-feedback spools. For this reason, a combination of the feed-forward and closed-loop control is practically necessary. Another useful control practice we used was limiting controller activation to avoid unnecessary energy consumption and the signalling of the pump pressure reference through the LS pilot line the of mobile hydraulic valve. We implemented this strategy so that if the absolute value of the cylinder velocity tracking error was less than a minor positive constant ε v , the mobile hydraulic valve would not be controlled (tracking mode). However, if the absolute value of the cylinder position error was greater than a minor positive constant ε p , the controller would activate (regulation mode). Thus, if a minor cylinder velocity were desired, for example due to a numerical imprecision of the optimisation, the cylinder would not be forced to move. This controller is simpler than the nonlinear model-based controllers, for example, by Bu and Yao [41] and Koivumäki and Mattila [42].

Appendix B. Cylinder Forces
The supply pressure computations are based on accurate cylinder force models. The cylinder forces, as given by Equation (16), were identified by using a least squares algorithm. However, because the base cylinder was not subjected to a gravitational force on the level ground of our test area, we approximated the base cylinder force as a constant and focused on the other force models. The modelling errors of the cylinder forces are acceptable, as can be verified from Figure A2a-c.
To achieve the modelling accuracy, we paid attention to the modelling of the friction force of the extension function, which had a high-magnitude compared to the gravitational component. Moreover, the friction force exhibited steps because of the long and slightly flexible telescoping link; see Nielsen [43]. Thus, an unconventional friction force model F f4 = tanh(Kq 4 )F c4total = tanh(Kq 4 ) F c4 + H f1 F c4 (q 4 − q f1 ) + H f2 F c4 (q f2 − q f1 ) + H f3 F c4 (q 4 − q f3 ) + H f4 F c4 (q f4 − q f3 ) (A3) was fitted to the data. Here, the tanh function, with a constant K of 2000, was used to assure smooth transient over the zero velocity, F c4 is the Coulomb friction force and F c4total is the total friction force (see Figure A2d). The Heaviside step functions were chosen to obtain the behaviour with the steps and plateaus occurring at the positions q f1 , q f2 , q f3 and q f4 .    After improving modelling accuracy by taking these measures, the modelled pump fluid flow rate matches the measured flow rate dynamics well (see the uppermost sub-plot of Figure A3). The minor modelling errors are caused by the assumption of the incompressible fluid and the steady-state errors produced by the empirical anti-cavitation model of the tilt cylinder when this model affects the predictions, for example, at 21 and 78 s. However, the modelling errors at these time instants would be significant without the use of the anti-cavitation model. (2) a zero tank pressure p T ; (3) constant flow coefficients and (4) pressure-compensated flow rate of the extension cylinder. Although the flow rate of the extension cylinder was not pressure-compensated by a dedicated valve like in the other cylinders, we could use the steady-state pressure model derived for the pressure-compensated differential case because the LS pump operated like a dedicated pressure compensator for the extension cylinder's high-pressure level.
As can be seen in the lowermost sub-plot of Figure A3, the modelled supply pressure tracks the measured pressure reasonably well (compared to the results presented in [44]). The observed modelling errors are caused mainly by the omitted pressure dynamics, but certain discrepancies originate from the residual oscillation of the input cylinder velocities around the zero velocity, which the model mistakes for a driven velocity, despite the value of ε = 0.005 m/s. Since modelling errors originating from this residual oscillation do not affect the optimisation, we used the smaller value for the ε in the optimisation.

Appendix D. Energy Consumption Using the Second Initial Configuration of the Manipulator
The following are experimental energy consumptions from the real test-bed using the second initial configuration of the manipulator at the beginning of each path. This configuration was computed based on the middle point between the smallest and largest feasible extension cylinder lengths.