Cleanflight aka Multiwii port to STM32 F10x and F30x

Cleanflight aka Multiwii port to STM32 F10x and F30x

Postby dominicclifton » Mon May 26, 2014 2:52 pm

UPDATE: Discussion has moved to RCGROUPS - http://www.rcgroups.com/forums/showthread.php?t=2249574

Hiya,

I'd like to introduce Cleanflight, it's a fork of baseflight that attempts to improve the quality of the codebase by
* introducing tests
* improving naming
* code decoupling
* other software development best practices

Cleanflight also has:
* Multi-color RGB LED Strip support (each LED can be a different color using variable length WS2811 Addressable RGB strips - use for Orientation Indicators, Low Battery Warning, Flight Mode Status, etc)
* OneShot ESC support.
* Support for additional targets that use the STM32F3 processors (STM32F3Discovery, Chebuzz Flying F3, Naze32Pro etc).
* Support for the TauLabs Sparky board ($35 STM32F303 based board with compass and baro!)
* Support for the OpenPilot CC3D board.
* Support for the CJMCU nano quadcopter board.
* Support for developer breakout boards: (Port103R, EUSTM32F103RC, Olimexino, etc).
* Support for more than 8 RC channels - (e.g. 16 Channels via FrSky X4RSB SBus).
* Support for N-Position switches via flexible channel ranges - not just 3 like baseflight or 3/6 in MultiWii
* Lux's new PID (uses float values internally, resistant to looptime variation).
* Simultaneous Bluetooth configuration and OSD.
* Better PWM and PPM input and failsafe detection than baseflight.
* Better FrSky Telemetry than baseflight.
* MSP Telemetry.
* RSSI via ADC - Uses ADC to read PWM RSSI signals, tested with FrSky D4R-II and X8R.
* Autotune - ported from BradWii, experimental - feedback welcomed.
* OLED Displays - Display information on: Battery voltage, profile, rate profile, version, sensors, RC, etc.
* In-flight manual PID tuning and rate adjustment.
* Rate profiles and In-flight selection of them.
* Graupner PPM failsafe.
* Graupner HoTT telemetry.
* Configurable serial port scenarios for Serial RX, Telemetry, MSP, GPS - Use most devices on any port, softserial too.
+ more many minor bug fixes.

There are already many bug fixes and features added to Cleanflight, Timecop has frequently backported changes and fixes into baseflight. Cleanflight attempts to stay up-to-date with baseflight.

There's code, binaries and unit tests here:

https://github.com/hydra/cleanflight

Additional documentation here:

https://github.com/hydra/cleanflight/tree/master/docs

Videos here:

https://www.youtube.com/playlist?list=P ... rllZAGWkt8

To configure it you should use the fork of baseflight-configurator, that can be found on the chrome web store, here:

http://bit.ly/cfconfig

Configurator source here:

https://github.com/hydra/cleanflight-configurator

There's a dedicated IRC channel here:

irc://irc.freenode.net/#cleanflight

You can find me there, I'm 'Hydra'.

Pull-requests welcomed!

Targets:
Open Pilot CC3D - http://www.openpilot.org/products/openp ... -platform/
CJMCU - https://github.com/hydra/cleanflight/issues/22
Naze32 - http://www.radioc.co.uk/Acro-Naze-32-fl ... p/3009.htm
Olimexino - https://www.olimex.com/Products/Duino/S ... INO-STM32/
Naze32Pro - viewtopic.php?f=22&t=5338
STM32F3Discovery - http://www.st.com/web/catalog/tools/FM1 ... 2/PF254044
STM32F3Discovery with Chebuzz F3 Taulabs shield.
and more!

Enjoy!

I'll add screenshots and links to this post over time so that new-comers can follow the thread easier.

Screenshot of Cleanflight configurator showing AUX1-8 configuration
AUX1-8 config.PNG
Last edited by dominicclifton on Tue Aug 23, 2016 7:46 pm, edited 14 times in total.
dominicclifton
 
Posts: 202
Joined: Tue Feb 05, 2013 10:28 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Postby Dilbert66 » Mon May 26, 2014 3:41 pm

Good stuff Dominic! It's on my watch list :) I'll be looking closely at your naze32pro branch as I have a shiny new one that I will be playing with soon. Just got to wait for my swd debug connector to arrive... I like your soft serial mods.
User avatar
Dilbert66
 
Posts: 45
Joined: Fri Apr 04, 2014 6:09 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Postby timecop » Mon May 26, 2014 5:10 pm

Just for the record, I do not approve of the direction, file structure, or overall attitude of this particular fork, and specifically the waste of developer time that will ensue from this silliness.
timecop
 
Posts: 1880
Joined: Fri Sep 02, 2011 4:48 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Postby copterrichie » Mon May 26, 2014 5:42 pm

