A New Type of Industrial Robot Trajectory Generation Component Based on Motion Modularity Technology

Motion modularity is the main method of motion control for higher animals. at means the complex movements of the muscles are made up of basic motion primitives, and the brain or central nervous system does not care about the specific details of the movement. However, the industrial robot control system does not adopt the technical roadmap of motion modularity, it generates complex trajectories by providing a large number of sampling points. is approach is equivalent to using the brain to directly guide the specific movement of the muscle and has to rely on a faster Fieldbus system to obtain complex motion trajectories. is work constructs a modularized industrial robot trajectory generation component based on Dynamic Movement Primitives (DMP) theory. With this component, the robot controller can generate complex trajectories without increasing the sampling points and can obtain good trajectory accuracy. Finally, the rationality of this system is proved by simulations and experiments.


Introduction
Motion modularity is an idea of decomposing complex motion into simple motion modules. at means complex motions are composed of some motion primitives. Studies in motor neuroscience have shown that the nervous systems of higher animals are controlled by a modular approach. e central nervous system achieves coordinated control of multiple muscles and multiple joints by combining modules that represent basic motion [1]. Neuroscience research on motion modularity has achieved many results in muscle synergy [2], motion primitive understanding [3], motion pattern learning [4], and motion modeling [5].
Since higher animals rely on modular methods to complete motion control, motion modularity technology should also be the future of robot control. However, currently the robot control system does not adopt the motion modularity technology roadmap, it adopts another centralized control technology roadmap which enhances the capability of Fieldbus to improve control effect. We will introduce this in detail in Section 3. Actually, scholars in the field of robotics have conducted long-term research on motion modularity. Professor Roger Brockett of Harvard University first proposed this idea in robotics. He pointed out that the motion of robots has the characteristics of the hybrid system, and can drive a robot to generate continuous motion by symbol string and real-valued functions. He proposed Motion Description Language (MDL) method [6,7]. A er that, Motion Description Language was combined with the dynamic system to establish a control method for the inverted pendulum choreography robot [8]. MDL has been applied in teleoperation system [9]. Since then, MDL has also been applied to the trajectory planning and control of mobile robots [10]. Based on the function decomposition theory of Hilbert space, this work decomposes the trajectory of the robot to obtain the motion primitives. e modular trajectory is sent to the mobile robot and good results are achieved. is method has been promoted and applied to the control of the industrial robot via mapping the robot joint trajectory to the motion primitives by function space decomposition [11]. en, a small number of motion primitives are sent to the robot joint and the joint reproduces the trajectory by combining the primitives. rough this technology, the purpose of not reducing the accuracy of the trajectory but reducing the real-time communication frequency of the robot is realized. However, this method has problems such as insufficient generalization ability of the motion primitives and the unstable number of primitive elements, and it cannot be deployed in the actual industrial robot control system. In this paper, the Dynamic Motion Primitive (DMP) technology is used to expand the MDL method, and the shortcomings of the previous work are solved. In the past, the DMP method was mainly used for imitative learning of robots which was on the task level. To reduce the data without compromising the accuracy of trajectory, the novelty of this work is that we apply the DMP method on the level of joint trajectory generation firstly based on the motion modularity idea and a new industrial robot trajectory generation component is added to the industrial robot controller. e following chapters will first sort out the Dynamic Motion Primitive theory, and then elaborate on the industrial robot trajectory generation component based on the motion modularity technology. Finally, the corresponding simulation and experimental results are introduced.

