Monday, June 3, 2019

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

lifelike User Interface For The 3 Axis Cnc mill about form computing device Science EssayThis paper details the design and development of a vivid User Interface for the 3-Axis CNC Milling Machine, which was designed in-house for testing and research purposes at the University of the South Pacific. The 3- bloc CNC Milling Machine employ COM Port terminal softw atomic heel 18, TeraTerm to communicate with the electronics hardware via RS232 link. The GUI was develop using Microsoft Visual Basic 2008 Integrated knowledge Environment. The end result is an interface that is exploiter friendly and is capable of lead off wordling various tasks of the Milling Machine. This paper aims to explain how simple components of Microsoft Visual Basic 2008 has been apply to design a Windows based substance ab drug user interface which is capable of complete encounter of CNC mill gondola.Keywords GUI, Serial Port, CNC, G Codes, STEP NC1. INTRODUCTIONOver the long time a number of manner s have been developed to control mechanism tools. The most widespread used throughout the industry is the G Code language for NC machine tools curriculumming. It is based on the data model stipulated by ISO6983, and has been used for over 50 years 1. G codes, however, limits the usage of todays fast evolving high-performance hardware 2.The up-to-the-minute development in NC machine tools computer programmeming is ISO 14649 or STEP NC. It is a new model for data transferring between 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 before doing actual testing. Verification of NC division programs using a PC is inexpensive compared to testing on model parts. press cutting simulation as a means of testing and verifying NC slipperiness pat hs has become an important part of modern machining 3. With the latest advancements in PC engineering science and 3D graphics it is much easier to simulate NC black paths.A leafy vegetable CNC executes G-code programs, which are generated 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 computer screen 5. The recent advancement in software package development technology using Object Oriented Programming (OOP) has made it possible to create simple user interface with a sound communication link to control NC machines. In 2002 5, a GUI was developed at the University of the South Pacific for a PC-Based computer numeric control drilling machine. The platform for the graphical user interface (GUI) was written in Borlands new rapid application product, C++ Builder.Gordon and Hillery 6 deve loped a Windows based graphical user interface for their CNC cutting machine. The user interface communicated with the machine via RS232 straight link. The programming environment used was Borland C++ Builder 3, which allowed the visual development of the program interface. The user interface developed in addition had features for homing the third axes, editing of NC part program (G Codes) and also prevueing the two dimensional ships boat motion.This paper mainly focuses on the design of the Graphical User Interface (GUI) for the 3-Axis CNC milling 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 MILLINGMACHINEThe CNC Milling Machine was designed in-house at the School of Engineering and Physics (SEP) at the University of the South Pacific (USP), for testing and research purposes. It uses an inviolate three dimensional mastermind system to create its tool path. It sequentially passes instructions which are in the form of three dimensional adjusts to the Milling Machine for controlling the tool, similar to how G Codes are used.The operational framework of the CNC milling machine is shown in convention 2.1. It consists of a dedicated PC exercisening Graphical User Interface Software which is used to upload a text cross- send containing X, Y and Z coordinates. It also has features to control the milling operations and to get a two dimensional cutter path preview. The software is linked to the electronics hardware via RS232 serial link.Figure 2.1 Operational framework of the CNC Milling MachineThe underway CNC Milling machine is only 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 back be used to approximate that particular geometry. For instance to mill a curve the milling machine needs 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 implicit three dimensional coordinate system (X, Y, and Z) for its tool path generation. The three dimensional coordinates are defined in a text file. Each of the three coordinates has three characters in the text file for instance the X coordinate 0 is defined as 000 in the text file. The Basic Length building block (BLU) is in millimeters.The electronics architecture of the CNC milling machine consisted of five PIC micro control conditions (PIC16F877) in a distributed architecture, with one master controller and several slave controllers. The master controller of the CNC Milling Machine consists of a PIC16F877 microcontroller which is responsible for coordinating and controlling the overal l operations of the Machine. It is the central intelligence system of the CNC Milling Machine. It receives its demands 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 choose the three axis of the CNC Milling Machine. It also has a 24V DC Motor which is the spindle 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 typing coordinates in TeraTerm. The GUI was designed using Microsoft Visual Basic 2008 and coded in BASIC (Beginners All purpose exemplary Instruction Code ). The overall design of the main form of the user interface is shown in Figure 3.1.Figure 3.1 Main form of the GUIIt was decided to hold in the following features in the GUIOpening of text file which contains the coordinates.Previewing 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 top of the main form on which there are three menus, File, Setup and Help. The File menu contains an Open menu which opens a file 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 only extension allowed was the *.t xt. The ShowDialog() method was used to display the Open Coordinate File dialog box on the screen. The FileName property was used to get the path specified by the user. The dialog box is shown in figure 3.1.1Figure 3.1.1 Open Coordinate File dialog boxAfter getting the path from the user, the program used a FileOpen() decease 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 string variable. This string variable was then extracted to get the X, Y and Z coordinates in a separate array. The array containing the X, Y and Z coordinate was then used later to generate two dimensional previews and to 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 can be used to previe w the path interpreted by the milling tool on the workpiece. The GUI uses the system.drawing.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 check and verify that the input signal text file does not contain actus reuss.A Preview command button 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 three-dimensional authoritative coordinate system has made 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 pr eview panel.Once the Preview command button is clicked, the btnPreview_Click event outgrowth gets the array containing the X and Y coordinates which was previously 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 cutter 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 position.Figure 3.3.1 Milling Control panelThe advantage of using a software interface to control the CNC Milling Machine is that it acts like a control panel of the CNC which resides on the PC. Several command buttons have been used o n 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 communication theory ports. These include parallel port (LPT1), serial port (COM), PS/2 ports and universal proposition Serial 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 rare technology is th at 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 can 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 DEBUGGING iodin problem 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 operate 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 TryCatch 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 containing 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 Speed 2500RPMCutting Tool Diameter 5mmThe result is shown in Figure 5.2. The result shows that the Graphical User Interface made no errors while sequentially sending coordinates to the milling machine.Figure 5.2 Output of the CNC Milling Machine6. CONCLUSION 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 meliorate 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 decimal 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 machines.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.