HIL Simulator of Drives of an Industrial Robot with 6 DOF

1 Abstract —The paper deals with design of a Hardware-in-the-Loop simulator of an industrial robot with six degrees of freedom. The robot is driven by industrial frequency converters of the SINAMICS S120 type. They communicate via CAN bus with the master control system RT-LAB executing control algorithms in real time. Such a complex task combines information from mechanics, electric drives, control theory, robotics, programming, and a deep knowledge of a frequency converter control structure. Proposed algorithms are verified experimentally and the resulting time responses show good agreement with expected results.


I. INTRODUCTION
A standard industrial robot generally does not enable open access into its control system.For a user it presents a kind of black-box where the user cannot change the robot program.For development of robot algorithms and also for teaching purposes it is often required that the control algorithms should be known and modifiable.This can be achieved by introducing a Hardware-in-the-Loop (HIL) simulator [1] and connecting it to the robotic system (more exactly -to robot drives).Here, the mechanical part of the robot remains unchanged and the power section is replaced by fully configurable converters supplying the motors that are controlled by a computing system performing calculations in real time.
Solutions of systems with HIL are already well knowna complete overview for field of electrical drives is shown in [2]; so let's concentrate on the HIL method application for drives in robotics.Authors in [3] present development of algorithms for HIL simulator of a robot Qbot with navigation in space with obstacles and serving for educational purposes.Control algorithms are programmed in MATLAB/Simulink.The work [4] relates creation of a working model for robotic arm that is used for operation on a base space station.In order to reduce the risk of system failure in the space, each algorithm is verified by a HIL simulator under all operating conditions.
The paper [5] deals with control of a parallel structure of robotic legs with 6 DOF.The walking robot is controlled from a real time system RT-LAB and QNX software is programmed in MATLAB/Simulink.
Various robust and adaptive control strategies dealing with non-linearities and uncertain behaviour of robotic manipulators were reported in [6], [7].The ref. [8] reported optimization strategies for industrial robots with the goal to improve their overall performance and their accuracy in the robot with open control structure.
Our paper takes advantages of HIL simulation and utilise standard features of industrial drives -a direct access into control circuit.For our work we have used feed-forward control of the robot drives with compensation of the torque calculated by inverse dynamics network.
In order to concentrate on description of the real-time control system of the HIL, we have omitted derivation of direct and inverse kinematic models as it is a standard task in robotics.After a short introduction of the robot system we describe used HW and SW parts, communication within the control system, control circuits of the drives, mention generating of desired trajectory and its solution within the system and finally we present brief experimental results.

A. Industrial Robotic Manipulator
The system under consideration is an industrial robotic manipulator SEF ROBOTER SR25 [9] (Fig. 1) with six rotational joints and six degrees of freedom (DOF), where original control and power sections were replaced by components of the SINAMICS S120 series by Siemens, [10] For an idea of the robot size: the mass of whole robot is 480 kg, and the effectors can carry the loads up to 25 kg.
Based on kinematic structure of the robot (Fig. 2) with 6 joints q1-q6 we have developed the model both of direct kinematics and of the inverse kinematics.Solution of inverse kinematics task is seldom to be found in a closed form because it usually requires solution of nonlinear equations.Therefore, for finding a solution of the vector of joints' coordinate system from nonlinear algebraic equations at the defined end position and orientation of the end effector, we have used a numerical method.
The quality of the control of the robot end effector depends on precise identification of static (kinematic) and dynamical parameters of the robot, as well as on precise control of joint drives, which will be described in the following chapter.

B. Drive System
For driving the manipulator six permanent magnet synchronous motors of the SIEMENS 1FK6 type are used.Their basic parameters are listed in Table I.Each motor is equipped with a gear.The power ratio for each particular axis (from 1 -6) is: 1:80; 1:120; 1:108; 1:76.5;1:100.5;1:92.2.The position is sensed by resolvers.The power section is equipped with frequency inverters SINAMICS S120 that in combination with the motors present modular motion control drives that are suitable for high performance drive applications.Herein, the term modular points to the fact that the converter can be composed according to the customer requirements in terms of the required power, number of actuators, or kind of communication with the master system.The power section itself contains a regenerative DC-link with uncontrolled output voltage of 540 V supplying six inverters.Parameterisation of the inverters is done via PROFIBUS bus through the PCMCIA card CP5512 with the parameter setting tool Starter PC.The drives are set up for vector control of the motor speed.

