The optimization of the control logic of a redundant six axis milling machine

The primary task of machine tools is simultaneously positioning and orienting the cutting tool with respect to the work piece. The mechanism must avoid positioning errors, and limit forces and torques required to the motors. A novel approach for combined design and control of manufacturing means is proposed in this work. The focus is on the optimization of the control logic of a redundant 6 axis milling machine, derived from the 5 axis milling machine by adding redundant degree of freedom to the work piece table. The new mechanism is able to fulfill a secondary task due to the introduction of redundancy. The proposed methodology sets as secondary task the minimization of the rotary motors torque, or the minimization of the norm of the positioning error. The control is based on the solution of a constrained optimization problem, where the constraints equations are the kinematic closure equations, and the objective function is the table motor torque or the positioning error of the tool tip. The implementation of this framework in the virtual machine model of the mechanism shows an improvement of the performances: actually, the introduction of a redundant axis allows the minimization of the torques and position errors.


Introduction
One of the main tasks of machine tools, such as 5 axis milling machines, is realizing the simultaneously positioning and orienting the cutting tool respect to the work piece. This task must be fulfilled with the higher possible precision, and this means that the machine must avoid positioning errors. An error is defined as the norm of the vector representing the distance between the ideal configuration of the machine, and the actual position of the tool respect to the finished part reference frame. Errors of the machine tool directly affects the deviation of the dimensions of the work piece from the nominal specifics. Many authors (Kiridena and Ferreira 1993) refer to this quantity as volumetric error, which represents an index for the errors of a machine tool (Cheng et al. 2018).
Volumetric errors are the result of the propagation of geometric unconformity of machine's components, in the way they are assembled, and in their mechanical behaviour. In order to study this phenomena, different models have been used to describe the kinematic behaviour of the machine, such as the one based on the Denavit and Hartenberg convention (Lamikiz et al. 2008;Ziegert and Kalle 1994), or the one proposed by Suh et al. (1998).
More recently, a model for the evaluation of the machining accuracy has been proposed by Cheng et al. (2016). The first efforts in error modelling mainly concentrated on 3 axis machine tools, as highlighted by an extensive survey in the article of Khan and Wuyi (2010). Later on, many researches focused on error identification of rotary axis (Fu et al. 2015), which makes the definition of the error model for 5 axis machines such a complex task, and still a topic of interest .
Despite the kinematic model taken in account, the main goal is the mitigation of the geometric uncertainties along the kinematic chain. In machine tools, the accuracy can be improved by error compensation (Stryczek 2016), or by error avoidance (Kreng et al. 1994). In the first case, the errors due to the structural uncertainties are mitigated by modifying the control logic. On the contrary, the error avoidance is obtained by the intrinsic use of particular design principles: these may be the adoption of particular constructive material, or the adoption of a particular morphology for the structure. The goal of the present research is proposing a hybrid approach, with features of both error avoidance and error mitigation. The proposed method is based on the adoption of a modified redundant architecture of the milling machine, and its control optimization.
Redundancy is a concept related to the task that a certain mechanism must fulfill. For a 5 axis machines tools, the objective is positioning the tool in a certain position and with a certain slope respect to the work piece. This means that the 5 degrees of freedom of the tool (the rotation around the symmetry axis is not taken in account) must be defined with respect to the reference frame attached to the work piece. To fulfil this task, the milling machine is usually characterized by a kinematic chain composed by 5 links connected by 5 joints, each actuated by a motor. An example is the RRTTT 5 axis machine tool, as defined by Kiridena and Ferreira (1993), depicted in Fig. 1a.
In the RRTTT 5 axis machine tool, the number of DOF of the tool are equal to the number of axis, which means that there is a finite number of possible configuration of the system which fulfill the placement task. But if the kinematic chain which characterizes the machine have 6 or more members, the problem becomes mathematically not determined, and there is an infinite number of possible solutions for the inverse kinematic problem. In this case the system is redundant.
An example of adoption of redundant architecture for manufacturing is the study of the use of industrial robots as an alternative to traditional CNC machines (Ji and Wang 2019;Tao et al. 2020). Industrial robots are characterized by 6 actuated degrees of freedom: 3 actuators belonging to the anthropomorphic manipulator, and 3 belonging to the spherical wrist. Compared to the 5 DOF required for a classical milling operation, industrial robots have a degree of freedom which can be used in order to improve the rigidity of the system during the machining (Xiong et al. 2019). Actually, the most interesting features of the redundant systems is the possibility to deal with different tasks at the same time (Patent Application WO/2019/243986). Examples of secondary tasks are the avoidance of singularities, the respect of the joint limits, and the prevention of the collisions, as it is exploited in the research of Xiao and Huan (2012). Moreover, another possible secondary task is the maximization of the resulting global stiffness of the manipulator depending on the configuration. This research focuses on the redundant TRRTTT milling machine, which is a variant of the RRTTT 5 axis machine tool: the main idea is determining the ideal configuration of the mechanism according to the achievement of a secondary task. Both minimization of rotary motor torque and minimization of volumetric errors will be taken in account. The volumetric errors are caused by the deviation of all the dimensional parameters from their ideal values. Anyway, as it had been highlighted by Chen et al. (2013), roll pitch and yaw errors have a high influence compared to linear positioning. This can be explained by the Abbe effect, which postulate an amplification of angular uncertainties depending on the structure of the kinematic chain. The introduction of a redundant degree of freedom is adopted in order to mitigate the effect of the angular uncertainties introduced by the tilting table. More precisely, a translational axis is added to the double turntable, as it is shown in Fig. 1b.
The use of a virtual model of the manufacturing machine is proposed here in order to provide a tool for the evaluation of the improvement of the double turntable due to the introduction of the additional axis. The development of a virtual counterpart of the physical system has two main goals: as it had been reported by Pedersen et al. (2016), a digital twin of a physical system is an effective tool for studding the behaviour of the actual mechanism. On the other hand, the improvement of the table performance depends on the results of an optimization procedure, carried out in order to provide the control of the table. The use of a virtual model of the machine can be an ideal workbench for the design of the control.
A last remark is about the validity of the framework for other types of devices. Similarly to machine tools, in additive manufacturing means, minimizing the placement error of the nozzle, or the torch, is a key factor for the process, because it minimizes the deviation of the actual product from the original design (Calignano 2018;He et al. 2019;Song et al. 2015). Consequently, the importance of mitigating the influence of geometric uncertainties of the productive process is still valid in productive means adopting both subtractive and additive paradigms, such as hybrid machines (Flynn et al. 2016).

