Abstract:

The purpose of the study was to design a flight control system with no pre-determined mathematical model, but instead using a genetic algorithm to maintain the optimal altitude. The study is done through a quantitative empirical research method. In the process of conducting the research, we found that programming a genetic algorithm was cumbersome for novice users to implement. Due to this, we created and released an open-source Python package called EasyGA.

An initial population of 15 chromosomes, 10 genes per chromosome with 100 generations, were used during one trial. The throttle value of the device had an associated gene value of 1 second. A minimum of 30 trials per robot were used to show statistical significance in the study. When the trials were completed, machine learning was achieved. Results showed that optimizing a one degree of freedom(DOF) device, in real-time, is possible without using a pre-determined mathematical model.

How it works:

In order to run the genetic algorithms needed for this experiment to be successful, an Arduino Uno, Python, Electronic Ducked Fan(EDF), Electric Speed Controller(ESC), an ultrasonic ranging module (USRM, and a laptop are required.

**Ardunio Uno: **Is an open-source micro controller board. This micro controller board comes with digital and analog pins. The pins have different purposes. Some pins are used for sending 3.3V and 5V power to other devices, and other pins are used as input, and output pins, which send pulse width modulation (PWM) signals to other devices.

Evolving Altitude Robot Wiring Diagram. Image by Author

For this experiment, digital pins 9, 10, and 11 will be used to send PWM signals and receive sensory information from the ultrasonic range module. Digital pin 9 (TRIG) is used for the signal output, pin 10 (ECHO) is used for the signal input, and pin 11 is used for PWM signals to the ESC.

**Arduino C++: **The code written on the Arduino is to receive directions from the python script in the form of throttle values. The Arduino then executes those instructions while also reading the heights from the USRM and transmits them back to python using serial communication.

**Python: **Python was used as the main language to handle the genetic algorithm while also sending directions to the Arduino.

**SQL Database: **A Sqlite3 database is used to store all running and configuration data coming from the robot and genetic algorithm. It is also used to find trends and query data.

One DOF device: The device is made up of an EDF fan, the USRM, a carbon fiber tube, assorted wiring, and three 3D printed parts: the intermediary connector, and platform. The platform for the device is designed to work functionally with all parts and pieces needed for the EDF to run. The EDF required that the 120mm x 20mm carbon fiber tube connect directly to the fan.

#arduino #python #ai #python #c++ #arduino.

Genetic Algorithm Robot: Evolving Altitude, using Python, C++ and an Arduino.
1.70 GEEK