Developing a Tool Point Control Scheme for a Hydraulic Crane Using Interactive Real-time Dynamic Simulation

This paper describes the implementation of an interactive real-time dynamic simulation model of a hydraulic crane. The user input to the model is given continuously via joystick and output is presented continuously in a 3D animation. Using this simulation model, a tool point control scheme is developed for the speciﬁc crane, considering the saturation phenomena of the system and practical implementation.


Introduction
Current mobile hydraulic manipulators, such as loader cranes, forestry machines and aerial lifts are typically controlled by electro-hydraulic actuation via joystick or remote control.One axis on the joystick commands one hydraulic cylinder.In order to move the tool point (end effector) in a controlled way, it is normally necessary to use several DOF of the manipulator simultaneously.This is often a highly nonlinear task, which only experienced operators can do accurately.Therefore one of the main advantages of automated or semi-automated tool point control is the reduced skill level required or, alternatively, the increased productivity.
Tool point control of mobile hydraulic manipulators has been subjected to research for several years.Such control is different from control of typical industrial robots, due to the non-ideal behavior of mobile hydraulic directional control valves, complex dynamics of the hydraulic and mechanical system, continuous online control by an operator, significant structural flexibility, vehicle mounting flexibility, highly varying loads and eigenfrequencies.Furthermore, there are several saturation phenomena associated with the hydraulic actuation.
Thus, for practical implementation of tool point control in mobile hydraulic manipulators, there are many issues to be addressed.Model based development and testing is preferred, since practical testing of such machinery is unsafe and costly in the initial design stages.Krus and Palmberg (1992) presented a simple vector control strategy for a 2 DOF hydraulic crane in the early nineties.Mattila and Virvalo (2000) describe a more advanced control scheme for a similar crane; where an online model is used to reduce the pressure levels and thus the energy consumption.Beiner (1997) solves the redundancy in a 3 DOF hydraulic crane using the minimum norm of the actuator forces.Recently, Yuan et al. (2009) presented a motion control for a 4 DOF non-redundant aerial lift including vibration suppression and static deflection compensation.An interactive real time simulation was achieved by Esqué et al. (2003) for a simplified 2 DOF crane.
Adapting robot control principles in motion control of mobile hydraulic manipulators has been a key area of research at Aalborg University for several years, see Pedersen and Nielsen (2002), Münzer (2003), Hansen and Andersen (2005), Ebbesen (2007) and Kabus and Haastrup (2008) where the Kuhn-Tucker optimality criteria, are applied continuously in directly calculating optimal actuator velocities, while simultaneously minimizing power consumption.Typically, a tool point control scheme for such systems is based on velocity control of the manipulator, and the premise, that the operator closes the loop regarding the tool point position.In order to verify this concept, an interactive real-time simulation model is developed, with actual operator-in-the-loop capabilities.
Recent advances in computational power has made it possible to make interactive dynamic simulations run in real-time on an ordinary laptop computer for limited systems.Here, the implementation of such a simulation model is presented in 3D for a 4 DOF crane including simple flexibility.
This paper describes the development of a tool point control scheme for commercial loader cranes, considering the practical implementation.This means that the costs of sensors and control valves must be kept at a minimum.The developed tool point control scheme is purely feed forward, based on a pseudo inverse approach for handling the redundancy.Flow sharing, deflection compensation, configuration control and joint limit avoidance is also implemented.

Considered system
An HMF 2020K4 mobile loader crane is used as case study, Figure 1.The crane consists of the following 5 bodies; base, column, main boom, jib and extension boom system.The base is considered stationary and neglected from the dynamic analysis.
The crane has 4 controlled joints; slew, main, jib, and extension.The first 3 are revolute joints and the 4th is prismatic.Each joint is actuated by one or more hydraulic cylinders.The slew joint connects through a rack-and-pinion.Both the main and jib joints connects through a linkage system.The extension joint consists of beam segments sliding within each other.It is actuated by 4 cylinders coupled in parallel and the sequence is controlled hydraulically.
For the simulation task at hand, the crane is modelled in 3 subsystems; the mechanical system and hydraulic system and the current reference input.The actuator forces are then used as input in the mechanical model, which solves the forward dynamics of the system and returns the joint accelerations for integration, see Figure 2. The modelling is as detailed as possible without violating the demand for real time simulation.
This paper is organized as follows; chapter 3 and 4 present the mechanical and hydraulic models.Chapter 5 discusses the implementation of these, and chapter 6 presents the developed tool point control algorithm.Results are presented in chapter 7.

