Inspiration
Our goal is to create an ultra-small drone that could sustain stable flight. After identifying the critical parameters—such as body dimensions, propeller size, motor weight, and battery placement—I began 3D printing and testing prototypes. However, this trial-and-error process quickly became inefficient. To streamline development, I shifted to a data-driven approach: modeling the drone’s motion and analyzing its inertial properties to predict stability. While I have been working on the project for the while, I only started the data analysis part a few days ago.
What it does
Our model crunches large amounts of data to predict meaningful results. I trained a model on the millions of lines of code, which allow us to identify optimal hotspot for parameters of the drone (10 in total: Ixx,Iyy, Izz, Ixz,Ixy,Izy,ComX, ComY, ComZ, Offset of motor). This way, I do not have to trial and error everything. I then used many different techniques to gather the information I want.
Generating Data
Initially, I used Matlab to model the motion of the copter. To do this, I used Ode45 to solve equations called euler's equations for rigid body dynamics. This accurately represents the scenario which is a rotating drone. I modeled the counter rotation from the propeller as having a specific angular velocity. I got this from momentum conservation, since I know the propeller's angular velocity - and our drone only has one offset propeller. Additionally, I modeled the torque from the propeller as a different force. Our y value was a ratio which was the magnitude of the angular velocity in the z direction (good) versus the magnitude of angular velocities in the other two directions (bad).
Creating a NN Model
I then trained a neural network to come up with a full predictor model based on our data as I took discrete step sizes (each ode45 took quite a while to solve). The model takes 10 input features and passes them through a sequence of dense (fully connected) layers. The first hidden layer has 64 neurons with ReLU activation and an L2 regularization penalty of 0.001 on the weights. The output of that feeds into a second hidden layer with 32 neurons, also using ReLU and the same L2 regularization, followed by a third hidden layer with 16 neurons under the same settings. Finally, there is a single linear output neuron (no activation) that produces the predicted continuous value. The model is trained using the Adam optimizer, with mean squared error (MSE) as the loss function, and mean absolute error (MAE) tracked as an additional metric. Training is done for 100 epochs, with a batch size of 1024, and the dataset is split 80% training / 20% validation after being standardized using a StandardScaler.
Challenges we ran into
Since our data was so large, it was hard to not only generate it but train on it. Therefore, I used google cloud to help alleviate our computer from this task. I created a virtual machine with 128gb of memory and 32 cpu cores to crank on the data, and used an nvidia l4 to train the model . Our data was gotten in the night, and I trained 100 epochs in a day, all for very little money.
Accomplishments that we're proud of
Our validation accuracy for the neural network was 91%, so I was happy with that metric, as well as all the findings I was able to derive from our model. I analysed the data using heatmaps, scatter plots, correlation matrices, and found ways to make the drone even better. I have a lot of learnings which will be shared in the video.
Built With
- ai
- cloud
- ml
- python
- tensorflow
Log in or sign up for Devpost to join the conversation.