## 2 Materials and Methods
### Control Description  
We used a finite state machine (FSM), depicted in Figure 2, to control the AAFO during the different stages of the gait cycle. It consists of four states: Push-off, Swing, Swing-low, and Heel-strike. The simulation starts in the state Push-off of the FSM, just before starting the toe-off of the foot. Figure 3 depicts the stages of the FSM described during a gait cycle with the ankle angle reference signal. For a clearer FSM description, in the following lines, the inputs and outputs are explained, followed by the possible actions of the cam. Figure 3: Ankle angle reference signal, with vertical lines indicating the starting points of every stage of the FSM. Toe-off is the start of the stage Swing, and other initial points have the name of its respective stage. The sampling rate is 0.01 s.  
Figure 2: Finite state machine. Every block represents a state, and inside each block is the set of actions (value of outputs). \(AH\) and \(HC\) are the inputs, where \(AH\) is the ankle height, and \(HC\) is the heel contact, \(ah_{1}\), \(ah_{2}\), and \(ah_{3}\) are the thresholds of ankle height, and \(hc\) is the threshold for the heel contact. * Inputs: The height of the ankle and the heel contact were chosen as input signals. These ankle height thresholds (\(ah_{1}\), \(ah_{2}\), and \(ah_{3}\)) must be customized to the user. The heel contact with the ground \(hc\) is detected when the signal from a force sensor at the heel exceeds a minimum. * Outputs: Movements of the cam, lever, and flexion of the ankle. The cam can perform three possible actions: Follow-wheel, Home-position, and Control. The Follow-wheel action consists of moving the cam and keeping its edge at a constant distance from the suspension, ensuring that any subsequent interactions between these elements are smooth. Otherwise, a strong contact may separate the elements instead of providing uniform pressure, thus affecting the Control action. The Home-position action is similar to Follow-wheel, but it increases the separation between the cam and suspension. During this action, no contact is expected to occur soon. Finally, the Control action follows the diagram of Figure 4, and it is explained in Section 2.2. During this action, the cam is in contact with the suspension. Given that the movement of the cam in the dorsiflexion direction demands more torque than in plantar flexion, a reduction factor of ten was applied when the ankle angle controller signal (Figure 4) results were negative, which means that the cam must move toward the plantarflexion direction. State Descriptions
* Push-off: This state keeps the lever inactive and the cam in Follow-wheel. In this part of the gait cycle, the user receives no assistance. The FSM passes from the last state to this once the input corresponding to the ankle height \(AH\) rises and exceeds the threshold \(ah_{3}\), representing the user carrying all their weight with the other foot. In this state, the lever becomes inactive, and the ankle goes up freely until it exceeds the threshold \(ah_{1}\), meaning the foot is about to take off from the ground. * Swing: The next state starts in Toe-off (purple line in Figure 3). The lever remains inactive while the cam is enabled and controlled to apply dorsiflexion of the ankle to avoid dragging the foot. * Swing low: This state, shown between the red and yellow vertical lines in Figure 3, is activated when the input \(AH\) goes below the threshold \(ah_{2}\) and is completed once the Heel-strike starts. This state is an intermediate state, preparing for the Heel-strike, to allow the lever to be activated before \(Susp_{Soft}\) raises an upper point. The cam is sent to the home position, consequently decreasing the dorsiflexion. * Heel-strike: This last state, occurring between the yellow and black vertical lines in Figure 3, is activated once the input of the contact heel \(HC\) is higher than a threshold \(hc\).