Basis of Dynamic Movement Primitives
e Dynamic Movement Primitives (DMP) method was first proposed by Professor Stefan Schaal of the University of Southern California and is a method for robot trajectory control and planning. is method improves the generalization ability of the robot motion primitives and can regress the trajectory better. It has many applications in the research of robot imitative learning [12], human-robot collaboration [13], and human motion modeling [14]. Besides, this method has been applied to neurosurgical science research by scientists, shows how movement primitives can be used to learn appropriate muscle excitation patterns and to generalize effectively to new reaching skills [15]. is achievement combines the study of motion modularity in neuroscience and robotics. e basic idea of the DMP theory is to use a relatively simple and stable system to parameterize the expression of complex trajectories and then adjusts the system through a nonlinear function, so that the trajectory of the system exhibits the desired characteristics. It inherits the advantages of linear systems: convergence to the attracting domain, robustness to interference, and time independence. e addition of a force function allows the system to generate arbitrary motion trajectories. ere are two main types of DMP models: discrete and rhythmic [16]. Discrete systems are based on attraction points and rhythms are based on limit cycles. e trajectory of the robot manipulator is essentially a mapping from time to robot configuration. In the actual system, it is a discrete motion through numerous intermediate points. erefore, the discrete DMP is selected as the basis of manipulator trajectory control.
e DMP system consists of two parts: a second-order system and a force function system. e second-order system produces a basic motion that converges to the target location. In the control of electromechanical systems, most of the models can be described by the spring-damping model. erefore, we use the spring-damping model as the basic second-order system in the DMP. e force function is a supplement to the second-order system and is used to fit the motion pattern of the original trajectory by producing an arbitrarily smooth motion trajectory. Using the spring-damped system to construct DMP, we can get the basic equations of the DMP system: In the basic equation, the force function 푓(푡) is essentially a function approximator that uses some regression method to approximate the original trajectory. e DMP system is made to converge to a given target while producing a trajectory that satisfies the requirements and is sufficiently smooth. However, it does not ensure that the system converges to the target point a er the force function is added to the basic equation. erefore, a gating term should be added that makes the force function converge to 0 while the system reaches the target . e first-order system 푠 = −훼푠 has such a property (Figure 1), so it is considered to use the variable as a gating term. In addition, the force function 푓(푡) is a function that depends on the system time; it is not a time-independent autonomous system. We should make the force function an autonomous system that does not depend on the system time . erefore, the independent variable of the force function can be replaced by the of the gating term. e entire force term can be expressed as 푠 푓(푠). us, a complete DMP system can be expressed in the form of the following equation: Among Equation (2), and are the spring rate and damping coefficient respectively related to the spring system, indicates the target position of the system, , , 푣 are the system position, velocity and acceleration states respectively. e parameter is a scaling factor that controls the speed of motion. 푠 푓(푠) is the force function with gating term and represented by a phase parameter. e forced function 푓(푠) is a function approximator that uses the regression method to approximate the original trajectory. ere are many algorithms of function regression that (2) can be summarized into two unified models, which are mixture of linear models (3) and weighted sum of basis functions (4) [17].
In this paper, we use the local weighted regression (LWR) algorithm that belongs to the mixture of linear models to approximate. According to the characteristics of the LWR algorithm and the DMP system, the unified model can be simplified, and the specific expression form of the function approximator is obtained: where is a standard Gaussian function: is the center of the Gaussian function, and is the width of the Gaussian function, which is a known parameter given in advance by the user. e entire DMP system only has the weight parameter which needs to be solved by prior data.
To solve the optimal parameter of the system, we need to pre-plan the end-effector trajectory of the manipulator according to the task requirements, and then calculate the reference trajectory of the robot joint according to the kinematics and dynamics model of the robot. A er that, the sets state point data 푦 ,푦 ,푦 are sampled on the trajectory with a fixed sampling period. Finally, the sampling point data are substituted into the original system equation, and the force function can be obtained.
According to the above Equation (7) and the force function selected to find the optimal weight of the system among it At this point, the theoretical preparation of the DMP controller is completed. Figure 2 shows the whole process of DMP algorithm from the training of motion primitives to the implementation.

