Keywords

14.1 Introduction

Achieving the optimal performance of robot manipulators in repeating tasks have been attracted many attentions in the recent years. In an optimal task, minimum consumed energy, minimum torque, or minimum time can be considered. Often the used manipulators in an assembly or manufacturing line are fixed so for a new product, the end effector of the manipulators and their predefined trajectories can be changed. Since changing the robot and its structure is a hard task or often impossible, beside the trajectory planning, one efficient way to increase the robot performance is balancing. Balancing introduces some simple modifications in the architecture of the original mechanism, which may simplifies its dynamic model and, as a result, its control as well. Besides the control simplification, balancing can also provide reduction of the driving torques. Basically balancing can be categorized into the two types: active and passive balancing. In the active balancing an external electric, pneumatic or hydraulic force is applied to the system [1], while in the passive balancing, compensation inertia [2] or springs [3] are used. Since the additional actuators are not required in the passive balancing, it is more economical and simpler than active one.

Two methods studied in the literature for the passive balancing are using counterweights and/or springs. The balancing by masses is due to added counterweights or link’s mass redistribution. Counterweight balancing is simple and has some advantageous, but it increases inertia of manipulators. In case of balancing by springs, changes in mass and inertia parameters of robot mechanism are insignificant because of negligible weight of springs in comparison to link. Unlike the counterweight balancing which is straight forward and almost simple, spring balancing can be performed in different forms as [4]: Balancing by springs jointed directly with links, balancing by using a cable and pulley arrangement, balancing by using an auxiliary linkage, balancing by using a cam mechanism and balancing by using gear train.

Arakelian et al. [3] has reviewed different types of spring balancing mechanisms. Kolarski et al. [5] compared dynamical behavior of the unbalanced, spring and counterweight balanced PUMA robot configuration. Banala et al. [6] presented spring balancing for 2-DOF spatial manipulator and 3-DOF spatial manipulator. They described the theory of gravity balanced spatial robotic manipulators through a hybrid strategy which uses springs in addition to identification of the center of mass using auxiliary parallelograms. Regardless of the balancing implementation method by mass or spring, the passive balancing approaches are classified into the four types:

  • Static balancing: A machine is said to be static balanced if its potential energy is constant for all possible configurations [5].

  • Dynamic balancing: It has one step more than static balancing, and it is reducing the reaction forces and moments on the base and among actuators, for all situations. Thus, the dynamic balanced robot will lightly transfer some reactions to its adjacent actuators and environments when it is operated [7].

  • Complete balancing: brings some modifications to unbalanced mechanisms in such away to obtain static balancing and complete decoupling of dynamic equations [2].

  • Optimal balancing: Selection of the balancing parameters by consideration of the system trajectory. According to the structure of the trajectory, again it can be divided to two subcategories as Closed Loop optimal balancing and Open Loop optimal balancing [810].

In the Closed Loop optimal balancing the controller is considered for the system. In this field, Saravanan et al. performed optimum balancing for an industrial robot, while a rectangular path must be tracked [8]. Ravichandran et al. by considering a nonlinear PD controller for a 2-DOF robot manipulator applied optimal balancing in order to determine the controller parameters and counterweight values [9]. This optimal balancing approach can be considered as a more general problem called Integrated Plant and Controller design problem. Design for control approach (DFC), in which structure and parameter of the both machine body and control algorithm are designed to fulfill the specific task of a five bar close chain robot by Cheng et al. [11, 12]. To this end, a PD plus robust term control algorithm in the DFC approach have been proposed to obtain the desired performance in terms of change of the tasks [11].

In the Open Loop optimal balancing, the trajectory and the balancing unknowns are simultaneously designed. Generally speaking, this open loop optimal balancing is the trajectory planning problem with some unknown parameters. Optimal trajectory planning of the manipulators is based on the optimization of an objective function while the dynamic equations of motion as well as bounds on joint positions, velocities and torques must be taken into account [13]. The idea is presented by Nikoobin and Moradi [10] and it have been tested for the counterweight balanced robot manipulators in the point to point motion. In fact, an optimal trajectory planning problem is outlined in which states, controls, and the values of counterweights are determined simultaneously in order to minimize the given performance index for a predefined point-to-point task. At this point, two strategies are well-known for path optimization: indirect methods [14] and direct methods [15]. These techniques are used in many articles and they have own benefits and weaknesses [13].

Although the optimal counterweight balancing method in comparison with previous methods such as unbalancing [16], static balancing [5], or complete balancing has significant superiorities to optimize the given performance index, it suffers from increasing the inertia. In order to overcome this drawback, in this chapter optimal balancing is developed for the spring balanced robot manipulators and it is shown that spring balancing is more practical and efficient than counterweight balancing. Then this approach has been applied on the spring balancing of robotic manipulators [4]. The chapter is organized as follows: general formulation of optimal balancing and static balancing is presented in Sects. 14.2 and 14.3, respectively. Then in Sect. 14.4 using the obtained general formulation, modeling and optimality conditions are derived for a two-link manipulator in details. Finally in order to verify the method, simulation results for a two-link manipulator and a PUMA-like robot are presented in Sect. 14.5.

14.2 The Optimal Balancing Formulation

Optimal balancing is defined as: simultaneously achieving of the unknown parameters and the trajectory of the system using the solution of the optimal control. The optimal control problem for the dynamic system involving parameters can be stated as follows [10]: Find the parameter vector b and continuous admissible control history u:[t 0,t f ] → Ω ⊆ ℝm generating the corresponding state trajectory x: [t 0,t f ] → ℝn which defined as continuous state vector as

$$ \mathbf{x}={\left[\begin{array}{cc} {\mathbf{x}}_1^{\mathrm{T}} & {\mathbf{x}}_2^{\mathrm{T}} \end{array}\right]}^{\mathrm{T}}={\left[\begin{array}{cc} {\mathbf{q}}^{\mathrm{T}} & {\dot{\mathbf{q}}}^{\mathrm{T}} \end{array}\right]}^{\mathrm{T}}, $$
(14.1)

which minimize the objective function

$$ J=\phi \left({\mathbf{x}}_{f},\mathbf{b}\right)+{\displaystyle {\int}_{t_0}^{t_{f}}L\left(\mathbf{x},\mathbf{u},\mathbf{b}\right)dt}, $$
(14.2)

subject to the system dynamics

$$ \mathbf{M}\left(\mathbf{q},\mathbf{b}\right)\ddot{\mathbf{q}}+\mathbf{C}\left(\mathbf{q},\dot{\mathbf{q}},\mathbf{b}\right)+\mathbf{G}\left(\mathbf{q},\mathbf{b}\right)=\mathbf{u}, $$
(14.3)

where M ∈ ℝn×n is the mass matrix, C ∈ ℝn is the coupling matrix, G ∈ ℝn is the gravity dependent terms, q ∈ ℝn is the position vector of the manipulator, and b ∈ ℝr is the design parameters vector. Generally, the vector b contains all the unknown constant parameters which their optimal value must be obtained during the problem solution. The vector u ∈ ℝm is the control vector, Ω is an admissible subset of ℝm, t 0 and t f are the initial and the final time and x f is predefined final state. ϕ and L are scalar continuously differentiable functions in which ϕ is the final state penalty term and L is the integrand of the cost function. ϕ and L can be selected to obtain different optimal control problem such as minimum time, terminal control, minimum effort, tracking problem, or regulator problem. Dynamic equation (14.3) can be rewritten in state space form as

