1 Introduction

The multi axis machining is a manufacturing process of material removal with cutting machines for milling and turning. Most of these CNC machines work with three axes (two axes in the case of turning machines) X, Y, Z for this manufacturing process. The movements of the milling machines are three axes for manufacture a part, with the help of the corresponding programs and the technician in charge.

However, rapid technology changes and a highly competitive market have influenced the current manufacturing industry. Many have considered the use of an open architecture technology as a trigger for such changes, enabling the use of retrofitting machines to work as a brand new machine would and so to reduce the expenditures.

Most of the CNC machines in underdeveloped countries are imported. With regular maintenance, these machines could last up to 10 years. Consequently, the owners face the necessity of purchasing a new machine, upgrading or retrofitting the old model. However, purchasing a new CNC machine is not an option because it represents a big financial burden for small and medium enterprises, SMEs [1].

The traditional CNC systems are frequently based in a centralized control and in most cases, those systems cannot handle the requirements of working with high speed and accuracy, restricting the use in the new production systems [2, 3] such as FMS or CIM. That is a reason it is necessary to establish an appropriate communication protocol and the respective interfaces to adapt new systems. In addition, it observes a tendency of migrating to a new standard (STEP-NC) to replace the traditional GM codes [4,5,6].

Nowadays, the multiaxis systems are commonly used in manufacturing industry. The small and medium enterprises do not have this feature, for that reason they cannot compete or provide a better level of service.

An example of this is a HAAS VF-2 mill machine acquired in 1995. The lack of fourth and fifth axis in a vertical HAAS Mill VF-2, does not allow doing complex machining, like turbine blades, biomedical prosthesis, machinery parts and equipment [7]. An example of complex geometry is also found in [8].

The end-mill cutting tools are very important for controling the cutting forces during machining, the strength of cutting edges and the chips removal capability [9]. Currently cutting tools making process also requires a multiaxis machining process, in the past the grinding process was made in two axis CNC machines, but nowadays the grinding-wheels require free-form profiles, expensive an uneasy process to make.

This technological issue limits the use of three axis-milling machines in the current manufacturing industry. For this reason, investments and infrastructure are a powerful incentive to satisfy technology development that demands the use of complex machining in the manufacturing industry in order to become part of the competitive market.

In this work, it is assessed different possibilities to add a fourth and a fifth axis to a HAAS Mill VF-2 CNC machine, which in normal conditions operates with three coordinate axes, an x–y table and a spindle that moves vertically (Z-axis).

2 Materials and methods

The first step realized was to review the control card of the CNC under study to verify the upgrade that could be achieved. It was observed certain limitations for the implementation of the fourth and the fifth axis in a VF-2 HAAS Mill. Due to the control card is obsolete and only has connection for four axes. As the control card only has an additional slot, it can add a fourth axis fully synchronized.

The second step was to review the HAAS catalogue for modules of fourth and fifth axis integrated as TRT-160 module (Fig. 1).

Fig. 1
figure 1

TRT-160 module (fourth and fifth axis)

This module adds directly the fourth and fifth axis (once it is decided to buy a servo amplifier card), it goes on top of the X–Y table and it reduces drastically the machining space for any vertical machine. It also has a high cost, but the real problem is how communicate the fifth axis, as it was said before the machine has only one additional slot for synchronizing four axes.

HASS dealer has a propose for the problem with another external controller (but considering that 4 axes will work simultaneously and 5th will be indexed).

Third step, if you do not desire to invest in another control, this inconvenience can be solved by switching the fourth and the fifth axis in real time. By doing so, it could only have 4 axes working simultaneously, but using proper control techniques and micro stepping it would be like having 5 axes at the same time. This could be achieved by using the I/O parameters, a microcontroller and an analog multiplexer.

For this propose a Teensy ++ 2.0 microcontroller was used (An AVR microcontroller capable to be programmed in C, C++ and Arduino).

2.1 I/O parameters in a VF-2 HAAS mill

The VF-2 HAAS Mill has different types of I/O modules. Most of them have already being used by the system for monitoring the door, coolant level, air pressure, light beacons, and some others. These modules cannot be used for another purpose, for that reason, the CNC machine has some spare slots that could be used for control purposes.

The digital inputs can be monitored by the M 96 instruction that use P and Q parameters. Where P indicates the line which instruction will jump to when the condition is met, Q indicates an input to be tested with a number (0-63). An example of this is:

N04 G28 (N indicates the number of line in the main program)

