# MC_MoveAbsolute(0) 4 th Order Real-Time Trajectory Generation Function Algorithm and Implementation
## 3 Fourth Order Position Profile Generation
### Calculation of Time \(t_{d}\)  
The following equations are used for calculation of time \(t_{\overline{d}}\) which covers the duration of a single movement section with applied snap boundary (i.e., its constrained value), as in Figure 4.  
\[t_{\overline{d}d_{\max}}=\sqrt[4]{\frac{\overline{\chi}}{8\overline{d}}} \tag{4}\]  
Rounding up (4) with respect to the sampling time \(T_{s}\):  
\[T_{s}\text{ceil}\left(\frac{t_{\overline{d}d_{\max}}}{T_{s}}\right)=T_{s} \text{ceil}\left(\frac{\sqrt[4]{\frac{\overline{\chi}}{8\overline{d}}}}{T_{s}}\right) \tag{5}\]  
\[dd=\left[\begin{array}{c}T_{s}\text{ceil}\left(\frac{\sqrt[4]{\frac{\overline {\chi}}{8\overline{d}}}}{T_{s}}\right)\\ \frac{\overline{\chi}}{8\left(T_{s}\text{ceil}\left(\frac{4\sqrt[4]{\frac{ \overline{\chi}}{8\overline{d}}}}{T_{s}}\right)\right)^{4}}\\ \end{array}\right] \tag{6}\]  
If the following Equation (7) holds true:  
\[\overline{v}\geq v_{\max}=2\frac{\overline{\chi}}{8\left(T_{s}\text{ceil} \left(\frac{\sqrt[4]{\frac{\overline{\chi}}{8\overline{d}}}}{T_{s}}\right) \right)^{4}}\left[T_{s}\text{ceil}\left(\frac{\sqrt[4]{\frac{\overline{\chi}} {8\overline{d}}}}{T_{s}}\right)\right]^{3} \tag{7}\]  
Then:  
\[dd1=dd \tag{8}\]  
Figure 4: Fourth order trajectory profiles in point-to-point movement (MC_MoveAbsolute).  
Otherwise:  
\[t_{\overline{q}^{2}\text{max}}=\sqrt[3]{\frac{\overline{v}}{2\overline{d}}} \tag{9}\]  
This rounded up with respect to the sampling time (\(T_{s}\)) yields the following equation:  
\[T_{s}\text{ceil}\left(\frac{t_{\overline{q}}v_{\text{max}}}{T_{s}}\right)=T_{s} \text{ceil}\left(\frac{\sqrt[3]{\frac{\overline{v}}{2\overline{d}}}}{T_{s}}\right) \tag{10}\]  
Then:  
\[dd1=\left[\begin{array}{c}T_{s}\text{ceil}\left(\frac{\sqrt[3]{\frac{ \overline{v}}{2\overline{d}}}}{T_{s}}\right)\\ \frac{\overline{v}}{2\left(T_{s}\text{ceil}\left(\frac{\sqrt[3]{\frac{\overline {v}}{2\overline{d}}}}{T_{s}}\right)\right)^{3}}\end{array}\right] \tag{11}\]  
If the following Equation (12) holds true:  
\[\overline{a}\geq a_{\text{max}}=\frac{\overline{v}}{2\left(T_{s}\text{ceil} \left(\frac{\sqrt[3]{\frac{\overline{v}}{2\overline{d}}}}{T_{s}}\right) \right)^{3}}\left[T_{s}\text{ceil}\left(\frac{\sqrt[3]{\frac{\overline{v}}{2 \overline{d}}}}{T_{s}}\right)\right]^{2} \tag{12}\]  
Then:  
\[dd2=dd1 \tag{13}\]  
Otherwise:  
\[t_{\overline{d}}a_{\text{max}}=\sqrt[3]{\frac{\overline{a}}{\overline{d}}} \tag{14}\]  
This rounded up with respect to the sampling time (\(T_{s}\)) yields the following equation:  
\[T_{s}\text{ceil}\left(\frac{t_{\overline{d}}a_{\text{max}}}{T_{s}}\right)=T_{ s}\text{ceil}\left(\frac{\sqrt[3]{\frac{\overline{v}}{\overline{d}}}}{T_{s}}\right) \tag{15}\]  
Then:  
\[dd2=\left[\begin{array}{c}T_{s}\text{ceil}\left(\frac{\sqrt[3]{\frac{ \overline{v}}{2\overline{d}}}}{T_{s}}\right)\\ \frac{\overline{v}}{2\left(T_{s}\text{ceil}\left(\frac{\sqrt[3]{\frac{ \overline{v}}{\overline{d}}}}{T_{s}}\right)\right)^{2}}\end{array}\right] \tag{16}\]  
If the following Equation (17) holds true:  
\[\overline{j}\geq j_{\text{max}}=\frac{\overline{a}}{\left(T_{s}\text{ceil} \left(\frac{\sqrt[3]{\frac{\overline{v}}{\overline{d}}}}{T_{s}}\right) \right)^{2}}\left[T_{s}\text{ceil}\left(\frac{\sqrt[3]{\frac{\overline{v}}{ \overline{d}}}}{T_{s}}\right)\right] \tag{17}\]  
Then:  
\[dd3=dd2 \tag{18}\]  
Otherwise:  
\[t_{\overline{d}/\text{max}}=\frac{\overline{j}}{\overline{d}} \tag{19}\]This rounded up with respect to the sampling time (\(T_{s}\)) yields the following equation:  
\[T_{s}\text{ceil}\left(\frac{t_{\overline{d}j_{\text{max}}}}{T_{s}}\right)=T_{s} \text{ceil}\left(\frac{\frac{\overline{j}}{d}}{T_{s}}\right) \tag{20}\]  
Then:  
\[dd3=\left[\begin{array}{c}T_{s}\text{ceil}\left(\frac{\frac{\overline{j}}{d} }{T_{s}}\right)\\ \frac{\overline{j}}{T_{s}\text{ceil}\left(\frac{\overline{j}}{T_{s}}\right)} \end{array}\right] \tag{21}\]  
Time \(t_{\overline{d}}\) is derived from Equation (21) as:  
\[t_{\overline{d}}=dd3_{1} \tag{22}\]  
The next section shows how to evaluate value of time (\(t_{\overline{j}}\)).