Intelligent optimization method and configuration of injection molding part structure and process parameters based on Python-Moldflow joint simulation
Through Python-Moldflow joint simulation, intelligent optimization of the workpiece structure and process parameters is achieved, solving the problems of low efficiency, error-prone and repetitive labor in the existing Moldflow simulation process, improving simulation efficiency and accuracy, and supporting efficient batch simulation and parameter optimization.
Patent Information
- Application Number
- CN202510582278.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-07
- Publication Date
- 2025-08-08
AI Technical Summary
The existing Moldflow simulation process is inefficient, error-prone, repetitive labor, and cumbersome results processing, lacks automated control and batch processing capabilities, especially in the parameterized modeling of the part molding process, gate position and angle setting, partial process parameter setting, batch result export and post-processing, etc.
The Python-Moldflow joint simulation is adopted, and the Moldflow simulation software is automatically controlled through the full process of Python scripts. The third-party modeling library is used for parameterized modeling, and the model files are automatically imported and exported. The process parameters are optimized in combination with machine learning algorithms to achieve intelligent optimization of the workpiece structure and process parameters.
It realizes full process automation, improves simulation efficiency and accuracy, optimizes the structure and process parameters of the parts, ensures the quality and production efficiency of the parts, supports efficient batch simulation and large-scale parameter sensitivity analysis, and is scalable.
Smart Images

