# Automated and Controlled System for Analysis of Residual Limbs Thermograms of Transtibial Amputees
## 3 Methodology
### Control Solution
#### 3.4.1 Plant Description  
In Figure 7, the free-body diagram representing the system of the automated cabin is depicted. Table 1 summarizes the variables and constants for the system.  
Figure 6: Thermographic image obtained with the use of the cabin.  
First, the position and velocity in the Cartesian coordinates are computed, such that  
\[\begin{cases}x=l\sin{(\theta)}\\ y=l\cos{(\theta)}\end{cases},\quad\begin{cases}\dot{x}=l\cos{(\theta)}\dot{ \theta}\\ \dot{y}=-l\sin{(\theta)}\dot{\theta}\end{cases}\]  
The quadratic resulting velocity is given by \(v^{2}=l^{2}\dot{\theta}\). As it is shown in the detailed view of the diagram (Figure 7), there exists an angular restriction generated for the wheel rolling without slipping in the circular surface. Such restriction is given by  
\[(R+r)\theta=r\alpha,\quad R>r. \tag{2}\]  
\begin{table}
\begin{tabular}{c c c c} \hline
**Parameter** & **Unit** & **Value** & **Description** \\ \hline \(r\) & m & 0.033 & Ratio of the wheel \\ \hline \(l\) & m & 0.551 &
\begin{tabular}{c} Distance between the center of the rail and \\ the center of the wheel \\ \end{tabular} \\ \hline \(R\) & m & 0.990 & Ratio external circle of the rail \\ \hline \(\theta\) & rad & NA & Angular position of the car in the rail \\ \hline \(\alpha\) & rad & NA & Angular position of the wheel \\ \hline \(\tau_{1}\) & Nm & NA & Torque exerted for the car \\ \hline \(\tau_{0}\) & Nm & NA & Torque of the wheel motor (input) \\ \hline \(N\) & N & NA & Normal force in the wheel and rail \\ \hline \(g\) & m/s\({}^{2}\) & 9.8 & Gravity acceleration \\ \hline \(m_{1}\) & Kg & 1.68 & Mass of the car \\ \hline \(m_{2}\) & Kg & 0.077 & Mass of the wheel \\ \hline \end{tabular}
\end{table}
Table 1: Parameters for the mathematical model of the cabin.  
Figure 7: Free-body diagram for the automated cabin.  
The kinetic and potential energy are computed as follows:  
\[\begin{array}{c}V=(m_{1}+m_{2})gl\cos{(\theta)},\\ K=\frac{1}{2}(m_{1}+m_{2})\;l^{2}\;\dot{\theta}^{2}+\frac{1}{2}I_{m_{2}}\dot{ \alpha}^{2},\end{array}\]  
where \(I_{m_{2}}\) is the inertia for the wheel, which is considered as a solid disk; thus, the inertia can be obtained as \(I_{m_{2}}=m_{2}r^{2}\), where \(V\) is the potential energy, \(K\) is the kinetic energy, and the Lagrangian is described as  
\[L=\tfrac{1}{2}(m_{1}+m_{2})l^{2}\dot{\theta}^{2}+\tfrac{1}{2}m_{2}r^{2}\dot{ \alpha}^{2}-(m_{1}+m_{2})gl\cos{(\theta)}.\]  
Considering the wheel normal force \(N\), the restriction (2), and the relation between the torques \(\tau_{1}\) and \(\tau_{0}\) given by \(\tau_{1}=Rr^{-1}\tau_{0}\), the Euler-Lagrange equation \(\dfrac{d}{dt}\bigg{(}\dfrac{\partial L}{\partial\dot{\theta}}\bigg{)}- \dfrac{\partial L}{\partial\dot{\theta}}=\tau_{1}\) is given by  
\[(m_{1}+2m_{2})l^{2}\dot{\theta}+(m_{1}+m_{2})lg\sin{(\theta)}=Rr^{-1}\tau_{0}. \tag{3}\]  
The following equation describes the electrical model of the DC motor actuating over the wheel:  
\[R_{m}I+L_{m}\dot{I}+K_{m}\dot{\alpha}=u, \tag{4}\]  
where \(R_{m}\) is the constant that represents the motor coil resistance, \(L_{m}\) is the constant for the motor coil inductance, \(I\in\mathbb{R}\) is the current of the motor, \(K_{m}\) is the constant for the electromotive force constant, and \(u\in\mathbb{R}\) is the input voltage.