# Model-Based Development of Control Systems for Forestry Cranes

Authors: Pedro La Hera; Daniel Ortíz Morales
Journal: Journal of Control Science and Engineering
 (2015)

---

## Abstract

Model-based methods are used in industry for prototyping concepts based on mathematical models.
With our forest industry partners, we have established a model-based workflow for rapid development of motion control systems for forestry cranes. Applying this working method, we can verify control algorithms, both theoretically and practically. This paper is an example of this workflow and presents four topics related to the application of nonlinear control theory. The first topic presents the system of differential equations describing the motion dynamics. The second topic presents nonlinear control laws formulated according to sliding mode control theory. The third topic presents a procedure for model calibration and control tuning that are a prerequisite to realize experimental tests. The fourth topic presents the results of tests performed on an experimental crane specifically equipped for these tasks. Results of these studies show the advantages and disadvantages of these control algorithms, and they highlight their performance in terms of robustness and smoothness.


---

## Body

## 1. Introduction

Hydraulic technology has had a great impact on the development of modern industry, and it prevails as the primary component in mechanized heavy-duty equipment. We see a breakthrough of this technology in the forest industry, a business that has profoundly advance from manual labor to the use of very sophisticated machinery. The timber exploited with these machines provides the raw material for countless industrial products.


### 1.1. Overview of Forestry Machines

In the forest industry, success relies on first-class products and competitive costs. Therefore, forestry machines are equipped with highly robust and efficient hydraulic technology. Yet, the efficiency and the work profit depend heavily on the operators working with these machines. This working assignment is difficult and demands highly skilled people. For this reason, operators, particularly beginners, practice the work tasks by combining real and virtual training [1, 2].A typical job description involves working all year round in difficult and isolated areas. This working situation is unattractive for many people and, as a consequence, attracting new operators is becoming increasingly difficult. This problem is one of the primary motivations to design smart forestry machines that will help boosting up productivity [3–5]. In fact, most machine manufacturers are already pioneering the development of machinery that can be more intelligent, user-friendly, and easier to learn.


### 1.2. Overview of Control of Forestry Cranes

Controlling cranes through manual open-loop commands is a mature technology used for more than two decades. It primarily consists of a mechanical manipulator actuated with hydraulic cylinders. These cylinders produce the motion and they are controlled with hydraulic valves. The operator controls the machine from a chair located inside the cabin, an ergonomic chair equipped with joysticks and buttons. Maneuvering the joysticks produces motion, and because neither the crane nor the vehicle is equipped with sensors, controlling all degrees of freedom is challenging and burdensome. This scenario results in unintuitive technology, technology that is difficult to use and learn.Work on other crane control modes is a subject of research for almost thirty years [6–9]. Most research aims to simplify the control complexity by providing more intuitive methods. One example is to directly command the end-effector motions rather than the motion of each individual link. Methods of this kind can be seen in a line of work found in [10–17] and references therein. Many of these solutions are now practical and will be essential for developing a new line of machines. A pioneering of this is already seen in a trend of commercial solutions appearing on the market, such as cranes with built-in sensors [18], smoother motion control [19, 20], and Cartesian end-effector control [19, 21], just to mention a few.The success in the performance of motion control methods depends on closed-loop control algorithms. In the literature, we find a variety of generalized methods that can be applied to manipulators actuated by hydraulic systems. These methods range from semilinear controllers [22–26] to nonlinear control methods [27], such as feedback linearization [28, 29], passivity-based control [30, 31], and adaptive nonlinear control methods [32, 33], among many others.From the variety of methods, Proportional-Integral-Derivative (PID) control is often adequate in most applications requiring closed-loop control [22, 34]. However, PID control lacks the ability to cope with unprecedented variations in model parameters and external disturbances [12]. For these reasons, we are going beyond traditional PID structures. Instead, we are opting for robust nonlinear control algorithms having better performance [35]. One of these methods is sliding mode control (SMC), a nonlinear control technique highly successful in industry.


### 1.3.  Overview of Model-Based Design as a Tool to Go from Research to Product Development

Model-based design (MBD) is currently applied in a variety of industries. Just as computer-aided design (CAD) provides a geometric way of describing equipment, MBD helps to incorporate dynamics and performance requirements to properly describe an overall system in a simulation environment. Moreover, modern MBD benefits from automatic code generation that facilitates rapid prototyping.In the forest industry MBD is important to develop new embedded control solutions. The interest is to use models all along the development cycle: from design to implementation. This working method is cost-efficient and facilitates collaboration among engineers of different disciplines and knowledge levels. For the machine manufacturers working with us, this is an attractive option because it helps to adopt new technologies without great efforts. This is a workflow that we have established for more than a decade and some of the results can be seen in our line of work [12, 14, 15, 23, 24, 36–40].


### 1.4.  Paper Organization

The remaining of this paper presents a procedure to design motion tracking controllers for a forwarder crane. We use SMC theory, but the mathematical models are explicitly formulated for those who would be interested in applying other nonlinear control methods. In terms of development, our aim is to show a complete description of the models and the methods applied for a variety of tasks, including simulation, model calibration, control synthesis/tuning, and verification/validation. The resulting control systems are automatically deployed in the machines’ main computers and we are interested to know how they perform without further online tuning. This is a challenging requirement, as the performance of the control loops relies extensively on the models used for design. With this control method, we are seeking a trade-off among good tracking performance, robustness, and smoothness.The paper is organized as follows. First, the mathematical models are presented in Section2. Second, we formulate the control laws in Section 3. Third, with the purpose of implementing the controllers in both simulation and practice, Section 4 presents an offline model calibration method using recorded data. To conclude this presentation, the results of hardware-in-the-loop tests are discussed in Section 5, and some concluding observations are given in Section 6.


## 1.1. Overview of Forestry Machines

In the forest industry, success relies on first-class products and competitive costs. Therefore, forestry machines are equipped with highly robust and efficient hydraulic technology. Yet, the efficiency and the work profit depend heavily on the operators working with these machines. This working assignment is difficult and demands highly skilled people. For this reason, operators, particularly beginners, practice the work tasks by combining real and virtual training [1, 2].A typical job description involves working all year round in difficult and isolated areas. This working situation is unattractive for many people and, as a consequence, attracting new operators is becoming increasingly difficult. This problem is one of the primary motivations to design smart forestry machines that will help boosting up productivity [3–5]. In fact, most machine manufacturers are already pioneering the development of machinery that can be more intelligent, user-friendly, and easier to learn.


## 1.2. Overview of Control of Forestry Cranes

