Loading [MathJax]/jax/output/SVG/jax.js
Research article Special Issues

Optimal synthesis of a planar mechanism using Matlab: Example of slider crank in a rowing motion


  • Received: 09 December 2022 Revised: 26 February 2023 Accepted: 07 March 2023 Published: 10 March 2023
  • This paper illustrates the conducted effort to introduce the methodology of optimal synthesis of mechanisms through an engineering problem under Matlab. This project is part of a first course on poly-articulated mechanisms and robotics at the graduate level. The course combines both the theoretical and implementation under Matlab aspects to achieve its goals. The example of the rowing machine is considered to introduce the crank-slider mechanism and the kinematic analysis using complex numbers. The mechanism is associated with a spring to ensure the device simulating the resistance in the rowing bench simulator. The optimal synthesis problem is formulated for the desired effort to perform and solved using the Sequential Quadratic Programming method. All developments are implemented under Matlab.

    Citation: Med Amine LARIBI. Optimal synthesis of a planar mechanism using Matlab: Example of slider crank in a rowing motion[J]. STEM Education, 2023, 3(1): 1-14. doi: 10.3934/steme.2023001

    Related Papers:

    [1] Med Amine Laribi, Saïd Zeghloul . Redundancy understanding and theory for robotics teaching: Application on a human finger model. STEM Education, 2021, 1(1): 17-31. doi: 10.3934/steme.2021002
    [2] Lotfi Romdhane, Mohammad A. Jaradat . Interactive MATLAB based project learning in a robotics course: Challenges and achievements. STEM Education, 2021, 1(1): 32-46. doi: 10.3934/steme.2021003
    [3] Eduard Krylov, Sergey Devyaterikov . Developing students' cognitive skills in MMS classes. STEM Education, 2023, 3(1): 28-42. doi: 10.3934/steme.2023003
    [4] Inae Jeong, Tanya Evans . Knowledge Organisers for learning: Examples, non-examples and concept maps in university mathematics. STEM Education, 2023, 3(2): 103-129. doi: 10.3934/steme.2023008
    [5] William Guo . Solving problems involving numerical integration (I): Incorporating different techniques. STEM Education, 2023, 3(2): 130-147. doi: 10.3934/steme.2023009
    [6] X. Yamile Sandoval-Castro, Eduardo Castillo-Castaneda, Benigno Munoz-Barron, Maximiano F. Ruiz-Torres . Mechanical programmable design of soft pneumatic actuators with kirigami patterns to generate expanding, bending and twisting motions. STEM Education, 2023, 3(1): 15-27. doi: 10.3934/steme.2023002
    [7] Shuangji Yao, Yunfei Guo, Botao Yang, You Lv, Marco Ceccarelli, Xiaoshuang Dai, Giuseppe Carbone . Single-objective flexible job-shop scheduling problem based on improved dung beetle optimization. STEM Education, 2024, 4(3): 299-327. doi: 10.3934/steme.2024018
    [8] Aai Sheau Yean, Suzieleez Syrene Abdul Rahim, Umi Kalsum Binti Mohd Salleh . Techno-optimism of Malaysia education blueprint (2013-2025) and its effect on the local sustainability education narrative. STEM Education, 2024, 4(3): 199-221. doi: 10.3934/steme.2024013
    [9] Xin Zhang, Longzhu Yi, Huikuan Chen, Jiayu Qian, Xuesong Zhai . Collaborative science experiments based on the educational metaverse: Research on the impact and mechanisms of collaborative science experiments on elementary students' creative thinking. STEM Education, 2025, 5(2): 250-274. doi: 10.3934/steme.2025013
    [10] Xiangping Cui, Jiangming Qian, Soheila Garshasbi, Susan Zhang, Geng Sun, Juan Wang, Jun Shen, Lin Yue, Yewen Lyu . Enhancing learning effectiveness in livestream teaching: Investigating the impact of teaching, social, and cognitive presences through a community of inquiry lens. STEM Education, 2024, 4(2): 82-105. doi: 10.3934/steme.2024006
  • This paper illustrates the conducted effort to introduce the methodology of optimal synthesis of mechanisms through an engineering problem under Matlab. This project is part of a first course on poly-articulated mechanisms and robotics at the graduate level. The course combines both the theoretical and implementation under Matlab aspects to achieve its goals. The example of the rowing machine is considered to introduce the crank-slider mechanism and the kinematic analysis using complex numbers. The mechanism is associated with a spring to ensure the device simulating the resistance in the rowing bench simulator. The optimal synthesis problem is formulated for the desired effort to perform and solved using the Sequential Quadratic Programming method. All developments are implemented under Matlab.



    Students, in Mechanical Engineering courses, are typically introduced to the study of machine kinematics through an introductory unit in kinematics. The fundamental physics of motion is explained as the student works through a large number of problems contained in one of the acknowledged textbooks [1]. In general, Science, Technology, Engineering, and Mathematics (STEM) education is the cross-curricular study of science, technology, engineering, and mathematics, and the application of those subjects in real-world contexts [2, 3]. As students engage in STEM education, they develop the transferable skills that they need to meet the demands of today's global economy and society, and to become scientifically and technologically literate citizens.

    In addition, students will discover how the four disciplines connect as they explore mechanics, including experiments in mechanical advantage and mechanism set-ups, and may even conceptualize new lifting and transport solutions. Once they are familiar with the various types of mechanisms, they'll have the opportunity to explore innovative solutions to real-world problems, challenges, and needs [4].

    A mechanism is defined as an arrangement of machine elements that produce a specified motion [5]. Four-bar mechanisms are a class of simple but practically important mechanisms [6, 7]. The slider-crank mechanism is a particular four-bar linkage configuration that converts linear motion to rotational, or vice versa [8]. Internal combustion engines are a common example of this mechanism, where combustion in a cylinder creates pressure which drives a piston. The piston's linear motion is converted into rotational motion at the crank through a mutual link, referred to as the connecting rod. As the geometry of the crank forces the conversion of linear motion to rotational, shaking forces are generated and applied to the crank's housing. These shaking forces result in vibrations which impede the operation of the engine.

    The slider-crank mechanism is frequently utilized in undergraduate engineering courses to investigate machine kinematics and resulting dynamic forces. The position, velocity, acceleration and shaking forces generated by a slider-crank mechanism during operation can be determined analytically. Certain factors are often neglected from analytical calculations, causing results to differ from experimental data. The assumption is frequently made that the crankshaft's angular velocity is constant. In reality, angular velocity is slightly higher on the power stroke than on the return stroke. The study of these slight variances produces useful insight into the characteristics of piston driven engines.

    The synthesis of a mechanism is the process of combining parametric elements into a mechanism that shows complex behavior [9]. Mechanism synthesis includes function generation, motion generation and path generation.

    The paper is organized as follows, after the introduction in section one the rowing mechanism overview is covered in section two, the kinematic analysis using complex numbers of the slider-crank mechanism is presented in section three. The issue of the initial solution of the rowing bench and the formulation of the optimal synthesis problem are addressed in section four. Finally, the concluding remarks are summarized in section five.

    The considered device is located in an apartment and simulates the movements of the rower. The operator should apply an effort on the oar of the rowing mechanism. This effort varies basis on the oar position and can be more or less important according to the training scenario:

    ●  Pushing on the oars, direction A (see Figure 1), these being out of the water, the effort is low, just the movement of the oars.

    Figure 1.  Rowing mechanism.
    Figure 2.  Operation description of the rowing mechanism.

    ●  Traction on the oars, direction B (see Figure 1), these are in the water, the effort is significant, because the water opposes the movements of the oars.

    The tractive effort can be adjusted by more or less tightening the adjustment needle 16, see the system assembly drawing in Appendix 1.

    The stress simulation is related to the movement of oil inside the device. Two identical devices are located on each side of the rower.

    The kinematic graph of the rowing mechanism is given by Figure 3 and is equivalent to a slider-crank mechanism. This later is a four-link mechanism with three revolute joints and one sliding joint. The rotation of the crank drives the linear movement of the slider, or the expansion of gases against a sliding piston in a cylinder can drive the rotation of the crank.

    Figure 3.  (a) Kinematic graph of the rowing mechanism, (b) its corresponding vector loop.

    In planar mechanisms, kinematic analysis can be performed either analytically or graphically. In this work, we investigate analytical kinematic analysis [10]. Analytical kinematics is based on projecting the vector loop equation(s) of a mechanism onto the axes of a non-moving Cartesian frame. This projection transforms a vector equation into two algebraic equations. Then, for a given value of the position (or orientation) of the input link, the algebraic equations are solved for the position and/or orientation of the remaining links. The first and second time derivative of the algebraic position equations provide the velocity and acceleration equations for the mechanism. For given values of the velocity and acceleration of the input link, these equations are solved to find the velocity and acceleration of the other links in the system.

    This section is focused on the kinematic analysis of the slider-crank mechanism. As a planar mechanism, the slider-crank can be represented by a general chain, consisting of one or more loops of successive bar-slider members.

    Complex numbers readily lend themselves as an ideal tool for modeling linkage members as part of planar chains. For each bar-slider member, the position of the pivot on the slider with respect to the pivot of the bar can be defined by a relative position vector Zk expressible as a complex number. The starting position of the bar k can be written as:

    Zk=Zkeiθ=Zk(cosθ+isinθ) (1)

    where,

    i=1

    Zk=|Zk|: length between the pivot of the bar and the pivot on the slider in the first position.

    θ=arg(Zk): angle measured to vector Zk from the coordinate system with the pivot of the bar.

    In a slider-crank mechanism, depending on its application, either the crank is the input link and the objective is to determine the kinematics of the connecting rod and the slider, or the slider is the input link and the objective is to determine the kinematics of the connecting rod and the crank. In the present example, we assume the first case: for the known value of θ2 we want to determine the kinematics of the other links.

    We start the analysis by defining vectors and constructing the vector loop equation using complex numbers:

    OC=OA+AB+BC (2)
    ZOC=ZOA+ZAB+ZBC (3)

    We place the xy frame at a convenient location. We define an angle (orientation) for each vector according to our convention (CCW with respect to the positive x-axis). The equation (3) can be written as follows:

    xeiθ0=L2eiθ2L3eiθ3+L4eiθ4 (4)

    Position equations

    The vector loop equation is projected onto the x and y axes to obtain two algebraic equations:

    xcosθ0=L2cosθ2L3cosθ3+L4cosθ4 (5)
    xsinθ0=L2sinθ2L3sinθ3+L4sinθ4 (6)

    Since θ0=0and θ4=0, we have:

    x=L2cosθ2L3cosθ3+L4 (7)
    0=L2sinθ2L3sinθ3 (8)

    Velocity equations

    The time derivative of the position equations yields the velocity equations:

    ˙x=L2ω2sinθ2+L3ω3sinθ3 (9)
    0=L2ω2cosθ2L3ω3cosθ3 (10)

    These equations can also be represented in matrix form, where the terms associated with the known crank velocity are moved to the right-hand-side:

    [1L2sinθ20L2cosθ2][˙xω2]=[L3ω3sinθ3L3ω3cosθ3] (11)

    Acceleration equations

    The time derivative of the velocity equations yields the acceleration equations:

    ¨x=L2˙ω2sinθ2+L2ω22cosθ2+L3˙ω3sinθ3+L3ω23cosθ3 (12)
    0=L2˙ω2cosθ2L2ω22sinθ2L3˙ω3cosθ3+L3ω23sinθ3 (13)

    These equations can also be represented in matrix form, where the terms associated with the known crank acceleration and the quadratic velocity terms are moved to the right-hand-side:

    [1L2sinθ20L2cosθ2][¨x˙ω2]=[L3˙ω3sinθ3+L3ω33cosθ3+L2ω22cosθ2L3˙ω3cosθ3+L3ω23sinθ3L2ω22sinθ2] (14)

    The relationship between the input and output variables of the mechanism can be obtained from equations (5) and (6). The slider position, x, is considered as an output and the crank angle, θ2, is considered as an input.

    x22x[L2cosθ2L4]+L22+L24L23+2L2L4cosθ2=0 (15)

    If we consider L4=0, the slider position can be defined by the following equation and with two possible solutions:

    x=L2cosθ2±L22(cosθ21)L23 (16)

    The slider velocity is obtained by the time derivative of the previous equations:

    ˙x=L2ω2sinθ2±L22ωsinθ2L22(cosθ21)L23 (17)

    To obtain the evolution of the input-output equation and for given values of the design parameters L2 and L3, we have implemented the functions to plot the position x and the velocity ˙x.

    In order to visualize the evolution of the slider position and the slider velocity, two functions have been implemented under Matlab. The implementation is considered for given values of the design parameters L2=5 and L3=20, the length of the crank and the connecting rod, respectively.

    Table 1.  Function to compute the slider position.
    function [x] = position (t, L2, L3)
    % t : input crank angle
    for i=1:max(size(t))
    x(i)= L2*cos(t(i))+ sqrt((L2^2*(cos(t(i))-1))-L3^2);
    end
    end

     | Show Table
    DownLoad: CSV

    Further, the obtained curves are based on one rotation of the crank for a rotation speed of the crank of 20rpm.

    Table 2.  Function to compute the slider velocity.
    function [v] = velocity(L2, L3, t, dt)
    % dt : rotation speed of the crank in rpm
    % t : input crank angle
    dt1 = dt*pi/30;
    for i=1:max(size(t))
    v(i)= -L2*sin(t(i))*dt*(1+L2/(sqrt((L2^2*(cos(t(i))-1))-L3^2));
    end
    end

     | Show Table
    DownLoad: CSV

    Figures 4 and 5 illustrate the evolutions of the position and the velocity for one crank rotation.

    Figure 4.  Slider position for one crank rotation.
    Figure 5.  Slider velocity for one crank rotation.

    The rowing bench simulator not working properly, so it was decided to replace the device simulating the resistance with pressurized air. This latter will be replaced by a mechanical solution and assimilated to a force of a spring of stiffness k=244N/mm. The new equivalent rowing bench simulator is given in Figure 5.

    The expected effort to be performed by the mechanical solution is presented in Figure 6. The effort is given for one rotation of the crank angle and for 63 positions with a step of 2π63.

    Figure 6.  Kinematic graph of the rowing mechanism with spring.

    The objective of this section is to determine the values of the fixed parameters of the crank-slider mechanism, defining the design vector I=[L2L3], leading to the desired effort. To do this, we will first implement a function to compute the effort for given fixed parameters, vector I, as input. The function effort under Matlab is given in Table 3.

    Table 3.  Function to compute the effort.
    function [F] = effort(t, L2, L3)
    x = position(t, L2, L3); % Crank position
    for i=1:max(size(t))
    F(i) = 244 * x(i);
    end
    end

     | Show Table
    DownLoad: CSV

    The evolution of the effort F is proportional to the slider displacement. An example of effort is presented in Figure 7 for the design vector, L2=10 and L3=50, and one rotation of the crank.

    Figure 7.  Evolution of the desired effort simulating the resistance in the rowing bench simulator.

    Using the squared error as the optimization criterion, one can write the general formulation of dimensional synthesis problem of the mechanism as follows:

    minIf(I(x))subjectto{c(I(x))0xminxxmax (18)

    with,

    f(I(x))=1nni=1(FdiF0i)2: squared error, called cost function.

    Fdi: the desired value of the effort at position i of the crank.

    F0i: the value of the effort at position i of the crank.

    n: the total number of potions.

    I(x)=[x1,..,xk]: the design vector.

    xmin and xmax: the bounding values of the design vector.

    To find out optimal values for the parameters L2 and L3 we want to minimize the difference between the calculated result F0i and the desired effort Fdi. So we subtract FdiF0i for all i from 1 to n. Hence, we calculate the sum over this difference and then calculate the average by multiplying the sum by 1/n. This would result in 1nni=1(FdiF0i)2 and when this sum is close to zero, the optimal target is reached.

    In the case of the slider crank mechanism, the optimisation problem can be defined as follow:

    minIf(I)subjectto{I=[L2L3]L2<L31L21011L320 (19)

    To solve the optimisation problem linked to the dimensional synthesis problem of the crank-slider mechanism an optimisation method based on a nonlinear programming solver under Matlab (Sequential Quadratic Programming) is applied [11]. In order to help visualising the optimisation, the 3D plot of the objective function will be presented in the next section.

    The purpose of Sequential Quadratic Programming (SQP) is to find a set of parameters that minimize the cost function f. Let's plot the cost function f as a three-dimensional surface that maps out the value of f for all values of the parameters L2 and L3, shown in Figure 8. This surface is shaped like a bowl, with a low point in the middle. That is the global minimum of the cost function, and it represents the point where our hypothesis will fit the data the best.

    Figure 8.  Force of a spring for a given values of the design vector, L2=10 and L3=50.

    We will use SQP to find the values of L2 and L3 that correspond to this global minimum. Note that SQP always has a convex cost function (i.e. it has only one global minimum, no other local minima) so we say the cost function f is a convex quadratic function.

    The script computing the squared errors for all combinations of L2[1,10] and L3[11,19] is given in Table 4. A surface with all squared errors can be obtained, as shown on Figure 8. Each error on this surface is linked to set values, L2 and L3.

    Table 4.  Function to compute the quadratic error.
    step = 360/63;
    t = (0:step: 360-step);
    L2 = (1:0.1:10);
    L3 = (10:0.1:19);
    e = [];
    F = zeros(size(t));
    n = 63;
    for i=1:max(size(L2))
    for j=1:max(size(L3))
    for k=1:max(size(t))
    F(k) = effort(t(k), L2(i), L3(j));
    end
    e(i, j)=(1/n)*sum((Fd-F').^2);
    end
    end
    figure(2)
    surf(L2, L3, e),
    xlabel('Crank length L2 (mm)'),
    ylabel('Connecting rod length L3 (mm)'),
    zlabel('Squared error');

     | Show Table
    DownLoad: CSV

    The minimum error means that the effort provided by the crank-slider mechanism is the most closer to the desired effort. This mechanism is called the optimal crank-slider mechanism and is defined by the design vector I=[L2L3].

    The projections of the surface of Figure 8 on specific planes allow identifying the optimal solution. Figure 9 presents the obtained projections and the approximated lengths values, which can be computed graphically.

    Figure 9.  Squared errors surface.
    Figure 10.  Projections of the squared errors surface.

    The optimisation problem is applied to solve accurately the optimisation problem based on a nonlinear programming solver under Matlab. For sake of simplicity, the optimisation problem is solved without constraints and fminunc (Table 5) is applied to find the minimum of unconstrained multivariable function Fobj (Table 6), which represents the objective function. The desired value of the effort mentioned, as explained in section §4.1, is given by the load of file Fd and using a function "load", as shown in Table 6 (x0=load('Fd')).

    Table 5.  SQP implementation under Matlab.
    options = optimoptions('fmincon', 'Display', 'iter', 'Algorithm', 'sqp');
    lam0 = [1, 5];
    [x, fval] = fminunc(@Fobj, lam0, options);

     | Show Table
    DownLoad: CSV
    Table 6.  Cost function applied to the design vector I.
    function [e]=Fobj(I)
    L2=I(1);
    L3=I(2);
    k=244;
    x0=load('Fd');
    x0=x0*1000;
    t=0:0.1:2*pi;
    x=(L2*cos(t)+sqrt(L3^2-(sin(t)*L2).^2))*k;
    for i=1:size(x, 2)
    E(i)=(x0(i)-x(i))^2;
    end
    e=sum(E)/size(x, 2);

     | Show Table
    DownLoad: CSV

    The optimisation starts at the point lam0 and attempts to find a minimum x of the cost function described in Fobj. An optimal solution is a feasible solution where the objective function reaches its minimum value.

    The optimal solution is obtained through six iterations and defined by I=[L2=3.3L3=13.5] with an error, a cost function, of 8.25104.

    Optimal synthesis of a new mechanism to replace the existing mechanism of the rowing machine is achieved thanks to the association of a slider crank mechanism and a spring. An approach based on the kinematic analysis using complex numbers on one hand, and the optimal synthesis problem formulation on the second hand has been presented. Detailed developments have been implemented under Matlab and presented with annotated codes.

    It is expected that the new machine will present resistance in the rowing bench simulator and have improved performance in terms of behavior. The desired effort to perform was considered as a problem input and handled in the optimization problem which is solved using the Sequential Quadratic Programming method.

    All authors declare no conflicts of interest in this paper.



    [1] Meriam, J.L. and Kraige, L.G., Engineering mechanics, Volume 2 Dynamics, Wiley, 1997.
    [2] Thibaut L., Ceuppens S., De Loof H., De Meester J., Goovaerts L., Struyf A., et al. (2018) Integrated STEM education: A systematic review of instructional practices in secondary education. European Journal of STEM Education 3: 2.
    [3] Ghani U., Zhai X., Ahmad R. (2021) Mathematics skills and STEM multidisciplinary literacy: Role of learning capacity. STEM Education 1: 104.
    [4] Koleza, E. and Skordoulis, C.D., Innovating STEM Education: Increased Engagement and Best Practices. Champaign, IL: Common Ground Research Networks. https://doi.org/10.18848/978-1-86335-251-2/CGP
    [5] Erdman, A.G. and Sandor, G.N., Mechanism Design: Analysis and Synthesis, 4th ed.; Pearson: London, UK, 2001.
    [6] Cabrera J., Simon A., Prado M. (2002) Optimal synthesis of mechanisms with genetic algorithms. Mech Mach Theory 37: 1165-1177.
    [7] Laribi M., Mlika A., Romdhane L., Zeghloul S. (2004) A combined genetic algorithm-fuzzy logic method GA-FL in mechanisms synthesis. Mech Mach Theory 39: 717-735.
    [8] McCarthy, J.M. and Joskowicz, L., Kinematic synthesis, Cambridge University Press, 2009.
    [9] Hernández A., Muñoyerro A., Urízar M., Amezua E. (2021) Comprehensive approach for the dimensional synthesis of a four-bar linkage based on path assessment and reformulating the error function. Mech Mach Theory 156: 104126.
    [10] Constans, E. and Dyer, K.B., Introduction to Mechanism Design with Computer Applications, CRC Press Taylor & Francis Group, 2019. https://doi.org/10.1201/b22145
    [11] Nocedal, J. and Wright, S., Numerical Optimization, Springer, 2006.
  • Author's biography Dr. Med Amine LARIBI is an Associate Professor in the Fundamental and Applied Sciences Faculty of the University of Poitiers (UP), where he teaches robotics and mechanic. He has a Mechanical Engineer Degree (specialization on Mechanical Design) from École Nationale d'Ingénieurs de Monsatir (E.N.I.M.) in 2001. M.S. in Mechanical Design, 2002. He received his Ph.D. in Mechanics from University of Poitiers in 2005 and National Habilitation in Mechanics from University of Poitiers in 2018. He servers as Associate Editor in several reputed internationals journals including ASME Journal of Medical Devices, Robotic Intelligence and Automation (Emerald Publishing), Mechanical Sciences (Copernicus Publications), MDPI Robotics and MDPI Machines. He is a member of international scientific committee of RAAD, MESROB and ROMANSY. His research interests, at the Department of G.M.S.C. of PPRIME Institute, include aspects on robots design, mechanism synthesis, cable driven robots, parallel robots, haptic interfaces, collaborative robots with more than 53 published peer reviewed journal papers, 9 edited books, 10 edited journal special issue, 6 PhD students. He is leading several national and international research projects in the fields of medical robotics and biomimetics
    Reader Comments
  • © 2023 the Author(s), licensee AIMS Press. This is an open access article distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/4.0)
通讯作者: 陈斌, bchen63@163.com
  • 1. 

    沈阳化工大学材料科学与工程学院 沈阳 110142

  1. 本站搜索
  2. 百度学术搜索
  3. 万方数据库搜索
  4. CNKI搜索

Metrics

Article views(1696) PDF downloads(89) Cited by(0)

Figures and Tables

Figures(10)  /  Tables(6)

Other Articles By Authors

/

DownLoad:  Full-Size Img  PowerPoint
Return
Return

Catalog