Open Source right?
copterrichie
 
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Postby nicog » Mon May 26, 2014 6:03 pm

Come on copterricchie did you even try to look at the links before posting? Or you just troll?
nicog
 
Posts: 88
Joined: Tue Aug 21, 2012 2:21 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Postby dominicclifton » Mon May 26, 2014 6:17 pm

copterricchie wrote:Open Source right?


yes

timecop wrote:Just for the record, I do not approve of the direction, file structure, or overall attitude of this particular fork, and specifically the waste of developer time that will ensue from this silliness.


Without wanting to feed the trolls too much, your opinion is noted thanks. We've had discussions already.

I shall continue to fix things as I find them, today for instance i found another bug in baseflight but can't report it via github since you've blocked me from there and since you threw your toys out the pram i can't tell you via IRC either. Keep your eye on my repo if you want the code, i'm still happy for my fixes to make their way into baseflight for others to enjoy.

Dilbert66 wrote:Good stuff Dominic! It's on my watch list :) I'll be looking closely at your naze32pro branch as I have a shiny new one that I will be playing with soon. Just got to wait for my swd debug connector to arrive... I like your soft serial mods.


Thanks. You should also keep an eye on treym's repo too. We are sharing quite a bit of code between the two projects. Just today he grabbed the uart2 code I did for the STM32F3.

https://github.com/treymarc?tab=repositories
dominicclifton
 
Posts: 202
Joined: Tue Feb 05, 2013 10:28 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Postby Dilbert66 » Mon May 26, 2014 8:33 pm

Geez... I really hate to see great minds disagree but such is the world of any dev project. Personally, I am not attached to any one project as my interests are quite varied. I'm not just flying these things. I like the coding aspect just as much and very interested in automation, GPS nav, telemetry links, FPV, embedded processors, etc. No, I'm not interested in DJI :). So basically no project has it all for me but I do prefer to play with ones that have good code and a good group of people that work on it and who have fun doing it.

Either way, I'm looking forward to seeing where they all go and will play with them all. Peace out folks!
User avatar
Dilbert66
 
Posts: 45
Joined: Fri Apr 04, 2014 6:09 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Postby dominicclifton » Tue May 27, 2014 11:33 am

Just got an email from Pierre_A who was kind enoigh to let me know the HoTT telemetry which I wrote some unit tests for the other day is now working. Still work in progress but satallite count, battery voltage and GPS position are all working now, all via soft serial.

For those that don't know the whole reason I started implementing softserial was to use with HoTT. Since HoTT is a two-way telemetry protocol, unlike FrSky, it's technically possible for you to change settings on the FC from your TX via text-based menus that the FC can generate dynamically, useful for adjusting PIDs, etc.

Here's some pictures Pierre sent.

1-GPS on MX20.jpg


2-GPS on MX20.jpg
dominicclifton
 
Posts: 202
Joined: Tue Feb 05, 2013 10:28 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Postby Pierre_A » Tue May 27, 2014 7:32 pm

Hi all,

For my forth multi (home made Y4), I’have been using Baseflight on Naze32 rev5 since a few months. Very nice board and easy flight with a very close to default configuration (thanks to Timecop and al).

Besides the Naze32, my configuration includes :
- Rx Graupner HoTT GR16 (associated to Tx MX20)
PPM signal on Naze32 RC input 1
Graupner HoTT Voltage module (battery voltage displayed on the MX20)
- KVTeam OSD : connected on Naze32 telemetry Rx/Tx serial port
- GPS Ublox 6M : connected on Naze 32 UART2 (RC3/4)

Then appears Cleanflight with the capability of displaying informations on the Tx Graupner MX20 based on the HoTT technology. So I decided to have a try and I began using Cleanflight two weeks ago withgout noting any difference in the flight behaviour.

Today, thanks to Dominic, Cleanflight (version may 25) brings new possibility emulating the HoTT EAM and GPS modules. Then,
- removing the Voltage module from the multi, I connected the GR16 HoTT Telemetry pin T on Naze32 Softserial (RC5/6) wiring a 1N4148 diode as documented (direct connection pin T + RC5 + anode, and cathode on RC6),
- leaving the GPS connected on UART2 (RC3/4),
I get HoTT measurements on the MX20 EAM and GPS with specific configuration Baseflight CLI parameters. That is for now : battery voltage, satellites number, coordinates (Lat and Long in deg and decimal mn) are exact and clearly displayed on the MX20 (see pictures in the last post of Dominic) and more are coming.
Let's keep on playing..
PA
Pierre_A
 
Posts: 35
Joined: Thu May 15, 2014 9:32 am

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Postby subaru4wd » Tue May 27, 2014 10:48 pm

timecop wrote:Just for the record, I do not approve of the direction, file structure, or overall attitude of this particular fork, and specifically the waste of developer time that will ensue from this silliness.



