**1. Introduction**

Programs to simulate a variety of mechanisms were initially developed to solve mathematical equations involved in the interconnection among elements of such mechanisms. The solving of systems of non-linear algebraic equations (or algebraic–differential equations in the case of dynamics) was a constant "burden" every time a mechanism had to be analyzed. General-purpose multibody dynamics programs subsequently emerged with the same target as general-purpose finite element programs. Among the softwares available at the time, the following general-purpose multibody dynamics programs were prominent: ADAMS [1,2], AUTOLEV [3], COMPAMM [4], DADS [5], DYMAC [6], and MESA [7]. This paper focuses on programs intended for mechanism simulations related to education, and few of them have any didactic capacity. It is challenging to find references in the literature where general-purpose programs are used for teaching. Some specific cases can be found, such as the Virtual Lab based on ADAMS presented in [8]. The authors claimed, however, that the exercises to be solved by students need to be carefully selected due to the complexity of the program. On the contrary, they remarked the advantage of employing a program that is commonly used in the industry so that students can learn it in college.

Another group of more specific programs for the analysis and synthesis of mechanisms was developed in the context of mechanisms and machine theory (MMT). The following are noteworthy: KINSYN [9], LINCAGES [10], and RECSYN [11]. University lecturers in machines and mechanisms have participated in the development of these programs, because of which they focus on a didactic approach. Recent softwares in this group are MechDev [12] and WinMecC [13,14], both dedicated to the analysis and synthesis of planar mechanisms. The most remarkable characteristic of WinMecC is its dimensional synthesis module based on evolutionary algorithms. MechDev has a special architecture based on plug-ins, including an algorithm that combines analytical with numerical computation.

**Citation:** Macho, E.; Urízar, M.; Petuya, V.; Hernández, A. Improving Skills in Mechanism and Machine Science Using GIM Software. *Appl. Sci.* **2021**, *11*, 7850. https://doi.org/ 10.3390/app11177850

Academic Editors: Jae Hyuk Lim, Jin-Gyun Kim and Peter Persson

Received: 27 July 2021 Accepted: 24 August 2021 Published: 26 August 2021

**Publisher's Note:** MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

**Copyright:** © 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/).

Another powerful program similar to them is Working Model 2D [15], which is capable of modeling mechanisms in an interactive way.

Dynamic geometric environments (DGEs) are software tools that are being commonly used nowadays to teach MMT. They allow for the building of parametrized geometric entities. GeoGebra [16] is a representative DGE. Mathematical libraries that can be used to support the teaching of many subjects related to mechanism and machine science are another type of technological tools. For example, the graphical programming environment Simulink of MATLAB is a good choice for implementing and solving the dynamics of the mathematical models of mechanical systems [17]. The MATLAB framework has proven to be useful for the development of active teaching–learning methodologies, such as the one designed to teach kinematic and dynamic analyses of 3D multibody systems proposed in [18]. Finally, there are some cases in which CAD systems have been used to simulate mechanisms for teaching. However, this does not appear to be the most adequate option as they are not specific programs for mechanisms, are usually expensive, and do not focus on didactic approaches.

The software presented in this paper (GIM), the initial steps of which were introduced in [19], is a general-purpose software that can handle planar and spatial systems of any number of degrees of freedom. It was developed by the COMPMECH research group of the Department of Mechanical Engineering of the University of the Basque Country UPV/EHU in Spain. It is designed for teaching and learning activities related to important subjects in mechanical engineering, such as applied mechanics, mechanism and machine theory, computational kinematics and dynamics, mechanical design, and robotics. GIM has also been used as a tool for the development of several doctoral theses, and their results have served as important feedback to develop and improve its computational modules.

### **2. Capabilities and Potential of GIM**

One of the aims of using GIM is to help students better understand the theoretical concepts explained in lectures in class, and to motivate them to work independently with the software to develop their skills on it. The software is available for free.

This section provides a general idea to the reader of the tools provided by GIM related to the learning process. A planar example is first developed. The case study chosen is the quick return mechanism, and is posed in the same way that it would be to students. The goal is to obtain the value of the actuating torque required to achieve a specified motion when some resisting loads are applied as shown in Figure 1.

