Development and Research of CAD Software for Main Drive System of Machine Tool

1 Introduction

Computer-aided design, abbreviated CAD, is the abbreviation of Computer Aided Design in English. It refers to the whole process of engineering and technical personnel designing a computer as a tool: it includes data retrieval, scheme design, calculation and analysis, engineering drawing, and preparation of technical documents. It is formed with the development of computers, peripheral equipment and software. A comprehensive high-tech. Modern cutting machining is developing in the direction of high speed, high efficiency, and high precision. This places higher and higher requirements on the structure and performance of machine tools, such as high speed, high power, wide speed range, low noise, good dynamic performance, and reliability. higher. The main drive system of the machine tool is the key in the design of the machine tool. Therefore, how to adapt to the market demand, in the complex and ever-changing market economy, the rapid and high-quality design and manufacture of cutting processing equipment required by the market is a manifestation of the manufacturing industry's strength and technological level. Therefore, the application of computer-aided design (CAD) technology to machine tool design has always been the goal pursued by many manufacturers. In China's previous machine tool designs, drawing boards were mostly used for drawing by hand, so the workload was often very large, resulting in a long development cycle and making the design process error-prone. Therefore, how to apply the computer to the design of a machine tool and how to develop a common and effective machine main drive system design software is the motivation for writing this paper.

2. Object-Oriented Programming Method

Object-oriented, as a concept, was a new method of designing and implementing a software system at first. Because of the great advantages of this method of thinking, it has made it more and more extensive in other fields.
The object-oriented approach is a brand-new representation of real-world objects built around the concept of the real world and a solution to the problem. Its extensibility and reusability greatly improve the development speed of the system. It controls the complexity and maintainability of the software by encapsulating and hiding design parameters and separating design and implementation.
The focus of object-oriented methodology is centered on the concepts, mechanisms, and principles of objects, classes, messages, inheritance, polymorphism, and dynamic linking. Among them, the object, class is the core of this method, the message is the link to connect them, inheritance is a unique contribution of this method, and polymorphism and dynamic programming make this method more perfect.
The object-oriented methodology holds that the objective world is composed of various "objects". Anything is an object. Each object has its own operating law and internal state. By analogy, objects with the same features and functions form a class (induction), and each object belongs to an "object class" that is an instance of that object class. The combination and interaction of different objects constitute the objective system that we want to study, analyze and construct. Object classes can constitute a hierarchy of classes through inheritance relationships. "Subclasses" can directly inherit the properties and functions of "parent classes". The interaction between objects through the message, the message is the notification object to complete an operation allowed to act on the object, the details of how the object will complete the operation is encapsulated in the definition of the class, is hidden from the outside world.
Object-oriented analysis is to use object-oriented thinking to study problems and construct a model reflecting the nature of problems according to the real world. This model illustrates what the system must do, not how to do it, that is, the details of the work. Object-oriented design is to construct a problem solving model. Since the analysis model is built using an object-oriented approach, it is similar to the structure of the software solution. Therefore, the object-oriented design is a refinement of the analysis model (describes what the object and its relationships are) and what the construction implementation involves. The process of the object.
Object-oriented methods provide more natural and more reasonable concepts and techniques than structured methods. Moreover, their abstraction, encapsulation, inheritance, and polymorphism are all superior to structured methods, making them become A more powerful tool and method.

3. Program design for CNC machine tool main drive system

According to the basic principle of the object-oriented method, the conceptual model of the main drive system of the CNC lathe was established and VC was used as the development tool for program design. Because the design part of the main drive system of CNC lathe is mainly a parametric design process, the program mainly completes this work in the form of human-machine interaction. For this feature, I divided the entire system into a number of interfaces, and abstracted these interfaces as entity objects into certain object classes.
The overall system object class is roughly as follows:
Object Class 1: Motor Model Dialog Box
Object Class 2: Transmission Gearbox Dialog Box
Object Class 3: Gear Ratio dialog
Object Class 4: Gear Pairs Dialog Box
Object Class 5: Gear Material Dialog
Object Class 6: Gear Modular (by Touch) Dialog Box
Object Class 7: Gear Modulus (By Bending) Dialog Box
Object Class 8: Gear Modulus (Standard) Dialog Box
Object Class 9: Synchronous Toothed Belt Calculate Power Properties Page
Object Class 10: Synchronization Tooth Band Modulus Property Page
Object Class 11: Size Pulley Diameter Property Page
Object Class 12: Synchronous Toothed Belt Properties Page