$$ \left[\begin{array}{c} {\dot{\mathbf{x}}}_1 \\ {\dot{\mathbf{x}}}_2 \end{array}\right]=\left[\begin{array}{c} {\mathbf{x}}_2 \\ {\mathbf{M}}^{-1}\left({\mathbf{x}}_1,\mathbf{b}\right)\left[\mathbf{u}-\mathbf{C}\left({\mathbf{x}}_1,{\mathbf{x}}_2,\mathbf{b}\right)-\mathbf{G}\left({\mathbf{x}}_1,\mathbf{b}\right)\right] \end{array}\right], $$
(14.4)

with the given initial condition

$$ \mathbf{x}\left({t}_0\right)={\mathbf{x}}_0, $$
(14.5)

and the prescribed final conditions

$$ \mathbf{x}\left({\mathrm{t}}_{\mathrm{f}}\right)={\mathbf{x}}_{f}. $$
(14.6)

where x ∈ ℝn is the state vector and t 0 is the initial time. Constant state vector can be appended for considering the parameters as \( \dot{\mathbf{b}}=\mathbf{0} \). Then by defining the Hamiltonian function as

$$ H=L+{\boldsymbol{\uplambda}}^{\mathrm{T}}\mathbf{f}+{\boldsymbol{\upmu}}^{\mathrm{T}}\dot{\mathbf{b}}, $$
(14.7)

Theorem 1:

Optimality conditions to minimize the objective function (14.4), subject to dynamic equation and boundary conditions (14.5) and (14.6) can be derived as follows:

$$ \begin{array}{l}\mathrm{ODE}:\dot{\mathbf{x}}={\nabla}_{\boldsymbol{\uplambda}}H,\kern1em \dot{\boldsymbol{\uplambda}}=-{\nabla}_{\mathbf{x}}H,\kern1em \dot{\boldsymbol{\upmu}}=-{\nabla}_{\mathbf{b}}H \\ \mathrm{Algebraic}\ \mathrm{Equation}:{\nabla}_{\mathbf{u}}H=0 \\ \mathrm{B}\mathrm{C}\mathrm{s}:\mathbf{x}\left({t}_0\right)={\mathbf{x}}_0,\kern1em \mathbf{x}\left({\mathrm{t}}_{\mathrm{f}}\right)={\mathbf{x}}_{f},\kern1em \boldsymbol{\uplambda} \left({\mathrm{t}}_{\mathrm{f}}\right)=-{\nabla}_{{\mathbf{x}}_{f}}\phi, \kern1em \boldsymbol{\upmu} (0)=0,\kern1em \boldsymbol{\upmu} \left({\mathrm{t}}_{\mathrm{f}}\right)={\nabla}_{\mathbf{b}}\phi . \end{array} $$
(14.8)

With the realization that the parameters behave like states, for the optimal control u* the Legendre-Clebsch condition,

$$ {\nabla}^2H\left({\mathbf{x}}^{*},{\mathbf{u}}^{*},{\boldsymbol{\uplambda}}^{*},{\mathbf{b}}^{*}\right)\ge 0, $$
(14.9)

must be satisfied.

Proof:

Adjoining the constraints (Dynamic equations and constancy of the parameters) to the performance index by Lagrange multipliers λ leads to the augmented performance index [10]

$$ {J}^{\prime }=\phi \left({\mathbf{x}}_{f},\mathbf{b}\right)+{\displaystyle {\int}_{t_0}^{t_{f}}\left[H\left(\mathbf{x},\mathbf{u},\lambda \right)-{\lambda}^{\mathrm{T}}\dot{\mathbf{x}}\right]dt}. $$
(14.10)

According to the fundamental theorem of calculus of variations, if x * is an extremal of functional J′, the variation of J′ must vanish on x′, that is δJ′(x *, δx) = 0 for all δx. Then, taking the variation of J′ and performing the integration by parts gives

$$ \begin{array}{ll}\delta {J}^{\prime }= & \left({\nabla}_{{\mathbf{x}}_{f}}\phi -{\lambda}_{f}^{\mathrm{T}}\right)\delta {\mathbf{x}}_{f}+\left({\nabla}_{\mathbf{b}}\phi +{\displaystyle {\int}_{t_0}^{t_{f}}{\nabla}_{\mathbf{b}}H\;dt}\right)\delta \mathbf{b}+{\lambda}_0\delta {\mathbf{x}}_0 \\ & +{\displaystyle {\int}_{t_0}^{t_{f}}\left[\left({\nabla}_{\mathbf{x}}H+{\dot{\lambda}}^{\mathrm{T}}\right)\delta \mathbf{x}+{\nabla}_{\mathbf{u}}H\delta \mathbf{u}+\left({\nabla}_{\lambda }H-{\dot{\mathbf{x}}}^{\mathrm{T}}\right)\delta \lambda \right]dt} \end{array} $$
(14.11)

If the initial and the final states are predefined then δx 0 and δx f are zero and if not, the corresponding multipliers should be considered zero. It means, for free initial it should consider λ 0 = 0 and for free final state it forms \( {\lambda}_{f}^{\mathrm{T}}={\nabla}_{{\mathbf{x}}_{f}}\phi \). Since the parameter vector b and control u are independent, consider the class of admissible comparison paths where there is no change in the parameter (δb = 0). The problem reduces to the standard fixed final time problem for which

$$ \dot{\mathbf{x}}={\nabla}_{\boldsymbol{\uplambda}}H,\kern1em \dot{\boldsymbol{\uplambda}}=-{\nabla}_{\mathbf{x}}H. $$
(14.12)

Then, for admissible comparison paths where δb ≠ 0, the first variation yields the condition

$$ {\nabla}_{\mathbf{b}}\phi +{\displaystyle {\int}_{t_0}^{t_{f}}{\nabla}_{\mathbf{b}}H\;dt}=0. $$
(14.13)

Now by selecting of the multiplier function μ as

$$ \dot{\boldsymbol{\upmu}}=-{\nabla}_{\mathbf{b}}H,\kern1em \boldsymbol{\upmu} (0)=0, $$
(14.14)

Eq. (14.13) becomes

$$ \boldsymbol{\upmu} \left({\mathrm{t}}_{\mathrm{f}}\right)={\nabla}_{\mathbf{b}}\phi . $$
(14.15)

Also with the realization that the parameters behave like states, the Weiestrass condition,

$$ \begin{array}{ll}H\left(x,{u}^{*},\lambda, b\right)\ge H\left(x,u,\lambda, b\right) & \mathrm{f}\mathrm{o}\mathrm{r}\ \mathrm{all}\ {\mathrm{u}}^{*} \end{array} $$
(14.16)

must be satisfied as must the Legendre–Clebsch condition to have minimum in the Hamiltonian,

$$ {H}_{uu}\left(x,u,\lambda, b\right)\ge 0 $$
(14.17)

As it can be seen, eliminating the parameter vector b in the above equations leads to the well-known optimality conditions obtained from Pontryagin’s minimum principle.

14.3 Static Balancing

For statically balanced robotic systems, the weight of the links does not exert any force at the actuators for any configuration. In the other word, it removes the gravitational effects in mechanical systems. Another appropriate and practical meaning of this concept can be stated as to be constant potential energy of the manipulator. This can be applied by establishing the additional mechanical elements into the system, such as counterweights or springs to make potential energy constant. The use of counterweights has some advantages along with disadvantages that serve to limit its usefulness. For instance, this is undesirable to provide an extra mass on robot where minimum weight is an important criterion. Also, adding the counterweights increases the moment of inertia of the manipulator. Here the general theory for static balancing of manipulators based energy method is stated. The static balancing using energy index can be stated as

$$ \frac{\partial P}{\partial {q}_i}=0,\kern1.12em i=1,\dots, n, $$
(14.18)

where P is the total potential function of manipulator and q i is the position of link i as generalized coordination of the system. Consequently for systems consisting of springs, the unknown parameters can be founded by using these n equations. In some cases, these equations have no solution and this means such systems are not completely balanceable. If complete static balancing occurs, then the gravitational forces become entirely eliminated as

$$ \mathbf{G}\left(\mathbf{q}\right)=0. $$
(14.19)

So, system dynamic described in Eq. (14.3) is reduced to

$$ \widehat{\mathbf{u}}=\widehat{\mathbf{M}}\ddot{\mathbf{q}}+\widehat{\mathbf{C}}\left(\mathbf{q},\dot{\mathbf{q}}\right), $$
(14.20)

where \( \widehat{\mathbf{M}} \) is inertia matrix and Ĉ is the vector of centripetal and Coriolis forces of the static balanced manipulator.

Theorem 2:

Static balancing is a special case of the optimal balancing with an infinite horizon performance index.

Proof:

In order to show the relation between the static and optimal balancing, the scaled time τ ∈ [0 1] is defined to represent the time as

$$ t={\mathrm{t}}_{\mathrm{f}}\tau. $$
(14.21)

Using this time-scaling the derivatives of position vector becomes

$$ \dot{\mathbf{q}}=\frac{d\mathbf{q}}{dt}=\frac{d\mathbf{q}}{t_{f}\;d\tau }=\frac{{\mathbf{q}}^{\mathbf{\prime}}}{t_{f}},\kern2em \ddot{\mathbf{q}}=\frac{d^2\mathbf{q}}{d{t}^2}=\frac{{\mathbf{q}}^{\mathbf{{\prime\prime}}}}{t_{f}^{2}}, $$
(14.22)

so Eq. (14.3) can be rewritten as follows:

$$ \mathbf{M}\left(\mathbf{q},\mathbf{b}\right)\frac{{\mathbf{q}}^{\mathbf{{\prime\prime}}}}{t_{f}^2}+\mathbf{C}\left(\mathbf{q},\mathbf{b}\right)\frac{{\mathbf{q}}^{\mathbf{{\prime\prime}}}}{t_{f}}+\mathbf{G}\left(\mathbf{q},\mathbf{b}\right)=\mathbf{u}. $$
(14.23)

The effort-optimal pay-off functional now selected as

$$ J={\displaystyle {\int}_0^1{\left\Vert \mathbf{u}\right\Vert}^2d\tau }. $$
(14.24)

By substituting the Eq. (14.23) into Eq. (14.24) one can write

$$ J={\displaystyle {\int}_0^1{\left\Vert \mathbf{M}\left(\mathbf{q},\mathbf{b}\right)\frac{{\mathbf{q}}^{\mathbf{{\prime\prime}}}}{t_{f}^2}+\mathbf{C}\left(\mathbf{q},\mathbf{b}\right)\frac{{\mathbf{q}}^{\mathbf{{\prime\prime}}}}{t_{f}}+\mathbf{G}\left(\mathbf{q},\mathbf{b}\right)\right\Vert}^2d\tau }. $$
(14.25)

By approaching t f → ∞ the all terms in Eq. (14.25) will be vanished except the gravitational one. Therefore,

$$ \underset{t_{f}\to \infty }{ \lim }J={\displaystyle {\int}_0^1{\left\Vert \mathbf{G}\left({\mathbf{q}}_{\mathrm{s}},{\mathbf{b}}_{\mathrm{s}}\right)\right\Vert}^2d\tau } $$
(14.26)

where q s denotes optimal static trajectory, b s denotes static balanced vector. The minimum solution of this functional is defined as static balancing of the robotic manipulator in terms of optimal balancing.

As usual, static balancing is considered as solution of the vector equation

$$ \mathbf{G}\left({\mathbf{q}}_{\mathrm{s}},{\mathbf{b}}_{\mathrm{s}}\right)\equiv \mathbf{0}. $$
(14.27)

It is obvious this leads to global minimum of the Eq. (14.26). Thus by approaching the final time to infinity, the optimal balancing leads to static balancing.

14.3.1 Counterweight Balancing

Counterweight static balancing is typically achieved by pioneering additional counterweights or reshaping of the links. This method has advantages along with disadvantages that serve to limit its usefulness. For example, in space robots this is undesirable to provide an extra mass on robot where minimum weight is an important criterion. Also, adding the balancing masses increases the moment of inertia of the manipulator. In contrast, the required torque to remain the manipulator at rest decreases considerably. The necessary number of counterweight for balancing argued before by others, e.g., Kamenski [17].

14.3.2 Spring Balancing

The general spring balancing schematic is presented in Fig. 14.1 for open chain robots, and it has been used for structure in static and optimal balancing. In this figure, k i denotes the spring between bodies whereas the ground body is inertial and considered as 0th body.

Fig. 14.1
figure 1

The general representation of open-chain robot manipulator including springs

The existence of spring in the manipulator will change the potential energy of the manipulator. For the general system shown in Fig. 14.1 the potential energy can be computed as

$$ P={\displaystyle \sum_{j=1}^{n_m}{P}_{j\mathrm{G}}}+{\displaystyle \sum_{j=1}^{n_k}{P}_{j\mathrm{E}}}={\displaystyle \sum_{j=1}^{n_m}\left(\frac{1}{2}{k}_j{\left({l}_j^{\prime }-{l}_j\right)}^2\right)}+{\displaystyle \sum_{j=1}^{n_k}\left({m}_jg{h}_j\right)} $$
(14.28)

where P G is gravitational potential function and P E is elastic potential of system. l denotes initial length of spring, l′ denotes deflected length of spring, m denotes mass of link, h denotes height of center of gravity for link, g denotes gravitational acceleration, n k denotes number of springs and n m denotes number of masses in the system. Substituting Eq. (14.28) into Eq. (14.18) yields

$$ -{\displaystyle \sum_{j=1}^{n_m}\left({k}_j\left({l}_j^{\prime }-{l}_j\right)\frac{\partial {l}_j}{\partial {q}_i}\right)}+{\displaystyle \sum_{j=1}^{n_k}\left({m}_jg\frac{\partial {h}_j}{\partial {q}_i}\right)}=0;\kern1em i=1,\dots, n, $$
(14.29)

where represents n nonlinear equations with n unknown parameters, which depend on the choice of springs structure, may has one, many or no solution. If there is a solution for Eq. (14.29), n unknown parameters are obtained which eliminates the gravitational torques.

14.4 Optimal Balancing of Two-Link Manipulator

14.4.1 Modeling of Two-Link manipulator

Here three different conditions are considered: unbalanced, statically balanced and optimally balanced manipulator. Dynamic equations of all these cases can be presented in the general form. Using the structure presented in Fig. 14.2 a two-link manipulator can be statically balanced.

Fig. 14.2
figure 2

Two-link manipulator with counterweigh balancing (left) and balancing springs (right)

14.4.1.1 Counterweight Balanced

