Keywords

1 Introduction

At the moment, there are a number of specialized software products that allow the analysis of kinematic chains, but at the same time solving only the specific direct kinematics problem, without the possibility of solving the optimization problem and enumerating many solutions [1, 3, 13, 16]. Such packages and software systems include commercial software package ADAMS, which provides the ability to design and optimize kinematic chains. ADAMS is a powerful tool, but requires a high level of knowledge and experience with such programs. In addition, this program is proprietary [10, 11, 17, 18] and has strong licensing constraints. Also CATIA has the kinematic analysis tools which enable 3D modelling of compounds with any degree of freedom and the output of the motion curves of the mechanism parts, but they do not have the ability to optimize generated solutions [12]. There is a modern JavaScript library for modelling, visualization and analysis of linkages called mec2  [9]. It provides the main advantage—simplicity of code visualizing the linkage. But this solution has no possibility to multiply variants of calculation for given structural schema  [9]. The another linkage design tool—WinMeCC  [2, 5] is also proprietary. It provides user-friendly interface (Fig. 1Footnote 1) but very limited possibilities to build linkage libraries, open stocks and optimized collections.

Fig. 1.
figure 1

WinMeCC—main window (advertisement from official website)

The program developed and implemented by the authors which is written in Python programming language is the open source solution aimed primarily to efficient enumeration of many variants of kinematic schemes, which allows, as the first approximation to obtain the semi-optimal or optimal solution. A library of mechanisms has also been created as a set of structural schemes with parametrically defined geometric parameters. Thus, this program gives user the freedom of choice both in the structure of the mechanism limited only by the size of the library, and in the selection of parameters with respect to which there will be a search for an optimal solution. The output of the program is a set of calculated parameters that provide minimized target function. This set of geometric snapshots can then be converted to several formats and visualized as motile mechanism using any of the above mentioned toolchains.

2 Advantages of Computer-Aided Design of Technological Systems

The main idea in the implementation of the program code was the principle of maximally free assignment of the base parameters and the whole model as it should be  [6]. At the same time, it is obvious that excessive freedom of input of the initial data, meaning the creation of directly structural schemes from basic elements, such as points and vectors, only leads to a complication of the initial data. The limitation in the form of a library of mechanisms makes it possible to speed up the process of formulating parameters for the program and at the same time avoids wasting time on the calculation of solutions in which it is impossible to obtain a satisfactory result. In addition, this approach reduces the number of errors that can be made when setting conditions in the program.

As a result, the user gets the opportunity to quickly and easily obtain an initial approximate solution for his task, with a minimum of effort spent directly on the formulation of the problem and the methods for solving it. This provides several advantages:

  1. 1.

    Significantly accelerate the process of obtaining a preliminary design, which can then be refined using more accurate software systems;

  2. 2.

    Elimination of deliberately unsatisfactory options, which also saves time spent on design and avoids further problems when working out a specific solution.

The resulting program has the ability to integrate with other programs. The output format of the program is simple to understand and easy to change, which allows the user to transfer geometric parameters to another program to visualize the solution, or to carry out further refinement calculations.

3 Synthesis of a Mechanism for a Given Function of the Output Joint: An Example of a Solution

Setting the initial data: Using the built-in library, the user chose several structural schemes for which the calculation will be done, and also sets the necessary output motion curve \( \phi _{out}=f(\phi _1)\) for each scheme having one degree of freedom. The selected mechanisms with the names assigned to them are displayed in the left window. At the next stage, the parameters that will change during the calculation together with their range of variation, and the constants are set in the right window (Fig. 2).

Fig. 2.
figure 2

Main window of the program

Examples of selection are shown in (Fig. 3).

Fig. 3.
figure 3

Selection

3.1 Calculation of the Direct Kinematic Problem

The program performs optimization dimensional synthesis for each mechanism selected from the library, thus allowing to compare the results between different structural schemes to find the better solution. In the program code, equations for the selected mechanisms are automatically generated and solved, taking into account the selected variable parameters. The result.txt file is created at the output with all satisfactory parameters for which the task has a solution and the corresponding values of the target function. In our example, we need to find a mechanism for which the motion curve of the output joint is as close as possible to the required one and the target function is defined as

$$\begin{aligned} \varDelta = \int \limits _{\phi } (\phi _{out}^{calculated} - \phi _{out}^{given})^2 \end{aligned}$$

Figure 4 represents the obtained result.

The most optimal solution here is found by the minimum value of the target function and the motion curves are displayed for it (Fig. 6), where the red line is the user-defined output law for changing the angle, and the blue one is the obtained law by solving systems of equations.

During the calculation process, all internal parameters can be used to iteratively calculate not only the target function, but also any other functionality that the user sets manually, for example, the sum of the lengths of the links. The resulting functionalities are also added to the result.txt file. The architectural solution of the program implies the creation in the global memory area of all objects of the selected classes of mechanisms, as well as current variable parameters. Below is the part of the code that describes the function that starts the optimization calculation (Fig. 5).

Fig. 4.
figure 4

Resulting dataset

Fig. 5.
figure 5

CalcModel function

The equations to be solved are compiled with respect to the variable parameters. The use of the global memory region allows sequential calculations, that is, to use the results obtained in one object, as source data for subsequent objects.

3.2 Visualization

To visualize the optimized kinematic scheme, a written script is used that converts the format of the program results to the JSON format which allows further work with the obtained linkage. For example constructing of the motion law of any joint. Choosing a specific kinematic scheme and link sizes from the result file, the user can convert this data and transfer it to the program for visualization. Converted input file obtained using the script, the constructed and visualized linkage are shown in (Fig. 7).

Fig. 6.
figure 6

Comparison of kinematic functions

Fig. 7.
figure 7

Converted input file and graphic representation of the mechanism (screenshot of mec2 web canvas)

4 Development Prospects: Training

In addition to the direct use of the written program for designing linkages, when used, it becomes possible to process and analyse the obtained array of results, which allows to trace the influence of individual geometric parameters on the kinematics of the system. In addition, the use of structure libraries over time will develop the user’s intuitive thinking when choosing a kinematic scheme and variable parameters. Thus, the program will increase understanding of design issues among inexperienced designers, and for professionals it will become an additional tool for quick verification and analysis of their own ideas. Developing the idea of learning, the next step will be the implementation of full automation, in which the design experience is somehow saved in the form of a database and used in machine learning [14, 15]. In this case, a trained ML system will be able to offer initial structural schemes itself, thereby leaving human user input only for the stage of formulating the problem. This approach can also stimulate development of special mechanics and assistance tools such as mechanisms with flexible parts and limited joint movement  [4, 7, 19].

5 Conclusion

Optimization problems in the design of mechanisms were successfully solved in the implemented program code. On the example of solving the optimization problem of the synthesis of a planar mechanism according to the known motion curve of the output joint, it was shown:

  • The ability to automate the design process, increasing the speed of development and the quality of the result;

  • The ability to process a dataset for AI training based on the analysis of an existing array of solutions obtained using the program.

Thus, the written program is the first step to fully automate the design process [8]. The development of such programs is a promising direction, allowing us to take the class of optimization tasks to a new level. The next step for development of this program is to make it open source to increase possibilities for other developers to improve the code and to develop their own tools based on the free software model  [17].