# Optimization of Redundant Degrees of Freedom in Robotic Flat-End Milling Based on Dynamic Response
## 2 Redundant Degrees of Freedom Optimization in Robotic Milling
### Solution of Redundant Degree of Freedom Optimization Model
#### 2.3.3 Regenerative Chatter Analysis of a Robotic Milling System  
In the analysis of regenerative chatter in robotic milling systems, the static force term is considered to have negligible effects on stability [41]. Consequently, Equation (10) can be revised as follows  
\[\mathbf{M}(\theta)\mathbf{\ddot{u}}(t)\mathbf{+C}(\theta)\mathbf{\dot{u}}(t) \mathbf{+K}(\theta)\mathbf{u}(t)\mathbf{=}a_{p}\mathbf{A}(t)[\mathbf{u}(t)- \mathbf{u}(t-T)] \tag{16}\]  
In order to predict the posture-dependent stability of the robotic milling process, the semi-discretization method [42] is used to solve the delay differential equations. Using the Cauchy transformation and linear approximation of the delayed term, Equation (16) can be expressed as  
\[\mathbf{\dot{u}}(t)=\mathbf{\tilde{A}}(t)\mathbf{u}(t)+\mathbf{\tilde{B}}(t) \mathbf{u}(t-T) \tag{17}\]  
with  
\[\mathbf{\tilde{A}}(t)= \begin{bmatrix}\mathbf{0}&\mathbf{I}\\ -\mathbf{M}^{-1}(a_{p}\mathbf{A}(t)+\mathbf{K})&-\mathbf{M}^{-1}\mathbf{C} \end{bmatrix}  \tag{18}\]  
\[\mathbf{\tilde{B}}(t)= \begin{bmatrix}\mathbf{0}&\mathbf{0}\\ \mathbf{M}^{-1}a_{p}\mathbf{A}(t)&\mathbf{0}\end{bmatrix}  \tag{19}\]  
\[\mathbf{u}(t)= \begin{bmatrix}\mathbf{x}(t)&\mathbf{\dot{x}}(t)\end{bmatrix} ^{T} \tag{20}\]  
where \(\mathbf{\tilde{A}}(t+T)=\mathbf{\tilde{A}}(t)\), \(\mathbf{\tilde{B}}(t+T)=\mathbf{\tilde{B}}(t)\). Using the semi-discretization method, the time period \(T\) is discretized into time intervals such as \(T=k\Delta t\) in which \(k\) is an integer. The period coefficient matrix can be approximately replaced by the average constant in each time interval \(t\in[t_{i},t_{i+1}]\), as follows:  
\[\left\{ \begin{array}{l}\mathbf{\tilde{A}}(t)\approx\mathbf{\tilde{A}}_{i}= \frac{1}{\Delta t}\int_{t_{i}}^{t_{i+1}}\mathbf{\tilde{A}}(t)dt\\ \mathbf{\tilde{B}}(t)\approx\mathbf{\tilde{B}}_{i}=\frac{1}{\Delta t}\int_{t_ {i}}^{t_{i+1}}\mathbf{\tilde{B}}(t)dt\end{array} \right. \tag{21}\]  
Consequently, the first-order equations of motion for the milling system can be expressed as follows:  
\[\mathbf{\dot{u}}(t)=\mathbf{\tilde{A}}_{i}\mathbf{u}(t)+\mathbf{\tilde{B}}_{ i}\mathbf{u}_{T,i} \tag{22}\]In this case, the delayed term is approximated with \(\mathbf{u}_{T,i}\) as follows:  
\[\mathbf{u}(t-T)\approx\mathbf{u}(t_{i}+\frac{\Delta t}{2}-T)\approx\omega_{a} \mathbf{u}_{i-k+1}+\omega_{b}\mathbf{u}_{i-k}=\mathbf{u}_{T,i} \tag{23}\]  
The weighting coefficients are expressed as follows:  
\[\left\{ \begin{array}{l}\omega_{a}=\frac{T+M-kM}{2M}\\ \omega_{b}=\frac{kM+\Delta t-T}{2M}\end{array} \right. \tag{24}\]  
In the milling system, the delayed term can be approximated as a weighted linear combination of the delayed discrete values taken at time \(t_{i-k}\) and \(t_{i-k+1}\). For the initial condition \(\mathbf{u}(t_{i})=\mathbf{u}_{i}\), Equation (22) is solved as follows:  
\[\mathbf{u}(t)=\exp(\mathbf{\tilde{A}}_{i}(t-t_{i})(\mathbf{u}_{i}+\mathbf{ \tilde{A}}_{i}^{-1}\mathbf{\tilde{B}}_{i}\mathbf{u}_{T,i})-\mathbf{\tilde{A}}_ {i}^{-1}\mathbf{\tilde{B}}_{i}\mathbf{u}_{T,i} \tag{25}\]  
With \(t=t_{i+1}\) substituted in Equation (25) and applying Equation (23), \(\mathbf{u}_{i+1}=\mathbf{u}(t_{i+1})\) can be defined as follows:  
\[\mathbf{u}_{i+1}=\mathbf{P}_{i}\mathbf{u}_{i}+\omega_{a}\mathbf{R}_{i} \mathbf{u}_{i-k+1}+\omega_{b}\mathbf{R}_{i}\mathbf{u}_{i-k} \tag{26}\]  
with  
\[\left\{ \begin{array}{l}\mathbf{P}_{i}=\exp(\mathbf{\tilde{A}}_{i}\Delta t) \\ \mathbf{R}_{i}=(\exp(\mathbf{\tilde{A}}_{i}\Delta t)-\mathbf{I})\mathbf{\tilde {A}}_{i}\mathbf{\tilde{B}}_{i}\end{array} \right. \tag{27}\]  
in which \(\mathbf{I}\) represents the identity matrix. Based on Equation (26), a discrete map between instants \(t_{i}\) and \(t_{i+1}\) can be defined as  
\[\mathbf{Q}_{t+1}=\mathbf{D}_{i}\mathbf{Q}_{i} \tag{28}\]  
where \(\mathbf{Q}_{i+1}=[\mathbf{u}_{i}\quad\mathbf{u}_{i-1}\quad\ldots\quad\mathbf{ u}_{i-k}]\), and  
\[\mathbf{D}_{k}=