Optimal synthesis of crank-rocker mechanisms with optimum transmission angle for desired stroke and time-ratio using genetic programming

Dimensional synthesis of crank-rocker mechanisms applied to provide some desired values of stroke and time ratio, is of utmost importance for designing an efficient mechanism. In the synthesis and manufacturing of crank-rocker mechanisms, the designers are further challenged by other design criteria, such as quality of motion. In this study, a novel approach based on genetic programming (GP) is proposed for dimensional synthesis of planar crank-rocker mechanisms with optimum transmission angle over the desired stroke and time-ratio. An analytical approach is elaborated which leads to an interesting relationship of length of the coupler and rocker links. It is, therefore, advised that by adopting equal lengths for coupler link and rocker link, one can guarantee the optimality of the transmission angle’s deviation ( TA ), ensuring the Grashof condition. Consequently, through an inverse modeling approach, GP method is utilized to construct some explicitly mathematical formulas to represent all the sizes and dimensions of the crank-rocker mechanism based on the any desired values of both stroke and time-ratio. In this way, an input-output data set consisting of all the dimensions and the sizes of the links as the input variables and both the stroke and time-ratio as output variables is first constructed using the pertinent mathematical equations. Indeed, such approach of inverse modeling using GP simplifies greatly the synthesis of the crack-rocker mechanisms for any desired values of both stroke and time-ratio. The proposed approach has been applied for kinematic synthesis of a crank-rocker mechanism. A comparison between the obtained results of this work and the analytic method, clearly illustrates the efficiency of the proposed approach.