III. CONCEPT OF ROBOTIC HIL SIMULATOR AND ITS FUNCTION
The control structure of the robot consists of three parts (Fig. 3): the Host PC, target PC and control system.The precompiled control code is loaded into the target computer (Target PC) in which a real-time operating system (RTOS) QNX is running.RT-LAB ™ QNX® Neutrino® RTOS is a full robust real-time operating system that meets performance criteria of embedded systems.The modular architecture enables creation of optimized and reliable systems while minimizing costs.RTOS is designed in such a way that the processed information flows continuously, without any time delay.As a result, particular time-critical tasks are carried out according to the priorities within precisely defined time intervals.
Communication between the client and real-time computer runs over Ethernet.This is used for transmission of control commands from the console and for monitoring the data that are obtained from the real-time system.Between the real-time system and the control unit of frequency converter a cyclic exchange of packets over the CAN bus is continuously running.Outgoing packets are used for controlling the inverter and incoming packets enter the control structure of the robot.The control unit processes incoming messages and according to chosen configuration and control structure it controls the inverters via bus DriveCLiQ.The control unit also processes actual speed and position obtained from the encoder.The speed and torque references are sent through the CAN bus into every drive.On the other side, through the bus are obtained actual values of position, speed and drive status.

IV. CONTROL STRUCTURE OF THE DRIVES AND TUNING OF
THEIR CONTROLLERS For own control of the robot drives a structure with cascade controller is used that contain an adaptive PI speed controller with torque limiter (Fig. 4).
The output of the speed controller (reference torque) is added to the calculated torque from the dynamic model and is converted to the reference current.The signal is filtered by a filter with small time constant in order to remove a noise from the measured current and input into the PI current controller.
Finally, the voltage references are modulated by pulsewidth modulation (PWM) and fed into the motor.Such control structure is defined by the frequency converter and can be changed only with limitations.
Each converter has an implemented routine for identifying the supplied motor.As we used standard motors from Siemens, they are present on the list of predefined motors, which considerably facilitated the task of parametrisation.
Quality of control of each drive system was tested at linearly increasing reference value of the speed.Just choose the first drive responses drive for illustration.Figure 5 shows the time response of the actual speed of the 1 st first axis drive to the linearly increasing reference signal.The curves are merged -the actual speed corresponds to the speed reference value, the difference is negligible.In the speed time response we have observed small periodic oscillations.They are caused by elastic coupling between the motor, gearbox and the driven mechanism.
Figure 6 shows corresponding time responses of the current reference and actual current of the 1 st drive.Again, both traces correspond mutually.
The converters parameters must be set up properly for the designed control structure.The process covers setting the topology of the used HW components in the power section.

V.POINT TO POINT INTERPOLATION OF THE DESIRED TRAJECTORY
The desired trajectory of the effector should run through the points which the end-effector has to pass.In order to smooth the curve, the desired trajectory are usually interpolated by a higher degree polynomial (or by Bezier-curves like it was reported e.g. in [11]).Fig. 5. Time response of the speed of the 1 st axis drive to changes in speed reference value with linearly increasing signal.Scale: vertical axis -speed scale <-600, 600> rpm, horizontal axis -time scale 3900 ms.For case of simplicity we have used interpolation by the 5 th order polynomial (otherwise there could have aroused problems with the solution of the inverse kinematics iterative method).The interpolation will ensure that the required vector of the position, speed and acceleration will be achieved within a predefined time interval.
The interpolation algorithm was implemented into the Target PC.The flow chart of the program for interpolation trajectory is shown in Fig. 7.The program calculates coefficients of the polynomial interpolation of the positions in the Cartesian coordinate system Its first derivation gives interpolation of the speed a polynomial of the 4th order) and its second derivation describes the acceleration (corresponding to the 3rd order polynomial).
The interpolation algorithm runs cyclically in the Target PC according to the program shown in flowchart (Fig. 7).The interpolated values are fed into the controllers for further processing and also into the feed-forward dynamic model.
After the interpolation is executed, it is checked whether there is another point for the program to calculate until it the algorithm is terminated when the final point of the trajectory is reached.