Mechanical model
A simplified 6 DOF model of the crane is considered in order to limit the computational effort.All flexibility is lumped in a passive universal joint within the jib body, modelled by rotational springs around the vertical and lateral axes, see Figure 3 and 4.
The dynamics of the mechanical system is implemented using the joint coordinate formulation and non-centroidal coordinate systems, as described by Nikravesh (1990Nikravesh ( , 1991)).
The body-fixed coordinate system is located in the joint connecting the given body to the previous in the chain by the vector r.The vector e describes the axis

Equations of motion
Each body is defined by its mass m, inertia matrix J and location of centre of mass ρ.The equations of motion is given by (1) Here, the i th mass matrix and force vector are where f and n are the forces and moments, respectively, acting on the body.The vector of Cartesian velocities v is defined as For a system of constrained bodies, the equations of motion are combined with the constraints, yielding Here, D and λ are the Jacobian of the constraints and a vector of Lagrange multipliers.This equation system can be solved for the accelerations and Lagrange multipliers by inverting a system matrix of size 54x54 (6x number of bodies + 24 constraints).However, in order to increase computational efficiency, the system is reduced to a minimum set using velocity transformations.

Reduction to a minimum set
The vector of joint velocities is defined as θ = θ1 θ2 θ3 θ4 θ5 θ6 T . (5) Transformation between the Cartesian and joint space is handled by the transformation matrix B as follows Accelerations are then transformed by It can be shown that the B matrix is orthogonal to the constraint Jacobian D, such that Thus, by inserting eq. ( 7) into eq.( 1) and premultiplying with B T we get Using the inertia matrix and force vector in joint space, M and f , then leads to the following short notation where Here, the constraints will be implicitly enforced and the constraint Jacobian as well as the Lagrange multipliers need not be determined.The system matrix, which needs to be inverted in this formulation, is only 6x6, corresponding to the number of DOFs.

Velocity transformation
The velocity transformation matrix B and its time derivative can be established from joint specific block matrices.For the ith body and the jth revolute (R) or prismatic joints (P), these are The distance vectors d ij = r i − r j are illustrated in Figure 5, where it should be noted that d ii = 0. Combining the block matrices of two revolute joints yields a Universal joint (U). (1) (2) The B matrix is thus built by inserting block matrices in the following way, such that R ij relates the joint velocity contribution of joint j to the Cartesian velocity of body i.

Flexibility
Mobile manipulators are typically highly weight optimized and therefore, the influence of the structural flexibility cannot be ignored.The influence of flexibility is investigated by Linjama and Virvalo (1999) and Mikkola (1997).The flexibility significantly influences the eigenfrequency of the structure and thus needs to be included in the mechanical model.
Here, structural flexibility is included in the mechanical model, by dividing the jib-body in two and connecting the halves by a universal joint equipped with rotational springs, as shown in Figure 3.This enables the crane model to flex both in its working plane and in the horizontal plane.
The applied spring torques T s are calculated by The spring constant K s of the rotational springs are determined by physical experiments, such that the deflection of the model resembles the deflection of the real crane.Damping is included in order to stabilize the model and the damping coefficient K d is also determined to match experiments.This simple flexibility model lowers the eigenfrequency and gives a deviation in the tool point position, and is considered sufficient for the purpose of this model.

Extension system modelling
The extension system is modelled as a single body with variable geometry and inertia properties.The dynamics of the relative motion between segments is thus ignored.This is justified, since this motion is highly damped due to friction and its dynamics has only negligible influence.An expression for the position of the centre of mass is obtained by determining it for different values of θ 6 using CAD and fitting a curve through the results, as shown in Figure 6.
The same approach has been applied for the inertia matrix, which is approximately constant, except for the J yy ≈ J zz terms, which vary notably with θ 6 , The results of the fitting procedure are shown in Figure 7.