Figure CN120449366A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of injection molding simulation technology and computer software technology, and in particular to an intelligent optimization method and configuration of injection molding part structure and process parameters based on Python-Moldflow joint simulation. Background Art
[0002] Plastic products have long been widely used in fields such as automobiles, electronics, and medical devices. The injection molding process has a significant impact on the performance and cost of parts. Injection molding, also known as injection molding, is a method in which a thermoplastic or thermosetting plastic is heated and melted, injected under high pressure into a closed mold cavity, and then released from the mold after cooling and solidification to produce a molded product. Modern injection molding technology is developing in the direction of combining simulation technology and intelligent mold design to further improve precision and efficiency. To predict potential manufacturing problems during the part design stage and shorten the development cycle, computer-aided engineering (CAE) technology is widely used to simulate and optimize the injection molding process. Among them, Autodesk Moldflow software, as an industry-leading injection molding simulation tool, can simulate the filling, holding pressure, cooling, and other processes during the molding process, as well as part warpage, helping engineers predict and resolve defects that may be caused by the manufacturing process, such as air pockets, weld lines, sink marks, and deformation.
[0003] However, the current Moldflow simulation process mainly relies on manual operation, that is, operation through the software's graphical user interface. As a result, the entire simulation process still has the following problems: Inefficiency: When simulating multiple parameter combinations, manually setting the parameters and conditions for each case is time-consuming and tedious. For example, optimizing process parameters or performing parameter sensitivity analysis may require hundreds or even thousands of simulation runs, and manual operation cannot meet the requirements for efficient iteration.
[0004] Error-prone: Manual operation can easily lead to incorrect parameter input, missed settings or misoperation due to negligence, affecting the accuracy and reliability of simulation results.
[0005] Repetitive work: For similar simulation cases, engineers need to repeat the same settings and operations. The lack of automation greatly reduces work efficiency.
[0006] Complicated result processing: The export and analysis of simulation results must be performed one by one in the graphical user interface (GUI). This makes it impossible to efficiently batch process and compare simulation results of different working conditions, hindering systematic data management and in-depth analysis.
[0007] While Moldflow already has some parameter batch simulation capabilities, they are incomplete and only cover a subset of process parameters. Furthermore, the current preferred language for developing Moldflow Synergy Application Programming Interface (API) scripts is Visual Basic Script (VBS), which has limited functionality, low development efficiency, and a lack of extensive third-party libraries, limiting expansion. Consequently, current Moldflow co-simulation still lacks capabilities in areas such as parametric modeling of part molding processes, gate location and angle settings, some process parameter settings, and batch result export and post-processing. A method is urgently needed to automate Moldflow software control, batch simulation execution, and automated result processing. Summary of the Invention
[0008] In order to solve the problems that the current Moldflow co-simulation still lacks in parametric modeling of part molding process, gate position and angle setting, some process parameter setting, batch result export and post-processing, the present invention provides an intelligent optimization method and configuration of injection molding part structure and process parameters based on Python-Moldflow co-simulation.
[0009] The present invention is achieved through the following technical solution: an intelligent optimization method for injection molding part structure and process parameters based on Python-Moldflow joint simulation, comprising the following steps: (1) Perform parametric modeling of the target part by calling a third-party modeling library through Python, and batch generate the structural parameters of the target part and the corresponding first STL (S Tereo Lithography) model file; (2) Start the Moldflow main program Moldflow Synergy through the Python script and import the first STL model file generated in step (1); (3) Set the meshing parameters, save the mesh information as a PAT file, select the material for injection molding, and obtain the default injection molding process parameters; (4) Call the Moldflow solver to perform simulation calculations. After the simulation calculations are completed, the Python script automatically exports the simulation result data and saves it as an XML file; (5) Extract eigenvalues according to the usage requirements or functional requirements of the target part, and determine the maximum or minimum eigenvalue as the optimal eigenvalue; (6) Select the structural parameters corresponding to the optimal eigenvalues as the optimal structural parameters of the target part; (7) Generate the corresponding second STL model file based on the optimal structural parameters obtained in step (6), import and divide the mesh, select the same injection molding material as step (3), continuously change the process parameters, and repeat steps (4) and (5) until a sufficient number of data sets with the changed process parameters as input and the corresponding eigenvalues as output are obtained; (8) Use the data set obtained in step (7) to train the machine learning model and obtain the optimal injection molding process parameters through optimization.
[0010] As a further improvement of the process technology solution of the present invention, in step (1), the third-party modeling library is a trimesh library.
[0011] As a further improvement to the process technology solution of the present invention, in step (2), the Python script communicates with the Component Object Model (COM) interface of Moldflow by importing the win32com.client module.
[0012] As a further improvement of the process technology solution of the present invention, in step (3), the injection molding process parameters include injection rate, holding pressure, holding time, mold temperature, melt temperature and cooling time.
[0013] As a further improvement of the process technology solution of the present invention, in step (4), the automatically derived simulation result data is the simulation result data of the injection molding quality index.
[0014] As a further improvement of the process technology solution of the present invention, the injection molding quality index is any one or a combination of several of deformation, sink mark, cavitation and shrinkage rate.
[0015] As a further improvement of the process technology solution of the present invention, in step (8), the machine learning model is a support vector machine (SVM), a random forest (Random Forest) or a neural network algorithm.
[0016] On the other hand, the present invention provides an intelligent optimization configuration of injection molding part structure and process parameters based on Python-Moldflow joint simulation, including a parametric modeling module, a Moldflow startup module, a meshing and process setting module, a simulation calculation module, a result analysis module, a parameter optimization module and a process optimization module; The parametric modeling module is used to perform parametric modeling on the target part by calling a third-party modeling library through Python, and batch generate first STL model files; the Python script uses the trimesh library to perform parametric modeling on the target part; The Moldflow startup module is used to start the Moldflow main program MoldflowSynergy through a Python script and import the first STL model file of the target part; The meshing and process setting module is used to set meshing parameters, select materials for injection molding, and obtain injection molding process parameters; The simulation calculation module is used to call the Moldflow solver to perform simulation calculations and automatically export simulation result data; The result analysis module is used to extract characteristic values according to the simulation result data; The parameter optimization module is used to obtain the optimal structural parameters of the target part according to the characteristic values, and import the optimal structural parameters of the target part into the parametric modeling module to generate a second STL model file of the optimal structural parameters of the target part; The process optimization module is used to optimize the injection molding process parameters through a machine learning model, with the injection molding process parameters as input and the characteristic values as output, and the optimal injection molding process parameters are obtained through optimization.
[0017] The intelligent optimization method and configuration for injection molding part structure and process parameters based on Python-Moldflow co-simulation provided by the present invention have the following advantages over the existing technology: 1) Full-process automation: Full-process automation of Moldflow simulation software through Python scripts avoids the tedious and error-prone manual operations and greatly improves simulation efficiency and accuracy.
[0018] 2) Optimize part structure and process parameters: Through multiple automatic iterations of intelligent optimization algorithms, the structure and process parameters of injection molding parts can be optimized to ensure the final part quality and production efficiency are optimal.
[0019] 3) Efficient batch simulation: Automated batch generation of simulation cases and large-scale parameter sensitivity analysis avoids the tedious and inefficient manual setup.
[0020] 4) Strong Scalability: The Python language's rich extensibility makes the proposed method applicable not only to a variety of scenarios, such as parametric modeling, batch simulation, and result post-processing, but also to conveniently integrate other advanced technologies, such as data visualization and deep learning, to meet diverse industrial application needs. Therefore, it has broad application prospects. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0022] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0023] Figure 1 This is a flow chart of the intelligent optimization method for injection molding part structure and process parameters based on Python-Moldflow joint simulation described in the present invention.
[0024] Figure 2 This is a schematic diagram of the gear component structure with four ribs obtained by parametric modeling in an embodiment of the present invention.
[0025] Figure 3 This is a schematic diagram showing the parametric changes to the shape of the injection-molded gear ribs using the Python trimesh library.
[0026] Figure 4 Schematic diagram of the target surface of the embodiment.
[0027] Figure 5 Schematic diagram comparing the original tooth shape and the deformed tooth shape of the embodiment. DETAILED DESCRIPTION
[0028] In order to more clearly understand the above-mentioned objectives, features and advantages of the present invention, the scheme of the present invention will be further described below. It should be noted that, in the absence of conflict, the embodiments of the present invention and the features therein can be combined with each other.
[0029] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present invention, rather than all the embodiments.
[0030] The specific embodiment of the present invention is described in detail below. The target workpiece of this embodiment is a gear, and the structure of the gear to be injection molded and the process parameters of the injection molding are optimized.
[0031] An intelligent optimization method for injection molding part structure and process parameters based on Python-Moldflow co-simulation includes the following steps: (S1) In the parametric modeling module, Python is used to call a third-party modeling library (trimesh library) to perform parametric modeling of the injection molded gear shape. Figure 2 The figure is a schematic diagram of parametric modeling with 3 ribs. Figure 2(c and d) show that in this embodiment, the cutout portion of the groove is annular, with an inner radius of R1, an outer radius of R1+L1, and a depth equal to the groove depth. The schematic diagram of the specific gear component structure obtained by parametric modeling is shown in FIG. Figure 3 As shown, the schematic diagram of the gear structure without ribs is shown in Figure 3 (a) Schematic diagram of the gear structure with 3 ribs. Figure 3 (b) Schematic diagram of the gear structure with 4 ribs. Figure 3 (c) Schematic diagram of the gear structure with 6 ribs. Figure 3 (d) Each structure also has different R1, R2, and depth to compare the effects of varying rib number, groove depth, and length on injection gear molding. This is saved as the first STL model file for easy import into the Moldflow main program before each analysis.
[0032] (S2) In the Moldflow startup module, use the win32com.client.Dispatch method to create a COM object to connect to Moldflow Synergy for automated control. Import the first STL model file generated in step (S1).
[0033] (S3) In the Meshing and Process Settings module, set the meshing parameters, set the maximum mesh side length to 3.5 mm, divide the mesh, and save the mesh information as a PAT file, including node numbers and coordinates; set the feed port position and angle; the material used for injection molding is polyetheretherketone; Get the default injection molding process parameters, including injection rate, holding time, holding pressure, mold temperature, melt temperature, and cooling time.
[0034] (S4) Using the simulation calculation module to start the Moldflow solver and set the solver parameters; using the subprocess to call the solver to run the project file, the Python script automatically exports the simulation result data of the injection molding quality index and saves it as an XML result file.
[0035] (S5) According to the use requirements of the gear, the outer tooth surface bears the main workload, and its geometric accuracy directly affects the transmission efficiency and stability of the gear. It is the most important functional area and plays a vital role in gear design and performance analysis. Therefore, using the result analysis module, combined with the XML result file (simulation result data) and the PAT mesh file (mesh information), the outer tooth surface is selected as the target surface in the program (such as Figure 4 As shown), the node coordinates of the outer tooth surface of the model and the node coordinates of the outer tooth surface after warping deformation ( Figure 5The maximum deviation between the tooth profile of the external tooth surface and the tooth profile after deformation (i.e., the maximum deviation of the target surface deformation) is taken as the eigenvalue and extracted, with the goal of minimizing this eigenvalue.
[0036] (S6) The minimum eigenvalue is the optimal eigenvalue, and its corresponding structural parameters are selected as the optimal structural parameters of the gear.
[0037] (S7) Using the parameter optimization module, a second STL model file is generated based on the optimal structural parameters of the gear, and the second STL model file is imported and meshed. The same injection molding material as in step (S3) is selected, the process parameters are continuously changed, and steps (S4) to (S5) are repeated until the number of data sets obtained with the process parameters as input and the characteristic values as output reaches 4000.
[0038] (S8) An artificial neural network (ANN) model is trained using the dataset; and a genetic algorithm (GA) is used to optimize the process parameters with the goal of minimizing the eigenvalues.
[0039] The maximum deviation of the eigenvalue target surface for a gear part obtained based on an unoptimized conventional gear shape and process parameters was 0.81mm. After the first structural optimization step of the present invention (i.e., optimization of steps S1-S6), the optimal model parameter combination of 5 ribs, 8mm groove depth, 50mm R1, and 10mm R2 was selected. The maximum deviation of the eigenvalue target surface was reduced to 0.61mm, a reduction of 24.7%. Next, further optimization was performed using the present invention's machine learning algorithm based on process parameters (i.e., optimization of steps S7 and S8), resulting in the optimal process parameter combination: injection rate of 60 cm / s, and injection speed of 1000 nm. 3 / s, holding pressure of 110 MPa, holding time of 25 seconds, mold temperature of 200°C, melt temperature of 380°C, and cooling time of 140 seconds. Verification shows that the eigenvalue has been further reduced to 0.47 mm, a decrease of approximately 23.0% compared to the first step of structural optimization. Ultimately, through the comprehensive optimization of the gear structure and process parameters of the present invention, the eigenvalue was reduced by nearly 42% compared to the initial value (i.e., the unoptimized conventional gear). This significantly reduces the tooth profile error of the injection-molded gear's external tooth surface, improves tooth profile accuracy, and thus enhances the overall precision and performance of the gear component.
[0040] Compared to traditional manual optimization methods, this method eliminates the need for further manual intervention after the initial process parameter setting, effectively saving labor costs while ensuring operational accuracy and stability. Furthermore, the optimization method can quickly obtain a sufficiently large dataset, which can be applied to machine learning algorithm optimization, significantly improving optimization efficiency and accuracy.
[0041] The above description is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Although detailed descriptions have been made with reference to the aforementioned embodiments, those skilled in the art should understand that they may still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents; and such modifications or replacements do not deviate from the essence of the corresponding technical solutions within the scope of the technical solutions of the embodiments, and they should all be included in the scope of protection of the claims.
Claims
1. An intelligent optimization method for injection molding part structure and process parameters based on Python-Moldflow joint simulation, characterized in that: The following steps are involved: (1) Perform parametric modeling of the target part by calling a third-party modeling library through Python, and batch generate the structural parameters of the target part and the corresponding first STL model file; (2) Start the Moldflow main program Moldflow Synergy through the Python script and import the first STL model file generated in step (1); (3) Set the meshing parameters, save the mesh information as a PAT file, select the material for injection molding, and obtain the default injection molding process parameters; (4) Call the Moldflow solver to perform simulation calculations. After the simulation calculations are completed, the Python script automatically exports the simulation result data and saves it as an XML file; (5) Extract eigenvalues according to the usage requirements or functional requirements of the target part, and determine the maximum or minimum eigenvalue as the optimal eigenvalue; (6) Select the structural parameters corresponding to the optimal eigenvalues as the optimal structural parameters of the target part; (7) Generate the corresponding second STL model file based on the optimal structural parameters obtained in step (6), import and divide the mesh, select the same injection molding material as step (3), continuously change the process parameters, and repeat steps (4) and (5) until a sufficient number of data sets with the changed process parameters as input and the corresponding eigenvalues as output are obtained; (8) Use the data set obtained in step (7) to train the machine learning model and obtain the optimal injection molding process parameters through optimization.
2. The intelligent optimization method for injection molding part structure and process parameters based on Python-Moldflow joint simulation according to claim 1 is characterized in that: In step (1), the third-party modeling library is the trimesh library.
3. The intelligent optimization method for injection molding part structure and process parameters based on Python-Moldflow joint simulation according to claim 1 is characterized in that: In step (2), the Python script communicates with the component object model interface of Moldflow by importing the win32com.client module.
4. The intelligent optimization method for injection molding part structure and process parameters based on Python-Moldflow joint simulation according to claim 1, characterized in that: In step (3), the injection molding process parameters include injection rate, holding pressure, holding time, mold temperature, melt temperature and cooling time.
5. The intelligent optimization method for injection molding part structure and process parameters based on Python-Moldflow joint simulation according to claim 1 is characterized in that: In step (4), the automatically derived simulation result data is the simulation result data of the injection molding quality index.
6. The intelligent optimization method for injection molding part structure and process parameters based on Python-Moldflow joint simulation according to claim 5, characterized in that: The injection molding quality index is any one or a combination of deformation, sink mark, cavitation and shrinkage rate.
7. The intelligent optimization method for injection molding part structure and process parameters based on Python-Moldflow joint simulation according to claim 1, characterized in that: In step (8), the machine learning model is a support vector machine, random forest or neural network algorithm.
8. An intelligent optimization configuration of injection molding part structure and process parameters based on Python-Moldflow joint simulation, characterized by: It includes parametric modeling module, Moldflow startup module, meshing and process setting module, simulation calculation module, result analysis module, parameter optimization module and process optimization module; The parametric modeling module is used to perform parametric modeling on the target part by calling a third-party modeling library through Python, and batch generate first STL model files; the Python script uses the trimesh library to perform parametric modeling on the target part; The Moldflow startup module is used to start the Moldflow main program Moldflow Synergy through a Python script and import the first STL model file of the target part; The meshing and process setting module is used to set meshing parameters, select materials for injection molding, and obtain injection molding process parameters; The simulation calculation module is used to call the Moldflow solver to perform simulation calculations and automatically export simulation result data; The result analysis module is used to extract characteristic values according to the simulation result data; The parameter optimization module is used to obtain the optimal structural parameters of the target part according to the characteristic values, and import the optimal structural parameters of the target part into the parametric modeling module to generate a second STL model file of the optimal structural parameters of the target part; The process optimization module is used to optimize the injection molding process parameters through a machine learning model, with the injection molding process parameters as input and the characteristic values as output, and the optimal injection molding process parameters are obtained through optimization.