Shape optimization for path synthesis of crank-rocker mechanisms using a wavelet-based neural network

Shape optimization for path synthesis of crank-rocker mechanisms using a wavelet-based neural network

Mechanism and Machine Theory 44 (2009) 1132–1143 Contents lists available at ScienceDirect Mechanism and Machine Theory journal homepage: www.elsevi...

595KB Sizes 0 Downloads 5 Views

Mechanism and Machine Theory 44 (2009) 1132–1143

Contents lists available at ScienceDirect

Mechanism and Machine Theory journal homepage: www.elsevier.com/locate/mechmt

Shape optimization for path synthesis of crank-rocker mechanisms using a wavelet-based neural network Gloria Galán-Marín *, Francisco J. Alonso, José M. Del Castillo Department of Mechanical, Energetic and Materials Engineering, University of Extremadura, Avda. de Elvas s/n, 06071, Badajoz, Spain

a r t i c l e

i n f o

Article history: Received 21 August 2007 Received in revised form 11 September 2008 Accepted 12 September 2008 Available online 26 October 2008

Keywords: Synthesis of mechanisms Path generation Wavelets Neural networks Grashof condition Transmission angle

a b s t r a c t Some recent developments in path generation have been based on neural network mechanism databases, which instantaneously provide an approximate solution of the synthesis problem. We describe a way to reduce the design space, ensuring that the neural network always yields a consistent crank-rocker mechanism with optimal transmission angle. Moreover, instead of the usual strategy of using Fourier coefficients, we propose a new method based on wavelet descriptors to represent the shape of the path, where the points do not need to be sampled at a constant time interval. Numerical results demonstrate the superiority of this wavelet-based neural network over the Fourier-based network in finding the optimal mechanism. They also show the accuracy of the proposed approach in providing near optimal crank-rocker mechanism solutions for path generation. Ó 2008 Elsevier Ltd. All rights reserved.

1. Introduction The dimensional synthesis of path generating mechanisms requires determining the linkage dimensions so that a point on the coupler link traces out the desired trajectory. The typical choice is a four-bar linkage. Some recent approaches have applied intelligent optimization techniques such as tabu-search, genetic algorithms, or ant systems, sometimes in combination with gradient or fuzzy-logic methods [1–4]. Usually, these methods are based on determining the position of the input element for each target point. If the function one is really seeking, however, is the shape of the path, these are poorly suited methods because they reduce the quality of the functional specification to a limited list of points. Other recent approaches apply objective functions that compare only the shape of two plane curves [5–10]. These methods split the optimization procedure into two independent sets of tasks – dimensional optimization and location/orientation/size optimization. The size problem can be solved by scaling the generated path to have the same length as the required path, and the location and orientation problem can be easily solved by minimizing the structural error [11], or by using superposition techniques from pattern recognition [10] where the solution is unique and no iterative optimization is needed. The most recent approach to shape optimization for path synthesis has been presented by Smaili and Diab [5] through a two-phase process. The first phase focuses on curve shape optimization and is based on the proposed cyclic angular deviation vector associated with a set of desired points of the curve. In the second phase, a purely mathematical procedure is applied to scale, rotate and translate the mechanism. The difficulty therefore lies in finding a mechanism that meets the shape specifications of the curve, so that it is important to focus on the shape specifications before tackling any others.

* Corresponding author. Tel.: +34 924289600x6737; fax: +34 924289601. E-mail address: [email protected] (G. Galán-Marín). 0094-114X/$ - see front matter Ó 2008 Elsevier Ltd. All rights reserved. doi:10.1016/j.mechmachtheory.2008.09.006

G. Galán-Marín et al. / Mechanism and Machine Theory 44 (2009) 1132–1143

1133

The direct synthesis methods described above have often been criticized for the limited number of solutions they provide and their slow convergence. An alternative consists of using huge databases of atlas of path curves, on paper or computerized [12]. These are sometimes incomplete, however, or can not be used easily or flexibly. Some methods have been developed to overcome this limitation. McGarva, for instance, proposed the creation of a library of mechanisms [13] stored in terms of the normalized Fourier coefficients of the path they generate [14]. Chengzhi et al. [15] applied for the first time the wavelet multiresolution analysis to create a new atlas database. Artificial neural networks offer a new approach to the dimensional synthesis of path generating mechanism. It has been shown that they can compete effectively with more traditional methods to solve some optimization problems [16]. Some recent developments have been based on creating extensive mechanism databases using neural networks where the shape is made the objective of the preliminary design [17,18]. Sharan and Balasubramanian [19] presented a neural network to generate mechanisms whose coupler curve passes through nine points, and Hoskins and Kramer [18] a network where the power spectrum of the curvature plot of the curve is used to provide a representation of the path. A more recent, and complete neural approach for path synthesis was presented by Vasiliu and Yannou [17], using the method proposed by McGarva to code the paths [13,14]. The inputs of this network are the normalized Fourier descriptors that represent the shape of the path, and the outputs are the values of the five dimensional parameters that define the desired four-bar mechanism. The neural network’s learning process requires that a very large number of cases be generated through kinematic simulations for random values of the dimensions of the mechanism. Although the design instances are not stored specifically, the neural catalogue is used to form an approximate inverse of the function describing the behaviour of the mechanism. The main advantage of the neural network is that, when the learning process has finished, a near optimal solution of the synthesis problem can be obtained instantaneously. There is also a drastic reduction in memory requirements compared to the conventional database. Nevertheless, one drawback that we found in implementing Vasiliu and Yannou’s network [17] was that it can sometimes converge to an inconsistent four-bar mechanism that does not meet the closed-loop criterion or the Grashof condition. Indeed, Vasiliu and Yannou [17] themselves indicate, but do not give any further details, that external procedures must be applied to determine the feasible intervals for the mechanism morphology and blocking constraints for the Grashof condition. To avoid this difficulty, we here apply a method that reduces the design space and ensures that the neural network always provides a consistent four-bar crank-rocker mechanism. The usual four-bar linkage is driven through a crank, which is usually connected to a rotating motor. Hence, the commonest requisite in synthesizing the four-bar linkage in order to trace closed paths is the Grashof condition. Another common design criterion is to synthesize mechanisms with an optimal transmission angle. Optimization algorithms [1–4] usually handle the Grashof and transmission angle constraints by either adding a penalty term to the objective function or directly eliminating non-compliant solutions and then searching for a new mechanism. In contrast, we here propose ensuring that both conditions are satisfied by applying them before optimization. This has the additional benefit of simultaneously reducing the design space. The synthesis of crank-rocker mechanisms with optimal transmission angles has been a subject of discussion for decades [20]. Many algebraic methods have been proposed to design mechanisms with completely rotable input links and an optimal transmission angle [21–25]. We here describe a simple application of the Grashof criterion that reduces the number of parameters of a crank-rocker mechanism by two, and ensures optimal values of the transmission angle. The output of the proposed neural network consists of only three parameters that always define a consistent crank-rocker mechanism. In order to improve the effectiveness of the network, we also propose a new method of coding the specified path, replacing Fourier coefficients as in [17] with wavelet descriptors. Recent pattern recognition literature has shown wavelet descriptors to be better than Fourier coefficients for shape recognition using neural networks [26,27]. Wavelets are localized in both time and frequency, enabling to small differences in shape to be picked up. From this point of view, they can represent local features of the path shape better than Fourier transforms which are localized only in frequency. Moreover, unlike Fourier descriptors, wavelet descriptors do not need the points of the curve to be sampled at a constant time interval. Our numerical experiments with the neural network indeed showed the wavelet representation of the path shape to be more efficient in finding the optimal mechanism than the Fourier representation. Indeed, the neural network takes only seconds to provide near optimal crank-rocker mechanisms for a set of some hundreds of paths always with optimal transmission angle. The article is organized as follows. Section 2 describes a design space reduction for a four-bar mechanism that satisfies the Grashof and optimal transmission angle criteria. This ensures that the dimensions of the linkage, which are the outputs of the neural network, always define a consistent crank-rocker mechanism. Section 3 presents a new method for coding a path based on the wavelet descriptors of the previously normalized curve. These wavelets which describe the shape of the path are the inputs of the neural network. Section 4 reviews the most recent Fourier-based neural network [17] for path generation, and then describes the structure and characteristics of the new wavelet-based neural network proposal. Section 5 evaluates and discusses the performance of the proposed neural network, and compares the wavelet and Fourier transform results for several thousand paths generated by kinematic simulations. Section 6 presents the conclusions.

2. Reduction of the optimal design space A very important consideration in the design of a four-bar mechanism to be driven by a motor, obviously, is to satisfy the Grashof criterion to ensure that the input crank can make a complete revolution. The transmission angle is also an important

1134

G. Galán-Marín et al. / Mechanism and Machine Theory 44 (2009) 1132–1143

criterion for the design of mechanisms by means of which the quality of motion transmission in a mechanism, at its design state can be judged [20–25]. In this section we describe an application of the Grashof criterion that ensures optimal values of the transmission angle while simultaneously reducing the design space by two parameters. Fig. 1 shows the definition of the 10 parameters of a four-bar path generating mechanism. Point P represents the coupler point which generates the coupler curve when the crank a is rotated. The inequalities that classify four-bar linkages set the extreme theoretical limits of each class of mechanism. The most extensively applied class is the crank-rocker mechanism which is employed to transform rotary into oscillatory motion. In this case, the values of the maximum and minimum transmission angles are [23]: 2

b þ c2  ðd þ aÞ2 2bc 2 b þ c2  ðd  aÞ2 ¼ 2bc

cos lmax ¼

ð1Þ

cos lmin

ð2Þ

The deviation of transmission angle from 90° is the measure of reduction in effectiveness of force transmission. So the aim in linkage design is to proportion the links so that these deviations are as small as possible [20,23]. Hence, a practical additional limitation to employ in the design of the mechanism is lmin ¼ 180  lmax or cos lmin ¼  cos lmax . It must be pointed out that, satisfying this condition, satisfies the condition that the time-ratio for the designed crank-rocker mechanism is unity [21]. Inserting this condition into Eqs. (1) and (2), one has the following expression: 2

2

a2 þ d ¼ b þ c2

ð3Þ

This equality can be parameterized as



qffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi 2 a2 þ d cos a;



qffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi 2 a2 þ d sin a

ð4Þ

Substituting Eq. (4) into Eq. (2) gives

cos lmin ¼

2ðd=aÞ ð1 þ ðd=aÞ2 Þ sin 2a

The desired linkage is one for which ð90  lmin Þ is a minimum [23]. Hence, for a given value of ðd=aÞ, the smallest positive value of cos lmin corresponds to a ¼ p=4, and therefore

sffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi 2 a2 þ d b¼c¼ 2

ð5Þ

It is straightforward to prove that for da > 1, ba ¼ ac > 1 and db ¼ dc < 1. The Grashof condition is thus expressed as

dþa< bþc

ð6Þ

Fig. 1. Definition of the parameters of the four-bar linkage.

G. Galán-Marín et al. / Mechanism and Machine Theory 44 (2009) 1132–1143

1135

Using the values of b and c given by Eq. (5), one has

bþc ¼

qffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi 2 2ða2 þ d Þ

This value satisfies the Grashof condition (6) since

pffiffiffi 1 þ ða=dÞ qffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi < 2 1 þ ða=dÞ2 for ðd=aÞ > 1. The conclusion that can be drawn is that, if the lengths of the links of a crank-rocker mechanism fulfil the simple condition (5), then the Grashof criterion is always satisfied with optimal transmission angle, that is, minimum deviation from 90°. Observe that condition (5) also implies a convenient reduction of the design space by two parameters. It must be pointed out that Eq. (5) is applied to facilitate the design with optimum options. Hence, candidate solutions with smaller values of the objective function may exist outside the scope of the prescribed space. 3. Wavelet descriptors for path shape representation 3.1. The wavelet transform Although one can find a variety of methods of describing a curve in the literature, the most extensively applied for synthesizing path generating mechanisms are Fourier transform based [7,9,13,17,18]. In recent years, however, the wavelet transform has become an active area of research for a variety of applications including signal processing in fault detection, time series modeling, and shape recognition. We here follow the trend of recent pattern recognition literature by proposing the use of wavelets to describe the path shape. It has been shown that, although the reconstructions obtained from Fourier coefficients are of comparable quality to the corresponding wavelet representation, the latter provides more reliable recognition results [26,27]. Wavelet analysis involves decomposing a signal into a representation consisting of shifts and dilations of local basis functions called wavelets. There are many types of wavelet basis functions – Daubechies, Coiflet, symmlet, Morlet, Mexican hat, etc. Wavelet transforms are classified into Discrete Wavelet Transforms (DWTs) and Continuous Wavelet Transforms (CWTs). In a nutshell, DWT analyzes the signal information at different resolutions (or levels, usually diadic) by dilating the scale of the wavelet function, and constructing a time-scale representation of a signal which relates the local properties of the signal to the evolution of wavelet transform coefficients when the scale varies. The CWT of a function f ðtÞ is defined as:

1 ðW w f Þða; bÞ ¼ pffiffiffiffiffiffi jaj

Z

1

f ðtÞw 1

  tb dt a

ð7Þ

where a is the dilation factor or scale index which is inversely proportional to the frequency given by 2j , b is the shift or data translation factor given by 2j k, and w ðtÞ is the complex conjugate of wðtÞ. Since CWT coefficients are complex, they have to be squared in order to represent the energy level possessed by a signal. The resulting plot is known as a scalogram. Discretizing the coordinates ða; bÞ of the CWT of Eq. (7) to the coordinates ð2j k; 2j Þ using two integers j and k, one defines the DWT as follows: ðjÞ

dk ¼ ðW w f Þð2j k; 2j Þ ¼ 2j=2

Z

1

f ðtÞw ð2j t  kÞdt

1

where j is known as the level. In DWT, the original signal is decomposed into two signals – the signal approximation (A) which contains the lower frequency band, and the detail signal (D) which contains the higher frequency band. In multiresolution DWT, the original signal can be decomposed into one signal approximation and a number of detail signals in the form of the decomposition tree shown in Fig. 2. This decomposition may be presented in matrix form as

F¼Aþ

M X

Dm

m¼k

where

F ¼ ½x yT ;

A ¼ ½xa

y a T ;

Dm ¼ ½xdm

ydm T ;

xa and ya are the residual signal approximations, and xd and yd are the detail signals. The signal approximations A are expressed in terms of the scaling functions /Mn in the form:

2P 3  an /Mn n 4 5 P A¼ cn /Mn ya 

xa

n

1136

G. Galán-Marín et al. / Mechanism and Machine Theory 44 (2009) 1132–1143

Fig. 2. Multiple-level decomposition.

where the subscript M means the maximum level of decomposition and n is the translation index. The detail signals are expressed in terms of the wavelet functions wmn in the form:

 Dm ¼

xdm ydm



2P n

4P n

r mn wmn dmn wmn

3 5

where the subscripts m ¼ 1; 2; . . . ; M indicate the successive levels of decomposition. The wavelet descriptors consist of the coefficients an ; cn representing the signal approximation and the set of rmn ; dmn , m ¼ 1; 2; . . . ; M representing the detail signals of M applied levels of decomposition. Following recent proposals for neural networks in shape recognition [26,27], in the present work we chose scaling and mother wavelet functions based on the Daubechies orthogonal function D3 (Fig. 3). Hence, we used Daubechies’ orthogonal function wavelets D3 as wavelet basis, and the level-3 detail wavelet coefficients and the residual signal coefficients as descriptors. A complete derivation of the theory of the scale wavelet transform using Daubechies wavelets is given in Daubechies [29]. 3.2. Normalization of the path In order for the representation to be independent of the path’s position, orientation, and size, and hence reproduce solely its shape, a normalization procedure must be carried out before computing the wavelet descriptors. Because of its simplicity and efficiency, we use the curve normalization procedure for a plane closed curve proposed by Dikabar and Mruthyunjaya [10] and also applied by Sánchez Marín and Pérez González [8]. In this method (see Appendix), all the calculations are done with respect to the length elements of the curve, and not the area bounded by the curve. The curve is rotated in order to align the major principal axis with the x-axis. Finally, the width w of the bounding box of the curve is evaluated, and the curve is scaled to its normalized configuration without deformation by the factor 1=w. This ensures that the curve rests on the bottom edge of the bounding unit square. Then comparison of two normalized closed paths is equivalent to comparing their shapes. Consider now a four-bar curve-generating mechanism defined by 10 parameters as shown in Fig. 1. The dimensional optimization with a normalized path reduces the number of parameters by four (X O ; Y O for position, b for orientation, and d if the size is normalized using the length of the ground link). By applying Eq. (5), one also eliminates the lengths b and c, so that the parameters in the synthesis problem are reduced to a=d, u1 , f, and g. Once one has a normalized curve, one must eliminate the initial input angle parameter u1 before computing the wavelet descriptors of the path. The representation of the curve will then not depend on the starting point. One of the reasons that wavelet transforms have not found widespread use in path shape recognition is because wavelet coefficients do not have shift-invariance, i.e., they depend on the starting point. Procedures to obtain a representation of the curve that does not depend on the starting point are described in [8,11], but they can be cumbersome to implement and computerize in practice. We therefore adopted the simple but effective technique for this task proposed in [27]. Given that a bounding unit square for each normalized curve has been determined by following the normalization procedure proposed in [10], we apply the method proposed by Wunsch and Laine [27], that consists of always taking the starting point of the path to be the contour point that is closest to the bottom left corner of the square. In this way, the input angle parameter representing the starting point is eliminated. Extensive experiments have shown that this simple strategy yields accurate results.

G. Galán-Marín et al. / Mechanism and Machine Theory 44 (2009) 1132–1143

1137

Fig. 3. Scaling and wavelet functions based on Daubechies’ orthogonal function D3 .

4. Neural networks for synthesizing path generating mechanisms 4.1. Review of the existing Fourier descriptor based neural network In the neural network proposed by Vasiliu and Yannou [17], the path shape is described by the complex coefficients of the first five harmonics. As those authors point out, the difference between the original path and this approximation is sometimes significant in zones with a large curvature. Indeed, our results will show that wavelet descriptors can represent a path’s local curvature changes better than Fourier coefficients, thus picking up small differences in shape. In order to obtain a representation of the shape independent of translation, rotation, and scale, a normalization procedure is adopted. Instead of normalizing the path as we do, Vasiliu and Yannou [17] apply the normalization procedure proposed by McGarva [13,14] to the Fourier coefficients. This procedure is equivalent to translating the centroid of the closed curve to the origin, rotating the curve in order to align the major principal axis with the x-axis, and then normalizing the curve. Since Vasiliu and Yannou [17] consider the first five harmonics and this normalization eliminates five Fourier coefficients, it reduces the number of coefficients from 22 to 17. The structure of the neural network proposed by Vasiliu and Yannou [17] is the classical one – the multilayer feedforward network. It consists of 17 input neurons corresponding to the normalized Fourier coefficients, 2 hidden layers of 22 neurons each, and 5 output neurons corresponding to the dimensional parameters of the four-bar mechanism. The mathematical nature of the activation log-sigmoid function used in this network requires input and output values scaled from 0 to 1. (In our network, since we apply a linear transfer function to the input and output neurons, it is not necessary to apply a specific scaling procedure for the values of the neurons.) The first stage in training the neural network consists of generating a very large number of cases by kinematic simulation, using random values of the five dimensions that define the four-bar mechanism. Then a set of points around the path must be evaluated for the coupler curve generated by each mechanism. The position of a point on the path is represented by the complex function: zðtÞ ¼ xðtÞ þ iyðtÞ. The first problem is that the Fourier descriptors require the points to be sampled at a constant time interval t, which usually is not the case for coupler curves. (In contrast, this is not a requirement for wavelet descriptors.) In order to overcome this difficulty with Fourier coefficients, some workers have applied methods based on the cumulative angular deviant [9,7]. Vasiliu and Yannou [17] apply a procedure proposed by McGarva [13], in which the curve is parameterized in terms of the chord length. They take the value of a new parameter t at any of the points as the sum of the

1138

G. Galán-Marín et al. / Mechanism and Machine Theory 44 (2009) 1132–1143

distances between the start point and the required point. Then, to obtain the Fourier coefficients, the trapezium rule is applied as follows:

am ¼

N 1 1X t kþ1  tk ðzkþ1 expð2pimtkþ1 Þ þ zk expð2pimtk ÞÞ N k¼0 2

ð8Þ

Even with an intensive training process, the main difficulty that we encountered in implementing the approach described above using the Matlab neural network toolbox was that the network sometimes converged to inconsistent four-bar mechanisms that do not satisfy the closed-loop criterion. Indeed, Vasiliu and Yannou [17] note that a general procedure not described in their article must be applied to determine the feasible intervals for the mechanism’s morphology. Moreover, some non-blocking constraints for the Grashof condition have to be implemented externally. (In contrast, the method proposed in Section 2 eliminates the need for any external procedure by ensuring that the outputs of the network always define a consistent crank-rocker mechanism.) 4.2. Description of the wavelet descriptor based neural network proposal The structure of the proposed neural network is similar to that of Vasiliu and Yannou [17], and is the most commonly used – a multilayer feedforward network with backpropagation algorithm. The inputs to the network are a number of wavelet descriptors for a given path similar to the number of Fourier coefficients taken by Vasiliu and Yannou [17], and again we adopt 2 hidden layers of 22 neurons each. In order to avoid applying a scaling procedure, a linear transfer function is applied to the input and output neurons. For the two hidden layers of the network, we use the log-sigmoid function. The main difference is that there are only three output neurons, since we apply the method described in Section 2 to guarantee that these three parameters define a crank-rocker mechanism that satisfies the closed-loop criterion and the Grashof condition with optimal transmission angle. For the learning process of the neural network, we use kinematic simulations programmed in Matlab to generate 15,000 crank-rocker mechanisms and their corresponding coupler curves using random values of the parameters ða=dÞ 2 ð0; 1Þ, f, and g. An advantage of this wavelet-based network is that, unlike the Fourier case, the points on the path do not need to be uniformly sampled. Thus, there is no procedure needed to parameterize the curve. Once the paths have been generated, they must be normalized with the curve normalization procedure described in Section 3.2, which is easily implemented in Matlab. The wavelet descriptors of these normalized paths are derived as described in Section 3.1 using the Matlab wavelet toolbox. We apply the multi-level 1D wavelet decomposition at level M ¼ 3 to the vectors x ¼ ðx1 ; . . . ; xn Þ and y ¼ ðy1 ; . . . ; yn Þ that define the n points of the path, using Daubechies’ orthogonal wavelets as wavelet family. The routines in the Matlab neural network toolbox are then applied to train the network. The generation of the training data set and the learning process must be performed only for the first time. The scheme of this phase is shown in Fig. 4a. When the learning process has finished, the trained network is ready for the utilization phase, whose scheme is shown in Fig. 4b. The network provides an interpolated solution for any given path which represents the dimensions of the synthesized crank-rocker mechanism. 5. Results and discussion In this section we present the results given by the proposed wavelet-based neural network described in Section 4.2. For comparison, we also present results from a neural network with identical structure but with the path coded by Fourier coefficients. Note that we did not implement the procedure actually proposed by Vasiliu and Yannou [17]. Since we consider normalized paths, we do not need to apply the normalization method to the Fourier coefficients [13]. As shown in [14], for a path normalized with the procedure described in Section 3.2, the Fourier coefficients corresponding to the first five harmonics reduce to 18. These coefficients are computed using expression (8). To compare the two networks, for any given path we considered a number of 18 wavelet descriptors derived as described in Section 4.2. The results presented in Table 1 show that with this number of descriptors both representations yielded high quality crank-rocker mechanism solutions. We therefore fixed the structure of both neural networks at 18 input neurons, 2 hidden layers of 22 neurons each, and 3 output neurons. For the network’s learning process, 15,000 cases were generated by kinematic simulations programmed in Matlab for random values of the parameters ða=dÞ, f, and g. The cases were divided into two sets: 7500 as learning patterns (to calculate the error function during the learning process) and 7500 as test patterns (to test the generalization capacity on paths not used in learning). For each pattern, both networks provided three outputs that defined a near optimal crank-rocker mechanism. Again, through kinematic simulation we obtained the paths generated by these synthesized mechanisms and normalized them. Therefore, for the 7500 test paths not used during the learning process, we obtained 15,000 coupler curves – 7500 generated by the mechanisms synthesized by the wavelet-based neural network and 7500 generated by the mechanisms synthesized by the Fourier-based neural network. In order to compare visually these synthesized paths with the original test paths, Figs. 5

1139

G. Galán-Marín et al. / Mechanism and Machine Theory 44 (2009) 1132–1143

Fig. 4. (a) Scheme of the generation of the training data set and learning process of the neural network. (b) Scheme of the utilization phase of the neural network, given a shape optimization problem.

Table 1 Results for j ¼ 1; . . . ; 7500 test paths, using the neural network and coding the path with the wavelet or Fourier descriptors. Mean value

Maximum value

Wavelet

Fourier

Wavelet

0.0151

0.0329

0.2995

0.2828

GPDð2Þ ¼ jðAÞoj  ðAÞsj j     GPDð3Þ ¼ wL oj  wL sj

0.0174

0.046

0.2029

1.3666

0.0329

0.0948

0.394

2.1863

GPDð4Þ ¼ jðcx Þoj  ðcx Þsj j

0.0027

0.0061

0.0651

0.1898

GPDð5Þ ¼ jðcy Þoj  ðcy Þsj j

I Ixx xx GPDð6Þ ¼ w  w 3 3 oj sj

I I  wyy3 GPDð7Þ ¼ wyy3 oj sj

0.0071

0.0156

0.1198

0.1618

0.009

0.0191

0.1527

0.2036

0.0045

0.01

0.0653

0.2091

Overall error (E)

0.0455

0.1236

0.5417

2.4929

    GPDð1Þ ¼ wh oj  wh sj

Fourier

Listed are the means and maxima of the overall error and, for each global property, of the absolute difference (GPD) between the original path (‘o’) and the synthesized path (‘s’).

and 6 present a selection of cases. The solid curve is the original, the dotted curve is the solution obtained by the waveletbased neural network, and the dashed curve the solution obtained by the Fourier-based neural network. One immediately appreciates the superiority of the wavelet solution which usually is a better description of the path shape and the changes in curvature. In order to compare systematically the numerical results given by the two approaches for the 7500 test paths, we needed to use a procedure based on shape properties, and that was independent of the representation of the path, i.e., that was not based on the values of the wavelet or Fourier descriptors. We adopted as the measure for comparison of two normalized paths the seven global properties (GPs) of a curve (see Appendix) defined by Dikabar and Mruthyunjaya [10] and also applied by Laribi et al. [3]:

1140

G. Galán-Marín et al. / Mechanism and Machine Theory 44 (2009) 1132–1143

Fig. 5. Curves: (3) original; (  ) synthesized by the wavelet-based neural network; and (- -) synthesized by the Fourier-based neural network.

GP ¼



h L Ixx Iyy ; A; ; cx ; cy ; 3 ; 3 w w w w



Observe that, except for the area (A), all the rest of the GPs – width (w), height (h), length (L), centre of gravity (cx ; cy ), and moments of inertia (Ixx ; Iyy ) – had already been calculated during the process of normalization for all the paths. Table 1 summarizes the results for the 7500 test paths, giving the means and maxima of the absolute difference of each global property between the original path (‘o’) and the path generated by the mechanism synthesized by each of the two neural networks (‘s’). In particular, the mean and maximum values of the difference in property i, GPDðiÞ, between the original path, GPOðiÞ, and the path generated by the mechanism synthesized by the network, GPSðiÞ, for i ¼ 1; . . . ; 7, were calculated for the N ¼ 7500 test paths, and defined as:

GPDðiÞ ¼

N X 1 jGPOðiÞj  GPSðiÞj j N j¼1

GPDðiÞmax ¼ max fjGPOðiÞj  GPSðiÞj jg j¼1;...;N

Table 1 also gives the mean and maximum overall error for the two neural networks, evaluated for all the N ¼ 7500 test paths as the distance between two GP vectors. These values of the overall error are defined as:

vffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi u 7 N X X 1u t ðGPOðiÞ  GPSðiÞ Þ2 E¼ j j N j¼1 i¼1 ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi9 8v 7
G. Galán-Marín et al. / Mechanism and Machine Theory 44 (2009) 1132–1143

1141

Fig. 6. Curves: (3) original; (  ) synthesized by the wavelet-based neural network; and (- -) synthesized by the Fourier-based neural network.