Standard RRTTT machine
The basic equations for the standard 5 axis machine are presented here. As a first step, the kinematic chain equations are derived by the use of the Denavit and Hartemberg convention. The equations describing the kinematic chain of the 5 axis machine tool are obtained using the Denavit and Hartemberg convention. Let's assume that a reference system O 0 x 0 y 0 z 0 is attached to the work piece, and the a reference system O 5 x 5 y 5 z 5 attached to the tool. It is possible to write the coordinates p (5) of the point P with respect to the reference coordinate system O 5 x 5 y 5 z 5 , if the coordinates p _ (0) , and the matrix A 5 0 are known: where p (0) are the coordinates the point P with respect to the reference coordinate system O 0 x 0 y 0 z 0 , and the matrix A 5 0 is global homogenous transformation matrix: The single link homogenous transformation matrix is derived according the Denavit and Hartenberg convection: The set of the reference systems attached to the links composing the kinematic chain of the 5 axis milling machine are depicted in Fig. 2.
Finally, taking in account the DH parameters reported in Table 1, the global transformation matrix is: where , , X, Y, Z are the variable parameters reported in Fig. 2: , are the coordinates of the two rotational axes, and X, Y, Z are the coordinates of the translational axes. According to Kiridena and Ferreira (1993), it is possible to derive the kinematic chain equations: and the Jacobian matrix of the system:

Modified TRRTTT machine
According to the schematic layouts depicted in Fig. 3, the 6 axis redundant TRRTTT milling machine is derived by the RRTTT by adding a prismatic kinematic couple. The basic equations for the redundant 6 axis TRRTTT machine tool are obtained imposing the coincidence of the generic point of the work piece and the centre of the tool. As depicted in Fig. 3b, the coordinates of a generic point P of the work piece with respect to the reference coordinate system O 0 x 0 y 0 z 0 are functions of the parameters r P , α, β. On the other hand, in the reference system O 6 x 6 y 6 z 6 , the tool has the rotation axis coincident with the z 6 axis. As a consequence, the two representations of the point P, p (0) and p (6) , must fulfil the following relation: The set of the reference systems attached to the links composing the kinematic chain of the 6 axis redundant milling machine are depicted in Fig. 4.
According to DH parameters reported in Table 2, the homogenous coordinate transformation matrix is: where , , X, Y, Z are the coordinates of the two rotational axes, and the three translational axes as in the RRTTT machine, and H is the variable parameter introduced with the redundant kinematic couple. Consequently, the closure equations for translation and rotations are: and the Jacobian matrix of the system results: It is convenient to write the kinematic closure Eqs. (9) and the Jacobian matrix (10) with respect to the reference coordinate system O 6 x 6 y 6 z 6 , which is attached to the tool. The new closure equations system is: and the new Jacobian matrix is: −sθ 2 −r P cαcβs c + r P sαcβc c −r P cαcβc s − r P sαcβs s + r P sβc − Hc −1 0 0 0 −r P cαcβc − r P sαcβs + Y 0 0 1 0 −cθ 2 r P cαcβs sθ 2 − r P sαcβc s −r P cαcβc c − r P sαcβs c − r P sβs + Hs As it may be noticed in the system (11), only the equations competing the translations are changed, and this is due to the fact the slope of the tool with respect to the work piece is only referred to the coordinates and of the rotational axes.

Optimal configuration of the TRRTTT machine
The optimal conditions for the control of the tool machine are introduced in this section. These conditions are derived by solving a constrained optimization problem. In general, a (continuous) constrained optimization problem is formulated as follows: In this case, the constraints are only equality continuous, and more specifically they are the kinematic closure equations, which are the conditions ensuring that the position of the tool lays in the desired point P of the work piece. On the other hand, the objective function U is related to the performance of the machine that will be improved. In the present research two objective functions will be presented, related to the minimization of the following physical quantities: 1. Torques provided by the rotational motors during the milling process; 2. Norm of the positional errors due to the wrong actual position of rotational joints.
As an example of the efficiency of the methodology, according the objectives 1 and 2, the optimal machine configuration for 2D machining problems will be defined in the next sections. The 2D machining is derived by the general 3D formulation by imposing the following conditions: θ 1 0, α 0, Y 0. Furthermore, we will consider the origin of the reference system O 6 x 6 y 6 z 6 coincident with the tool centre, which implies that L 0 as well. Under these hypothesis, the kinematic closure equations become: where μ is the angle between the x 0 axis attached to the work piece, and the axis of the tool z 6 . Moreover, it is possible to provide the Jacobian matrix of the system according to the 2D formulation of the problem, and the consequent change of the dimensions of the matrix itself:

Minimization of the joint torque
Let F x , F z , M y be the components of the force and the momentum applied by the tool on the work piece. If G (6) 4x3 J (6) 3x4 T is the transpose of the Jacobian matrix, it is possible to solve the equilibrium of the system by the use of the kinetostatic duality: where T H , C , T X , T Z are forces and the torque generated by the actuators corresponding to the axes coordinates H , , X , Z . It can be noticed that the only function in the system (16) which can be optimized according to the boundary conditions (kinematic chain equations and milling process specifications) is the one competing the torque provided by the rotational motor.
Consequently, the first objective function is the absolute value of the couple C 2 : In the 2D case, the objective function can be nullified, reaching a global minimum, imposing the following condition: Figure 5 depicts the graphical representation of the condition (18): as it may be expected, the optimal configuration for the machine shows the line of action of the force passing through the point of instant rotation. This condition, if theoretically may be always met, in practice cannot because the parameter H may only have values in accordance with the physical limits of the mechanical linear guide. Chen et al. (2019) highlighted that position errors have a high sensitivity to angular position of rotation motors and angular errors. Their relation may be evaluated writing the infinitesimal variation of the positional parameters in function of the infinitesimal variation of the axes variables:

Minimization of the position error norm
The second objective function is the norm of the vector representing the positioning error, and the second optimization problem may be defined as: As it can be noticed, it is possible writinĝ , because the kinematic closure equations are independent by the infinitesimal rotation d . Furthermore, minimizing the objective function U 2 is equivalent to minimizing its square divided by the quantity (dθ 2 ) 2 , which is a positive quantity. For this reason, it is possible define a new equivalent optimization problem: 5 Graphical representation of the optimality condition for the torque optimization (angle ξ is positive, and the represented force F is generic, and not meant to represent the actual interaction between tool and work piece) This particular constrained optimization problem is convex, and admit the global minimum U 2opt r 2 P cos 2 β, corresponding to the value of the variable H opt2 r P sin (β). Figure 6 shows the optimal configuration of the machine, with the point P laying on the axis x 1 ≡ x 2 , so that the distance between the point P and the point O 1 is minimum.
As it had been outlined in the previous section, if a device for additive manufacturing has the possibility to orient the noozle or the torch with to respect the work piece, the accuracy of the forming process can be improved by the mitigation of positioning errors.