Just for the record, nobody really gives a fuck what you think Timecop.

HUUUUUGE thanks to Dominic for releasing this code and doing his best to help out the 32 bit community.

We need more dev's like this, and less devs like TimeCop!
subaru4wd
 
Posts: 316
Joined: Sat Dec 08, 2012 2:16 am

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Postby timecop » Wed May 28, 2014 12:14 am

subaru4wd wrote:Just for the record, nobody really gives a fuck what you think Timecop.
HUUUUUGE thanks to Dominic for releasing this code and doing his best to help out the 32 bit community.
We need more dev's like this, and less devs like TimeCop!


Exactly!
We need more fragmentation and less developers actually developing towards a common goal. Totally a great idea. You're a fucking genius, dude. Can I have your LinkedIn? I think I'm going to hire you.
timecop
 
Posts: 1880
Joined: Fri Sep 02, 2011 4:48 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Postby copterrichie » Wed May 28, 2014 12:43 am

Karma
copterrichie
 
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Postby dominicclifton » Wed May 28, 2014 12:55 am

timecop wrote:We need more fragmentation and less developers actually developing towards a common goal. Totally a great idea


If you have thoughts on open source projects and how people should collaborate then perhaps a separate thread would be best Timecop. I'd do with the same with my thoughts on source control *cough* github timecop, github *cough*, but I'm too busy having fun coding to feed the trolls. Please keep this thread on topic. :D

subaru4wd wrote:HUUUUUGE thanks to Dominic for releasing this code and doing his best to help out the 32 bit community.

We need more dev's like this, and less devs like TimeCop!


Thanks subaru4wd. Much appreciated. Nice to know my efforts are appreciated, if not by everyone.
dominicclifton
 
Posts: 202
Joined: Tue Feb 05, 2013 10:28 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Postby subaru4wd » Wed May 28, 2014 12:57 am

timecop wrote:
subaru4wd wrote:Just for the record, nobody really gives a fuck what you think Timecop.
HUUUUUGE thanks to Dominic for releasing this code and doing his best to help out the 32 bit community.
We need more dev's like this, and less devs like TimeCop!


Exactly!
We need more fragmentation and less developers actually developing towards a common goal. Totally a great idea. You're a fucking genius, dude. Can I have your LinkedIn? I think I'm going to hire you.


You are the only motherfucker here who is NOT developing towards a common goal.

Who gives a shit what the code looks like???? If it works... IT WORKS!

Im starting to turn into a bigger troll than Timecop. Im sorry Dominic. I'll just sit back and watch progress continue.
subaru4wd
 
Posts: 316
Joined: Sat Dec 08, 2012 2:16 am

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Postby Dilbert66 » Wed May 28, 2014 1:14 am

subaru4wd wrote:Who gives a shit what the code looks like???? If it works... IT WORKS!




Developers care. Shit code causes people to write more shit code. Having easy to understand and debug code, means that it will be sustainable and easy to add more beloved features. Having code that looks like speghetti and having a million different styles will just end up frustrating any developer. Yes, we can't get too hung up on styles and of course, but it needs to be clean code.

Goals. Well, that's a hot topic, every group has different goals. Dominic has a plan to create code that can have features added to easily, perhaps in a modular fashion. I'm interested to see where this leads. Baseflight is good code too, just different styles.
User avatar
Dilbert66
 
Posts: 45
Joined: Fri Apr 04, 2014 6:09 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Postby copterrichie » Wed May 28, 2014 1:17 am

The cleanliness of code is very subjective and a matter of opinion. I know of MAJOR corporations that have a two stage process, get the code working, then clean up / make it more efficient.
copterrichie
 
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Postby subaru4wd » Wed May 28, 2014 1:20 am

Im not a developer by any means. Im out of my league here by far. I am just an end-user who is expecting results. If you were to ask me, ALL code is a cluster fuck and makes absolutely no sense.

Apparently, the only code worth running... is the code that comes from TimeCop. His shit must be so clean you can eat off it. Im sure if I looked at the source for BaseFlight, it would read like a story right??
subaru4wd
 
Posts: 316
Joined: Sat Dec 08, 2012 2:16 am

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Postby timecop » Wed May 28, 2014 1:50 am

subaru4wd wrote:Im not a developer by any means. Im out of my league here by far. I am just an end-user who is expecting results. If you were to ask me, ALL code is a cluster fuck and makes absolutely no sense.


And herein lies the problem.
You aren't paying for results when you spend $20 on a flight controller.
You can either deal with what's offered to you by the kindness of others, or step up and fix shit that's broken.

If you want results, feel free to purchase DJI Phantom Vision V2+
timecop
 
Posts: 1880
Joined: Fri Sep 02, 2011 4:48 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Postby subaru4wd » Wed May 28, 2014 2:04 am