Introduction
Mechanisms as basic components of machines are widely used in a widening area of engineering and scientific domains. The synthesis of a mechanism is the study of procedures of combining parametric members whose combination provides some desired behaviors. 1 Dimensional synthesis, as a kind of inverse problem, is concerned with evaluation of geometrical sizes of mechanisms. Dimensional syntheses of crank-rocker mechanisms to provide some desired values of stroke and time-ratio, have been sort of challenging problems in the case of planar mechanisms. However, in the synthesis and manufacturing of crank-rocker mechanisms, the designers are challenged by some other design criteria, for example, quality of motion. Addressing this issue is very important to design an efficient mechanism. 2 The quality of motion is measured by transmission angle's deviation from ideal value of 900. 3 Generally, synthesis of the crank-rocker mechanisms has been addressed during the last decades. In earlier studies, Joe Brodell and Soni 4 introduced a design chart obtained from an analytical approach to synthesize the crank-rocker mechanism with good quality of motion and unit time-ratio. Balaji Rao and Lakshminarayana 5 presented the optimal synthesis of RSSR crank-rocker mechanisms for different combinations of oscillation angle, time-ratio, and axis angle. The authors in 6 suggested a synthesis procedure which satisfies a prescribed stroke and time-ratio wherein the required definite objective function is optimized. Soylu, 7 investigated a synthesis procedure for the planar mechanism in which the maximum deviation of transmission angle is constrained to be less than a certain desired limit. The graphical and analytical approaches associated with design charts considering some performance criteria, such as stroke, transmission angle, and time-ratio was addressed in Lun and Leu. 8 Balli and Chand 3 investigated the transmission angle's influence on the different parameters of a mechanism, for example, friction, mechanical advantage, pressure angle, transmission force, input crank angle, tolerance, and the performance sensitivity. The authors also studied the various mechanism's defects, such as branching, order, circuit, and poor transmission angle in Balli and Chand. 9 Eren and Aydemir 10 introduced a kinematic synthesis scheme for the synthesis of four-bar sley drive linkages. The authors considered the transmission angle, the stroke, and the time-ratio as the parameters affecting the sley trajectory. Hassaan et al. 11 used Powell's optimization method for optimal design of crank-rocker linkages for a given stroke and time-ratio. Khader 12 proposed the design nomograms for directly designing the crank-rocker mechanism links' ratios with a definite determined transmission angle limit. Rufino and Ferreira 13 described a variable stroke mechanism and presented a kinematic model to determine the requirements for synthesis of the mechanism. El-Shakeryet al. 14 suggested both analytical and graphical methodologies to optimally determine links' lengths of crank-rocker four-bar linkage to obtain a targeted design with definite transmission angle. Yildiz 15 addressed the structural design optimization of a four-bar linkage for a trunk lid of a sedan type passenger car, incorporating three different population-based optimization techniques. The authors in Refs. 2,16,17 used game theory to present a framework for multi-objective optimal synthesis of four-bar mechanisms for path-generating applications. It should be mentioned that the performance criteria stroke and time-ratio were not taken into account by authors. However, many research works have been devoted to the optimal synthesis of path-generating four-bar mechanism using suitable optimization schemes and computational intelligence techniques. 2,[17][18][19][20][21][22][23][24] Modeling and identification of data driven systems have always been of a great interest for research workers and have become a new topic of research in a broad range area in engineering science. [25][26][27][28][29][30][31] Generally, an exactly mathematical relationship between inputoutput data is needed to model as well as to predict the data-driven system, precisely. However, obtaining such mathematical modeling is so cumbersome and even is not possible in poorly identified systems. Recently, some deep learning algorithms as a part of a broader category of machine learning schemes in conjunction with evolutionary algorithms have drawn considerable attention in computation of imprecisely complex environments. In evolutionary algorithms (EAs), genetic programming is defined as an extension to genetic algorithms (GAs) in which the structures undergoing adaptation are not strings but are hierarchical computer programs of dynamically varying shape and size. Recent research works that set the stage for current GP research topics and applications is various, and includes topology optimization of structures, 32,33 optimal modeling of complex systems, 34 controller design, 35 image processing, 36 object detection, 37 data mining, 38 control of robots, 39 and so on.
The available kinematic design methods in mechanism literature calculate the link lengths of a crank rocker mechanism according to minimum transmission angle criteria as a design constraint. On the other hand, as the occurrence of failure of Grashof condition is catastrophic in a four-bar mechanism, guaranteeing Grashof constraint feasibility is of the most importance at both the synthesis stage and the manufacturing process. As far as the authors know, there is no design approach in the literature for a crank-rocker mechanism to determine the link lengths of the mechanism analytically, taking into account the deviation of transmission angle from ideal value as an objective function and guaranteeing the Grashof condition, simultaneously. Moreover, there is still a clear gap in development and implementing meta-heuristic approaches to generate the structural descriptions of mechanisms.
This study tries to overcome these shortcomings by incorporating GP meta-modeling and inverse modeling approaches to solve the optimization problems arising in kinematic synthesis of crank-rocker mechanisms. The objective of the optimization problem is defined as to design a mechanism that has a pre-determined value for stroke and time ratio and simultaneously guarantees the optimality of the motion quality and Grashof condition as well . In this regard, the lengths of the mechanism links are considered as design variables. It is, analytically, advised that keeping equal the length of rocker link and connecting rod link would automatically satisfy the optimality of the transmission angle's deviation. Then, for each mechanism, the stroke and the time ratio are geometrically obtained as a function of the lengths of the mechanism links. In order to apply GP method for the inverse modeling purpose, some input-output data are constructed based on stroke and time ratio as functions of sizes and lengths of the crank-rocker mechanism. Finally, with the use of the GP, the optimal mathematical model for each design variables are obtained as the functions of both stroke and time ratio.
It is shown that the GP model can successfully find almost simple and easy to use mathematical relations of mechanism's links needed to synthesize the mechanism with the best quality of motion for any desired values of both stroke and time ratio simultaneously. In fact, the proposed mathematical forms presented in this study, provide the capability to synthesize the length of mechanism's links for any desired value of stroke and time ratio within the estimated ranges. Moreover, such novel application of the proposed approach of the optimum synthesis of crank-rocker mechanisms leads to a very interesting relationship of length of mechanism's link. It is advised that keeping equal the length of rocker link and connecting rod link would automatically satisfy the optimality of the transmission angle's deviation. The proposed approach has been applied for kinematic synthesis of a four-bar crank-rocker mechanism. A comparison between the obtained results of this work and the analytical method, clearly illustrates the efficiency of the proposed method.

