CN112068836A - G code generation method and device of dispenser, terminal equipment and storage medium - Google Patents

G code generation method and device of dispenser, terminal equipment and storage medium Download PDF

Info

Publication number
CN112068836A
CN112068836A CN202010942424.5A CN202010942424A CN112068836A CN 112068836 A CN112068836 A CN 112068836A CN 202010942424 A CN202010942424 A CN 202010942424A CN 112068836 A CN112068836 A CN 112068836A
Authority
CN
China
Prior art keywords
open
graphic element
adjacent
end point
graphic
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010942424.5A
Other languages
Chinese (zh)
Other versions
CN112068836B (en
Inventor
张清源
林淦斌
叶航
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fuqin Intelligent Technology Kunshan Co ltd
Original Assignee
Fuqin Intelligent Technology Kunshan Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fuqin Intelligent Technology Kunshan Co ltd filed Critical Fuqin Intelligent Technology Kunshan Co ltd
Priority to CN202010942424.5A priority Critical patent/CN112068836B/en
Publication of CN112068836A publication Critical patent/CN112068836A/en
Application granted granted Critical
Publication of CN112068836B publication Critical patent/CN112068836B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The invention discloses a G code generation method and device of a dispenser, terminal equipment and a storage medium. The method comprises the steps of obtaining a drawing exchange file, wherein the drawing exchange file comprises a plurality of open graphic elements to be drawn; traversing each open graphic element to generate a graphic adjacency list of each open graphic element; traversing each open graphic element based on the graphic adjacency list to generate a continuous track of the open graphic element; and generating dispensing G codes corresponding to the drawing exchange file based on the continuous track. The continuous dispensing can be controlled without manually teaching or scanning and shooting the material object, the continuity of the dispensing process is ensured, and the precision and the efficiency of the dispensing process are improved.

Description

G code generation method and device of dispenser, terminal equipment and storage medium
Technical Field
The embodiment of the invention relates to the field of numerical control machines, in particular to a G code generation method and device of a dispenser, terminal equipment and a storage medium.
Background
Most of the traditional dispensing machines record and input dispensing tracks in a teaching mode, a large amount of time is consumed, and meanwhile the track precision is influenced by operators; most of the existing automatic track generation methods rely on image recognition technology, and are high in cost, low in speed and complex in process. In addition, the existing method for automatically generating the track is mainly based on the fact that images are shot or other sensors are used for measuring actual dies and workpieces, and finally, the measured data are processed to generate the dispensing track, the contour extraction is required to be carried out according to a material object element, and the efficiency is low.
Disclosure of Invention
The invention provides a G code generation method and device of a dispenser, terminal equipment and a storage medium, which can realize control of continuous dispensing without manual teaching or scanning and shooting of real objects, ensure the continuity of a dispensing process and improve the precision and efficiency of a dispensing process.
In a first aspect, an embodiment of the present invention provides a G code generation method for a dispenser, where the method includes:
acquiring a drawing exchange file, wherein the drawing exchange file comprises a plurality of open graphic elements to be drawn;
traversing each open graphic element to generate a graphic adjacency list of each open graphic element;
traversing each open graphic element based on the graphic adjacency list to generate a continuous track of the open graphic element;
and generating a G code corresponding to the drawing exchange file based on the continuous track.
In a second aspect, an embodiment of the present invention further provides a G code generation apparatus for a dispenser, where the apparatus includes:
the drawing exchange file acquisition module is used for acquiring a drawing exchange file, wherein the drawing exchange file comprises a plurality of open graphic elements to be drawn;
the graph adjacency list generating module is used for traversing each open graphic element and generating a graph adjacency list of each open graphic element;
a continuous track generation module, configured to traverse each open graphic element based on the graphic adjacency list, and generate a continuous track of the open graphic element;
and the G code generating module is used for generating the G code corresponding to the drawing exchange file based on the continuous track.
In a third aspect, an embodiment of the present invention further provides a control device, where the control device includes:
one or more processors;
a storage device for storing one or more programs,
when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the G code generation method of the dispenser as provided by any embodiment of the present invention.
In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the G code generation method of a dispenser provided in any embodiment of the present invention.
According to the G code generation method of the dispenser, provided by the embodiment of the invention, the graphic adjacency list of each open graphic element is generated by acquiring the drawing exchange file and traversing each open graphic element; traversing each open graphic element based on the graphic adjacency list to generate a continuous track of the open graphic element; and generating dispensing G codes corresponding to the drawing exchange file based on the continuous track. And G codes of continuous dispensing tracks are generated according to the drawing exchange files and the process parameters, so that the fact that a real object is not required to be taught or scanned or shot manually is realized, the continuity of the dispensing process is ensured, and the precision and the efficiency of the dispensing process are improved.
Drawings
Fig. 1 is a flowchart of a G code generation method of a dispenser according to an embodiment of the present invention;
fig. 2 is a flowchart of a G code generation method of a dispenser according to a second embodiment of the present invention;
FIG. 3 is a diagram illustrating a data structure of a graphics adjacency list according to a second embodiment of the present invention;
fig. 4 is a flowchart of a G code generation method of a dispenser according to a third embodiment of the present invention;
fig. 5 is a schematic structural diagram of a G code generation apparatus of a dispenser according to a fourth embodiment of the present invention;
fig. 6 is a schematic structural diagram of a control device according to a fifth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1 is a flowchart of a G code generation method of a dispenser according to a first embodiment of the present invention, which may be applied to a case where a dispenser is controlled, where the method may be executed by a device controlled by the dispenser, and the dispenser control device may be implemented in a software and/or hardware manner, for example, the dispenser control device may be configured in a terminal controller, and the present embodiment does not limit the type and the device of a data processing device. As shown in fig. 1, the method specifically includes:
and S110, acquiring a drawing exchange file.
In order to realize continuous track dispensing control without manual shooting teaching, a control program for acquiring graphic elements in a drawing exchange file, generating a graphic adjacency list and generating continuous tracks based on process parameters is needed. The file Format of the Drawing Exchange file (DXF) is a CAD data file Format for CAD data Exchange between AutoCAD and other software, and the Format is a vector data Format. Optionally, the data formats are divided into ASCII and binary data formats. Drawing exchange files are widely used due to their data formats.
In the embodiment of the present invention, the drawing exchange file stores graphic elements to be drawn, and optionally, the graphic elements in the drawing exchange file include open graphic elements and closed graphic elements. Specifically, the open graphic elements include, but are not limited to, straight line graphic elements, multi-line segment graphic elements, and circular arc graphic elements; closed figure elements include, but are not limited to, single dot figure elements and full circle figure elements.
Optionally, in some embodiments, before obtaining the drawing exchange file, first obtaining state information of the dispenser, where the state information includes position state information and operation state information of the dispenser, and specifically, the state information may be displayed through a preset human-machine interaction interface. Optionally, adjustment data of the current position of the dispenser of the user can be acquired through the human-computer interaction interface, and the dispenser is adjusted to the preset position according to the reference point position data designed according to the process, so that the dispenser can dispense glue from the preset position conveniently.
Optionally, a storage address of a drawing exchange file stored in the control device and input by a user is obtained through the human-computer interaction interface, and the required drawing exchange file is read through the storage address; the drawing exchange file imported by the user may also be directly acquired, and the embodiment does not limit the manner of acquiring the drawing exchange file.
And S120, traversing each open graphic element to generate a graphic adjacent list of each open graphic element.
In the embodiment of the invention, all open graphic elements in the drawing exchange file are obtained, and all the open graphic elements are stored in the preset list. For example, the drawing exchange file may at least include a straight line list, a multi-line segment list, and a circular arc category, and respectively store the straight line graphic element, the multi-line segment graphic element, and the circular arc graphic element.
Optionally, the index identifier corresponding to each open graphic element and the index identifier corresponding to each endpoint in each open graphic element are preset. The index identifier may be, but is not limited to, a name, a number, or a character string formed of at least one of a number, a letter, and a character of each graphic element, and the like. For example, the index identifiers of the open graphic elements may be generated according to the element types and the storage locations in the preset list, for example, the type identifiers of the straight-line graphic elements, the multi-line segment graphic elements, and the arc graphic elements may be A, B and C (where A, B and C are merely examples and are not limited to A, B and C), respectively, the index identifiers of the straight-line graphic elements in the straight-line list may be a1, a2, A3, and the like, and similarly, the index identifiers of the multi-line segment graphic elements in the multi-line segment list may be B1, B2, B3, and the like, and the index identifiers of the arc graphic elements in the arc category may be C1, C2, C3, and the like. The index identification of each endpoint in the open graphic element may be determined based on the index identification of the open graphic element, for example, the endpoint index identification of the straight graphic element a1 may be a11 and a12, the endpoint index identification of the circular arc graphic element C2 may be C21 and C22, and so on. By the method, the open graphic elements and the index identifications of the end points of the open graphic elements are automatically set, so that time waste caused by manually setting the index identifications under the condition of large number of the open graphic elements is avoided.
In this embodiment, the graphic adjacency list is a preset list in which the adjacent relationship of each open graphic element and the adjacent relationship of each endpoint are stored. Alternatively, the graphical adjacency list may be stored in formats including, but not limited to, table format, text format, and graphical format.
The position information of each end point of each open graphic element in the drawing exchange file is acquired, for example, the position information may be coordinate information. Optionally, any end point of any open graphic element is obtained, and the distance between the end point and each of the other end points in the preset list is calculated according to the position information. And when the distance value between any two end points is smaller than the preset distance, determining that the two current end points are adjacent end points, and the open graphic elements to which the two end points belong are adjacent graphic elements. And when the distance between any end point and each end point of the other open graphic elements is larger than the preset distance, determining that the current end point is an open end point. Alternatively, the preset distance may be preset, and may be 1mm, 5mm, or 1cm, for example. And traversing all the open graphic elements and all the end points in sequence, and forming a graphic adjacency list based on the adjacent relation of each open graphic element and the adjacent relation of each end point in each open graphic element. Further, based on the adjacent relationship of each open graphic element and the adjacent relationship of each endpoint in each open graphic element, and the index identifier corresponding to each open graphic element and the index identifier corresponding to each endpoint, an adjacent relationship between the index identifiers is formed, and a graphic adjacent list of each open element is formed based on the index identifiers.
S130, traversing each open graphic element based on the graphic adjacency list, and generating a continuous track of the open graphic element.
In the embodiment of the invention, for example, the continuity of the dispensing operation is improved, and the tracks of the open graphic elements meeting the adjacent distance condition are spliced to form a continuous track. The graphic adjacency list comprises all open graphic elements meeting the distance adjacency condition and the adjacency relation of all the open graphic elements. And splicing all open graphic elements in the drawing exchange file based on the graphic adjacency list to form at least one continuous track. Specifically, at least one adjacent open element of the current open graphical element may be determined based on the graphical adjacency list starting from any open graphical element or an end point of any open graphical element, and the adjacent open elements of the adjacent open element may be determined, and so on, and the respective trajectories of the adjacent open graphical elements may be spliced to form a continuous trajectory.
In some embodiments, traversing the respective open graphical elements based on the graphical adjacency list, generating a continuous trajectory of the open graphical elements, comprises: and obtaining each open end point in the graph adjacency list, taking any open end point as a starting point for generating the continuous track, determining each open graphic element which is sequentially adjacent to the open graphic element to which the starting point of the continuous track belongs and an end point of the continuous track based on the adjacent relation of each open graphic element and the adjacent relation of each end point in the graph adjacency list, and forming the continuous track of each open graphic element. Illustratively, the graphical adjacency list includes a straight-line graphical element a1, an arc graphical element C2, and a multi-line segment graphical element B3, where an endpoint a11 of the straight-line graphical element a1 is an open endpoint, an endpoint a12 is an adjacent endpoint to an endpoint B31 of the multi-line segment graphical element B3, an endpoint B32 of the multi-line segment graphical element B3 is an adjacent endpoint to an endpoint C22 of the arc graphical element C2, and an endpoint C21 is an open endpoint. Correspondingly, the graph adjacency list including the open end points a11 and C21 may use any open end point as a starting point, for example, may be the open end point C21, determine an adjacent end point of another end point C22 of the arc graphic element C2 to which the open end point C21 belongs, that is, an end point B32, further determine that an adjacent open element of the arc graphic element C2 is a multi-line segment graphic element B3, determine an adjacent end point of an end point B31 that is not traversed in the multi-line segment graphic element B3, that is, an end point a12, further determine that the straight line graphic element a1 is an adjacent open element of the multi-line segment graphic element B3, and determine that an end point a11 that is not traversed in the straight line graphic element a1 is an open end point, that is an end. Therefore, the generated continuous trajectory is formed by stitching the trajectories of the circular arc figure element C2, the multi-line segment figure element B3 and the straight line figure element a1 in sequence. And sequentially traversing each open graphic element from any open end point, so that the omission of the end points or the elements can be avoided in the process of generating the track, and the continuous track of each open graphic element is completely generated.
In some embodiments, any open graphic element may be further used as a starting point element for traversal, the adjacent end points of the two end points of the starting point element and the adjacent graphic element to which the adjacent end points belong are respectively determined according to the graphic adjacent list, the adjacent end points and the next adjacent graphic element are respectively determined for the end points which are not traversed in each adjacent graphic element until the adjacent end points and the next adjacent graphic element do not exist in the end points which are not traversed, the determined tracks of the sequentially adjacent open graphic elements are spliced to form a continuous track, and any open end point in the continuous track is used as a track starting point, and the other open end point is used as a track ending point. And respectively traversing from two end points of any open graphic element to generate a continuous track, and rapidly traversing each end point and each open graphic element so as to rapidly generate the continuous track of each open graphic element.
Determining whether an unretraversed open endpoint and/or an unretraversed open graphic element still exist in the graphic adjacency list or not based on the generated continuous track of each open graphic element; optionally, all open endpoints and open graphic elements in the graphic adjacency list may be respectively matched with endpoints and graphic elements in the continuous trajectory, and when all the open endpoints and open graphic elements can be successfully matched, it indicates that there are no open endpoints and open graphic elements that are not traversed, and when the matching is unsuccessful, there are open endpoints and/or open graphic elements that are not traversed. If the open end points exist, generating a new continuous track for the new track starting point based on the open end points which are not traversed, or when the open end points do not exist in the open graphic elements which are not traversed, generating a new continuous track for the new track starting point based on any end point of any open graphic element which is not traversed.
And S140, generating a G code corresponding to the drawing exchange file based on the continuous track.
In the embodiment of the invention, the process parameters for the dispensing operation are received from the user operation input. Specifically, the process parameter includes at least one of a feed speed, a feed distance, a retract distance, and a work plane offset. Optionally, the process parameter data manually input by the user may be obtained, or the process parameter picture taken by the user may be identified to obtain the process parameter data, which is not limited in the embodiment.
Optionally, the G code of the continuous track of each open graphic element is generated according to each process parameter and the continuous track of each open graphic element. For example, when the continuous track is at the starting point and any end point in the middle, the G code of the feeding behavior may be generated according to the feeding distance in the process parameters; and when the continuous track is at the end point of the continuous track, generating a G code of the tool retracting action according to the tool retracting distance in the process parameters. Optionally, the different types of openness elements may correspond to different sub-code segments, and the corresponding sub-code segments are sequentially called based on the types of the openness elements sequentially included in the continuous track, so as to form a G code corresponding to the continuous track. And distributing the G codes corresponding to the continuous track, the track starting point and the track ending point to form the G codes corresponding to the drawing exchange file.
In some embodiments, optionally, closed graphic elements in the drawing intersection file are acquired, and G codes of continuous tracks of the closed elements are generated; and sending control instructions in the acquired G codes for generating the continuous tracks of the open graphic elements and the acquired G codes for generating the continuous tracks of the closed elements to a currently controlled dispenser.
According to the G code generation method of the dispenser, provided by the embodiment of the invention, the graphic adjacency list of each open graphic element is generated by acquiring the drawing exchange file and traversing each open graphic element; traversing each open graphic element based on the graphic adjacency list to generate a continuous track of the open graphic element; and generating dispensing G codes corresponding to the drawing exchange file based on the continuous track. The G code of the continuous dispensing track is generated according to the drawing exchange file and the process parameters, so that the continuous dispensing can be controlled without manual teaching or scanning and real object shooting, the continuity of the dispensing process is ensured, and the precision and the efficiency of the dispensing process are improved.
Example two
Fig. 2 is a flowchart of a G code generation method of a dispenser according to a second embodiment of the present invention, and this embodiment is further optimized based on the above embodiments. As shown in fig. 2, the method includes:
s210, obtaining a drawing exchange file.
And S220, respectively determining the distance between each end point in the current open graphic element and each end point of other open graphic elements in the drawing exchange file for any open graphic element.
In the embodiment of the invention, the coordinate information of each endpoint of each open graphic element is acquired. Optionally, the distances between any end point in any open graphic element and each end point of the remaining open graphic elements are compared to determine a minimum distance, so as to further determine the adjacent end point of the current end point and the adjacent graphic element of the open graphic element to which the current end point belongs by the minimum distance.
S230, when the distance between a first end point in the current open graphic element and a second end point in a second open graphic element in the current preset list is smaller than a preset distance, determining that the second open graphic element is an adjacent graphic element of the current open graphic element, and the second end point is an adjacent end point of the first end point.
In the embodiment of the present invention, the position information of each endpoint of each open graphic element in the preset list is obtained, for example, coordinate information. Optionally, any end point of any open graphic element is acquired as a first end point, and the distance between the first end point and each end point in the rest open graphic elements in the preset list is respectively calculated according to the position information. When the distance value between the first end point and any end point is smaller than the preset distance, the current end point is determined to be an adjacent end point of the first end point, the adjacent end point is called as a second end point, and the open graphic element to which the first end point belongs and the open graphic element to which the second end point is located are adjacent graphic elements. Alternatively, when there are a plurality of end points having a distance smaller than the preset distance from the first end point, one end point may be arbitrarily selected as an adjacent end point of the first end point.
And S240, when the distance between the third end point in the current open graphic element and each end point of each open graphic element in the drawing exchange file is greater than the preset distance, determining that the third end point is an open end point.
In the embodiment of the present invention, the distance between the first endpoint and each endpoint in the remaining open graphic elements in the preset list is calculated, and when the distance value between the first endpoint and any endpoint is greater than the preset distance, the current endpoint is determined to be an open endpoint, which is called a third endpoint.
And S250, forming a graphic adjacency list based on adjacent graphic elements of each open graphic element and adjacent end points of the end points in each open graphic element.
In the embodiment of the present invention, as shown in fig. 3, the adjacent relationship of each open graphic element and the adjacent relationship of each endpoint in the graphic adjacency list are respectively obtained, and the adjacent graphic element of each graphic element in the preset list, the adjacent endpoint of the endpoint in each graphic element, and the graphic index and the endpoint index of each graphic element are obtained.
Optionally, the graph adjacency list of each open graphic element is generated by sequentially traversing all open graphic elements and all end points, and the index identifiers corresponding to each open graphic element and the index identifiers corresponding to each end point.
And S260, traversing each open graphic element based on the graphic adjacency list to generate a continuous track of the open graphic element.
And S270, generating a G code corresponding to the drawing exchange file based on the continuous track.
According to the G code generation method of the dispenser, the drawing exchange file is obtained, all the open graphic elements are traversed, adjacent graphic elements, adjacent end points and open end points in all the open graphic elements are determined, and the adjacent graphic elements of all the open graphic elements and the adjacent end points of the end points in all the open graphic elements form a graphic adjacent list. Traversing each open graphic element based on the graphic adjacency list to generate a continuous track of the open graphic element; and generating dispensing G codes corresponding to the drawing exchange file based on the continuous track. The method comprises the steps of generating a G code of a continuous dispensing track according to a drawing exchange file and process parameters, generating a graphic adjacency list by using graphic elements in the drawing exchange file, and generating the G code of the continuous dispensing track according to the process parameters, so that a user does not need to manually teach or scan or shoot a real object, and the characteristics of high speed and high precision are realized.
EXAMPLE III
Fig. 4 is a flowchart of a G code generation method of a dispenser according to a third embodiment of the present invention, and the present embodiment is further optimized based on the above embodiments. As shown in fig. 4, the method includes:
s310, obtaining a drawing exchange file.
S320, traversing each open graphic element to generate a graphic adjacency list of each open graphic element.
S330, determining the track starting point and each open graphic element which is adjacent to the open graphic element in sequence based on each open end point to form the continuous track.
In this embodiment of the present invention, optionally, each open endpoint in the graphical adjacency list is stored in the first preset set, and each open graphical element is stored in the second preset set. When the first preset set is detected to be a non-empty set and the second preset set is detected to be a non-empty set, any end point of any open graphic element in the first preset set is obtained to serve as a track starting point of a continuous track of the open graphic element, the track starting point is used for generating the continuous track of the current open graphic element, and the current end point is deleted from the first preset set so as to prevent repeated dispensing tracks from being generated.
Optionally, acquiring an adjacent open graphic element and a distance value of the other end point of the current open graphic element; when it is detected that the adjacent open graphical element of the other end point of the current open graphical element is not stored in the second preset set, or it is determined that the other end point of the current open graphical element does not have an adjacent open graphical element, optionally, the next adjacent graphical element of the adjacent graphical elements of the current open graphical element in the graphical adjacency list may be iteratively determined until it is determined that there is no adjacent end point and no next adjacent graphical element. And determining the other end point of the current open graphic element as the end point of the continuous track of the current open graphic element, deleting the end point from the first preset set, and deleting the current open graphic element where the end point is located from the second preset set. When detecting that a plurality of adjacent open graphic elements exist at the other end point of the current open graphic element, determining the next adjacent open graphic element according to a preset rule, or when only one adjacent open graphic element exists at the other end point of the current open graphic element, determining the adjacent end point of the adjacent open graphic element as the starting point of the next section of continuous track.
Optionally, a trajectory starting point and a trajectory ending point of a continuous trajectory of each open graphic element in the graphic adjacency list, and adjacent graphic elements of each open graphic element and adjacent end points of each end point in the open graphic elements are determined, each adjacent open graphic element is sequentially drawn, and the continuous trajectory of each open graphic element is generated.
S340, determining whether an open endpoint which is not traversed and/or an open graphic element which is not traversed exist in the graphic adjacency list; if yes, go to step S330, otherwise go to step S350.
In the embodiment of the present invention, when it is detected that the first preset set is an empty set and the second preset set is a non-empty set, it is determined that an unretraversed open endpoint does not exist in the graph adjacency list, but an unretraversed open graph element exists, that is, it is determined that each open graph element is in a closed trajectory; when the first preset set is detected to be an empty set and the second preset set is detected to be an empty set, it is determined that no non-traversed open end points and non-traversed open graphic elements exist in the graphic adjacency list, that is, it is determined that all open graphic elements are traversed.
And S350, generating a new continuous track for a new track starting point based on the non-traversed open end point, or generating a new continuous track for a new track starting point based on any end point of any non-traversed open graphic element when the non-traversed open graphic element has no open end point.
In the embodiment of the invention, when each open graphic element is determined to be in the closed track, the starting point of the closed continuous track is determined according to the preset rule, and the closed continuous track of the current open graphic element is generated; optionally, when it is determined that all the open graphic elements and the open end points have been traversed, based on the track starting point and the track ending point of the continuous track of each open graphic element and the adjacent end points of the adjacent graphic elements of each open graphic element and each end point in the open graphic elements, each adjacent open graphic element is sequentially drawn, and the continuous track of each open graphic element is generated.
And S360, generating a G code corresponding to the drawing exchange file based on the continuous track.
It should be noted that, in some embodiments of the present invention, the corresponding G code may be generated while generating the continuous track of each open graphic element in the drawing exchange file, or may be generated after generating the continuous track of each open graphic element in the drawing exchange file, where the timing for generating the G code is not limited in this embodiment.
According to the G code generation method of the dispenser, provided by the embodiment of the invention, the graphic adjacency list of each open graphic element is generated by acquiring the drawing exchange file and traversing each open graphic element; traversing each open graphic element based on the graphic adjacency list, determining the adjacent relation of each open graphic element and the adjacent relation of each end point of the graphic adjacency list, and determining each open graphic element which is adjacent to the open graphic element to which the track starting point belongs in sequence based on the adjacent relation of each open graphic element and the adjacent relation of each end point to form the continuous track; and generating dispensing G codes corresponding to the drawing exchange file based on the continuous track. According to the open graphic elements, the end points and the corresponding adjacent relations in the drawing exchange file, the continuous track of each open graphic is generated, and the G code of the continuous track is generated, so that the continuity of the dispensing process is ensured on the basis of realizing dispensing control without manual teaching or scanning and shooting of real objects, and the precision and the efficiency of the dispensing process are improved.
Example four
Fig. 5 is a schematic structural diagram of a G code generation apparatus of a dispenser according to a fourth embodiment of the present invention. As shown in fig. 5, the apparatus includes:
a drawing exchange file obtaining module 410, configured to obtain a drawing exchange file.
And a graph adjacency list generating module 420, configured to traverse each open graphic element, and generate a graph adjacency list of each open graphic element.
A continuous track generating module 430, configured to traverse each open graphic element based on the graph adjacency list, and generate a continuous track of the open graphic element.
And a G code generating module 440, configured to generate a G code corresponding to the drawing exchange file based on the continuous track.
Optionally, the graphics adjacency list generating module 420 includes:
the distance determining unit is used for respectively determining the distance between each end point in the current open graphic element and the distance between each end point of other open graphic elements in the drawing exchange file for any open graphic element;
an adjacent graphic element and adjacent end point determining unit, configured to determine that a second open graphic element is an adjacent graphic element of the current open graphic element and a second end point is an adjacent end point of a first end point when a distance between the first end point in the current open graphic element and the second end point in the second open graphic element in the drawing exchange file is smaller than a preset distance;
and the adjacency list generating unit is used for forming a graphic adjacency list based on adjacent graphic elements of each open graphic element and adjacent end points of the end points in each open graphic element.
Optionally, the module 420 for generating a graphic adjacency list further includes:
and the open endpoint determining unit is used for determining that the third endpoint is an open endpoint when the distance between the third endpoint in the current open graphic element and each endpoint of each open graphic element in the drawing exchange file is greater than the preset distance.
Optionally, the open graphical element is configured with a graphical index and an endpoint index.
Optionally, the adjacency list generating unit includes:
and the figure connection list generation subunit is used for forming a figure connection list based on adjacent figure elements of each figure element, adjacent end points of the end points in each figure element, and the figure index and the end point index of each figure element.
Optionally, the continuous track generating module 430 includes:
a track starting point determining unit configured to determine a track starting point based on an open end point in the graphics adjacency list;
and the first continuous track generating unit is used for determining each open graphic element which is sequentially adjacent to the open graphic element to which the track starting point belongs based on the adjacent relation of each open graphic element in the graphic adjacency list and the adjacent relation of each end point to form the continuous track.
Optionally, the first continuous trajectory generating unit specifically includes:
determining an adjacent end point of the other end point of the open graphic element to which the track starting point belongs and an adjacent graphic element to which the adjacent end point belongs based on the adjacent relation of each open graphic element and the adjacent relation of each end point of the graphic adjacent list;
determining a next adjacent graphic element of the adjacent graphic elements determined by iteration until the adjacent graphic elements do not have adjacent end points and the next adjacent graphic element, and taking the open end points of the adjacent graphic elements without the adjacent end points as track end points;
and sequentially drawing each adjacent open graphic element to form the continuous track.
Optionally, after the continuous track generating module 430, the method further includes:
an unretraversed open end point and graph element determining unit, configured to determine whether an unretraversed open end point and/or an unretraversed open graph element exists in the graph adjacency list;
and if so, generating a new continuous track for a new track starting point based on the non-traversed open end point, or, when the non-traversed open graphic element does not have an open end point, generating a new continuous track for a new track starting point based on any end point of any non-traversed open graphic element.
Optionally, the G code generating module 440 includes:
the process parameter acquisition unit is used for acquiring process parameters in the dispensing operation;
and the G code generating unit is used for generating the G codes of the continuous tracks of the open graphic elements according to the process parameters and the continuous tracks of the open graphic elements.
According to the G code generation method of the dispenser, provided by the embodiment of the invention, the graphic adjacency list of each open graphic element is generated by acquiring the drawing exchange file and traversing each open graphic element; traversing each open graphic element based on the graphic adjacency list to generate a continuous track of the open graphic element; and generating dispensing G codes corresponding to the drawing exchange file based on the continuous track. The G code of the continuous dispensing track is generated according to the drawing exchange file and the process parameters, so that the continuous dispensing can be controlled without manual teaching or scanning and real object shooting, the continuity of the dispensing process is ensured, and the precision and the efficiency of the dispensing process are improved.
EXAMPLE five
Fig. 6 is a schematic structural diagram of a control device in the fifth embodiment of the present invention. FIG. 6 illustrates a block diagram of an exemplary control device 512 suitable for use in implementing embodiments of the present invention. The control device 512 shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiment of the present invention.
As shown in fig. 6, the control device 512 is in the form of a general purpose computing device. The components of the control device 512 may include, but are not limited to: one or more processors or processing units 516, a system memory 528, and a bus 518 that couples the various system components including the system memory 528 and the processing unit 516.
Bus 518 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, micro-channel architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Control device 512 typically includes a variety of computer system readable media. Such media can be any available media that is accessible by control device 512 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 528 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)530 and/or cache memory 532. The control device 512 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 534 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 6, and commonly referred to as a "hard drive"). Although not shown in FIG. 6, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 518 through one or more data media interfaces. Memory 528 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 540 having a set (at least one) of program modules 542, including but not limited to an operating system, one or more application programs, other program modules, and program data, may be stored in, for example, the memory 528, each of which examples or some combination may include an implementation of a network environment. The program modules 542 generally perform the functions and/or methods of the described embodiments of the invention.
The control device 512 may also communicate with one or more external devices 514 (e.g., keyboard, pointing device, display 524, etc.), with one or more devices that enable a user to interact with the control device 512, and/or with any devices (e.g., network card, modem, etc.) that enable the control device 512 to communicate with one or more other computing devices. Such communication may occur via input/output (I/O) interfaces 522. Also, the control device 512 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the Internet) via the network adapter 520. As shown, the network adapter 520 communicates with the other modules of the control device 512 via the bus 518. It should be appreciated that although not shown in FIG. 6, other hardware and/or software modules may be used in conjunction with the control device 512, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The processing unit 516 executes various functional applications and data processing by running programs stored in the system memory 528, for example, implementing a G code generation method of a dispenser provided by an embodiment of the present invention, the method includes:
acquiring a drawing exchange file, wherein the drawing exchange file comprises a plurality of open graphic elements to be drawn;
traversing each open graphic element to generate a graphic adjacency list of each open graphic element;
traversing each open graphic element based on the graphic adjacency list to generate a continuous track of the open graphic element;
and generating dispensing G codes corresponding to the drawing exchange file based on the continuous track.
EXAMPLE six
An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements a G code generation method for a dispenser, where the method includes:
acquiring a drawing exchange file, wherein the drawing exchange file comprises a plurality of open graphic elements to be drawn;
traversing each open graphic element to generate a graphic adjacency list of each open graphic element;
traversing each open graphic element based on the graphic adjacency list to generate a continuous track of the open graphic element;
and generating dispensing G codes corresponding to the drawing exchange file based on the continuous track.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or control device. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (11)