And what exactly would you know about kindness?
subaru4wd
 
Posts: 316
Joined: Sat Dec 08, 2012 2:16 am

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Postby treym » Wed May 28, 2014 2:46 am

Hi,

could we please have this user removed, or banned , he is being quite offensive lately with no reason .

thanks in advance


notably this :

subaru4wd wrote:If you are so unhappy... quit Timecop.

Nobody here is twisting your arm or forcing you to do what you do.

Just stop. Stop today, go on vacation.


dont come back.
User avatar
treym
 
Posts: 258
Joined: Sat Jul 21, 2012 12:28 am

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Postby dominicclifton » Wed May 28, 2014 3:36 am

Ok, just added a new feature. RSSI via ADC. Latest binaries have it.

Code here:

https://github.com/hydra/cleanflight/co ... 8501e4079f

Instructions here:

https://github.com/hydra/cleanflight/bl ... cs/Rssi.md
dominicclifton
 
Posts: 202
Joined: Tue Feb 05, 2013 10:28 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Postby dominicclifton » Wed May 28, 2014 3:42 am

For those feeling brave, i've ported over the autotune feature from BradWii. It's not field tested yet and only supports pid controllers 1 and 2 and not Lux's new pid controller.

If you want to try it then switch to the 'autotune' branch and grab the binaries or compile it yourself.

Code here:

https://github.com/hydra/cleanflight/commits/autotune

Docs here:

https://github.com/hydra/cleanflight/bl ... utotune.md

Binaries here:

https://github.com/hydra/cleanflight/tree/autotune/obj

UPDATE: Autotune support is now in the master branch and latest binaries for those wanting to try it out, it's still experimental but has been flight tested.
Last edited by dominicclifton on Fri May 30, 2014 11:17 am, edited 1 time in total.
dominicclifton
 
Posts: 202
Joined: Tue Feb 05, 2013 10:28 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Postby copterrichie » Wed May 28, 2014 4:22 am

I was toying around with the configuration on the APM and noted it also had an auto tune feature. I have no idea where it is within the code but APM is also open source. You might have a look around to see what you can see. :)
copterrichie
 
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Postby dominicclifton » Tue Jun 03, 2014 1:46 pm

I've made it so that UBLOX GPS SBAS mode can be configurable. A recent change in baseflight made my GPS unit, here in Europe, take longer to get a lock. The SBAS setting was changed to AUTO which appeared to be the cause. Allowing the user to choose a mode based on their region should help with GPS startup times. Would love feedback.

Code is in the git repo, binaries will be built with after I test fly it later today.
dominicclifton
 
Posts: 202
Joined: Tue Feb 05, 2013 10:28 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Postby brm » Tue Jun 03, 2014 7:09 pm

subaru4wd wrote:
timecop wrote:Just for the record, I do not approve of the direction, file structure, or overall attitude of this particular fork, and specifically the waste of developer time that will ensue from this silliness.

We need more dev's like this, and less devs like TimeCop!


we need more hw - therefore we need TC - that simple.
brm
 
Posts: 287
Joined: Mon Jun 25, 2012 12:00 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Postby copterrichie » Tue Jun 03, 2014 7:40 pm

Maybe it is time to start bread boarding again until some vendor jumps onto the bandwagon.
copterrichie
 
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Postby rank » Tue Jun 03, 2014 8:54 pm

Cleanflight looks very promising, will be testing it out shortly.
A few questions meanwhile.

I have a stock minimosd which runs @ 57600, in Harakiri set tele_prot = 3 brings the live to it. Any chance to do something similar in Cleanflight?
Is the Gps code will stay similar to Baseflight, or will be more advanced? Is there any difference at the moment, apart from SBAS configuration. Basically, I'm interested to know, how well the gps functions perform as of Today.
Has S-Bus (have a Frsky X8R RX) been fully implemented yet? It says via serial, can you please elaborate more on this.
Thank you
rank
 
Posts: 31
Joined: Fri Dec 06, 2013 5:27 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Postby dominicclifton » Wed Jun 04, 2014 11:18 pm

brm wrote:
subaru4wd wrote:We need more dev's like this, and less devs like TimeCop!


we need more hw - therefore we need TC - that simple.


No-one's denying TC makes some nice hardware, my Naze's all fly great and I'm looking forward to more F3 boards from him. He already spends more time making hardware and trolling than writing code anyway so I don't see a problem :D

I'd love it if some other people started making Cleanflight F3 and F4 boards and as already stated on IRC I'm available to help out.
dominicclifton
 
Posts: 202
Joined: Tue Feb 05, 2013 10:28 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Postby dominicclifton » Wed Jun 04, 2014 11:24 pm

I updated cleanflight and the configurator today to support AUX1-8 configuration as per this screenshot and video.

