5 ANALYSIS 49 CHAPTER 5 OF LINUXCNC In the literature survey it is found that under the open source category, there is an open system for CNC as LinuxCNC. It is developed in open source software under GNU public license for Numerical Control (NC) of machines. 5.1 LINUXCNC OVERVIEW LinuxCNC uses the real time kernel of the Linux system and can send signals without over loading the operating system. It supports both servo and stepper motors. Currently many motion control card and drive manufactures developed drivers for LinuxCNC. Since LinuxCNC uses a hardware abstraction layer, it is possible to mix and match various control boards. LinuxCNC communicate to the motion controller using various ports like parallel port, serial ports, PCI and PCI-express bus. It can control up to 9 axes in a CNC machine. 5.2 ARCHITECTURE OF EMC There are four components contained in the LinuxCNC Architecture: a motion controller (EMCMOT), a discrete IO controller
50 (EMCIO), a task executor (EMCTASK) which coordinates them and several text-mode and graphical User Interfaces. The motion control card receives commands from user space modules via a shared memory buffer, and executes those commands in realtime. The status of the controller is made available to the user space modules through the same shared memory area. The motion controller interacts with the motors and other hardware using the HAL (Proctor &Michaloski 1993). Figure 5.1 shows the architecture of LinuxCNC. Figure 5.1 LinuxCNC Architecture
51 5.2.1 EMC Motion Controller (EMCMOT) EMCMOT executes the executable modules in a loop to perform real time operations and performs trajectory planning, direct and inverse kinematic calculations and computation of a desired output to the motor control subsystem. This process includes sensing of controlled axis positions, computation of the next trajectory point and interpolation between these trajectory points. It supports both hardware limits and programmable software limits. The hardware limits will be sensed by the axes limit and home switches (Proctor &Michaloski 1993). 5.2.2 Discrete I/O Controller (EMCIO) The EMCIO module handles all I/O functions, which are not directly related to the actual motion of machine axis. It is implemented as an I/O controller consisting of a hierarchy of subordinate controllers for the main spindle, automatic tool change, the coolant, auxiliary functions (E-STOP chain, lubrication, etc.) and other user-defined subsystems (Proctor &Michaloski 1993). 5.2.3 Task Executer (EMCTASK) EMCTASK is having two modules the G-code interpreter and sequencing logic. It monitors the status of subordinate modules (EMCMOT and EMCIO) and coordinates them. It also receives and analyzes the commands, either from the operator through GUI or from another process as in auto mode (data may be provided from a file for sequencing), interprets them into Neutral Messaging Language (NML) messages and dispatches them to EMCMOT, EMCIO or EMCTASK itself at appropriate times (Proctor &Michaloski 1993).
52 5.2.4 User Interfaces A user interface is the part of the LinuxCNC that the machine tool operator interacts with. The LinuxCNC comes with several types of user interfaces: AXIS is the standard GUI interface. Touchy is a touch screen GUI. Keystick is a character-based screen graphics program suitable for minimal installations (without the X server running). When LinuxCNC is running, there are three different major modes used for inputting commands. These are manual, Auto and Machine Device Interface (MDI). Changing from one mode to another makes a big difference in the way that the LinuxCNC control behaves. An operator can take an axis to home position in manual mode but not in auto or MDI modes. An operator can cause the machine to execute a whole file full of G-codes in the auto mode but not in manual or MDI (EMC 2011);(linuxcnc.org). 5.3 MOTION CONTROL CARD SELECTION FOR LINUXCNC The Motion Control Card (MCC) selected for the proposed system is MESA6i68 PCI Express Card. The MESA6i68 Card works with the system in real time and provide flexibility for better configurability. The daughter board selected is MESA3x20, which is compatible to the MESA6i68. The MESA6i68 buffers all I/O pins with bus switches for interfacing with MESA3x20 daughter board. The MESA3x20 is a high I/O density external PCI Express FPGA card. The MESA3x20 has 144 user I/O ports available. It requires only 3.3V external power supply. The PCI Bridge allows FPGA programming via the host and does not require any FPGA
53 bootstrap. The PCIE bridge supports host data transfer rates of greater than 150MB/Sec. On card configuration storage is provided for stand-alone applications. The input from the HMI are decoded into machine control signals by the MESA 6i68 PCI Express Card and send as I/O signals to the drives with proper isolation. This will be done by a daughter board MESA3x20, which operates with Spartan-3 FPGA. The MESA3x20 is a high I/O density external FPGA card with 144 user I/O ports. It requires only 3.3V external power supply. PCI bridge allows FPGA programming via the host and does not require any FPGA bootstrap(mesa). 5.4 PROCEDURE FOR SETUP AND TEST LINUXCNC The Mesa card is connected to the PC through PCIExpress bus. The drives are connected to the axes headers of the daughter board and the motors are interfaced to the drives using dedicated connectors and cables provided by the manufacturer. 5.4.1 System Configuration of LinuxCNC A test setup has been prepared for the testing of LinuxCNC using the selected cards, drives and motors. LinuxCNC is installed on Linux PC (Ubuntu 12.04). The drivers for the cards are also installed by downloading it from the manufactures web portal. The additional plugins for parameter setting and simulation are also installed. Now the system is ready for the basic machining testing. The figure 5.2 shows the system configuration for LinuxCNC.
54 Figure 5.2 System configuration of Linux CNC 5.4.2 LinuxCNC initial setup Menu The various parameters and machine configuration is set by using a plugin used with LinuxCNC. It is used to select the motion control card, the daughter I/O board, drive parameters, spindle parameters and encoder parameters. The LinuxCNC parameter setting window is shown in the Figure 5.3.
55 Figure 5.3 LinuxCNC parameter setting window 5.4.3 LinuxCNC Simulation window Many simulators are available as plugin in LinuxCNC. The most commonly used one if AXIS. The AXIS will give a pictorial representation for the tool path and the currently running G-Code on the simulation window. The test G-codes and the screen shots of the Linux CNC simulator is shown in the Figure 5.4.
56 Figure 5.4 LinuxCNC Simulator AXIS screen shot 5.5 RESULTS AND ANALYSIS The drives and motors are successfully interfaced with LinuxCNC. Machine tool operations are performed as per the expectations on the simulator. Even though the performance was satisfactory, many interfaces were untested due to the absence of support from the LinuxCNC or due to the absence of driver for the hardware. As the system operation is tested with a two axes machine, the performance evaluation should be extended with multi axes platform. The LinuxCNC satisfies the educational and light operations level machining operations. Due to the robust open source real time OS, LinuxCNC
57 promotes expansion possibilities, scalability, interoperability and reconfigurability of open architecture. One of the main disadvantage noticed was it lacks interface to the motion controller through Ethernet or USB. Due to the compatibility issues in modules developed in two different real time environment like RTAI and RTLinux the Ethernet support is not possible in real time operation. But it is found that many proprietary controllers support Ethernet interface. The auxiliary functions like coolant pump, lubricant, tool changer, emergency stop, are also supported by LinuxCNC system with standard functions or auxiliary functions. Table 5.1 Test Result Comparison of LinuxCNC with old SBL110CNC Lathe Sl No Parameter SBL110 CNC Retrofitted System with LinuxCNC 1 Feed Rate 1-2000 mm/min 1-5000 mm/min 2 Rapid Traverse rate 5 m/min 10 m/min 3 Max. threading pitch 2 mm 2 mm 4 Positioning Accuracy ± 0.01 mm ± 0.001 mm 5 Repeatability ± 0.005 mm ± 0.001 mm 6 Backlash(vertical) NA ±0.002 mm 7 Backlash(horizontal) NA ±0.001 mm 8 Spindle Speed 1000, 1500, 2500, 0-6000 variable rpm 3000rpm 9 Holding torque of axes 1.6 Nm 2.39 Nm 10 Temperature Compensation Nil Available 11 Tool changer Manual Automatic 12 Coolant pump Manual Automatic 13 Lubricant pump Manual Automatic 14 JOG operations Available More flexibility 15 Loading Characteristics Low torque More torque 16 CAD, CAM, G codes Only G codes All formats possible in PC 17 Real time tasks Not available Available
58 The Table 5.1 gives a real time test result and comparison of the parameters generated by retrofitted LinuxCNC and the conventional CNC machine. Results clearly show improvement in performance.