HobbyKing.com New Products Flash Sale
Reply
Thread Tools
This thread is privately moderated by timecop, who may elect to delete unwanted replies.
Old Jun 24, 2011, 08:21 PM
Suspended Account
Joined Dec 2010
11,764 Posts
Discussion
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: http://code.google.com/p/afrodevices/

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
timecop is offline Find More Posts by timecop
Last edited by timecop; Oct 08, 2011 at 11:59 PM.
Reply With Quote  (Disabled)
Sign up now
to remove ads between posts
Old Jun 24, 2011, 08:49 PM
No thrust...It'll bust...
troynh's Avatar
Troy, NH
Joined Sep 2006
4,312 Posts
You've got my attention...

-Tim
troynh is offline Find More Posts by troynh
Reply With Quote
Old Jun 25, 2011, 11:20 AM
Gravity sucks :)
Indonesia
Joined Jul 2005
924 Posts
subscribed, looking forward to replace multiwii fc on my fun quad
ddmt is offline Find More Posts by ddmt
Reply With Quote
Old Jun 27, 2011, 02:59 AM
Registered User
SirFishaLot's Avatar
USA, VA, Richmond
Joined Jan 2011
188 Posts
I hope you get paid well, you talented MF'er
SirFishaLot is offline Find More Posts by SirFishaLot
Reply With Quote
Old Jun 28, 2011, 12:17 PM
Design > Build > Fly
Qrome's Avatar
Arizona, USA
Joined Feb 2005
3,744 Posts
Oh my gosh! Subscribed. Cool!
Qrome is offline Find More Posts by Qrome
Reply With Quote
Old Jul 08, 2011, 01:25 PM
Hovership
3rdeyepro's Avatar
United States, CA, Cupertino
Joined Aug 2010
934 Posts
Would love to try one, PM me.
3rdeyepro is offline Find More Posts by 3rdeyepro
Reply With Quote
Old Jul 11, 2011, 08:09 AM
Registered User
Joined Feb 2009
166 Posts
way to go farward with stm32 bases quads
is it possible to make this code compatible to copter control
kanchana is offline Find More Posts by kanchana
Reply With Quote
Old Jul 12, 2011, 06:52 AM
Suspended Account
Joined Dec 2010
11,764 Posts
I suspect openpilot will have stm32f2-based platform soon enough.
timecop is offline Find More Posts by timecop
Reply With Quote  (Disabled)
Old Jul 15, 2011, 05:37 AM
Suspended Account
Joined Dec 2010
11,764 Posts
now it can flip.

AfroFlight doing its first [intentional] flip (0 min 46 sec)
timecop is offline Find More Posts by timecop
Reply With Quote  (Disabled)
Old Jul 15, 2011, 06:19 AM
Design > Build > Fly
Qrome's Avatar
Arizona, USA
Joined Feb 2005
3,744 Posts
Great job! I knew you had it in you!
Qrome is offline Find More Posts by Qrome
Reply With Quote
Old Jul 20, 2011, 07:24 AM
Suspended Account
Joined Dec 2010
11,764 Posts
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"...
timecop is offline Find More Posts by timecop
Reply With Quote  (Disabled)
Old Aug 09, 2011, 12:34 AM
Registered User
Joined Jun 2006
1,764 Posts
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!!
titeuf007 is offline Find More Posts by titeuf007
Reply With Quote
Old Aug 18, 2011, 11:17 PM
Enjoying the sunshine
HappySundays's Avatar
Australia, NSW, Sydney
Joined Feb 2011
2,823 Posts
Wow

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?
HappySundays is offline Find More Posts by HappySundays
Last edited by HappySundays; Aug 18, 2011 at 11:57 PM. Reason: Always room for more questions...
Reply With Quote
Old Aug 19, 2011, 12:35 AM
Suspended Account
Joined Dec 2010
11,764 Posts
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.
timecop is offline Find More Posts by timecop
Reply With Quote  (Disabled)
Old Aug 31, 2011, 10:02 AM
Suspended Account
Joined Dec 2010
11,764 Posts
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,
http://code.google.com/p/afrodevices...runk%2Fafrowii
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.
timecop is offline Find More Posts by timecop
Last edited by timecop; Aug 31, 2011 at 12:18 PM.
Reply With Quote  (Disabled)
Reply

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 Electronics 12207 Mar 31, 2014 03:19 AM
Build Log Building a palm size quad-copter & Introducing a new simple flight controller thanhTran Mini Multirotors 1390 Sep 17, 2013 09:59 AM
Discussion Different flight characteristics Quad vs Hexa Connexxion Multirotor Talk 9 Mar 18, 2011 02:07 PM
Found Want to Trade FY-90Q Quad Controller for differnt Quad controller FL62 Aircraft - Electric - Helis (FS/W) 5 Mar 11, 2011 06:43 PM