Trajectory Generation Component Based on Motion Modularity Technology
is section will take an actual robot control system as an example to analyze the traditional industrial robot control system in detail. Figure 3 shows the SIA-SmartPainting, a painting system for vehicle maintenance developed by our team. Its controller is a typical centralized industrial robot control system. e system visually models the car's door, generates a paint path in the upper controller and performs interpolation operation, then sends intermediate points of trajectory to the joint through EtherCAT bus. According to the characteristics of the robot control task, the robot control system can be divided into four levels from top to bottom: planning layer, trajectory layer, communication layer, and joint layer. At the planning layer, the SIA-SmartPainting system visualizes the painted door to create a motion path of the robot's end-effector. e trajectory layer performs operations such as inverse kinematics, trajectory interpolation, and time parameterization. It maps the path in Cartesian space to the joint space and adds time parameters. It also plans reasonable velocity and acceleration through interpolation and optimization algorithms. A er obtaining the reference trajectory of the joint space, the relevant data are transmitted to the communication layer, and the intermediate point of the reference trajectory is sent to the joint layer by the Fieldbus system of the communication layer. Since the communication layer is a real-time component, the closed-loop control of the manipulator is also carried out in this layer. To ensure the smoothness of the trajectory and the stability of the spray gun while painting operation, the communication layer needs to perform closed-loop control of the position and speed of the joint. To improve the communication rate, we adopt the high-speed EtherCAT bus, and the real-time communication frequency can reach 1 kHz, that is, the communication layer performs closed-loop control with a period of 1 ms. e bottom layer of this control system is the joint layer. is layer receives the reference signal sent from the Fieldbus, controls the joint motor motion according to the reference signal, and feeds the motor status to the upper controller in real-time.
rough the detailed analysis of a typical industrial robot control system, we can find that the control system of an industrial robot is mainly composed of two kinds of hardware: the upper controller and the joint motor driver. e upper controller is responsible for the control of the whole robot arm and the joint motor driver is responsible for the motion control of the joint motor. e two parts rely on the Fieldbus system to communicate. In the traditional industrial robot control system, the path of the robot is generated in the planning layer; the trajectory layer is responsible for the inverse kinematics and interpolation calculation; the communication layer sends the reference points of the trajectory to the joint in real-time; the joint layer is the motor control unit, which controls the specific motion of the joint motor according to the reference signal. is control system is essentially a discrete control which discretizes the joint's trajectory and then sends the discrete intermediate points of trajectory to the joint controller. e characteristic of this system is that all the motion details Journal of Robotics 4 Fieldbus determines the accuracy of the trajectory. In connection with the idea of motion modularity, we hope to establish a modularized trajectory generation component. is component, with motion primitives in joints, can improve the trajectory accuracy and the performance of the robot without increasing the sampling points and communication rate.
of the joint are generated by the upper controller, and the joint itself is only an execution unit without any autonomy. is kind of control system is a centralized structure. Under this structure, if we want to improve the trajectory accuracy of the robot, we need to increase the number of sampling points of the interpolation point, and the communication rate of the  system. is new system first precalculates the robot trajectory and then trains the basic DMP motion primitives with the obtained trajectories in advance. A er obtaining the optimal parameters, we deploy these primitives to the joint driver. When the robot is running, the joint itself calculates the feedforward information of the trajectory via motion primitives. e upper controller only needs to control the position of the joint trajectory at a very low frequency, so that an accurate and smooth trajectory can be obtained. is system implements the control that is feedforward and supplemented by feedback. Figure 5 shows the similarities and differences a er adding the new trajectory generation component to the robot control system. e hierarchy is similar, but there are differences in ere has been a lot of research on modular robots, but the current modularity mainly refers to modular joints, which are modular in mechanical and electrical aspects. at is to say, only hardware is modular and there is no so ware modularity currently. We hope to use motion modularity technology in the structure of the system, such that the motion is generated by the motion primitives. erefore, we have made a trajectory generation component based on the DMP theory that generates motion in a modular way, improves joint autonomy, and achieves good motion performance without transmitting a large number of intermediate points of the trajectory. As can be seen from the structure diagram ( Figure  4), the modularized system has one more component for DMP model generation and analysis than the traditional control Journal of Robotics 6 trajectory sampling and control with a period of 1 ms. The advantage of this new method is that the reference trajectory is generated autonomously by the joint, and the upper controller can greatly improve the control period. For example, the joint's position loop can be controlled with a period of 10 ms, but the trajectory accuracy and smoothness can also be realized. Figure 6 shows the relationship between feedforward and feedback of this kind of control strategy. With the modularized component, the robot control system can complete complex trajectory with a small number of sampling points, achieve the control effect of high-speed Fieldbus with the low-speed Fieldbus, and improve the accuracy of the trajectory without increasing the real-time data.

Simulations
To verify the feasibility of the trajectory generation method in the robot control system, we need to simulate the system at first. e simulation environment is built by V-REP and MATLAB platforms. V-REP is a robot integrated simulation environment with the robot and environment model. We can quickly develop and research robot algorithms through embedded scripts, plug-ins or remote APIs [18]. e V-REP contains the dynamics engine that supports the Unified Robot Description Format (URDF) file. Importing a URDF file with the dynamic characteristics and inertia information of the robot, the robot can be dynamically simulated and the joints can be controlled. e developer can also directly adjust the joint PID parameters. We will simulate the robot body and joint driver through V-REP. e user can operate robot joints and obtain feedback by calling V-REP's Remote APIs in MATLAB. erefore, we write a program to simulate the robot's controller in MATLAB.
is simulation uses the SIA-SmartPainting robot model as the analysis object, and controls the robot to reproduce the four types of end-effector trajectory in different ways (Figure 7), then compare and analyze the relevant characteristics. e specific versions of the simulation so ware are V-REP 3.5 and MATLAB 2014a. e simulation adopts the synchronous mode of V-REP, the simulation period is 5 ms. Programs are written in MATLAB which are applied to both traditional and modularized system architectures: the specific functions of each layer. e planning layer is no different from the traditional controller and is still responsible for the path planning. e trajectory layer is responsible for the trajectory solving tasks and the generation of motion primitives. Specifically, this layer should calculate the reference trajectory of the joint space according to the optimization index of the system and the kinematics and dynamics model of the robot. en generates a DMP model based on the previously obtained trajectory to complete the mapping from trajectory to motion primitives. e communication layer is responsible for deploying the motion primitives to the robot joint driver in advance.
us, during the motion of the manipulator, the joint driver can generate a feedforward signal of the trajectory according to the predeployed motion primitives.
Traditionally, to obtain a highly accurate and smooth trajectory, the upper controller generally performs reference   Table 1 shows the weights of force function in different tajectory type. Table 2 shows the analysis of the simulation results and Figure 8 shows the position curve of the robot in Cartesian coordinates. In the four sets of simulations, the robot used the same joint PID parameters. It can be seen that adopting the modularized architecture, better control effects can be obtained with the same control period and the same amount of data. Simulation analysis proves the feasibility of the trajectory generation component based on DMP technology.

Experimental Platform.
In order to verify the practical ability of the motion modularity technology in the industrial robot control system, we built a principle verification experimental platform consisting of an upper controller and a joint motor driver (Figure 9). e hardware of the upper controller is an computer with a real-time Linux system. e so ware system is mainly based on ROS and has been developed packages such as trajectory generation, DMP calculation, and communication. e trajectory generation package is developed based on the pilz industrial robot trajectory generation library [19]. e DMP calculation package is developed based on the DMPBBO calculation library [20]. Figure 10 shows the overall node architecture and information flow of the experimental platform, the blue dashed box indicates the corresponding tool used by the node. e joint driver is based on the STM32 platform and is a brushless motor driver with DMP analysis. In order to improve the processing speed and the stability of the motor control, the driver is divided into two independent parts of low voltage side and high voltage side. Each part is assigned an independent CPU. e high voltage side uses the STM32F303 chip, a chip with an internal integrated amp unit which is very practical and suitable for motor control applications. e chip is responsible for sampling armature current and PWM generation. e low voltage side is responsible for control and operation, which is handled by an STM32F405 chip. e F4 chip contains a floating-point arithmetic unit, which can provide good support for mathematical operations. erefore, the brushless motor FOC control, PID calculation, and DMP analysis are performed on the low voltage side. Figure 11 is a (1) Traditional architecture: is scheme is applied to the control system of the traditional architecture. e upper system controls the position loop of the joint with a control period of 50 ms and there is no modularized tajectory generation component on joint.
(2) Modularized architecture: is scheme is applied to the control system of the modularized architecture. e upper system controls the position loop of the joint with a control period of 50 ms and there is modularized tajectory generation component on joint. e joint is simulated at the period of 5 ms to generate feedforward signal for the position and velocity loops.
In order to make a quantitative analysis of the reproducibility of the trajectory, we define the pose error of the endeffector trajectory. Since the pose matrix of the robot belongs to the Special Euclidean Group 푆퐸(3), which is not closed to addition, it is considered to map the end pose matrix to the corresponding Lie Algebra 푠푒(3) for error analysis and comparison. Let the desired pose matrix be , and the actual matrix of trajectory is , so that the actual trajectory points are in one-to-one correspondence with the desired trajectory points. en the error of the i-th point on the trajectory is defined as: at is the two norms of the difference between the two Lie Algebras. us, we can define the Root Mean Square Error (RMSE) of the two trajectories: Journal of Robotics 8 system, and then the trajectory data of each joint are collected. We use the joint trajectory data collected in the simulation environment to train the DMP model. A er that, we send the parameters to the joint driver in advance. e joint motor driver stores the motion primitives a er receiving the DMP's parameters. As soon as the target point is sent to the motor driver, the motor begins to run. During the motion, the upper functional diagram of the driver unit. Figure 12 is the joint motor driver based on STM32.  be seen that the system achieves a good reconstruction of the trajectory. is experiment proves the effectiveness of the modularized control system for industrial robots.

Experimental
6. Discussion e current industrial robot control systems are centralized, and the upper control system is responsible for all the details controller controls the position loop of the motor in a period of 50 ms, which is longer than the joint feedforward given period (feedforward period is 5 ms). In the middle of the two control signals, the CPU on the low voltage side of the driver calculates the motion feedforward values (position, velocity, and acceleration) in real time. ese feedforward signals are inputs of the corresponding control loop of the driver.
Since we cannot show the results of every joint, we only show the typical trajectory curves of joint 2 (Figure 13) of the motion, just as humans use the brain to guide the motion of each muscle. However, neuroscience research has shown that higher animals generate and control motion in a modular manner. erefore, we hope that the robot control system can also have the same ability of motion modularity, which combining complex motion by simple primitives and improving joint's autonomy. Based on the DMP theory, this work builds a modularized trajectory generation component for the industrial robot controller. Firstly, the method of motion primitive generation is constructed by DMP theory. en the function and benefits of the components are analyzed. Finally, the feasibility of this system is proved by simulation and experiment. e significance of the motion modularity component in practical work can be listed as following: (1) e autonomy of the joint has been improved. e joint automatically generates the feedforward information can greatly reduce the frequency of the feedback control. at means the ability of multirobot cooperation will be improved. For example, on the production line, one upper controller can be responsible for multiple manipulators and the operations are synchronized by the same upper controller. at will make it easier for multi-robot to work together.
is study also has the following shortcomings, which need to be improved in the future: (1) e clock synchronization of the joints has not been considered. Clock synchronization is a key issue in multiaxis control. is work only uses the local clock of the joint itself, and does not have multiaxis clock synchronization. Clock synchronization will be the focus of subsequent research. (2) e characteristics of motion primitives are not delved deeper. Currently the system obtains motion primitives by precalculating the trajectory, without analyzing the characteristics of the motion primitives. We hope to extract the characteristics of the motion primitives, classify them and establish a one-one mapping between primitives and trajectories.
Data Availability e data and all other info used or produced in this project will be available for the publisher.

Conflicts of Interest
e authors declare that there are no conficts of interest regarding the publication of this paper.