**Figure 1.** Proposed case study.

To solve this exercise, students have to follow basic steps:


Since simply an example is not enough to show the potential of this software and all options that the students can exploit to improve their learning skills, additional aspects are explained.

#### *2.1. Geometry Module—Case Study*

A kinematic sketch is a geometrical model of the mechanism in which ideal joints are considered and elements are modeled as perfectly rigid bodies. The student can build the geometrical model to make a kinematics or dynamics simulation simply and quickly. A trained user can have any model ready for simulation in a few minutes.

For analysis, the mechanism is defined directly in an assembled position, but not necessarily with empirical dimensions. The first step consists of defining the points of interest of the mechanical system, called nodes. To do this, the students can directly type the coordinates of the nodes or set their positions using the mouse pointer. In the second step, using these nodes, elements of the mechanism are built. The user simply selects the nodes belonging to the same element. Finally, the kinematic joints between elements are set from a list.

Even in the process of geometrical definition, students can compare the results with their knowledge, because each time a geometrical change is made, the program computes the number of degrees of freedom and the number of redundant constraints of the model in its given state.

Once the topology of the mechanism has been defined, the user can still modify the position of any node and orientation of any joint, or—what constitutes a more practical capability—can edit such values of the geometrical constraints as lengths of elements or angles between them. This is useful because the empirical geometrical data of a mechanism is often given by the sizes of elements and certain positional constraints, but does not include the coordinates of the moving nodes.

Figure 2 shows the process of generating the geometrical model of the Quick Return mechanism, which is used as an example to illustrate the teaching/self-learning capabilities of the program. This paper is not intended to be a user manual, and accordingly, practical instructions are not provided. The images of the software provided here should be sufficient for the reader to understand the main idea of GIM.

#### Geometry Module–Additional Considerations

The GIM is a general-purpose software that can to deal with planar and spatial systems of any number of degrees of freedom. This is why the geometry module implements a wide collection of kinematic joints including all the most commonly used ones in practice (Figures 3 and 4).

Some of them require the definition of additional geometric information—for example, the orientation of axes of the joint for spatial revolution. In these cases, once more, the student can use the keyboard or the mouse (with or without a grid option). Any joint type can be set as a fixed joint by connecting elements with a fixed frame. Moreover, the most convenient system of coordinates (Cartesian or polar) can be used in the geometric function (Figure 5). The spatial joints and links are modeled as easily as the planar ones.

**Figure 3.** Planar joints implemented in GIM.

**Figure 4.** Spatial joints implemented in GIM.

**Figure 5.** Position of a point in spherical coordinates.

#### *2.2. Kinematics Module—Case Study*

The three main kinematic problems, i.e., those of position, velocity, and acceleration, can be solved in GIM. For this, the student needs to define as many actuators as the number of degrees of freedom of the mechanism. Each actuator is established as a motion function that specifies the value of its position variable, and the first and second derivatives along time. The most common types of actuators (fixed rotations, relative rotations, pistons, and sliders) as well as the most common types of motion functions (constant velocity or acceleration, polynomial, sinusoidal) are provided. The multibody approach based on natural coordinates is implemented to obtain the primary results: the simulation of motion of the mechanism (trajectories of all nodes, and velocities and accelerations at all nodes in each position).

As shown in Figure 6, all results can be graphically plotted along with the mechanism at any position, which makes it possible to visually analyze their evolution during motion. It also becomes possible to evaluate the variation of any parameter along the time tracing the corresponding function.

Using this computation module, apart from having at hand the numerical results of the proposed problem (as a mechanism calculator), students can corroborate the relevant theoretical concepts studied during lectures. Some examples are shown in Figure 7:


time point velocity along the motion

**Figure 6.** Main kinematic results: Trajectories, velocities, and accelerations for given inputs.

**Figure 7.** Visualizing decomposition of velocity and acceleration.

Once the analysis has been concluded, the student can modify any kinematic or geometric parameter to see how this affects the results, which are recomputed in real time.

• In the context of relative motion, they realize how this decomposition is made in relative and frame (and the Coriolis acceleration) components. They can verify that

the Coriolis acceleration is always perpendicular to relative velocity.

