Reverse planetary roller screw pair parametric modeling method
By using Visual Basic 6.0 and VB6.0 programming in SolidWorks 3D modeling software, parametric modeling of the reverse planetary roller screw pair was realized, solving the problems of cumbersome and inefficient modeling in the existing technology and realizing a fast and accurate modeling process.
Patent Information
- Application Number
- CN202411144829.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-20
- Publication Date
- 2026-03-03
AI Technical Summary
The existing technology for 3D modeling of reverse planetary roller screw pairs is cumbersome and inefficient, and cannot meet the needs of rapid and accurate modeling.
Using Visual Basic 6.0 as the development language and SolidWorks 3D modeling software, parametric modeling of a reverse planetary roller screw pair was achieved through macro recording, VBA editor, and VB6.0 programming. A human-computer interaction interface was established to input structural dimension parameters for automatic modeling.
Rapid parametric modeling of reverse planetary roller screw components was achieved, shortening modeling time and improving modeling efficiency.
Smart Images

Figure CN121598520A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of rolling functional component design, and in particular, a parametric modeling method for a reverse planetary roller screw pair. Background Technology
[0002] A reverse planetary roller screw assembly is a mechanical structure capable of converting between linear and rotary motion, transforming the rotational motion of the nut into the linear motion of the screw. Manually modeling its parts in 3D modeling software is cumbersome, time-consuming, and inefficient. The structural dimensions of reverse planetary roller screw assembly parts vary; changes in structural dimensions do not alter the appearance of the part, only its size. Remodeling in 3D modeling software is time-consuming and labor-intensive, failing to meet the demand for rapid and accurate modeling.
[0003] Currently, the existing method for 3D modeling of reverse planetary roller screw pairs involves manually creating 3D models of the parts in modeling software, which is inefficient and tedious. There is no method that can automatically model reverse planetary roller screw pair parts. Summary of the Invention
[0004] The purpose of this invention is to provide a parametric modeling method for reverse planetary roller screw pairs, using Visual Basic as the development language and VB6.0 software as the development tool, and to perform targeted secondary development on the 3D software SolidWorks to achieve parametric modeling of reverse planetary roller screw pairs.
[0005] The technical solution to achieve the purpose of this invention is as follows:
[0006] A parametric modeling method for a reverse planetary roller screw pair includes:
[0007] Open SolidWorks 3D modeling software and enable macro recording function. Perform 3D modeling of each part in the reverse planetary roller screw pair, use macro recording function to obtain the macro program of the part modeling process, and save the recorded macro program.
[0008] Open the VBA code obtained from macro recording using the VBA editor that comes with SolidWorks software, and clean it up, removing unnecessary code;
[0009] Add library files and write a linker in VB6.0 software to connect the VB6.0 programming software with the SolidWorks 3D modeling software;
[0010] Copy the code of the macro recording of the 3D modeling steps of the part into the Button control in the VB6.0 software, find the modeling step code in the SolidWorks API file, and manually modify and improve the program obtained by macro recording according to the code format.
[0011] A human-computer interaction interface was created in VB6.0 software to input structural dimension parameters for parametric modeling;
[0012] Input the dimensional parameters of the reverse planetary roller screw pair in the human-computer interaction interface, and then click the modeling button to drive the SolidWorks software to perform 3D modeling of the part.
[0013] The significant advantages of this invention compared to existing technologies are:
[0014] This invention uses Visual Basic 6.0 as the development environment, Visual Basic as the development language, and SolidWorks as the modeling software to design a parametric modeling platform for reverse planetary roller screw pairs. It realizes parametric modeling of all parts of the reverse planetary roller screw pair, shortens the modeling time, improves the modeling efficiency, and meets the requirements of rapid modeling. Attached Figure Description
[0015] Figure 1 The process of parametric modeling for a reverse planetary roller screw pair;
[0016] Figure 2 A 3D diagram of a planetary roller screw pair;
[0017] Figure 3 This is a diagram showing the components of a reverse planetary roller screw assembly.
[0018] Figure 4 Record function diagrams for SolidWorks macros;
[0019] Figure 5 A diagram illustrating the addition of references to the VB6.0 software;
[0020] Figure 6 Diagram of SolidWorks API file;
[0021] Figure 7 A human-computer interaction interface for parametric modeling of components in a reverse planetary roller screw pair;
[0022] Figure 8 To enable the program to drive the 3D modeling of the lead screw in SolidWorks. Detailed Implementation
[0023] The present invention will be further described below with reference to the accompanying drawings and specific embodiments.
[0024] like Figure 1 As shown, this invention discloses a parametric modeling method for a reverse planetary roller screw pair, used to input structural dimension parameters and establish a three-dimensional model. The specific steps are as follows:
[0025] Step 1: Analyze the components of the reverse planetary roller screw assembly to lay the foundation for 3D modeling in SolidWorks software. The reverse planetary roller screw assembly is as follows: Figure 2 As shown;
[0026] Analysis of the components of a reverse planetary roller screw assembly reveals that it includes a nut 1, rollers 2, a screw 3, a cage 4, and a retaining ring 5. Figure 3 As shown.
[0027] Step 2: In SolidWorks software, create 3D models of each component of the reverse planetary roller screw assembly. Enable the macro recording function and use it to record the macro process during the 3D modeling of the components. The macro recording button is shown below. Figure 4 As shown;
[0028] In the SolidWorks software, click the Macro option in the toolbar to open the macro recording editor. Click the black triangle in the macro recording editor to start recording. Then, perform 3D modeling of each part of the reverse planetary roller screw pair. After the modeling is complete, click the vertical equal sign to complete the macro recording. Save the recorded macro program. The macro program code is VBA code.
[0029] Step 3: Use the VBA editor that comes with SolidWorks software to open the VBA code obtained from macro recording and manually tidy it up. Find the modeling step code and then delete the remaining code.
[0030] Taking the lead screw 3 of the reverse planetary roller screw pair as an example, the code format of some modeling steps obtained from the 3D modeling macro recording is as follows:
[0031] boolstatus = Part.Extension.SelectByID2("Forward Reference Plane","PLANE",0,0,0,False,0,Nothing,0) 'Select the reference plane'
[0032] Part.CreateCircleByRadius2 0,0,0,20 / 2000' Creates a sketch
[0033] Part.InsertHelix False,True,False,True,2,100 / 1000,5 / 1000,6,0,(2*pi-a4)' Generates a spiral
[0034] Set equationDriveCurve=Part.SketchManager.CreateEquationSpline2(r1&"*cos(t)+"&r1&"*t*sin(t)",r1&"*sin(t)-"&r1&"*t*cos(t)","","0",a,False,0,0,0,True,True)' Generate the involute curve of the gear.
[0035] Part.FeatureExtrusion 1,1,0,0,0,10 / 1000,10 / 1000,0,0,0,0,0,0,0,0'Boss Extrusion
[0036] Part.FeatureManager.InsertCutSwept3 False,True,0,False,False,0,0,False,0,0,0,0,1,1,0,1'Scanning and Removing
[0037] Set myFeature=Part.FeatureManager.FeatureCut4(True,False,False,0,0,5 / 1000,Hs3 / 1000,False,False,Fa lse,False,0#,0#,False,False,False,False,False,True,True,True,True,False,0,0,False,False)' Stretch Cut
[0038] Step 4: Connect the VB6.0 software with the SolidWorks 3D modeling software using program and library files;
[0039] Open VB6.0 software, create a new standard EXE project, find References in the Project menu, click References, and add the following three library files in the pop-up window: SldWorks 2021 Type Library, SOLIDWORKS2021 Commands Type Library, and SOLIDWORKS2021 Constant Type Library. Figure 5 As shown. Then add an SSTAB control to the form, add a Button control to the SSTAB, and add a connector to the Button control;
[0040] The connection program contains the following:
[0041] Dim swApp As Object
[0042] Set swApp=CreateObject("SldWorks.Application")
[0043] The code snippet `Dim swApp As Object` sets `swApp` as an object, and `CreateObject("SldWorks.Application")` creates an instance of a SolidWorks application in VB6.0. The purpose of this code is to launch the SolidWorks software at runtime and allow scripts or programs to interact with SolidWorks.
[0044] Step 5: Copy the macro code recorded in Step 2 (part 3D modeling steps) into the Button control in VB6.0 software. Then, locate the modeling step code in the SolidWorks API file. Manually modify and improve the macro-recorded program according to its code format. The SolidWorks API file is as follows: Figure 6 As shown;
[0045] The modeling steps recorded by macros may be missing or incomplete. Find the corresponding modeling step format in the SolidWorks API documentation and modify and improve it according to this format. This is a general solution.
[0046] Taking the 3D modeling of the lead screw 3 in a reverse planetary roller screw pair as an example, the key steps of the modified and improved 3D modeling procedure are as follows:
[0047] 'Create Thread'
[0048] Part.SelectByID"Forward","PLANE",0,0,0' Select the reference plane
[0049] Part.CreateCircleByRadius2 0,0,0,Ds1 / 2000' Create a sketch
[0050] Part.InsertHelix False,True,False,True,2,(Hs1+10) / 1000,Ls / 1000,6,0,(2*pi-a4)'Generates a spiral,
[0051] Create thread normal section
[0052] boolstatus = Part.Extension.SelectByID2("Reference Plane 3","PLANE",0,0,0,False,0,Nothing,0) 'Select the reference plane'
[0053] Dim skSegment As Object
[0054] Set skSegment = Part.SketchManager.CreateLine(0#,0,0#,0#,bs3 / 1000,0#)'Draw a straight line
[0055] Part.SketchAddConstraints"sgFIXED"
[0056] Set skSegment=Part.SketchManager.CreateLine(bs2 / 1000,(bs3-bs1) / 2000,0#,bs2 / 1000,(bs3+bs1) / 2000,0#)
[0057] Part.SketchAddConstraints"sgFIXED"
[0058] Set skSegment=Part.SketchManager.CreateLine(0#,0,0#,bs2 / 1000,(bs3-bs1) / 2000,0#)
[0059] Part.SketchAddConstraints"sgFIXED"
[0060] Set skSegment=Part.SketchManager.CreateLine(0#,bs3 / 1000,0#,bs2 / 1000,(bs3+bs1) / 2000,0#)
[0061] Part.SketchAddConstraints"sgFIXED"
[0062] 'Scanning cut to generate threads'
[0063] boolstatus=Part.Extension.SelectByID2("grass Figure 4 ","SKETCH",0,0,0,False,1,Nothing,0)'Select the created normal section
[0064] boolstatus = Part.Extension.SelectByID2("Helix / Whirlwind 1","REFERENCECURVES",0,0,0,True,4,Nothing,0) 'Select the created helix
[0065] Part.FeatureManager.InsertCutSwept3 False,True,0,False,False,0,0,False,0,0,0,0,1,1,0,1' Generates threads by scanning and cutting.
[0066] 'Circular array of threads'
[0067] boolstatus = Part.Extension.SelectByID2("Resection-Scan 1","BODYFEATURE",0,0,0,False,4,Nothing,0)
[0068] boolstatus = Part.Extension.SelectByID2("Reference Axis 1","AXIS",0,0,0,True,1,Nothing,0)
[0069] Dim Feature As Object
[0070] Set Feature = Part.FeatureManager.FeatureCircularPattern2(ns,(2*pi) / ns,False,"NULL",False)' Threaded Circular Array
[0071] 'Create a lead screw with 3 gears'
[0072] boolstatus = Part.Extension.SelectByID2("Reference Plane 6","PLANE",0,0,0,True,0,Nothing,0)
[0073] Set myRefPlane=Part.FeatureManager.InsertRefPlane(8,Hs3 / 1000,0,0,0,0)
[0074] boolstatus = Part.Extension.SelectByID2("Reference Plane 7","PLANE",0,0,0,True,0,Nothing,0)
[0075] Dim equationDriveCurve As Object
[0076] Set equationDriveCurve=Part.SketchManager.CreateEquationSpline2(r1&"*cos(t)+"&r1&"*t*sin(t)",r1&"*sin(t)-"&r1&"*t*cos(t)","","0",a,False,0,0,0,True,True)'Create an involute curve for a gear.
[0077] 'Create a sketch of gear teeth'
[0078] X4 = r3 * Cos(a4)
[0079] Y4=-r3*Sin(a4)
[0080] Set skSegment=Part.SketchManager.CreateCenterLine(0#,0#,0#,X4 / 1000,Y4 / 1000,0#)
[0081] X5=r1*Cos(a)+r1*a*Sin(a)
[0082] Y5=r1*Sin(a)-r1*a*Cos(a)
[0083] X6 = r1 * Cos(a4)
[0084] Y6=-r1*Sin(a4)
[0085] Set skSegment = Part.SketchManager.CreateArc(0#,0#,0#,X5 / 1000,Y5 / 1000,0#,X4 / 1000,Y4 / 1000,0#,1) 'Create an arc'
[0086] 'Set skSegment=Part.SketchManager.CreateLine(r4 / 1000,0#,0#,R1 / 1000,0#,0#)' Creates a straight line.
[0087] Set skSegment=Part.SketchManager.CreateArc(0#,0#,0#,r1 / 1000,0#,0#,X6 / 1000,Y6 / 1000,0#,1)
[0088] 'Set skSegment=Part.SketchManager.CreateLine(X6 / 1000,Y6 / 1000,0#,X4 / 1000,Y4 / 1000,0#)
[0089] boolstatus=Part.Extension.SelectByID2("Spline2","SKETCHSEGMENT",0#,0#,0#,True,0,Nothing,0)'Select involute curve
[0090] boolstatus=Part.Extension.SelectByID2("Arc1","SKETCHSEGMENT",0#,0#,0#,True,0,Nothing,0)
[0091] 'boolstatus=Part.Extension.SelectByID2("Line2","SKETCHSEGMENT",0#,0#,0#,True,0,Nothing,0)
[0092] boolstatus=Part.Extension.SelectByID2("Arc2","SKETCHSEGMENT",0#,0#,0#,True,0,Nothing,0)
[0093] boolstatus=Part.Extension.SelectByID2("Line1","SKETCHSEGMENT",0#,0#,0#,True,0,Nothing,0)
[0094] Part.SketchMirror mirrors the created gear tooth sketch.
[0095] Dim myFeature As Object
[0096] Set myFeature=Part.FeatureManager.FeatureCut4(True,False,False,0,0,Hs3 / 1000,Hs3 / 1000,False,False,Fal se,False,0#,0#,False,False,False,False,False,True,True,True,True,False,0,0,False,False)' Extrude and cut to generate alveolar
[0097] boolstatus = Part.Extension.SelectByID2("Excision-Extension 1","BODYFEATURE",0,0,0,False,4,Nothing,0)
[0098] boolstatus = Part.Extension.SelectByID2("Reference Axis 1","AXIS",0,0,0,True,1,Nothing,0)
[0099] 'boolstatus=Part.Extension.SelectByID2("Mirror 1","BODYFEATURE",0,0,0,True,4,Nothing,0)
[0100] Set Feature = Part.FeatureManager.FeatureCircularPattern2(Zs, 2*pi / Zs, False,"NULL", False) ' Generate a complete gear by performing a circular array of gear tooth grooves'
[0101] Step 6: Create a human-computer interaction interface in VB6.0 software to input structural dimension parameters for parametric modeling;
[0102] The SSTAB control has been added to the standard EXE form created in VB6.0 software. Within the SSTAB control, a common control Textbox is added for inputting the structural dimensional parameters of the reverse planetary roller screw assembly; a common control Label is added to represent the structural dimension code; and a common control PictureBox is added to display a simplified diagram of the part, indicating the location of the part's dimensional parameters to the user. The common control Button added in step 4 already contains the 3D modeling steps of the part, which can be used by the user to start the modeling operation. The resulting parametric modeling human-computer interface for the reverse planetary roller screw assembly is as follows: Figure 7 As shown.
[0103] Step 7: Input the dimensional parameters of the reverse planetary roller screw assembly parts into the human-computer interaction interface, and then click the modeling button. VB6.0 software will drive SolidWorks software to perform 3D modeling of the parts. Taking the lead screw 3 in the reverse planetary roller screw assembly as an example, input its structural dimensional parameters into the Textbox in the lead screw modeling interface, and click the lead screw modeling button. SolidWorks software will then perform 3D modeling of the lead screw. The completed 3D model is shown below. Figure 8 As shown.
Claims
1. A parametric modeling method for a reverse planetary roller screw pair, characterized in that, include: Open SolidWorks 3D modeling software and enable macro recording function. Perform 3D modeling of each part in the reverse planetary roller screw pair, use macro recording function to obtain the macro program of the part modeling process, and save the recorded macro program. Open the VBA code obtained from macro recording using the VBA editor that comes with SolidWorks software, and clean it up, removing unnecessary code; Add library files and write a linker in VB6.0 software to connect the VB6.0 programming software with the SolidWorks 3D modeling software; Copy the code of the macro recording of the 3D modeling steps of the part into the Button control in the VB6.0 software, find the modeling step code in the SolidWorks API file, and manually modify and improve the program obtained by macro recording according to the code format. A human-computer interaction interface was created in VB6.0 software to input structural dimension parameters for parametric modeling; Input the dimensional parameters of the reverse planetary roller screw pair in the human-computer interaction interface, and then click the modeling button to drive the SolidWorks software to perform 3D modeling of the part.
2. The parametric modeling method for a reverse planetary roller screw pair according to claim 1, characterized in that, Connecting VB6.0 programming software with SolidWorks 3D modeling software specifically includes: Open VB6.0 software, create a new standard EXE project, find References in the Project menu, click References to add three library files: SldWorks 2021 Type Library, SOLIDWORKS2021 Commands Type Library, and SOLIDWORKS2021 Constant Type Library. Then add an SSTAB control to the form, add a Button control to the SSTAB control, and add a connector to the Button control.
3. The parametric modeling method for a reverse planetary roller screw pair according to claim 1, characterized in that, The specific process of establishing a human-computer interaction interface is as follows: The SSTAB control has been added to the standard EXE form created in VB6.0 software. A common control Textbox is added to the SSTAB control for inputting the structural dimension parameters of the reverse planetary roller screw assembly; a common control Label is added to represent the structural dimension code; and a common control PictureBox is added to display the simplified diagram of the part.
4. The parametric modeling method for a reverse planetary roller screw pair according to claim 3, characterized in that, Enter the structural dimensions of the part into the Textbox in the lead screw modeling interface, and click the lead screw modeling button. SolidWorks software will then perform 3D modeling of the lead screw.
5. The parametric modeling method for a reverse planetary roller screw pair according to claim 1, characterized in that, The macro program code is VBA code.