1

Object Class 13: Shaft Size Estimation Dialog Box
According to the above basic object class, the design part of the main drive system of the CNC machine tool is further divided into four subsystems:


Based on the above system model and structure based on object-oriented analysis, the module decomposition of the program can be directly obtained. With the above four subsystems, it is easy to design the overall modular structure of the programming part of the system.
(1) Motion Design Module
In this module, the work of determining the motor model of the machine tool, the limit rotation speed of the machine tool, the number of shift stages, the transmission gear ratio, and the number of gear teeth is mainly completed.
(2) Gear Design Module
In this module, the selection of transmission gear materials and heat treatment methods, the calculation of the transmission gear module according to the contact fatigue strength, the calculation of the transmission gear module and the rounding of the modulus based on the bending fatigue strength are mainly completed.
(3) Synchronous toothed belt module
In this module, the work of determining the calculated power, the toothed belt modulus, the toothed belt speed ratio, the number and size of the large and small belt teeth, the width of the toothed belt, the center distance of the belt pulley and the number of teeth of the toothed belt are mainly completed.
(4) Shaft diameter estimation module
In this module, the work of determining the maximum machining diameter of the lathe, the diameter of the general transmission shaft, the estimation of the diameter of the shaft before the shaft, the estimation of the diameter of the shaft journal, and the estimation of the average internal diameter of the shaft are mainly completed.
According to the relationship between the above-mentioned object classes and the modular division of the system, at the same time in order to ensure the validity of the data transfer of each object class in the design process. In object class design, each object class is first encapsulated as part of the data member (attribute) associated with that object class. Then declare in the program the structure corresponding to each object class (Struct), the structure contains a variable corresponding to the data member packaged in the object class. The variables in these structures play an important role in the initialization of object classes, data transfer between object classes, and preservation of important design parameters. Finally, as long as an object is defined for each structure in the "Document" class, some important methods of "document" and "visual" classes in Visual C++ are used to accomplish these tasks. The figure below shows the organizational relationship between data. This work can also be done directly through the objects of the class rather than the objects of the structure. However, for the sake of organizational coordination and ease of management, the idea of ​​middle bridges is used to organize data and transfer data.

1