Hydraulic model
The hydraulic system is modelled with the highest possible detail level without compromising real time simulation.Pressure losses in hoses and fittings are largely ignored and the dynamics of the directional control valves is modelled as a first order system.All cylinders on the crane are mounted with overcenter valves (OCVs) due to practical and legislative reasons.OVCs serve a number of purposes, including leak tight load holding, shock absorbtion, cavitation protection during lowering and load holding at pipe/hose bursts.Their influence on the system is significant, and their effect is included in a simple and efficient manner.
The system in Figure 8 illustrates the main lift cylinder, which has only one OCV controlling the lowering motion.All other joints have double acting OCVs mounted, since the gravity load for these joints act in both directions.
The dynamics of the hydraulic fluid is introduced via the pressure gradient equation for a volume of Newtonian fluid, Merrit (1967) where β is the effective bulk modulus of the fluid, Q is the flow into the volume V and V is the time derivative of the volume expansion.From this, the piston and rod side pressure gradients of the cylinders are calculated These are then integrated to get the pressures on both sides of the piston.
p p,i = ṗp,i dt and p r,i = ṗr,i dt The flow into the circuit Q in is determined from the valve rated flow and the control signal u i and saturates at maximum valve flow The flow out of the circuit is governed by the OCV.
Finally, the cylinder force can be determined from the pressure and area differences and friction.
Nielsen ( 2005) obtained good results using the following simple cylinder friction model, which has also been implemented here.The tanh is continous and crosses through the origin, thus ignoring stick-slip effects.
A mechanical efficiency of η = 0.92 is assumed and the normalization velocity ċη is set at 0.02m/s.

Over-center valves
The OCV model determines the flow out of the cylinders in most cases.The dynamics of the over-center valves is disregarded, and the following static approximation is applied.
The crack pressure p cr must be balanced by the pressures in the cylinder chambers (affected by the pilot ratio ψ, typically ≈ 4 for this application) for the overcenter valve to open.Assuming flow out of the piston side chamber, we have The flow out of an OCV is determined by the orifice equation, assuming a linear discharge characteristic, as shown in Figure 9.The tank pressure p t is assumed to be zero.The maximum value of the flow coefficient K OCV,max can be calculated from the OCV manufacturer datasheets.The pressure increment ∆p at which the OCV is fully opened, is set to 25bar.The OCV flow coefficient is given as

Connecting the mechanical and hydraulic models
In the hydraulic model, the crane state is expressed by cylinder stroke and velocity, i.e. actuator coordinates.
The mechanical model, however, returns joint coordinates.Thus a transformation is necessary from the joint space to the actuator space.

ċ = A θ (29)
A is the Jacobian matrix of the joint to actuator transformation, i.e. the instantaneous effective torque arms of the actuators, given by Here, a 1 = 0.105m is the constant radius of the rack and pinion slew mechanism, a 2 and a 3 vary significantly due to the linkage systems, see Figures 10  and 11.For the linear extension joint, a 4 = 1.
Given the constant lengths k, l, m, n and h and the angle θ 2 , its possible to determine the angles θ l , θ m , θ c and the cylinder stroke c 2 .The instantaneous effective relationship between the cylinder velocity and joint velocity is then given by ċ2 where The same holds for the jib joint.In order to reduce the computational burden, curve fits are used to determine a 2 and a 3 as a function of θ 2 and θ 3 , as shown in Figure 11.
The A matrix furthermore gives the relationship between the cylinder forces and joint torques It is clear, that the maximum lifting capacity of joint 2 (main) and 3 (jib) will be where the effective torque arms have their maximum.The typical pressure layout of such a crane is that the jib joint is set to be stronger than the main joint.Therefore, for general maximum lifting capacity, the torque arm of the main joint should be maximized.The torque arm of the jib joint is approximately constant for θ 3 > −π/2.

