## 2 Design, Modeling, and Control
### Communication  
Regarding the communication, it was decided to use serial protocol. The adopted communication strategy for the vehicle was chosen based on its reliability, simplicity, and robustness. Considering this, the serial communication channels were used. The Teensy 4.1 board uses the USB port to communicate with the main board, bidirectionally, through the defined message structure. To communicate with the microcontrollers placed on the joints, the board uses 4 dedicated serial ports, each one predefined to a leg, which allows the software to always know to/from which leg it is transmitting/receiving. In each leg, a serial bus is implemented, through a board that allows for hardware connections to be easily performed, as well as to protect the general purpose input output (GPIO). Figure 10 presents the diagram that demonstrates the implemented connections, representing the example of only one leg. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Quantity** & **Reference** & **Description** & **Price Range (Unit.)** \\ \hline
1 & TEENSY41 & Teensy 4.1 & 35–40 € \\
12 & ABX00032 & Arduino Nano 33 IOT & 18–22 € \\
12 & ARD03162 & Arduino Nano I/O Expansion Board & 5–8 € \\
8 & CQRGL20180525-52 GB & 12 V DC Motor with Encoder and 210:1 Gearbox & 28–32 € \\
4 & CQR37D64 CPR70 GR & 12 V DC Motor with Encoder and 70:1 Gearbox & 28–32 € \\
4 & CQR37D64 CPR43.8 GR & 12 V DC Motor with Encoder and 43.8:1 Gearbox & 28–32 € \\
8 & BTS7960 & High Power Motor Driver Module & 16–20 € \\
8 & DRV8871 & Adafruit DC Motor Driver Breakout Board & 6–10 € \\
8 & TAL 220 & 10 kg Load Cell & 8–12 € \\
8 & HX711 & Load Cell Amplifier & 10–14 € \\
12 & AS5048A & High-Resolution Rotary Position Sensor & 6–10 € \\
8 & AS5048B & High-Resolution Rotary Position Sensor & 6–10 € \\
16 & \(59025+57025\) & Reed Switch + Magnet & 4–6 € \\
64 & S-1148 & Traction Spring & 1–3 € \\
8 & FRT-K2-103 & Continuous Rotation Damper & 53–57 € \\
4 & RB-Nex-49 & 100 mm Plastic Omni Wheel & 10–14 € \\
4 & 905225 & 100 mm/83 A Powerslide Swell Rubber Wheel & 5–9 € \\ n/a & n/a & PLA Printing Material & 32–40 € \\ n/a & n/a & Jumper Wire Cables & 16–20 € \\ n/a & n/a & Screws & 40–60 € \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Components and price range for the prototype construction. The USB port can also be used simultaneously with the serial communication through the GPIO, by connecting it directly to the main microcontroller, through the software Joint Tune (presented in Figure 11a), created specifically for this purpose. One of the reasons for this software creation was to test each of the joints individually to obtain, for example, local parameters or graphics from each of the joints. Another reason was to easily and quickly debug one of the hardware components, the DC motor for example, enabling local tests without the need to actuate the entire system. This software was very important to collect the required data to obtain the joint and motor models that are presented. Another important task enabled by this software is the controller implementation and testing. Figure 10: Single leg communication diagram. The Arduino joint firmware can communicate in two independent ways--USB and SERIAL--and, as far as possible, maintain the working compatibility of both modes. This enables the use of the Robot Tune application (presented in Figure 10(b)) to control the robot, which communicates through USB with the main computer and, at the same time, controls each joint individually through the serial port. This duality allows, for example, the tuning of parameters in real time, as well as their recording to flash memory, obtaining data directly from the Arduino, and debugging serial communications, among others. The communication dynamics between the multiple applications and processing boards is shown in Figure 12.  
Figure 11: Joint Tune and Robot Tune. An important feature is the possibility of remote OTA (Over-the-air) firmware upload to the Arduino boards.