Here is a specific example to illustrate this working principle:
1. Data package
l Object Class 1: Motor Model Dialog Box Class Name: ACMotorSelectDlg
Class ACMotorSelectDlg : public CDialog
{
// Construction
Public:
CNCLatheDesignView* pView; // View object (pointer)
CNCLatheDesignDoc* pDoc; // Document Class Object (Pointer)
Int index; // AC motor power list box selection index
Float power[7]; // AC motor rated power array
Long basespeed[7]; // AC motor rated speed array
Long maxspeed[7]; // AC motor maximum speed array
ACMotorSelectDlg(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(ACMotorSelectDlg)
Enum { IDD = IDD_ACMOTOR_SELECT };
CListBox m_powerlist;
CString m_information;
Long m_ebspeed;
Long m_emaxspeed;
Float m_epower;
//}}AFX_DATA
};
l Object Class 2: Variable Speed ​​Series Dialog Class Name: GearShiftSelectDlg
Class GearShiftSelectDlg : public CDialog
{
// Construction
Public:
CNCLatheDesignView* pView; // As a pointer object
CNCLatheDesignDoc* pDoc; // Document pointer object
Double nj; // spindle calculation speed
Double Rn; // spindle speed range
Double Rnp; // spindle constant power speed range
Double Rp; // Motor constant power speed range
GearShiftSelectDlg(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(GearShiftSelectDlg)
Enum { IDD = IDD_GEARSHIFT_SELECT };
CButton m_calculate;
Float m_inputmaxspeed;
Float m_inputminspeed;
Int m_twoshift;
CString m_spispeedrange;
CString m_motspeedrange;
//}}AFX_DATA
};
These two pieces of program code both encapsulate the member variables needed by object class 1 and object class 2, and there are two member variables CNCLatheDesignView* pView and CNCLatheDesignDoc* pDoc in these member variables, which are a medium. By associating the media with the structure objects defined in the "Document" class CNCLatheDesignDoc (derived from the CDocument class), you can make the object class refer to its own structure or a structure associated with other object classes. variable. In these two pieces of program code, the member variables defined between // Dialog Data and // AFX_DATA are associated with the controls in the dialog box, used to describe the status and values ​​of each control, and also rely on these Member variables communicate data through media and structure variables.

4. The application of database technology in the design of the main drive system of machine tools

The traditional machine tool main drive system design needs to find a large amount of data, which will lead to a large amount of design work, how to organize the basic data needed in the design, and build a compact, efficient database to shorten the search time and improve Efficiency is an important part of our software design and development process.
VC includes two independent database access systems: ODBC (Open Database Connectivity) and DAO (Data Access Objects). The ODBC standard is used in this program. ODBC is a standard based on SQL (Structured Query Language). Using this language, you can implement database operations.
In this program, the CDatabase class and CRecordset class in VC are used to achieve specific operations. Before actually accessing the database, we must first establish a database that can be used. Combining the requirements of this design, a specific database is created using SQL (Structured Query Language) software. Two data tables are included in the database: one is a data table for storing various common gear ratios, and the other is a data table. Zhang is a data sheet for storing gear materials and heat treatment hair styles.
After the database is established, use the data source manager (in the Windows Control Panel) to make the connection between the application and the data source, specify the database to access the database as ODBC, and select the data table to be accessed so that the application can access the database. Data resources.
After these tasks are completed, you can add the appropriate code to the application to perform database operations. In the program, it first derives its subclasses from the CRecordset class. One is the Summation class and the other is the Material class. These two subclasses respectively access the two data tables in the database. Then apply the subclass's Open() function, MoveFirst() function, MoveNext() function, etc., and use SQL SELECT statements to implement specific functions.
Part of the program code is as follows:
1. Retrieve the same number of teeth and statements of different transmission ratios at each level of the transmission in the transmission group
summation.m_strFilter="(gear ratio="+string1+" or gear ratio="+string2+" or gear ratio="+string3+" or gear ratio="+string4") and number of teeth and in (select teeth and "+" from Appropriate number of teeth for various common gear ratios Gear ratio = "+string1+" and Number of teeth and "+" in (Selection of teeth and from the applicable number of teeth for various common gear ratios Gear ratio="+string2+" and Number of teeth and "+" In (select number of teeth and from the applicable number of teeth for various common gear ratios gear ratio="+string3+" and number of teeth and "+" in (selected number of teeth and from the applicable number of teeth for various common gear ratios gear ratio="+string4+" ))))";
2. Open the database, query and retrieve statement set conditions related to the data and close the database statement
If (summation.IsOpen())
{
summation.Close();
}
summation.Open();
If (summation.IsBOF())
{
Return false ;
}
summation.MoveFirst();
M_summation1=0;
CComboBox* pcombobox=(CComboBox*) GetDlgItem(IDC_SUMMATION1);
While( !summation.IsEOF())
{
If (summation.m_column1==m_trasmitone )
{
string1.Format("%d",summation.m_column2);
Pcombobox->InsertString(-1,string1);
}
summation.MoveNext();
}
summation.Close();

5. Conclusion

This article applies object-oriented thinking to the main drive system of CNC machine tools, discusses CAD technology in machine tool design, and introduces database technology into the design of machine tools, which greatly simplifies the workload of designers. Practice has proved that the CAD software has Certain feasibility and versatility.