were better for the mean and maximum values of the overall error, and also for the mean values of all seven GP differences. And for the maximum values of the differences, there was only a very small margin in favour of the Fourier descriptors in ðh=wÞ, the rest being better with the wavelet descriptors. The results in the table also demonstrate the accuracy of the proposed approach to providing near optimal crank-rocker mechanism solutions for path generation. Once the learning process of the network has been completed, the solutions are obtained almost instantaneously. For instance, to provide near optimal crank-rocker mechanism solutions for a set of 300 paths, the network only takes 0.25 s on a conventional 3 GHz Pentium IV PC with 512 MBytes RAM using Matlab. 6. Conclusions Artificial neural networks offer a new approach to design catalogues, in which design instances are not stored specifically but are used to form instantaneously an approximate inverse to the function describing the behaviour of the mechanism. Once the learning process has been completed, the network offers a very large number of solutions with very fast convergence, drastically reducing the size requirement with respect to that of a conventional database. We have here described a procedure which guarantees that the neural network synthesizes a crank-rocker mechanism that always satisfies the fundamental design criteria, i.e., the closed-loop criterion and the Grashof condition with optimal transmission angle. In order to improve the effectiveness of the network, we proposed a new wavelet descriptor based method for coding a path. Extensive numerical experiments performed with the network showed the superiority of the wavelet over the Fourier descriptors in finding an optimal mechanism that satisfies the shape specifications of the original closed path. In future, we plan to adapt the proposed neural network to the problem of open-path dimensional synthesis of four-bar mechanisms and evaluate its efficiency. In this sense, wavelet descriptors can be applied to open or closed paths with points that do not need to be uniformly sampled, corresponding to the usual case of curves used in engineering. Fourier descriptors, however, can only be applied to closed paths that must be parameterized in order to obtain points artificially sampled at a constant time interval. Although the present work’s focus has been on the synthesis of crank-rocker mechanisms, there are various possibilities for its evolution by extending the wavelet-based neural network method to synthesize other rigid-body linkages or even compliant mechanisms.

1142

G. Galán-Marín et al. / Mechanism and Machine Theory 44 (2009) 1132–1143

Appendix. Normalization and global properties of a closed plane curve The curve is assumed to be a simple closed polygon of n sides, where ðxi ; yi Þ represents the ith vertex of the polygon and ðx0 ; y0 Þ is considered identical to ðxn ; yn Þ. One can then define the following parameters: Width: w ¼ maxðxi Þ  minðxi Þ; height: h ¼ maxðyi Þ  minðyi Þ; qffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi P Length: L ¼ ni¼1 ðxi1  xi Þ2 þ ðyi1  yi Þ2 ; P Area: A ¼ ni¼1 ðxi1 yi  xi yi1 Þ; qffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi Pn 1 Centre of gravity: cx ¼ 2L ðxi1  xi Þ2 þ ðyi1  yi Þ2 ; i¼1 ðxi1 þ xi Þ qffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi Pn 1 cy ¼ 2L ðxi1  xi Þ2 þ ðyi1  yi Þ2 ; i¼1 ðyi1 þ yi Þ P Moments of inertia: Ixx ¼ 13 ni¼1 ðli ½ðyi1  yc Þ2 þ ðyi  yc Þ2 þ ðyi1  yc Þðyi  yc ÞÞ; P Iyy ¼ 13 ni¼1 ðli ½ðxi1  xc Þ2 þ ðxi  xc Þ2 þ ðxi1  xc Þðxi  xc ÞÞ; P Ixy ¼ 16 ni¼1 ðli ½ðxi1  xc Þðyi  yc Þ þ ðxi  xc Þðyi1  yc Þ þ 2½ðxi1  xc Þðyi1  yc Þ þ ðxi  xc Þðyi  yc ÞÞ; The direction

of the major principal axis with respect to the x-axis is given by a if Ixx < Iyy or a þ p=2 if Ixx > Iyy , where: a ¼ 12 tan1 Iyy2IIxyxx . If ðP x ; Py Þ and ðQ x ; Q y Þ represent the corners of the bounding box of the path, with w ¼ jQ x  P x j and h ¼ jQ y  P y j, the path is brought to its normalized configuration by applying the following transformation to all the points [10]:

0

xi

1

0

cos a w

B  B C sin a ¼B @ yi A @  w 1 normalized 0

sin a w cos a w

0



10 1 x

C B i C P  wy C A @ yi A 1 original 1  Pwx

In order to compare solely the shape of two paths, we apply the global properties that characterize a given curve defined in [10]:

 GP ¼

h L Ixx Iyy ; A; ; cx ; cy ; 3 ; 3 w w w w



where the elements of the vector are normalized in order to compare elements of the same dimensions in calculating the overall error. References [1] A. Smaili, N. Diab, Optimum synthesis of hybrid-task mechanisms using ant-gradient search method, Mech. Mach. Theory 42 (2007) 115–130. [2] A. Smaili, N. Diab, Optimum synthesis of mechanism using tabu-gradient search algorithms, J. Mech. Des. 127 (5) (2005) 917–923. [3] M.A. Laribi, A. Mlika, L. Romdhane, S. Zeghloul, A combined genetic algorithm-fuzzy logic method (GA-FL) in mechanism synthesis, Mech. Mach. Theory 39 (2004) 717–735. [4] J.A. Cabrera, A. Simon, M. Prado, Optimal synthesis of mechanisms with genetic algorithm, Mech. Mach. Theory 37 (10) (2002) 1165–1177. [5] A. Smaili, N. Diab, A new approach to shape optimization for closed path synthesis of planar mechanisms, J. Mech. Des. 129 (2007) 941–948. [6] F.T. Sánchez Marín, A. Pérez González, Open path synthesis of linkages through geometrical adaptation, Mech. Mach. Theory 39 (2004) 943–955. [7] Y. Liu, R. Xiao, Optimal synthesis of mechanisms for path generation using refined numerical representation based model and AIS based searching method, J. Mech. Des. 127 (2005) 688–691. [8] F.T. Sánchez Marín, A. Pérez González, Global optimization in path synthesis based on design space reduction, Mech. Mach. Theory 38 (2003) 579–594. [9] I. Ullah, S. Kota, Optimal synthesis of mechanisms for path generation using Fourier Descriptors and Global Search Methods, J. Mech. Des. 119 (4) (1997) 504–510. [10] S. Dikabar, T.S. Mruthyunjaya, Synthesis of workspaces of planar manipulators with arbitrary topology using shape representation and simulated annealing, Mech. Mach. Theory 34 (1999) 391–420. [11] K. Watanabe, Application of natural equations to the synthesis of curve generating mechanism, Mech. Mach. Theory 27 (3) (1992) 261–273. [12] V. Unruh, P. Krishnaswami, A computer aided design technique for semi-automated infinite point coupler curve synthesis of four-bar linkages, J. Mech. Des. 117 (1995) 143–149. [13] J.R. McGarva, Rapid research and selection of path generation mechanisms from a library, Mech. Mach. Theory 29 (2) (1994) 223–235. [14] J.R. McGarva, G. Mullineux, Harmonic representation of closed curves, Appl. Math. Model. 17 (4) (1993) 213–218. [15] W. Chengzhi, J. Yuebo, S. Daoheng, Research on applying wavelet analysis to path synthesis for coupler curves of planar four-bar linkages, Chin. J. Mech. Eng. 40 (8) (2004) 34–39. [16] G. Galan-Marin, J. Muñoz-Perez, Design and analysis of maximum Hopfield networks, IEEE Trans. Neural Networks 12 (2001) 329–339. [17] A. Vasiliu, B. Yannou, Dimensional synthesis of planar mechanisms using neural networks: application to path generator linkages, Mech. Mach. Theory 36 (2001) 299–310. [18] J.C. Hoskins, G.A. Kramer, Synthesis of mechanical linkages using artificial neural networks and optimization, Proc. IEEE Int. Conf. Neural Networks 2 (1993). 822–J–822–N. [19] A.M. Sharan, R. Balasubramanian, Design of four-bar mechanism by neural network methods, Int. J. Model. Simul. 19 (1) (1999) 1–6. [20] S.S. Balli, S. Chand, Transmission angle in mechanisms (Triangle in mech), Mech. Mach. Theory 37 (2002) 175–195. [21] B. Roth, F. Freudenstain, G. Sandor, Synthesis of a four bar link path generating mechanisms with optimum transmission characteristics, in: Transactions of Seventh Conference on Mechanisms, Purdue University, Lafayette, Ind., 1962, pp. 44–48. [22] M. Lun, Y. Leu, Design of crank-rocker mechanisms with optimum transmission angle over working stroke, Mech. Mach. Theory 31 (4) (1996) 501–511.

G. Galán-Marín et al. / Mechanism and Machine Theory 44 (2009) 1132–1143

1143

[23] A.K. Khare, R.K. Dave, Optimizing 4-bar crank-rocker mechanism, Mech. Mach. Theory 14 (1979) 319–325. [24] K.C. Gupta, A note on the optimum design of four bar crank rocker mechanism, Mech. Mach. Theory 12 (1977) 247–254. [25] K.C. Gupta, Synthesis of position, path and function generating 4-bar mechanism with completely rotable driving links, Mech. Mach. Theory 15 (1980) 93–101. [26] S. Osowski, D.D. Nghia, Fourier and wavelet descriptors for shape recognition using neural networks, Pattern Recogn. 35 (2002) 1949–1957. [27] P. Wunsch, A.F. Laine, Wavelet descriptors for multiresolution of handprinted characters, Pattern Recogn. 28 (1995) 1237–1249. [29] I. Daubechies, Ten Lectures on Wavelets, Society for Industrial and Applied Mathematics, Philadelphia, 2001.