The dynamic equations for such general two-link manipulator with supposing of arbitrary value of counterweights can be described as follows:

$$ \left[\begin{array}{cc} {M}_{11} & {M}_{12} \\ {M}_{12} & {M}_{22} \end{array}\right]\left[\begin{array}{c} {\ddot{\theta}}_1 \\ {\ddot{\theta}}_2 \end{array}\right]+\left[\begin{array}{c} {C}_1 \\ {C}_2 \end{array}\right]+\left[\begin{array}{c} {G}_1 \\ {G}_2 \end{array}\right]=\left[\begin{array}{c} {\tau}_1 \\ {\tau}_2 \end{array}\right] $$
(14.30)

where

$$ \begin{aligned}{M}_{11} & ={m}_1{r}_{g1}^2+{m}_2\left({l}_1^2+2{l}_1{r}_{g2} \cos {\theta}_2+{r}_{g2}^2\right) \nonumber\\ &\quad+ {m}_{\mathrm{p}}\left({l}_1^2+2{l}_1{l}_2 \cos {\theta}_2+{l}_2^2\right)+{m}_{c1}{r}_1^2 \nonumber\\ &\quad+{m}_{c2}\left({l}_1^2-2{l}_1{l}_2 \cos {\theta}_2+{r}_2^2\right)+{I}_1+{I}_2 \\ {M}_{12} & ={m}_2\left({l}_1{r}_{g2} \cos {\theta}_2+{r}_{g2}^2\right)+{m}_{\mathrm{p}}\left({l}_1{l}_2 \cos {\theta}_2+{l}_2^2\right) \nonumber\\ &\quad+{m}_{c2}\left(-{l}_1{r}_2 \cos {\theta}_2+{r}_2^2\right)+{I}_2 \\ {M}_{22} & ={m}_2{r}_{g2}^2+{m}_{\mathrm{p}}{l}_2^2+{m}_{\mathrm{c}2}{r}_2^2+{I}_2 \\ {C}_1 & ={l}_1 \sin {\theta}_2\left(-{m}_2{r}_{g2}-{m}_{\mathrm{p}}{l}_2+{r}_2{m}_{\mathrm{c}2}\right)\;\left(2{\dot{\theta}}_1{\dot{\theta}}_2+{\dot{\theta}}_2^2\right) \nonumber\\ {C}_2 & ={l}_1 \sin {\theta}_2\left({m}_{\mathrm{c}2}{r}_2-{m}_2{r}_{g2}-{m}_{\mathrm{p}}{l}_2\right){\dot{\theta}}_1^2 \nonumber\\ {G}_1 & =\left({m}_1{r}_{g1}+{m}_2{l}_1+{m}_p{l}_1-{m}_{\mathrm{c}1}{r}_1+{m}_{\mathrm{c}2}{l}_1\right)g \cos {\theta}_1 \nonumber\\ &\quad+\left({m}_2{r}_{g2}+{m}_{\mathrm{p}}{l}_2-{m}_{\mathrm{c}2}{r}_2\right)g \cos \left({\theta}_1+{\theta}_2\right) \nonumber\\ {G}_2 & =\left({m}_{\mathrm{c}2}{r}_2-{m}_2{r}_{g2}-{m}_{\mathrm{p}}{l}_2\right)g \cos \left({\theta}_1+{\theta}_2\right) \end{aligned} $$
(14.31)

For link i (i = 1, 2), denotes the mass, l i denotes the length, I i denotes the mass moment of inertia, m p denotes the payload mass, r gi denotes the distance from joint i to the center of mass of the link i, m ci denotes the counterweights attached to link i, and r i denotes the distance from the joint to the counterweights. In unbalanced case (namely normal case), counterweights of manipulator are zero (m c1 = m c2 = 0) which called normal case in this article. Now, in order to achieve the static balancing, m c1 and m c2 must be obtained in such a way that the gravity effects in Eq. (14.31) vanish. It implies that G 1 = G 2 = 0, so by defining the counterweights as follows:

$$ \begin{aligned}[b]{m}_{\mathrm{c}2}&=\left({m}_2{r}_{g2}+{m}_{\mathrm{p}}{l}_2\right)/{r}_2\\ {m}_{\mathrm{c}1}&=\left({m}_1{r}_{g1}+{m}_2{l}_1+{m}_{\mathrm{p}}{l}_1+{m}_{\mathrm{c}2}{l}_1\right)/{r}_1\end{aligned} $$
(14.32)

the dynamic parameters in Eq. (14.30) are changed to

$$ \left[\begin{array}{cc} {M}_{11} & {M}_{12} \\ {M}_{12} & {M}_{22} \end{array}\right]\;\left[\begin{array}{c} {\ddot{\theta}}_1 \\ {\ddot{\theta}}_2 \end{array}\right]=\left[\begin{array}{c} {\tau}_1 \\ {\tau}_2 \end{array}\right], $$
(14.33)

where the value of inertia matrix is

$$ \begin{aligned}{M}_{11} & ={m}_1\left({r}_{g1}^2+{r}_g{r}_1\right) \\ & \quad+{m}_2\left({l}_1^2+{r}_{g2}^2+{l}_1{r}_{g2}\frac{r_1+{l}_1}{r_2}+{l}_1{r}_1+{r}_{g2}{r}_2\right) \\ &\quad+{m}_{\mathrm{p}}\left({l}_1^2+{l}_2^2+{l}_1{r}_1+{l}_2{r}_2+{l}_1{l}_2\frac{r_1+{l}_1}{r_2}\right)+{I}_1 \\ {M}_{12} & ={M}_{21}={m}_2{r}_{g2}^2+{m}_{\mathrm{p}}{l}_2^2+{m}_2{r}_{g2}{r}_2+{m}_{\mathrm{p}}{l}_2{r}_2 \\ {M}_{22} & ={m}_2{r}_{g2}^2+{m}_{\mathrm{p}}{l}_2^2+{m}_2{r}_{g2}{r}_2+{m}_{\mathrm{p}}{l}_2{r}_2+{I}_2 \end{aligned} $$

All required parameters of the robot manipulator are given in Table 14.1. The counterweights of static counterweight balanced manipulator are calculated to be: \( {m}_{\mathrm{c}1}=17\;\mathrm{kg},\ {m}_{\mathrm{c}2}=5\;\mathrm{kg} \).

Table 14.1 Parameters of two-link manipulator [10]

14.4.1.2 Spring Balanced

In deriving the dynamic equations the zero free springs are supposed. For zero free length springs the potential energy using Eq. (14.28) can be written as follows:

$$ \begin{aligned}[b]P&=-{m}_1g{r}_{g1} \sin {\theta}_1-{m}_2g{r}_{g2} \sin \left({\theta}_1+{\theta}_2\right)\\&\quad+{m}_{s1}g\left[\left({l}_1-\frac{1}{2}{s}_1\right) \sin {\theta}_1+\frac{1}{2}{s}_2 \cos \left({\theta}_1+{\theta}_2\right)\right]\\&\quad-{m}_{s2}g\left[{s}_1 \sin {\theta}_1+{s}_2 \sin \left({\theta}_1+{\theta}_2\right)\right]\\&\quad+{m}_{\mathrm{p}}\left[{l}_1 \sin {\theta}_1+{l}_2 \sin \left({\theta}_1+{\theta}_2\right)\right]+\frac{1}{2}{k}_1{x}_1^2+\frac{1}{2}{k}_2{x}_2^2, \end{aligned} $$
(14.34)

