Download as pdf or txt
Download as pdf or txt
You are on page 1of 17

Mechanism and Machine Theory 115 (2017) 18–34

Contents lists available at ScienceDirect

Mechanism and Machine Theory


journal homepage: www.elsevier.com/locate/mechmachtheory

Research paper

Optimal synthesis of four-bar path generator linkages using


Circular Proximity Function
Sahand Hadizadeh Kafash∗, Ali Nahvi
Department of Mechanical Engineering, K. N. Toosi University of Technology, Tehran, Iran

a r t i c l e i n f o a b s t r a c t

Article history: This paper presents a new objective function for the optimization of path-generator four-
Received 16 October 2016 bar linkages. A four-bar linkage includes four revolute joints, two of which are connected
Revised 20 February 2017
to the coupler link. These two joints, which are known as the moving joints of the linkage,
Accepted 18 April 2017
have a remarkable characteristic: both trace circular curves. Using this fact, a new method-
Available online 28 April 2017
ology is presented. In this methodology, a dyad is considered which exactly traces the de-
Keywords: sired path. On the plane attached to the moving link of the dyad, an unlimited number of
Four-bar linkage points can be defined. Among these points, the point which traces a circular curve is very
Path generation important since this point together with the moving joint of the dyad can be considered
Optimization as the two moving joints of a four-bar linkage. In order to evaluate the path generated
Objective function by each point and find the point that traces a near-circular curve, the Circular Proxim-
Evolutionary algorithm ity Function (CPF) is implemented. Using CPF, a new objective function is introduced that
has the lowest number of optimization variables. The optimization process is carried out
by the method of differential evolution (DE). Three example problems were solved which
resulted in the synthesis of crank-rocker four-bar linkages.
Three example problems are solved in this paper demonstrating the efficacy of the
proposed method.
© 2017 Elsevier Ltd. All rights reserved.

1. Introduction

Synthesis of four-bar linkages has been widely studied during the past decades. In general, dimensional synthesis of four-
bar linkages is categorized in three classes: function generation, path generation, and motion generation [1]. The problem
of path generation synthesis, which is the subject of this paper, is to determine the length of links and the coordinates of
the fixed joints in such a way that a specific point on the coupler plane would generate a desired path. The desired path is
defined by a set of discrete points known as precision points.
Path generation synthesis of four-bar linkages can be solved analytically [2]. The limited number of precision points is a
major drawback of analytical methods. Because of the limited number of independent design variables in a four-bar linkage,
analytical synthesis of path-generator four-bar linkages can be done with no more than nine precision points [3].
Optimization methods are alternative solutions which are able solve the problem with more than nine precision points.
While in analytical methods the obtained linkage generates a path which exactly falls on the precision points, in optimiza-
tion methods the obtained linkage approximately generates the desired path and the generated path may not exactly fall on


Corresponding author.
E-mail addresses: shadizadeh@mail.kntu.ac.ir, sahand.hdz@gmail.com (S. Hadizadeh Kafash), nahvi@kntu.ac.ir (A. Nahvi).

http://dx.doi.org/10.1016/j.mechmachtheory.2017.04.010
0094-114X/© 2017 Elsevier Ltd. All rights reserved.
S. Hadizadeh Kafash, A. Nahvi / Mechanism and Machine Theory 115 (2017) 18–34 19

the precision points. In this context, a majority of works has been devoted to the optimization of path-generator linkages
by means of evolutionary algorithms.
Studies conducted in the field of evolutionary optimization of four-bar linkages can be categorized into two groups. In
the first group, researchers focused on the performance of evolutionary algorithms to find better results for this problem.
Fang [4], Roston and Sturges [5] were the first researchers who used Genetic Algorithm (GA) to solve this problem. Acharyya
and Mandal [6] compared the performance of GA, Particle Swarm Optimization (PSO), and Differential Evolution (DE) for the
optimal synthesis of path-generator linkages. They observed that DE shows faster convergence and better results. Laribi et
al. [7] combined GA with a fuzzy logic controller to solve this problem. In their method, a fuzzy logic controller monitors
the variations of optimization variables in the first run of the algorithm and modifies the boundaries of search space for the
second run of GA. Lin [8] combined GA with DE for the optimization of path-generator linkages. Cabrera et al. [9] used DE
with a slight modification. They added a mutation operator in order to avoid stagnation and to find the correct optimum
linkage. Ortiz et al. [10] also used a modified version of DE in which control parameters of the algorithm are tuned during
the execution of the algorithm. Ebrahimi and Payvandy [11] implemented Imperialistic Competitive Algorithm (ICA) for the
synthesis of path generating four-bar linkages. Sedano et al. [12] combined evolutionary algorithm with a deterministic
optimization technique. The deterministic optimization method used in their study enables the optimization algorithm to
avoid the influence of size, location, and orientation of the generated curve. Bulatović et al. [13] studied the application of
Krill Herd (KH) algorithm for the dimensional synthesis of path-generator linkages. The paper presented by Lin and Hsiao
[14] is one of the latest studies conducted in this framework.
In the second group, researchers concentrated on the performance of objective functions in the optimal synthesis of path-
generator linkages. Zhou and Cheung [15] presented a new objective function, which is based on the orientation structural
error of the fixed link. Ullah and Kota [16] used Fourier descriptors and presented an effective objective function for the
shape optimization of coupler curve. This objective function compares the shape of the generated curve with the desired
path without being affected by the size, orientation, or location of the curve. Fernández-Bustos et al. [17] used the finite
element method and proposed a new objective function. Matekar and Gogate [18] introduced a modified distance error
function and studied its performance in comparison with the Euclidean distance error function. Kim and Yoo [19] employed
a spring-connected arbitrarily-sized rectangular block model for the optimization of path-generator linkages. Buśkiewicz
[20] presented a new technique for the path generation synthesis of four-bar linkages in that the deviation of generated
path of the joints from the ideal path is considered as the error function. Kim et al. [21] used the first and second or-
der derivatives of the coupler curve and proposed a two-step optimization strategy for the path generation synthesis. Each
objective function presents a different approach for the optimization of path-generator linkages. The interesting fact about
such objective functions is that each takes a different number of optimization variables. For example, the objective func-
tion presented in [15] has 6 optimization variables, while the objective function presented in [19] includes 28 optimization
variables.
It is necessary to distinguish optimization variables from design variables. The design variables are required to fully
define a linkage while the optimization variables are the input parameters of the objective function. The number of design
variables for a path-generator four-bar linkage is nine. However, the number of optimization variables depends on our choice
of the objective function. For instance, the most common objective function for path generation synthesis known as tracking
error (TE) has 9 +n optimization variables, where n is the number of precision points. This function takes all nine design
variables and the angle of the driving link for each generated point as input parameters. The main drawback of using TE
as objective function is that when the number of precision points increases, the number of optimization variables also in-
creases. Therefore, high number of precision points results in a large-dimensional search space which significantly increases
the computational cost. The objective function presented in this paper has four optimization variables and its number of
optimization variables is independent of the number of precision points. Therefore, increasing the number precision points
does not change the dimension of the search space.
This paper is closely related to the recent work [22] on the optimal synthesis of four-bar motion generator linkages. In
[22], a new objective function was introduced for motion generation synthesis, which reduces the number of optimization
variables. In a similar way, a new objective function is presented in this study for path generation synthesis, which has the
lowest number of optimization variables in comparison with other objective functions presented so far.
This paper is organized as follows. In Section 2, kinematics of a four-bar linkage and the design variables needed to
define a path-generator linkage are presented. Section 3 is devoted to the explanation of the methodology. In Section 4,
the optimization algorithm is explained. Performance of the presented method is investigated by solving three example
problems in Section 5.