Model implementation
The simulation model is implemented in Simulink using the 3D animation toolbox and blocks of Embedded Matlab, Figure 12.The Embedded Matlab blocks Using the fixed step Runge-Kutta integrator (ODE4), real time performance is achieved with a time step of 2.5ms on a standard 2GHz laptop computer.
The Simulink 3D animation toolbox includes a source block for joystick input.This is used as interactive reference input to the model, and resembles the input device typically used for controlling the real crane.
Figure 12: Example of the 3D animation.
The 3D animation sink block featured in the same toolbox is easily applied together with CAD files for the given crane.The CAD files are converted to VRML format, and a VR-world hierarchy files is written, defining the relationship between the CAD parts.
The interactive real time model provides a better feeling with the control system during development, which can otherwise be difficult to obtain, using nonreal time models with preset trajectories.It provides an excellent target for developing and testing new control strategies.

Tool point control
A feedforward control scheme is implemented, where the operator controls the velocity, i.e. direction and speed, of the tool point (hook) of the crane online.The operator will then 'close the loop' and ensure sufficient positional accuracy.
The purpose of creating the simulation model was to aid in the development of a new tool point control scheme for loader cranes.Thus a control block is inserted to transform the joystick input to a suitable reference signal for the virtual crane.
The tool point control block must take the Cartesian velocity reference input ṙT P and, based on some feedback, return the valve flow reference u to the virtual crane, as shown in Figure 13.

Joint controller
Low cost, low resolution sensors are used for the practical implementation in order to keep it commercially viable.A pure feed forward velocity controller is chosen, in order not to rely too much on the sensors for accurate feedback in a closed loop control scheme.The Jacobian matrix of the Cartesian to joint transformation is easily established considering that each column represents the associated joint's velocity contribution to the tool point velocity. where Due to the redundancy, the Jacobian is not square, and the Moore-Penrose pseudo-inverse is used This corresponds to finding the minimum velocity norm in the joint space, Beiner and Mattila (1999).
The requested cylinder velocity is then calculated by eq. ( 29) which is subsequently used for calculating the flow set-point.

Joint limit avoidance
Joint limits are avoided by the weighted least norm (WLN) approach, Chan and Dubey (1993), using the weighted pseudo inverse, which penalizes the motion of joints close to their limits Here a W is a symmetric positive definite weighing matrix The elements of W is given as the partial derivative of a performance criterion, e.g.
The value of H increases exponentially when a joint approaches its limit.The partial derivative of H is then used as weights in W.
The ith weight will go towards infinity, when the ith joint approaches its limit, thus effectively stopping the joint motion.On the other hand when moving away from a limit, the joint is not penalized.Here, ∆| ∂H ∂θi | is the rate of change of the partial derivative.It can be shown, that the weights are continuous, also when ∆| ∂H ∂θi | changes sign, Chan and Dubey (1993).

Configuration control
Experience shows that it is feasible to maximize the effective joint torque arm of the main joint, i.e. a 2 in Figure 11.This can be achieved by modifying the associated weight w 2 by adding the following penalization, i.e. when moving away from the maximum.
In some cases it might also be necessary for the operator to control the configuration of the crane, as shown in Figure 14.This will override the above maximization of the main joint torque arm and can be used to avoid obstacles or fine-tuning the lifting capacity.For a redundant system, a set of joint velocities that do not cause any tool point motion can be determined according to so-called self-motion, see e.g.Chan and Dubey (1993) or Beiner and Mattila (1999).This is typically used in some sort of optimization, e.g. in the gradient projection method, but here it is controlled directly by the operator.θs = (I − J + J)z. (43) The first term is the null space projection matrix of the Jacobian and z is an arbitrary vector in the null space.Then θs can be added to eq. ( 36) without interfering with the tool point motion.Since there is only on degree of redundancy, choosing and taking φs as input from joystick, the operator can control the configuration online.This is possible, even while simultaneously controlling the tool point motion.

