Modelling and Simulation of Machine Tool Prototype with 6DOF Parallel Mechanism in Matlab / Simulink

. The article deals with the preparation of simulation model of mechanism with parallel kinematic structure called hexapod as an electro-mechanical system in software MATLAB/Simulink. The simulation model is composed from functional blocks represented each part of mechanism’s kinematic structure with certain properties. The results should be used for further simulation of its behaviour as well as for generating of control algorithms for real functional prototype.


Introduction
Recent progress of robotics technology and CNC machine tools brings a lot of breakthroughs in the industries as well as in the fields of amusement, welfare and medicine.
General 6 DOFs parallel mechanism has its own drawbacks, such as high coupled motions, small workspace and singularities inside the workspace. The moving platform of general fully parallel mechanism can tilt up to approximately 40 degrees from the horizontal plane at the origin position. It is the result of joint range limits and interferences between limbs or limbs and the moving platform. All these characteristic features have negative influence on its application in certain areas. For example, the small orientation workspace limits its application for motion simulation of acrobatic aircrafts and similar kind of devices required higher tilt angle. However, for most commercial flight or car simulators the capability of the common Stewart platform is sufficient.
To reach high tilting angles, several authors proposed some concepts [12], for example Eclipse mechanism for five-face machining in a single setup. On the other hand, not all applications need to reach so high mobility. At present, such tasks can be automated by use of the Hexapod [5,17] that provides relatively large workspace volume but limited orientation capability around three translational axes.
It is still necessary to do the research related to the topic of designing of different kind of parallel mechanisms with up to 6DOF, as well as their type synthesis, kinematic structure analysis, workspace analysis, etc. As the main motivation to do all these analyses can be considered the necessity to understand their properties and changing of their behaviour along the whole workspace more detailed. The literature repeatedly refers to the simulation and modelling of parallel mechanisms. However through the modelling and simulation in appropriate simulation software tools we can reach these objectives.
During last fifteen years, there was formed a group of researchers dealing with the parallel kinematic structures development as well as at the authors workplace [3,4,18]. There have been proposed various design concepts of the mechanisms with parallel kinematic structure as well as different kind of simulation software for these mechanisms within this period. This article deals with the modelling and simulation of hexapod mechanism in software MATLAB / Simulink.

Structure and design of machine tool prototype
We decided to use the machine tool prototype (Figure 1) based on mechanism hexapod developed at the authors' workplace for modelling and simulation in Matlab/Simulink software. This experimental machine tool is equipped with automatic tool changing and automatic part changing system as well. This article will later focus only on model creation of the hexapod mechanism in software Matlab/Simulink. Designed machine tool prototype can be divided into these basic subsystems: -main frame, -mechanism hexapod with 6 driven electro-mechanical legs and moving platform with main milling spindle, -system of automatic tool changing and system of automatic part changing, -electrical switchbox with control and power units. The machine tool prototype is based on a moving mechanism with parallel kinematic structure ̶ hexapod. Main frame was designed as a welded structure made of steel thinwalled square tubes. The moving platform is capable of moving within its workspace and is connected to the fixed platform via six extensible legs equipped at both ends with universal joints (2 DOFs) or spherical joints (3 DOFs) respectively. The body of each leg is created by linear actuator Exlar IX30 which can generate continuous force up to 4026 N by maximum linear velocity 338 mm per second (for more parameters see Table 1). These actuators present a new range of alternatives for linear motion solutions. Compared to the low performance spur gears provided by most ball screw actuators, the I Series' planetary gears offer an extended life, high input speed and output torque and quiet operation. They are driven by the motors Siemens 1FT7.

Matlab/Simulink simulation model of mechanism Hexapod
Next chapter will be focus on development of simulation model of mechanism hexapod from our machine tool prototype suitable for carrying out different further analyses. The final model will be developed in software Matlab/Simulink. The module Multibody or older version SimMechanics from MathWorks Inc. is a recently developed Matlab library based on Simulink. It is modeling software for mechanical systems that provides a single simulation environment for the construction of reliable mechanical and controller models. These models can be reused by converting them into compact, efficient C code for embedded controller implementations and hardware-in-the-loop testing applications [2,11].
The process of simulation model making in Matlab/Simulink can be divided into several separate steps [2,5] where will be prepared: -model of one leg and model of entire hexapod mechanism, -model of control system a PID controller, -interface for trajectory generation and input of parameters.

Model of one leg and model of entire hexapod mechanism
At the beginning it was necessary to prepare an appropriate 3D model of mechanism Hexapod ( Figure 2) for what we used software ProEngineer and SolidWorks as well. Subsequently, the 3D model was converted to a format that can be processed by the program Matlab/Simulink. The CAD-to-SimMechanics translator can help us to convert the mechanical design into a SimMechanics model faster and easier. For this operation we need to install the free module SimMechanics Link for software Solidworks, Autodesk Inventor or Creo Parametric [18]. After exporting operation it is automatically generated the block file "hexapod.xml" as well as the file of 3D model with suffix "STL". Both files can be imported directly to Matlab. However, the designer must make sure that the SimMechanics model corresponds exactly to the real mechanism.

Fig. 2. CAD model of mechanism hexapod
Consequently the specification of actuators that are used to achieve the desired motion of the different joints of the mechanism can be set. Sensors are then used to monitor the parameters important for simulation purposes. In our case are important mainly position and velocity monitoring of each actuator as well as the end-effector (point TCP, or the tool tip). The organising of assembly components into the individual subassemblies is needed to minimize the number of functional blocks in final Matlab/Simulink model.