2. Kinematics of four-bar path-generator linkages

In Fig. 1, a path-generator linkage with its design variables is depicted. In total, there are nine independent design vari-
ables. r1 , r2 , r3 , and r4 determine the lengths of the links, r5 and β define the position of the point on coupler plane which
generates the path. xA , yA , and α also define the position and the orientation of the fixed link and therefore the local x,y
frame. These nine design variables can fully define a path-generator four-bar linkage.
20 S. Hadizadeh Kafash, A. Nahvi / Mechanism and Machine Theory 115 (2017) 18–34

Fig. 1. Nine design variables of path-generator linkage include r1 , r2 , r3 , r4 , r5 , β, xA , yA , and α.

By considering θ 2 as input angle, θ 3 can be computed as follows:


 √ 
m± l 2 + m2 − n2
θ3 = 2 arctan (1)
l−n
where
l = 2r2 r3 cos θ2 − 2r1 r3 (2)

m = 2r2 r3 sin θ2 (3)

n = r1 2 + r2 2 + r3 2 − r4 2 − 2r1 r2 cos θ2 (4)


The important point about Eq. (1) is the change of sign before the squared root of This change of sign l2 + m2 − n2 .
results in two distinct values corresponded to the two ways in which a four-bar linkage can be closed.
The position of point M in the local x,y coordinate system attached to the fixed link is obtained by the following relation:
      
xM r cos θ2 cos θ3 − sin θ3 r5 cos β
= 2 + (5)
yM r2 sin θ2 sin θ3 cos θ3 r5 sin β

In the final step, the position of point M in global X,Y coordinate system is calculated as follows:
      
XM x cos α − sin α xM
= A + (6)
YM yA sin α cos α yM

3. Methodology

In Fig. 2, a desired path (K) and a dyad (ABM) are shown. As point M traces the desired path, point C which is rigidly
connected to the link BM generates a circular curve. It is known that both of the moving joints in a four-bar linkage generate
S. Hadizadeh Kafash, A. Nahvi / Mechanism and Machine Theory 115 (2017) 18–34 21

Fig. 2. A dyad (ABM) which traces the desired path (K).

circular curves. Based on this fact, points B and C can be considered as the moving joints of a four bar-linkage. This is the
main idea of this paper.
For practical purposes, full rotation of input link r2 around its fixed pivot A is preferred. Considering the four-bar linkage
shown in Fig. 2 as a crank-rocker linkage, when crank AB rotates and point M generates the closed curve K, links AB and
BM are aligned with each other twice. The first alignment occurs when M traces the farthest point of the desired path from
fixed pivot (Rmax ) and the second alignment occurs when M traces the nearest point (Rmin ) of the desired path. Based on
this observation, form the following relationships can be formulated:
r2 + r5 = Rmax (7)

|r2 − r5 | = Rmin (8)


Rmax and Rmin are the longest and shortest distance between the desired path and the fixed joint A. If point A lies outside
the desired curve, then r5 > r2 . On the other hand, if point A lies inside the desired curve, then r5 < r2 . Based on this fact,
when the coordinates of point A are known, the length of r2 and r5 can be obtained by means of Eqs. (7) and (8). xA and yA
are two unknown variables which define the coordinates of point A. These two variables are found during the optimization
process. It should be noted that the idea of using Eqs. (7) and (8) to compute r2 and r5 has been borrowed from [15].
Now the main challenge of this research is to find point C which traces a circular curve. If such a point tracing a circular
curve is found, then this point can be chosen as the second moving pivot of the linkage. Then, the center of the circular
curve traced by C can be chosen as the second fixed pivot of the four bar linkage. Fig. 2 schematically depicts this idea.
At this point, two variables r3 and β which define the position of point C are unknown. An unlimited number of points
can be defined on the plane attached to the link BM. As point M traces the desired curve, each point on the plane attached
to BM traces a different path. These paths should be evaluated in order to find the point which traces a circular curve.
22 S. Hadizadeh Kafash, A. Nahvi / Mechanism and Machine Theory 115 (2017) 18–34

Performing such evaluation requires an error function which is able to quantify the similarity of a path to a circular curve.
This error function which was introduced in [22] is briefly explained in the following subsection.

3.1. Circular Proximity Function

Circular Proximity Function (CPF) which was fully developed in our recent paper [22] is an error function which measures
the similarity of a group of points in Cartesian space to a circular curve. CPF provides an analytical tool to find the best
fitting circle for a group of discrete points in XY plane.
Consider a group of points (X1 , Y1 ), (X2 , Y2 ), , (Xn , Yn ) defined in the XY plane. Let (CX , CY ) to be the center of a
hypothetical circle with maximum proximity to the given points. The square distance between each given point (Xi , Yi ) and
(CX , CY ) can be obtained by the following equation:
Ri 2 = (CX − Xi )2 + (CY − Yi )2 (9)
The mean value of the squared distances for all given points is computed as follows:

1 2
n
R̄2 = Ri (10)
n
i=1

The Circular Proximity Function (CPF) is defined by the following equation:


n 
 2
CP F = Ri 2 − R̄2 (11)
i=1

In the case that all of the given points exactly lie on a circular curve and the point (CX , CY ) is the center of this circular
curve, the value of CPF will be equal to zero. In this way, CPF enables us to have a quantitative judgement about the
proximity of a set of points to a circular curve. The smaller the value of CPF, the given points are closer to a circular curve.
The question which arises here is that how we can find the center of the best fitting circle. In fact, the point (CX , CY ) is
still unknown and we have to specify two unknown variables CX and CY that result in the minimum value of CPF. In order
to have a better understanding of this problem, the CPF is expanded as follows:

n 
n
2

n 
n 
n 
n
CPF = CX 2 ai 2 + CY 2 bi + CX 2ai ci + CY 2bi ci + CX CY 2ai bi + ci 2 (12)
i=1 i=1 i=1 i=1 i=1 i=1

where:
2
ai = (X1 + X2 + X3 + · · · + Xn ) − 2Xi (13)
n
2
bi = (Y1 + Y2 + Y3 + · · · + Yn ) − 2Yi (14)
n

1  2 
n
ci = Xi 2 + Yi 2 − Xi + Yi 2 (15)
n
i=1

Eq. (12) can be simplified as follows:


CP F = f1CX 2 + f2CY 2 + f3CX + f4CY + f5CX CY + f6 (16)
where:

n 
n
2 
n
f1 = ai 2 , f2 = bi , f3 = 2 ai ci
i=1 i=1 i=1
n 
n 
n (17)
f4 = 2 bi ci , f5 = 2ai bi , f6 = ci 2
i=1 i=1 i=1

CPF is a two-variable function of CX and CY . In order to find the optimum point (CX , CY ) where the CPF has its minimum
value, the first derivatives with respect to CX and CY are taken and set to zero:
∂ CPF
= 2 f1CX + f5CY + f3 = 0 (18)
∂ CX
∂ CPF
= 2 f2CY + f5CX + f4 = 0 (19)
∂ CY
Eqs. (18) and (19) form an algebraic system of equations than can be solved as follows:
   −1  
CX 2 f1 f5 − f3
= (20)
CY f5 2 f2 − f4
S. Hadizadeh Kafash, A. Nahvi / Mechanism and Machine Theory 115 (2017) 18–34 23

For a two-variable function, the zero derivatives occur at the minimum, maximum, or saddle point. In [22], it was proven
that the optimum point is always a minimum. Once the minimum point is found, the value of CPF can be computed by
means of Eq. (11).
Based on our observations, we found that for the purpose of optimization it is better for the final error computed by
Eq. (11) to be dimensionless. In fact, it was observed that dimensionless CPF eventuates in better results. Therefore, the
dimensionless CPF is taken as the error function for optimization. The dimensionless CPF is expressed by the following
equation.
 2

n
Ri 2 − R̄2
CP Fdimensionless = (21)
i=1
R̄2

3.2. Objective function

As stated before, the objective function presented in this study takes four optimization variables. These four variables
form a candidate solution which is expressed as vector X:
X = [x A , y A , r 3 , β ] (22)
Considering the values of xA and yA for each candidate solution X, and by means of Eqs. (7) and (8), the dyad ABM can
be constructed which traces the desired path while the link AB has full rotation. Two other optimization variables r3 and β
define the position of point C on the plane attached to the link BM.
Now consider a path generation problem with n precision points. The set of precision points is defined by (Xdi , Ydi ) where
i = 1 : n denotes the sequence of the desired points. For a candidate solution X = [xA , yA , r3 , β ] the values of r2 and r5 is
calculated by means of Eqs. (7) and (8). Then, the trajectory of point C can be computed by the following equations:
⎛  2  2 ⎞

Ydi − yA r2 2 + Xdi − xA + Ydi − yA − r5 2
θAB
i
= arctan ± arccos ⎝  ⎠ (23)
Xdi − xA 2  2
2r2 Xdi − xA + Ydi − yA

Ydi − yA − r2 sin θAB
i
θBM
i
= arctan (24)
Xdi − xA − r2 cos θAB
i

θBC
i
= θBM
i
−β (25)

       
xCi x cos θAB
i
cos θBC
i
= A + r2 + r3 (26)
yCi yA sin θAB
i
sin θBC
i

The crucial point about Eq. (23) is the change of sign before the arccosine term. This change of sign refers to the two
different ways in which a dyad can reach to the desired point. In order to have a continuous and full rotation for the link
r2 , this sign should be changed once the dyad reaches to the farthest desired point (Rmax ) and another time when the dyad
reaches to the nearest desired point (Rmin ).
By means of Eq. (26), the trajectory of point C is obrained. Using CPF, the trajectory of point C is evaluated and the center
of the best fitting circle is determined. In practice, it is highly unlikely to find a point which traces an ideal circular curve
with CPF value equal to zero. In most cases, a point is found which traces a near-circular curve. Eq. (20) determines the
center of best fitting circle. This point is considered as the fixed pivot (point D in Fig. 2). r1 , r4 , and α are computed by the
following equations:
   
xD C
= X (27)
yD CY

r1 = (xD − xA )2 + (yD − yA )2 (28)

 2  2
1
n
r4 = xCi − xD + yCi − yD (29)
n
i=1
y − y 
α = arctan D A
(30)
xD − xA
In summary, four out of nine design variables are considered as optimization variables. The remaining design variables
including r1 , r2 , r4 , r5 , and α are computed by means of Eqs. (7), (8), and (27–30).
When all of the nine design variables are determined, constraints can be imposed. In this study, we only consider the
Grashof condition. Grashof condition states when s + l < p + q where s is the shortest link, l is the longest link, and p and q
24 S. Hadizadeh Kafash, A. Nahvi / Mechanism and Machine Theory 115 (2017) 18–34

Table 1
Coordinates of precision points for Problem 1.

Order of points 1 2 3 4 5 6 7 8 9 10

x - coordinate −24 −30 −34 −38 −36 −28 −21 −17 −8 3


y - coordinate 40 41 40 36 30 29 31 32 34 37

