My new simple funfly quad/hexa flight controller - RC Groups
Thread Tools
This thread is privately moderated by timecop, who may elect to delete unwanted replies.
Jun 24, 2011, 09:21 PM
Suspended Account

My new simple funfly quad/hexa flight controller

Where's the innovation in multirotor scene? You can count the number of people actually moving it forward on the fingers of one hand. The rest just rehash same old boring designs and stagnate development by copy pasting the same boring code.

Despite 8bit MCUs being totally dead I thought I'll give them one last chance, but instead of using old and boring Atmel stuff, I went for a more modern device that actually runs at 3V and has proper bootloader, proper ICD, etc. I HATE pcb standoffs. So the other requirement was only in-plane mounted sensors. No surprise, but digital sensors still suck. So I went for analog XY/Z gyros from invensense (IDG/Z500), and SPI digital accel (ADXL345) from ADI. Yes, its digital output but it's SPI and I can clock it at 8MHz instead of ridiculous 100-400kHz joke of a bus that Nintendo accessory tear down crew keeps using.

It's 2011, and anyone still using giant receivers with 12 channels lined up on a 2.54mm spaced row of headers is living in the past. The board only takes PPM input - single servo wire for up to 12 (or more?) channels. When someone donates me a SBus receiver I might change my mind, but seeing how it's limited to Futaba and their extremely overpriced gear, I doubt anyone would be willing to part with one. So I will keep using my FrSky combo which can output PPM with firmware update, and I'm first in line to get a bunch of D4FR which output PPM by simply jumpering 2 pins.

ADC on STM8S is very fast (and accurate) unlike the craptastic job on ATMega parts, and actually has a properly working buffered scan mode which fires a end-of-conversion interrupt after ALL the channels have been scanned and makes all conversion results available in a buffer. Why do people keep wasting time with megaAVR? The mind boggles. Then there's the whole deal about hardware PWM and 16bit timers which STM8S has plenty of. I'm using one timer for PPM input (with 1us precision), 2 timers for 6 PWM outputs (4+2), also with > 1us precision, allowing me to have any configuration of tri/quad/hexa, and each PWM channel can have different PWM period - so for a servo on a tri I don't need to go through stupid divider hoops to get things going. And since this is hardware-controlled PWM there's no jitter or timing issues. Looks smooth down to 10ns/div.

Current firmware I have is a very simple gyro-only rate mode flight with a basic quad+ mixer. Accelerometer and ADC are sampled in a loop, without any averaging or smoothing. That loop runs at ~5khz before rate-mode mixer is added in, which slows the main loop down to ~3khz. I need to figure out a simple way to integrate accelerometer data for auto-leveling, but I'm having too much fun flying in rate mode anyway. Since i'm not limited to 4 control channels with PPM, I have plenty of switches and knobs to assign to various things on the controller.

UPDATE: rev2 hardware has been tested and should work.

Board with SPI analyzer attached making sure the accel is alive (and it is)

BlueSkyRC xRotor plywood frame based quad for testing the controller:

First it was raining here for weeks and now its hot + windy, so not really an ideal flying environment, especially combined with my crap flying.

AfroFlight windy day flying (1 min 4 sec)

Update: I created a googlecode project for this hardware and for shrediquette C-port. It's available here:

And to make things a litte bit more interesting, I hand-soldered a prototype STM32F2xx-based flight control which takes my standard AfroSense sensor boards - No firmware for that is ready at all, but I'm thinking I should be able to do some simple rate-mode gyro code for it soon
Last edited by timecop; Oct 09, 2011 at 12:59 AM.
Sign up now
to remove ads between posts
Jun 24, 2011, 09:49 PM
No thrust...It'll bust...
troynh's Avatar
You've got my attention...

