Kvålsvoll Design Audio Forum

EnglishEnglish text EN    NorskNorsk text NO
Forum Navigation
Please to create posts and topics.

Drone Control

Control of flying drones - the parts

A typical flying drone, with rotors driven by electric motors. How does it work, what do we need to make to be able to control its flight.

Dividing the problem into separate tasks makes the system manageable, and as we will see, code and system parts can then be reused on very different types of drones, providing reuse of the technology developed.

Now, why not just simply make a black box with an AI, just make all sensors and control input go into that, and the output controls the motors and gives feedback to the user, whether the user is an autonomous drone control system or a person flying the drone. Simply because it is not a good solution, as it makes it harder to develop and make solutions that are reusable. For a small, simple drone it will also be unnecessary demanding on the control computer, the computer needs to be quite powerful to be able to run such a system compared to a simple flight controller.

Flight control

Control the individual motors to provide stable flight in requested direction and speed.

Input: Sensor signals from motor speed, inertial acceleration, drone actual speed, requested speed vector.

Output: Speed and torque for each motor.

This system provides stable flight for the drone, and takes a simple speed vector as control input, so it follows a requested direction with a requested speed.

This part is hard real-time, and there is no need for any AI in here.

Path control

Gives the drone a trajectory to follow, this can be fully autonomous, or manual from a person flying the drone.

Obviously real-time, but typically less strict for timing and not very fast sample frequencies.

Decision making

Make decisions based on situation awareness by processing data from sensors and supporting applications. This can make the drone fully autonomous.

Also real-time, but typically not very time-critical.

Applications

This can be camera and video processing and distribution, and other systems that the drone is equipped with for specific purposes.

 

Real-time vs fast

Real-time in computing means predictable behavior related to time. Has nothing to with fast or slow response time, really, a real-time system can be slow, say a temperature control system with a sample rate of 2 minutes, it is just that the control algorithm is guaranteed to run and complete exactly each 2 minutes.

A video camera processing unit may run at a sample rate of 120 frames per second, and require complex computing involving AI image processing for each frame. But it is not necessarily hard-real-time, it can be acceptable to loose frames now and then. Depends on usage; if it is for monitoring and surveillance, lost frames are acceptable, if it is a sensor used for real-time motion control, a lost frame can make the drone crash. Then it is a hard real-time system, where each frame must be guaranteed to run and be completely processed every 1/120 second.

the flight control of a drone is a hard real-time system. Sample rate required will depend on the drone; small drone -> faster, large heavy drone -> slower. Because the required sample rate depends on the dynamics of the physical system.

Hard real-time computing sets some very special requirements for both hardware and software. The software needs to run on a real-time operating system, and there are specific rules that is to be followed to ensure predictable operation, such as static memory management with no dynamic memory allocation, predictable exception handling.

You probably have observed that your laptop needs to be rebooted after some use, the browser becomes slower after some use and needs to be restarted. In a real-time system, such software is not acceptable. Real-time software needs to be able to start and then run forever, with no need for a restart due to memory being fragmented or dynamically created processes slowing down the system.