Model of one leg
As it was mentioned above, the entire hexapod mechanism is composed from 6 identical linear actuators -extensional legs. So before of modelling hexapod we can prepare the appropriate model of one leg which will be multiplied six times. The model of each leg including more detailed description of blocks Leg1 up to Leg6 is shown in figure 3. To be more illustrative, we add there also the part of static base platform (BP) as well as moving platform (MP).
The leg or guiding chain is composed from upper universal joint (UJ) with 2 DOFs, body of linear actuator itself containing drive unit and linear transmission unit with 1 DOF and bottom spherical joint (SJ) with 3 DOFs (composed from universal joint and additional revolute joint) connected to the moving platform. The same structure is represented by block schema created in Matlab/Simulink (Figure 3, right side). For connection with external objects outside the leg are used Connection blocks on both sides. The control of guiding chain motion is provided by INPUT block called "Acting intervention" where is coming the data from control system. Contrary, for monitoring of leg behaviour are used OUTPUT blocks "Position" and "Velocity".

Model of hexapod mechanism
By multiplication of one leg block model six times, we can get the final model of hexapod mechanism (see Figure 4). We would like to highlight that the orientation of block schema is upside-down regarding to the real inverted configuration of the hexapod prototype (moving platform is in top). The model of one leg is "covered" under each block labelled as Leg no. 1 to 6, and it should be opened double-clicking over it. For data exchange between other levels are used the above mentioned INPUT and OUTPUT blocks. In Figure 4 is shown the hexapod block diagram. Lower red rectangle highlights the chain of blocks, which represents the fixed frame of hexapod (static upper platform).
The upper red rectangle describes the moving platform including the end-effector. Between the fixed frame and the moving platform are located six guiding chains (extendable struts composed from linear actuators). They must be linked properly to other objects. Env block must be connected to the block Root Ground due to machine settings. It is actually a machine environment that lets you view and change the mechanical environment. There can be set the gravity into the three-dimensional environment. When you click on a block MP a window of basic settings of moving platform will appear.

Model of control system, interface and PID controller
To complete the functional simulation model of mechanism hexapod we need to prepare not only the model of the mechanism itself, but also the model of control system, PID regulator and communication interface.

Model of hexapod with control system and I/O features
The block model of whole hexapod control system was designed as the schema composed from three particular blocks -block of hexapod mechanism, block for trajectory input and calculation and block of PID regulator. Besides these components there are used some peripheral blocks, as for example Graphic output for output parameter monitoring and graph plotting, position sensor and connections. Block model ( Figure 5) represents also the interface for control of whole Simulink model of hexapod. According to this block model we can see, that the behaviour of entire hexapod mechanism is controlled by PID regulator along the trajectory generated by module Trajectory calculation. As the main control parameter is used Acting intervention signal (ActingIntv) continuously send from PID regulator to hexapod block.

Model of PID controller
A proportional-integral-derivative controller (PID controller) is a control loop feedback mechanism A PID controller continuously calculates an error value as the difference between a desired setpoint and a measured process variable and applies a correction based on proportional, integral, and derivative terms (denoted P, I, and D respectively). In our case its function is to control the motion along the desired trajectory with desired velocity to be stable with minimum position and velocity error or deviations. The Stewart platform model use a simple PID controller and Joint Sensor blocks to measure motion. The simplest implementation of trajectory control is to apply acting intervention to the actuator proportional to the motion error. PID feedback is a common form of linear control.

Model of interface for trajectory input and calculation
The last element of designed model of control system for hexapod mechanism is the interface for trajectory input and calculation (Figure 7) labelled also as Trajectory calculation. Thanks to this model we can easily generate the shape and parameters of desired trajectory which we want to navigate hexapod along. coordinates of the TCP point (placed on moving platform with the end-effector) while the blocks X Angle, Y Angle and Z Angle allow us to control the angular motion of the moving platform in all three coordinates. As an example are in Figure 7 the blocks X Pos and Y Pos are replaced by other sources of input parameters, concretely by the block with equation of circular motion. Block EulerXYZ calculates the final rotation matrix corresponding to the orientation of the moving platform. Block body_pts represents the moving platform with 6 three-dimensional values -the joints. The block Product will produce the final transformation matrix which is composed from two input matrices EulerXYZ and body_pts. The block Nominal Leg Length calculates the length of each leg.

Simulation results and verification of designed model
The functionality of designed Matlab/Simulink model of mechanism hexapod was verified on initial simulations. We have chosen the circular trajectory with a radius of 5 cm along which was moving the tool end point with moving platform and the spindle for the first functional tests. Simulation results are shown in Figures 8 and 9. Consequently the model can be used to carry out vide variety of simulations, different motion analysis, simulation of different regulation methods for drive units, influence of controller settings, or control stability during idle or under load. After these preliminary tests we plan to verify the shape and dimensions of generated workspace with its 3D model designed by other simulation software as well as to simulate the distribution of hexapod mechanism properties along such workspace.
At the authors' workplace there was designed the prototype of machine tool with hexapod kinematic structure during the last couple of years. Hexapod can be considered as a general parallel mechanism with complex mobility because it produces motion in all 6 DOFs.
The main aim of this article was the design of simulation model of mechanism hexapod in software Matlab/Simulink. The designed model is composed of individual function blocks arranged to the block schema and mutually connected by suitable links. Besides the kinematic structure of entire mechanism the model contains as well as the control system, PID controller and interface for trajectory data input. The functionality of designed model was verified on preliminary tests with motion along circular trajectory.
The simulation model can be consequently used to carry out vide variety of simulations, different motion analysis, simulation of different control methods for drive units, controller settings with respect to minimizing the output positioning error, or simulation of control system stability during idle or under load. For the future work we plan to continuously improve the designed model and extended it by more detailed model of electromechanical linear actuator to get more precise results closer to the real mechanism.