Automatic setting method of machine tool parameters based on numerical control device
By building a setting interface to acquire and store CNC machine tool parameter data, generate control files and automatically set CNC device parameters, it solves the problem of numerous parameter settings and easy to operate incorrectly in the existing technology, and realizes a more efficient and safe CNC machine tool debugging process.
Patent Information
- Application Number
- CN202410957488.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-17
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2044-07-17
AI Technical Summary
In the prior art, the parameter setting of CNC machine tools is numerous and it is prone to misoperation, resulting in alarms or safety accidents of CNC devices.
By building a setting interface, obtaining machine tool parameter data, storing and generating control files through query, and automatically setting CNC device parameters to reduce the complexity of manual operations and the risk of misoperation.
It reduces the debugging time of CNC machine tools, lowers the professional threshold, improves production efficiency, and avoids safety hazards caused by misoperation.
Smart Images

Figure CN118915618B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of device control, and in particular relates to a method for automatically setting machine tool parameters based on a numerical control device. Background Art
[0002] The CNC device is the control center of the CNC machine tool. Because the CNC device is rich in functions, when the CNC machine tool has a large number of axes and applies a large number of complex functions, the machine tool parameters to be set in the CNC device will be very numerous. Electrical engineers need to undergo CNC device debugging training, master the corresponding parameter setting methods for each function, spend a lot of time on parameter setting, and cannot make any mistakes when entering many parameters, otherwise the wrong parameter setting will cause the CNC device to alarm or even cause a safety accident. Summary of the invention
[0003] In order to solve the above technical problems, the present invention proposes a method for automatically setting machine tool parameters based on a numerical control device to solve the problems existing in the above prior art.
[0004] To achieve the above object, the present invention provides a method for automatically setting machine tool parameters based on a numerical control device, comprising:
[0005] Acquire machine tool parameter data through a setting interface, wherein the machine tool parameters include basic parameter data, channel parameter data and axis parameter data;
[0006] The machine tool parameter data is stored, and the stored machine tool parameter data is extracted by querying, a control file is generated, parameters of the numerical control device are set by the control file, and the numerical control machine tool is controlled according to the numerical control device after the parameter setting.
[0007] Optionally, the process of obtaining machine tool parameters includes:
[0008] Constructing a setting interface, wherein the setting interface includes an initial interface, a channel parameter setting interface and an axis parameter setting interface;
[0009] The initial interface is provided with input boxes and buttons corresponding to basic parameters, and data is input into the corresponding input boxes and buttons according to the basic parameters to obtain basic parameter data;
[0010] The channel parameter setting interface is provided with input boxes and buttons corresponding to the channel parameters, and data is input into the corresponding input boxes and buttons according to the channel parameters to obtain channel parameter data;
[0011] The axis parameter setting interface is provided with input boxes and buttons corresponding to the axis parameters. Data is input into the corresponding input boxes and buttons according to basic parameters to obtain axis parameter data.
[0012] Optionally, the basic parameters include: total number of axes, axis names, number of channels and channel settings.
[0013] Optionally, the channel parameters include: channel axis quantity, channel axis selection and channel name setting, and geometric axis setting.
[0014] Optionally, the axis parameters include: axis characteristics, reduction ratio, pitch, maximum operating speed, speed monitoring threshold, positive stroke, negative stroke, number of pitch compensation points, master-slave function and gantry axis function.
[0015] Optionally, the machine tool parameter data is stored in a database, wherein the database includes: a basic parameter table, a channel parameter table and an axis parameter table, which are respectively used to store the basic parameter data, the channel parameter data and the axis parameter data.
[0016] Optionally, the basic parameter table, channel parameter table and axis parameter table all contain lower-level data categories, wherein the lower-level data categories include parameter numbers, parameter names and initial parameter values, wherein the specific descriptions of the lower-level data categories of the corresponding tables are filled in in sequence according to the basic parameter data, channel parameter data and axis parameter data.
[0017] Optionally, the input boxes and buttons in the setting interface are constructed through a control component, wherein the tag attribute of the control component stores a parameter number as a query intermediary between the setting interface and the database.
[0018] Optionally, the process of extracting the stored machine tool parameter data by querying includes:
[0019] The control components in the setting interface are parsed, the parameter numbers corresponding to the control components are extracted, the corresponding parameter names and initial parameter values in the database are queried according to the parameter numbers, the query results are extracted, stored in a data storage device, and a data set is generated.
[0020] Optionally, a control file is generated in the form of NC code according to the data set, and the control file is transmitted to a storage area of a numerical control device to perform parameter setting on the numerical control device.
[0021] Compared with the prior art, the present invention has the following advantages and technical effects:
[0022] 1. Through this patent, the debugging of CNC devices, which used to require professional electrical engineers to undergo training, has been transformed into a process where only familiarity with the interface of the CNC device and execution of the NC program are required to complete the machine tool parameter input, greatly reducing the on-site debugging time of the machine tool. This has not only lowered the professional threshold for debugging CNC machine tools, but also improved the production efficiency during the equipment manufacturing and debugging process.
[0023] 2. The input operation of many parameters is very likely to cause misoperation. The CNC device is the brain of the entire CNC machine tool, controlling the operation of all executable mechanisms such as servo motors, cylinders, hydraulics and other structures. A slight mistake will cause a safety accident. The present invention can avoid the occurrence of misoperation in parameter input and eliminate the safety hazards caused by misoperation. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The illustrative embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0025] Figure 1 A schematic diagram of a method flow of an embodiment of the present invention;
[0026] Figure 2 This is a schematic diagram of the initial interface of an embodiment of the present invention;
[0027] Figure 3 A schematic diagram of a channel parameter setting interface according to an embodiment of the present invention;
[0028] Figure 4 A schematic diagram of an axis parameter setting interface according to an embodiment of the present invention;
[0029] Figure 5 A schematic diagram of a database according to an embodiment of the present invention;
[0030] Figure 6 It is a schematic diagram of executing a numerical control device according to an embodiment of the present invention;
[0031] Figure 7 Schematic diagram of parameter setting of a numerical control device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0032] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0033] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0034] The present invention provides a method for automatically setting machine tool parameters based on a numerical control device, comprising:
[0035] Acquire machine tool parameter data through a setting interface, wherein the machine tool parameters include basic parameter data, channel parameter data and axis parameter data;
[0036] The machine tool parameter data is stored, and the stored machine tool parameter data is extracted by querying, a control file is generated, parameters of the numerical control device are set by the control file, and the numerical control machine tool is controlled according to the numerical control device after the parameter setting.
[0037] As some embodiments, the process of obtaining machine tool parameters includes:
[0038] Constructing a setting interface, wherein the setting interface includes an initial interface, a channel parameter setting interface and an axis parameter setting interface;
[0039] The initial interface is provided with input boxes and buttons corresponding to basic parameters, and data is input into the corresponding input boxes and buttons according to the basic parameters to obtain basic parameter data;
[0040] The channel parameter setting interface is provided with input boxes and buttons corresponding to the channel parameters, and data is input into the corresponding input boxes and buttons according to the channel parameters to obtain channel parameter data;
[0041] The axis parameter setting interface is provided with input boxes and buttons corresponding to the axis parameters, and data is input into the corresponding input boxes and buttons according to the basic parameters to obtain axis parameter data;
[0042] As some embodiments, the basic parameters include: the total number of axes, axis names, the number of channels and channel settings.
[0043] As some embodiments, the channel parameters include: the number of channel axes, channel axis selection and channel name setting, and geometric axis setting.
[0044] As some embodiments, the axis parameters include: axis characteristics, reduction ratio, pitch, maximum operating speed, speed monitoring threshold, positive stroke, negative stroke, number of pitch compensation points, master-slave function and gantry axis function.
[0045] As some embodiments, the machine tool parameter data is stored in a database, wherein the database includes: a basic parameter table, a channel parameter table and an axis parameter table, which are respectively used to store the basic parameter data, the channel parameter data and the axis parameter data.
[0046] As some embodiments, the basic parameter table, channel parameter table and axis parameter table all contain lower-level data categories, wherein the lower-level data categories include parameter numbers, parameter names and initial parameter values, wherein the specific descriptions of the lower-level data categories of the corresponding tables are filled in in sequence according to the basic parameter data, channel parameter data and axis parameter data.
[0047] As some embodiments, the input boxes and buttons in the setting interface are constructed through control components, wherein the tag attribute of the control component stores the parameter number as a query intermediary between the setting interface and the database.
[0048] As some embodiments, the process of extracting the stored machine tool parameter data by querying includes:
[0049] The control components in the setting interface are parsed, the parameter numbers corresponding to the control components are extracted, the corresponding parameter names and initial parameter values in the database are queried according to the parameter numbers, the query results are extracted, stored in a data storage device, and a data set is generated.
[0050] As some embodiments, a control file is generated in the form of NC code according to the data set, and the control file is transmitted to a storage area of a numerical control device to set parameters of the numerical control device.
[0051] This embodiment provides a method for automatically setting machine tool parameters based on a numerical control device, and the above content of this application is described in detail in conjunction with the relevant drawings:
[0052] The numerical control device for parameter adjustment in the present invention controls a numerical control machine tool, which is composed of a bed, a screw, a reducer and other mechanical structures and a servo motor, a numerical control device and other control units. The numerical control device needs to set corresponding machine tool parameters to combine with the mechanical structure to make the numerical control machine tool run normally as a whole. The machine tool parameters include channel parameters, axis type, transmission ratio, maximum speed, master-slave function parameters, gantry axis function parameters, etc.
[0053] Due to the rich functions of CNC devices, when CNC machine tools have a large number of axes and a large number of complex functions are applied, the machine tool parameters to be set will be very numerous. For example, the fine surface function requires 83 parameters to be set, and the master-slave function requires 17 parameters to be set. Electrical engineers need to undergo CNC device debugging training, master the corresponding parameter setting methods for each function, spend a lot of time on parameter setting, and cannot make any mistakes when entering many parameters, otherwise the wrong parameter setting will cause the CNC device to alarm or even cause a safety accident.
[0054] On this basis, this embodiment hopes to provide a method for setting machine tool parameters for CNC machine tools, which replaces the traditional method of manual CNC device parameter setting by automatically entering the parameters of the corresponding functions, to solve the problem of possible operational errors in the manual entry process of CNC machine tools, resulting in incorrect parameter settings causing CNC device alarms, or causing damage to the CNC device or more serious safety accidents.
[0055] The present invention can avoid the occurrence of parameter input misoperation and eliminate the potential safety hazard caused by misoperation.
[0056] At the same time, the technical solution of the present invention also needs to solve the following problems: the operation of the CNC device requires electrical engineers to be too professional, that is, it is necessary to wait for professional electrical engineers to perform parameter adjustment operations of special CNC machine tools. The professionalism is too high and the requirements for parameter adjustment operations of CNC machine tools cannot be lowered, and there is no universality of personnel who can adjust CNC machine tools.
[0057] The present invention uses an automated CNC device operation mode, which changes the past situation where professional electrical engineers need to be trained to debug CNC devices to a situation where only familiarity with the interface operation of the CNC device and execution of the NC program can complete the machine tool parameter input, greatly reducing the on-site debugging time of the machine tool. This not only reduces the professional threshold for CNC machine tool debugging, but also improves the production efficiency in the equipment manufacturing and debugging process.
[0058] In view of the problems existing in the above-mentioned prior art, the technical solution of the present invention is described in detail in combination with the relevant drawings:
[0059] like Figure 1 As shown, the present invention constructs an initial interface, fills in or sets parameters in the initial interface, wherein the parameter values include basic parameters, channel parameters and axis parameters, and the parameter values are stored and queried through a database. After the query, a program file is output, and the program file is input into a numerical control device for execution. The numerical control device is used to control the numerical control machine tool to realize automatic control of the numerical control machine tool.
[0060] The present invention is a method for automatically setting machine tool parameters based on a numerical control device, which is achieved by developing software of a graphical machine tool parameter setting interface in a high-level programming language and configuring a database containing numerical control device function parameters.
[0061] After setting the parameter value through the setting interface of the software, it is stored in the corresponding database, and the corresponding parameter data in the database is queried and called. The parameter name and the set parameter value are written into text data according to the rules required by the CNC device, and the data is stored in the NC program file that can be executed in the CNC device. The file is transmitted to the CNC device for execution, and all machine tool parameters are automatically set. The CNC machine tool is automatically controlled according to the set machine tool parameters.
[0062] 1. Settings interface
[0063] Settings interface
[0064] 1) Initial interface
[0065] like Figure 2As shown, the initial interface is the basic parameter setting interface. From the initial interface, set the number of all servo motors controlled by the CNC device, that is, the "total number of axes". And set the "axis name" corresponding to each axis and all "channel numbers". The basic parameters in these initial interfaces are the basic setting parameters of the CNC device, and other interface settings will be based on the "axis name" set in this setting.
[0066] In the initial interface, the first thing you need to set is the "total number of axes". The input box corresponding to the "total number of axes" in the initial interface will require you to enter the corresponding number of axes. According to the number of servo motors of the CNC machine tools that the CNC device needs to control, count the number of all servo motors and enter them in the input box corresponding to the "total number of axes" to collect the total number of axes data.
[0067] After the "Total Axis Quantity" is set, the "Axis Name Setting" section will generate and display input boxes corresponding to the total number of axes. Each input box will be marked with a number and a "Set" button. Click the "Set" button to jump to the axis parameter setting interface corresponding to the axis name. Enter the set axis name in the input box to collect axis name data.
[0068] Then you need to set the "Number of Channels". The input box corresponding to "Number of Channels" is the number of channels that need to be set. The channel represents the axes that need to cooperate to complete a certain function. The channel can be regarded as the setting for a function. Enter the number of channels in the "Number of Channels" input box to collect the channel number data.
[0069] After the "Number of Channels" is set, the corresponding "Channel 1 Setting", "Channel 2 Setting", "Channel 3 Setting"... and other buttons are generated. These buttons serve as trigger buttons for channel parameters, and you can jump to the channel parameter setting interface through the above buttons.
[0070] Pressing the "Set" button after "Axis Name Setting" will enter the axis parameter setting interface, with a maximum of 31 parameters.
[0071] Press the "Channel 1 Setting"... "Channel 3 Setting"... buttons to enter the corresponding channel parameter setting interface.
[0072] 2) Channel parameter setting interface
[0073] like Figure 3 As shown, the channel parameter setting interface sets the channel parameters dedicated to a certain channel. One channel corresponds to one channel parameter setting interface, and the number of channel parameter interfaces is determined by the "number of channels" in the initial interface.
[0074] The channel parameter setting interface mainly includes "channel axis number", "channel axis selection and channel name setting" and "geometric axis setting".
[0075] The "Number of Channel Axes" setting contains the number of axes in this channel. From a practical point of view, it means the number of axes corresponding to a certain function. Figure 2 Select the axis name belonging to this channel from the axis name data in "Axis Name Setting" in the .
[0076] The "Channel Axis Selection and Channel Name Setting" section includes different "Channel Axis" buttons for inputting this channel. The axis name data of the "Axis Name Setting" in this button is used as an alternative option. The axis that needs to be used in this channel only needs to be selected from the alternative options in the "Channel Axis" to complete the input. Each "Channel Axis" button also corresponds to a "Channel Name" input box. The "Channel Name" input box inputs the channel axis name that is reset for the axis selected in the channel, that is, the selected axis is renamed in the channel. And the "Display" button is set immediately after the "Channel Name" input box. This button indicates whether the coordinate value of this axis is displayed in the human-machine interface of the CNC device.
[0077] "Geometry Axis Setting" includes "Geometry Axis Name", including X / Y / Z. Each "Geometry Axis Name" is followed by a corresponding "Axis Selection" button, in which the "Axis Selection" button includes different channel axis options. The alternative options are the channel axis list, indicating which channel axis is selected as the geometry axis. In this function, the function of the axis is set to adapt to the corresponding function under the channel.
[0078] Whether the CNC device uses "turning technology" or "milling technology" depends on whether it contains a "Y" axis.
[0079] And set which channel axis corresponds to the geometric axis. The geometric axis is the axis that constitutes the Cartesian coordinate system, only XYZ (milling machine version) or XZ (lathe version).
[0080] Enter the font size number in the "Large font display quantity" input box to adjust the font size of the axis coordinate value displayed on the human-machine interface of the CNC device.
[0081] Checking the "Precision Surface" function will apply the button function of the CNC system. This function does not require setting parameter values in the interface. The parameter number and parameter value corresponding to this function are retrieved from the database. While providing the maximum processing speed, the CNC system will optimize the operating speed and trajectory of the servo motor according to the parameter setting value to achieve this function. This system function can obtain the best workpiece surface processing quality.
[0082] After all the above parameter values are set, click the "Save" button and all channel parameter values will be stored.
[0083] 3) If Figure 4 As shown in the figure, the axis parameter interface sets the axis-specific parameters. Figure 2The "Total number of axes" in the "Axis Parameters" determines the number of axis parameter interfaces. The axis-specific parameters in the axis parameters are common setting parameters for different functions of the axis and will not be adjusted due to different functions. The axis is adjusted for different channels or functions according to the "Channel axis selection and channel name setting" and "Geometry axis" functions in the "Channel parameters" to adapt to different functions.
[0084] Set the number of axes in the basic parameter interface. After setting the axis name, press the "Set" button to enter the axis parameter setting interface. Each axis has a dedicated setting interface. The axis parameter interface sets the basic parameters of the axis, which are necessary parameters to ensure the normal operation of the device. In addition to these parameters, set the corresponding axis-related parameters according to different functions in the channel setting interface.
[0085] Click the "Axis Characteristics" button to set the axis motion type. The default axis is linear motion. If the axis motion is rotation, such as the main axis, check "Rotation Axis". Check "Positioning Axis" for axes that do not participate in interpolation operation, including the slave axis of the master-slave motion.
[0086] The "Reduction Ratio" input box sets the reduction ratio of the speed change mechanism connected to the motor. In order to obtain large torque, the speed change mechanism often uses a reducer, that is, the motor rotates n times, the reducer outputs 1 turn, and the reduction ratio is set to 1:n.
[0087] The "pitch" input box sets the distance the moving end moves when the motor rotates one turn. If it is a screw drive, the parameter is set to the screw pitch. If it is a gear rack drive, this parameter should be set to: the pitch circle diameter of the gear Φ multiplied by π, that is, n = Φ*π.
[0088] "Maximum operating speed" input box, set the maximum set speed of the axis, the linear axis unit is mm / min, the rotary axis unit is degree / min
[0089] "Speed monitoring threshold" input box, set the maximum operating speed of the axis. If the speed exceeds this value, the CNC device will alarm and stop the axis operation.
[0090] The "Positive Stroke" and "Negative Stroke" input boxes are used to set the axis's operating range. If this operating range is exceeded, the CNC device will alarm and stop the axis's operation.
[0091] The “Number of pitch compensation points” input box is used to set the number of pitch error compensation points, which is generally set at 100.
[0092] The "Master-Slave Function" button is an optional function of the CNC system, which is used for dual motor backlash elimination in the gear rack transmission mechanism to improve the positioning accuracy of the linear axis. To set a master axis and one or more slave axes, you can set the function to take effect and whether this axis is the master axis or the slave axis.
[0093] The "Gantry Axis Function" button is an optional function of the CNC system, which is used to synchronize one or more pairs of motors in the gantry structure. To set the master and slave axes in pairs, you can set the function to take effect and whether this axis is the active axis or the driven axis.
[0094] During the axis parameter setting process, the different options and input box settings are set in parallel and there is no related logical relationship.
[0095] It should be noted that the above-mentioned initial interface, channel parameter setting interface, and axis parameter setting interface of the present invention all need to be filled in by relevant professionals. The above-mentioned interface of the present invention only provides a data input or acquisition method. The above-mentioned data can also be integrated or collected by using relevant data formats or integration methods. Data acquisition is to record all the parameters used in debugging, which is the digitized storage of engineers' debugging experience. The data source is the Siemens CNC system parameter manual. It should be noted that according to the different CNC devices, the parameter manuals used will also be adjusted accordingly. The collected data are the parameters that need to be set for debugging selected from tens of thousands of parameters. The above-mentioned interface settings of the present invention generate a file of parameter data after acquisition, and transfer the file to the database, and the data is stored through the database through related structures.
[0096] 2. Parameter data query
[0097] Setting up the database
[0098] like Figure 5 As shown in the figure, a database is established to store the machine parameter number and parameter name of the CNC device. The database is divided into three parts: the basic parameter table "GeneralParameters" stores the basic parameter data in the CNC device; the channel parameter table "ChanelParemeters" stores the channel parameter data in the CNC device. The axis parameter table "AxisParameters" stores the axis parameter data in the CNC device. Each parameter table contains the lower parameter number "ID", parameter name "ParameterName" and initial parameter value "ParameterValue".
[0099] The parameter number is described below the number of each parameter in the table, the parameter name is described below the specific name of the parameter, and the initial parameter value is the numerical value or option corresponding to each parameter.
[0100] The basic parameter data, channel parameter data, and axis parameter data are entered into the corresponding tables respectively, and the tables are stored, and the database is established. The basic parameter and axis parameter data lists are shown in Table 1 and Table 2. (Because there are so many data, they cannot be listed one by one).
[0101] Table 1
[0102]
[0103] Table 2
[0104]
[0105]
[0106] exist Figure 2 , Figure 3 , Figure 4 In the machine tool parameter setting interface shown in the figure, the software adopts C / S architecture, the client is developed using the WinForm development framework of Visual Studio, and the development language is C#. The database uses SQLite as the server to store data. Each function button such as the parameter setting value input text box and the function check button exists in the form of a control (control component) in the high-level language development environment (taking C# as an example).
[0107] A control is the smallest unit on the software interface. Each component on the interface, such as buttons, labels, and dialog boxes, is a control. Each control has its own property list to display or set the relevant properties of the control. The "tag" property of each control can store data corresponding to the machine tool parameter number, such as the data query summary of the basic parameter and axis parameter data lists shown in Table 1 and Table 2.
[0108] By parsing the controls in all interfaces, extracting the machine tool parameter number data contained in each control, writing query statements, and querying in the database according to the parameter number, the machine tool parameter names and parameter data corresponding to all controls in the interface can be obtained.
[0109] For the above database query process, the corresponding important core programming code in the development software Visual Studio is:
[0110]
[0111] foreach(Control itemin this.Controls) / / Traverse all controls in the entire interface
[0112] {
[0113] if(item.Tag.ToString()!=null) / / Judge whether the Tag attribute contains a set value (machine parameter number)
[0114] {
[0115] / / Get the machine parameter number
[0116] string parameterNo=item.Tag.ToString();
[0117] / / Define query database statement
[0118] string sql1="Select AxisParameters.ParameterName from AxisParameterswhere ID="+parameterNo;
[0119] string sql2="Select AxisParameters.ParameterValue fromAxisParameters where ID="+parameterNo;
[0120] / / Query the database to obtain the machine tool parameter name.
[0121] string parameterName=
[0122] SQLiteHelper.GetSingleResult(sql1).ToString();
[0123] / / Query the database to obtain machine tool parameter data.
[0124] string parameterValue=
[0125] SQLiteHelper.GetSingleResult(sql2).ToString();
[0126] / / Merge parameter settings
[0127] if(item is TextBox)
[0128] parameterValue=item.Text.ToString();
[0129] / / Store the queried data in the collection
[0130] ParametersVarList.Add(parameterName,parameterValue);
[0131]
[0132] When the operator sets the relevant parameters in the software interface and clicks the "Save" button, this code starts running. Its function is to identify the Tag attributes of all controls in the software interface. If the Tag attribute contains a parameter number, the corresponding parameter name and parameter setting value are searched in the database (for example, some data shown in Table 1 and Table 2). The found data is saved in the temporary storage area "Collection". Then the NC code file is generated according to the CNC system data format.
[0133] In the above content: create a dictionary collection to store machine tool parameter data, create a corresponding object format file, traverse all controls in all interfaces, determine whether the "tag" attribute in the control contains a set value (machine tool parameter number, i.e. parameter number), obtain the machine tool parameter number, query the machine tool parameter name, parameter data, merge the parameter setting values, and store the queried parameter name and parameter data in the collection.
[0134] If the control is a non-text input box, retain the default parameter value in the database. If it is a text input box, replace the database value with the parameter value set in the text box.
[0135] These machine parameter data are stored in the data memory "set".
[0136] 3. Generate files and execute
[0137] Generate NC code file
[0138] The operation instructions of CNC machine tools are realized by executing NC codes through CNC devices. NC codes can not only execute user processing programs, but also execute codes to set changes in machine tool parameters. Taking Siemens CNC device 840Dsl as an example, its format is:
[0139] N1030$MN_CONTOUR_SAMPLING_FACTOR=1
[0140] N1040 M30
[0141] "N" + number represents the line number of the executed program. It is for reference only and has no actual function.
[0142] A line of string starting with "$" represents the name of the parameter, which corresponds to the parameter name in the database
[0143] "=" represents assignment, and the number after it represents the parameter value to be set, which corresponds to the parameter value in the database. In this example, "MN_CONTOUR_SAMPLING_FACTOR" represents the maximum sampling time calculation coefficient of the contour. After the NC code program in this example is executed, the corresponding parameter No. 10682 in the "Basic Parameters" is set to 1.
[0144] "M30" indicates the end of the program
[0145] Output the parameter data in the data "set" obtained through database query to a text file in the above format through data stream, with one parameter per line. And set the suffix of this file to the ".mpf" format that can be recognized by the CNC device. Taking the setting of axis parameters of the X1 axis as an example, the NC code program generated after the axis interface parameters are set is partially as follows:
[0146] N0880; ********************
[0147] N0890;*Parameters of Machine Parameters Setting*
[0148] N0900;******************
[0149] N1000$MA_CTRLOUT_MODULE_NR[X1]=1
[0150] N1010$MA_CTRLOUT_TYPE[X1]=1
[0151] N1020$MA_NUM_ENCS[X1]=1
[0152] N1030$MA_ENC_MODULE_NR[X1]=1
[0153] N1040$MA_ENC_TYPE[X1]=1
[0154] N1050$MA_IS_ROT_AX[X1]=0
[0155] N1060$MA_LEADSCREW_PITCH[X1]=10
[0156] N1070$MA_DRIVE_AX_RATIO_DENOM[X1]=1
[0157] N1080$MA_DRIVE_AX_RATIO_NUMERA[X1]=1
[0158] N1090$MA_MAX_AX_VELO[X1]=40000
[0159] N1100$MA_POS_LIMIT_MINUS[X1]=-5
[0160] N1110$MA_POS_LIMIT_PLUS[X1]=10000
[0161] N1120$MA_AX_VELO_LIMIT[X1]=41000
[0162] N1130$MA_MM_ENC_COMP_MAX_POINTS[X1]=100
[0163] N1140 M30.
[0164] As shown in Table 3, the correspondence between NC codes and interface controls is as follows:
[0165] Table 3
[0166]
[0167] Execution Program
[0168] Copy the NC code program (.mpf file) produced by the software to the storage area of the CNC device, ensure that the NC system alarm and authority level are "manufacturer", press the program execution button, and after the execution is completed ( Figure 6 )All parameters can be set. Figure 7 ).
[0169] 3. Advantages
[0170] 1. Through this patent, the debugging of CNC devices, which used to require professional electrical engineers to undergo training, has been transformed into a process where only familiarity with the interface of the CNC device and execution of the NC program are required to complete the machine tool parameter input, greatly reducing the on-site debugging time of the machine tool. This has not only lowered the professional threshold for debugging CNC machine tools, but also improved the production efficiency during the equipment manufacturing and debugging process.
[0171] 2. The input operation of many parameters is very likely to cause misoperation. The CNC device is the brain of the entire CNC machine tool, controlling the operation of all executable mechanisms such as servo motors, cylinders, hydraulics and other structures. A slight mistake will cause a safety accident. The present invention can avoid the occurrence of misoperation in parameter input and eliminate the safety hazards caused by misoperation.
[0172] The above are only preferred specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for automatically setting machine tool parameters based on a numerical control device, characterized in that: include: Acquire machine tool parameter data through a setting interface, wherein the machine tool parameters include basic parameter data, channel parameter data and axis parameter data; The machine tool parameter data is stored, and the stored machine tool parameter data is extracted by querying, a control file is generated, parameters of a numerical control device are set by the control file, and the numerical control machine tool is controlled according to the numerical control device after the parameters are set; The machine tool parameter data is stored in a database, wherein the database includes: a basic parameter table, a channel parameter table and an axis parameter table, which are respectively used to store the basic parameter data, the channel parameter data and the axis parameter data; The basic parameter table, channel parameter table and axis parameter table all contain lower-level data categories, where the lower-level data categories include parameter numbers, parameter names and initial parameter values. The specific descriptions of the lower-level data categories of the corresponding tables are filled in sequentially according to the basic parameter data, channel parameter data and axis parameter data; The input boxes and buttons in the setting interface are constructed by the control component, wherein the tag attribute of the control component stores the parameter number as a query intermediary between the setting interface and the database; The process of extracting stored machine tool parameter data by querying includes: Parsing the control components in the setting interface, extracting the parameter numbers corresponding to the control components, querying the corresponding parameter names and initial parameter values in the database according to the parameter numbers, extracting the query results, storing them in a data storage device, and generating a data set; A control is the smallest unit on the software interface. Each component on the interface, such as buttons, labels, and dialog boxes, is a control. Each control has its own property list to display or set the relevant properties of the control. The "tag" property of each control can store data corresponding to the machine tool parameter number. By parsing the controls in all interfaces, extracting the machine tool parameter number data contained in each control, writing a query statement, and querying in the database according to the parameter number, the machine tool parameter name and parameter data corresponding to all controls in the interface can be obtained; Create a dictionary collection to store machine tool parameter data, create a corresponding object format file, traverse all controls in all interfaces, determine whether the "tag" attribute in the control contains a set value (machine tool parameter number, i.e. parameter number), obtain the machine tool parameter number, query the machine tool parameter name, parameter data, merge the parameter setting value, and store the queried parameter name and parameter data in the collection; If the control is a non-text input box, the default parameter value of the database is retained. If it is a text input box, the parameter value set in the text box replaces the database value.
2. The method according to claim 1, characterized in that The process of obtaining machine tool parameters includes: Constructing a setting interface, wherein the setting interface includes an initial interface, a channel parameter setting interface and an axis parameter setting interface; The initial interface is provided with input boxes and buttons corresponding to basic parameters, and data is input into the corresponding input boxes and buttons according to the basic parameters to obtain basic parameter data; The channel parameter setting interface is provided with input boxes and buttons corresponding to the channel parameters, and data is input into the corresponding input boxes and buttons according to the channel parameters to obtain channel parameter data; The axis parameter setting interface is provided with input boxes and buttons corresponding to the axis parameters. Data is input into the corresponding input boxes and buttons according to basic parameters to obtain axis parameter data.
3. The method according to claim 2, characterized in that The basic parameters include: total number of axes, axis names, number of channels and channel settings.
4. The method according to claim 2, characterized in that: The channel parameters include: channel axis quantity, channel axis selection and channel name setting, and geometric axis setting.
5. The method according to claim 2, characterized in that: The axis parameters include: axis characteristics, reduction ratio, pitch, maximum operating speed, speed monitoring threshold, positive stroke, negative stroke, pitch compensation points, master-slave function and gantry axis function.
6. The method according to claim 1, characterized in that According to the data set, a control file is generated in the form of NC code, and the control file is transmitted to the storage area of the numerical control device to set parameters of the numerical control device.
Citation Information
Patent Citations
Method for online managing cutting tool of numerically controlled lathe
CN101770222A
Method for automatically setting flexible cutting parameters of numerical control device
CN110597186A