First, some pending matters from previous weeks:

📝 Software Architecture

The software was divided into: library back-end, robot modelling, app front-end and firmware.

💾 Software Repository

Everything we code for LibScoutR can be found in the following link: ▪https://github.com/mizidoro/LibScoutR

🧩 Software Modeling

Class diagram for the objects that model the robot:

Class diagram

Class diagram

🦿 Firmware Code for Robot Movement

The movement of the robot was coded by @Matheus Izidoro in Arduino and will be interfaced to the raspberry, where all the logic to where to move sits.

The line following code uses a PID algorithm to move the robot without any abrupt turns, this way we can have better readings of the camera.

📋 Firmware Activity Flowchart

The firmware execution is basically divided into two subroutines: Setup and Loop.

Setup subroutine is responsible to get all the sensors, motor interfaces and serial communication up for the robot to be able to move around the library, acquire positioning data and communicate with the Raspberry.

Loop is the main subroutine that will be running in almost the whole time. The Loop subroutine will be waiting for Raspberry to send commands then executing the actions that achieve the command desired result. The following flowchart describes how the firmware behavior in runtime:

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/98515b80-deb6-4001-94c7-a3a104a5f78e/Flowchart.jpg

📈 PID Controller

As we want the robot to follow the lines the most accurate possible way allowing the cameras to get better images of the books borders, we needed to implement a kind of control that can correct the position of the robot proportionally to its difference to black lines, summed over time and responding the fastest as possible. That's what PID controllers do. PID stands for proportional, integral and derivative control.