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

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

This post lets us create a publisher and subscriber messaging app using Azure Web PubSub Service and C#. In the previous post, Getting Started with Azure Web PubSub Service; we have learned how to create Azure Web PubSub Service in the Azure Portal and tested the messaging using one sample application.

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.

What is Geek Coin

What is GeekCash, Geek Token

Best Visual Studio Code Themes of 2021

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

top 30 Python Tips and Tricks for Beginners

In this post, we'll learn top 30 Python Tips and Tricks for Beginners

Lambda, Map, Filter functions in python

You can learn how to use Lambda,Map,Filter function in python with Advance code examples. Please read this article

Python vs C++: Difference Between Python and C++ [2021]

Python vs C++: Difference Between Python and C++ [2021]. Python and C++ as to which is the better learning tool in the programming paradigm. However, there is no right answer to that. Python is more suitable for web programming while C++ scores where hardware-related programming is concerned. In any case, both languages differ from each other in a number of ways and have varied uses.

Python vs C++: Difference Between Python and C++ [2021]

In this tutorial, we will look at the features and applications of both programming languages and draw a comparison between the two. So, let’s get started!

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

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.