Controlling cranes through manual open-loop commands is a mature technology used for more than two decades. It primarily consists of a mechanical manipulator actuated with hydraulic cylinders. These cylinders produce the motion and they are controlled with hydraulic valves. The operator controls the machine from a chair located inside the cabin, an ergonomic chair equipped with joysticks and buttons. Maneuvering the joysticks produces motion, and because neither the crane nor the vehicle is equipped with sensors, controlling all degrees of freedom is challenging and burdensome. This scenario results in unintuitive technology, technology that is difficult to use and learn.Work on other crane control modes is a subject of research for almost thirty years [6–9]. Most research aims to simplify the control complexity by providing more intuitive methods. One example is to directly command the end-effector motions rather than the motion of each individual link. Methods of this kind can be seen in a line of work found in [10–17] and references therein. Many of these solutions are now practical and will be essential for developing a new line of machines. A pioneering of this is already seen in a trend of commercial solutions appearing on the market, such as cranes with built-in sensors [18], smoother motion control [19, 20], and Cartesian end-effector control [19, 21], just to mention a few.The success in the performance of motion control methods depends on closed-loop control algorithms. In the literature, we find a variety of generalized methods that can be applied to manipulators actuated by hydraulic systems. These methods range from semilinear controllers [22–26] to nonlinear control methods [27], such as feedback linearization [28, 29], passivity-based control [30, 31], and adaptive nonlinear control methods [32, 33], among many others.From the variety of methods, Proportional-Integral-Derivative (PID) control is often adequate in most applications requiring closed-loop control [22, 34]. However, PID control lacks the ability to cope with unprecedented variations in model parameters and external disturbances [12]. For these reasons, we are going beyond traditional PID structures. Instead, we are opting for robust nonlinear control algorithms having better performance [35]. One of these methods is sliding mode control (SMC), a nonlinear control technique highly successful in industry.


## 1.3.  Overview of Model-Based Design as a Tool to Go from Research to Product Development

Model-based design (MBD) is currently applied in a variety of industries. Just as computer-aided design (CAD) provides a geometric way of describing equipment, MBD helps to incorporate dynamics and performance requirements to properly describe an overall system in a simulation environment. Moreover, modern MBD benefits from automatic code generation that facilitates rapid prototyping.In the forest industry MBD is important to develop new embedded control solutions. The interest is to use models all along the development cycle: from design to implementation. This working method is cost-efficient and facilitates collaboration among engineers of different disciplines and knowledge levels. For the machine manufacturers working with us, this is an attractive option because it helps to adopt new technologies without great efforts. This is a workflow that we have established for more than a decade and some of the results can be seen in our line of work [12, 14, 15, 23, 24, 36–40].


## 1.4.  Paper Organization

The remaining of this paper presents a procedure to design motion tracking controllers for a forwarder crane. We use SMC theory, but the mathematical models are explicitly formulated for those who would be interested in applying other nonlinear control methods. In terms of development, our aim is to show a complete description of the models and the methods applied for a variety of tasks, including simulation, model calibration, control synthesis/tuning, and verification/validation. The resulting control systems are automatically deployed in the machines’ main computers and we are interested to know how they perform without further online tuning. This is a challenging requirement, as the performance of the control loops relies extensively on the models used for design. With this control method, we are seeking a trade-off among good tracking performance, robustness, and smoothness.The paper is organized as follows. First, the mathematical models are presented in Section2. Second, we formulate the control laws in Section 3. Third, with the purpose of implementing the controllers in both simulation and practice, Section 4 presents an offline model calibration method using recorded data. To conclude this presentation, the results of hardware-in-the-loop tests are discussed in Section 5, and some concluding observations are given in Section 6.


## 2. System Modeling

We model the system based on first principle laws describing the interaction in between the mechanical crane and its hydraulic actuation. Briefly, this task consists in describing the mathematics for(i)
the rigid body dynamics, including friction forces,(ii)
the mechanical torque that results from the force exerted by the hydraulic actuators,(iii)
the hydraulic dynamics produced by the circulation of oil from the pump and reservoir to the hydraulic actuator.Due to the complexity of this task and in order to provide a detailed review and exemplification of our findings, the inner boom denoted byq2 in Figure 1 is fully analyzed and presented below. The remaining links will be used to alter model parameters and introduce external disturbances during experimental studies. However, interested readers are referred to [37–39] for the complete modeling of forwarder cranes.Figure 1
Forwarder crane used for our study. It resembles a kinematically redundant manipulator with four degrees of freedom. The gripper is attached at the boom tip and is used for collecting forest biomaterials.


### 2.1. Mechanics

Seen as a single link manipulator, the crane dynamics can be approximated by the second-order differential equation:(1)q¨2·η1+η2q2+τF=τ2,in which q2∈R denotes the angular position of the link, τ2∈R the torque applied at the joint, and τF the friction forces. The expressions for η1 and η2 are given by(2)η1=2l01cos⁡-q3+q20θ3+θ12d6l01sin⁡-q3+q20+l012+d62+θ4,η2=θ1l01+θ2cos⁡q2+q20+θ3cos⁡q2+q3-d6sin⁡q2+q3θ1·g,where(3)l01=r32+d22,and θi represents inertial parameters, [r3,d2,d6] are length values shown in Figure 2, q20=0.0496rad, and g is the constant of gravity. We assume that the telescopic opening q4 is static and fully retracted; that is, q4=0. In contrast, q3 can be placed at different positions, but for the nominal model it will be located at its minimum q3≈-0.2(rad). Both q4 and q3 will be varied to test performance to unmodeled dynamics, parameters variations, and external disturbances.Figure 2
Geometry of the first link jointq2 as a function of the cylinder’s displacement x2. The schematics show the portion related to the motion q2 from Figure 1.


### 2.2.  Friction Forces

The behavior of the motion differs according to the direction [37]; therefore, we approximate friction forces by a model accounting for asymmetries [41]:(4)τF=f¯c·sgn⁡q˙2+Δfc+f¯v·q˙2+Δfv·q˙2,where the terms with a bar¯ denote the mean values for the coefficients of Coulomb (fc) and viscous (fv) friction. In additions, Δf(·) denotes the bias from these mean values.


### 2.3.  Relation between Hydraulic Force and Mechanical Torque

The relation between hydraulic force and mechanical torque is defined by the following expression [34]:(5)τ2=F2·dx2dq2,where F2 is the force produced by the cylinder and dx2/dq2 denotes the change of the cylinder’s piston displacement with respect to the link’s angular position. Referring to Figure 2, this relation is given by differentiating(6)x2q2=j12+j22-2j1j2cos⁡π2-φ4+φ3+q2,in respect of q2, which yields(7)dx2dq2=j1j2sin⁡π/2-φ4+φ3+q2j12+j22-2j1j2cos⁡π/2-φ4+φ3+q2.


### 2.4. Hydraulic Cylinder Dynamics

The actuator’s force (see Figure3) can be calculated from measurements of pressures as(8)F2=AApA-ABpB,where AA, AB denote the areas of chambers A, B respectively and p(·) denotes their pressures. Due to the configuration of the electrovalve (see Figure 4), the pressure in chambers A and B behaves differently. Dynamics of the pressure in chamber A can be derived from the mass balance equation:(9)p˙=βV∑Q-V˙,where β denotes the Bulk modulus, V the hydraulic volume, and Q the input/output flow. Looking at the schematics in Figure 3, the volume in chamber A can be defined as(10)VA=V0A+AAx,and the rate of change in volume is given by the derivative(11)V˙A=AAx˙.Considering internal leakages, dynamics of the pressure inside chamber A can be mathematically approximated by the differential equation:(12)p˙A=βVAQA-KLpA-pB-KApA-AAx˙,where QA denotes flow into chamber A, KL is the coefficient for the internal leakage, and KA is the coefficient of leakage out of the cylinder.Figure 3
Differential double acting cylinder [34].Figure 4
Bidirectional electrohydraulic valve. The configuration for the first link resembles a regenerative 2/3 setup, where theB side is directly connected to the tank and the supplied oil is driven only to the A side.The pressure on chamberB follows another dynamical principle, because it is connected to the tank directly (see Figure 4). This configuration is known as regenerative and it is used to gain potential energy regeneration [42]. The nominal pressure in this chamber is equal to the tank atmospheric pressure, and we model the small variations as a system formed by a resistance and a capacitance [22, 34]; the capacitance is the chamber, and the resistance is the hose where the oil flows:(13)pB=pt+CbABx˙,where pt denotes the tank’s pressure and Cb the capacitance constant [34].


