In this section a brief description of the main controller of the drone is included.
The next picture shows the control diagram, which represents the global functioning of the main controller:
The main controller interacts with several devices (sensors and actuators). The drivers of these devices are loaded automatically by the main controller, by searching for them in a specified direction. So, several implementations of the drivers of each device can be developed and just putting them on a specified folder the main controller loads them automatically. Also it is possible to indicate to the main controller that a specified driver shouldn’t be loaded.
The code of the controller can be found in the next link:
The actuators and collectors included in the image are the IMU (inertial measurement unit), which it is used to obtain information about the attitude of the drone, the PWM which it is used to control the speed of the motors and the battery monitor which it is used to control the capacity of the battery.
The main controller is executed with a frequency of 50 Hz, that is to say, the main controller executes every 20 ms. All the code is written in Python although provides less computation time efficiency, it has these several advantages:
- It is quicker to program with it than with others
- It is being used a lot
- Its community is growing every day.
The hardware set can be seen in the next two pictures: