## 1 Introduction
applied MPC in nonlinear systems, and proved it is highly effective by comparing it with the traditional feedback control method [21]. [PERSON] and [PERSON] proved that the dynamic matrix control algorithm, which belongs to MPC, can be used in the fast embedded system, with MPC satisfying the real-time requirements, and can achieve rapid response [22]. [PERSON] et al. and [PERSON] et al. presented a decentralized model predictive controller for different nonlinear systems [23; 24]. All these studies offer a framework of control strategies based on OCM. Some studies are discussed below that use OCM to solve the trajectory planning problem of manipulators. [PERSON] and [PERSON] firstly worked on the minimum-time optimal control problem (OCP) for manipulators in 1971; their research [25] linearized the motion equations for the system so that they could simplify the highly nonlinear dynamics system and used the Pontryagin minimum principle to obtain an approximation of the minimum-time control. [PERSON] solved the minimum-time manipulator control problem, the path of which is specified, and the actuator torque limitations of which are known. This method finds the bang-bang switching structure and finds the optimal open-loop torques [9]. In 1988, [PERSON] gave a non-academic, highly nonlinear model of a commercially available robot [26]. [PERSON] used this model with a hybrid approach that combines a direct collocation method (DCM) and an indirect multiple shooting method to solve optimal point-to-point trajectory planning problems of robotic manipulators in the mid-1990s [27]. At this time, the optimal control method was firstly applied in three-axis robotic manipulators. In 2010, [PERSON] developed the DCM and published an open-source solver PSOPT [28]. The work of [PERSON] in 1988 was included in the example set of PSOPT. [PERSON] published an introduction to help others solve trajectory planning problems using DCM in 2016 [29]. It is said in [27] that the most difficult part in describing an OCP is to give the expression of the state equations of a complex dynamic system, which are generally called the right-hand-side (RHS) equations and written as:  
\[\dot{\mathbf{x}}=\mathbf{f}(\mathbf{x},\mathbf{u},t), \tag{1}\]  
where \(\mathbf{x}\) and \(\mathbf{u}\) refer to the states and the controls in a dynamic system; function \(\mathbf{f}\) generally refers to the forward dynamics of the system. As has been said in [27], the dynamics behavior of the manipulator is given either explicitly by the output of a symbolic computation system, or in an efficient implicit form of the RHS equations by the subroutine R3M2 SI [30]. However, the RHS equations become more and more difficult to express as the degree of freedom of robotic manipulators increases. The work of [26] derived the explicit RHS equations of a three-axis manipulator; the work of [30] presents a general method to describe the RHS equations of manipulators wit hat tree structure in an implicit way, and the subroutine R3M2 SI is an instance of this method applied to a three-axis manipulator. However, the RHS equations of six-axis manipulators are still tough to work out, and there is no research solving the OCP with the RHS equations of six-axis manipulators. This research introduces Functional Mock-up Unit (FMU) to overcome the difficulty. Modelica is a modeling language, which builds models that can instead use the RHS equations. The Modelica model is defined as an FMU which can be regarded as a black-box function. Moreover, a standard interface criterion FMI (Functional Mock-up Interface) [31] is applied to call any specified variables in the Modelica models. Therefore, we can use the Modelica model to construct the dynamics of manipulators and call the model with FMI in an implicit form of the RHS equations. In this way, the OCP described in PSOPT with the RHS equations expressed by FMU can be solved. The solutions of the time-optimal trajectory planning problem of both three-axis and six-axis robotic manipulators are given in this paper.