THE FLIGHT COMPUTER
I’ve been working on the electronics and software for the rocket, and honestly.. this part was probably even more annoying than designing the rocket itself 😭
The flight computer is based around an ESP32-CAM, with the camera running separately from the sensors. Core 0 handles the camera and video, while Core 1 handles the MPU-6050, BMP280, flight state and telemetry.
THE FLIGHT COMPUTER
The main idea is pretty simple.
The MPU-6050 measures acceleration and rotation, while the BMP280 measures pressure and therefore altitude. The ESP32 then uses this data to figure out what the rocket is doing.
There are currently different flight states:
IDLE -> ARMED -> BOOST -> COAST -> APOGEE -> DESCENT -> LANDED
So basically, the computer is constantly asking itself:
“WHAT IS THE ROCKET DOING RIGHT NOW??”
The sensor system runs at 100 Hz for the MPU-6050 and 50 Hz for the BMP280, so it should get plenty of data during the flight.
CALIBRATION 💽
And this is where I found one of the bigger problems.
Originally, the computer automatically started a calibration when it booted. It would tell me to keep it still, wait 3 seconds, and then take 500 samples from the MPU-6050.
But that isn’t really what I want.
I don’t want the calibration to happen whenever the ESP32 starts.
I want to put the rocket exactly where I want it, then press a button:
START POS
And that’s it.
The computer takes the current sensor values and uses them as the starting reference.
So the current position becomes the calibrated starting position, and the altitude gets reset to the launch position as well.
This also makes way more sense for the rocket because I can power everything on, put it on the launch rail, make sure everything is positioned correctly and then press the button.
Much better.
LASTLY
The code was horrible to write. I hope that it was worth it in the end, as I really want a video and flight data in the end of the first flight.
Next up is the assembly of the rocket, sanding, painting and glueing, yeah!
Like and Follow ig
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.