Close

Firmware and Flight Stacks

A project log for Goliath - A Gas Powered Quadcopter

A BIG Gas Powered Quadcopter

peter-mccloudPeter McCloud 01/08/2015 at 03:540 Comments

With the days shorter and the weather colder, I've had some time inside to dedicate towards figuring out the firmware. Early in the project I'd settled on the pixhawk (PX4) controller running the Ardupilot software. My goal was to modify the Ardupilot software to handle Goliath's unique control system. This seemed like a possible path since it had been done previously for the single and co-axial copter.

Now that I've had some time to learn the details of the hardware and related software I have a better understanding of the system and my options. To start with, there is the PX4 hardware. The hardware runs a Real Time Operating System (RTOS) called NuttX. The autopilot software, called a Flight Stack, which actually controls the vehicle, is run by the operating system. What I didn't know before is that in addition to the Ardupilot Flight Stack, the Pixhawk has it's own Flight Stack that the user can choose.

Ardupilot is open source and there is a large development community out there, the documentation for developers is somewhat lacking. Also as @J Groff pointed out, "it's quite a software thicket". It's doable (as demonstrated by the single and co-axial copters), but it'd be a significant amount of work to get the Ardupilot software modified for Goliath. The PX4 Flight Stack however has documentation on getting started as a developer and tutorials for developers to write their own Flight Stack. This seems like a better option, because I can get some simple code working to test Goliath out, and build up the code as Goliath matures. Once I get things nailed down, then I can work on integrating it with the rest of the PX4 Flight Stack.

I've created a fork to the PX4 Firmware and I've started with some basic code based off the tutorials. For now it resides as seprate module, so the code I'm writing lives under /src/modules/goliath_simple. So far I just have some basic logic to start the controller in a startup state (MAIN_STATE_INIT), initialize some variables and look for a valid RC signal. When a RC signal is received then the controller will be switched to another mode. (for now MAIN_STATE_MANUAL). My next steps will be add some basic logic to deal with the ignition and starter relays and to shut off the relays if the RC signal is lost. (This code is primarily meant for the test stand for now, so I want to make sure thing shutdown if I can't communicate with it.)

Things are still coming together on the actual hardware, hopefully just a few more items and it'll be back to the test stand to test out the changes.

Discussions