## 4 Comparative Methods
### Force Switch-Based Method  
The other method is based on the idea of the force switch algorithm proposed by [PERSON] et al. [22]. They [22] developed a method to estimate the wearer's motion, walking or standing, based on the force switch on the feet of the wearer. The algorithm required two or three steps for estimation and generates torques on the joints based on a pre-defined pattern for the walking motion. Unfortunately, we found that the original method needed time to estimate the walking motion, and the wearer needed to push his/her feet actively while the powered skeleton tried to retain posture before motion estimation was accomplished. Following motion estimation, the powered exoskeleton began assisting the estimated motion of the wearer. However, we found that many parameters needed to be tuned for appropriate power assistance.  
Therefore, we designed a simplified algorithm in place of the force switch-based method. Since force sensors are attached to the wearer's feet in our powered exoskeleton, we used them as force switches instead. The powered exoskeleton recognizes the \"swing phase\" and the \"stance phase\" according to the difference between the left and right force values. When the difference is small, it recognizes that both feet are in \"stance phase\". Otherwise, if the force value of the left foot is greater than the right, it recognizes that the left leg is in the \"swing phase\" and the right leg is in the \"stance phase\", and vice versa.  
Following the recognition of the phase of each foot, the powered exoskeleton controls itself to maintain the posture of the leg as desired according to the recognized phase. The desired angles of the powered skeleton \(\varphi_{t}^{d}=(\varphi_{rw}^{d},\varphi_{lw}^{d},\varphi_{rk}^{d},\varphi_{ lk}^{d})\) are set to the pre-defined desired angles \((\varphi_{rw}^{rp},\varphi_{lw}^{lp},\varphi_{rk}^{rp},\varphi_{lk}^{lp})\), where \(rp\) and \(lp\) indicate the phases of the right and left legs, respectively. \(\phi_{i}^{swing}\) and \(\phi_{i}^{sstand}\) are the desired angles of joint \(i\) for the \"swing phase\" and the \"stance phase\", respectively. A PD controller was applied to calculate the input of each joint motor \(u_{t}=(u_{rw},u_{lw},u_{rk},u_{lk})\) by Equation (5):\[\mathbf{u}_{t}=k_{p}(\mathbf{\phi}_{t}-\mathbf{\phi}_{t}^{d})+k_{d}\left((\mathbf{\phi}_{t}-\mathbf{ \phi}_{t}^{d})-(\mathbf{\phi}_{t-1}-\mathbf{\phi}_{t-1}^{d})\right) \tag{5}\]  
where \(\mathbf{\phi}_{t}=(\phi_{rw},\phi_{lw}\phi_{rk},\phi_{lk})\) are the given joint angles of the powered exoskeleton. The algorithm for this process is shown in Algorithm 2. Thresholds \(\tau_{A}\) and \(\tau_{B}\) are determined by trial and error.  
The two competing methods introduced above struggle to distinguish forward and backward walks. Therefore, we apply and tune the parameters of these methods only for the forward walking motion.  
```
Obtain the floor reaction force \(f_{l},f_{r}\) from the force sensors on the wearer's feet \(f_{diff}=f_{l}-f_{r}\) if\(\tau_{A}\leq f_{diff}\leq\tau_{B}\)then  recognizes that both legs are in \"stance phase\" \(\phi_{rw}^{d}\), \(\phi_{lw}^{d}\), \(\phi_{rk}^{d}\) and \(\phi_{lk}^{d}\) is set to \(\phi_{rw}^{stand}\), \(\phi_{lw}^{stand}\), \(\phi_{rk}^{stand}\) and \(\phi_{lk}^{stand}\) endif if\(f_{diff}<\tau_{A}\)then  recognizes that the left leg is in \"swing phase\" and the right leg is in \"stance phase\" \(\phi_{rw}^{d}\), \(\phi_{lw}^{d}\), \(\phi_{rk}^{d}\) and \(\phi_{lk}^{d}\) is set to \(\phi_{rw}^{stand}\), \(\phi_{lw}^{swing}\), \(\phi_{rk}^{stand}\) and \(\phi_{lk}^{swing}\) endif if\(\tau_{B}<f_{diff}\)then  recognizes that the right leg is in \"swing phase\" and the left leg is in \"stance phase\" \(\phi_{rw}^{d}\), \(\phi_{lw}^{d}\), \(\phi_{rk}^{d}\) and \(\phi_{lk}^{d}\) is set to \(\phi_{rw}^{swing}\), \(\phi_{lw}^{stand}\), \(\phi_{rk}^{swing}\) and \(\phi_{lk}^{stand}\) endif
```  
**Algorithm 2** Foot Force Switch-based Walk Assistance System