Deflection compensation
The total deflection of the tool point is due to; 1) structural flexibility, 2) deformation of sliding pads between segments in the extension system, 3) mechanical slack between segments and 4) compression of hydraulic fluid in cylinders.
In a practical implementation, the joint angles of the main and jib joints would be measured using inclinometers, i.e. relative to horizontal.This means that these joint angles would be measured in the deflected state.Thus, only the deflection of the extension system needs to be compensated for actively.In practise, only the in-plane vertical deflection is significant, i.e. up to ≈ 0.5m.The deflection is especially problematic for horizontal straight-line tool point motion.
Figure 15 illustrates how the real tool point velocity deviates from the reference due to the deflection, which can be expressed as In order for the real tool point velocity to match the reference, the reference must be compensated as ṙcomp Determining ẇ is difficult in practise, since the deflection contribution caused by 2), 3) and 4) is difficult to isolate and quantify.Hence, a simplified approach is used here; Only the vertical deflection is considered and the total deflection velocity is assumed to be proportional to the telescope extension velocity θ6 .The deflection angle of an inclined cantilever beam with a load P at the free end can estimated as follows where ϕ 6 = θ 2 + θ 3 is the inclination angle of the extension system relative to horizontal.Thus, only the scaling factor K c in eq. ( 47) needs to be determined from experiments.Practically, this deflection compensator adds a small upwards velocity to the tool point reference velocity, when extending, which cancels out due to the deflection.

Flow setpoint calculation
The requested cylinder velocities are calculated using eq.( 29) and the flow request Q req is determined by the piston or rod side area, depending on the direction of the requested cylinder velocity Two saturation phenomena need to be included; firstly the valve flow limit and secondly the pump flow limit.The set flow is different from the requested flow if any of the two limits are exceeded in order to maintain the tool point velocity and only violate the speed.The requested set point signal u req,i is determined from the requested flow normalized by the maximum valve flow

Flow sharing
The requested flow is limited to the valve flow limit, typically 40-100 l/min.If one valve limit is exceeded, all requested flows are scaled down by k v .
The total requested flow is determined by summation Flow sharing is applied again if the total requested flow Q tot exceeds the maximum pump flow Q pump : It is then ensured, that neither the valve flow limit nor the pump flow limit are exceeded.

Results
Figure 16 shows the overall control scheme developed.
All motion is directly proportional to the input given by the operator, i.e. no closed loop control has been applied, in order to leave the operator in complete control.The following working cycle is established, in order to illustrate the advantages of real-time versus nonreal-time simulation, see Figure 17.
Traditionally, in a non-real-time simulation, the operator will be modelled, e.g. as a set of predefined trajectories which should follow a reference.This is exemplified as the "predefined operator".Using the simple feedforward joint controller, the tool point speed will generally be slightly lower than the reference, which accumulates to a position error.This is due to pressure build-up time in the hydraulics and acceleration of the mechanics.
In real-time simulation, an actual operator controls the crane tool point (hook) such that it follows the same trajectory.This is shown as the "active operator".In this case, the operator uses visual feedback to close the loop and adjust the input through the joystick, until he/she finds that the reference position is sufficiently achieved.Since the direction of the tool point is always maintained, and only the speed is violated, it is not noticed by the operator.

Conclusions
Under normal evaluation conditions (i.e. using a predefined operator), such a control scheme would probably be deemed unacceptable.However, when the operator capabilities are included in real-time simulation, the controller performance is excellent.
Tool point control of a hydraulic loader crane seems very advantageous for many tasks, however, the operator needs the ability to control the crane traditionally as well, e.g. when folding the crane, or operating close to obstacles.Furthermore, some kind of configuration control will be needed in order to avoid obstacles in the workspace.
Interactive real-time dynamic simulation is a powerful tool for developing control strategies.It provides valuable insight into the practical application of a given control scheme.Future works could include more detailed modelling of the operator as part of a simulation.However, the only authentic way to include operator abilities is to let him/her be part of the loop.

Figure 2 :
Figure 2: Overview of the simulation model.

Figure 6 :
Figure 6: Variable location of extension system Centre of Mass (COM).

Figure 7 :
Figure 7: Fitted location of COM and moments of inertia for the extension system.

Figure 13 :
Figure 13: Overview of the simulation.

Figure 15 :
Figure 15: Tool point velocity deviation due to deflection.

Figure 16 :
Figure 16: Overview of the control scheme.

Figure 17 :
Figure 17: Reference and actual tool point position.