VI. VERIFICATION OF THE RESULTS
The robot performance was tested using a continuous trajectory of the end effector trajectory passing through the pre-set points (trajectory nodes).Their position in the 3D space is listed in Table II.The trajectory path in 3D space is shown in Fig. 8.
The rotation of the end effector in the trajectory points was also prescribed (last three rows of the table).From the trajectory path using the inverse kinematics calculation the reference signals for position of the drives are obtained and they are led into the control circuits of the drives (shown in Fig. 4).
The time responses of each joint drive are presented in following figures: the positions in Fig. 9 and the speeds in Fig. 10.The actual values of the variables (speeds and positions) correspond to the calculated reference signals and therefore only the time courses of measured variables are shown here.
A good agreement among position reference and actual position of each joint for the trajectory from Fig. 8 is shown in the graph (Fig. 11).The time responses show a good precision of the designed control and drive system -the maximum error reaches values several hundredths of degree.

VII. CONCLUSIONS
The described HIL system is an open system where the user has free access to control signals starting from the host system up to own control loops of the drive itself and he can modify them according to his needs.This presents a principal advantage towards commercial robotic systems.
Another advantage of the presented solution dwells in proposing a completely new HIL configuration at an affordable price.Thanks to the MATLAB/Simulink/RT-Lab it allows easy development and fast verification of the proposed control algorithms on level of the robot controller.
The system is not limited by the number of robot axes.There are no problems to integrate such controlled robot into any workstation.In addition, the SINAMICS converters are accompanied with high quality and detailed documentation that, together with BICO permits accessible control interventions on level of the robot drives.

Fig. 3 .
Fig. 3. Block diagram of the HIL simulator of the robot.1.The Host PC implements basic monitoring and control functions, which in terms of time are not critical and functions only as a user interface for the operator.2. The Target PC performs time-critical operations on higher level of control and ensures communication with the drive within time interval period of 2 ms, which presents the maximum achievable communication speed.The tasks include algorithm of reading points in 3D space, floating interpolation by a polynomial of the fifth order, iterative process of solving inverse kinematics, dynamic feedforward torque of each motor, and calculation of position control algorithm within the control loop.3. The control system uses the control unit SINAMICS CU-320 DP extended by a communication card CBC 10 allowing communication over CAN.The communication between the modules and the control unit runs via bus DRIVE CLiQ.Connected to the control unit are also six SMC10 sensor modules for resolvers.Within the Host PC, a programming environment of the robot control (MATLAB/Simulink) is installed.Developed and suitably modified control law is precompiled by RT-LAB™.This software presents a decentralized platform developed by OPAL-RT Technologies Inc., which allows simulations of engineering systems in real time.Note, that the software allows user to work with models from MATLAB/Simulink and CarSim RT, Dymola and others and that it enable to import programs written in Fortran, C and C ++ languages.The precompiled control code is loaded into the target computer (Target PC) in which a real-time operating system (RTOS) QNX is running.RT-LAB ™ QNX® Neutrino® RTOS is a full robust real-time operating system that meets performance criteria of embedded systems.The modular architecture enables creation of optimized and reliable systems while minimizing costs.RTOS is designed in such a way that the processed information flows continuously, without any time delay.As a result, particular time-critical tasks are carried out according to the priorities within precisely defined time intervals.Communication between the client and real-time computer runs over Ethernet.This is used for transmission of control commands from the console and for monitoring the data that are obtained from the real-time system.

Fig. 6 .
Fig. 6.Corresponding time response of the current of the 1 st axis drive to changes in speed reference value with linearly increasing signal.Scale: vertical axis -current scale <-4, 4> A, horizontal axis -time scale 3900 ms.

Fig. 8 .
Fig. 8. Course of the end effector trajectory in 3D space.

Fig. 9 .
Fig. 9. Time responses of measured (actual) positions of the joints q1 -q6 for the trajectory shown in Fig. 8.

TABLE I .
BASIC PARAMETERS OF THE ROBOT DRIVES.

TABLE II .
POINTS OF THE END EFFECTOR TRAJECTORY.