where m s1 and m s2 are mass of fractional mechanism, m 1 and m 2 are mass of links, m p is payload mass, l 1 and l 2 are length of links, r gi denotes the distance from joint i to the center of mass of the link i, k 1 and k 2 are stiffness of springs, x 01 and x 02 are initial length of springs, d, s 1, s 2, and s 3 are the connecting position of springs as shown in Fig. 14.2. x 1 and x 2 are instantaneous length of springs which are functions of θ 1 and θ 2 as follows:

$$\begin{aligned}[b]{x}_1^2 & = 2\left({l}_1-{s}_3\right)\;\left({s}_2 \cos {\theta}_2-d \sin {\theta}_1\right)-2d{s}_2 \sin \left({\theta}_1+{\theta}_2\right)+{d}^2+{s}_2^2+{\left({l}_1-{s}_3\right)}^2\nonumber\\ {x}_2^2& = {s}_1^2+{\left({l}_1-{s}_2\right)}^2+2{s}_2\left({l}_1-{s}_1\right) \cos {\theta}_2.\end{aligned}\raisetag{15pt}$$
(14.35)

For convenience the parameters α and β are defined as follows:

$$ \alpha ={m}_2{r}_{g2}+{l}_2{m}_{\mathrm{p}},\kern2em \beta ={m}_1{r}_{g1}+\left({m}_2+{m}_{\mathrm{p}}\right){l}_1 $$
(14.36)

The dynamic equations for such general two-link manipulator can be described as follows:

$$ \left[\begin{array}{cc} {M}_{11} & {M}_{12} \\ {M}_{12} & {M}_{22} \end{array}\right]\;\left[\begin{array}{c} {\ddot{\theta}}_1 \\ {\ddot{\theta}}_2 \end{array}\right]+\left[\begin{array}{c} {C}_1 \\ {C}_2 \end{array}\right]+\left[\begin{array}{c} {G}_1 \\ {G}_2 \end{array}\right]=\left[\begin{array}{c} {\tau}_1 \\ {\tau}_2 \end{array}\right]. $$
(14.37)

where

$$ \begin{aligned} {M}_{22}& = {m}_2{r}_{g2}^2+{m}_{\mathrm{p}}{l}_2^2+{I}_2 \\ {M}_{11}& = {m}_1{r}_{g1}^2+\left({m}_2+{m}_p\right){l}_1^2+{I}_1+2{l}_1\alpha \cos {\theta}_2+{M}_{22} \\ {M}_{12}& = {l}_1\alpha \cos {\theta}_2+{M}_{22}\end{aligned} $$
$$\begin{aligned}[b] {C}_1& = -{l}_1\alpha \sin {\theta}_2\left(2{\dot{\theta}}_1+{\dot{\theta}}_2\right){\dot{\theta}}_2 \\ {C}_2& = {l}_1\alpha {\dot{\theta}}_1^2 \sin {\theta}_2 \\ {G}_1& = \cos {\theta}_1\left({k}_1d\left({s}_3-{l}_1\right)+\beta g\right)+ \cos \left({\theta}_1+{\theta}_2\right)\left(-{k}_1d{s}_2+\alpha g\right) \\ {G}_2& = \left({s}_2\left({k}_2\left({s}_1-{l}_1\right)-{k}_1\left({l}_1+{s}_3\right)\right)\right) \sin {\theta}_2+\left(\alpha g-{k}_1d{s}_2\right) \cos \left({\theta}_1+{\theta}_2\right) \end{aligned} $$
(14.38)

where I i denotes the mass moment of inertia of links.

Again in the unbalanced case, spring parameters of manipulator are zero (\( {k}_1={k}_2=0 \)) which called normal case. Now, in order to achieve the static balancing, s 1, d and s 3 must be obtained in such a way that the gravity effects in Eq. (14.38) vanish. Here k 1, k 2 and s 2 are supposed to be known parameters. Static balancing implies that G 1 = G 2 = 0, so by defining the spring parameters as follows:

$$ d=\frac{g\alpha }{k_1},\kern2em {s}_1={l}_1+\frac{k_1}{k_2}\frac{\beta }{\alpha }{s}_2,\kern2em {s}_3={l}_1-\frac{\beta }{\alpha }{s}_2, $$
(14.39)

static balancing is applied and then, the dynamic parameters in Eq. (14.38) becomes

$$ \begin{aligned}[b]{M}_{22}&={m}_2{r}_{g2}^2+{m}_{\mathrm{p}}{l}_2^2+{I}_2 \\ {M}_{11}&={m}_1{r}_{g1}^2+\left({m}_2+{m}_p\right){l}_1^2+{I}_1+2{l}_1\alpha \cos {\theta}_2+{M}_{22} \\ {M}_{12}&={l}_1\alpha \cos {\theta}_2+{M}_{22} \\ {C}_1&=-{l}_1\alpha \sin {\theta}_2\left(2{\dot{\theta}}_1+{\dot{\theta}}_2\right){\dot{\theta}}_2 \\ {C}_2&={l}_1\alpha {\dot{\theta}}_1^2 \sin {\theta}_2 \\ {G}_1&={G}_2=0. \end{aligned} $$
(14.40)

A two-link manipulator at vertical plan is considered as shown in Fig. 14.2. All required parameters of the robot manipulator are given in Table 14.1. The static balancing results can be seen in the Table 14.2.

Table 14.2 Manipulator parameters for static and optimal balanced cases

14.4.2 Optimality Conditions for Normal and Static Balanced Case

In this section, using the general formulation mentioned in Sect. 14.2, optimality conditions are derived for the considered two-link manipulator at unbalanced and static balanced cases. For the unbalanced case, all the parameters associated with the springs are supposed to be zero, and finding the optimal trajectory between the two given points of the end-effector is considered. For the static balanced case, at first unknown parameters are obtained using Eq. (14.39), then the optimal trajectory for the given performance index will be achieved. Consequently in both unbalanced and statically balanced cases, the unknown parameters do not appear in trajectory optimization procedure. The initial position of the end-effector in XY plane at t = 0 is P 0 = (x 0,y 0) and the final position at t = t f is P f = (x f,y f ). The initial and final velocity is considered to be zero. So by solving the inverse kinematic equations, one can write the boundary conditions as follows:

$$ \begin{aligned}[b]{\theta}_1(0)&={\theta}_{10},\kern1em {\theta}_2(0)={\theta}_{20},\kern1em {\theta}_1\left({\mathrm{t}}_{\mathrm{f}}\right)={\theta}_{1\mathrm{f}},\kern1em {\theta}_2\left({\mathrm{t}}_{\mathrm{f}}\right)={\theta}_{2\mathrm{f}} \\ {\dot{\theta}}_1(0)&={\dot{\theta}}_2(0)={\dot{\theta}}_1\left({\mathrm{t}}_{\mathrm{f}}\right)={\dot{\theta}}_2\left({\mathrm{t}}_{\mathrm{f}}\right)=0. \end{aligned} $$
(14.41)

At the first step, using Eq. (14.1) by defining the continuous state vector as follows:

$$ {X}_1=\left[\begin{array}{l}{\theta}_1(t) \\ {\theta}_2(t) \end{array}\right]=\left[\begin{array}{l}{x}_1(t) \\ {x}_2(t) \end{array}\right],\kern2em {X}_2=\left[\begin{array}{l}{\dot{\theta}}_1(t) \\ {\dot{\theta}}_2(t) \end{array}\right]=\left[\begin{array}{l}{x}_3(t) \\ {x}_4(t) \end{array}\right], $$
(14.42)

the state space form of Eq. (14.37), using Eq. (14.4) becomes

$$ {\renewcommand\theequation{\normalsize\thechapter.\arabic{equation}}\fontsize{9}{11}\selectfont{\begin{aligned}[b] {\dot{x}}_1 & ={x}_3 \\ {\dot{x}}_2 & ={x}_4 \\ {\dot{x}}_3 & =\frac{M_{22}\left({X}_1\right)\;\left({\tau}_1\,{-}\,{C}_1\left({X}_1,{X}_2\right)\,{-}\,{G}_1\left({X}_1\right)\right)\,{-}\,{M}_{12}\left({X}_1\right)\;\left({\tau}_2\,{-}\,{C}_2\left({X}_1,{X}_2\right)\,{-}\,{G}_2\left({X}_1\right)\right)}{M_{11}\left({X}_1\right){M}_{22}\left({X}_1\right)\,{-}\,{M}_{12}\left({X}_1\right){M}_{21}\left({X}_1\right)} \\ {\dot{x}}_4 & =\frac{M_{11}\left({X}_1\right)\;\left({\tau}_2-{C}_2\left({X}_1,{X}_2\right)-{G}_2\left({X}_1\right)\right)-{M}_{21}\left({X}_1\right)\;\left({\tau}_1-{C}_1\left({X}_1,{X}_2\right)-{G}_1\left({X}_1\right)\right)}{M_{11}\left({X}_1\right){M}_{22}\left({X}_1\right)-{M}_{12}\left({X}_1\right){M}_{21}\left({X}_1\right)}. \end{aligned}}} $$
(14.43)

where M ij , C i , and G i (i, j = 1, 2) are substituted from Eqs. (14.38) and (14.40) for normal case and static balanced case, respectively. For unbalanced case unknown parameters are considered to be zero in Eq. (14.38).

Now according to Eq. (14.7), by considering the performance index as minimum control effort is defined as follows:

$$ J={\displaystyle {\int}_{t_0}^{t_{f}}\left({\tau}_1^2+{\tau}_2^2\right)dt}, $$
(14.44)

and the costate vector as \( \lambda =\left[\begin{array}{cccc} {x}_5 & {x}_6 & {x}_7 & {x}_8 \end{array}\right] \), the Hamiltonian function becomes

$$ H={\tau}_1^2+{\tau}_2^2+{x}_5{\dot{x}}_1+{x}_6{\dot{x}}_2+{x}_7{\dot{x}}_3+{x}_8{\dot{x}}_4, $$
(14.45)

where \( {\dot{x}}_i,\ i=1,\dots, 4 \) can be substituted from Eq. (14.43). Then by substituting Eq. (14.43) into Eq. (14.45), and differentiating the Hamiltonian function with respect to the states, according to Eq. (14.8), the costate equations are obtained as follows:

$$ {\renewcommand\theequation{\normalsize\thechapter.\arabic{equation}}\fontsize{9}{11}\selectfont{\begin{aligned}[b]{\dot{x}}_5&=-\frac{\partial H}{\partial {x}_1}=-\frac{\partial }{\partial {x}_1}\left(\frac{\left(-{C}_1-{G}_1\right)\left({x}_7{M}_{22}-{x}_8{M}_{12}\right)+\left(-{C}_2-{G}_2\right)\left(-{x}_7{M}_{12}+{x}_8{M}_{11}\right)}{M_{11}{M}_{22}-{M}_{12}{M}_{21}}\right) \\ {\dot{x}}_6&=-\frac{\partial H}{\partial {x}_2}=-\frac{\partial }{\partial {x}_2}\left(\frac{\left(-{C}_1-{G}_1\right)\left({x}_7{M}_{22}-{x}_8{M}_{12}\right)+\left(-{C}_2-{G}_2\right)\left(-{x}_7{M}_{12}+{x}_8{M}_{11}\right)}{M_{11}{M}_{22}-{M}_{12}{M}_{21}}\right) \\ {\dot{x}}_7&=-\frac{\partial H}{\partial {x}_3}=-{x}_5-\frac{\partial }{\partial {x}_3}\left(\frac{\left(-{C}_1\right)\left({x}_7{M}_{22}-{x}_8{M}_{12}\right)+\left(-{C}_2\right)\left(-{x}_7{M}_{12}+{x}_8{M}_{11}\right)}{M_{11}{M}_{22}-{M}_{12}{M}_{21}}\right) \\ {\dot{x}}_8&=-\frac{\partial H}{\partial {x}_4}=-{x}_6-\frac{\partial }{\partial {x}_4}\left(\frac{\left(-{C}_1\right)\left({x}_7{M}_{22}-{x}_8{M}_{12}\right)+\left(-{C}_2\right)\left(-{x}_7{M}_{12}+{x}_8{M}_{11}\right)}{M_{11}{M}_{22}-{M}_{12}{M}_{21}}\right) \end{aligned}}} $$
(14.46)

After that the control values can be obtained by solving the following equations

$$ \frac{\partial H}{\partial {\tau}_1}=0,\kern2em \frac{\partial H}{\partial {\tau}_2}=0. $$
(14.47)

So by substituting the Hamiltonian function from Eq. (14.45) into Eq. (14.47), the optimal control laws become

$$ \begin{aligned}[b] {\tau}_1 & =\frac{0.5}{M_{11}{M}_{22}-{M}_{12}-{M}_{21}}\left(-{x}_7{M}_{22}+{x}_8{M}_{21}\right) \\ {\tau}_2 & =\frac{0.5}{M_{11}{M}_{22}-{M}_{12}-{M}_{21}}\left(-{x}_7{M}_{22}+{x}_8{M}_{11}\right). \end{aligned} $$
(14.48)

Finally by substituting Eq. (14.48) into Eqs. (14.43) and (14.46), eight nonlinear ordinary differential equations will be obtained which with eight boundary conditions given in Eq. (14.41), construct a two point boundary value problem. This problem can be solved using the bvp4c command in MATLAB®.

14.4.2.1 Optimal Counterweight Balancing

Unlike the static and adaptive balanced cases in which the counterweights are dependent on manipulator parameters as shown by Eq. (14.32), in the optimal balanced case the values of counterweights depends on the dynamic equations, the performance index, and the boundary conditions. Therefore, the counterweights and the optimal trajectory are obtained simultaneously in such a way that the given performance index is minimized. Dynamic equations, costate equations, and optimal control law are the same as obtained in Eqs. (14.43), (14.46), and (14.48), respectively. The dynamic parameters M ij , C i and G i (i, j = 1, 2) in Eqs. (14.43), (14.46), and (14.48), can be substituted form Eq. (14.31). Here, in all equations m c1 and m c2 are considered to be unknown parameters.

Now using Eq. (14.14), by defining the two new state variables x 9 and x 10, the optimality conditions associated with the parameters are given by

$$ {\dot{x}}_9=-\frac{\partial H}{\partial {m}_{\mathrm{c}1}},\kern2.12em {\dot{x}}_{10}=-\frac{\partial H}{\partial {m}_{\mathrm{c}2}} $$
(14.49)

where according to Eqs. (14.14) and (14.15) the associated boundary conditions become