Methodology
In this section, a general algorithm for the optimally synthesis of mechanisms has been presented by using genetic programming method. The proposed algorithm has been summarized in Figure 1. The objective of the optimization problem is defined as to design a mechanism that has some desired performance criteria. Generally, the lengths of the mechanism links are considered as design variables, that is, output variables. For each mechanism, the performance criteria, that is, input variables are geometrically obtained as a function of the lengths of the mechanism links. Then, in order to apply genetic programming method for the inverse modeling purpose, some input-output data are constructed based on the performance criteria as functions of sizes and lengths of the mechanism. Finally, with the use of the GP the optimal mathematical model for each design variable are obtained as the functions of performance criteria. The following case study illustrate how the proposed approach depicted in Figure 1 can be used to improve the overall design of a four-bar crankrocker mechanism for any desired stroke and time-ratio while optimizing transmission angle' deviation.

Crank-rocker mechanism: A case study
The four-bar mechanism is the simplest and the most popular linkages, which consists of three movable links and a fixed link. A crank-rocker is a type of four-bar mechanism which is widely used for converting continuous rotary motion to oscillatory motion with a quick return feature. A four-bar linkage is called a crankrocker when the shortest link is connected to the ground link. As illustrated in Figure 2, r 1 is the reference bar, r 2 is the input link with rotatory motion which is called crank, r 3 is a connecting rod link, and r 4 is the output link which is called rocker and oscillates between two limiting angles. Angles u 3 , u 4 , and g represent the interior joint angles and obtained as follows for a certain crank angle (u 2 ) as follows In this study, the stroke, time-ratio, and transmission angle's deviation (TA) are considered as performance criteria in the synthesis of mechanism. The stroke of a crank-rocker mechanism is the angle range that rocker oscillates and time ratio is a measure of its quick return feature. Figure 3 shows a planar four-bar crank-rocker mechanism at its limiting situations. According to Figure 3 and by using cosine law, the stroke and time-ratio of the mechanism are kinematically computed as a function of four parameters, that is, the length of the mechanism's links. The parameters b 1 , b 2 , a 1 , and a 2 are defined as follows The stroke and time ratio are then calculated using equations (6) and (7), respectively.
in which b = p À a, and a = a 1 À a 2 : The transmission angle' deviation is formulated as According to equation (8), TA is to minimize the deviation of the transmission angle from 90°. Figure 4 illustrates the minimum and maximum values of transmission angles which can be obtained by equation (9) g min = cos À1 r 3 2 + r 4 2 À (r 1 À r 2 ) 2   where, g refers to transmission angle of mechanism. In order to allow for the complete turn of the input link, the Grashof condition should be satisfied as an inequality constraint during the synthesis process. Grashof condition for a four-bar crank-rocker is defined as where, r min and r max are the lengths of minimum and maximum links and r a and r b are the lengths of two other links.

Optimization of transmission angle
In the synthesis and manufacturing of mechanisms, design engineers usually are faced quality of motion. Addressing this important issue is essential to synthesize an accurate, efficient, and reliable mechanism that functions satisfactorily during its period of service. The transmission angle of mechanism employed as a measure of the quality of force transmission of the mechanism. For instance, it helps to decide the ''Best'' among a family of possible mechanisms for most effective force transmission.
In this section, an analytical approach adopted from Ahmadi et al. 24 is given to obtain an explicitly mathematical equation which guarantees the optimality of the transmission angle's deviation and also ensures the Grashof condition.
In this way, equation (8) can be rewritten using equation (9) as follows, In order to obtain a relationship between r 3 and r 4 which leads to optimality of TA, one can set the gradient vector of equation (11) to zero with respect to r 3 and r 4 , that is, The necessary conditions of equation (12) is transferred to equation (14) using some algebraic manipulation as Evidently, both a and b in equation (13) cannot be equal to zero at the same time. Moreover, the sum of a + b ð Þin equation (14b) cannot be zero. By this way, the set of solution is obtained as an feasible solution of RRS as r 3 = r 4 .

