News & Updates

How We Developed Nebula Technology’s Rocket Flight Controller

This post is about my experience developing a rocket flight controller. If you spot anything that’s off, please let me know.
P.S. I study chemical engineering, so the technologies I used here were outside my field. Some of my terminology may be off. I’d appreciate any corrections…

I’m a member of the Nebula Technology team, where I’ve been responsible for the flight controller. Our first prototype used an Arduino Uno and an MPU6050. Its servo controller was simple and the software had no parachute deployment routine.

We released the code on the Nebula Technology website. It had quite a few problems, including servo jitter and overcorrection. I later revised the control software, and for the second iteration we switched from the Arduino Uno to a Seeeduino XIAO. The XIAO had fewer pins available for servo outputs, but it was smaller and had a more capable microcontroller than the ATmega328P.

In a later version, an unresolved issue sometimes caused the servo to lock up as the correction accumulated. I suspected the correction was increasing too quickly and going out of range.

The servo angle still jittered with the gyroscope level. The MPU6050 readings were fluctuating as well, so I suspected that sensor noise was making the servo jitter and tried filtering the readings.

I struggled to learn these algorithms. I hadn’t studied linear algebra at the time, and the code had all kinds of problems I didn’t know how to fix. The filter still had room for improvement, so please point out any mistakes you find.

For this hardware revision, I replaced the loose Dupont jumper wires with a simple PCB. At the time I suspected a supply-voltage mismatch on the particular MPU6050 module I had used. Some signal traces also looked too thin. Please let me know if you spot anything else I missed.

For the latest generation of the thrust-vectoring rocket, which we’re still working on, I designed a new PCB to replace the development board and 6050 module. It uses an ATmega328P as the main microcontroller and replaces the MPU6050 with a WitMotion JY901B. The JY901B has built-in filtering and a barometric altimeter, which saved me from rewriting the Kalman filter. This version added hardware self-tests, flight logging, GPS positioning, two-way Zigbee communication, and provision for a future staging feature. The PCB is shown below:

The two ribbon-cable connectors on the PCB connect it to the power board. I kept the controller and power boards separate to reduce the risk of excess current burning out the controller. The six-pin connector on the controller board is for GPS and Zigbee communications. The power board is shown below:

You’ll probably spot the large buzzer on the power PCB. It’s part of the startup self-test. If the checks pass, a MOSFET switches on the buzzer so it beeps.

While designing this PCB, I learned how important it is to handle analog and digital grounds carefully. My approach was to reference the analog supply to analog ground and the digital supply to digital ground, and to avoid referencing a different layer unless necessary. I also avoided routing traces across the analog and digital regions. For example, I kept analog ground out from under digital traces. I grouped analog and digital components separately and put the boundary through the A/D converter. I used an analog ground pour for analog signals and a single-point connection through an inductor or ferrite bead between the analog ground or supply and the digital supply.

I wrote up a few other lessons as well. Once I’ve finished the document, I’ll upload it to the forum.

For this iteration, I revised the attitude controller for the three Euler angles.

I also learned how to detect and switch between phases of flight, from startup tests to descent and parachute recovery. I used two sensor-based checks to decide when to deploy the parachute.

If you know of better ways to decide when to deploy the parachute, I’d appreciate your advice. I want the recovery system to be as reliable as possible.

To make it easier to see the rocket’s attitude, I used the ANO flight-control ground station and its protocol to monitor attitude, altitude, and other data.

I ran into plenty of pitfalls during the build. Here are a few things I wish I’d known when I started working on rocket flight electronics:

1. Don’t use a development board’s 5V or 3.3V rail to power other components. My Seeeduino XIAO board above is an example of what can go wrong. A high-power component can reset the development board, with serious consequences.

2. High-current devices such as servos need their own supply. A dedicated regulated 5V supply for the servos can help keep their current draw from affecting the other electronics.

3. Don’t use a battery with too high a voltage. Connect a battery delivering more than 7V to a 5V input and you really might see smoke.

4. Avoid soldering the JY901B directly to the board by its castellated pads. Repeated hot-air heating can damage the built-in barometric altimeter.

5. Use plenty of silkscreen labels: connector pinouts, board name, date, version number, and any other notes. They’re like comments in code! This is especially important when one person designs the board and someone else assembles it.

6. Keep components away from the edge of the board, where they can get knocked off. This matters especially for the crystal oscillator, since edge placement can also cause EMI problems. Keep the crystal as close to the chip as possible, avoid routing traces underneath it, and use a ground pour there. When distributing a clock to multiple devices, route it as a clock tree. 

7. Lay out the PCB in functional blocks. First, make each block compact and optimize its vias, traces, and copper pours. Use vias to fan out power and ground connections where possible, so you can route around them later. Minimize layer changes on signal traces to keep the via count down.

8. Place vias close to power and ground pins. Keep the traces between the pins and vias as short as possible to limit inductance. Make power and ground traces as wide as possible to reduce impedance.

9. The 0402 package is about as small as I can solder by hand. I strongly recommend larger components to make assembly easier.

10. The 3.3V rail is usually the main supply. With a dedicated power plane, it’s easy to use vias to distribute it across the board. 

The 5V rail may only serve as the power input, in which case you only need a copper pour in a small area. Keep it as wide as you can. 

11. I recommend VS Code for development. Pairing it with Copilot really speeds things up.

One last preview: we plan to finish building our latest thrust-vectoring rocket over winter break.

Hi, I’m 005

Leave a Reply

Your email address will not be published. Required fields are marked *