2 software structure design
In order to meet the requirements of scalability, portability, scalability and interoperability, the software adopts the idea of ​​modular design and develops on the Windows2000 operating system by using Visual C++ 6.0 development tools. The software is divided into two parts, the human-machine interface interaction part and the system control part.
1) Man-machine interface The human-machine interface module mainly completes the status display of the entire CNC system and the input of demand parameters. In addition, it should make the interface friendly and easy to use. This program is designed with the help of the powerful functions of the CWnd class and CButton button class in the MFC library. The member functions of these two classes and the subclasses derived from the class construct a friendly and convenient interface. The interface includes the display of important parameters during the machining process, the display of the main function buttons and the machining graphics. The parameters display the coordinates of each axis, the working stroke, the bottom dead center, the tool code, the diameter, the offset and the number of holes processed, the record of the tool magazine, etc.; the function button has start, return to the origin, return to the parking space, import Documents, tool parameters, tool management, machining parameters, etc., among which the tool parameters, tool management and machining parameter buttons can also open other interfaces to complete the system function; the graphic display is located in the middle part of the interface to display the graphics of the processed PCB holes, the processing It can also dynamically display the machining to a hole.
2) Processing file The processing file function module decodes the processing file (Excellon format file common to the PCB industry) that is input from the external input, and converts the information of the processing file into the data format required by the control system. The specific implementation method of the software is to interpret each line of the file, and put each tool node data to be processed into a WORK_NODE structure according to the interpreted information, and the RECORD_NODE structure corresponding to the hole processing data under the tool is placed in the WORK_NODE. In the body, finally, each tool node is stored in the processing list gWorkList of the type WORK_NODE. The data structures of WORK_NODE and RECORD_NODE are as follows:
Typedef struct _WORK_NODE
{
Int Type; //tool ​​type,
Int ToolNo; //Tool number T0,T1...
Double Diameter; //mm diameter
Double VelocityForZUp; //speed up
Double VelocityForZDown; //Drilling speed mm/min
Double Offset; //Drill down allowable offset mm
Int Rev; // spindle speed rpm/minute
Int MaxLife, HitCount; //Lifetime
Int ToolCurNo; //The magazine number of the current tool
CRecordList *pList; //hole coordinate list
}WORK_NODE,*PWORK_NODE;
Typedef struct _RECORD_NODE
{
Double x; //x coordinates
Double y; //y coordinate
}RECORD_NODE, *PRECORD_NODE;
3) Machining parameter management This function completes the management of various parameters in the machine control process, including the machine's axis parameters, system parameters, machining parameters, tool parameters, machine tool coordinate parameters. In order to facilitate management and use, the global parameter storage is defined in the above parameter program, and the operation of these variables can be used to read and modify each parameter. Each parameter variable is of a custom structure type. The axis parameter type includes the enable, maximum speed, maximum acceleration, pulse equivalent, zero return speed, zero return direction, backlash, etc. of each axis; Parameters include interpolation accuracy, in-position detection period, tool magazine coordinate position, depth detection depth, depth detection speed; machining parameters including feed rate, lifting speed, working stroke, spindle speed, tool change mode, allowable range of broken drill detection; The parameters include the type, diameter, life, and service life of the tool. The machine coordinate parameters include the absolute and relative coordinate parameters of the machine. All of these parameters, except for the absolute and relative coordinate parameters, need to be input by the user before processing, and the data is moved according to the settings during the machining. The following is an example of the data structure of the axis parameters:
Typedef struct _AXIS_PARAM_SET
{
Int Installed; //Whether the axis is installed: TRUE - install
Int Enable; //Is the axis valid?
Int HomeDir; // Machine zero return direction: 1 - forward, -1 - reverse, 0 - invalid
Double Interval; //backlash
&nb, sp;&n, bsp; double MaxSpeed; //maximum speed (mm/min) (A)
Double AccelSpeed; //Maximum acceleration (mm/min<2)3600000
Double PulseFactor; //pulse equivalent (mm)
Long PulseUp; //Electronic gear numerator
Long PulseDown; // electronic gear denominator
Long PulseDir; / ​​/ feedback direction
Int SRatio; //S type acceleration curve coefficient
Double HomeSpeed; //zero speed
Double HomeCheckDis; // zero return detection length
Double HomeOffsetDis; //moving distance after zero return
Double DepthCheckDis; //Drop distance of depth detection
}AXIS_PARAM_SET, *PAXIS_PARAM_SET;
Previous page | 1 | 2 | 3 | Next page |
Marble Acp,Aluminum Composite Panel,Sandwich Panel,Curtain Wall
Fireproof ACP,High Gloss ACP Co., Lt d. , http://www.nbcompositepanel.com