System characterization by virtual machine and control optimization
The implementation of the virtual model of the 6 axis TRRTTT machine is described in this section. The main purpose is evaluating the performances of the proposed archi-tecture, when the milling process is controlled according with the proposed approach. Moreover, the following example will briefly show the implementation of the constrained optimization in the machine control logic.
The mill machining process depicted in Fig. 7 is taken as case study: the path of the trajectory is composed by a first linear segment with 30 mm length, a circular arc of 50 mm radius, and a second linear segment of 20 mm. During the machining process, the force on the work piece is always tangent to the trajectory.

Minimization of the joint torque
For the given case study, the objective function U 1 may be written as: Figure 8 shows the mapping of U 1 on the workspace for the tool centre for a work piece of 200 × 100 mm, considering different slopes ξ of the force F. It can be noticed that the torque required to the rotation motor is zero in the points In the particular case of the milling process described in Fig. 5, recalling the optimization problem (17), the objective function becomes: consequently angle γ is always equal to 0, due to the fact that the force is always tangent to the trajectory, and remembering that ξ γ + . Imposing the optimality condition: it is possible to obtain the ideal configuration of the machine in correspondence of every point of the trajectory of the centre of the tool. In the Fig. 9, the values of the axes variables H , , X , Z , are reported in function of the curvilin-ear coordinate of the tool trajectory (continuous line). These values are compared with the values of the correspondent variables if the milling process is carried out by a standard 5 axis RRTTT machine (dashed line).
It can be noticed that the values are different, except for the variable which, in both machines, is the only variable involved in the determination of the slope of the work piece respect to the tool. Moreover, for the 5 axis machine the variable H is identically equal to zero, because it misses the redundant axis.
The data reported in Fig. 9 completely describe the configuration of the two machines during the milling process. Consequently, it is possible to determine the evolution of the objective function during the machining of the profile of the work piece. The values of U 1 for the 5 axis machine (dashed line) and redundant 6 axis machine (continuous line) are reported in Fig. 10. The introduction of the redundant degree of freedom allows the limitation of the torque required to the rotational axis. This appends for almost every point of

Minimization of the position error norm
The objective function U 2 may be written as: Figure 11 shows the mapping of U 2 on the workspace for the tool centre for a work piece of 200 × 100 mm. More in detail, Fig. 11a shows the mapping of the position error norm in the case of the standard 5 axis RRTTT milling machine.
In Fig. 11b the mapping of the objective function is reported for the 6 axis TRRTTT redundant milling machine if it satisfied the optimal configuration condition: It is interesting notice that it is possible to nullify U 2 only in correspondence of the points laying on the z 0 axis. This depends by the fact that the only points of the work piece which can be coincident with the rotation centre are the points on the z 0 axis. Finally, Fig. 11c shows the improvement introduced by the redundant axis. In the particular case of the milling process described in Fig. 7, the values of the axes variables H , , X , Z , are shown in Fig. 12 for both the 5 axis machine (dashed line) and 6 axis machine (continuous line).
Furthermore Fig. 13 shows the comparison between the vales of the objective function obtained for the two machines during the milling process. Once more, the redundant 6 axes machine has better performances in terms of positioning errors compared to the 5 axis machine.

Conclusions
The paper presented a novel redundant TRRTTT milling machine architecture. The introduction of a redundant axis gives the possibility of introducing a secondary task in the control of the machine. Consequently, it is possible to define an optimization problem, which allows the minimization of an objective function representing a particular physical quantity. The optimality condition for the minimization of the torque required to a rotary axis and the minimization of the norm of the positioning errors have been obtained. As a case study, the values of the objective functions have been determinate during a 2D milling machine process. As a result, the redundant 6 axis milling machine always shows better performances compared to the standard 5 axis milling machine.

Conflict of interest No potential conflict of interest was reported by the authors.
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecomm ons.org/licenses/by/4.0/.