$$ {x}_9(0)={x}_{10}(0)={x}_9\left({\mathrm{t}}_{\mathrm{f}}\right)={x}_{10}\left({\mathrm{t}}_{\mathrm{f}}\right)=0. $$
(14.50)

At last, by substituting Eq. (14.48) into Eqs. (14.43), (14.46), and (14.51), ten nonlinear ordinary differential equations with respect to state \( \left[\begin{array}{cccc} {x}_1 & {x}_2 & {x}_3 & {x}_4 \end{array}\right] \), costate \( \left[\begin{array}{cccc} {x}_5 & {x}_6 & {x}_7 & {x}_8 \end{array}\right] \), new states \( \left[\begin{array}{cc} {x}_9 & {x}_{10} \end{array}\right] \) and unknown parameters \( \left[\begin{array}{cc} {m}_{\mathrm{c}1} & {m}_{\mathrm{c}2} \end{array}\right] \) will be achieved. These ten equations with 12 boundary conditions given in Eqs. (14.41) and (14.52) construct a two point boundary value problem and by solving it using bvp4c command in MATLAB, all the states and unknown parameters can be obtained.

14.4.2.2 Optimal Spring Balancing

Unlike the static balanced case in which the unknown parameters are dependent on manipulator parameters as Eq. (14.39), in optimal balanced case the values of unknowns are dependent on dynamic equations, performance index, and boundary conditions according to Eq. (14.8). Therefore, the unknown parameters and optimal trajectory are obtained simultaneously in such a way that the given performance index is minimized. In this case, optimal control problem involving parameters which its optimality conditions are given in Eq. (14.8) must be considered. All of dynamic equations, costate equations, and optimal control law are the same as unbalanced case obtained in the last section. For convenience the optimization process selection of unknown parameters is divided into two steps. At the first step, k 1, k 2, and s 2 are considered to be known parameters and the optimal value of s 1, d, and s 3 are obtained, on the other hand the parameter vector in Eq. (14.3) is considered to be b = [ s 1 d s 3]T. At the second step, the obtained values for s 1, d, and s 3 at the first step are rounded, and unknown parameters vector is considered to be b = [ k 1 k 2]T. In the first step, by defining the three new state variables as x 9, x 10, and x 11, the optimality conditions associated with the parameters become

$$ {\dot{x}}_9=-\frac{\partial H}{\partial {s}_1},\kern2em {\dot{x}}_{10}=-\frac{\partial H}{\partial d},\kern2em {\dot{x}}_{11}=-\frac{\partial H}{\partial {s}_3}, $$
(14.51)

where according to Eq. (14.8) the associated boundary conditions become

$$ {x}_{9,10,11}(0)={x}_{9,10,11}\left({\mathrm{t}}_{\mathrm{f}}\right)=0. $$
(14.52)

For the second step, by defining of two new state variables as x 9 and x 10, one can write the optimality conditions as

$$ {\dot{x}}_9=-\frac{\partial H}{\partial {k}_1},\kern2em {\dot{x}}_{10}=-\frac{\partial H}{\partial {k}_2}, $$
(14.53)

where according to Eq. (14.8) the associated boundary conditions become

$$ {x}_{9,10}(0)={x}_{9,10}\left({\mathrm{t}}_{\mathrm{f}}\right)=0. $$
(14.54)

At last, by substituting Eq. (14.48) into Eqs. (14.43), (14.46), and (14.51), 11 nonlinear ordinary differential equations in terms of the state [x 1 x 2 x 3 x 4], costate [x 5 x 6 x 7 x 8], new states [x 9 x 10 x 11], and unknown parameters (s 1, d, s 3) will be achieved. These 11 equations with 14 boundary conditions given in Eqs. (14.41) and (14.52), construct a two point boundary value problem which by solving it all the states and unknown parameters can be obtained.

14.4.3 Simulation Results

In these simulations, the five different methods are compared. Normal case means unbalanced form of manipulator, counterweight static balanced means static balanced of manipulator using mass, counterweight optimal means optimal balanced of manipulator using mass, zero free spring-static means static balanced with spring, and zero free spring-optimal means optimal balanced of manipulator using spring.

The initial position of the end-effector in XZ plane at t = 0 is \( {p}_0=\left(1,\kern0.24em 0\right)m \) and the final position at t = 1 s is \( {p}_{f}=\left(0,\kern0.24em 1.73\right)m \). The initial and final velocities are zero. From the inverse kinematic equations, the boundary condition can be expressed as

$$ \begin{aligned}[b]{\theta}_1(0)&=60{}^{\circ},\kern1.12em {\theta}_2(0)=120{}^{\circ},\kern1.12em {\theta}_1\left({\mathrm{t}}_{\mathrm{f}}\right)=120{}^{\circ},\kern1.12em {\theta}_2\left({\mathrm{t}}_{\mathrm{f}}\right)=-60{}^{\circ}\\ {\dot{\theta}}_1(0)&={\dot{\theta}}_2(0)={\dot{\theta}}_1\left({\mathrm{t}}_{\mathrm{f}}\right)={\dot{\theta}}_2\left({\mathrm{t}}_{\mathrm{f}}\right)=0.\end{aligned} $$
(14.55)

The results of simulations for the normal case, counterweight static balanced case and counterweight optimal balanced case are the same as reported in [10]. For counterweight optimal balanced case, at first the values of parameters are obtained using Eq. (14.39). Then the corresponding boundary value problem derived in Sect. 14.4.2.1 is solved to obtain the states and controls. For spring optimal balanced case the corresponding boundary value problem derived in Sect. 14.4.2.2 is solved to obtain states, controls, and unknown parameters. The manipulator parameters for static and optimal balanced cases are given in Table 14.2. In optimal case, since the second spring’s stiffness k 2 is zero, the value of s 1 is unimportant and it is probable to eliminate the second spring in practice.

The obtained optimal trajectories between the initial and final points for the five cases are shown in Fig. 14.3. Figure 14.4 shows the obtained torque of motors. The angular position and angular velocity of links are illustrated in Fig. 14.5. The second column of Table 14.3 shows the values of performance index defined in Eq. (14.44) for five considered cases. The third and forth column represent the improvement relative to the normal case in state of amplification or reduction. As it reported in [10] and can be shown in Table 14.3, the performance index for counterweight-optimal balanced case is less than normal case and counterweight-static balanced case. While the performance index for spring-optimal balanced case is less than the all other cases. In the following figures, readers should notice optimal balancing decrement of input torques, and its effect on the trajectory (path and velocity profile of joints).

Fig. 14.3
figure 3

Optimal trajectories for different cases

Fig. 14.4
figure 4

Input torques of motor 1 and 2 (effect of optimal spring and mass balancing)

Fig. 14.5
figure 5

Angular position and angular velocity of links (The effect of optimal balancing on velocity)

Table 14.3 Comparison of performance indexes

14.5 PUMA-Like Robot

14.5.1 Modeling

A spatial three-jointed PUMA robot is considered as shown in Fig. 14.6. DH parameters and links parameters are given in Tables 14.4 and 14.5. In this robot the first spring is connected between the base and the parallel fractional mechanism. Second spring is connected between second link and third link as shown in Fig. 14.6.

Fig. 14.6
figure 6

PUMA-like robot with additional springs and parallelogram mechanism

Table 14.4 Denavit– Hartenberg parameters for a PUMA-Like robot
Table 14.5 Link parameters and inertia properties [4]