AUX1-8 config.PNG


dominicclifton
 
Posts: 202
Joined: Tue Feb 05, 2013 10:28 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Postby dominicclifton » Wed Jun 04, 2014 11:37 pm

rank wrote:Cleanflight looks very promising, will be testing it out shortly.
A few questions meanwhile.

I have a stock minimosd which runs @ 57600, in Harakiri set tele_prot = 3 brings the live to it. Any chance to do something similar in Cleanflight?
Is the Gps code will stay similar to Baseflight, or will be more advanced? Is there any difference at the moment, apart from SBAS configuration. Basically, I'm interested to know, how well the gps functions perform as of Today.
Has S-Bus (have a Frsky X8R RX) been fully implemented yet? It says via serial, can you please elaborate more on this.
Thank you


I'm not sure what tele_prot = 3 does in harakiri. I'd have to look into that, is it mavlink? OSD wise I use minimosd's with KVTeam firmware. I will be looking into MW OSD - viewtopic.php?f=8&t=4865 That seems to have picked up from KVTeam firmware and specifically supports MSP. It's quite possible that I may also fork that in order to provide support for cleanflight features if that becomes needed.

GPS code is not currently a big priority for me, the main focus is code cleanups to support F3 processors and adding small features along the way. I'm waiting for some of the recent GPS developments to become more finalised in the multiwii ccodebase before I look at it more. There are a few videos on youtube showing that RTH on baseflight does work, I've been having issues with my GPS and have been busy testing other things recently, however now I've got support for more AUX channels and I've fixed my GPS issues on my testing quad I will hopefully look into how the GPS side of things works for me and can report back. Please try the code and give us your findings too.

S-Bus should work fine, I have not flight tested it but it's known to work on Cleanflight. I'll be migrating one of my quads to the X8R in due course so the X8R will get more flight time, currently it's desk bound testing device :D

Again, please test your X8R and report back here!

With regards to your question about serial, what did you read that was unclear? We can improve the documentation with your feedback.
dominicclifton
 
Posts: 202
Joined: Tue Feb 05, 2013 10:28 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Postby brm » Thu Jun 05, 2014 5:47 pm

hmm,
what do you understand using the term clean?
in one area it is very clean: inline doc.
so this is cleanflight ;-)
brm
 
Posts: 287
Joined: Mon Jun 25, 2012 12:00 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Postby Hamburger » Thu Jun 05, 2014 8:00 pm

Just why cannot you give the guy cedit for picking up and trying to improve upon the standstill in functionality we have witnessed since evolution of 32bit hardware more than 2 years ago? Where are the super duper features that make everyone rush and buy into it?
What once looked promising with the oh so advanced 32bit hardware has given us basically a port of what existed before with a mixture of removals of what the man considered unneccessary plus the edition of a CommandLineInterface. Dig it. Is a cli that next big thing or is it not more like 1980 style? Not much in the direction of what we wanted to expect from a high tech guy using advanced 32bit hardware.

Over time it has turned into one big disappointment. So if someone new gives the whole thing a new fresh spin then I applaud him.
User avatar
Hamburger
 
Posts: 2548
Joined: Tue Mar 01, 2011 2:14 pm
Location: air

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Postby copterrichie » Thu Jun 05, 2014 9:46 pm

Add to the above, much of the development on the 8bit platform has almost come to a stand still. The few people that are still developing are fearful of being BASHED in my opinion.
copterrichie
 
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Postby jihlein » Thu Jun 05, 2014 11:55 pm

IMHO, I think there are a lot of valid reasons for using a CLI. The main one for me is that when developing/debugging, I add things for debug display regularly, then remove them. Constantly having to keep a GUI configuration program up to date and in sync with the main code is a pain, it's just more code to maintain. The use of a CLI, and/or non use of a GUI, in no way reflects the quality of the flight software, although quite often the two are equated together. It also has nothing to do with the choice of 8 bit/32 bit systems. Again, all IMHO.

Plus I'd rather work on flight code, than GUIs.........

I've written code for TC's F1 and F3 boards, and the AeroQuad F4 board. At the moment they are not as feature rich as some of the other code bases, but the code performs very well. They make use of the hardware floating point, and limited use of the DSP functions (in the F3 and F4 incarnations). And they all use a CLI for setup.....

Sorry for the off topic post......
jihlein
 
Posts: 27
Joined: Sat Sep 08, 2012 3:10 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Postby HFMan » Fri Jun 06, 2014 3:02 am

I'd consider trying Cleanflight, but there are a frightening number of changes going in nearly every day, with very little documentation or explanation, or even discussion here in this thread.

Is this code base stable?

How is the PID tuning compared to Baseflight?

I almost exclusively fly Acro, but rely on GPS for RTH- are the Hold, RTH, and leveling functions working?