#### Kinematics Module—Additional Considerations

Apart from the main results, additional derived results are provided, such as the centers of curvature of the points, instantaneous centers of rotation of the elements, and fixed and moving centrodes. In addition, all results can be computed in terms of absolute motion or that relative to any moving element. Some of these additional capacities are shown in Figures 8–11.

**Figure 8.** Disk element fixed and moving centrodes in absolute and relative motions. Velocities of poles.

**Figure 9.** Angular velocities and accelerations. Loci of center of curvature of a trajectory.

**Figure 10.** Swept of revolute joint axis swept. Element's swept. Fixed and moving axodes with the instantaneous axes of rotation and sliding.

**Figure 11.** Complex trajectories of one degree-of-freedom mechanisms computed automatically (see Videos S1 and S2 of the Supplementary Material to visualize the motions of both mechanisms).

## *2.3. Dynamics Module–Case Study*

Dynamic problems consider simultaneously motion and forces. GIM can solve two main types of dynamics problems, i.e., problems in inverse dynamics (kinetostatic problem) and direct dynamics. If all actuators are controlled in terms of position, velocity, and acceleration, as in the kinematics module, the motion of the mechanism is defined and can be computed independently from the existing forces. The unknowns of this problem are the values of the driving loads required to achieve such motion (considering resistant applied loads), and are computed by means of a kinetostatic approach. On the contrary, when all applied load values are known, the resulting motion is dependent on such values, i.e., the motion cannot be computed using a purely kinematic approach, and the direct dynamics problem has to be simulated.

Apart from driving loads (known values in direct dynamics but unknowns in inverse dynamics), the student can define as many external resistant loads as desired. The available loads are punctual as well as linearly distributed forces and torques. In this module, to compute inertial loads, the properties of mass of each element need to be specified. The default values of the center of gravity and moment of inertia are automatically computed depending on the shape of the element, but because this shape is sometimes just a kinematic sketch (the real element may have a different shape), these defaults can be substituted by custom values. Elemental weights are also considered if a value of gravitational acceleration is defined. Figure 12 shows the proposed case study, and the value of the torque required over time to achieve a specific constant rotational velocity in the actuator under certain external loads.

**Figure 12.** Value of driving load for the computation of inverse dynamics.

A number of additional results can be visualized apart from the above. In any dynamics problem, if the mechanism is non-redundant, a complete analysis of the force of the mechanical system is performed to compute the reaction forces and torques at the joints between elements. In addition, for linear elements, a diagram of internal efforts can be computed. As shown in Figure 13, the real distribution of weight and inertial forces along the element are considered. This force analysis is conducted for each position of the simulation, and thus the evolution of any of these results can be represented along the motion.

The student has the option of visualizing the values of any internal effort as a color map for the entire mechanical system at a position. Any internal effort diagram of an element can be also traced along time (motion), as shown in Figure 14.

**Fi 13** F lid d i l ff ' di **Figure 13.** Free solid and internal efforts' diagrams.

**Figure 14.** Color map of internal effort for all systems and evolution over time for an element.

Using the tools provided in the computation module, the students can check/verify in a very clear way some of the concepts imparted to them theoretically, such as the following:


Other characteristics, such as the fact that when a body has only forces at two points, both are in the direction of the line connecting the points, and are in the opposite direction when a body has forces only at three points and their action lines intersect at a point.

#### Dynamics Module—Additional Considerations

Other standard elements commonly used in dynamic analyses, like springs and dampers, are also implemented in the software to use to model mechanical systems. Because the methodology implemented has a general purpose, it is valid for a system with

any number of degrees of freedom, including isostatic structures (mechanical systems with zero degrees of freedom and zero redundancies), such as the one shown in Figure 15.

**Figure 15.** Axial forces of isostatic structure.

When a direct dynamics problem is computed, the motion is unknown, and simulating it often requires the numerical integration of a system of differential equations because, due to the complexity inherent to the problem, it does not have an analytical solution. This task is programmed in the software, thus students can observe the result (Figure 16). The motion of the mechanism shown in Figure 16 can be visualized in the third video included in the Supplementary Material.

**Figure 16.** Simulating the motion of a chain released to the effect of gravity from repose.