For obtaining the dynamic equations, the Lagrangian formulation is used. Total Lagrangian for this robot can be written as follows:

$$ {L}_{\mathrm{t}}=L+{L}_{\mathrm{sp}}, $$
(14.56)

where L t is total Lagrangian, L is Lagrangian of robot, and L sp is additional Lagrangian due to springs. The additional Lagrangian can be stated as

$$ {L}_{\,sp}=K-U=0-U=-{\displaystyle \sum_{i=1}^2\frac{1}{2}{k}_i{x_i}^2}, $$
(14.57)

where k is stiffness of spring and x i is deformed length of springs.

14.5.2 Static Balancing

The static balancing is considered by two counterweights and its application of the balancing equation with the manipulator’s parameters given in the Table 14.5 leads to the following counterweight’s masses as

$$ \begin{aligned}[b]{m}_{\mathrm{c}2}{r}_2&=0.5\times {m}_{\mathrm{p}}+1.25\\ {m}_{\mathrm{c}1}{r}_1&=0.5\times \left({m}_{\mathrm{p}}+{m}_{\mathrm{c}2}+5\right)+2.5.\end{aligned} $$
(14.1)

These can be rearranged as

$$ {m}_{\mathrm{c}2}=\frac{m_{\mathrm{p}}+2.5}{2{r}_2},\kern1em {m}_{\mathrm{c}1}=\frac{\left(2{r}_2+1\right){m}_{\mathrm{p}}+20{r}_2+2.5}{2{r}_1}, $$
(14.2)

Therefore for any selection of r 1 and r 2 and payload m p, there are corresponding m c1 and m c2. If the value of r 1 and r 2 considered as 0.25 and 0.125 correspondingly, two methods for static balancing are possible: with payload 2 kg and without payload value. In the first method, m c1 = 40 kg and m c2 = 10 kg. These counterweights are considered for comparison, and maybe their application is impossible.

14.5.3 Point-to-Point Motion

After deriving the dynamic equations for this robot, using Eq. (14.8) the optimality condition can be obtained as the same way presented for the two-link manipulator. The boundary conditions are considered as follows:

$$ \begin{aligned}[b]{\theta}_1(0)&=17{}^{\circ},\kern1em {\theta}_1\left({\mathrm{t}}_{\mathrm{f}}\right)=29.22{}^{\circ},\kern1em {\theta}_2(0)=29{}^{\circ},\kern1em {\theta}_2\left({\mathrm{t}}_{\mathrm{f}}\right)=-24{}^{\circ} \\ {\theta}_3(0)&=11.45{}^{\circ},\kern1em {\theta}_3\left({\mathrm{t}}_{\mathrm{f}}\right)=32.23{}^{\circ}, \\ {\dot{\theta}}_1(0)&={\dot{\theta}}_1\left({\mathrm{t}}_{\mathrm{f}}\right)={\dot{\theta}}_2(0)={\dot{\theta}}_2\left({\mathrm{t}}_{\mathrm{f}}\right)={\dot{\theta}}_3(0)={\dot{\theta}}_3\left({\mathrm{t}}_{\mathrm{f}}\right)=0. \end{aligned} $$
(14.58)

For this robot simulations are performed for two cases: normal case and optimal balanced case. For the normal case all the parameters dealing with the springs are considered to be zero. For optimal balanced case, at first the stiffness of springs, k 1 and k 2 are considered to be known and the values of distance between joints and spring connection points are determined. In the next step, by considering the rounded position values, the optimal value of stiffness are obtained. Optimal values of parameters are listed in Table 14.6.

Table 14.6 Optimal values of parameters for PUMA-like robot in point-to-point motion

The obtained optimal controls are shown in Fig. 14.7. The angular position and angular velocity of links are illustrated in Fig. 14.8. The optimal trajectories for normal and optimal balanced cases are given in Figs. 14.9 and 14.10 respectively. Performance index for normal case is found to be 8.81 Nm2 and for spring optimal balanced case is found to be 7.08 Nm2 that this value is 20 % less than normal case.

Fig. 14.7
figure 7

Input torques of motors

Fig. 14.8
figure 8

Angular position and velocity of links

Fig. 14.9
figure 9

Optimal trajectories for normal case

Fig. 14.10
figure 10

Optimal trajectories for optimal cases

14.5.4 Specified Path Tracking

For motion in predefined path, the performance index is considered as follows:

$$ J={\displaystyle {\int}_{t_0}^{t_{f}}\left(w\left({\left({x}_{\mathrm{end}}-{x}_{\mathrm{p}}\right)}^2+{\left({y}_{\mathrm{end}}-{y}_{\mathrm{p}}\right)}^2+{\left({z}_{\mathrm{end}}-{z}_{\mathrm{p}}\right)}^2\right)+{\tau}_1^2+{\tau}_2^2+{\tau}_3^2\right)dt,} $$
(14.59)

where x end, y end, z end are end effector coordinate and x p, y p, z p are path coordinate. The trajectory is a quadrant that start point is p 0 = (0.3, 0.8, 0.3) and final point is p f = (3.0, 0.3, 0.8). The equation of path is defined as following:

$$ \left\{\begin{array}{c} {x}_{\mathrm{p}}=0.3 \\ {y}_{\mathrm{p}}=0.3+0.5 \cos (t) \\ {z}_{\mathrm{p}}=0.3+0.5 \sin (t) \end{array}\right. $$
(14.60)

After deriving the dynamic equations, using Eq. (14.8) the optimality condition can be obtained. The obtained optimal value of the parameters, are given in Table 14.7.

Table 14.7 Optimal values of parameters for PUMA-like robot

The obtained optimal controls are shown in Fig. 14.11. The angular position and angular velocity of links are illustrated in Fig. 14.12. The optimal trajectories for normal and optimal balanced cases are given in Fig. 14.13. Performance index for normal case is found to be 10.6Nm2 and for spring optimal balanced case is found to be 6.903 Nm2 that this value is 34.9 % less than normal case.

Fig. 14.11
figure 11

Input torques of motors

Fig. 14.12
figure 12

Angular position and velocity of links (should be as same as each other)

Fig. 14.13
figure 13

The trajectory of the end effector

14.6 Conclusion

In this chapter, the optimal balancing for robotic system based on the indirect solution of optimal control problem is formulated and then verified by simulation. The method uses the well-known Pontryagin’s minimum principle. The obtained equations lead to a standard form of a two-point boundary value problem which can be solved by computer programs such as MATLABs bvp4c command or Fortan’s twpbvp code.

The efficiency of the proposed method is investigated through computer simulations for a two-link manipulator and the PUMA-like manipulator. The obtained results show that, although the performance index for the static balanced manipulator has been reduced 66.8 % with respect to unbalanced case, by applying the proposed method this reduction reaches to 95 % by using spring balancing. It is also shown that the performance index for spring balancing is very less than the performance index for the counterweight balancing. This result is expected, because in the counterweight balancing the moment of inertia is increased due to the added masses. Finally, simulation is performed for a PUMA-like robot and the capability of the method to solve the complicated problem is shown. For this case study, performance index for optimal balanced case is obtained 20 % less than the unbalanced case. Also, effect of the predefined trajectory is examined for the optimal spring balancing for PUMA-like robot. By simulation, the performance index for the optimal balanced case is obtained 34.9 % less than the unbalanced case.