### 2.5.  Electrohydraulic Valve

To drive the oil, the system uses proportional bidirectional valves. These valves have orifices with variable areas controlled by the internal spool’s displacement. The flow through an orifice is given by the general equation:(14)Q=CdAxv2ρΔp,where A is the cross section of the orifice, Δp is the pressure drop across the orifice, and ρ is the density of the fluid. The discharge coefficient is Cd and we assume it is constant. Considering that the area A depends on the spool displacement xv and that [Cd, ρ] are nearly constant, we can rewrite (14) as(15)Q=kqxvΔp,where kq denotes the valve constant. Additionally, we can assume that xv=u because the electronics have fast dynamics in comparison to the overall process. Referring to Figure 4, u is the electrical input to the valve and, therefore, it is the control signal for the process. Without loss of generality, any nonunity gain between xv and u is taken care of by the constant kq; that is,(16)Q=kquΔp.Based on these observations, the flow can be modeled as(17)QA=kqAuΔpA,where(18)ΔpA=ps-pAforu>0,ΔpA=pA-ptforu<0,and ps is the pressure supplied by the pump.In hydraulic systems, a well-known nonlinear phenomenon is asymmetry; that is, the response of the system differs according to the direction of motion. This phenomenon is mathematically described by (17) and (18), where the flow changes according to the sign of the control signal u. This implicates that the model parameter kqA,B can be direction dependent. To place this in mathematical terms, we can consider from (17) and (18) that(19)QA=u·k¯qA+ΔkqAsgn⁡x˙·ps-pt2+sgn⁡x˙ps+pt2-pA︸qAwhich can be shortened as(20)QA=u·k¯qA+ΔkqAsgn⁡x˙qA.


### 2.6. Hydraulic Force as a Function of the Control Input

The differential equation describing dynamics of the hydraulic force can be found by differentiating (8); that is,(21)F˙2=AAp˙A-ABp˙B,which in combination with (12) and (20) yields the change of force as response to the input signal u in the simplified form:(22)F˙2=φ1+φ2·u,where(23)φ1=ξ1KA+ξ2KL+ξ3β+ξ4Cb,φ2=k¯qA+ΔkqAsgn⁡x˙ξ5β,ξ1=-pAVAAA,ξ2=-pA-pBVAAA,ξ3=-AA2VAx˙,ξ4=-AB2x¨,ξ5=qAVAAA.


### 2.7. Mechanical Motion as a Function of the Control Input

To determine the dynamics of the output positionq2 as response to the control input u, we take the time derivative of (1) as(24)q⃛2·η1+ddq2η2q2·q˙2+τ˙F=τ˙2,where(25)τ˙2=ddtF2·dx2dq2=F˙2dx2dq2+F2ddtdx2dq2,so that (24) is rewritten as(26)q⃛2=fq2,q˙2,pA,pB+bq2,pA·uin which(27)fq2,q˙2,pA,pB=1η1ddtdx2dq2·F2+dx2dq2φ1-ddq2η2q2·q˙2-τ˙F,bq2,pA=1η1dx2dq2φ2.Equation (26) is important for control design because it shows the input/output relationship. Additionally, the model (27) is explicitly written to apply most nonlinear control methods.


## 2.1. Mechanics

Seen as a single link manipulator, the crane dynamics can be approximated by the second-order differential equation:(1)q¨2·η1+η2q2+τF=τ2,in which q2∈R denotes the angular position of the link, τ2∈R the torque applied at the joint, and τF the friction forces. The expressions for η1 and η2 are given by(2)η1=2l01cos⁡-q3+q20θ3+θ12d6l01sin⁡-q3+q20+l012+d62+θ4,η2=θ1l01+θ2cos⁡q2+q20+θ3cos⁡q2+q3-d6sin⁡q2+q3θ1·g,where(3)l01=r32+d22,and θi represents inertial parameters, [r3,d2,d6] are length values shown in Figure 2, q20=0.0496rad, and g is the constant of gravity. We assume that the telescopic opening q4 is static and fully retracted; that is, q4=0. In contrast, q3 can be placed at different positions, but for the nominal model it will be located at its minimum q3≈-0.2(rad). Both q4 and q3 will be varied to test performance to unmodeled dynamics, parameters variations, and external disturbances.Figure 2
Geometry of the first link jointq2 as a function of the cylinder’s displacement x2. The schematics show the portion related to the motion q2 from Figure 1.


## 2.2.  Friction Forces

The behavior of the motion differs according to the direction [37]; therefore, we approximate friction forces by a model accounting for asymmetries [41]:(4)τF=f¯c·sgn⁡q˙2+Δfc+f¯v·q˙2+Δfv·q˙2,where the terms with a bar¯ denote the mean values for the coefficients of Coulomb (fc) and viscous (fv) friction. In additions, Δf(·) denotes the bias from these mean values.


## 2.3.  Relation between Hydraulic Force and Mechanical Torque

The relation between hydraulic force and mechanical torque is defined by the following expression [34]:(5)τ2=F2·dx2dq2,where F2 is the force produced by the cylinder and dx2/dq2 denotes the change of the cylinder’s piston displacement with respect to the link’s angular position. Referring to Figure 2, this relation is given by differentiating(6)x2q2=j12+j22-2j1j2cos⁡π2-φ4+φ3+q2,in respect of q2, which yields(7)dx2dq2=j1j2sin⁡π/2-φ4+φ3+q2j12+j22-2j1j2cos⁡π/2-φ4+φ3+q2.


## 2.4. Hydraulic Cylinder Dynamics

The actuator’s force (see Figure3) can be calculated from measurements of pressures as(8)F2=AApA-ABpB,where AA, AB denote the areas of chambers A, B respectively and p(·) denotes their pressures. Due to the configuration of the electrovalve (see Figure 4), the pressure in chambers A and B behaves differently. Dynamics of the pressure in chamber A can be derived from the mass balance equation:(9)p˙=βV∑Q-V˙,where β denotes the Bulk modulus, V the hydraulic volume, and Q the input/output flow. Looking at the schematics in Figure 3, the volume in chamber A can be defined as(10)VA=V0A+AAx,and the rate of change in volume is given by the derivative(11)V˙A=AAx˙.Considering internal leakages, dynamics of the pressure inside chamber A can be mathematically approximated by the differential equation:(12)p˙A=βVAQA-KLpA-pB-KApA-AAx˙,where QA denotes flow into chamber A, KL is the coefficient for the internal leakage, and KA is the coefficient of leakage out of the cylinder.Figure 3
Differential double acting cylinder [34].Figure 4
Bidirectional electrohydraulic valve. The configuration for the first link resembles a regenerative 2/3 setup, where theB side is directly connected to the tank and the supplied oil is driven only to the A side.The pressure on chamberB follows another dynamical principle, because it is connected to the tank directly (see Figure 4). This configuration is known as regenerative and it is used to gain potential energy regeneration [42]. The nominal pressure in this chamber is equal to the tank atmospheric pressure, and we model the small variations as a system formed by a resistance and a capacitance [22, 34]; the capacitance is the chamber, and the resistance is the hose where the oil flows:(13)pB=pt+CbABx˙,where pt denotes the tank’s pressure and Cb the capacitance constant [34].