Can I still tune the PIDS and other parameters with minimOSD (MWOSD version)?

Is the MW protocol still working such that minimOSD can display all the existing parameters that Baseflight can display?

Is emf_avoidance functioning as well as Baseflight?
User avatar
HFMan
 
Posts: 43
Joined: Mon Mar 31, 2014 3:28 pm
Location: Colorado Springs

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Postby brm » Fri Jun 06, 2014 6:25 am

Hamburger wrote:Just why cannot you give the guy cedit for picking up and trying to improve upon the standstill in functionality we have witnessed since evolution of 32bit hardware more than 2 years ago? Where are the super duper features that make everyone rush and buy into it?
What once looked promising with the oh so advanced 32bit hardware has given us basically a port of what existed before with a mixture of removals of what the man considered unneccessary plus the edition of a CommandLineInterface. Dig it. Is a cli that next big thing or is it not more like 1980 style? Not much in the direction of what we wanted to expect from a high tech guy using advanced 32bit hardware.

Over time it has turned into one big disappointment. So if someone new gives the whole thing a new fresh spin then I applaud him.


there is nothing really new - maybe i am wrong.
all is copied over form other sources.
there is an other guy named scott driessen who did a nicer job.

the code base from john is nice.
my main point on the latest baseflight incarnations is jitter on the time axis.
this is valid for all variations and flavours of baseflight.
using a hw timer would be the solution.

in essence baseflight inherits all probs from multiwii.
and there was less movement on the mw code base.
brm
 
Posts: 287
Joined: Mon Jun 25, 2012 12:00 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Postby HFMan » Fri Jun 06, 2014 6:42 am

brm wrote:my main point on the latest baseflight incarnations is jitter on the time axis.
this is valid for all variations and flavours of baseflight.
using a hw timer would be the solution.


What do you mean by the above? Jitter on the time axis? You do realize an external oscillator clocks the STM32- and that there are quite a few hardware timers in this uC. I'm lost what you are getting at.
User avatar
HFMan
 
Posts: 43
Joined: Mon Mar 31, 2014 3:28 pm
Location: Colorado Springs

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Postby Hamburger » Fri Jun 06, 2014 10:58 am

jihlein wrote:IMHO, I think there are a lot of valid reasons for using a CLI. .....

yes, I agree, same for me. But that is not the point I was trying to make. Btw. MWii has had support for the gui plus support for a cli style interface in the form of LCD display support since about day 1. Removing the latter and adding a new CLI for smaller set of supported hardware choice is not the quantum leap I was expecting from the 32bit advocates. No doubt our 8bit hardware has severe limits but we have yet to see something making real use of the 32bit freedom in terms of the next big thing feature. A different cli implementation certainly does not fit that category for me.
User avatar
Hamburger
 
Posts: 2548
Joined: Tue Mar 01, 2011 2:14 pm
Location: air

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Postby Hamburger » Fri Jun 06, 2014 11:28 am

brm wrote:
Hamburger wrote:. So if someone new gives the whole thing a new fresh spin then I applaud him.

there is nothing really new - maybe i am wrong. all is copied over form other sources.


I see. So I will wait and watch out for whether that path will gain momentum. At the least it seems to stirr up some all too resting minds. If that evolves into a new wave of real improvements & new features, that would be even better. Time will tell, for now I welcome the new spin to 32bit world.
User avatar
Hamburger
 
Posts: 2548
Joined: Tue Mar 01, 2011 2:14 pm
Location: air

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Postby fiendie » Fri Jun 06, 2014 12:12 pm

Hamburger wrote:
jihlein wrote:IMHO, I think there are a lot of valid reasons for using a CLI. .....

yes, I agree, same for me. But that is not the point I was trying to make. Btw. MWii has had support for the gui plus support for a cli style interface in the form of LCD display support since about day 1. Removing the latter and adding a new CLI for smaller set of supported hardware choice is not the quantum leap I was expecting from the 32bit advocates. No doubt our 8bit hardware has severe limits but we have yet to see something making real use of the 32bit freedom in terms of the next big thing feature. A different cli implementation certainly does not fit that category for me.


You seem to forget that the CLI in baseflight entirely replaces messing with config.h. Your LCD and "telemetry" support is so unwieldy you can probably count all users of that feature on one hand.

With cTn's baseflight configurator you can automagically flash the newest firmware to your board and don't have to mess with an IDE or edit badly formatted C header files. And you don't even have to use a separate tool to use the CLI. It is very well documented and very rarely needed.
The configurator would already make all CLI-only settings available but for that to happen someone needs to add custom commands to MSP. There are some drafts and it's being worked on.

I am terribly sorry that you expected a quantum leap but no matter how you spin it STM32 still wins in every aspect.
fiendie
 
