Method for parameterizing processing object based on two-dimensional drawing
Technical Field
The invention relates to the field of parametric machining, in particular to a method for parametrically machining an object based on a two-dimensional drawing.
Background
In the field of machining, a numerically controlled machine tool system performs machining according to a two-dimensional graph input by a user. This makes intangible input requirements for the user high. For planar graphic processing, the user may give a more desirable graphic. For more complicated three-dimensional graphic processing, such as processing on an ellipsoid, the graphic input by the user may not be the one really intended by the user. Therefore, errors between the user input graph and the correspondingly processed graph are inevitably generated, and the difficulty of user input is also increased.
Chinese patent (CN 104698980 a) discloses a feature-based parameterized machining control method for a numerical control vertical lathe, which includes: step S11, pre-installing a parameterized standard cycle module for processing a product to be processed and a global variable definition module for defining processing parameters; step S12, determining a characteristic processing area in the product to be processed; step S13, selecting a certain characteristic of the characteristic processing area, and determining the geometric parameter of the selected characteristic; step S14, determining the cutting parameters of the selected features; step S15, selecting a standard circulation program unit corresponding to the selected feature in the parameterized standard circulation module, inputting the geometric parameters and cutting parameters of the feature, generating a machining program for the selected feature, and finishing the machining of the selected feature; and repeating the steps S13 to S15 until the processing of all the characteristics of the characteristic processing area is completed. Thereby this patent needs the user to manually input the geometric parameters of waiting to process the product and process the product, and is loaded down with trivial details troublesome. And the manual input parameters are easy to generate errors, so that more defective products are processed, and the production cost of manufacturers is increased.
Disclosure of Invention
Aiming at the defects of the prior art, the invention provides a method for parameterizing a machined object based on a two-dimensional drawing, which is characterized by comprising the following steps:
reading graphic data of at least one two-dimensional drawing in a graphic primitive reading mode;
establishing a database comprising at least one model based on the primitives and associated coordinates;
calibrating characteristic parameters of a model to be processed, which are obtained by matching the input model parameters with the model;
and storing the parameters of the model to be processed and processing the object to be processed according to the parameters.
According to a preferred embodiment, the method of building a database comprising at least one model based on the primitives and associated coordinates comprises:
combining at least one primitive into at least one first processing model based on a coordinate system;
respectively storing model parameters input from the outside and a model to be processed in a mapping mode;
forming a second machining model based on the model to be machined and the at least one model parameter;
storing the second machining model in a model database.
According to a preferred embodiment, the manner of reading the primitive includes:
establishing a three-dimensional coordinate system uniquely representing the position of a primitive based on the direction identification marked on the drawing;
marking primitive shapes and/or positions with coordinates or functions;
and correcting the shape and position coordinates of the graphic primitive.
According to a preferred embodiment, the method of parameterizing a work object comprises:
counting the combined probability of all the primitives combined together and storing the combined probability in a probability database;
and sending early warning to the primitive combination with abnormal combination probability.
According to a preferred embodiment, the method of parameterizing a work object comprises:
determining a characteristic processing area of the object to be processed based on the characteristic parameters of the model to be processed;
determining cutting parameters of the features based on the material of the object to be processed, the used prop information and the feature parameters;
a machining program for the selected feature is generated based on the input feature parameter and the cutting parameter to machine the object to be machined.
According to a preferred embodiment, the method of parameterizing a work object comprises:
calculating each curved surface function of the model to be processed formed by the primitives;
and converting the curved surface function into a mechanical axis motion coordinate matched with the processing device.
According to a preferred embodiment, the direction marks of the drawing comprise a radial mark, a transverse mark, a coordinate mark and a scale mark.
According to a preferred embodiment, the database further comprises a primitive database storing primitives by primitive type and coordinate zone classification.
The invention also provides a device for parameterizing the processed object based on the two-dimensional drawing, which is characterized by comprising a graphic input unit, a database unit, a calibration unit, a storage unit and a PLC control processing unit,
the graphic input unit reads graphic data of at least one two-dimensional drawing in a graphic primitive reading mode;
the database unit stores at least one model established based on the primitives and the relevant coordinates;
the calibration unit calibrates the characteristic parameters of the model to be processed, which are obtained by matching the input model parameters with the model;
the storage unit stores the parameters of the model to be processed and enables the PLC to control the processing unit to process the object to be processed according to the parameters.
According to a preferred embodiment, the apparatus further comprises a machining model generating unit including a first acquiring unit, a second acquiring unit, a third acquiring unit, and a first creating unit,
the first acquisition unit combines at least one primitive into at least one first processing model based on a coordinate system;
the second acquisition unit acquires model parameters input from the outside;
the third obtaining unit obtains parameters of a model to be processed;
the second acquisition unit and the third acquisition unit respectively store model parameters input from the outside and model parameters to be processed in a mapping manner;
the first creating unit creates a second machining model based on the model to be machined and at least one model parameter;
the second processing model is stored in the database unit.
The invention has the beneficial technical effects that:
the invention provides a method for parameterizing a processing object based on a two-dimensional drawing, which is simple, quick, high in accuracy and capable of saving time cost and error rate, wherein the processing parameters of the object to be processed are directly obtained through the drawing to process a product. The method calibrates the obtained machining model, so that the characteristic parameters of the machining model are more accurate, and the machined object completely consistent with the drawing is obtained.
Drawings
FIG. 1 is a schematic flow diagram of a method for parameterizing a machined object based on a two-dimensional drawing according to the present invention;
FIG. 2 is a schematic illustration of a method of calculating machine axis coordinates according to the present invention;
FIG. 3 is a schematic flow chart of the present invention for performing a process for selected features;
FIG. 4 is a schematic flow diagram of an apparatus for parameterizing a work object based on two-dimensional drawings according to the present invention; and
FIG. 5 is a schematic view of a processing model generation unit according to the present invention.
Detailed Description
The following detailed description is made with reference to the accompanying drawings.
The primitive in the present invention is a basic unit which constitutes an image, such as a minimum graphic unit which can be edited by a point, a line, a surface, and the like in a three-dimensional model.
As shown in fig. 1, the present invention provides a method for parameterizing a processing object based on a two-dimensional drawing, the method comprising: reading graphic data of at least one two-dimensional drawing in a graphic primitive reading mode;
establishing a database comprising at least one model based on the primitives and associated coordinates;
calibrating characteristic parameters of a model to be processed, which are obtained by matching the input model parameters with the model;
and storing the parameters of the model to be processed and processing the object to be processed according to the parameters.
Example one
And scanning the graph, the direction mark and other special marks on the first two-dimensional drawing. And determining direction marks of the two-dimensional drawing, including a radial mark, a transverse mark and a coordinate mark. And establishing a three-dimensional space coordinate system according to the direction identifier. And dividing the graph of the two-dimensional drawing into a plurality of primitives. And recording the spatial region, the shape and the specific position of each primitive by using coordinates or a function equation. And storing the data information of each primitive in a primitive database. The database also includes a primitive database that stores primitives by primitive type and coordinate zone classification.
And reading the graph, the direction identification and other special identifications on the second two-dimensional drawing. And if the second drawing and the first drawing belong to the same plane and the graphs are drawn in the same proportion, recording the spatial region, the shape and the specific position of the graphic element on the second drawing by using the coordinate or the function equation of the same three-dimensional coordinate system. And if the second drawing sheet and the first drawing sheet belong to different planes, recording the drawing elements according to the coordinates or the function equation of the corresponding coordinate area. Other two-dimensional drawings are read in the same manner.
A database comprising at least one model is built based on the primitives and associated coordinates. The database comprises a drawing data base, a model parameter table and a processing model parameter table. And combining at least one primitive belonging to the same model into a first processing model in the same three-dimensional coordinate system. And obtaining model parameters input from the outside and storing the model parameters and the model to be processed in a mapping mode respectively. That is, the externally inputted model is stored in the model parameter table. The model parameters in the model parameter table have a mapping relation with the processing model parameter table of the model to be processed.
The step of obtaining a plurality of model parameters corresponding to the modeling parameter information in the processing model parameter table comprises the following steps: acquiring a mapping relation between modeling parameter groups in a processing model parameter table; determining a model parameter group corresponding to an externally input model parameter in a processing model parameter table according to the mapping relation; and acquiring a model parameter group corresponding to the model parameter input from the outside.
Further, creating the second machining model according to the acquired model parameters includes: acquiring a first parameter item in the model parameter group, wherein the first parameter item is a parameter in the model parameter group; acquiring a first parameter item first parameter corresponding to the first parameter item, wherein the first parameter item first parameter is a parameter of the first parameter item; and creating a second machining model based on the first parameter item and the first parameter.
And after the second processing model is obtained, counting the combination probability of all the graphic primitives combined together and storing the combination probability in a probability database. And sending early warning to the primitive combination with abnormal combination probability. And (5) counting the combined probability of combining all the graphic primitives with each other. And the combined probability is divided into different levels according to the height. For example, primitive combinations with a combination probability below 1% are marked as abnormal combinations. And counting the probability of each primitive combination forming the first processing model, and giving an early warning to the primitive combination with abnormal combination. And reminding a user to manually confirm the correctness of the primitive combination so as to avoid forming an incorrect first processing model due to the coordinate error of the primitive.
The second machining model is a model to be machined. A logic database of the model to be processed is pre-stored in the device. And after the model to be processed is formed, calibrating the characteristic parameters of the model to be processed according to the logic database. And calculating whether each characteristic parameter of the model to be processed and the position of the graph meet the rule of the logic data. And calibrating the characteristic parameters which do not accord with the logic rule. Or, the coordinates of each primitive in the model to be processed are recalibrated. And counting a characteristic parameter table which is formed after the model to be processed is formed. And according to the characteristic parameter table ratio, the characteristic parameters of the model to be processed are obtained. And correcting the characteristic parameter calibration with errors from the characteristic parameter table. If the error of the characteristic parameter and the corresponding sample characteristic parameter in the characteristic parameter table is found to be out of the normal error range, firstly, whether the characteristic parameter accords with the rule of the logic data is calculated. If the data does not accord with the rule of the logic data, an early warning is sent out, and the characteristic parameters of errors are corrected manually. The error rate of the model to be processed after the calibration process is lower.
And storing the parameters of the model to be processed and processing the object to be processed according to the parameters. Specifically, a characteristic machining area of the object to be machined is determined based on characteristic parameters of the model to be machined.
And selecting a certain characteristic of the characteristic processing area, and determining the selected characteristic parameter according to the drawing.
Specifically, after a certain feature of the feature processing area is selected, the driving geometric information of the feature processing area is extracted according to a part drawing, and the selected feature parameter is determined.
Calculating each curved surface function of the model to be processed formed by the primitives; and converting the curved surface function into a mechanical axis motion coordinate matched with the processing device.
For example, as shown in fig. 2, the curved surface of the model to be processed is a spherical surface, and the coordinate transformation formula is:
due to the fact that the projection is vertical,
d is point A
,On the Z axisProjection of
And | O 'a' | ═ r, which is the radius of the object to be machined. Then
To obtain
In the above formula, x and y are plane coordinates on a machining graph after center offset is performed, r is the spherical radius of the spectacle lens to be machined, and LQW refers to the axial length of the spectacle lens to be machined in a machine tool.
And determining the cutting parameters of the selected characteristics according to the material of the product to be processed, the used cutter information and the selected characteristic parameters. Specifically, in the present embodiment, the tool information is determined by the selected characteristic parameter; the tool information at least comprises a tool type, a tool characteristic parameter, a tool processing mode and the like.
And inputting external parameters, namely the characteristic parameters and the cutting parameters, generating a machining program for the selected characteristic, and finishing machining of the selected characteristic. As shown in fig. 3, completing the processing of the selected feature specifically includes the steps of:
step S21, introducing external parameters, namely introducing external geometric parameters and cutting parameters;
and step S22, calculating other geometrical sizes of the features and data parameters required for forming the tool path through the introduced external geometrical parameters and cutting parameters.
In step S23, the parameters are used to generate a cutting path of the tool path.
And step S24, executing the tool path cutting route to finish the required cutting process.
If the situation that the actual production state changes due to the fact that a drawing is modified or other products with similar characteristic structures are designed after programming occurs, or different cutters, different machining modes, different cutting amounts and the like are selected in the production process, corresponding external parameters (cutting parameters) can be directly modified, the numerical control machining program can be universal, the labor intensity of programming personnel is greatly reduced, and the production preparation period is shortened.
In addition, in the present embodiment, if the inputted cutting parameters are wrong or the parameters for forming the tool path are wrong, the method further includes a step of alarming when a machining program for the selected feature is generated. Therefore, if wrong parameters are set or wrong tool information is input in the process of programming or modifying the program, alarm information appears in the program in the execution process so as to remind programmers or machine tool operators to correct in time and avoid on-site production accidents.
Example two
The embodiment also provides a device for parameterizing the processed object based on the two-dimensional drawing, which comprises a graphic input unit, a database unit, a coordinate conversion unit, a calibration unit, a storage unit and a PLC control processing unit. The graphic input unit reads the graphic data of at least one two-dimensional drawing in a graphic primitive reading mode. The database unit stores at least one model built based on the primitives and associated coordinates. The calibration unit calibrates the characteristic parameters of the model to be processed, which are obtained by matching the input model parameters with the model. The storage unit stores parameters of the model to be processed and enables the PLC to control the processing unit to process the object to be processed according to the parameters.
According to a preferred embodiment, the apparatus further comprises a coordinate transformation unit. The coordinate conversion unit establishes a three-dimensional coordinate system uniquely representing the position of the primitive based on the direction identification marked on the drawing, marks the shape and/or the position of the primitive by coordinates or functions, and/or corrects the shape and the position coordinates of the primitive.
Fig. 4 is a schematic diagram of an apparatus for parameterizing a machining object based on a two-dimensional drawing according to the present invention.
The graphic input unit scans the graphics, direction marks and other special marks on the first two-dimensional drawing. And determining direction marks of the two-dimensional drawing, including a radial mark, a transverse mark and a coordinate mark. And establishing a three-dimensional space coordinate system according to the direction identifier. And dividing the graph of the two-dimensional drawing into a plurality of primitives. And recording the spatial region, the shape and the specific position of each primitive by using coordinates or a function equation. And storing the data information of each primitive in a primitive database in a database unit. The database unit further includes a primitive database storing primitives by primitive types and coordinate zones.
The graphic input unit reads the graphics, the direction identification and other special identifications on the second two-dimensional drawing. And if the second drawing and the first drawing belong to the same plane and the graphs are drawn in the same proportion, recording the spatial region, the shape and the specific position of the graphic element on the second drawing by using the coordinate or the function equation of the same three-dimensional coordinate system. And if the second drawing sheet and the first drawing sheet belong to different planes, recording the drawing elements according to the coordinates or the function equation of the corresponding coordinate area. Other two-dimensional drawings are read in the same manner. And the coordinate conversion unit rechecks the coordinate or function equation mark of the primitive and corrects the mark with the error so as to ensure that the mark of the primitive is more accurate and reduce the error of the graph formed after the primitives are combined together.
A database unit comprising at least one model is built based on the primitives and associated coordinates. The database unit comprises a drawing database, a model parameter table and a processing model parameter table. The invention also comprises a model generation unit to be processed. As shown in fig. 5, the machining model generating unit includes: a first acquisition unit 10, a second acquisition unit 20, a third acquisition unit 30 and a first creation unit 40.
The first obtaining unit 10 is configured to obtain a model parameter table, where the model parameter table is used to store a plurality of modeling parameters corresponding to the first processing model, where the plurality of modeling parameters are parameters for modeling the first processing model, and the plurality of modeling parameters are stored in the model parameter table after being classified.
Preferably, the first obtaining unit 10 includes: the first determining module is used for determining the type of the modeling parameter corresponding to the first machining model; the processing module is used for performing classification processing on a plurality of modeling parameters corresponding to the processing model according to the types of the modeling parameters to obtain a plurality of modeling parameter groups;
the first establishing module is used for establishing a model parameter table; and a storage module for storing the plurality of modeling parameter sets into the model parameter table.
And a second obtaining unit 20, configured to obtain externally input machining model parameter information.
The third obtaining unit 30 is configured to obtain a plurality of model parameters corresponding to the modeling parameter information in the model parameter table.
Preferably, the third acquiring unit 30 includes: the first acquisition module is used for acquiring the mapping relation among modeling parameter groups in the model parameter table; the second determining module is used for determining a modeling parameter group corresponding to the externally input machining model parameter in the model parameter table according to the mapping relation; and the second acquisition module is used for acquiring the model parameter group corresponding to the model parameter input from the outside.
And a first creating unit 40, configured to create a second machining model using the obtained modeling parameters.
Preferably, the first creating unit 40 includes: a third obtaining module, configured to obtain a first parameter item in the model parameter set, where the first parameter item is a parameter in the model parameter set; the fourth obtaining module is used for obtaining a first parameter item first parameter corresponding to the first parameter item, wherein the first parameter item first parameter is a parameter of the first parameter item; and a second creation module for creating a second machining model based on the first parameter item and the first parameter.
In this embodiment, a model parameter table is obtained by the first obtaining unit 10, where the model parameter table is used to store a plurality of model parameters corresponding to the first processing model, where the plurality of modeling parameters are parameters for modeling the first processing model, and the plurality of modeling parameters are stored in the model parameter table after being classified. The second acquisition unit 20 acquires externally input machining model parameter information. The third acquisition unit 30 acquires a plurality of modeling parameters corresponding to the modeling parameter information in the model parameter table. And the modeling parameters acquired by the first creating unit 40 create the second machining model, so that the problem of low efficiency in processing for modifying the model to be machined based on the modeling parameters of the existing machining model in the prior art is solved.
After the second processing model is obtained, the statistical unit calculates the combination probability of all the primitives combined together and stores the combination probability in the probability database. And sending early warning to the primitive combination with abnormal combination probability. And (5) counting the combined probability of combining all the graphic primitives with each other. And the combined probability is divided into different levels according to the height. For example, primitive combinations with a combination probability below 1% are marked as abnormal combinations. And counting the probability of each primitive combination forming the first processing model, and giving an early warning to the primitive combination with abnormal combination. And reminding a user to manually confirm the correctness of the primitive combination so as to avoid forming an incorrect first processing model due to the coordinate error of the primitive.
The second machining model is a model to be machined. The database unit is pre-stored with a logic database of the model to be processed. After the model to be processed is formed, the calibration unit calibrates the characteristic parameters of the model to be processed according to the logic database. The calibration unit calculates whether each characteristic parameter of the model to be processed and the position of the graph accord with the rule of the logic data. And calibrating the characteristic parameters which do not accord with the logic rule. Or, the coordinates of each primitive in the model to be processed are recalibrated. And counting a characteristic parameter table which is formed after the model to be processed is formed. And according to the characteristic parameter table ratio, the characteristic parameters of the model to be processed are obtained. And correcting the characteristic parameter calibration with errors from the characteristic parameter table. If the error of the characteristic parameter and the corresponding sample characteristic parameter in the characteristic parameter table is found to be out of the normal error range, firstly, whether the characteristic parameter accords with the rule of the logic data is calculated. If the data does not accord with the rule of the logic data, an early warning is sent out, and the characteristic parameters of errors are corrected manually. The error rate of the model to be processed after the calibration process is lower.
And storing the parameters of the model to be processed in the unit and processing the object to be processed according to the parameters. Specifically, a characteristic machining area of the object to be machined is determined based on characteristic parameters of the model to be machined. And the PLC controls the processing unit to process the object to be processed according to the parameters. And the PLC controls the processing unit to calculate the coordinate parameter of the mechanical axis according to the characteristic parameter of the model to be processed and the formed cutting parameter. And the PLC controls the processing unit to determine the cutting parameters of the selected characteristics according to the material of the product to be processed, the used cutter information and the selected characteristic parameters. Specifically, in the present embodiment, the tool information is determined by the selected characteristic parameter. The tool information at least comprises a tool type, a tool characteristic parameter, a tool processing mode and the like.
The PLC controls the processing unit to generate a processing program for the selected feature according to the input external parameters, namely the input feature parameters and the cutting parameters, and the processing of the selected feature is completed. The step of completing the processing of the selected feature comprises the following steps:
step S21, introducing external parameters, namely introducing external geometric parameters and cutting parameters;
and step S22, calculating other geometrical sizes of the features and data parameters required for forming the tool path through the introduced external geometrical parameters and cutting parameters.
In step S23, the parameters are used to generate a cutting path of the tool path.
And step S24, executing the tool path cutting route to finish the required cutting process.
The PLC controls the processing unit to monitor each step in the processing program and collects the pressure, temperature parameters and working conditions of the model to be processed in the production process. And adjusting pressure and temperature parameters according to the working condition, the material and the condition of the cutting tool so as to prevent the material of the model to be processed from deforming, thereby reducing the error of the model to be processed in the processing process.
Specifically, the PLC controlled processing unit includes:
the input setting module is used for selecting working units on the touch screen, numbering each working unit and setting position key points for each working unit according to the numbering sequence, wherein the position key points comprise two or more position points; . The field bus module is used for collecting the state information and/or the request information of each working unit in real time and sending the state information and/or the request information to the PLC, wherein the state information comprises the current position point, and the request information comprises the position point which is requested to enter and the action execution information;
and the PLC control module is used for analyzing the state information and/or the request information of all the working units to judge whether the request information of each working unit can be responded, if so, the working unit executes according to the request information, otherwise, the working unit enters a preset position to wait.
Further, the PLC control module specifically includes:
the register module is used for respectively storing the state information and/or the request information of each working unit into registers with different addresses through the field bus module, and a general functional instruction is preset in each register;
the decoding module is used for decoding the state information and/or the request information in the registers at different addresses through the decoding instruction and sending the decoded state information and/or the request information to the judging module;
and the judging module is used for judging whether the position point requested to enter by each working unit conflicts with the current position points of other working units and/or the position points requested to enter, if no conflict exists, the working unit executes the request information by calling the functional instruction in the register of the working unit, otherwise, the working unit and the working unit which conflicts with the working unit enter a preset position to wait and send an alarm at the same time.
Therefore, the PLC controls the processing unit to monitor all parameters of the processing model in the machining process, and adjusts the parameter samples and the parameters according to the working conditions, so that the error rate of the processing model in the processing process is reduced, and the obtained processing model is more accurate.
It should be noted that the above-mentioned embodiments are exemplary, and that those skilled in the art, having benefit of the present disclosure, may devise various arrangements that are within the scope of the present disclosure and that fall within the scope of the invention. It should be understood by those skilled in the art that the present specification and figures are illustrative only and are not limiting upon the claims. The scope of the invention is defined by the claims and their equivalents.