## 2.5.  Electrohydraulic Valve

To drive the oil, the system uses proportional bidirectional valves. These valves have orifices with variable areas controlled by the internal spool’s displacement. The flow through an orifice is given by the general equation:(14)Q=CdAxv2ρΔp,where A is the cross section of the orifice, Δp is the pressure drop across the orifice, and ρ is the density of the fluid. The discharge coefficient is Cd and we assume it is constant. Considering that the area A depends on the spool displacement xv and that [Cd, ρ] are nearly constant, we can rewrite (14) as(15)Q=kqxvΔp,where kq denotes the valve constant. Additionally, we can assume that xv=u because the electronics have fast dynamics in comparison to the overall process. Referring to Figure 4, u is the electrical input to the valve and, therefore, it is the control signal for the process. Without loss of generality, any nonunity gain between xv and u is taken care of by the constant kq; that is,(16)Q=kquΔp.Based on these observations, the flow can be modeled as(17)QA=kqAuΔpA,where(18)ΔpA=ps-pAforu>0,ΔpA=pA-ptforu<0,and ps is the pressure supplied by the pump.In hydraulic systems, a well-known nonlinear phenomenon is asymmetry; that is, the response of the system differs according to the direction of motion. This phenomenon is mathematically described by (17) and (18), where the flow changes according to the sign of the control signal u. This implicates that the model parameter kqA,B can be direction dependent. To place this in mathematical terms, we can consider from (17) and (18) that(19)QA=u·k¯qA+ΔkqAsgn⁡x˙·ps-pt2+sgn⁡x˙ps+pt2-pA︸qAwhich can be shortened as(20)QA=u·k¯qA+ΔkqAsgn⁡x˙qA.


## 2.6. Hydraulic Force as a Function of the Control Input

The differential equation describing dynamics of the hydraulic force can be found by differentiating (8); that is,(21)F˙2=AAp˙A-ABp˙B,which in combination with (12) and (20) yields the change of force as response to the input signal u in the simplified form:(22)F˙2=φ1+φ2·u,where(23)φ1=ξ1KA+ξ2KL+ξ3β+ξ4Cb,φ2=k¯qA+ΔkqAsgn⁡x˙ξ5β,ξ1=-pAVAAA,ξ2=-pA-pBVAAA,ξ3=-AA2VAx˙,ξ4=-AB2x¨,ξ5=qAVAAA.


## 2.7. Mechanical Motion as a Function of the Control Input

To determine the dynamics of the output positionq2 as response to the control input u, we take the time derivative of (1) as(24)q⃛2·η1+ddq2η2q2·q˙2+τ˙F=τ˙2,where(25)τ˙2=ddtF2·dx2dq2=F˙2dx2dq2+F2ddtdx2dq2,so that (24) is rewritten as(26)q⃛2=fq2,q˙2,pA,pB+bq2,pA·uin which(27)fq2,q˙2,pA,pB=1η1ddtdx2dq2·F2+dx2dq2φ1-ddq2η2q2·q˙2-τ˙F,bq2,pA=1η1dx2dq2φ2.Equation (26) is important for control design because it shows the input/output relationship. Additionally, the model (27) is explicitly written to apply most nonlinear control methods.


## 3. Nonlinear Control Design

Discrepancies, or mismatches, are always present when we compare real behavior againts mathematical models. These differences arise from external disturbances, unknown parameters, and unmodeled dynamics. Designing control laws in the presence of these uncertainties is a very challenging task for a control engineer. Therefore, developing robust control methods is an interesting but difficult subject. One particular robust control approach is the so-called sliding mode control (SMC) technique. Robustness, finite-time convergence, and reduced-order compensated dynamics are advantages of this method. Two variations of this control technique are presented below.


### 3.1. First-Order Sliding Mode Control

The first step to design SMC is to define a sliding surface/functions(t)∈R corresponding to the dynamics of the error between the system’s response and the desired behavior [35, 43]. A sliding mode exists if s(t) converges to zero in finite time and s(t)s˙(t)<0, a fundamental condition for SMC. To design this controller, we start by defining a C3-smooth desired trajectory q2d(t) and the error between q2 and q2d as(28)et=q2t-q2dt.Thus, the sliding mode St follows that(29)St=q2∣st=0,where s(t) is the dynamics of the error (28) and it can be selected as any dynamical system that drives the error dynamics to an exponentially stable behavior. For instance,(30)st=ddt+λ12et,λ1>0.Note that, on the surface S(t), the error dynamics are governed by the relation(31)ddt+λ12et=0.In order to achieve asymptotic convergence of the error to zero, that is, limt→∞e(t)=0, with a given convergence rate and in the presence of a bounded disturbance ω(t), we have to drive the sliding surface s(t) in (30) to zero in finite time by the control input u. To design this control input, we differentiate (30), yielding(32)s˙=e⃛+2λ1e¨+λ12e˙=q⃛2-q⃛2d+2λ1e¨+λ12e˙.Thus, by introducing (26) in the equation above, that is,(33)s˙=f+b·u-q⃛2d+2λ1e¨+λ12e˙,we find the relationship between s and u. The problem is to design a feedback control law that drives this system to zero asymptotically. One choice is [35, 43, 44](34)u=ufl+uro,where ufl is the main control action to account for nonlinear dynamics. On the other hand, uro plays three roles: (1) it determines the reaching time to the sliding surface, (2) it gives robustness to model uncertainty, and (3) it provides disturbance rejection. These two can be postulated as follows:(35)ufl=1b-f+q⃛2d-2λ1e¨-λ12e˙,(36)uro=-δbsgn⁡s,δ>0,where sgn is the signum function and the larger δ, the shorter reaching time. In this form, the stability condition s(t)s˙(t)<0 is satisfied. We refer the reader to the stability analysis presented in [35].


### 3.2.  Second-Order Sliding Mode Control

As defined in the work [45], a second-order SMC is defined by the sliding surface:(37)∂∂t+z0st=∏j=1n∂∂t+λj∫0teτdτ,which represents a set of band-pass filters that are tuned according to λj and z0. The integral term is used to reach zero steady-state errors. The unfactored form of (37), with n=3, yields(38)s˙+z0s=e¨+C2e˙+C1e+C0∫0teτdτ,where Ci are constant values that ensure an exponentially stable behavior. The purpose of the second-order SMC is to make s(t)=s˙(t)=0. The control action can be found by taking the derivative of (38) as presented below:(39)s¨+z0s˙=e⃛+C2e¨+C1e˙+C0e,s¨+z0s˙=q⃛2-q⃛2d+C2e¨+C1e˙+C0e,s¨+z0s˙=f+b·u-q⃛2d+C2e¨+C1e˙+C0e,such that stability is guaranteed if the controller (34) is designed as [45](40)ufl=1b-f+q⃛2d-C2e¨-C1e˙-C0e+z0s˙,uro=-z1bs-δ2bsgn⁡s˙,z1>0,δ2>0,where z1, δ2∈R.


## 3.1. First-Order Sliding Mode Control

