# MC_MoveAbsolute(0) 4 th Order Real-Time Trajectory Generation Function Algorithm and Implementation
## 6 Summary  
The article presents, in a step by step manner, the procedure for implementation of a 4 th order trajectory generator that mirrors the MC_MoveAbsolute() function. Due to the straightforward nature of Equations (1)-(75), it is easily implementable in any of the available textual or graphical programming languages for real-time control systems.  
The implementation of the presented algorithm is possible in control systems adhering to the IEC 61131-3 standard (e.g., PLC), and its source code was generated as a result of applying the fast prototyping paradigms, i.e., it was generated from the Simulink model. As an example, generated profiles are given with different parameters (i.e., boundaries). It is also possible to generate motion profiles of lower orders than fourth--the algorithm itself is scalable and following the procedure presented here will lead to obtaining simpler solutions constrained on third or second derivatives.  
The most important contribution of this work is the unique nature of the presented approach, as it allows for practical implementation of this algorithm in commonly used real-time control systems.  
The algorithm presented here is fully parametrized. It can be fully integrated by way of interfaces and its functionality, with other motion control features (i.e., collision avoidance or trajectory generation profile correction). As proposed in this paper, the implementation of _MC_MoveAbsolute()_ is parametrized through its inputs (as it can be found in all functions and function blocks in graphical IEC 61131-3 compliant programming languages). Modularity of the approach enables the user to combine a proposed solution with an extension boom elasticity estimation feature (loader or forestry cranes applications) or dynamic collision avoidance (multi-axis serial robotic manipulators).  
Figure 8: Code fragment generated via Simulink PLC Coder.  
The function presented here can be implemented without any problems in all PLC/PAC-based control systems. The short sampling time (not more than 200 microseconds) requirement is fulfilled by most available control platforms. In the case of PLC/PACs with higher sampling times proposed, the algorithm can be extended with sampling time correction. In other cases, the integer multiple of sampling time requirement needs to be fulfilled by all times for \(t_{0}\)-\(t_{15}\) times in Equation (53).  
Conceptualization, K.P. and M.K.; data curation, M.K.; formal analysis, P.W. and M.K.; funding acquisition, K.P.; investigation, K.P., P.W. and M.K.; methodology, K.P. and M.K.; project administration, K.P.; resources, K.P.; software, K.P.; supervision, K.P.; validation, P.W. and M.K.; visualization, P.W.; writing--original draft, K.P., P.W. and M.K.; writing--review and editing, K.P. and M.K.  
This research was partially funded by: (a) Ministerstwo Nauki i Szkolnictwa Wyzszego, grant number R03 042 02, (b) Ministerstwo Nauki i Szkolnictwa Wyzszego, grant number N N502 336936 and, (c) Marie Curie 7 PR, FP7-PEOPLE-2012-IAPP (Industry-Academia Partnerships and Pathways) grant number 324496.  
The authors declare no conflict of interest.