Order of points 11 12 13 14 15 16 17 18 19 20

x - coordinate 10 17 26 28 29 26 17 11 6 0
y - coordinate 41 41 39 33 26 23 23 24 27 31

are the two remaining links, the shortest link has full rotation [1]. As it is preferred for the input link to have full rotation,
the shortest link must be r2 . Considering these constraints, the objective function is defined as follows:
fob j = CP Fdimensionless + (s + l > p + q) × M1 + (r2 = s ) × M2 (31)
where the parenthesized terms are logical statements which can take the values of 1 (true) or 0 (false). M1 and M2 are
constants of very high values which penalize the candidate solution when the constraints are violated. In this study, the
values of M1 and M2 were set equal to 10 0 0.
In order to have a better understanding of the method presented in this paper, a flow chart is presented in Fig. 3.

4. Optimization strategy

In this paper, the method of Differential Evolution (DE) is used to perform the optimization process. DE which was
originally introduced by Storn and Price [23], has been widely used in several works including [6,8–10,13,22]. The DE was
chosen for this study because of its satisfactory performance in previous works and its straightforward algorithm.
The optimization process begins with the generation of an initial population. The initial population consists of randomly
generated individuals, each of which is a possible solution to the problem. Each individual (chromosome) in the initial
population is a vector in the form X = [xA , yA , r3 , β ] whose parameters are randomly generated within the search space.
In the next step, the best individual known as Xbest is perturbed by two randomly selected individuals Xa and Xb to form
a parent V for the reproduction stage. This perturbation is mathematically expressed as:
V = Xbest + F (Xa − Xb ) (32)
where F is the scaling factor and is set to 0.6 in this study.
In the reproduction stage, each individual Xi in the current generation is crossed with V to generate a new individual
Xinext for the next generation. The Crossover Probability (CP) is a parameter that controls the fraction of variables copied
from V to Xinext . When CP= 1, for example, the child vector Xinext inherits all of its parameters from V. On the other hand,
when CP= 0, vector Xinext inherits all of its parameters from Xi . In this research CP is set to 0.9.
As recommended in [9], in order to avoid local optimums and to find the global optimum, a mutation procedure has
been added. In this procedure, each of the genes in Xinext can be mutated with probability of MP. In this research, mutation
is carried out with a probability MP= 0.1 which is much lower than CP= 0.9.
The number of individuals in each generation NP is a control parameter which should be determined by user. NG is the
other parameter which determines the maximum number of generations the DE runs for.

5. Results

In order to examine the performance of the presented method, three example problems were solved. Problems 1 and
2 were chosen from the literature because of their relatively high number of precision points. Problem 3 is included to
demonstrate the power of this method for solving path generation problems with very high number of precision points.

5.1. Problem 1: a closed ∞ path with 20 precision points

This is a path generation problem with 20 precision points. The desired path in this problem includes a crunode and
forms a ∞ shaped curve. This problem was firstly studied by Hongying et al. [24]. The precision points of this problem are
given in Table 1.
The optimization process for this problem was carried out with NP= 200 and NG= 50. The ranges of 4 optimization
variables are defined as xA , yA ∈ [−120, 120], r3 ∈ [1120], and β ∈ [−π , +π ]. In order to investigate the robustness of the
method, the optimization process was executed for 100 times. The best result obtained by these 100 runs of DE is X =
[−75.246082, 53.622914, 119.954387, −1.129413] with the error of 0.0033.
Fig. 4 shows the distribution of the error values of the best solutions obtained during 100 runs of the DE. It can be seen
that in most cases the algorithm converged to the optimum points with the errors less than 0.0039.
The parameters of optimal linkage obtained in this study along with the optimal linkages reported in [14] and [24] are
given in Table 2.
S. Hadizadeh Kafash, A. Nahvi / Mechanism and Machine Theory 115 (2017) 18–34 25

Fig. 3. Flow chart of the method.


26 S. Hadizadeh Kafash, A. Nahvi / Mechanism and Machine Theory 115 (2017) 18–34

Fig. 4. Histogram of the best error values obtained during 100 executions of algorithm for Problem 1.

Table 2
Final solutions for Problem 1.

This study Hongying et al. [24] Lin and Hsiao [14]

NP 200 – 200
NG 50 – 20 0,0 0 0
Number of evaluations 10,0 0 0 – 40,0 0 0,0 0 0
r1 74.0261 76.77 83.6638
r2 33.3195 27.31 33.5251
r3 119.9544 46.44 120
r4 119.9647 72.55 96.8159
r5 74.5243 60.42 88.0724
β (radian) −1.1294 5.489 −1.011223
xA −75.2461 −44.87 −88.7106
yA 53.6229 71.09 57.9453
α (radian) −0.4007 5.18712 6.10457

Table 3
Coordinates of precision points for Problem 2.

Order of points 1 2 3 4 5 6 7 8 9 10 11 12 13

x - coordinate 7.03 6.95 6.77 6.40 5.91 5.43 4.93 4.67 4.38 4.04 3.76 3.76 3.76
y - coordinate 5.99 5.45 5.03 4.60 4.03 3.56 2.94 2.60 2.2 1.67 1.22 1.97 2.78

Order of points 14 14 16 16 18 19 29 21 22 23 24 25

x - coordinate 3.76 3.76 3.76 3.76 3.80 4.07 4.53 5.07 5.05 5.89 6.41 6.92
y - coordinate 3.56 4.34 4.91 5.47 5.98 6.40 6.75 6.85 6.84 6.83 6.80 6.58

Table 2 shows that the values of r2 and r3 obtained in this study are close to the values reported in [14]. However, the
remaining design variables are quite different and it is not reasonable claim that these two linkages are similar. In fact,
the optimal solution found in this study and the optimal solutions reported in [14] and [24] define three distinct optimal
linkages. The differences between the methodologies used in each study can explain this issue.
Number of evaluations which is included in Table 2 is equal to NP × NG and refers to the number of times that the
objective function has been used to evaluate candidate solutions during the optimization process. This factor can be used
to compare the computational efficiency of the presented method with previous works. Accordingly, it can be seen that the
method presented in this study is 99.975% ( 40,0400 0,0 0 0−10,0 0 0
,0 0 0,0 0 0 ) more efficient than the method presented in [14].
In Fig. 5, the optimal linkage obtained in this study is depicted. It can be seen that the optimal linkage successfully
generated the desired path.
Fig. 6 helps us to have a visual comparison between the results reported in [14] and [24] and the result obtained in
this study. All of these paths are satisfactory as they generated the desired path with acceptable approximation. However,
the coupler curves of the optimal linkage obtained in this study and the optimal linkage reported in [14] are closer to the
precision points.

5.2. Problem 2: a closed path with 25 precision points

This problem was presented by McGarva et al. [25] and was studied in [7] and [13]. The desired path in this problem
includes a cusp. The coordinates of the precision points are given in Table 3.
The optimization process for this problem was carried out with NP= 100 and NG= 50. The ranges of 4 optimization
variables are defined as xA , yA ∈ [−10, 10], r3 ∈ [1, 10], and β ∈ [−π , +π ]. The optimal solution found for this problem is X =
S. Hadizadeh Kafash, A. Nahvi / Mechanism and Machine Theory 115 (2017) 18–34 27

Fig. 5. Optimal linkage for Problem 1.

Fig. 6. Generated paths for Problem 1.

[−1.535379, −0.606131, 5.886708, −0.665359] with the error of 0.0037. It should be noted that the algorithm was executed
for 100 times and the solution reported here is the best solution obtained.
Fig. 7 shows the distribution of the error values of final solutions obtained by 100 executions of the optimization algo-
rithm. It can be seen that the best solution reported here has the highest frequency.
Using the method presented in Section 3, the design variables of the optimal linkage is computed. These parameters
along with the optimal linkages reported in literature are shown in Table 4.
The remarkable fact about Table 4 is that the optimal linkage found in this study is different from the linkages reported
in [7] and [13]. In fact, each study resulted in a distinct optimal solution. One possible explanation for this issue is that in
28 S. Hadizadeh Kafash, A. Nahvi / Mechanism and Machine Theory 115 (2017) 18–34

Fig. 7. Histogram of the best error values obtained during 100 executions of algorithm for Problem 2.

Table 4
Final solutions for Problem 2.

This study Laribi et al. [7] Bulatović et al. [13]

NP 100 100 25
NG 50 50 1500
Number of evaluations 50 0 0 50 0 0 37,500
r1 9.5962 9 9.99432
r2 2.7476 3.01 1.93027
r3 5.8867 8.8 4.57242
r4 9.9987 8.8 7.36674
r5 8.3490 11.1 8.042534
β (radian) −0.6654 5.6025 0.187430
xA −1.5354 −2.4 −2.31301
yA −0.6061 −4 2.86189
α (radian) −0.0232 0.4887 −0.61763

each study a different objective function was implemented. Laribi et al. [7] used the objective function presented by Zhou
and Cheung [15]. This objective function includes 6 optimization variables. On the other hand, Bulatović et al. [13] used the
tracking error (TE) as the objective function. TE is defined as sum of the squares of distances between the generated points
and the precision points. Different objective functions have different search spaces which can result in different optimal
solutions. It is true that the ultimate goal of these functions is to find optimal path-generator linkage. However, it should be
noted that each objective function observes the problem from a different viewpoint.
Fig. 8 depicts the optimal linkage obtained in this study and the generated path. It is evident that the optimal linkage
successfully generated the desired path.
In Fig. 9, the generated path of this study and the paths generated by optimal linkages reported in [7] and [13] are shown.
All of these paths are satisfactory as they are close enough to the precision points. However, a visual comparison reveals
that the optimal linkage reported in [13] and the optimal linkage obtained in this study are remarkable more accurate than
the optimal linkage reported in [7].
Number of evaluations reported in Table 4 also shows that from computational viewpoint, the method presented in this
paper and the method implemented in [7] is 86.6% ( 37,50 0−50 0 0
37,500 ) more efficient than the method presented in [13]. This fact
was predictable because the objective function used in [13] has 9 + 25 optimization variables while the objective functions
used in [7] and in this study include 6 and 4 optimization variables, respectively.

5.3. Problem 3: a triple loop path with 90 precision points

This problem was included to test the performance of the presented method for a complex path with high number
of precision points. This problem is designed so as to have an ideal solution. A path-generator linkage with design vari-
ables r1 = 10.4, r2 = 3.1, r3 = 5, r4 = 8.6, r5 = 6, β = 1, and xA = yA = α = 0 is selected. Then, 90 points generated by this
linkage for input angles θ2n = n × 4◦ where n = 0, 1, 2, · · · , 89 was considered as precision points. These precision points
describe a curve which crosses itself twice and forms a triple loop path. The coordinates of the precision points are given
in Table 5.
The optimization process for this problem was carried out with NP= 200 and NG= 50. The ranges of 4 opti-
mization variables are defined as xA , yA ∈ [−5, 5], r3 ∈ [1, 10], and β ∈ [−π , +π ]. The optimization resulted in X =
[0.004652, −0.048600, 5.039389, 0.99926977] with the error of 1.5066e−4. The parameters of the optimal path-generator
linkage found in this study along with the parameters of the exact solution are given in Table 6.
In Fig. 10 the histogram of best error values is displayed. It is evident that in most cases the optimization algorithm
converged to the points with the lowest values of error.
S. Hadizadeh Kafash, A. Nahvi / Mechanism and Machine Theory 115 (2017) 18–34 29

Fig. 8. Optimal linkage for Problem 2.

Table 5
Coordinates of precision points for Problem 3.

Order of points x y Order of points x y Order of points x y

1 −1.7476 3.5356 31 −0.4094 8.5753 61 −3.0386 3.1277


2 −1.6409 3.9034 32 −0.4460 8.4303 62 −3.1311 2.9461
3 −1.5302 4.2837 33 −0.4796 8.2702 63 −3.2099 2.7652
4 −1.4158 4.6713 34 −0.5092 8.0960 64 −3.2750 2.5863
5 −1.2983 5.0613 35 −0.5340 7.9088 65 −3.3265 2.4107
6 −1.1786 5.4487 36 −0.5537 7.7096 66 −3.3644 2.2398
7 −1.0583 5.8288 37 −0.5677 7.4998 67 −3.3891 2.0750
8 −0.9389 6.1974 38 −0.5762 7.2807 68 −3.4009 1.9176
9 −0.8223 6.5508 39 −0.5794 7.0539 69 −3.4004 1.7691
10 −0.7102 6.8861 40 −0.5783 6.8216 70 −3.3879 1.6309
11 −0.6045 7.2007 41 −0.5749 6.5859 71 −3.3642 1.5045
12 −0.5067 7.4930 42 −0.5721 6.3502 72 −3.3301 1.3913
13 −0.4182 7.7615 43 −0.5751 6.1183 73 −3.2861 1.2929
14 −0.3400 8.0056 44 −0.5913 5.8956 74 −3.2334 1.2107
15 −0.2728 8.2247 45 −0.6300 5.6877 75 −3.1726 1.1463
16 −0.2170 8.4186 46 −0.7003 5.4992 76 −3.1049 1.1011
17 −0.1729 8.5874 47 −0.8066 5.3313 77 −3.0311 1.0768
18 −0.1403 8.7314 48 −0.9461 5.1801 78 −2.9522 1.0747
19 −0.1188 8.8509 49 −1.1105 5.0394 79 −2.8692 1.0964
20 −0.1078 8.9463 50 −1.2908 4.9028 80 −2.7831 1.1434
21 −0.1067 9.0181 51 −1.4789 4.7658 81 −2.6946 1.2170
22 −0.1146 9.0670 52 −1.6691 4.6253 82 −2.6045 1.3184
23 −0.1304 9.0934 53 −1.8571 4.4798 83 −2.5133 1.4487
24 −0.1532 9.0979 54 −2.0399 4.3283 84 −2.4215 1.6087
25 −0.1818 9.0813 55 −2.2152 4.1707 85 −2.3291 1.7990
26 −0.2150 9.0442 56 −2.3813 4.0074 86 −2.2362 2.0195
27 −0.2517 8.9872 57 −2.5370 3.8387 87 −2.1425 2.2698
28 −0.2906 8.9110 58 −2.6813 3.6655 88 −2.0474 2.5488
29 −0.3306 8.8165 59 −2.8133 3.4886 89 −1.9503 2.8546
30 −0.3706 8.7043 60 −2.9325 3.3090 90 −1.8506 3.1846

Table 6 enables us to have a comparison between the parameters of the optimal linkage and their exact values. First
of all, it can be seen that the values of absolute errors for all nine design variables are less than 0.15. In addition, the
maximum relative error is (8.7281–8.6)/8.6 or 1.49% which is computed for r4 . Due to the fact that errors in these ranges
are reasonable for engineering purposes, it can be said that the method presented in this study found the optimal solution
successfully.
30 S. Hadizadeh Kafash, A. Nahvi / Mechanism and Machine Theory 115 (2017) 18–34

Fig. 9. Generated paths for Problem 2.

Table 6
Final solution for Problem 3.

Exact value Optimized value Absolute error

r1 10.4 10.5479 0.1479


r2 3.1 3.1092 0.0092
r3 5 5.0394 0.0394
r4 8.6 8.7281 0.1281
r5 6 6.0387 0.0387
β (radian) 1 0.9993 0.0 0 07
xA 0 0.0047 0.0047
yA 0 −0.0486 0.0486
α (radian) 0 −0.0021 0.0021
S. Hadizadeh Kafash, A. Nahvi / Mechanism and Machine Theory 115 (2017) 18–34 31

Fig. 10. Histogram of the best error values obtained during 100 executions of algorithm for Problem 3.

Fig. 11. Optimal linkage for Problem 3.

In Fig. 11, the optimal path-generator linkage is depicted. Precision points are shown with red circles and the generated
path is shown by blue line. It can be seen that the optimal linkage generated the desired path with reasonable accuracy.
This problem is very important for us because it has a relatively high number of precision points. In addition, the path
described by these points is not a simple path. The desired path in this problem crosses itself twice which increases its
complexity and causes the synthesis problem to be very challenging. The successful synthesis of a path-generator linkage
for this problem demonstrates the efficacy of the proposed method.

6. Conclusion

In this paper, the optimal synthesis of path-generator four-bar linkages was investigated. The main idea of this paper is
to find a point on the coupler plane which traces a near-circular curve. This point is then selected as the moving joint of
the path-generator linkage. An unlimited number of points can be defined on the coupler plane and each of these points
traces a different path. In order to find a path which is similar to a circular curve, the CPF is implemented. The CPF is a
mathematical tool which can provide a quantitative judgment about the similarity of a curve to a circle. With the help of
the CPF, a new objective function is introduced for the optimal synthesis of path-generator linkages. The proposed objective
function has the lowest number of optimization variables in comparison with other objective functions introduced so far.
The objective function presented in this study has two remarkable advantages. First of all, this objective function has
the lowest number of optimization variables. While a path-generator four-bar linkage is defined by nine independent design
variables, it was demonstrated that the optimization of path-generator four-bar linkage can be done with only four optimiza-
tion variables. The complete set of design variables required to fully define a path-generator linkage is then extracted from
these four optimization variables. Secondly, the number of optimization variables is independent of the number of precision
points. Therefore, when the number of precision points is increased, the dimension of search space remains constant.
32 S. Hadizadeh Kafash, A. Nahvi / Mechanism and Machine Theory 115 (2017) 18–34

Three example problems were solved in this paper which resulted in the synthesis of crank-rocker linkages. It has been
shown that for all three case studies the optimization algorithm has converged to the solutions with reasonable accuracies.
Figs. 4, 7 and 10 also show the range and the frequency of error values obtained during 100 executions of the algorithm
for each problem. The remarkable fact about these histograms is that the lowest error values have the maximum frequency.
Therefore, the robustness of the presented method is guaranteed.
A comparison based on the number of evaluations also shows that the method presented in this paper is more efficient
in terms of computational cost. For Problems 1 and 2, it has been shown that the method implemented in this paper was
more efficient in comparison with previous works.
Future research can be devoted to the adaptation of the proposed method to the synthesis of other types of linkages
such as slider-crank mechanisms and six-bar linkages. In addition, a comparative study should be conducted to investigate
the performance of different objective functions presented so far. The comparison among different objective functions makes
sense when all of these objective functions are tested under equal conditions with the same evolutionary algorithm.

Appendix: MATLAB codes