N05 M96 P10 Q8 (Test the input #8 in this case is the door switch, if this is cero then the control will jump to line 10)

M00 (optional stop)

N10 ... (Machining program)

M30 (End of program)

In addition, it has some I/O user modules called M-code relays, which in most of the cases can be used as digital outputs, but can also be dependent of a user input called M-FIN. This user input can be monitored by the M 96 instruction too. The relays above mentioned are used with instruction M 21-M 28 respectively (Fig. 2).

Fig. 2
figure 2

M-code relays from the HAAS Mill

Fig. 3
figure 3

Block diagram of the 5 axis integration proposal

For instance, the M23 instruction that will turn on a relay labeled as M23 if an M-FIN signal is received, and then after a short period it will turn off. Besides, it can use M51-M58 which turn on each relay (without the need of waiting for M-FIN signal) and leave it on, until a M61-M68 turned it off respectively.

Another way to establish a communication with the CNC machine is by RS-232 interface which is normally used for upload and download machining programs. In addition, it is used for sending information of the current position of the spindle by the G102 instruction.

In this work were used these communication options for develop the interface (Fig. 3), which can use a program enabled with macros that calls a subroutine with the use of I/O that reads signal from sensors and sends the appropriate signals for enabling the fifth axis in full operation.

2.2 Macros instructions

The macros are a set of instructions that are an optional feature. For HAAS dealer, it needs to be purchased if you want to enable it on your CNC machine, for some other dealers this instructions set is already activated when you purchase a new machine.

Macros add capabilities and flexibility to the control that are not possible with standard G-code [10]. Most of the times the macros are used for a family of parts, custom canned cycles, complex motions and driving optional devices.

A macro is any routine or subprogram that may run several times. A macro statement can assign a value to a variable or read a value from a variable, evaluate an expression, jump conditionally or unconditionally to another point within a program, or conditionally repeat some section of program. For this reason, this type of instructions are used in this work along with I/O parameters described before.

3 Development

The Fig. 3 describes the proposal method for adding the fourth and the fifth axis. The process starts with a CAD-CAM process like in [11] which time consuming operations are needed to define complex geometries. For this paper purposes a code converter program was developed in Labview 2009 software.

The reason of use code converter program is because the CNC machine controller is not able to interpret a code involving a fifth axis coordinate (A and B axis in this case). Due to this was made a program called the code converter in Lab view that assists in the task. In the write buffer it is pasted a machining program that involves 5 coordinate axes and in the result buffer it obtains a program compatible with a three axes CNC machine, where this calls a subroutine each time that an A axis or B axis code appears.

In Fig. 4 an analog multiplexer can be added between the microcontroller and the TRT-160. In addition, it is required a power phase for making the connection with the TRT-160, this is because the microcontroller and the analog multiplexer work only with TTL (transistor transistor logic) signals.

Fig. 4
figure 4

Fourth and fifth axis integration via analog multiplexer and the TRT-160

As a second alternative (Fig. 5) industrial servomotors can be used for enabling the forth and the fifth axis also the microcontroller and the power phase as it was mentioned before for making a proper connection.

Fig. 5
figure 5

Fourth and fifth axis integration via two industrial servomotors

The subroutines contain instructions and information of position and speed of the fourth and fifth axis. In the first test, servomotors were moved without any control and without synchrony with three axes already installed so far. The result of the code converter was sent to the CNC machine enabled with macros. It can be sent via RS-232 or via a USB port.

The synchronization method was carried out by a microcontroller that works as an interface between the CNC machine and the fourth and fifth axis through two low power servomotors. This method allows generating a signal proportional to the information received from the CNC machine via RS-232. The synchronization was carried out by the M-FIN signal as described in the I/O parameters section.

4 Results

Figure 6 shows the Code Converter program required to adequate de NC code for being readable in a 3-axis mill machine. It has a section where you write code or subprogram that is going to replace to A or B codes, that in normal operation they cannot be read. For example if you write M98 P9998 L, the code B will be replaced by P9998 subroutine. Each time the Mill Machine needs to move servomotor B the main program will call to subroutine P9998 that it will be executed “L” times. You can also write G65 P9998 B where B code will be stored as a variable and then it will be send to the microcontroller to move servomotor B to desired position.

Fig. 6
figure 6

Code Converter program developed in Labview

Figure 7 shows how the experiment was made. It has two conventional servomotors on top of an X–Y table of the HAAS VF-2 Mill Machine, it has also a webcam for measuring purposes using Machine Vision like in [12] with the difference here is that the inspection is carried to measure angular displacements also on-machine.

Fig. 7
figure 7

Module of conventional servomotors on HAAS VF-2 table

Fig. 8
figure 8

Whole experiment set up

In Fig. 8 the whole experiment is displayed, it shows the power supply, the microcontroller and computer which was used to supply voltage to the microcontroller and also for displaying the information received via RS-232 from the CNC Mill Machine.

5 Conclusions

The given results show that manufacturing industry requirements for producing complex shapes could be achieved with a synchronized axes CNC machine with two external servomotors, emulating a 5 axes CNC machine. Hence, it reduces the cost of any investment and can certainly be part of any academic program teaching resource.

One of the alternatives for communicating the fifth axis using the TRT-160 was using the microcontroller and an analog multiplexer.

The other option could be done by using a CNC via serial bus and a Microcontroller’s digital I/O ports, and passing the code through a converter code, replacing some command lines and directing the additional axis instructions to the servomotors via RS-232 serial bus and to generate displacement on the servomotors that emulates the fourth and fifth axis.

In this proposal, it could achieve synchronization of two conventional servomotors with a HAAS VF-2 Mill Machine that opens the possibility for evaluating a six-axes movement related to a complex machining process, as well as connecting a robotic arm or a conveyor in a manufacturing cell.

By using the I/O capabilities that it explored in this work, open an opportunity to work with Flexible Manufacturing Systems (FMS) should be highly considered.