Results and discussion
As shown in Table 1, the sample points include two inputs (S, TR) and three independent outputs (r 1 , r 2 , r 3 ) which are considered as the input-output data pairs for GP algorithm. Subsequently, GP takes S and TR as input variables to generate mathematical functions and to fit as accurately as possible for each link's length of r 1 , r 2 and r 3 . It should be mentioned that the variations of two input parameters are set to 20 8 ł S ł 55 8 and 1:05 ł TR ł 1:2. The input samples are depicted in Figure 5. Moreover, the limits of link lengths are considered as: The main advantage of GP for the modeling process is its ability to produce models that build an understandable structure, that is, a formula or equation relating input and output variables, which might shed engineering insight into the processes involved. 40 Thus, for mechanism synthesis instances, GP may offer advantages over other techniques since GP can self-modify, through the genetic loop, a population of function trees in order to finally generate an optimal and physically interpretable model. Specifically, a comparative analysis of GP and multi-layer perceptron artificial neural network (MLP-ANN) for metamodeling of the sample points is provided in Table 2. The results show that across all three systems GP provided greater training and prediction capability. The close proximity of training and prediction performance of GP implies relatively greater resistance to overfitting. The analysis of computational effort by GP and MLP-ANN reveals that GP requires a greater amount of computing time. However, this increased cost of fitting a GP metamodel may not be significant when the data is computationally expensive. 41 Furthermore, GP produces explicit functions in contrast with the models generated by other nonparametric approaches, such as MLP-ANN.
In order to succeed the inverse modeling procedure, the GP algorithm is deployed as a surrogate model. The GP algorithm utilizes computer programs as individuals of its population and models them with a tree structure. 33 More complete details on genetic programming and its terminology is presented in Refs. 30  In the optimization process, the inverse modeling error is evolutionarily minimized as the fitness function which is expressed as follows in which, r m represents the length obtain from GP's models and r d stands for the desired length of links. To construct the GP-type meta-model, 35 input-output data sets (Table 1) have been generated by equations (6) and (7) under above-mentioned constraints. Table 3 lists the determined parameters to control the genetic programming performance in this study. It should be mentioned that, the control parameters are adjusted experimentally. According to Table 3, the initial population in GP execution consists of 100 individuals generated by ramped half and half method with the maximum depth of trees as 7. In the last generation, there are 100 mathematical models with different levels of accuracy and complexity for each normalized length. The best model related to the fitness function considered as the final solution to the problem.
The corresponding mathematical expressions of such GP-type models for optimum r 1 , r 2 , r 3 are given by equation (19). In order to examine the efficiency of GP, the output of such non-linear meta-models is shown in Figures 6 to 8 for r 1 , r 2 , and r 3 , respectively. As it can be seen, the suggested GP models impressively provide high correlation coefficients. These mathematical models enable designers to synthesize a crank-rocker mechanism for any desired pre-determined value of stroke and time ratio.
The proposed method is now applied effectively to the optimal synthesis of a four-bar mechanism. It is desired to synthesize a crank-rocker four-bar mechanism to provide a stroke of S = 32°(0.558 rad) and TR = 1.06 with the best possible value of quality of motion. Table 4 provides the performance comparison of the synthesized mechanism using the obtained equation (19) of this paper for the given stroke and time ratio with that of analytic method. It should be mentioned that, in analytic method, the optimal values of r 1 , r 2 , r 3 , and r 4 are directly calculated by equations (6) and (7) for any desired values of S and TR. Figure 9 depicts the rocker displacement for mechanism obtained by this work and the analytic method.
The ideal value of transmission angle is 90°in order to provide the best possible quality of force transmission at the joint. That is why most mechanism designers try to keep the minimum transmission angle' deviation above a specified value to promote smooth running and good force transmission. Generally, to obtain a good quality of motion, it is recommended in the literature, for example, that the maximum deviation of the transmission angle from 90 8 should be less than 45 8 . 1 The constraint limits on the minimum and maximum values of transmission angles are considered as It should be noted that, for a Grashof four-bar mechanism the transmission angle can generally vary from 0°t o 90°. In the other hand, for a non-Grashof linkage the transmission angle will be 0°in the toggle positions which occur when the output rocker and the coupler are colinear. 1 However, the equation (15) obtained from the proposed approach would automatically guarantees the optimality of the motion quality and also ensures the Grashof condition, that is, the transmission angle will not be 0°or 180°. The values of TA over the entire range of motion for the mechanism is also shown in Figure 10. It is evident from Figure 10 that the synthesized mechanism keeps the transmission angle within the recommended range while simultaneously improve the overall design of four-bar mechanism to met the desired stroke and time-ratio. More importantly, it should be mentioned now that the genetically obtained synthesis equations of this paper can now be readily employed for the design of any crankrocker mechanism used in real-world practical applications such as the sley drive of weaving machines, 10 the mixer mechanism, 42 the shaper linkage, 43 windshield wiper mechanism, 44 the continuously variable transmission (CVT) system, 45 etc. For instance, the application of the proposed approach for the design of four-bar linkage sley drive mechanisms is elaborated. The minimum transmission angle' deviation, the stroke, and the time ratio are the parameters affecting the sley motion curve. The optimum values of these parameters should be used by taking into account the desired sley motion on the one   hand and dynamics of the mechanism on the other hand. Once the required sley motion curve is determined from the shed geometry of a weaving machine, the kinematic design approach introduced in the proposed methodology can be used to optimize a four-bar sley drive mechanism with the best quality of motion.