The code written in MATLAB for CPF is presented in the following lines. This MATLAB function takes the coordinates of
a set of discrete points as input and gives the dimensionless error value stated by Eq. (21) as output. This function also
computes the coordinates of center and the radius of best fitting circle.
function [error,circle] = CPF(x,y)
n=numel(x);
a=zeros(1,n);
b=zeros(1,n);
c=zeros(1,n);
for i=1:n
a(i)=(2/n)∗ sum(x)-2∗ x(i);
b(i)=(2/n)∗ sum(y)-2∗ y(i);
c(i)=x(i)^2+y(i)^2-(1/n)∗ sum(x.^2+y.^2);
end
f1=sum(a.^2);
f2=sum(b.^2);
f3=sum(2∗ a.∗ c);
f4=sum(2∗ b.∗ c);
f5=sum(2∗ a.∗ b);
C=[2∗ f1,f5;f5,2∗ f2]^-1∗ [-f3;-f4];
Cx=C(1); % x-coordinate of center point
Cy=C(2); % y-coordinate of center point
R2=zeros(1,n);
for i=1:n
R2(i)=(x(i)-Cx)^2+(y(i)-Cy)^2;
end
error=sum(((R2-mean(R2))/mean(R2)).^2); %dimensionless error
R=mean(sqrt(R2)); % the radius of best fitting circle
circle=[Cx Cy R];
In the following lines, you can find the codes written in MATLAB for the objective function used in this paper. This
function takes four optimization variable as vector X = [xA , yA , r3 , β ] and the coordinates of precision points as Xd and Yd .
This MATLAB function gives the error value of candidate solution as output. This function also provides the complete set of
nine design variables of the linkage.
function [error,linkage] = objfun(X,Xd,Yd)
xA=X(1);
yA=X(2);
r3=X(3);
beta=X(4);
n=numel(Xd);
R=zeros(1,n);
for i=1:n
R(i)=sqrt((Xd(i)-xA)^2+(Yd(i)-yA)^2);
end
[Rmax,max_index]=max(R);
[Rmin,min_index]=min(R);
if inpolygon(xA,yA,Xd,Yd)
r2=(Rmax+Rmin)/2;
S. Hadizadeh Kafash, A. Nahvi / Mechanism and Machine Theory 115 (2017) 18–34 33

r5=(Rmax-Rmin)/2;
else
r2=(Rmax-Rmin)/2;
r5=(Rmax+Rmin)/2;
end
xC1=zeros(1,n); % x-coordinate of point C in trajectory 01
yC1=zeros(1,n); % y-coordinate of point C in trajectory 01
xC2=zeros(1,n); % x-coordinate of point C in trajectory 02
yC2=zeros(1,n); % y-coordinate of point C in trajectory 02
for i=1:n
if (i<max_index && i>min_index) || (i>max_index && i<min_index)
% trajectory 01
theta2m1=atan2(Yd(i)-yA,Xd(i)-xA)+acos((r2^2+R(i)^2-r5^2)/(2∗ r2∗ R(i)));
theta5m1=atan2(Yd(i)-yA-r2∗ sin(theta2m1),Xd(i)-xA-r2∗ cos(theta2m1));
theta3m1=theta5m1-beta;
xC1(i)=xA+r2∗ cos(theta2m1)+r3∗ cos(theta3m1);
yC1(i)=yA+r2∗ sin(theta2m1)+r3∗ sin(theta3m1);
% trajectory 02
theta2m2=atan2(Yd(i)-yA,Xd(i)-xA)-acos((r2^2+R(i)^2-r5^2)/(2∗ r2∗ R(i)));
theta5m2=atan2(Yd(i)-yA-r2∗ sin(theta2m2),Xd(i)-xA-r2∗ cos(theta2m2));
theta3m2=theta5m2-beta;
xC2(i)=xA+r2∗ cos(theta2m2)+r3∗ cos(theta3m2);
yC2(i)=yA+r2∗ sin(theta2m2)+r3∗ sin(theta3m2);
elseif i==max_index
theta2=atan2(Yd(i)-yA,Xd(i)-xA);
theta5=theta2;
theta3=theta5-beta;
xC1(i)=xA+r2∗ cos(theta2)+r3∗ cos(theta3);
yC1(i)=yA+r2∗ sin(theta2)+r3∗ sin(theta3);
xC2(i)=xC1(i);
yC2(i)=yC1(i);
elseif i==min_index
if inpolygon(xA,yA,Xd,Yd)
theta2=atan2(Yd(i)-yA,Xd(i)-xA);
theta5=pi+theta2;
theta3=theta5-beta;
xC1(i)=xA+r2∗ cos(theta2)+r3∗ cos(theta3);
yC1(i)=yA+r2∗ sin(theta2)+r3∗ sin(theta3);
xC2(i)=xC1(i);
yC2(i)=yC1(i);
else
theta2=pi+atan2(Yd(i)-yA,Xd(i)-xA);
theta5=atan2(Yd(i)-yA,Xd(i)-xA);
theta3=theta5-beta;
xC1(i)=xA+r2∗ cos(theta2)+r3∗ cos(theta3);
yC1(i)=yA+r2∗ sin(theta2)+r3∗ sin(theta3);
xC2(i)=xC1(i);
yC2(i)=yC1(i);
end
else
% trajectory 02
theta2m1=atan2(Yd(i)-yA,Xd(i)-xA)+acos((r2^2+R(i)^2-r5^2)/(2∗ r2∗ R(i)));
theta5m1=atan2(Yd(i)-yA-r2∗ sin(theta2m1),Xd(i)-xA-r2∗ cos(theta2m1));
theta3m1=theta5m1-beta;
xC2(i)=xA+r2∗ cos(theta2m1)+r3∗ cos(theta3m1);
yC2(i)=yA+r2∗ sin(theta2m1)+r3∗ sin(theta3m1);
% trajectory 01
theta2m2=atan2(Yd(i)-yA,Xd(i)-xA)-acos((r2^2+R(i)^2-r5^2)/(2∗ r2∗ R(i)));
theta5m2=atan2(Yd(i)-yA-r2∗ sin(theta2m2),Xd(i)-xA-r2∗ cos(theta2m2));
theta3m2=theta5m2-beta;
xC1(i)=xA+r2∗ cos(theta2m2)+r3∗ cos(theta3m2);
34 S. Hadizadeh Kafash, A. Nahvi / Mechanism and Machine Theory 115 (2017) 18–34