Jun 25, 2011, 12:20 PM
Gravity sucks :)
subscribed, looking forward to replace multiwii fc on my fun quad
Jun 27, 2011, 03:59 AM
Registered User
SirFishaLot's Avatar
I hope you get paid well, you talented MF'er
Jun 28, 2011, 01:17 PM
Design > Build > Fly
Qrome's Avatar
Oh my gosh! Subscribed. Cool!
Jul 08, 2011, 02:25 PM
3rdeyepro's Avatar
Would love to try one, PM me.
Jul 11, 2011, 09:09 AM
Registered User
way to go farward with stm32 bases quads
is it possible to make this code compatible to copter control
Jul 12, 2011, 07:52 AM
Suspended Account
I suspect openpilot will have stm32f2-based platform soon enough.
Jul 15, 2011, 06:37 AM
Suspended Account
now it can flip.

AfroFlight doing its first [intentional] flip (0 min 46 sec)
Jul 15, 2011, 07:19 AM
Design > Build > Fly
Qrome's Avatar
Great job! I knew you had it in you!
Jul 20, 2011, 08:24 AM
Suspended Account
Built a Y6 with the same controller.

AfroFlight Y6 mixer working (0 min 43 sec)

Works pretty good, though I think I should be using 8" props instead of 10"...
Aug 09, 2011, 01:34 AM
Registered User
i am already impressive by your quality pcb soldering
what are you using to soldering your board?do you use a simple reworkstation?
which kind of software do you use for create your own board??
you work is very incredible!!
Aug 19, 2011, 12:17 AM
OpenAeroVTOL developer
HappySundays's Avatar


Hi timecop,
Well I'm impressed. Starting from scratch is often the best.
But making your own ESCs? that's hard code dude!
I also use Frsky gear but am not sure there is PPM available on the receivers I use.
How's the auto-level development going?

What plans do you have to stock this little guy?
Last edited by HappySundays; Aug 19, 2011 at 12:57 AM. Reason: Always room for more questions...
Aug 19, 2011, 01:35 AM
Suspended Account
Some FrSky receivers have PPM output by default. Like V8RSP, etc.
The D8R I use needs to be reflashed to allow PPM output on CH8. This is documented on FrSky website. The new D4FR micro receiver outputs PPM and RSSI by shorting a free channel. Very nice way of doing it. I think any new product from FrSky will have PPM out one way or another. Some of the older V8 receivers can also be reflashed for PPM. I've not looked into that as I use the telemetry mode only.

This proj is currently on hold since I blew an ESC in the test quad and didn't want to order more plush+etc, which is one of the reasons I got back into the ESC project. Now that's done I can resume work on the FC one way or another.
Aug 31, 2011, 11:02 AM
Suspended Account
I was bored and thought, why not?
Ported multiwii to the STM8 board.

It seems to work (I need to do RC input still and motor output) but the GUI is getting proper data. Very little modifications were needed to the code.
I basically stuck tarduino-specific garbage into sysdep.c/.h and #ifdef STM8 the rest.

Code is at afrodevices repository,
It mostly reuses sensor reading code from AfroFlight for ADC/SPI.
This is untested and all, I burned ADC inputs on my test PCB and I need to make another one. PPM input and Motor output is still not implemented (need to ifdef it all out and replace with code from AfroFlight).

Some issue with model randomly deciding its turned upside down:
AfroWii 1.8 patch1 strange flipping (0 min 26 sec)

Figured it out, works fine now.
Last edited by timecop; Aug 31, 2011 at 01:18 PM.

Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
Build Log Build KapteinKUKs Simple and Low Part Count Quad, Hex and Tricopter Flight Controller kapteinkuk Multirotor Drone Electronics 12226 Aug 28, 2016 01:39 PM
Build Log Building a palm size quad-copter & Introducing a new simple flight controller thanhTran Mini Multirotor Drones 1393 Sep 16, 2014 04:40 PM
Discussion Different flight characteristics Quad vs Hexa Connexxion Multirotor Drone Talk 9 Mar 18, 2011 03:07 PM
Found Want to Trade FY-90Q Quad Controller for differnt Quad controller FL62 Aircraft - Electric - Helis (FS/W) 5 Mar 11, 2011 07:43 PM