Real-Time Rocket Attitude Display

An attempt at tracking a model rocket's orientation in real time with an MPU6050 6-axis IMU.

  • Taoyuan Vocational HS (NTUT-affiliated)
  • HS Year 1
  • 2022
  • Solo project
A computer screen showing a tilted 3D rocket model

Background

The whole reason we got into model rockets was to make one that could take off and land vertically and be reused, just like SpaceX. We knew that even for a model rocket this would be really hard, maybe close to impossible, but our little group of dreamers wanted to give it a shot anyway. Around then I happened to be stuck at home in quarantine with nothing to do, so I started figuring out how to read the rocket’s attitude.

How It Works

  1. Read the MPU6050 6-axis accelerometer/gyro over I2C
  2. The sensor gives raw 3-axis acceleration and 3-axis angular velocity, so I used a Kalman filter plus integration to get the relative angles
  3. Send the data back to Python with pyserial
  4. Use the Python library Panda3D to render the rocket model at its live angle

Reflections

This project was a bit of a stretch for me at the time. There were basically no Chinese tutorials online about integrating angular velocity into angles or filtering out noise, so I had to go dig through English-language forums. That’s when I discovered a whole new world: it turns out I could actually understand English resources! I’d hit a word I didn’t know now and then, but I could usually guess the meaning. From there I followed some English tutorials and got accurate angle data.

The next challenge was displaying a 3D model in Python. If you want a nice-looking 3D model, Panda3D is pretty much the go-to Python library, but it also didn’t have many resources, so I kept surfing English sites.

The project might look simple, but it trained me to hunt for answers on English forums and read library documentation, which has had a huge impact on the projects I’ve done since.