Graphical automatic programming of CNC wire cutting 3B machining instructions

Abstract This paper presents a graphical automatic programming system for CNC wire cutting 3B code processing, developed using AutoCAD as the platform. The system leverages AutoLisp language to read and process group codes from graphic entities, converting them into 3B format instructions. The method is intuitive, accurate, and efficient, with a simple user interface that makes it accessible even for beginners. Keywords: Graphic, Solid, Line Cutting, Entity Code

CNC wire-cutting machines are used to cut metal materials by moving a molybdenum wire vertically. Over the years, numerous wire-cutting machine tools have been developed globally, with corresponding processing instructions adhering to international standards such as ISO and EIA. In China, these machines are widely adopted due to their affordability, ease of maintenance, reliability, and the large number of skilled operators available. However, most domestic systems still use the 3B code format, which is not supported by general CAD/CAM software like UGII or MasterCAM. With the growing adoption of AutoCAD in the Chinese manufacturing industry, this paper introduces a 3B code generation system based on AutoCAD. By utilizing AutoLisp, the system reads entity group codes and converts them into 3B processing instructions, proving to be accurate, practical, and efficient through real-world application.

1 Principle

1.1 3B Instruction Code Format: B XY B YY B J G Z
In this format, "B" serves as a delimiter. XY and YY represent the endpoint coordinates for straight lines (with the origin at the start point), or the starting point coordinates for arcs (with the origin at the center). J refers to the total projected length of the path in the counting direction, while G defines the direction of counting—either X or Y. Z indicates the machining instruction, with 12 different types available. For example, when machining a straight line, if the line lies within the shaded area, G takes the value Gy; otherwise, it is Gx. Similarly, for an arc, G depends on the position of the endpoint relative to the shaded region.

1.2 AutoCAD Entity Selection Sets and Group Codes
In AutoCAD, each graphic element is treated as a separate entity. The ssget() function can be used to create selection sets based on user input. Each entity has a unique group code that provides access to its properties. For instance, group code -1 represents the entity name, group code 0 represents the entity type (e.g., LINE, ARC, PLINE), and other group codes provide details such as layer names, coordinates, radius, angles, etc.

1

Figure 1: Counting Direction Selection (Left: Straight Line, Right: Arc)

1

Figure 2: Machining Instruction Schematic (Left: Straight, Right: Arc)

Here is a sample of entity group code:

(-1.<Entity name: 60000014>)
(0."LINE")
(8."0")
(10 1.0 2.0 0.0)
(11 6.0 6.0 0.0)

Table: Part Code

Group Code | Description

Straight / Arc | Layer Name

8 | 10 | Starting Point Coordinate | Center Coordinate

11 | End Point Coordinate | ...

40 | Radius

50 | Starting Angle

51 | Ending Angle

210 | Extension Direction

2 Programming Method

The program begins by calling the getfiled() function to create an NC file with a .3B extension. It then uses the ssget() function to allow users to select entities according to the desired processing order. These entities are categorized into two types: Line and Arc. Based on research, it was found that in AutoCAD v12.0, complex entities like polylines or splines are broken down into basic Line and Arc entities. The core of the program involves handling these two types of geometry.

Once the entity is identified as a Line or Arc, the program extracts relevant geometric data from the group codes. A string in the format "B XX B YY BJGZ" is generated and written to the NC file. The process continues until all entities are processed.

For straight lines, the start and end points are extracted using group codes 10 and 11. The origin is shifted to the start point, and the values of XX and YY correspond to the end point coordinates. The program then determines whether to use Gx or Gy based on the larger of the absolute values of XX and YY. For arcs, the center, radius, start angle, and end angle are obtained using group codes 10, 40, 50, and 51, respectively.

One challenge in arc processing is calculating the projection length J. The calculation varies depending on the arc's position and orientation, as shown in Figure 3. Three main cases are considered, each involving different coordinate transformations and distance calculations.

Figure 3: Calculation of Arc Projection Length J (Left: G=Gx, Right: G=Gy)

Regarding the machining direction of arcs, since AutoCAD defines all arcs counterclockwise, the program keeps track of the last entity’s coordinates. When the next entity is an arc, it compares the current coordinates with the arc’s starting point. If they match, the arc is assumed to be counterclockwise; otherwise, it is clockwise, and the start and end points are swapped accordingly. A block diagram illustrating this logic is shown in Figure 4.

1

3 Conclusion

Practical implementation has demonstrated that the method described in this paper for generating 3B code is both efficient and user-friendly. It simplifies the programming process, reduces errors, and improves overall accuracy. The system allows for the automatic generation of 3B code through a graphical interface, significantly lowering the requirements for numerical control programmers and reducing the workload. Overall, this approach proves to be reliable, intuitive, and effective in achieving automated programming for 3B processing.

Dispersing Machine

Dispersing Machine,Dispersion Kneader,Dispersion Kneader Machine,High Speed Dispersion Machine

wuxi top mixer equipment co.,ltd , https://www.wxtpmixer.com