Building a Quadrotor

Putting the Applied in Applied Mathematics

From simulation to the real world

After completing my applied mathematics research project on nonlinear quadrotor control, I wanted to take the work a step further. The research had involved developing a nonlinear flight simulator in Python and comparing three approaches to autonomous control: proportional-integral-derivative (PID) control, linear quadratic regulation (LQR) and proximal policy optimisation (PPO), a reinforcement learning algorithm.

The results were interesting. In the scenarios I tested, PID emerged as the most reliable overall, particularly in terms of settling time and robustness. LQR performed well in several conditions, while PPO demonstrated some promising behaviour but struggled to generalise across the more demanding scenarios.

That left me with a rather obvious question: what would happen if I actually built the aircraft?

I wanted to put the applied in applied mathematics, so to speak. A simulator is an excellent environment for investigating control algorithms, since it allows us to isolate variables, introduce disturbances and repeat experiments under controlled conditions. But there's quite a difference between stabilising a simulated twelve-dimensional state vector and getting an actual quadrotor airborne.

In the physical world, one has to contend with the less glamorous but equally important details of engineering: selecting components, distributing electrical power, managing vibration, calibrating sensors and, of course, making sure everything stays in one piece.

So I decided to build an F450 quadrotor as a physical platform for further experimentation, with the longer-term objective of developing onboard computer vision and autonomous flight capabilities.

The assembled aircraft on the field before flight testing.
Figure 1: The assembled aircraft on the field before flight testing.

Selecting the hardware

Given the results of my research, I decided to begin with a conventional PID-based flight-control architecture. For this I selected the Holybro Pixhawk 6C Mini, running PX4, which provides an established flight-control system with configurable attitude and angular-rate control loops.

This wasn't a matter of transferring the PID gains directly from my numerical model to the aircraft. The physical system has its own dynamics, sensors, actuator characteristics and control architecture, so calibration and tuning are necessary. Nevertheless, it gave me a sensible and well-supported starting point.

For propulsion, I selected four 2212-class brushless motors, rated at approximately 920KV, paired with electronic speed controllers and 10-inch propellers.

My initial estimate for the aircraft was approximately 1 kg, but I also wanted to accommodate a prospective additional payload of 350–400 g for the Jetson Orin Nano, its power electronics and mounting hardware. That meant looking beyond whether the motors could simply lift the aircraft. They needed to provide adequate thrust margin for control authority, manoeuvring and disturbances, without pushing the project into an unnecessarily expensive class of components.

Cost was a consideration throughout the build. I wanted a capable research platform, not an exercise in purchasing the most expensive hardware available.

The remaining components included a 3S LiPo battery, GPS module, electronic speed controllers and an ExpressLRS radio link through a RadioMaster transmitter.

With the main hardware selected, I could begin putting everything together.

Power distribution, soldering and assembly

The F450 frame was relatively straightforward to assemble, but the electrical integration required considerably more care.

The airframe and flight electronics during assembly, with the power components and motors still being connected.
Figure 2: The airframe and flight electronics during assembly, with the power components and motors still being connected.
The power-distribution plate and motor-controller wiring.
Figure 3: The power-distribution plate and motor-controller wiring.

Each motor had its own electronic speed controller (ESC), which needed to receive power from the battery and control signals from the flight controller. I soldered the ESC power leads directly to the power distribution board, paying particular attention to polarity, insulation and the mechanical integrity of the connections.

Before connecting the battery, I checked the connections for continuity and unintended shorts. It's a fairly mundane step, but one that is worth doing properly when a wiring mistake can damage a flight controller, ESC or battery.

Underside view of the distribution assembly.
Figure 4: Underside view of the distribution assembly.
Soldered connections and the battery connector on the distribution plate.
Figure 5: Soldered connections and the battery connector on the distribution plate.

I also used foam vibration-damping material around the flight-controller installation to help isolate the onboard inertial sensors from mechanical vibration. Since the IMU provides measurements used by the stabilisation system, the quality of those measurements matters just as much as the controller processing them.

The power module during assembly.
Figure 6: The power module during assembly.

Once the electrical components were installed, the next challenge was getting the wiring under control. There were cables coming from almost every direction, and the available space on the frame was rather limited.

After a generous number of cable ties and Velcro straps, the result began to resemble an aircraft rather than a collection of components on my desk.

An unexpected problem with the propellers

One of the more entertaining difficulties arose when I tried to fit the propellers.

I had ordered 10-inch propellers compatible with the motor and airframe configuration, but I hadn't paid sufficient attention to the diameter of the propeller hub bore relative to the motor's mounting shaft.

The propellers needed to be reamed to fit correctly.

I bought a dedicated propeller reamer, expecting this to be a quick job. Unfortunately, after a few turns, the tool had become practically blunt.

Blue-handled stepped reamer beside two black propellers.
Figure 7: The stepped reamer used to fit the propeller hubs.

Rather than spend the afternoon fighting with it, I improvised with a drill to drive the reamer. It was one of those moments where a seemingly trivial component turned into a much larger exercise than anticipated.

The important engineering consideration, however, was maintaining a correctly centred bore. If the propeller is mounted off-centre, it introduces imbalance and vibration during rotation. That vibration can affect both the mechanical system and the measurements taken by the flight controller.

For future builds, I'd favour correctly sized propeller adapters or a purpose-built, properly supported reaming setup. Improvisation can be useful in a workshop, but a rotating propeller is not a component on which to compromise alignment or safety.

Communications, failsafes and first power-up

With the mechanical assembly largely complete, I moved on to the radio system.

I used an ExpressLRS receiver paired with a RadioMaster Pocket transmitter, arranging the receiver antennas to provide useful orientation diversity and reduce the likelihood of losing the radio link as the aircraft changes attitude.

The transmitter was particularly important for the initial flight tests, as well as providing a means of manual intervention while developing more advanced autonomy.

The RadioMaster transmitter used with the aircraft.
Figure 8: The RadioMaster transmitter used with the aircraft.

I configured the flight modes and emergency controls, including a dedicated motor-stop function and radio-link-loss failsafe behaviour.

Radio setup interface showing roll, pitch, yaw and throttle channels.
Figure 9: Radio configuration during flight-controller setup.

One thing that becomes immediately apparent when moving from simulation to physical hardware is the importance of planning for failure.

In a simulation, a poorly tuned controller might send the aircraft into the ground, after which one can reset the environment and try again. With an actual quadrotor, the consequences involve real equipment, potentially nearby people and a rather less convenient reset procedure.

I therefore treated safety as part of the engineering process rather than something to consider at the end.

That extended to the battery. Lithium-polymer batteries require appropriate charging, storage, transportation and fire precautions, including a suitable protective carrying case and appropriate firefighting provisions. A battery fire can involve thermal runaway, so simply suppressing visible flames does not necessarily eliminate the underlying hazard.

After the electrical checks, radio setup and calibration, I proceeded with controlled motor testing, initially without the propellers installed, to verify the motor assignments, rotation directions and basic system responses.

Then it was time to fly.

First flight

I took the quadrotor to an open field near the University of Cape Town for its initial flight and hover tests.

There was a reasonable breeze, approximately 6 knots with gusts reaching around 10 knots, which wasn't necessarily ideal for a first flight but did provide an opportunity to observe the aircraft under modest environmental disturbances.

After completing the preflight checks, I armed the motors and gradually increased the throttle.

The aircraft lifted off.

A frame from the original field-test video.
Figure 10: A frame from the original field-test video.

It was particularly satisfying to see something that had started as a collection of mathematical equations, Python code and components scattered across my desk actually become airborne.

The quadrotor maintained an approximately stable hover, and the initial behaviour was encouraging. The PID-based flight-control system was clearly providing sufficient stabilisation for these preliminary tests.

I should emphasise that this was not a rigorous experimental validation of the controller. A proper evaluation would require examining flight logs, tracking errors, attitude responses, disturbance rejection and performance over repeated trials.

For now, the objective was more fundamental: verify that the aircraft could take off, remain controllable and land safely.

That milestone was achieved.

Designing the Jetson Orin Nano mount

With the aircraft airborne, I could begin working toward the next phase of the project: adding onboard computing.

My intention is to use an NVIDIA Jetson Orin Nano as a companion computer for computer vision, perception and higher-level autonomous decision-making, while retaining the Pixhawk as the dedicated flight-control system.

This required a suitable mounting solution.

I designed a custom support in Autodesk Fusion, using the mounting geometry of the F450 frame as the starting point. The objective was to position the Jetson above the central flight-controller assembly while maintaining adequate clearance, airflow and access to the electronics.

The design also needed to account for the additional payload mass, cable routing and vibration, without making future maintenance unnecessarily difficult.

I modelled the mounting feet, support surfaces and fastening points, then manufactured the part using a 3D printer.

The companion-computer support during printing.
Figure 11: The companion-computer support during printing.
The underside of the printed part, including its mounting feet.
Figure 12: The underside of the printed part, including its mounting feet.
The recessed upper surface of the mount.
Figure 13: The recessed upper surface of the mount.
The Jetson fitted into its printed support on the bench.
Figure 14: The Jetson fitted into its printed support on the bench.

Seeing a component move from a CAD model to a physical part that fits into the aircraft is a satisfying process in its own right. It also highlights how many small constraints have to be reconciled in hardware integration: a few millimetres of clearance, a misplaced mounting hole or an inaccessible connector can make an otherwise reasonable design rather impractical.

The mounting structure is now part of the ongoing integration work for the companion computer.

The next step: perception and autonomy

The aircraft can now fly, but my longer-term objective is for it to do considerably more than respond to commands from a handheld transmitter.

I want to develop an autonomy system that allows an operator to issue a high-level instruction from a ground control station, such as identifying a particular target, navigating toward it and monitoring the surrounding environment.

That requires a complete sequence of capabilities: interpreting the instruction, detecting the target, estimating its position relative to the aircraft, planning an appropriate trajectory and translating that plan into commands that the flight controller can execute safely.

The Jetson would handle the more computationally demanding perception and planning tasks, while the Pixhawk would continue to manage the lower-level flight-control loops.

Eventually, I would like to explore tasks such as visual target tracking, autonomous navigation and landing, particularly in environments where conventional GPS-based positioning may be unreliable or unavailable.

There is a broader reason why I find this work exciting. Although the dynamics of a quadrotor are very different from those of a satellite, spacecraft or helicopter operating in the Martian atmosphere, many of the underlying systems-engineering challenges are related: sensing, state estimation, planning, feedback control and reliable autonomous operation.

The same general principles can therefore be carried into increasingly sophisticated aerospace systems, even though their physical models, environmental constraints and implementations differ substantially.

Reflections and what comes next

Perhaps the most rewarding part of this project has been seeing the connection between the mathematics and the hardware.

My original research focused on numerical models and control algorithms. Building the physical aircraft introduced an entirely different set of challenges, from choosing the right propulsion system to soldering electrical connections, dealing with propeller tolerances and designing mechanical components.

Each stage demanded a slightly different way of thinking, but all of them contributed to the same objective.

What started as a study of nonlinear dynamics has become a platform on which I can continue experimenting with control, computer vision and autonomous systems.

There's still plenty to do, particularly with the Jetson integration and the development of the perception and navigation stack. I'll continue updating this article as the work progresses, including the inevitable problems, design changes and lessons along the way.

For now, though, it's been an immensely enjoyable experience to go from first-principles mathematics to a physical aircraft that I've assembled, tested and flown.