\chapter{Robot's demonstrations}\label{chapter:demo}
\thispagestyle{myheadings}


This Chapter describes the demonstrations that use the development detailed in Chapter \ref{chapter:tele-operation}. These consist of the tele-operation of the robot using the haptic device and in some cases, using the general COP to generate a force feedback for user interaction. In all the demonstrations, only the 5 DOF of each leg linked by the hip piece are used. During these demonstrations, the robot's feet are kept in constant contact with the floor at a distance of  $14\cm$ from each other. 

The command of the humanoid robot is done by the \textit{humanoid\_control} module, holding the kinematics functions that control the movements. These functions are adaptations from the previous work \citep{cruz_haptic_2012}. In the experiments where the haptic force feedback is active, as explained in Section \ref{sec:tele_haptic_force}, the force is generated using the difference between the COP in the home position and the current COP. In each of the demonstrations, a single axis from the haptic device is monitored; using the value of that axis and applying a scale factor to use the maximum of the effective force feedback workspace, a kinematic function calculates the joint values according to a parameter set by the launcher. This parameter's value is set by the user and it corresponds to the type of movement (demonstration) of the robot. The movements of the robot are controled by the haptic device's state, more precisely, it's position. Because the robot's movements are done solely in one plane the control is done in position depending on a single axis of the device's position.

All the data from the experiments is recorded into \textit{bags} using the \textit{rosbag} utility. This allows for offline analysis and visualization of the recorded informations; the results presented in following Sections are created from these \textit{bags}.

Since the PHUA robot won't be performing walking motion, only balancing, a bench power source was used. It consists of a AC-DC power supply and a DC-DC power converter.%, both shown in Figure \ref{fig:power_source}.
 The power supply is MASCOT Type 9821 with an output of $12V$ and a maximum current of $20A$. The power converter is a CC BEC Pro by Castle Creations capable of an adjustable output between $4.8V$ and $12.5V$ with a maximum peak current of $20A$. For the demonstrations the converter was set to the lower working voltage of the servomotors, $6V$.
%
%
%\begin{figure}[H]
%  \centering
%  \includegraphics[height=50mm]{Imagens/power_source.pdf}
%  \captionof{figure}[ PHANTOM OMNI kinematics]{Bench power source and DC-DC converter.}
%  \label{fig:power_source}
%\end{figure}


The axis system for the robot used in this demonstration is depicted in Figure \ref{fig:robot2planes}; this system is centred in the geometrical center of the right foot so that both the COP and the position of the robot are represented in the same referential. All the kinematics are done for the right leg and because all the movements performed in these experiments are symmetrical, the calculated kinematics can be applied to both legs. In all of the demonstrations, the used arrangement of the load cells in the robor's feet is depicted in Figure \ref{fig:cells_loc} where the red cells correspond to the LSB-10 and the blue cells to the LBS-5.


\begin{figure}[H]
  \centering
  \includegraphics[height=80mm]{Imagens/robot2planes.pdf}
  \captionof{figure}[PHUA robot's axis system]{PHUA robot's axis system.}
  \label{fig:robot2planes}
\end{figure}

\begin{figure}[H]
  \centering
  \includegraphics[width=0.95\textwidth]{Imagens/cells.pdf}
  \captionof{figure}[PHUA robot's axis system]{PHUA robot's axis system.}
  \label{fig:cells_loc}
\end{figure}

Two main launch files are created and used to keep the experiments simple to perform and to replicate. The file that is launched first has the purpose of finding the used ports automatically and publishes the transformations between each foot and their relation the the world. The second file calls other launch files that in turn launch each of the nodes necessary for the experiments. All this files are in the Appendix \ref{appendix_launch}.



%\FloatBarrier
\section{Hip's vertical movement}\label{sec:demo_zz}


This demonstration consists of the vertical movement of the hip; to ensure this, the legs only move in the $XOZ$ plane. This happens by controlling three joints: Flexion/Extension of the ankle, knee and hip, where the knee joint is the only one to move along the $X$ axis. The COP variations are expected to be minimal so the force feedback originating from the COP is not active. This experience aims to validate the control of the PHUA robot using the motion of the haptic device. The $Z$ axis of the device is monitored and with its values commands the kinematics of the robot.


%\FloatBarrier
\subsection{Inverse kinematics}\label{subsec:demo_zz_invkin}


Each joint is controlled according to the inverse kinematics presented below. The used kinematics is similar to the three links planar robot depicted in Figure \ref{fig:RRR_planar} where the foot corresponds to the origin of the $X$ and $Y$ axis and the hip is represented by the $P_W$ point.


\begin{figure}[H]
  \centering
  \includegraphics[width=0.95\textwidth]{Imagens/RRR_planar.pdf}
  \captionof{figure}[Three rotary joints planar robot \citep{santos_robotica_2003}]{Three rotary joints planar robot \citep{santos_robotica_2003}.}
  \label{fig:RRR_planar}
\end{figure}


The $x$ and $y$ coordinates of the $P_W$ point can be expressed by the Equations \ref{equation:Pwx_Z} and \ref{equation:Pwy_Z} respectively.

\begin{equation}
	P_{Wx}=L_1 \cos \theta_{1} + L_2 \cos (\theta_{1} + \theta_{2})
	\label{equation:Pwx_Z}
\end{equation}

\begin{equation}
	P_{Wy}=L_1 \sin \theta_{1} + L_2 \sin (\theta_{1} + \theta_{2})
	\label{equation:Pwy_Z}
\end{equation}

Developing these equations gives the solution for the inverse kinematics of the $\theta_2$ joint angle given in Equation \ref{equation:theta2_Z}.

\begin{equation}
	\theta_{2} = \pm \arccos \frac{ P_{Wx}^2 + P_{Wy}^2 - L_1^2 - L_2^2} { 2 L_1 L_2 }
	\label{equation:theta2_Z}
\end{equation}

Due to the resemblance to the human body's knee, the robot's knee joint was mechanically blocked and the servomotor assembled so this joint only bends backwards; according to the kinematics presented above and the physical limitations the redundancy of the $\theta_2$ joint is eliminated resulting only in positive angle joints. The inverse kinematics of the $\theta_1$ joint is obtained by further development of the Equations \ref{equation:Pwx_Z}, \ref{equation:Pwy_Z} and \ref{equation:theta2_Z} as shown in Equation \ref{equation:theta1_Z}


\begin{equation}
	\theta_{1} = \arctan \frac{ P_{Wy}( L_1 + L_2\cos \theta_2) - P_{Wx} L_2 \sin \theta_2} {P_{Wx}( L_1 + L_2\cos \theta_2) + P_{Wy} L_2 \sin \theta_2}
	\label{equation:theta1_Z}
\end{equation}

To keep the hip always horizontal to the ground, the orientation of the grip present in Figure \ref{fig:RRR_planar}, $\phi$, is needed and it depends only on the $\theta_1$, $\theta_2$ and $\theta_3$ angles. This dependency results in the final part of the inverse kinematics for this demonstration and is given by the Equation \ref{equation:phi_Z}.


\begin{equation}
	\theta_3 = \phi - \theta_1 - \theta_2
	\label{equation:phi_Z}
\end{equation}


%\FloatBarrier
\subsection{Haptic device and robot's motion}\label{subsec:demo_zz_haptic_motion}

In the hip's vertical movement, the $Z$ axis of the haptic device is used to control the height of the PHUA robot's hip. The control is done by making a correspondence between the $Z$ axis values from the device to the $P_{Wy}$ variable in the inverse kinematics detailed in the Subsection \ref{subsec:demo_zz_invkin}. An offset is given to the kinematics so that the $zero$ of the haptic device's $Z$ axis coincides with the home position of the robot. This way, the robot only starts to crouch if the user moves the tip of the device to negative values of the $Z$ axis. Figure \ref{fig:move_zz_phantom_dimension} illustrates the values of the $Z$ axis during the experiment. Using the inverse kinematics function in the \textit{humanoid\_control} module, the robot's actuated joints (ankle, knee and hip's Flexion/Extension) performed the path present in Figure \ref{fig:move_zz_humanoide_joints_time} following the device's vertical movement; since both legs follow the same kinematics, only the right leg joints are represented. By using the time stamp present in every ROS message it is possible to represent multiples sources of information in the same graph, e.g. joint values and movement of the haptic device.



During the experiments, 2 movements of lowering and rising are performed; the first is done by moving the haptic device's tip down and up at a low speed. This movement corresponds to the first 20 seconds represented in Figures \ref{fig:move_zz_phantom_dimension} and \ref{fig:move_zz_humanoide_joints_time}. Between the lowering and rising movements, the joints saturate because one of them, the ankle, reaches one of its limits stopping the motion of all the other joints involved in the kinematic. In both downward and upward movements, the joints behave at a constant speed with some steps near the beginning and end of each movement. These steps are also visually observable in the robot during the demonstrations. The reason for this phenomenon is that the servomotors reach the requested position before the new position reaches the \textit{humanoid\_control} \textit{node}.


\begin{figure}[H]
  \centering
  \includegraphics[width=0.95\textwidth]{Imagens/Move_ZZ/phantom_dimension.pdf}
  \captionof{figure}[Motion of haptic device's $Z$ axis]{Motion of haptic device's $Z$ axis during the vertical movement demonstration.}
  \label{fig:move_zz_phantom_dimension}
\end{figure}

\begin{figure}[H]
  \centering
  \includegraphics[width=0.95\textwidth]{Imagens/Move_ZZ/phantom_joints_time.pdf}
  \captionof{figure}[Motion of the PHUA robot]{Motion of the actuated joints of the PHUA robot during the vertical movement demonstration with the $Z$ axis movement of the haptic device.}
  \label{fig:move_zz_humanoide_joints_time}
\end{figure}
\pagebreak

The second movements are done using the same motion but at a faster speed on the haptic device's side. The servomotors quickly respond to the orders in a stable movement using the set speed for each joint. A small overshoot is perceivable on the knee joint but it has a fast stabilization. In both cases, fast and slow movements, the only joint that reaches its physical limits is the ankle Flexion/Extension joint, all other joints still have more range but the kinematics function prevents further movements once one of the actuated joints reach its limits.

In Figure \ref{fig:move_zz_humanoide_joints_time}, it is possible to see a delay between the motion of the haptic device and the servomotors during the fast movements. 	This may indicate either a slow control loop of the servomotors or a slow communication line between the main system and the servomotors. During the experiments, the CPU and RAM usage was monitored; with all \textit{nodes} necessary to this demonstration both CPU cores were at $100\%$ and over $80\%$ of the RAM has being used. This issue is addressed in Section \ref{sec:future} where suggestions are made to prevent this problem.






%\FloatBarrier
\subsection{Forces and COP}\label{subsec:demo_zz_force_cop}

Using the information of the load cells stored in this demonstration's \textit{bag}, it is possible to obtain the graphs in Figures \ref{fig:move_zz_humanoide_ard1_time} and \ref{fig:move_zz_humanoide_ard2_time}. For a better understanding of the dynamic shifts of the forces, the movement of the haptic device is also represented in the graphs.

The oscillations in the transitions from the home position to the lowest position stand out as an uncertainty of the measurements but, when the robot's joints stop in any of the 2 positions, the measurements are stable and constant. This indicates that the system developed for the acquisition of the load cells values is capable of accurately reading their values in static positions of the robot. The hight and low values in the transition phases are explained by the dynamics of the movement, slacks in the belt transmission and elastic effects caused by the rubber soles can be the sources for some of the oscillations. Figure \ref{fig:move_yy_humanoide_total_ard_1_2_time} illustrates the sum of all the cells in each; here is possible to see the  full acceleration and inertial effects on the robot's feet.

An interesting observation can be done in Figures \ref{fig:move_zz_humanoide_ard1_time} and \ref{fig:move_zz_humanoide_ard2_time}; most variations only occur in three of the four load cells, and the fourth cell value is caused by the compression from the bolts that hold the bottom and top parts of the feet; this last cell shows very little variations throughout the demonstration. This is most likely the redundancy of four contact points in a rigid plane like the PHUA robot's foot. Since a plane only needs three points of contact the fourth load cells doesn't sense more pressure unless the COP moves close to it. Even though this happens, there is no need to change the mathematical formulation of the COP (Equation \ref{equation:cop}) since it's weighted on the value of the force; a small force has little or none influence on the final value of the COP.

Figure \ref{fig:move_zz_humanoide_total_ard_1_2_time} shows the sum of all the forces in each foot where is possible to see a stable measurement of the total normal force. Except for the oscillations caused by the inertial component of the normal force, the graphs show that the weight measured by the load cells is constant and accurate.


\begin{figure}[H]
  \centering
  \includegraphics[width=0.95\textwidth]{Imagens/Move_ZZ/humanoide_ard1_time.pdf}
  \captionof{figure}[Forces normal to the right foot]{Forces normal to the right foot of the robot during the vertical movement demonstration with the $Z$ axis movement of the haptic device.}
  \label{fig:move_zz_humanoide_ard1_time}
\end{figure}



\begin{figure}[H]
  \centering
  \includegraphics[width=0.95\textwidth]{Imagens/Move_ZZ/humanoide_ard2_time.pdf}
  \captionof{figure}[Forces normal to the left foot]{Forces normal to the left foot of the robot during the vertical movement demonstration with the $Z$ axis movement of the haptic device.}
  \label{fig:move_zz_humanoide_ard2_time}
\end{figure}


\begin{figure}[H]
  \centering
  \includegraphics[width=0.95\textwidth]{Imagens/Move_ZZ/humanoide_total_ard_1_2_time.pdf}
  \captionof{figure}[Total of the forces in each foot]{Total of the forces in each foot of the robot during the vertical movement demonstration with the $Z$ axis movement of the haptic device.}
  \label{fig:move_zz_humanoide_total_ard_1_2_time}
\end{figure}


The calculated COP for the whole experiment is shown in Figure \ref{fig:move_zz_cop_LR_values}. The path of the COP shows a region of stability. For a better visualization, a shorter time range of the COP is represented in Figure \ref{fig:move_zz_cop_LR_stage3}; the time range corresponds to the fast lowering movement of this experiment. It shows clearly 2 zones where the bigger one corresponds to the home position part of the movement and the smaller one happens when the robot is in the lowest crouching position.


\begin{figure}[H]
  \centering
  \includegraphics[width=0.95\textwidth]{Imagens/Move_ZZ/cop_LR_values.pdf}
  \captionof{figure}[Complete motion of the COP]{Complete motion of the COP during the vertical movement demonstration.}
  \label{fig:move_zz_cop_LR_values}
\end{figure}


\begin{figure}[H]
  \centering
  \includegraphics[width=0.95\textwidth]{Imagens/Move_ZZ/cop_LR_stage3.pdf}
  \captionof{figure}[Part of the motion of the COP]{Part of the motion of the COP during the fast downward movement.}
  \label{fig:move_zz_cop_LR_stage3}
\end{figure}


\begin{figure}[H]
  \centering
  \includegraphics[width=0.95\textwidth]{Imagens/Move_ZZ/cop_LR_axis_values.pdf}
  \captionof{figure}[Components of the COP]{Components of the COP robot during the vertical movement demonstration.}
  \label{fig:move_zz_cop_LR_axis_values}
\end{figure}


Figure \ref{fig:move_zz_cop_LR_axis_values} represents the $X$ and $Y$ components of the COP during the full time range of the experience. The $Y$ does not have a large variation during the experiment because most of the mass moves in the $X$ axis direction. In $X$ component, 2 levels of coordinates are visible; these correspond to the 2 zones of stability in the 2 static stages of movement, home position and full crouching.




%\FloatBarrier
\section{Hip's lateral movement}\label{sec:demo_yy}


For this demonstration, the hip moves sideways with the ankle's Inversion/Eversion and the hip's Abduction/Adduction joints performing the relevant movements. These are done in the $YOZ$ plane where the vertical movements are done only when needed for a wider range of lateral movement. The COP is expected to move considerably so the force feedback is active. Like explained in Section \ref{sec:tele_haptic_force}, this forces are the direct result of the difference of the resting position's COP and the COP of the current position of the robot.



%\FloatBarrier
\subsection{Inverse kinematics}\label{subsec:demo_yy_invkin}

The kinematics used in this demonstration are based a two links planar robot like the one shown in Figure \ref{fig:move_zz_RR_planar}. Like in the previous experiment, the inverse kinematics is done directly from the trigonometrical relations present in this kind of robots. In this case the PHUA robot's hip corresponds to the point $A$ in Figure \ref{fig:move_zz_RR_planar} and it's ankle to the axis's origin.


\begin{figure}[H]
  \centering
  \includegraphics[width=0.95\textwidth]{Imagens/RR_planar.pdf}
  \captionof{figure}[Two links planar robot \citep{santos_robotica_2003}]{Two links planar robot \citep{santos_robotica_2003}.}
  \label{fig:move_zz_RR_planar}
\end{figure}



Since the movement is now done sideways, the parameters for the inverse kinematics are the value of $X$ component of the position of the point $A$ and the direction of the hip. The position of $A$ is given by the Equations \ref{equation:Ax_Y} and \ref{equation:Ay_Y}.


\begin{equation}
	A_{x}=L_1 \cos \theta_{1}
	\label{equation:Ax_Y}
\end{equation}

\begin{equation}
	A_{y}=L_1 \sin \theta_{1}
	\label{equation:Ay_Y}
\end{equation}

By solving the $A_x$ equation to $\theta_1$ is possible to get the first part for the inverse kinematics as seen in Equation \ref{equation:theta1_Y}. The $\theta_2$ angle can be obtained by guaranteeing the verticality of the hip, $\alpha$, as in Equation \ref{equation:theta2_Y}.


\begin{equation}
	\theta_{1} = \arcsin \frac{A_{y}}{L_1}
	\label{equation:theta1_Y}
\end{equation}


\begin{equation}
	\theta_{2} = \alpha - \theta_1
	\label{equation:theta2_Y}
\end{equation}

Due to mechanical restrictions the ankle's Inversion maximum range is $30^\circ$; to keep the servomotors from overstraining the applied kinematics take this limitation into account restricting the PHUA robot's movement


\FloatBarrier
\subsection{Haptic device and robot's motion}\label{subsec:demo_yy_haptic_motion}

In this demonstration the monitored axis of the haptic device is the $Y$ where its zero corresponds to the home position of the PHUA robot. Figure \ref{fig:move_yy_phantom_dimension} illustrates the movement performed by the user during the experiment.

\begin{figure}[H]
  \centering
  \includegraphics[width=0.95\textwidth]{Imagens/Move_YY/phantom_dimension.pdf}
  \captionof{figure}[Motion of haptic device's $Y$ axis]{Motion of haptic device's $Y$ axis during the lateral movement demonstration.}
  \label{fig:move_yy_phantom_dimension}
\end{figure}
The movement started with a motion to the left side by the haptic device where the robot followed as seen by the joint values of the right ankle and hip in Figure \ref{fig:move_yy_humanoide_joints_time}. When the user felt a substantial force feedback given the haptic device, a movement to the center position was done to return the robot to its home position; but an unexpected event took place as the ankle furthest from the hip, the left one, skipped some of its belt transmission's teeth. This event causes the \textit{humanoid\_control} \textit{node} to work as the servomotor is in the correct position when it is not the case; the joint and the servomotor do not have a correspondent position. Although all the joints are correctly dimensioned to perform the required torques some of them, like the ankle, have a low contact ratio in the transmission; this is caused by very few teeth of the belted transmission are in contact with the pinion. The event happens around the 51st second, just before the experience is terminated.


\begin{figure}[H]
  \centering
  \includegraphics[width=0.95\textwidth]{Imagens/Move_YY/phantom_joints_time.pdf}
  \captionof{figure}[Motion of the PHUA robot]{Motion of the actuated joints of the PHUA robot during the movement demonstration with the $Y$ axis movement of the haptic device.}
  \label{fig:move_yy_humanoide_joints_time}
\end{figure}


The stepping issue also was noticed in this demonstration; now, with all of the developed modules, the frequencies of the ROS messages are checked for discrepancies. Without recording the experiment with \textit{rosbag}, the frequencies are similar to the expected ones except the one holding the state of the humanoid robot which is being published at around $5\hertz$. A control loop this slow can be related to the step movement problems in both the first experiment as well this one. During the recording of this experiment's \textit{bag} a loss of ROS messages was noticed; this may be due to excessive CPU usage or a \textit{bug} in the \textit{rosbag} utility.





%\FloatBarrier
\subsection{Forces, COP and haptic generation}\label{subsec:demo_zz_force_cop_haptic}


Figures \ref{fig:move_yy_humanoide_ard1_time} and \ref{fig:move_yy_humanoide_ard2_time} show the values of the forces in each load cell with the movement of the haptic device also represented.

Similar to the previous experiment, only three load cells at a time register variations but in this demonstration is visible an exchange of the cell that is reduced to the pre-compression from the bolts between the cells 2 and 4. What happens in this demonstration is due to the hip's side movement: the COP moves close enough to affect the cell that at the beginning had no extra strain on it. When this happens, another cell losses the pressure from the robot's weight reducing the force down to the pre-compression value.

Figure \ref{fig:move_yy_humanoide_total_ard_1_2_time} represents the total values of the force in each foot. In it is visible a change in weight from the left foot to the right one as the COP moves closer to it.

Figure \ref{fig:move_yy_cop_LR_values} shows the path of the COP during the demonstration where it is clearly visible the dislocation of it to the right as expected.
In Figure \ref{fig:move_yy_cop_LR_axis_values} is possible to visualize the $X$ and $Y$ components of the COP during the experience. The $X$ component has very little variation during the demonstration as opposed to the $Y$ component that has a wide range of variations.


It was expected for the COP to have a wide range of movement during this demonstration so the force feedback on the haptic device is activated. Using the linear relation described in Section \ref{sec:tele_haptic_force} the user feels a force in the direction of the unbalance of the robot. This method requires the user to fully control the haptic device with fine and precise movements so the maximum force of the device, $3.3\newton$, is not used instead it is used a maximum force of $2.5\newton$. Figures \ref{fig:move_yy_cop_x_axis_w_force_x_axis} and \ref{fig:move_yy_cop_y_axis_w_force_y_axis} show the force feedback on the $X$ and $Y$ axis of the haptic device in accordance with the $X$ and $Y$ components of the COP; in these, the space between the black lines represents the dead zone. In the first, where the $X$ components are represented, the COP has very small peaks above the dead zone line, thus creating no sensible force for the user. As expected, the generated force is bigger on the $Y$ component since the COP clearly passes the dead zone lines. In Figure \ref{fig:move_yy_cop_y_axis_w_force_y_axis} is possible to observe that the generated force follows the oscillations of the COP.


\begin{figure}[H]
  \centering
  \includegraphics[width=0.95\textwidth]{Imagens/Move_YY/humanoide_ard1_time.pdf}
  \captionof{figure}[Forces normal to the right foot]{Forces normal to the right foot of the robot during the lateral movement demonstration with the $Y$ axis movement of the haptic device.}
  \label{fig:move_yy_humanoide_ard1_time}
\end{figure}



\begin{figure}[H]
  \centering
  \includegraphics[width=0.95\textwidth]{Imagens/Move_YY/humanoide_ard2_time.pdf}
  \captionof{figure}[Forces normal to the left foot]{Forces normal to the left foot of the robot during the lateral movement demonstration with the $Y$ axis movement of the haptic device.}
  \label{fig:move_yy_humanoide_ard2_time}
\end{figure}


\begin{figure}[H]
  \centering
  \includegraphics[width=0.95\textwidth]{Imagens/Move_YY/humanoide_total_ard_1_2_time.pdf}
  \captionof{figure}[Total of the forces in each foot]{Total of the forces in each foot of the robot during the lateral movement demonstration with the $Y$ axis movement of the haptic device.}
  \label{fig:move_yy_humanoide_total_ard_1_2_time}
\end{figure}


\begin{figure}[H]
  \centering
  \includegraphics[width=\textwidth]{Imagens/Move_YY/cop_LR_values.pdf}
  \captionof{figure}[Complete motion of the COP]{Complete motion of the COP during the demonstration.}
  \label{fig:move_yy_cop_LR_values}
\end{figure}


\begin{figure}[H]
  \centering
  \includegraphics[width=\textwidth]{Imagens/Move_YY/cop_LR_axis_values.pdf}
  \captionof{figure}[Components of the COP]{Components of the COP robot during the lateral movement demonstration.}
  \label{fig:move_yy_cop_LR_axis_values}
\end{figure}


\begin{figure}[H]
  \centering
  \includegraphics[width=\textwidth]{Imagens/Move_YY/cop_x_axis_w_force_x_axis.pdf}
  \captionof{figure}[$X$'s Components of the COP and force feedback]{$X$'s Components of the COP and force feedback with the dead zone lines.}
  \label{fig:move_yy_cop_x_axis_w_force_x_axis}
\end{figure}


\begin{figure}[H]
  \centering
  \includegraphics[width=\textwidth]{Imagens/Move_YY/cop_y_axis_w_force_y_axis.pdf}
  \captionof{figure}[$Y$'s Components of the COP and force feedback]{$Y$'s Components of the COP and force feedback with the dead zone lines.}
  \label{fig:move_yy_cop_y_axis_w_force_y_axis}
\end{figure}

\pagebreak

%\FloatBarrier
\section{Hip's sagittal movement}\label{sec:demo_xx}


In this demonstration, the robot's hip moves back and forward with most movements in the $X$ axis. For back and forward movements the hip needs to lower its height so the knee joint can have a greater influence in this demonstration. This movement is particularly important for the walking gait as the forward balancing of the body greatly contributes to the activity. Similarly to the last experience, the force feedback is active so the user can feel the unbalance of the robot. The data that this experience produces is invaluable to the future work for robot learning from demonstration.



%\FloatBarrier
\subsection{Inverse kinematics}\label{subsec:demo_xx_invkin}

The kinematics used in this demonstration is based on the generic planar robot shown in Figure \ref{fig:RRR_planar} similar to the first demonstration. The main difference is the necessity to have the hip at a lower height; for this, the ankle joints are placed in their maximum Flexion range, $20^\circ$, and the knee and hip's joints make the longitudinal movement of the hip while keeping the hip vertical.

Using the kinematics from the other demonstrations and the constrains described before, the Equation \ref{equation:xx_theta2} gives the value for the $\theta_2$ where it depends on $\theta_1$ that now is not a variable but a constant. Like before, the last joint depends on the required orientation of the hip as in Equation \ref{equation:xx_theta3}. Similar to the other experiments, the kinematics is restrained by the first joint to reach one of its maximum ranges.



\begin{equation}
	\theta_2 = \arccos \left(  \frac{x}{L_2} - \frac{L_1}{L_2} \cos \theta_1 \right)  - \theta_1
	\label{equation:xx_theta2}
\end{equation}

\begin{equation}
	\theta_3 = \phi - \theta_2 - \theta_1
	\label{equation:xx_theta3}
\end{equation}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
%\FloatBarrier
\subsection{Haptic device and robot's motion}\label{subsec:demo_xx_haptic_motion}

The monitored axis of the haptic device in the demonstration is the $X$; its zero corresponds to the full crouching position. Figure \ref{fig:move_xx_phantom_dimension} shows the movement performed by the haptic device's tip during the experiment.

The experience started with the hip near the home position moving then to the front. The user, feeling the force feedback, stopped the front motion before the robot lost its balance. Passing through the home position, the user tele-operated the robot to take its hip back as far as possible. Once reached the joint's limits, the robot preforms a repetition of the movement. The motion of the hip and knee's joints are visible in Figure \ref{fig:move_xx_humanoide_joints_time} as is the $X$ axis's values of the device.



\begin{figure}[H]
  \centering
  \includegraphics[width=0.95\textwidth]{Imagens/Move_XX/phantom_dimension.pdf}
  \captionof{figure}[Motion of haptic device's $X$ axis]{Motion of haptic device's $X$ axis during the sagittal movement demonstration.}
  \label{fig:move_xx_phantom_dimension}
\end{figure}



\begin{figure}[H]
  \centering
  \includegraphics[width=0.95\textwidth]{Imagens/Move_XX/phantom_joints_time.pdf}
  \captionof{figure}[Motion of the PHUA robot]{Motion of the actuated joints of the PHUA robot during the movement demonstration with the $Z$ axis movement of the haptic device.}
  \label{fig:move_xx_humanoide_joints_time}
\end{figure}



%\FloatBarrier
\subsection{Forces, COP and haptic generation}\label{subsec:demo_xx_force_cop_haptic}


In Figures \ref{fig:move_xx_humanoide_ard1_time} and \ref{fig:move_xx_humanoide_ard2_time} it is possible to visualize the forces sensed by the load cells during the demonstration. In some parts of this experiment only 2 cells of a foot are feeling the floor under the foot.  Around the 20th second only the front cells of the left foot are feeling the normal forces from the robot's weight; the duration of this state is approximately 10 seconds and it corresponds to the movement of the hip beyond the home position for this experiment.

Figure \ref{fig:move_xx_humanoide_total_ard_1_2_time} illustrates the total values of the force in each foot; in this graph a constant shift between the two feet is seen. This may be caused if the feet are not in the same plane or if there is a joint with the belted transmission not tight enough.


Figure \ref{fig:move_xx_cop_LR_values} represents the COP during the experience where it shows a back and forward movement with a slight inclination to the right; the analyses of this and the graphs in Figures \ref{fig:move_xx_humanoide_ard1_time} and \ref{fig:move_xx_humanoide_ard2_time} indicate that the right foot is inclined in relation to the floor. Figure \ref{fig:move_xx_cop_LR_axis_values} illustrates the $X$ and $Y$ components of the COP during the experience.


The generated forces in this experience are shown in Figures \ref{fig:move_xx_cop_x_axis_w_force_x_axis} and \ref{fig:move_xx_cop_y_axis_w_force_y_axis} with the dead zone lines in black. In the $X$ axis, the bigger forces are generated when the user takes the hip to the front causing the COP to move to the front zone. The graph corresponding to the $Y$ axis shows that a great force was generated due to the deviation of the $Y$ component of the COP; this resulted from the inclined foot.


\begin{figure}[H]
  \centering
  \includegraphics[width=0.95\textwidth]{Imagens/Move_XX/humanoide_ard1_time.pdf}
  \captionof{figure}[Forces normal to the right foot]{Forces normal to the right foot of the robot during the sagittal movement demonstration with the $Z$ axis movement of the haptic device.}
  \label{fig:move_xx_humanoide_ard1_time}
\end{figure}



\begin{figure}[H]
  \centering
  \includegraphics[width=0.95\textwidth]{Imagens/Move_XX/humanoide_ard2_time.pdf}
  \captionof{figure}[Forces normal to the left foot]{Forces normal to the left foot of the robot during the sagittal movement demonstration with the $Z$ axis movement of the haptic device.}
  \label{fig:move_xx_humanoide_ard2_time}
\end{figure}


\begin{figure}[H]
  \centering
  \includegraphics[width=0.95\textwidth]{Imagens/Move_XX/humanoide_total_ard_1_2_time.pdf}
  \captionof{figure}[Total of the forces in each foot]{Total of the forces in each foot of the robot during the sagittal movement demonstration with the $Z$ axis movement of the haptic device.}
  \label{fig:move_xx_humanoide_total_ard_1_2_time}
\end{figure}


\begin{figure}[H]
  \centering
  \includegraphics[width=0.95\textwidth]{Imagens/Move_XX/cop_LR_values.pdf}
  \captionof{figure}[Complete motion of the COP]{Complete motion of the COP during the demonstration.}
  \label{fig:move_xx_cop_LR_values}
\end{figure}


\begin{figure}[H]
  \centering
  \includegraphics[width=0.95\textwidth]{Imagens/Move_XX/cop_LR_axis_values.pdf}
  \captionof{figure}[Components of the COP]{Components of the COP robot during the sagittal movement demonstration.}
  \label{fig:move_xx_cop_LR_axis_values}
\end{figure}




\begin{figure}[H]
  \centering
  \includegraphics[width=0.95\textwidth]{Imagens/Move_XX/cop_x_axis_w_force_x_axis.pdf}
  \captionof{figure}[$X$'s Components of the COP and force feedback]{$X$'s Components of the COP and force feedback with the dead zone lines.}
  \label{fig:move_xx_cop_x_axis_w_force_x_axis}
\end{figure}


\begin{figure}[H]
  \centering
  \includegraphics[width=0.95\textwidth]{Imagens/Move_XX/cop_y_axis_w_force_y_axis.pdf}
  \captionof{figure}[$Y$'s Components of the COP and force feedback]{$Y$'s Components of the COP and force feedback with the dead zone lines.}
  \label{fig:move_xx_cop_y_axis_w_force_y_axis}
\end{figure}


\FloatBarrier