1. A G code generation method of a dispenser is characterized by comprising the following steps:
acquiring a drawing exchange file, wherein the drawing exchange file comprises a plurality of open graphic elements to be drawn;
traversing each open graphic element to generate a graphic adjacency list of each open graphic element;
traversing each open graphic element based on the graphic adjacency list to generate a continuous track of the open graphic element;
and generating a G code corresponding to the drawing exchange file based on the continuous track.
2. The method of claim 1, wherein traversing the respective open graphical element to generate a graphical adjacency list for the respective open graphical element comprises:
for any open graphic element, respectively determining the distance between each endpoint in the current open graphic element and each endpoint of other open graphic elements in the drawing exchange file;
when the distance between a first end point in the current open graphic element and a second end point in a second open graphic element in the drawing exchange file is smaller than a preset distance, determining that the second open graphic element is an adjacent graphic element of the current open graphic element, and the second end point is an adjacent end point of the first end point;
a graphical adjacency list is formed based on neighboring graphical elements of each open graphical element and the adjoining endpoints of the endpoints in each open graphical element.
3. The method of claim 2, further comprising:
and when the distance between the third end point in the current open graphic element and each end point of each open graphic element in the drawing exchange file is greater than the preset distance, determining that the third end point is an open end point.
4. The method of claim 2, wherein the open graphical element is configured with a graphical index and an endpoint index;
wherein the forming a graphical adjacency list based on adjacent graphic elements of each graphic element and the adjacent endpoints of the endpoints in each graphic element comprises:
and forming a graphic adjacency list based on adjacent graphic elements of the graphic elements, adjacent end points of the end points in the graphic elements, and the graphic indexes and the end point indexes of the graphic elements.
5. The method of claim 1, wherein traversing the respective open graphical elements based on the graphical adjacency list to generate a continuous trajectory of the open graphical elements comprises:
determining a trajectory starting point based on an open endpoint in the graphical adjacency list;
and determining each open graphic element which is adjacent to the open graphic element to which the track starting point belongs in sequence based on the adjacent relation of each open graphic element in the graphic adjacency list and the adjacent relation of each end point to form the continuous track.
6. The method according to claim 5, wherein the determining, based on the adjacent relationship of each open graphic element and the adjacent relationship of each end point of the graphic adjacency list, each open graphic element to which the track start point belongs is sequentially adjacent to form the continuous track comprises:
determining an adjacent end point of the other end point of the open graphic element to which the track starting point belongs and an adjacent graphic element to which the adjacent end point belongs based on the adjacent relation of each open graphic element and the adjacent relation of each end point of the graphic adjacent list;
iteratively determining a next adjacent graphic element of the adjacent graphic elements until the adjacent graphic elements do not have an adjacent end point and the next adjacent graphic element, and taking an open end point of the adjacent graphic element without the adjacent end point as a track end point;
and sequentially drawing each adjacent open graphic element to form the continuous track.
7. The method of claim 5, further comprising, after forming the continuous track:
determining whether there are open endpoints and/or open graphical elements in the graphical adjacency list that are not traversed;
if so, generating a new continuous track for a new track starting point based on the non-traversed open end point, or, when the non-traversed open graphic element has no open end point, generating a new continuous track for a new track starting point based on any end point of any non-traversed open graphic element.
8. The method of claim 1, wherein generating the G-code corresponding to the drawing exchange file based on the continuous track comprises:
acquiring process parameters in the dispensing operation;
and generating a G code of the continuous track of the open graphic element according to the process parameter and the continuous track of the open graphic element.
9. A G code generation device of a dispenser, comprising:
the drawing exchange file acquisition module is used for acquiring a drawing exchange file, wherein the drawing exchange file comprises a plurality of open graphic elements to be drawn;
the graph adjacency list generating module is used for traversing each open graphic element and generating a graph adjacency list of each open graphic element;
a continuous track generation module, configured to traverse each open graphic element based on the graphic adjacency list, and generate a continuous track of the open graphic element;
and the G code generating module is used for generating the G code corresponding to the drawing exchange file based on the continuous track.
10. A control apparatus, characterized in that the control apparatus comprises:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the G-code generation method of the dispenser according to any one of claims 1 to 8.
11. A computer-readable storage medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the G-code generation method of a dispenser according to any one of claims 1 to 8.
CN202010942424.5A 2020-09-09 2020-09-09 G code generation method and device of dispenser, terminal equipment and storage medium Active CN112068836B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010942424.5A CN112068836B (en) 2020-09-09 2020-09-09 G code generation method and device of dispenser, terminal equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010942424.5A CN112068836B (en) 2020-09-09 2020-09-09 G code generation method and device of dispenser, terminal equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112068836A true CN112068836A (en) 2020-12-11
CN112068836B CN112068836B (en) 2021-08-24

