A simulation method for a crank slider mechanism
By defining translation and rotation connectors on the Modelica simulation platform, building a crank slider mechanism model and solving the dynamic equation, the design cycle extension problem caused by the lack of crank slider mechanism elements in the prior art is solved, and the crank slider mechanism is realized Improve efficient simulation and design efficiency.
Patent Information
- Application Number
- CN202410565220.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-09
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2044-05-09
AI Technical Summary
The lack of crank slider mechanism components in the existing Modelica's own mechanical library has caused designers to re-customize each time, and the design cycle becomes longer.
By defining translation and rotation connectors on the Modelica simulation platform, building a crank slider mechanism model, establishing a system of dynamic equations, solving the rheological variables and potential variables, the motion and force simulation of the crank slider mechanism is realized.
The design process is simplified, the design cycle is shortened, the effective simulation of the crank slider mechanism is realized, and the design efficiency is improved.
Smart Images

Figure CN118278133B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of simulation, in particular to a simulation method of a crank slider mechanism. Background Art
[0002] The slider-crank mechanism refers to a planar connecting rod mechanism that uses a crank and a slider to realize the conversion between rotation and movement. In the slider-crank mechanism, the component that forms a moving pair with the frame is the slider, and the component that connects the crank and the slider through a rotating pair is the connecting rod. The slider-crank mechanism is widely used in the main mechanism of reciprocating piston engines, compressors, punching machines, etc., to convert reciprocating movement into a partial or full rotational motion; compressors and punching machines use the crank as the active component to convert full rotation into reciprocating movement. Many designers will use existing simulation software to simulate the structure of the equipment and complete the simulation operation in the design stage.
[0003] Modelica simulation platform is a common simulation tool that can customize components with different functions using its own language. When using modelica's own mechanical library to build a simulation model, the required mechanical movement can be achieved based on the combination of different components. However, there are currently no components for crank slider mechanisms in Modelica's own mechanical library. If the movement and force of the crank slider mechanism are to be realized, the designer needs to re-establish a customized crank slider mechanism based on the modelica language every time, which will prolong the design cycle. Summary of the invention
[0004] In order to solve the problem that there is no crank slider mechanism element in the existing Modelica self-owned mechanical library, each design needs to re-establish a customized crank slider mechanism, which leads to a longer design cycle. The present invention provides a crank slider mechanism simulation method, which can provide a crank slider mechanism simulation method based on Modelica. The method is simple, universal, and has a wide range of applications, and can effectively shorten the design cycle.
[0005] The technical solution of the present invention is as follows: a simulation method of a crank slider mechanism, characterized in that it comprises the following steps:
[0006] S1: According to the structure of the crank slider mechanism, two translational mechanical interfaces are referenced based on the translational connector, which are defined as flange_a and flange_b; based on the rotational connector, two rotational mechanical interfaces are introduced, which are defined as mount_a and mount_b;
[0007] The crank slider mechanism model is built based on two translation connectors. The motion of the translation connectors flange_a and flange_b is affected by the inertial reference frame mount_a and mount_b.
[0008] S2: defined connector variables, including potential variables and flow variables;
[0009] The potential variables include: s, phi, cos_phi, sin_phi, cos_alpha, sin_alpha and dsdphi;
[0010] Where radius is the length of the rotating connecting rod of the crank slider mechanism, length is the length of the connecting rod, the distance between the slider and the rotation center is offset, the rotating connecting rod angle is phi, the position of the slider is s, alpha is the angle between the connecting rod with a length of length and the direction of movement of the slider, dsdphi is the derivative of the angular displacement between the connecting rod with a length of length and the crank with a length of radius;
[0011] The flow variables include: flange_a.tau, mount_a.tau, flange_b.f and mount_b.f;
[0012] Among them, flange_a.tau represents the variable of the torque of the translation connector flange_a, mount_a.tau represents the variable of the torque of the rotation connector mount_a, flange_b.f represents the variable of the force of the translation connector flange_b, and mount_b.f represents the variable of the force of the rotation connector mount_b;
[0013] The flow variables are directly implemented by referencing variables in the interface, where mount_a and mount_b related quantities are user input quantities;
[0014] S3: construct a group of dynamic equations in the crank slider mechanism model based on the relationship of the mathematical model, and after solving them, all flow variables and the values of potential variables flange_a.tau and flange_b.f can be obtained; the rotation potential variables, rotation flow variables, translation potential variables and translation flow variables in the crank slider structure are solved to complete the simulation calculation of the crank slider mechanism model;
[0015] S4: Using the Modelica simulation platform, based on the solved data values of the flow variables and potential variables, the crank slider mechanism model is implemented to obtain a component model, thereby realizing the transmission of various physical quantities of the movement and force of the crank slider mechanism.
[0016] It is further characterized by:
[0017] In step S3, a set of equations is constructed in the crank slider mechanism model based on the relationship of the mathematical model, which specifically includes the following steps:
[0018] a1: According to the structure of the crank slider, construct the equation group:
[0019] sin_alpha*length+offset=sin_phi*radius;
[0020] a2: Construct the equation for the position s of the slider:
[0021] s=radius*cos_phi+length*cos_alpha;
[0022] a3: According to the sine and cosine theorem:
[0023] sin_alpha=(radius*sin_phi-offset) / length;
[0024] cos_alpha=sqrt(1-sin_alpha^2);
[0025] get:
[0026] cos_alpha=sqrt(1-sin(alpha)^2)=sqrt(1-((radius*sin_phi-offset) / length)^2);
[0027] a4: If we take the derivative of s and cos_alpha, we get:
[0028] dsdphi=-radius*sin(flange_a.phi-mount_a.phi)+1 / 2 / sqrt(1-((radius*sin_phi-offset) / length)^2)*(-2*((radius*sin_phi-offset) / length))*radius*cos_phi;
[0029] a5: Based on the relationship between potential variables, rotation angle and translation displacement, construct the equation:
[0030] phi-phi0 = (flange_a.phi-mount_a.phi);
[0031] s-s0 =(flange_b.s-mount_b.s);
[0032] a6: The crank slider mechanism composed of flange_a and flange_b is affected by mount_a and mount_b of the inertial reference system. The potential variables at the connection of the crank slider mechanism are equal, and the sum of the flow variables at the connection is 0. Construct the equation:
[0033] 0=flange_a.tau+dsdphi*flange_b.f;
[0034] 0 = flange_a.tau+mount_a.tau;
[0035] 0 = flange_b.f+mount_b.f;
[0036] In step S2, the potential variable is defined as Real type.
[0037] The present application provides a simulation method for a slider crank mechanism. According to the structure of the slider crank mechanism, two translation interfaces and two rotation interfaces are referenced, and dynamic equations are established between the interfaces. Through the code of Modelica, the transmission of various physical quantities of the movement and force of the slider crank mechanism is realized. The method is simple in concept, and the conversion between rotation and translation can be realized through custom components. The method is simple, has universality, and has a wide range of applications, which can effectively shorten the design cycle. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 is a schematic flow chart of a simulation method of a crank slider mechanism in this method;
[0039] Figure 2 It is an example of a connector in the modelica software platform;
[0040] Figure 3 An embodiment for realizing the system of equations;
[0041] Figure 4 is a schematic diagram of a crank slider structure in the present method;
[0042] Figure 5 Schematic diagram of the inertial reference system of the crank slider mechanism in this method. DETAILED DESCRIPTION
[0043] The existing Modelica mechanical library provides some simple part models. However, the crank slider mechanism is a combination of multiple rigid connecting rods and sliders. Therefore, the crank slider mechanism customized by this method considers the following situations:
[0044] 1) The speed, torque and angular displacement of the rotating parts in the input and output crank slider mechanism;
[0045] 2) The translation speed, force and linear displacement of the translation part of the slider in the input and output crank slider mechanism;
[0046] 3) The motion control of the entire system of the crank slider mechanism on other parts.
[0047] Modelica is an open, object-oriented, equation-based computer language that can easily model complex physical systems across different fields. Figure 1 In the illustrated embodiment, as a method implemented based on the Modelica simulation platform, the method includes defining interfaces, defining parameters, defining variables, and defining basic equations of the interfaces.
[0048] Specifically, the present application includes a simulation method for a crank slider mechanism, which includes the following steps.
[0049] S1: According to the structure of the slider-crank mechanism, two translational mechanical interfaces are referenced based on the translational connector, defined as flange_a and flange_b; two rotational mechanical interfaces are introduced based on the rotational connector, defined as mount_a and mount_b. The slider-crank mechanism model is constructed based on the two translational connectors, and the motion of the translational connectors flange_a and flange_b is affected by the inertial reference frame mount_a and mount_b.
[0050] The translational mechanical interface and the rotational mechanical interface are actually the connectors or connector classes encapsulated in the Modelica language. Figure 4 Shown is a schematic diagram of the crank slider structure.
[0051] S2: defined connector variables, including potential variables and flow variables;
[0052] The potential variables include: s, phi, cos_phi, sin_phi, cos_alpha, sin_alpha and dsdphi; in step S2, the potential variables are defined as Real type.
[0053] Where radius is the length of the rotating connecting rod of the crank slider mechanism, length is the length of the connecting rod, the distance between the slider and the rotation center is offset, the rotating connecting rod angle is phi, the position of the slider is s, alpha is the angle between the connecting rod with a length of length and the direction of movement of the slider, dsdphi is the derivative of the angular displacement between the connecting rod with a length of length and the crank with a length of radius;
[0054] Flow variables include: flange_a.tau, mount_a.tau, flange_b.f, and mount_b.f;
[0055] Among them, flange_a.tau represents the variable of the torque of the translation connector flange_a, mount_a.tau represents the variable of the torque of the rotation connector mount_a, flange_b.f represents the variable of the force of the translation connector flange_b, and mount_b.f represents the variable of the force of the rotation connector mount_b;
[0056] Flow variables are directly implemented by referencing variables in the interface, where mount_a and mount_b related quantities are user input quantities.
[0057] The implementation of the slider-crank mechanism of this method is firstly achieved by directly referencing the translation connector and the rotation connector, then by customizing the variables in the connector in Modelica, and finally by defining 9 equations. Figure 2 , so that these variables can communicate with the outside world. Therefore, in the end, the variables between different interfaces can be coupled through equations to solve the variables, thereby solving the rotation and translation related physical quantities in the crank slider mechanism.
[0058] like Figure 2 , use drag-and-drop modeling in the Modelica software platform, reference 2 translational mechanical interfaces: flange_a and flange_b, and 2 rotational mechanical interfaces: mount_a and mount_b. Modelica will automatically reference the respective flow variables and potential variables in the mechanical interfaces. By switching to the code area, you can define parameters, variables, and equations to make Figure 2 The flow variables and potential variables of the four mechanical interfaces in the example above produce corresponding results.
[0059] S3: Construct a group of dynamic equations based on the relationship of the mathematical model in the crank slider mechanism model. After solving them, all flow variables and the values of potential variables flange_a.tau and flange_b.f can be obtained; realize the solution between the rotational potential variables, rotational flow variables, translational potential variables and translational flow variables in the crank slider structure, and complete the simulation calculation of the crank slider mechanism model.
[0060] In step S3, a set of equations is constructed in the crank slider mechanism model based on the relationship of the mathematical model, which specifically includes the following steps:
[0061] a1: According to Figure 4 The structure of the crank slider shown in
[0062] If we define the length of the rotating link as radius, the length of the link as length, the distance between the slider and the center of rotation as offset, and the angle of the rotating link as phi, then it is easy to construct the equation:
[0063] sin_alpha*length+offset=sin_phi*radius;
[0064] In this method, sin_alpha is sin(alpha), cos_alpha is cos(alpha), and other angle-related calculation expressions are the same;
[0065] a2: Construct the equation for the position s of the slider:
[0066] s=radius*cos_phi+length*cos_alpha;
[0067] a3: According to the sine and cosine theorem:
[0068] sin_alpha=(radius*sin_phi-offset) / length;
[0069] cos_alpha=sqrt(1-sin_alpha^2);
[0070] get:
[0071] cos_alpha=sqrt(1-sin(alpha)^2)=sqrt(1-((radius*sin_phi-offset) / length)^2);
[0072] a4: If we take the derivative of s and cos_alpha, we get:
[0073] dsdphi=-radius*sin(flange_a.phi-mount_a.phi)+1 / 2 / sqrt(1-((radius*sin_phi-offset) / length)^2)*(-2*((radius*sin_phi-offset) / length))*radius*cos_phi;
[0074] a5: Based on the relationship between potential variables, rotation angle and translation displacement, construct the equation:
[0075] phi-phi0 = (flange_a.phi-mount_a.phi);
[0076] s-s0 =(flange_b.s-mount_b.s);
[0077] a6: The crank slider mechanism composed of flange_a and flange_b is affected by mount_a and mount_b of the inertial reference system. The potential variables at the connection of the crank slider mechanism are equal, and the sum of the flow variables at the connection is 0. Construct the equation:
[0078] 0=flange_a.tau+dsdphi*flange_b.f;
[0079] 0 = flange_a.tau+mount_a.tau;
[0080] 0 = flange_b.f+mount_b.f.
[0081] like Figure 3 As shown, it is an embodiment of the specific implementation of the equation group. The variables required in the equation are divided into potential variables and flow variables. Potential variables include: s, phi, cos_phi, sin_phi, cos_alpha, sin_alpha and dsdphi, and the data types of these variables are defined as Real type. The flow variables in the equation are directly implemented by referencing the variables in the interface. Specifically include: flange_a.tau, mount_a.tau, flange_b.f and mount_b.f, where the related quantities of mount_a and mount_b are user input quantities. Therefore, in the definition equation area, a total of 9 equations are generated, and there are 9 unknown variables, and the equations are closed.
[0082] S4: The crank slider mechanism model is implemented using the Modelica simulation platform based on the solved data values of the flow variables and potential variables to obtain a component model, thereby realizing the transmission of various physical quantities of the crank slider mechanism's motion and force.
[0083] Modelica is a declarative modeling, which means that unlike MATLAB, Modelica does not stipulate that the left side of the equal sign is always the output variable and the right side of the equal sign is always the input variable. In other words, as long as the unknown quantity is in the equation and the equation is closed, Modelica can solve the unknown quantity. Finally, the solution between the rotational potential variable, rotational flow variable, translational potential variable and translational flow variable in the crank slider structure can be realized.
[0084] One of the notable features of the Modelica language is the definition of flow variables and potential variables between interfaces. Specifically, the potential variables at the connection are equal; the sum of the flow variables at the connection is 0. Therefore, there are five equations as follows:
[0085] phi-phi0 = (flange_a.phi-mount_a.phi);
[0086] s-s0 =(flange_b.s-mount_b.s);
[0087] 0=flange_a.tau+dsdphi*flange_b.f;
[0088] 0 = flange_a.tau+mount_a.tau;
[0089] 0 = flange_b.f+mount_b.f.
[0090] The equations define four interfaces: flange_a, mount_a, flange_b, and mount_b, which are two translation interfaces and two rotation interfaces. The first two equations express the relationship between the potential variables, rotation angle, and translation displacement between the connector interfaces. The last three equations express the relationship between the flow variables, force, and torque between the connector interfaces. Figure 5 The crank slider mechanism composed of flange_a and flange_b is shown in the figure and is affected by mount_a and mount_b of the inertial reference system and is added to the above five equations.
[0091] In summary, the present invention is based on the characteristics of flow variables and potential variables in the modelica language. By defining 7 different variables and referencing the rotation angle (phi), displacement (s), force (f) and torque (tau) of flange_a, mount_a, flange_b, and mount_b themselves, a closed set of equations is formed, ultimately achieving the purpose of solving the flow variables (force, torque) and potential variables (displacement, angle) of the crank slider mechanism.
[0092] This method can achieve the conversion between rotation and translation through custom components. Specifically, it can achieve:
[0093] 1) Conversion between angular displacement and translational displacement;
[0094] 2) Conversion between angular velocity and translational velocity;
[0095] 3) Conversion between angular acceleration and translational acceleration;
[0096] 4) The conversion between the torque applied during rotation and the translational force.
[0097] The crank slider mechanism simulation method based on Modelica provided by this method is suitable for the realization of crank slider mechanism in equipment in various fields because of its simplicity and small calculation amount, thus saving manpower and reducing labor intensity.
Claims
1. A method for simulating a crank slider mechanism, characterized in that: It includes the following steps: S1: According to the structure of the crank slider mechanism, two translational mechanical interfaces are referenced based on the translational connector, which are defined as flange_a and flange_b; based on the rotational connector, two rotational mechanical interfaces are introduced, which are defined as mount_a and mount_b; The crank slider mechanism model is built based on two translation connectors. The motion of the translation connectors flange_a and flange_b is affected by the inertial reference frame mount_a and mount_b. S2: defined connector variables, including potential variables and flow variables; The potential variables include: s, phi, cos_phi, sin_phi, cos_alpha, sin_alpha and dsdphi; Where radius is the length of the rotating connecting rod of the crank slider mechanism, length is the length of the connecting rod, the distance between the slider and the rotation center is offset, the rotating connecting rod angle is phi, the position of the slider is s, alpha is the angle between the connecting rod with a length of length and the direction of movement of the slider, dsdphi is the derivative of the angular displacement between the connecting rod with a length of length and the crank with a length of radius; The flow variables include: flange_a.tau, mount_a.tau, flange_b.f and mount_b.f; Among them, flange_a.tau represents the variable of the torque of the translation connector flange_a, mount_a.tau represents the variable of the torque of the rotation connector mount_a, flange_b.f represents the variable of the force of the translation connector flange_b, and mount_b.f represents the variable of the force of the rotation connector mount_b; The flow variables are directly implemented by referencing variables in the interface, where mount_a and mount_b related quantities are user input quantities; S3: construct a group of dynamic equations based on the relationship of the mathematical model in the crank slider mechanism model, and obtain all flow variables and the values of potential variables flange_a.tau and flange_b.f after solving them; realize the solution between the rotational potential variables, rotational flow variables, translational potential variables and translational flow variables in the crank slider structure, and complete the simulation calculation of the crank slider mechanism model; S4: using the Modelica simulation platform to implement the crank slider mechanism model based on the solved data values of the flow variables and potential variables to obtain a component model, thereby realizing the transmission of various physical quantities of the movement and force of the crank slider mechanism; In step S3, a set of equations is constructed in the crank slider mechanism model based on the relationship of the mathematical model, which specifically includes the following steps: a1: According to the structure of the crank slider, construct the equation group: sin_alpha*length+offset=sin_phi*radius; a2: Construct the equation for the position s of the slider: s=radius*cos_phi+length*cos_alpha; a3: According to the sine and cosine theorem: sin_alpha=(radius*sin_phi-offset) / length; cos_alpha=sqrt(1-sin_alpha^2); get: cos_alpha=sqrt(1-sin(alpha)^2)=sqrt(1-((radius*sin_phi-offset) / length)^2); a4: If we take the derivative of s and cos_alpha, we get: dsdphi=-radius*sin(flange_a.phi-mount_a.phi)+1 / 2 / sqrt(1-((radius*sin_phi-offset) / length)^2)*(-2*((radius*sin_phi-offset) / length))*radius*cos_phi; a5: Based on the relationship between potential variables, rotation angle and translation displacement, construct the equation: phi-phi0 = (flange_a.phi-mount_a.phi); s-s0 =(flange_b.s-mount_b.s); a6: The crank slider mechanism composed of flange_a and flange_b is affected by mount_a and mount_b of the inertial reference system. The potential variables at the connection of the crank slider mechanism are equal, and the sum of the flow variables at the connection is 0. Construct the equation: 0=flange_a.tau+dsdphi*flange_b.f; 0 = flange_a.tau+mount_a.tau; 0 = flange_b.f+mount_b.f.
2. The method for simulating a crank slider mechanism according to claim 1, characterized in that: In step S2, the potential variable is defined as Real type.