The first step to design SMC is to define a sliding surface/functions(t)∈R corresponding to the dynamics of the error between the system’s response and the desired behavior [35, 43]. A sliding mode exists if s(t) converges to zero in finite time and s(t)s˙(t)<0, a fundamental condition for SMC. To design this controller, we start by defining a C3-smooth desired trajectory q2d(t) and the error between q2 and q2d as(28)et=q2t-q2dt.Thus, the sliding mode St follows that(29)St=q2∣st=0,where s(t) is the dynamics of the error (28) and it can be selected as any dynamical system that drives the error dynamics to an exponentially stable behavior. For instance,(30)st=ddt+λ12et,λ1>0.Note that, on the surface S(t), the error dynamics are governed by the relation(31)ddt+λ12et=0.In order to achieve asymptotic convergence of the error to zero, that is, limt→∞e(t)=0, with a given convergence rate and in the presence of a bounded disturbance ω(t), we have to drive the sliding surface s(t) in (30) to zero in finite time by the control input u. To design this control input, we differentiate (30), yielding(32)s˙=e⃛+2λ1e¨+λ12e˙=q⃛2-q⃛2d+2λ1e¨+λ12e˙.Thus, by introducing (26) in the equation above, that is,(33)s˙=f+b·u-q⃛2d+2λ1e¨+λ12e˙,we find the relationship between s and u. The problem is to design a feedback control law that drives this system to zero asymptotically. One choice is [35, 43, 44](34)u=ufl+uro,where ufl is the main control action to account for nonlinear dynamics. On the other hand, uro plays three roles: (1) it determines the reaching time to the sliding surface, (2) it gives robustness to model uncertainty, and (3) it provides disturbance rejection. These two can be postulated as follows:(35)ufl=1b-f+q⃛2d-2λ1e¨-λ12e˙,(36)uro=-δbsgn⁡s,δ>0,where sgn is the signum function and the larger δ, the shorter reaching time. In this form, the stability condition s(t)s˙(t)<0 is satisfied. We refer the reader to the stability analysis presented in [35].


## 3.2.  Second-Order Sliding Mode Control

As defined in the work [45], a second-order SMC is defined by the sliding surface:(37)∂∂t+z0st=∏j=1n∂∂t+λj∫0teτdτ,which represents a set of band-pass filters that are tuned according to λj and z0. The integral term is used to reach zero steady-state errors. The unfactored form of (37), with n=3, yields(38)s˙+z0s=e¨+C2e˙+C1e+C0∫0teτdτ,where Ci are constant values that ensure an exponentially stable behavior. The purpose of the second-order SMC is to make s(t)=s˙(t)=0. The control action can be found by taking the derivative of (38) as presented below:(39)s¨+z0s˙=e⃛+C2e¨+C1e˙+C0e,s¨+z0s˙=q⃛2-q⃛2d+C2e¨+C1e˙+C0e,s¨+z0s˙=f+b·u-q⃛2d+C2e¨+C1e˙+C0e,such that stability is guaranteed if the controller (34) is designed as [45](40)ufl=1b-f+q⃛2d-C2e¨-C1e˙-C0e+z0s˙,uro=-z1bs-δ2bsgn⁡s˙,z1>0,δ2>0,where z1, δ2∈R.


## 4. Controller Implementation

Referring to Figures1 and 5, the machine is equipped with the following hardware: (1) three angular and one linear position quadrature encoders with a resolution of 4000 pulses/rev, (2) eight analog pressure transducers with a range of [0,200] bar, and (3) one off-the-shelf rapid prototyping platform with a sampling frequency of 1 kHz [46]. This hardware is used for recording data, real-time visualization, and testing.Figure 5
The layout presents the configuration of our control system setup, which includes the measurement devices and the rapid prototyping unit. The valve is equipped with magnetic coils to provoke the motion of the internal spools and a power amplifier that accepts regular PWM signals.Most nonlinear control methods use mathematical models as an attempt to cancel nonlinear dynamics. To compute reliable input signals in practice, the model parameters have to be known with a certain degree of certainty. However, a common engineering problem is to have unknown parameters that represent physical properties.The geometry of the system is usually known from CAD drawings. The remaining unknown parameters, masses, inertias, and friction values, have to be found through experimental system identification. This method serves to calibrate the model for simulation and to tune control laws for real-time implementation [47]. The steps used with this purpose are presented below.


### 4.1. Model Calibration

We use three different sets of equations, that is, (1) for the mechanical system, (12) for the pressure dynamics of chamber A, and (13) for chamber B. The coefficients for the valve are found intrinsically within (12). For (1), the unknown parameters relate to the inertial terms denoted by θi and the friction coefficients of the model (4). Similarly, for (22), the unknown parameters relate to the flow coefficients in (20), the Bulk modulus β, and the coefficients of leakage in (12).


#### 4.1.1. Estimation of the Mechanical System Coefficients

We apply algorithms of least-square regression. To this end, we start by rewriting the system (1) as(41)ψ1ψ2ψ3ψ4ψ5ψ6ψ7ψ8︸Ψθ1θ2θ3θ4f¯vf¯cΔfcΔfv︸Θ=τ2,where(42)ψ1=l01gcos⁡q2+q20-gd6sin⁡q2+q3+2d6l01q¨2sin⁡-q3+q20+l012+d62q¨2,ψ2=gcos⁡q2+q20,ψ3=gcos⁡q2+q3+2l01cos⁡-q3+q20q¨2,ψ4=q¨2,ψ5=q˙2,ψ6=sgn⁡q˙2,ψ7=1,ψ8=q˙2.Given measurements of [q2(t),q˙2(t),q¨2(t)] and τ(t) for a finite time T, the parameters of θi can be found by least-square regression [47]:(43)Θ^=ΨTΨ-1ΨTτ2=Ψ†τ2.The estimation of velocities and accelerations is done by Kalman filtering [48]. We use periodic input signals to identify nonlinear behavior [39, 49]. Three cases of recorded data are presented in Figure 6. The results of the estimation with (43) are presented in Figure 7, results that compare the simulated torque τ2 against the measured one.Figure 6
Example of recorded trajectories which resemble finite Fourier series. Each column represents a different data set, which results from an average of many periods. (a) Measured angular positionq2(t) in (rad). (b) Estimated angular velocity q˙2(t) in (rad/sec). (c) Estimated angular acceleration q¨2(t) in (rad/sec2).
(a)
(b)
(c)Figure 7
Result of validation for three different recorded sets of data. The plot shows the simulated response of the input torqueτ2(t) in (Nm) (dark bold line) versus the measured one (grey line).


#### 4.1.2.  Estimation of the Hydraulic System Coefficients of Chamber A

This is done based on (12). To this end, we rearrange the mathematical expression as (44)u^=1φ2p˙A-φ1φ2,which combines (12) with (20) and conveniently expresses the estimate of the input signal u as the dependent variable. This relation is chosen over p˙^A to avoid numerical differentiation errors. (The pressure is measured with analog transducers. Hence, its derivative has to be found by numerical differentiation.) Our aim is to estimate k¯qA, ΔkqA, KA, KL, and β that best reproduce the behavior of the measured signal u. For this task, we use an objective function to quantitatively compare the model behavior to the measured data:(45)ψ=∑iui-u^i2=∑iui-1φ2p˙A-φ1φ22,where ψ is the quantity to be minimized and it accounts for the error between the predicted and observed data. For our particular purposes, this algorithm is programmed in MATLAB applying the Global Optimization Toolbox [47, 50]. This toolbox gives the possibility to work with large amounts of recorded data sets and find global solutions. The search is constrained by defining boundaries according to theoretical values.An example of the data set is presented in Figure8. The comparison between u and u^ is shown in Figure 9. These results demonstrate that the models are able to capture the motion dynamics with sufficient accuracy.Figure 8
Each column depicts a different recorded capture used for identification. (a) Cylinder displacementx2(t) in meters. (b) Pressure pA(t) in chamber A in bars. (c) Pressure pB(t) in chamber B in bars. (d) Control input u(t). All data is presented for a period of 60 seconds.
(a)
(b)
(c)
(d)Figure 9
Validation results. The data presents a comparison of the measured control inputu (grey signal) with the estimation u^ (bold signal) found according to the model (44).


#### 4.1.3.  Estimation of the Hydraulic System Coefficients of Chamber B

This is done based on (13). Rearranging the mathematical expression in the linear form(46)1ABx˙︸Υα1α2︸Λ=pB,we apply least-square estimation Λ^=ΥTΥ-1ΥTpB=Υ†pB. The data used for the estimation is presented in Figure 8, while the results validating the estimation are presented in Figure 10.Figure 10
Validation results. The data presents a comparison of the measured pressurepB (grey signal) with the estimation p^B (bold signal) found according to the model (46).


### 4.2.  Reducing the Sliding-Mode Chattering

Chattering is a common problem of SMC, a behavior that is inadvisable in electrohydraulically actuated servomechanisms. Chattering leads to low control accuracy and it can provoke the wearing of the moving actuators or damage the servo valves. Different methods exist for avoiding chattering. Among these methods, one that performs satisfactorily in practice is via state-dependent time-varying switching gains [43]. One example for first-order SMC is the modification of (36) by(47)uro=-δbs+ϵ1sgn⁡s,ϵ1>0,where the gain δ/b varies proportionally to the value of the sliding surface s. The constant ϵ1 is a sufficiently small value.Unlike first-order SMC, the second-order option (40) leads to a control law that is free of chattering. This is one of the benefits of higher order sliding-mode dynamics. However, higher order SMC can also benefit from state-dependent modifications to improve performance. One example is to modify (40) as(48)uro=-z1bs-δ2bs+ϵ2sgn⁡s˙,ϵ2>0.


### 4.3. Mathematical Considerations

In some cases, control algorithms present mathematical operations that might not be feasible in the formal sense. For instance, the control law (24) needs the derivative of the friction forces defined in (4). Friction forces involve the signum function; therefore, the derivative at zero crossing is undefined in the ordinary sense. It is always possible, however, to consider two separate dynamical models according to the direction of the movement. In that case, the Coulomb friction reduces to a constant value, since sgn⁡(q˙2) is equal to 1 or -1. The derivative of this constant is zero and can be assumed as such in a small vicinity of zero velocity. In this way, the relation τ˙F can be numerically implemented. We follow similar concept to implement the control laws (47) and (48).


## 4.1. Model Calibration

We use three different sets of equations, that is, (1) for the mechanical system, (12) for the pressure dynamics of chamber A, and (13) for chamber B. The coefficients for the valve are found intrinsically within (12). For (1), the unknown parameters relate to the inertial terms denoted by θi and the friction coefficients of the model (4). Similarly, for (22), the unknown parameters relate to the flow coefficients in (20), the Bulk modulus β, and the coefficients of leakage in (12).


### 4.1.1. Estimation of the Mechanical System Coefficients

We apply algorithms of least-square regression. To this end, we start by rewriting the system (1) as(41)ψ1ψ2ψ3ψ4ψ5ψ6ψ7ψ8︸Ψθ1θ2θ3θ4f¯vf¯cΔfcΔfv︸Θ=τ2,where(42)ψ1=l01gcos⁡q2+q20-gd6sin⁡q2+q3+2d6l01q¨2sin⁡-q3+q20+l012+d62q¨2,ψ2=gcos⁡q2+q20,ψ3=gcos⁡q2+q3+2l01cos⁡-q3+q20q¨2,ψ4=q¨2,ψ5=q˙2,ψ6=sgn⁡q˙2,ψ7=1,ψ8=q˙2.Given measurements of [q2(t),q˙2(t),q¨2(t)] and τ(t) for a finite time T, the parameters of θi can be found by least-square regression [47]:(43)Θ^=ΨTΨ-1ΨTτ2=Ψ†τ2.The estimation of velocities and accelerations is done by Kalman filtering [48]. We use periodic input signals to identify nonlinear behavior [39, 49]. Three cases of recorded data are presented in Figure 6. The results of the estimation with (43) are presented in Figure 7, results that compare the simulated torque τ2 against the measured one.Figure 6
Example of recorded trajectories which resemble finite Fourier series. Each column represents a different data set, which results from an average of many periods. (a) Measured angular positionq2(t) in (rad). (b) Estimated angular velocity q˙2(t) in (rad/sec). (c) Estimated angular acceleration q¨2(t) in (rad/sec2).
(a)
(b)
(c)Figure 7
Result of validation for three different recorded sets of data. The plot shows the simulated response of the input torqueτ2(t) in (Nm) (dark bold line) versus the measured one (grey line).


### 4.1.2.  Estimation of the Hydraulic System Coefficients of Chamber A

This is done based on (12). To this end, we rearrange the mathematical expression as (44)u^=1φ2p˙A-φ1φ2,which combines (12) with (20) and conveniently expresses the estimate of the input signal u as the dependent variable. This relation is chosen over p˙^A to avoid numerical differentiation errors. (The pressure is measured with analog transducers. Hence, its derivative has to be found by numerical differentiation.) Our aim is to estimate k¯qA, ΔkqA, KA, KL, and β that best reproduce the behavior of the measured signal u. For this task, we use an objective function to quantitatively compare the model behavior to the measured data:(45)ψ=∑iui-u^i2=∑iui-1φ2p˙A-φ1φ22,where ψ is the quantity to be minimized and it accounts for the error between the predicted and observed data. For our particular purposes, this algorithm is programmed in MATLAB applying the Global Optimization Toolbox [47, 50]. This toolbox gives the possibility to work with large amounts of recorded data sets and find global solutions. The search is constrained by defining boundaries according to theoretical values.An example of the data set is presented in Figure8. The comparison between u and u^ is shown in Figure 9. These results demonstrate that the models are able to capture the motion dynamics with sufficient accuracy.Figure 8
Each column depicts a different recorded capture used for identification. (a) Cylinder displacementx2(t) in meters. (b) Pressure pA(t) in chamber A in bars. (c) Pressure pB(t) in chamber B in bars. (d) Control input u(t). All data is presented for a period of 60 seconds.
(a)
(b)
(c)
(d)Figure 9
Validation results. The data presents a comparison of the measured control inputu (grey signal) with the estimation u^ (bold signal) found according to the model (44).


### 4.1.3.  Estimation of the Hydraulic System Coefficients of Chamber B

This is done based on (13). Rearranging the mathematical expression in the linear form(46)1ABx˙︸Υα1α2︸Λ=pB,we apply least-square estimation Λ^=ΥTΥ-1ΥTpB=Υ†pB. The data used for the estimation is presented in Figure 8, while the results validating the estimation are presented in Figure 10.Figure 10
Validation results. The data presents a comparison of the measured pressurepB (grey signal) with the estimation p^B (bold signal) found according to the model (46).