Family

ID=73664643

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010942424.5A Active CN112068836B (en) 2020-09-09 2020-09-09 G code generation method and device of dispenser, terminal equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112068836B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115999864A (en) * 2022-12-09 2023-04-25 上海新时达机器人有限公司 Automatic dispensing method and device, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070191982A1 (en) * 2006-02-13 2007-08-16 Sullivan Douglas G Manual CNC programming system and technique to use computer aided design systems to determine cutter location information
CN101396689A (en) * 2007-09-29 2009-04-01 比亚迪股份有限公司 Three-dimensional glue spreading system and method
CN101414168A (en) * 2008-11-25 2009-04-22 上海柏楚电子科技有限公司 Automatic drip model method of microcomputer combining with digital control drip model machine
CN103455311A (en) * 2012-05-29 2013-12-18 鸿富锦精密工业(深圳)有限公司 Drawing code generation system and method
CN104616326A (en) * 2015-02-02 2015-05-13 西北工业大学 Composite material laying unit expanded outline correction method in numerical control blanking procedure

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070191982A1 (en) * 2006-02-13 2007-08-16 Sullivan Douglas G Manual CNC programming system and technique to use computer aided design systems to determine cutter location information
CN101396689A (en) * 2007-09-29 2009-04-01 比亚迪股份有限公司 Three-dimensional glue spreading system and method
CN101414168A (en) * 2008-11-25 2009-04-22 上海柏楚电子科技有限公司 Automatic drip model method of microcomputer combining with digital control drip model machine
CN103455311A (en) * 2012-05-29 2013-12-18 鸿富锦精密工业(深圳)有限公司 Drawing code generation system and method
CN104616326A (en) * 2015-02-02 2015-05-13 西北工业大学 Composite material laying unit expanded outline correction method in numerical control blanking procedure

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115999864A (en) * 2022-12-09 2023-04-25 上海新时达机器人有限公司 Automatic dispensing method and device, electronic equipment and storage medium
CN115999864B (en) * 2022-12-09 2024-03-15 上海新时达机器人有限公司 Automatic dispensing method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN112068836B (en) 2021-08-24