Posts: 151
Joined: Fri Apr 20, 2012 4:22 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Postby Pierre_A » Fri Jun 06, 2014 1:21 pm

@ HFMan »
.... How is the PID tuning compared to Baseflight?
I almost exclusively fly Acro, but rely on GPS for RTH- are the Hold, RTH, and leveling functions working?
Can I still tune the PIDS and other parameters with minimOSD (MWOSD version)?
Is the MW protocol still working such that minimOSD can display all the existing parameters that Baseflight can display?


Using Cleanflight (since 1st version) on Naze 32 with a MinimOSD (KVTeam version) connected on Rx/Tx serial port.
I confirm that you access the 9 pages of the OSD on your GStation and you can tune PIDs and other parameters directly through your Tx as before with MW or Baseflight.
The tuning and resulting flight behaviour are not different.
Pierre_A
 
Posts: 35
Joined: Thu May 15, 2014 9:32 am

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Postby Hamburger » Fri Jun 06, 2014 5:58 pm

fiendie wrote:You seem to forget that the CLI in baseflight entirely replaces messing with config.h.

Hm, your man replied to user question on how to setup flaps
timecop wrote:Airplane mixer can do 2 motors, all the stuff you're asking for is "doable" but none of it is "configurable".
So you'll have to understand and edit code and rebuild

in essence, cli makes use of extended memory and provides more options to setup while providing less choice in supported hardware. If that fits your needs, you are fine and you picked the right platform.
I am terribly sorry that you expected a quantum leap but no matter how you spin it STM32 still wins in every aspect.

So we have been told for some years now. Still waiting.

I am going to judge cleanflight by what it provides; this may depend on and have influence on what type of users and devs it can attract and unite to join forces.
User avatar
Hamburger
 
Posts: 2548
Joined: Tue Mar 01, 2011 2:14 pm
Location: air

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Postby brm » Fri Jun 06, 2014 6:11 pm

HFMan wrote:
brm wrote:my main point on the latest baseflight incarnations is jitter on the time axis.
this is valid for all variations and flavours of baseflight.
using a hw timer would be the solution.


What do you mean by the above? Jitter on the time axis? You do realize an external oscillator clocks the STM32- and that there are quite a few hardware timers in this uC. I'm lost what you are getting at.


cycletime - too much jitter
brm
 
Posts: 287
Joined: Mon Jun 25, 2012 12:00 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Postby dominicclifton » Fri Jun 06, 2014 6:35 pm

jihlein wrote:I've written code for TC's F1 and F3 boards, and the AeroQuad F4 board. At the moment they are not as feature rich as some of the other code bases, but the code performs very well. They make use of the hardware floating point, and limited use of the DSP functions (in the F3 and F4 incarnations). And they all use a CLI for setup.....

Sorry for the off topic post......


that's ok! :D Thanks for sharing your code jihlein.

With regards to time axis jitter mentioned, for those that'd don't know what this means here's a quick rundown.

The length of time the main loop takes to run is different each time, so the next time the main loop is run a different amount of time has passed since the previous time and this effects calculations in the 'multiwii pid' and the 'pid rewrite' controllers. Attempts are made in the code to try to keep the time between main loop iterations as constant as possible by waiting until a certain amount of time has passed before performing non essential operations and also ensuring that these non essential operations are not all scheduled to happen at the same time. This is the reason why the 'cycletime' is displayed in the GUI. If you were to plot it on a graph you would want to see a smooth horizontal line without spikes.

jihlein's solution is quite nice, which uses the systick hander, and can be seen here:

https://github.com/FocusFlight32/FF32mi ... tem.c#L106
https://github.com/FocusFlight32/FF32mi ... src/main.c

The same kind of code in baseflight is scattered across the system, for example:

https://github.com/multiwii/baseflight/ ... /mw.c#L162
https://github.com/multiwii/baseflight/ ... /mw.c#L474
https://github.com/multiwii/baseflight/ ... /mw.c#L780
https://github.com/multiwii/baseflight/ ... /mw.c#L823

I prefer the former, it's much cleaner.

Code: Select all
[2014-05-06 11:58:20] <dongs> and i disagree with his whole main loop timing way
[2014-05-06 12:01:05] <Hydra> what don't you like about his main loop dongs?


I asked timecop about his statement above, but i never got an answer. I would like to hear his thoughts.

I'm totally open to improving the scheduling within cleanflight. It would be really nice to be able to adjust the scheduling of various actions from one place so that it can be easily optimized.


With regards to the difference between baseflight, cleanflight has all current baseflight features and has additional features and bug fixes. features that are only in cleanflight are listed and updated in the first post of this thread.
dominicclifton
 
Posts: 202
Joined: Tue Feb 05, 2013 10:28 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Postby jihlein » Fri Jun 06, 2014 7:32 pm