Conclusion
In this paper, by using genetic programming, a unified approach for optimal syntheses of four-bar crankrocker mechanisms was proposed so that any desired values of both stroke and time-ratio are achieved wherein the optimality of the transmission angle deviation as well as Grashof condition is guaranteed analytically. It was proved that keeping equal the length of connecting rod link and rocker link would guarantee the optimality of the transmission angle deviation and also ensures the Grashof condition. In this way, the length of three links, namely, reference bar, crank, and connecting rod was considered as design variables. A complete set of input-output data was obtained by considering the pertinent mechanism's geometry relations and constraints. It is shown that GP can successfully find almost simple and easy to use mathematical relations of design variables needed to synthesize the mechanism for desired values of both stroke and timeratio simultaneously. In fact, the proposed mathematical forms presented in this paper, provide the capability to synthesize the length of mechanism's links for any desired value of stroke and time-ratio with optimum transmission angle. Further considerations are suggested to conduct as future works: -In the case of this study, the dynamic considerations have not been taken into account. However, the future works may consider several dynamic performance criteria such as maximum values of the ground bearing forces during one input crank revolution, maximum required value of driving torque, maximum shaking force/moment, etc. -The present study addressed the problem of dimensional synthesis of planar linkages in a deterministic environment, that is, the dimensional tolerance and joint clearance were not considered. However, in real world applications, the dimensional tolerance and joint clearance are investable in the stages of manufacturing and assembling. Certainly, any experimental attempt is required to hire some robust design approaches and uncertainty analysis which can be done as future research. -Further possible future research avenues are to introduce advances from the GP literature to further improve the generalization ability and also to investigate the capability of the other methods of artificial intelligence in metamodeling of mechanism synthesis applications.

Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.

Funding
The author(s) received no financial support for the research, authorship, and/or publication of this article.