Similar Documents

Publication Publication Date Title
JPH10105361A (en) Method and system for specifying object
CN100514302C (en) Multi-source, multi-destination data transfer
CN111626238A (en) Text recognition method, electronic device and storage medium
CN111597628B (en) Model marking method and device, storage medium and electronic equipment
CN112068836B (en) G code generation method and device of dispenser, terminal equipment and storage medium
CN116245052A (en) Drawing migration method, device, equipment and storage medium
CN103559512A (en) Method and system for recognizing and outputting characters
CN113538623B (en) Method, device, electronic equipment and storage medium for determining target image
JP2017091328A (en) Information processing apparatus and information processing program
CN111292341B (en) Image annotation method, image annotation device and computer storage medium
JP4378519B2 (en) Information display device
JP2686758B2 (en) Graphic editing device
WO2023016493A1 (en) Handwriting erasing method and apparatus, storage medium, and electronic device
JPH0812668B2 (en) Handwriting proofreading method
CN111723799A (en) Coordinate positioning method, device, equipment and storage medium
CN113009908A (en) Motion control method, device, equipment and storage medium for unmanned equipment
CN103546707B (en) Projection arrangement, optical projection system and projecting method
US20200125689A1 (en) Automated generation of electronics schematics with single wire tracing
CN113516736B (en) Method and device for establishing and processing dicode file mark and electronic equipment
CN114937279A (en) BOM recognition method and device for realizing IA based on RPA and AI
CN114724170A (en) BOM generation method and device, electronic equipment and storage medium
CN113093715B (en) Motion control method, device and equipment of unmanned equipment and storage medium
CN111696154A (en) Coordinate positioning method, device, equipment and storage medium
CN114419199B (en) Picture marking method and device, electronic equipment and storage medium
CN116580286B (en) Image labeling method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant