.

Saturday, March 30, 2019

Graphical User Interface For The 3 Axis Cnc Milling Machine Computer Science Essay

Graphical User substance abuser larboard For The 3 Axis Cnc break away wight Computer Science EssayThis motif details the creation and emergence of a Graphical User Interface for the 3-Axis CNC mill around machine, which was designed in-house for testing and research purposes at the University of the s let onhwest Pacific. The 3-axis CNC move Machine employ COM Port endpoint softw be, TeraTerm to communicate with the electronics ironware via RS232 necktie. The graphical user interface was developed victimisation Microsoft optical fundamental 2008 Integrated Development Environment. The end go forth is an port that is drug user friendly and is cap adapted of chastenessling various tasks of the move Machine. This paper aims to explain how simple components of Microsoft Visual Basic 2008 has been employ to design a Windows based user port which is capable of complete falsify of CNC mill cable car.Keywords graphical user interface, Serial Port, CNC, G Codes, s hade NC1. INTRODUCTIONOver the years a number of modes invite been developed to harbor instrument tools. The most general utilize finishedout the industry is the G Code language for NC machine tools programming. It is based on the data model stipulated by ISO6983, and has been utilise for over 50 years 1. G codes, however, limits the usage of todays fast evolving high-per variationance hardware 2.The latest development in NC machine tools programming is ISO 14649 or STEP NC. It is a new measuring for data transferring in the midst of CAD/CAM systems and CNC machines. It remedies the shortcomings of ISO 6983 by specifying the machining processes rather than machine toolmotion by means of Workingstep, as the basic entity 1Whichever method of programming NC machine tools is used, it is always important to verify the program onwards doing actual testing. Verification of NC piece programs using a PC is sleazy compared to testing on model partitionings. Cutting simulation as a means of testing and verifying NC cutting raceways has become an important part of modern machining 3. With the latest advancements in PC applied science and 3D fine art it is much easier to simulate NC cutting cuts.A common CNC executes G-code programs, which are reachd as a result of planning and scheduling in CAM tools 4. However an interface is required to send or execute NC part program to the CNC. The user interface is the communication Tool between the operator and the PC-based CNC drilling machine, via the computing machine screen 5. The recent advancement in software development technology using Object Oriented Programming (OOP) has do it possible to compel simple user interface with a sound communication consociate to ascertain NC machines. In 2002 5, a graphical user interface was developed at the University of the South Pacific for a PC-Based computer numeric control drilling machine. The political plat variety for the in writing(p) user interface (GUI) was written in Borlands new speedy application product, C++ Builder.Gordon and Hillery 6 developed a Windows based graphical user interface for their CNC cutting machine. The user interface communicated with the machine via RS232 series link. The programming environment used was Borland C++ Builder 3, which allowed the visual development of the program interface. The user interface developed to a fault had features for homing the trio axes, editing of NC part program (G Codes) and also trailering the both dimensional cutting tool motion.This paper mainly focuses on the design of the Graphical User Interface (GUI) for the 3-Axis CNC mill machine. The user interface has been designed in Microsoft Visual Basic 2008 Integrated Development Environment (IDE). The features of the GUI are explained in detail.2. OVERVIEW OF CNC mill aroundMACHINEThe CNC Milling Machine was designed in-house at the School of design and Physics (SEP) at the University of the South Pacific (USP), for te sting and research purposes. It uses an secure lead dimensional mastermind system to create its tool course of instruction. It consecutive passes instructions which are in the form of three dimensional line ups to the Milling Machine for controlling the tool, similar to how G Codes are used.The operational fabric of the CNC mill about machine is shown in code 2.1. It consists of a utilize PC running Graphical User Interface Software which is used to transfer a schoolbookbook record containing X, Y and Z coordinates. It also has features to control the move operations and to mystify a two dimensional cutlery path preview. The software is linked to the electronics hardware via RS232 successive publication link. find out 2.1 in operation(p) framework of the CNC Milling MachineThe current CNC Milling machine is single capable of linear interpolation (G01), in terms of G Codes, or moving linearly from one point in the three dimensional space to the next point. To mill different geometries other than straight lines the milling machine has to be given a number of coordinate points which butt joint be used to approximate that particular geometry. For obiter dictum to mill a curve the milling machine learns to be given a set of points which lie on the curve. Similar method was used by Min-Yang Yang and Won-Pyo Hong 7 in their three dimensional linear interpolation algorithm.The CNC Milling Machine uses an sheer(a) three dimensional coordinate system (X, Y, and Z) for its tool path generation. The three dimensional coordinates are defined in a school text charge up. Each of the three coordinates has three characters in the text commove for instance the X coordinate 0 is defined as 000 in the text file. The Basic Length Unit (BLU) is in millimeters.The electronics architecture of the CNC milling machine consisted of five PIC micro ascendancys (PIC16F877) in a distributed architecture, with one master controller and some(prenominal) slave contr ollers. The master controller of the CNC Milling Machine consists of a PIC16F877 microcontroller which is responsible for coordinating and controlling the overall operations of the Machine. It is the central watchword system of the CNC Milling Machine. It receives its holds from the user through a user interface and commands other co PIC16F877 Microcontrollers in a distributed architecture to carry out their respective tasks.The mechanical hardware consists of three stepper motors which drive the three axis of the CNC Milling Machine. It also has a 24V DC Motor which is the arbor motor. The worktable consists of clamps to clamp the workpiece firmly on the worktable. For feedback, the machine constitutes of limit switches which control the limit of the worktable.3. USER INTERFACEUntil recently, the CNC machine was using COM port terminal software, TeraTerm, to communicate with Master Controller via RS232 link. The GUI was designed to provide a user friendly interface instead of ty ping coordinates in TeraTerm. The GUI was designed using Microsoft Visual Basic 2008 and coded in BASIC (Beginners every last(predicate) purpose Symbolic Instruction Code). The overall design of the main form of the user interface is shown in invention 3.1.Figure 3.1 Main form of the GUIIt was decided to incorporate the following features in the GUIpossibility of text file which contains the coordinates. catching of coordinate file (or tool path) in two dimensional X and Y axisCommunication with the CNC Machine via RS232 linkMilling control features such as homing, manual jog etcDisplaying coordinate file3.1 File InputThe GUI contains a MenuStrip at the go across of the main form on which there are three menus, File, apparatus and Help. The File menu contains an Open menu which open(a)s a file web browser window as shown in Figure 3.1.1.The software utilizes an OpenFileDialog control of Visual basic 2008 to prompt the user for the files path. It allowed the user to choose which text file to open in the program. The OpenFileDialog control contains the Filter property which was used to control the type of file to be opened in the program. The except computer address allowed was the *.txt. The ShowDialog() method was used to display the Open Coordinate File dialog thump on the screen. The FileName property was used to get the path specified by the user. The dialog boxwood is shown in manikin 3.1.1Figure 3.1.1 Open Coordinate File dialog boxAfter getting the path from the user, the program used a FileOpen() function to open the file specified by the user. The end of file function, EOF() was used to iterate through the file until the no more coordinates are left. The LineInput() function was used get a line of coordinates into a drag variable. This string variable was indeed extracted to get the X, Y and Z coordinates in a separate set off. The cast containing the X, Y and Z coordinate was indeed used later to generate two dimensional previews and t o send to the CNC milling machine. Finally the FileClose() function closes the text file.3.2 Tool Path PreviewThe graphical user interface that is designed also contains a two dimensional preview feature which asshole be used to preview the path taken by the milling tool on the workpiece. The GUI uses the system. give sucking.graphics namespace to create tool path. The preview panel, as shown in figure 3.2.1, gives a two dimensional (X, Y) preview of the tool path which will be followed by the cutting tool. It is also to transgress and verify that the input text file does not contain errors.A Preview command handout is used to generate preview. This is activated only when a valid coordinate file is loaded. The GUI utilizes system.drawing namespace which includes system.drawing.graphics class to draw the preview. The DrawLines() method was used to draw a series of lines according to the X and Y coordinates in the coordinate file.Figure 3.2.1 Tool Path Preview controlThe use of thr ee-dimensional absolute coordinate system has make the previewing algorithm much easier since the preview is two dimensional (X, Y), the program utilizes these X and the Y coordinates to draw a preview of the shape in the preview panel.Once the Preview command button is clicked, the btnPreview_Click event procedure gets the array containing the X and Y coordinates which was antecedently read from the text file. The procedure then used these coordinates as points to draw a series of lines using the DrawLines() method. Since absolute coordinates are used, the lines connect from the end point of the first X, Y coordinate to the start point of the next X, Y coordinate. In this way the path taken by the stonecutter is drawn by connecting the series of points.3.3 Milling ControlsThe GUI on the main form contained a group box with a number of command buttons for commanding the milling machine. The Home command button was used to command the milling machine to rapidly move to its home pos ition.Figure 3.3.1 Milling Control panelThe advantage of using a software interface to control the CNC Milling Machine is that it acts ilk a control panel of the CNC which resides on the PC. Several command buttons have been used on the main form to command the CNC Milling Machine to carry out various tasks. The Home command button is used to command the CNC Milling Machine to move to its home position. The milling control also contains a command button Start to run or to send the coordinates to the milling machine to start milling. The flowchart in figure 3.3.2 shows this.Figure 3.3.2 Flowchart showing the start subroutine4. COMMUNICATIONSThe user interface for controlling the milling machine resides on a dedicated PC. Therefore there should be some means of communication between the software and the electronics hardware. A standard desktop personal computer consists of several communications ports. These include parallel port (LPT1), serial port (COM), PS/2 ports and Universal Se rial Bus (USB) ports.Serial port communications has been used to with the electronics hardware. The Serial port or RS232 has several port settings that need to be set. The advantage of this obsolete technology is that it best suits the application we are designing, and the amount of data that needs to be sent to and from the milling machine.Figure 4.1 shows the dialog box that appears to the user when the user chooses Serial Port from the setup Menu. On this dialogue box the user locoweed choose the port settings. The reason for including this control is so that the application may work on different PCs. The default port setting is shown in figure 4.1.Figure 4.1 Serial Port Configuration dialog boxThe communications via RS232 was made possible using the system.IO.ports namespace, and the SerialPort class of Visual Basic 2008. The SerialPort class consisted of properties/attributes, methods and events which was used in the communication algorithm. The ReadExisting() method was used to read data from the PCs serial port receive buffer (Rx). The Write() method was used to send string data to the electronics of the CNC Milling Machine. The flowchart in figure 4.2 demonstrates how the communication to the milling machine is made when the user clicks ok on the dialog box in figure 4.1.Figure 4.2 Flowchart showing the communication algorithm followed.5. TESTING AND DEBUGGINGOne difficulty faced during the development and testing of the GUI was run time errors or exceptions. Runtime errors or exceptions occur as a result of normal operating conditions 8. For example errors when the GUI is trying to open a COM port which is being used by another program. The problem was overcome using structured error handling or the bear witnessCatch code block in Visual Basic. The GUI used message boxes to display appropriate messages to the users when an exception occurred and allowed the program to continue.The preview part of the GUI was tested by opening a text file containin g 165 X, Y, Z points. These points resembled a circle in two dimensional (X, Y) planes. The result is depicted in Figure 5.1 which shows the tool path generated on the preview panel.Figure 5.1 Tool Path preview showing the preview of a circleFurthermore, the same file was used to mill a circle on softwood with the following settingsFeedrate 75mm/minSpindle swiftness 2500RPMCutting Tool Diameter 5mmThe result is shown in Figure 5.2. The result shows that the Graphical User Interface made no errors while consecutive sending coordinates to the milling machine.Figure 5.2 Output of the CNC Milling Machine6. completion AND FUTURE WORKBased on the result in the previous section of this paper, it can be concluded that the GUI design was successful. The GUI was able to communicate with the electronics hardware of the CNC Milling Machine using RS232 serial link. The preview algorithm of the program also worked well. Finally the GUI was able to sequentially send (X, Y, and Z) coordinates representing cutter path in three dimensional space, to the CNC Milling machine.However, a number of tasks can be carried out in the future to improve the performance of the GUI and to enhance the output of the CNC Milling Machine. One such include the implementation of the industry standard G Codes which is based on ISO6983 data model, instead of X, Y, Z coordinate file. The G Code programming is a standardized way of controlling cutter motion.The CNC milling machine is capable of moving in steps as small as 1 tenth of a millimeter. Thus it is also recommended to improve the GUI so that it can cater for coordinates with one tenfold point. The output of the CNC milling machine will improve drastically by having coordinates in mm to one decimal point.Another improvement that can be implemented on the GUI is using an abort button to cancel or abort the operations of the CNC Milling Machine. This is a standard safety feature which exists on most industrial machines including CNC mach ines.

No comments:

Post a Comment