One other thing that is not so obvious, is that on the F3 and F4 versions, 2 spare hardware timers are used to compute the dt value for integrations in the 500 Hz and 100 Hz loops. All this is done in an attempt to keep loop timing as consistent as possible without moving to an RTOS, and keep the integrations as accurate as possible. The sensors are noisy enough, might as well not introduce other sources of error if at all possible. I may move to FreeRTOS at some point.
jihlein
 
Posts: 27
Joined: Sat Sep 08, 2012 3:10 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Postby Crashpilot1000 » Fri Jun 06, 2014 7:58 pm

Just some offtopic - cry out: I sincerely believe that the mwii protocol is good but it has to have a defined standard of sending variables/names/values/value ranges to the gui. So a gui could display all current and future parameters and the user can alter them (within the transmitted limits). Something that is "normal" - every day business with mavlink. So that is most ugent to wrap the head around in the mwii project in general - just my opinion.
That would free the user from 1980 style cli and 1975 style changing the code and recompile. However CLI is still a nice thing to have because a serial monitor will run on all platforms/OS etc..
Concerning the timejitter issue I also have an opinion but stuffing everything into a 1ms timer can not be a general solution and has some serious downsides. Some OS on stm will just add overhead, point of failures and waste space.
OT closed
Cheers Rob
User avatar
Crashpilot1000
 
Posts: 631
Joined: Tue Apr 03, 2012 7:38 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Postby treym » Fri Jun 06, 2014 8:19 pm

Crashpilot1000 wrote:Just some offtopic - cry out: I sincerely believe that the mwii protocol is good but it has to have a defined standard of sending variables/names/values/value ranges to the gui. So a gui could display all current and future parameters and the user can alter them (within the transmitted limits). Something that is "normal" - every day business with mavlink. So that is most ugent to wrap the head around in the mwii project in general - just my opinion.
That would free the user from 1980 style cli and 1975 style changing the code and recompile. However CLI is still a nice thing to have because a serial monitor will run on all platforms/OS etc..
Concerning the timejitter issue I also have an opinion but stuffing everything into a 1ms timer can not be a general solution and has some serious downsides. Some OS on stm will just add overhead, point of failures and waste space.
OT closed
Cheers Rob

+1 with the above troll
User avatar
treym
 
Posts: 258
Joined: Sat Jul 21, 2012 12:28 am

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Postby dominicclifton » Fri Jun 06, 2014 8:54 pm

yes, i'm in favor of supplementing the MSP to allow GUI clients to configure cleanflight. I hate going into the CLI to configure telemetry, for example. And a GUI for serial port configuration would also be nice.

I have already made MSP changes in cleanflight, trying to keep things as backwards compatible as possible to the EZ-GUI and MinimOSD with KVTeam, both of which I also use.
dominicclifton
 
Posts: 202
Joined: Tue Feb 05, 2013 10:28 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Postby brm » Fri Jun 06, 2014 9:27 pm

dominicclifton wrote:jihlein's solution is quite nice, which uses the systick hander, and can be seen here:

I asked timecop about his statement above, but i never got an answer. I would like to hear his thoughts.


i took baseflight apart to reduce the noise on the readings.
thus reading the mems devices at 1khz and the mw sensor fusion at 333hz.
not much interest to do so.
basically it is a 'light' form of:
Code: Select all
void setupTaskEntries()
{
   clearTaskEntries();

   setTaskEntry(eFrame_1Hz, 1, frame_Hartbeat);
   setTaskEntry(eFrame_10Hz, 10, frame_10Hz);
   setTaskEntry(eFrame_50Hz, 50, updateCommands);
   setTaskEntry(eFrame_Sensor_Fusion, 500, updateActuators);
   setTaskEntry(eFrame_Read_IMU, 1000, readImu);
}

a tasklet would look like:
Code: Select all
void updateActuators(float time)
{
    updateAttitude(time);
    stabilisation(time);
    mixTable();
    writeServos();
    writeMotors();
}


seperation of concerns ...
TC would say f*** it!
brm
 
Posts: 287
Joined: Mon Jun 25, 2012 12:00 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Postby brm » Fri Jun 06, 2014 9:28 pm

dominicclifton wrote:yes, i'm in favor of supplementing the MSP to allow GUI clients to configure cleanflight. I hate going into the CLI to configure telemetry, for example. And a GUI for serial port configuration would also be nice.

I have already made MSP changes in cleanflight, trying to keep things as backwards compatible as possible to the EZ-GUI and MinimOSD with KVTeam, both of which I also use.


MSP is: f*** it.
never seen so much nonsense protocol wise
brm
 
Posts: 287
Joined: Mon Jun 25, 2012 12:00 pm

Next

Return to Software

Who is online

Users browsing this forum: Google [Bot] and 1 guest