## 4.1.1. Estimation of the Mechanical System Coefficients

We apply algorithms of least-square regression. To this end, we start by rewriting the system (1) as(41)ψ1ψ2ψ3ψ4ψ5ψ6ψ7ψ8︸Ψθ1θ2θ3θ4f¯vf¯cΔfcΔfv︸Θ=τ2,where(42)ψ1=l01gcos⁡q2+q20-gd6sin⁡q2+q3+2d6l01q¨2sin⁡-q3+q20+l012+d62q¨2,ψ2=gcos⁡q2+q20,ψ3=gcos⁡q2+q3+2l01cos⁡-q3+q20q¨2,ψ4=q¨2,ψ5=q˙2,ψ6=sgn⁡q˙2,ψ7=1,ψ8=q˙2.Given measurements of [q2(t),q˙2(t),q¨2(t)] and τ(t) for a finite time T, the parameters of θi can be found by least-square regression [47]:(43)Θ^=ΨTΨ-1ΨTτ2=Ψ†τ2.The estimation of velocities and accelerations is done by Kalman filtering [48]. We use periodic input signals to identify nonlinear behavior [39, 49]. Three cases of recorded data are presented in Figure 6. The results of the estimation with (43) are presented in Figure 7, results that compare the simulated torque τ2 against the measured one.Figure 6
Example of recorded trajectories which resemble finite Fourier series. Each column represents a different data set, which results from an average of many periods. (a) Measured angular positionq2(t) in (rad). (b) Estimated angular velocity q˙2(t) in (rad/sec). (c) Estimated angular acceleration q¨2(t) in (rad/sec2).
(a)
(b)
(c)Figure 7
Result of validation for three different recorded sets of data. The plot shows the simulated response of the input torqueτ2(t) in (Nm) (dark bold line) versus the measured one (grey line).


## 4.1.2.  Estimation of the Hydraulic System Coefficients of Chamber A

This is done based on (12). To this end, we rearrange the mathematical expression as (44)u^=1φ2p˙A-φ1φ2,which combines (12) with (20) and conveniently expresses the estimate of the input signal u as the dependent variable. This relation is chosen over p˙^A to avoid numerical differentiation errors. (The pressure is measured with analog transducers. Hence, its derivative has to be found by numerical differentiation.) Our aim is to estimate k¯qA, ΔkqA, KA, KL, and β that best reproduce the behavior of the measured signal u. For this task, we use an objective function to quantitatively compare the model behavior to the measured data:(45)ψ=∑iui-u^i2=∑iui-1φ2p˙A-φ1φ22,where ψ is the quantity to be minimized and it accounts for the error between the predicted and observed data. For our particular purposes, this algorithm is programmed in MATLAB applying the Global Optimization Toolbox [47, 50]. This toolbox gives the possibility to work with large amounts of recorded data sets and find global solutions. The search is constrained by defining boundaries according to theoretical values.An example of the data set is presented in Figure8. The comparison between u and u^ is shown in Figure 9. These results demonstrate that the models are able to capture the motion dynamics with sufficient accuracy.Figure 8
Each column depicts a different recorded capture used for identification. (a) Cylinder displacementx2(t) in meters. (b) Pressure pA(t) in chamber A in bars. (c) Pressure pB(t) in chamber B in bars. (d) Control input u(t). All data is presented for a period of 60 seconds.
(a)
(b)
(c)
(d)Figure 9
Validation results. The data presents a comparison of the measured control inputu (grey signal) with the estimation u^ (bold signal) found according to the model (44).


## 4.1.3.  Estimation of the Hydraulic System Coefficients of Chamber B

This is done based on (13). Rearranging the mathematical expression in the linear form(46)1ABx˙︸Υα1α2︸Λ=pB,we apply least-square estimation Λ^=ΥTΥ-1ΥTpB=Υ†pB. The data used for the estimation is presented in Figure 8, while the results validating the estimation are presented in Figure 10.Figure 10
Validation results. The data presents a comparison of the measured pressurepB (grey signal) with the estimation p^B (bold signal) found according to the model (46).


## 4.2.  Reducing the Sliding-Mode Chattering

Chattering is a common problem of SMC, a behavior that is inadvisable in electrohydraulically actuated servomechanisms. Chattering leads to low control accuracy and it can provoke the wearing of the moving actuators or damage the servo valves. Different methods exist for avoiding chattering. Among these methods, one that performs satisfactorily in practice is via state-dependent time-varying switching gains [43]. One example for first-order SMC is the modification of (36) by(47)uro=-δbs+ϵ1sgn⁡s,ϵ1>0,where the gain δ/b varies proportionally to the value of the sliding surface s. The constant ϵ1 is a sufficiently small value.Unlike first-order SMC, the second-order option (40) leads to a control law that is free of chattering. This is one of the benefits of higher order sliding-mode dynamics. However, higher order SMC can also benefit from state-dependent modifications to improve performance. One example is to modify (40) as(48)uro=-z1bs-δ2bs+ϵ2sgn⁡s˙,ϵ2>0.


## 4.3. Mathematical Considerations

In some cases, control algorithms present mathematical operations that might not be feasible in the formal sense. For instance, the control law (24) needs the derivative of the friction forces defined in (4). Friction forces involve the signum function; therefore, the derivative at zero crossing is undefined in the ordinary sense. It is always possible, however, to consider two separate dynamical models according to the direction of the movement. In that case, the Coulomb friction reduces to a constant value, since sgn⁡(q˙2) is equal to 1 or -1. The derivative of this constant is zero and can be assumed as such in a small vicinity of zero velocity. In this way, the relation τ˙F can be numerically implemented. We follow similar concept to implement the control laws (47) and (48).


## 5. Experimental Results

After detailing our model-based control design, we proceed with experimental results. To begin, we recall that our aim is to investigate how our controllers work without the necessity of online tuning.Cranes and particularly the hydraulic actuation present three different challenges. First, these manipulators have long reaching distance and, therefore, they are highly flexible specially while lifting logs. Second, the hydraulic cylinders work as actuators and suspension systems simultaneously. As a consequence, they are highly flexible to avoid mechanical stress while lifting loads. Third, these cranes can lift up to twice their own weight, an amount that introduces high uncertainty in model parameters. All of these problems make control design quite challenging, and our aim in this section is to verify the SMC performance to these effects. Our interest is to obtain a trade-off in between good tracking performance, robustness, and smoothness. The smoothness can be observed by the amplitude of oscillations in the hydraulic pressure and the robustness by the ability to cope with unmodeled dynamics or external disturbances. To introduce these effects, the telescope (q4 in Figure 1) is placed at 70% of its maximum opening, a situation that introduces serious flexibility and causes oscillatory response. Similarly, the outer boom (q3 in Figure 1) is placed to 10% its maximum range, and the gripper is loaded with logs of an approximated weight of 130 kg. All of these changes alter our nominal conditions and will be helpful to observe the control performance. The results are organized as follows: (1) Figures 11 and 12 show experimental validation of the first-order SMC; (2) Figures 13 and 14 show experimental validation of the second-order SMC.Figure 11
Experimental results of tracking performance with a first-order SMC. (a)Angular link displacement in radians. The bold signal shows the results applying the chattering reduction method (47), the striped signal shows results with the original formula (36), and the gray signal is the reference trajectory. (b)Control input. The bold signal shows the results applying the chattering reduction method (47) and the gray signal shows results with the original formula (36). (c)Computed torque from pressure measurements. The bold signal shows the results applying the chattering reduction method (47) and the gray signal shows results with the original formula (36).
(a)
(b)
(c)Figure 12
Experimental results of disturbance rejection with a first-order SMC. (a)Angular link displacement in radians. The bold signal shows the results applying the chattering reduction method (47), the striped signal shows results with the original formula (36), and the gray signal is the reference trajectory. (b)Control input. The bold signal shows the results applying the chattering reduction method (47) and the gray signal shows results with the original formula (36). (c)Computed torque from pressure measurements. The bold signal shows the results applying the chattering reduction method (47) and the gray signal shows results with the original formula (36).
(a)
(b)
(c)Figure 13
Experimental results of tracking performance with a second-order SMC. (a)Angular link displacement in radians. The bold signal shows the results applying the state-dependent method (48), the striped signal shows results with the original formula (40), and the gray signal is the reference trajectory. (b)Control input. The bold signal shows the results applying the state-dependent method (48) and the gray signal shows results with the original formula (40). (c)Computed torque from pressure measurements. The bold signal shows the results applying the state-dependent method (48) and the gray signal shows results with the original formula (40).
(a)
(b)
(c)Figure 14
Experimental results of disturbance rejection with a second-order SMC. (a)Angular link displacement in radians. The bold signal shows the results applying the state-dependent method (48), the striped signal shows results with the original formula (40), and the gray signal is the reference trajectory. (b)Control input. The bold signal shows the results applying the state-dependent method (48) and the gray signal shows results with the original formula (40). (c)Computed torque from pressure measurements. The bold signal shows the results applying the state-dependent method (48) and the gray signal shows results with the original formula (40).
(a)
(b)
(c)


### 5.1. Results with First-Order SMC

For Figure11, the initial conditions were varied to verify the asymptotic convergence to the desired trajectory. The modified control law (47) has a faster settling time, but the tracking accuracy slightly reduces. This is observed in the first row of Figure 11, where we show a superimposed plot of angular position measurements and the desired trajectory. We also observe that the chattering phenomenon is reduced by the control law (47), as we show in the second row of Figure 11. Reducing chattering allows for achieving smoother movements, as it is observed in the third row of Figure 11, where the control law (47) shows less oscillatory amplitude.For Figure12, we modified dynamics by changing the links configurations and including load. The crane was initially positioned far from the desired trajectory to verify asymptotic convergence. Despite the changes, the controller is able to keep all characteristics described earlier. In addition, the modified control law (47) behaves better than the original one.


### 5.2.  Results with Second-Order SMC

For Figure13, the crane was initially positioned near the trajectory to verify the tracking performance. The modified control law (47) has a slower settling time, but the tracking accuracy in both cases is nearly similar. This can be observed in the first row of Figure 13 that shows a superimposed plot of angular position measurements and the desired trajectory. We verified that second-order SMC can suppress chattering, a result observed in the second row of Figure 13. The state-dependent control law (48), however, improves smoothness, as it can be qualified by the torque observed in the third row of Figure 13. In both cases, we see improvements of higher order SMC if we compare Figure 11 with Figure 13.For the results in Figure14, we modified dynamics as explained earlier. The crane was positioned relatively far from the desired trajectory to verify asymptotic convergence. The modified control law (47) has a faster settling time; however, the tracking accuracy in both cases is similar. The first row of Figure 14 shows this behavior with a superimposed plot of angular position measurements and the desired trajectory. In addition, the second-order SMC suppresses chattering without the modification (48), but the state-dependent control law (48) improves smoothness. Figure 14 shows these properties.


## 5.1. Results with First-Order SMC

For Figure11, the initial conditions were varied to verify the asymptotic convergence to the desired trajectory. The modified control law (47) has a faster settling time, but the tracking accuracy slightly reduces. This is observed in the first row of Figure 11, where we show a superimposed plot of angular position measurements and the desired trajectory. We also observe that the chattering phenomenon is reduced by the control law (47), as we show in the second row of Figure 11. Reducing chattering allows for achieving smoother movements, as it is observed in the third row of Figure 11, where the control law (47) shows less oscillatory amplitude.For Figure12, we modified dynamics by changing the links configurations and including load. The crane was initially positioned far from the desired trajectory to verify asymptotic convergence. Despite the changes, the controller is able to keep all characteristics described earlier. In addition, the modified control law (47) behaves better than the original one.


## 5.2.  Results with Second-Order SMC

For Figure13, the crane was initially positioned near the trajectory to verify the tracking performance. The modified control law (47) has a slower settling time, but the tracking accuracy in both cases is nearly similar. This can be observed in the first row of Figure 13 that shows a superimposed plot of angular position measurements and the desired trajectory. We verified that second-order SMC can suppress chattering, a result observed in the second row of Figure 13. The state-dependent control law (48), however, improves smoothness, as it can be qualified by the torque observed in the third row of Figure 13. In both cases, we see improvements of higher order SMC if we compare Figure 11 with Figure 13.For the results in Figure14, we modified dynamics as explained earlier. The crane was positioned relatively far from the desired trajectory to verify asymptotic convergence. The modified control law (47) has a faster settling time; however, the tracking accuracy in both cases is similar. The first row of Figure 14 shows this behavior with a superimposed plot of angular position measurements and the desired trajectory. In addition, the second-order SMC suppresses chattering without the modification (48), but the state-dependent control law (48) improves smoothness. Figure 14 shows these properties.


## 6. Conclusion

The main objective was to present a model-based development workflow. In control engineering, this working method involves using mathematical models to design controllers. Successful application of model-based design involves modeling, control design, simulation, and practical verification. We have presented all of these steps with sufficient details.The subject of study was output tracking motion control for a forestry crane actuated by hydraulic cylinders. This system presents challenges related to flexibility, oscillatory response, and unpredictable model uncertainty. Achieving desirable performance under these effects is a difficult control problem.In relation to system modeling, we have presented first principle laws that explain the motion dynamics. We believe that this is an important step, because (1) the hydraulic configuration used in these systems has different characteristics to what is commonly found in literature and (2) these mathematical models are essential to derive nonlinear control laws. The model parameters were found by system identification tests. The simulation results showed agreement between the experimental data and simulated quantities.For control design, we have presented nonlinear sliding mode control techniques considering two alternatives: first-order SMC and second-order SMC. For both cases, we have tested the case of static and state-dependent control parameters to reduce chattering. Results of experimental tests suggest that state-dependent control has better performance over static gains. Additionally, for tracking and model uncertainty, second-order SMC performs slightly better than the first-order option. Nevertheless, we experienced that first-order SMC is easier to implement and the benefits of higher order SMC might not be so much better to justify the efforts of implementation. We conclude that first-order SMC with state-dependent parameters meets all of our expectations.As a concluding remark, the control laws were tuned applying the Robust Control Toolbox of MATLAB. The results presented show the performance of control parameters found with this software; online tuning was not done. We implemented these controllers using automatically generated embedded code, thus completing out model-based development workflow.



---

*Source: 256951-2015-06-02.xml*