yC1(i)=yA+r2∗ sin(theta2m2)+r3∗ sin(theta3m2);


end
end
[C1CPF,circle1]=CPF(xC1,yC1); %CPF error for trajectory 01
[C2CPF,circle2]=CPF(xC2,yC2); %CPF error for trajectory 02
[error,index]=min([C1CPF,C2CPF]);
if index==1 % if trajectory 01 is more similar to a circular curve
xD=circle1(1);
yD=circle1(2);
r1=sqrt((xA-xD)^2+(yA-yD)^2);
r4=circle1(3);
alpha=atan2(yD-yA,xD-xA);
else % if trajectory 02 is more similar to a circular curve
xD=circle2(1);
yD=circle2(2);
r1=sqrt((xA-xD)^2+(yA-yD)^2);
r4=circle2(3);
alpha=atan2(yD-yA,xD-xA);
end
linkage=[r1,r2,r3,r4,r5,beta,xA,yA,alpha];
s=min(linkage(1:4));
l=max(linkage(1:4));
pq=sum(linkage(1:4))-(s+l);
error=error+(s+l>=pq)∗ 1000+(linkage(2)∼=s)∗ 1000;
References

[1] R.L. Norton, Design of Machinery-An Introduction to the Synthesis and Analysis of Mechanisms and Machines, 2004.
[2] G. Sandor, A. Erdman, Advanced Mechanism Design: Analysis and Synthesis, 2, Prentice-Hall, Englewood Cliffs, New Jersey, 1984.
[3] A.J. Sommese, Complete solution of the nine-point path synthesis problem for four-bar linkages, J. Mech. Des. 114 (1992) 153.
[4] W.E. Fang, Simultaneous type and dimensional synthesis of mechanisms by genetic algorithms, Mech. Synth. Anal. 70 (1994) 35–41.
[5] G.P. Roston, R.H. Sturges, Genetic algorithm synthesis of four-bar mechanisms, Artif. Intell. Eng. Des. Anal. Manuf. 10 (1996) 371–390.
[6] S.K. Acharyya, M. Mandal, Performance of EAs for four-bar linkage synthesis, Mech. Mach. Theory 44 (2009) 1784–1794.
[7] M.A. Laribi, A. Mlika, L. Romdhane, S. Zeghloul, A combined genetic algorithm–fuzzy logic method (GA–FL) in mechanisms synthesis, Mech. Mach.
Theory 39 (2004) 717–735.
[8] W.-Y. Lin, A GA–DE hybrid evolutionary algorithm for path synthesis of four-bar linkage, Mech. Mach. Theory 45 (2010) 1096–1107.
[9] J.A. Cabrera, A. Ortiz, F. Nadal, J.J. Castillo, An evolutionary algorithm for path synthesis of mechanisms, Mech. Mach. Theory 46 (2011) 127–141.
[10] A. Ortiz, J.A. Cabrera, F. Nadal, A. Bonilla, Dimensional synthesis of mechanisms using Differential Evolution with auto-adaptive control parameters,
Mech. Mach. Theory 64 (2013) 210–229.
[11] S. Ebrahimi, P. Payvandy, Efficient constrained synthesis of path generating four-bar mechanisms based on the heuristic optimization algorithms, Mech.
Mach. Theory 85 (2015) 189–204.
[12] A. Sedano, R. Sancibrian, A. de Juan, F. Viadero, F. Egana, Hybrid optimization approach for the design of mechanisms using a new error estimator,
Math. Probl. Eng. 151590 (2012).
[13] R.R. Bulatović, G. Miodragović, M.S. Bošković, Modified Krill Herd (MKH) algorithm and its application in dimensional synthesis of a four-bar linkage,
Mech. Mach. Theory 95 (2016) 1–21.
[14] W.Y. Lin, K.M. Hsiao, A new differential evolution algorithm with a combined mutation strategy for optimum synthesis of path-generating four-bar
mechanisms, Proc. Inst. Mech. Eng. Part C (2016) 0954406216638887.
[15] H. Zhou, E.H.M. Cheung, Optimal synthesis of crank–rocker linkages for path generation using the orientation structural error of the fixed link, Mech.
Mach. Theory 36 (2001) 973–982.
[16] I. Ullah, S. Kota, Optimal synthesis of mechanism for path generation using Fourier descriptors and global search methods, J. Mech. Des. 119 (4) (1997)
504–510.
[17] I. Fernández-Bustos, J. Aguirrebeitia, R. Avilés, C. Angulo, Kinematical synthesis of 1-dof mechanisms using finite elements and genetic algorithms,
Finite Elem. Anal. Des. 41 (2005) 1441–1463.
[18] S.B. Matekar, G.R. Gogate, Optimum synthesis of path generating four-bar mechanisms using differential evolution and a modified error function,
Mech. Mach. Theory 52 (2012) 158–179.
[19] B.S. Kim, H.H. Yoo, Unified mechanism synthesis method of a planar four-bar linkage for path generation employing a spring-connected arbitrarily
sized rectangular block model, Multibody Syst. Dyn. 31 (2014) 241–256.
[20] J. Buśkiewicz, A method for optimal path synthesis of four-link planar mechanisms, Inverse Probl. Sci. Eng. 23 (2015) 818–850.
[21] J.-W. Kim, T. Seo, J. Kim, A new design methodology for four-bar linkage mechanisms based on derivations of coupler curve, Mech. Mach. Theory 100
(2016) 138–154.
[22] S.H. Kafash, A. Nahvi, Optimal synthesis of four-bar motion generator linkages using circular proximity function, Proc. Inst. Mech. Eng. Part C (2017)
892–908.
[23] R. Storn, K. Price, Differential evolution–a simple and efficient heuristic for global optimization over continuous spaces, J. Global Optim. 11 (1997)
341–359.
[24] Y. Hongying, T. Dewei, W. Zhixing, Study on a new computer path synthesis method of a four-bar linkage, Mech. Mach. Theory 42 (2007) 383–392.
[25] J.R. McGarva, Rapid search and selection of path generating mechanisms from a library, Mech. Mach. Theory 29 (1994) 223–235.

You might also like