Cleanflight aka Multiwii port to STM32 F10x and F30x

friesianflyer
Posts: 3
Joined: Thu Jul 17, 2014 10:13 pm

Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by friesianflyer »

Hi everyone, just flashed cleanflight onto a naze32 r5 (full) and am having an issue with telemetry from my FrSky dr4ii to taranis......?

I have the Rx connected to the middle pin on the bottom row of the 10 naze pins (which is where it worked with baseflight)
I have enabled feature soft serial but there is no voltage being displayed on the Taranis? I have tried armed/unarmed with no difference.

Does anyone have this setup that could point me in the right direction?

Thanks.

And a big thanks to Dominic and his team for the hard work!

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

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by dominicclifton »

check the examples in Serial.md in the documentation.

https://github.com/cleanflight/cleanfli ... /Serial.md

eample C) is close (ignore the gps feature).

and also see

https://github.com/cleanflight/cleanfli ... lemetry.md

you will probably need to 'set telemetry_inversion=1' too

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

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by dominicclifton »

OneShot support is now in the firmware, it's been flight tested, users report improved throttle response. Would love some more PWM vs OneShot in-flight comparison tests please!

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

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by dominicclifton »

Support for the TauLabs sparky is coming along, Cleanflight is booting and running on the board, Acc and Gyro are working - these Sparky boards are very cheap for a board with a acc, gyro, compass, barometer and a better processor than the one on the Naze32. The board should also support FrSky and SBus without inverters or softserial.

watch this space

friesianflyer
Posts: 3
Joined: Thu Jul 17, 2014 10:13 pm

Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by friesianflyer »

Thanks Dominic, that example worked perfectly. I don't fully understand how the serial scenario lines work, which pins are serial port one, two, three etc?

Thanks!

ollierexx
Posts: 3
Joined: Tue Dec 09, 2014 11:36 am

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by ollierexx »

Hey guys :)
I have hooked up a d4r-II to my naze, with CPPM and Telemetry however it seems the naze vbat feature is not working. I have confirmed there is power to the vbat input on the board, however cleanflight displays nothing, with vbat enabled in the CLI.
http://puu.sh/dnnFJ/805c123d4b.png

One thing i noticed was in the feature list, VBAT is listed as disabled at the top, and enabled at the bottom: http://puu.sh/dnnEv/70e4cb6306.png

Any help would be greatly appreciated :)

ollierexx
Posts: 3
Joined: Tue Dec 09, 2014 11:36 am

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by ollierexx »

friesianflyer wrote:Hi everyone, just flashed cleanflight onto a naze32 r5 (full) and am having an issue with telemetry from my FrSky dr4ii to taranis......?

I have the Rx connected to the middle pin on the bottom row of the 10 naze pins (which is where it worked with baseflight)
I have enabled feature soft serial but there is no voltage being displayed on the Taranis? I have tried armed/unarmed with no difference.

Does anyone have this setup that could point me in the right direction?

Thanks.

And a big thanks to Dominic and his team for the hard work!

I am having the exact same problem, I think that they may have broken VBAT support. Does the Initial setup page show voltage for you? (It does not for me)

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

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by dominicclifton »

Vbat works fine with latest firmware on 4 of my quads with cc3d and naze boards.

ollierexx
Posts: 3
Joined: Tue Dec 09, 2014 11:36 am

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by ollierexx »

dominicclifton wrote:Vbat works fine with latest firmware on 4 of my quads with cc3d and naze boards.

Ahh, thanks for the reply.
Is it possible the chip could have died?

wilco1967
Posts: 156
Joined: Thu Aug 18, 2011 6:04 pm
Location: Winterswijk, Netherlands

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by wilco1967 »

friesianflyer wrote:Hi everyone, just flashed cleanflight onto a naze32 r5 (full) and am having an issue with telemetry from my FrSky dr4ii to taranis......?

I have the Rx connected to the middle pin on the bottom row of the 10 naze pins (which is where it worked with baseflight)
I have enabled feature soft serial but there is no voltage being displayed on the Taranis? I have tried armed/unarmed with no difference.

Does anyone have this setup that could point me in the right direction?

Thanks.

And a big thanks to Dominic and his team for the hard work!


did you set telemetry_inversion = 1 ?
it used to be called set frsky_inversion = 1 (frsky became telemetry), so perhaps uploading the old CLI dump missed it....

uk-Pedro
Posts: 8
Joined: Sat Nov 29, 2014 9:06 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by uk-Pedro »

I'm tempted to try cleanflight for two reasons: Autotune and improved GPS performance.
My question is has the GPS performance improved over baseflight or is this lower on the priority list?

Cheers,
Pedro

FinalGlide
Posts: 10
Joined: Thu Dec 11, 2014 12:50 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by FinalGlide »

Hi guys, first post here and it's only because it's the Cleanflight thread. I wouldn't feel right posting in other places :). Anyway firstly, thanks for Cleanflight Dominic, It rocks and all my quads are slowly getting switched over to it. :)

I have a suggestion but not sure where to post it so Dominic can see it and it won't get lost in history. Not sure where else to go. The common perception with Cleanflight and ####flight is that the yaw is fairly sluggish. Some say it is and others say it's not a problem. Yes you can increase the Yaw rate but that has other effects also. What I would like to suggest is to create a split RCrate section. So just like roll/pitch rate and yaw rate you also have roll/pitch RCrate and Yaw RCrate. I think this would solve everyone's issues with yaw fairly easily. For me I find the yaw lacking in my acro quads but it is fine in my FPV mini H quads. Being able to adjust it separately would fix the problem simply and easily.

If there is a better place to put this request then let me know and I'll check it out. Thanks guys!

Pierre_A
Posts: 35
Joined: Thu May 15, 2014 9:32 am

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by Pierre_A »

FinalGlide wrote:Hi guys, first post here and it's only because it's the Cleanflight thread. I wouldn't feel right posting in other places :). Anyway firstly, thanks for Cleanflight Dominic, It rocks and all my quads are slowly getting switched over to it. :)

I have a suggestion but not sure where to post it so Dominic can see it and it won't get lost in history. Not sure where else to go. The common perception with Cleanflight and ####flight is that the yaw is fairly sluggish. Some say it is and others say it's not a problem. Yes you can increase the Yaw rate but that has other effects also. What I would like to suggest is to create a split RCrate section. So just like roll/pitch rate and yaw rate you also have roll/pitch RCrate and Yaw RCrate. I think this would solve everyone's issues with yaw fairly easily. For me I find the yaw lacking in my acro quads but it is fine in my FPV mini H quads. Being able to adjust it separately would fix the problem simply and easily.

If there is a better place to put this request then let me know and I'll check it out. Thanks guys!


Welcome FinalGlide,
You should post your suggestion as a new issue here :
https://github.com/cleanflight/cleanflight/issues

FinalGlide
Posts: 10
Joined: Thu Dec 11, 2014 12:50 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by FinalGlide »

Thanks Pierre_A. I'll check it out tonight.

DIE_KUH
Posts: 19
Joined: Thu Feb 06, 2014 4:18 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by DIE_KUH »

I wanted to try Oneshot, but it didn't work. I flashed the most recent firmware, set PIDs, AUX ranges, looptime 2000 and the necessary features (PPM, motor_stop, VBAT, telemetry) - all working. Then I set "feature oneshot125", saved, rebooted - nothing. When I arm the Naze32 (rev5), nothing happens (except all the LEDs light up). Same when I go to the motors tab. Can't even calibrate the ESCs. There simply doesn't seem to be a motor signal. Any ideas?

Pierre_A
Posts: 35
Joined: Thu May 15, 2014 9:32 am

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by Pierre_A »

DIE_KUH wrote:I wanted to try Oneshot, but it didn't work. I flashed the most recent firmware, set PIDs, AUX ranges, looptime 2000 and the necessary features (PPM, motor_stop, VBAT, telemetry) - all working. Then I set "feature oneshot125", saved, rebooted - nothing. When I arm the Naze32 (rev5), nothing happens (except all the LEDs light up). Same when I go to the motors tab. Can't even calibrate the ESCs. There simply doesn't seem to be a motor signal. Any ideas?


Do you use Kiss esc ? if yes, remember to short JP1 (enabling oneshot).

DIE_KUH
Posts: 19
Joined: Thu Feb 06, 2014 4:18 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by DIE_KUH »

Oops, you're right. User fault. Sorry. ;)

Edit: Ok, it works. And it seems to work great. Of course it's possible that my expectations are impairing my judgment, but it feels even more responsive with Oneshot. Definitely improved throttle response. Can't really test it though in this weather.

But I suck at these soldering bridges. I had no problem soldering the KISS ESCs, but this... ugh. Don't like it. So now I'm stuck on Cleanflight on this quad, because I'm too lazy to desolder JP1. Which isn't bad. :mrgreen:

FinalGlide
Posts: 10
Joined: Thu Dec 11, 2014 12:50 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by FinalGlide »

As per your request Dominic, here is a full review/comparison of OneShot on Cleanflight. I think a few people are going to eat humble pie over time...

Apologies for the length but please watch till the end for the full review.

https://www.youtube.com/watch?v=pYFYpf1RS_A

DIE_KUH
Posts: 19
Joined: Thu Feb 06, 2014 4:18 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by DIE_KUH »

I instantly recognized those trees from your KISS comparison video. Thanks for the comparison! Also, nice flying. Now I'm relieved I didn't make a video of my own. Guess I should apply for team Nana. :)

Nice to see Oneshot is working. So maybe the better throttle response was only in my head (hard to measure really), but the ability to increase the PIDs or to have less oscillations with the same PIDs is great. What PWM frequency and looptime did you use without Oneshot? Edit: Just saw in the Youtube comments that you used 490 Hz/2000 ns. That makes it even more interesting, because you were already using the KISS ESCs near their limit. I ran them at 500 Hz/2000 ns and had no problems.

It's a shame that some people (who probably are too stubborn to eat their humble pie) are unwilling to try new things. But at least we now finally have Oneshot on Naze boards, thanks Dominic!

FinalGlide
Posts: 10
Joined: Thu Dec 11, 2014 12:50 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by FinalGlide »

Thanks mate. I just hope the video prtayed well enough what I experienced. My back yard is tight with all the trees but it's close to the computer :).

FinalGlide
Posts: 10
Joined: Thu Dec 11, 2014 12:50 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by FinalGlide »

I was playing around with the tuning with OneShot and got it to a point there was some slight oscillations with OneShot enabled, so I disabled OneShot to test if the oscillations got worse, better or stayed the same using the same PID's.

https://www.youtube.com/watch?v=DxUFY5k1aZs

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

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by dominicclifton »

FinalGlide wrote:As per your request Dominic, here is a full review/comparison of OneShot on Cleanflight. I think a few people are going to eat humble pie over time...
https://www.youtube.com/watch?v=pYFYpf1RS_A


FinalGlide wrote:I was playing around with the tuning with OneShot and got it to a point there was some slight oscillations with OneShot enabled, so I disabled OneShot to test if the oscillations got worse, better or stayed the same using the same PID's.

https://www.youtube.com/watch?v=DxUFY5k1aZs


Wow! - The difference is so noticeable, amazing that you can get the extra performance out of it.

This quote in particular now makes me ROFL (when TC was referring to OneShot from here: viewtopic.php?f=22&t=2387&start=2400)

timecop wrote:Why don't you spend like 10 fucking seconds searching the thread, to find the reasons why there is absolutely no chance eurohype will be implemented?


Really glad we all decided to give this a try.

iDaniel
Posts: 11
Joined: Mon Dec 15, 2014 9:51 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by iDaniel »

Hello,

i have just one little question, which board would be the most recommended one for cleanflight?
could I use an MW32 v2? http://flyduino.net/Multikopter-FC_2

Thanks!

TimJC
Posts: 4
Joined: Thu Aug 07, 2014 9:15 pm
Location: Cincinnati, OH, USA

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by TimJC »

iDaniel wrote:Hello,

i have just one little question, which board would be the most recommended one for cleanflight?
could I use an MW32 v2? http://flyduino.net/Multikopter-FC_2

Thanks!

That looks just like the Flip32 I am running, so it is compatible.

nebbian
Posts: 67
Joined: Mon Jul 21, 2014 6:54 am

Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by nebbian »

Have you got your hands on some KISS ESC's yet dominic? I'd be interested to hear your thoughts on how oneshot vs non-oneshot works for you. Just be prepared to empty your wallet once you try a set (even in PWM mode!)

Since those videos from Final Glide and Bird Of Prey have come out, there has been a LOT of interest in oneshot. I know of at least one person who is trying to get BLHeli to talk in this protocol as eell.

Oh and nice work poking the bear in that other thread :)

Olddude
Posts: 43
Joined: Thu Apr 24, 2014 4:31 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by Olddude »

So the youtube vid i watched is prove of one shot 'working' then ???
Me fail for words....Amazing ... I put it simple. My one and only comment on this BS ...


imagine at work this thinking would be implemented :? ...

Scenario:
I just make it worse to see if the new stuff makes it better compared to the old ? but not just that .No No NO . Also lets see if the new stuff handles the crooked stuff I introduced better then the old stuff
and to conclude : If it does i am a genius and its soo much better then before ??

U cannot be serious dude ?
LOLOLOL

FinalGlide
Posts: 10
Joined: Thu Dec 11, 2014 12:50 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by FinalGlide »

When you've finished sucking on your Timecock mate get back to us with something constructive. BTW: you've got something on your bottom lip.

Olddude
Posts: 43
Joined: Thu Apr 24, 2014 4:31 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by Olddude »

?? and that has woot to do with anything ?

OF course it easier then actually addressing the issue
Your lack of documentation and test cases.......
But what did i expect LOL

and BTW U ALL are just little brats :U, jobless numb nut, as well as TC

I ask for proof of concept not ur wishy washy BS video
This is pathetic if u seriously think this is proof of anything ?
Are u really that dumb >?
Wait, I take this question back as you answered this already by totally ignoring any concern and instead went straight for personal attack.
So in fact u answered this Question comprehensively...

Read again my last post tell me how your setup proofs anything
You method :

I fuck it up test and see if it runs better with the fucked up code i insert ?


Mr u should maybe try a real job for once ?
U know jobs grown ups have where testing is done properly and results are recorded and published

2 m/s LOL
go and get a job u numbnut

ronco
Posts: 317
Joined: Thu Aug 18, 2011 2:58 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by ronco »

Olddude wrote:?? and that has woot to do with anything ?

OF course it easier then actually addressing the issue
Your lack of documentation and test cases.......
But what did i expect LOL

and BTW U ALL are just little brats :U, jobless numb nut, as well as TC

I ask for proof of concept not ur wishy washy BS video
This is pathetic if u seriously think this is proof of anything ?
Are u really that dumb >?
I mean U cannot be serious ?

Read again my last post tell me how your setup proofs anything
You method :
I fuck it up test and see if it runs better with the fucked up code i insert ?


Mr u should maybe try a real job for once ?
U know jobs grown ups have where testing is done properly and results are recorded and published

2 m/s LOL
go and get a job u numbnut


so lovely here :D

..what makes a 49xHz (1-2ms) signal to the perfekt match for multicopters? does the guys that made it a standard in the RC HW before ~40 years (http://en.wikipedia.org/wiki/Radio-controlled_model) really know that this is the best speed for sending datas to theh esc's?
why is it so hard to belive that a faster signal can give you improvements in some cases?
and is there any sense in repeating old signals? really? please explain me that.
if you know how a PID loop works you will know that a faster response is always better.. and eaven if you wont notice the differens with some setups i cant hurt.

what final glide is showing in the videos ist just that it makes his copter more stable against too high PID's.. the difference you may feel when useing oneshot compared to 1-2ms PWM is hard to record in a video.

regards

felix

DIE_KUH
Posts: 19
Joined: Thu Feb 06, 2014 4:18 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by DIE_KUH »

This is kinda funny, but mostly sad. Let me quote the one coherent sentence in your otherwise incoherent ramblings:

Olddude wrote:Wait, I take this question back as you answered this already by totally ignoring any concern and instead went straight for personal attack.


You're really complaining that you're not taken seriously, after what you wrote before? Maybe you should tell us what your "concern" actually is. What is your specific issue? What are you complaining about? You didn't really tell us.

As you mentioned that something was made worse: What was made worse in Cleanflight so that now it can be proven that Oneshot makes it better? Are you saying the flight algorithms in Cleanflight are worse than in Baseflight? If so: What leads you to that conclusion? Did you ever use Cleanflight at all? Where is your Youtube video in which you show us the "facts"?

Lupin
Posts: 2
Joined: Wed Dec 17, 2014 7:41 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by Lupin »

I have set up cleanflight on one of these small STM32 boards (the very small, arduino nano sized ones) that are all over ebay (following the "Cheap DIY control board" thread there: http://www.rcgroups.com/forums/showthread.php?t=2154329).
I've also got a FrSky X9DP with an X8R receiver. Since this receiver does not support CPPM and I don't want to by a converter (why insert an analog step?), I'm using SBUS (built an inverter for that). I'm also using an ublox-neo6 as GPS. I've got all of this working, but I would also like to get telemetry back, in my case it would have to be via the "smart port".

But as soon as I try to enable smart port on one of the serial ports the whole setup resets (which indicates an invalid configuration; but unfortunately with no hint what is wrong). I can enable normal telemetry on one of the ports (and saw a signal on the scope).

This is my setup (with normal telemetry just to show that it is doing something):

Code: Select all

feature MOTOR_STOP
feature RX_SERIAL
feature SOFTSERIAL
feature TELEMETRY
feature GPS

# MSP, CLI, GPS-PASSTHROUGH
set serial_port_1_scenario = 5

# RX SERIAL ONLY
set serial_port_2_scenario = 3
# SBUS
set serialrx_provider = 2

# GPS ONLY
set serial_port_3_scenario = 2
# NMEA
set gps_provider = 0

# TELEMETRY ONLY
set serial_port_4_scenario = 4
# SoftSerial port #2
set telemetry_port = 2
# FrSky
set telemetry_provider = 0


set gps_baudrate = 9600
set gps_passthrough_baudrate = 9600
# EGNOS
set gps_sbas_mode=1


With that I can connect using cleanflight configurator on UART1, get the channel values via SBUS on UART2, get GPS coordinates via softserial 1 and output telemetry (in a format I can't use) on softserial 2.

Keeping everything the same, but changing the telemetry to smart port, resets the configuration.

Code: Select all

# SMARTPORT TELEMETRY ONLY
 set serial_port_4_scenario = 9
# SoftSerial port #2
set telemetry_port = 2
# SmartPort
set telemetry_provider = 3


What am I doing wrong? Or can't I get CLI/MSP, SBUS, GPS and Smart Port at the same time?

Rust
Posts: 36
Joined: Wed Nov 20, 2013 8:39 am

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by Rust »

Cheers to Dominic!
Cleanflight is one really great piece of code!
If you bring the GPS goodness from Harakiri, this will most definitely be the absolute number one available today!

Thanks for the good work!

FinalGlide
Posts: 10
Joined: Thu Dec 11, 2014 12:50 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by FinalGlide »

@Olddude, if you wish to disagree with what I am testing or my testing method then that is fine. Everyone has their own opinion. But if you're going to be an arogant prick about then you will get the response you got. There has already been a discussion on my movies on another forum that managed to stay civil in 5 pages of discussion where you managed to make the discussion dive downwards in one reply.

It's sad because this highlights the hardships and personal attacks that those like Felix and Dominic have to endure when they decide to try something different. I can only imagine how the private messages read. Y'know, the best way to weed out what works and what doesn't is to sit and wait. Time will prove if an idea works or not. If you don't believe an idea actually works then go sit in the non believers corners and be happy in the fact that you are right. I'm happy to be proven wrong over time. I just simply tried a new idea with an open mind and came away with positive results in my mind.

One last thing...... THIS IS A TOY!!!!! It's not a life or death situation so don't treat it like it is.

Right let's get back to progressing this great bit of software Dominic and others have worked so hard on...

Animal60
Posts: 10
Joined: Wed Apr 02, 2014 3:56 am

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by Animal60 »

All i can say is well put FinalGlide ;) ;)
This is a hobby not a life or death situation.

FinalGlide wrote:@Olddude, if you wish to disagree with what I am testing or my testing method then that is fine. Everyone has their own opinion. But if you're going to be an arogant prick about then you will get the response you got. There has already been a discussion on my movies on another forum that managed to stay civil in 5 pages of discussion where you managed to make the discussion dive downwards in one reply.

It's sad because this highlights the hardships and personal attacks that those like Felix and Dominic have to endure when they decide to try something different. I can only imagine how the private messages read. Y'know, the best way to weed out what works and what doesn't is to sit and wait. Time will prove if an idea works or not. If you don't believe an idea actually works then go sit in the non believers corners and be happy in the fact that you are right. I'm happy to be proven wrong over time. I just simply tried a new idea with an open mind and came away with positive results in my mind.

One last thing...... THIS IS A TOY!!!!! It's not a life or death situation so don't treat it like it is.

Right let's get back to progressing this great bit of software Dominic and others have worked so hard on...


I have looked at the code; and coding can be hard to get right well done to the people working on the code.
Keep up the good work.

User avatar
idefixRC
Posts: 3
Joined: Thu Dec 18, 2014 4:31 am
Contact:

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by idefixRC »

Hello everyone,

I just migrated from Baseflight (awesome :mrgreen: ) and after the first flights would now like to get the rate adjustment going.
I had a look at Dominic's video on that (https://www.youtube.com/watch?v=RkSec6LTzMY) and set everything up. Works like a charm.

Only issue: the beeper is going nuts :? As soon as the adjustment channel is enabled, the beeper will beep constantly. Only when I go into the CLI, the beeping stops.
Reboot, power cycles..... nothing helps.

I played around with the adjustments a little and it looks like the beeping should correspond with rate changes once applied.
Maybe the 3 position switch method from the video induces some kind of feedback loop??

So for now (in order to not annoy the neighbors and local wildlife - as well as myself), I had to disable the adjustments.

Any suggestion how this can be fixed ?

Thanks !

User avatar
bulesz
Posts: 71
Joined: Mon May 06, 2013 8:03 pm
Location: Hungary EU

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by bulesz »

Guys, what is the main difference between the PID controller 1 and PID controller 2? more agile, or more precise? or both? :) This would be the main reason of switching from Baseflight...

?

Cheerz,
B

DIE_KUH
Posts: 19
Joined: Thu Feb 06, 2014 4:18 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by DIE_KUH »

bulesz wrote:Guys, what is the main difference between the PID controller 1 and PID controller 2?


Yup, I'd also like to know that. What PID controllers are there, what are the differences, which ones are still actively in development? And which one is "Lux's PID controller"? Didn't find anything in the documentation.

mstocker
Posts: 7
Joined: Sun Oct 28, 2012 8:14 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by mstocker »

Hi Guys:
I don't post much so don't have a lot of credibility, but I have been using the Naze32 boards since Version 2 came out. 3 years ago? I have switched 5 boards over to Cleanflight, using pid_controller=0,1, and 2, on the 3 profiles of each board. I don't begin to understand the differences in coding of the 3 profiles, but have a basic feel for how they affect the Quad I'm using at the time.
pid_controller=2....Snappy!!! I don't understand why the good Acro flyers don't seem to be using it! The 'I' in the P,I,D's doesn't seem to have much effect, I'm only tuning with P, and,D. I'm finding it tricky to tune in the 250 and under sizes. EG: Leora, Raven 234, Warp230, Minion H. Set the pid's too high and they oscillate, warble, make funny noises,and whatever else you can think of. Too low, and the Angle won't hold. IE: push the stick for forward Pitch, or whatever direction, and release it and the quad gradually comes back to level. Yes I'm talking about Acro mode here. (has a,very strong Angle mode though, I don't, and haven't really ever used Horizon mode). Tune the P just enough to hold the angle upon release, and it starts to makes noises. I have 2 VC450 frames using controller=2, and BLHELI Esc's, and they are much, much easier to tune, and fly beautifully, Snappy, and on rails!
Kiss helped tuning the small frames a lot, and just last week, enabling Oneshot, all but eliminated the small oscillations, as Final Glide showed in his video.
Pid_controller=1...Snappy as well, a little easier to tune, I think, seems to be affected more by looptime, 2000 generally works for me 1600-1800 works well depending on the rig. It has it's own feel though. You have to experiment with the two controllers.
Pid_controller=0... The good old stand by, solid feel, easy to tune, but S..L..O..W to re-act. In Cleanflight I have to use RC Rates in the 180-225 range, P/R rates 30-50, and no Expo. Actually in Controller=2, I've only just started using 10% expo in the RC rates.
I hope this gives you some idea of the characteristics I've experienced.
Later...Matt
Last edited by mstocker on Sun Dec 21, 2014 3:04 pm, edited 1 time in total.

User avatar
leocopter
Posts: 101
Joined: Mon Jan 27, 2014 7:29 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by leocopter »

It's great to have all those different FCs supported. I can't wait to see full Sparky support.
I'm also interested in the CMJCU board but I don't know where to buy it.
** It is available at GoodLuckBuy.
Last edited by leocopter on Sun Dec 28, 2014 4:03 pm, edited 1 time in total.

User avatar
leocopter
Posts: 101
Joined: Mon Jan 27, 2014 7:29 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by leocopter »

Rust wrote:Cheers to Dominic!
Cleanflight is one really great piece of code!
If you bring the GPS goodness from Harakiri, this will most definitely be the absolute number one available today!

Thanks for the good work!



+1 for that !

mstocker
Posts: 7
Joined: Sun Oct 28, 2012 8:14 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by mstocker »

Rust wrote:Cheers to Dominic!
Cleanflight is one really great piece of code!
If you bring the GPS goodness from Harakiri, this will most definitely be the absolute number one available today!

Thanks for the good work!

YES, for sure :!: My bad for not mentioning this in my previous post. :oops:
Also kudo's to other people making contributions as well. :!:
Matt

Dave Pitman
Posts: 12
Joined: Sat Dec 20, 2014 9:02 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by Dave Pitman »

Hi Guys, first post here.

Using a STM32 board and CleanFlight for the first time. Thank you to Dominic and other devs contributing their time.

A couple basic questions.

Should a passive or active buzzer be used?

Does vbat min voltage look for the calculated voltage per cell under load which tends to be about .5v less than resting voltage?

Thanks.

jihlein
Posts: 27
Joined: Sat Sep 08, 2012 3:10 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by jihlein »

The 'I' in the P,I,D's doesn't seem to have much effect, I'm only tuning with P, and,D.


Set the pid's too high and they oscillate, warble, make funny noises,and whatever else you can think of. Too low, and the Angle won't hold.


The behavior you describe is caused by not using any integral gain. In rate (what is typically called acro) mode, the controller attempts to keep a commanded rate. So look at the situation where you command a roll rate, the quad achieves that roll rate, you zero your input, and roll rate of the quad returns to zero, leaving the quad banked at some angle. The desired behavior is for it to stay at that bank (zero rate), but it slips back toward level. This is either because the integral term isn't being calculated correctly in the PID, or you are not using enough integral gain. Think of integral gain as trim. You may have to add quite a bit of integral gain to get the desired behavior.

I'm not familiar with the Cleanflight PID implementations, but they should all behave more or less as described above. Trying to solve the slip back you are seeing with higher proportional gains will definitely cause oscillations.

mstocker
Posts: 7
Joined: Sun Oct 28, 2012 8:14 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by mstocker »

jihlein wrote:
The 'I' in the P,I,D's doesn't seem to have much effect, I'm only tuning with P, and,D.


Set the pid's too high and they oscillate, warble, make funny noises,and whatever else you can think of. Too low, and the Angle won't hold.


The behavior you describe is caused by not using any integral gain. In rate (what is typically called acro) mode, the controller attempts to keep a commanded rate. So look at the situation where you command a roll rate, the quad achieves that roll rate, you zero your input, and roll rate of the quad returns to zero, leaving the quad banked at some angle. The desired behavior is for it to stay at that bank (zero rate), but it slips back toward level. This is either because the integral term isn't being calculated correctly in the PID, or you are not using enough integral gain. Think of integral gain as trim. You may have to add quite a bit of integral gain to get the desired behavior.

I'm not familiar with the Cleanflight PID implementations, but they should all behave more or less as described above. Trying to solve the slip back you are seeing with higher proportional gains will definitely cause oscillations.

Hi jihlein:
Thanks for replying to this. What you're saying regarding the 'I' is exactly how I've always tuned in pid_controller=0 for any board I've used, multi 2.3, Baseflight and Cleanflight, but I haven't been able to make it work with pid_controller=2 I've tried as high as 200 or so and down to my usual 28-34, with-out seeing any, or much difference at all. When activating p_c=2, in the cli, it defaults the pid's to 2.5/60/60 for p/r. I "think" I remember reading a while ago that p_c=2 uses different algorithms, which lessen the effect of Looptime, and ignores the 'I'. It has been 2-3 weeks since I gave up on trying to tune using it, and maybe now after a little more experience with Cleanflight p_c=2, I can get the 'I' component to have more effect.
Thanks...Matt

DIE_KUH
Posts: 19
Joined: Thu Feb 06, 2014 4:18 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by DIE_KUH »

Hi Matt,
thanks for sharing your experiences with the different PID controllers! Just some quick questions, because I couldn't try them out myself yet: Were you using the same PIDs for pid_controller 0 and 1? If I got that right, 0 and 1 are pretty similar? And did KISS and Oneshot help with your "slipping" problems with pid_controller 2 with the smaller quads, or did it only really work flawlessly with the bigger quads?

@Dave: Active buzzer, 5V. And vbat only reports the measured voltage - no calculations for resting voltage, you have to figure that in yourself (depends on the battery anyway).

Dave Pitman
Posts: 12
Joined: Sat Dec 20, 2014 9:02 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by Dave Pitman »

DIE_KUH wrote:.....
@Dave: Active buzzer, 5V. And vbat only reports the measured voltage - no calculations for resting voltage, you have to figure that in yourself (depends on the battery anyway).


Thank you!

jihlein
Posts: 27
Joined: Sat Sep 08, 2012 3:10 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by jihlein »

uses different algorithms, which lessen the effect of Looptime, and ignores the 'I'


Now I'm not familiar with the PID algorithms used in Cleanflight, but this make no sense to me. So feel free to take this for what it's worth.......

For the PID to function properly, the I and D terms are necessarily dependent on loop time. Loop time should be a constant, I don't get the need for a variable loop time. Changing the loop time will force a change to all the PID parameters, in general shorter loop times lead to higher gains before instability occurs.

I can easily run all the necessary inner loop stuff at 500 Hz, in floating point. I use 2 hardware timers, one to calculate the 500 Hz dt and one to calculate the 100 Hz dt. This helps keep the integral and derivative calculations as accurate as possible. Short loop times and accurate calculations are very important on the small, 250 quads which can respond so quickly.

So I would recommend coding a set loop time, and code the PID in floating point. Adjust the PID values for stability, and scale the PID control variable command to get the desired feel/sensitivity.

This is how I've set up my code over the last few years, and it has worked out quite well.

From the for what it's worth department......

mstocker
Posts: 7
Joined: Sun Oct 28, 2012 8:14 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by mstocker »

[quote="DIE_KUH"]Hi Matt,
thanks for sharing your experiences with the different PID controllers! Just some quick questions, because I couldn't try them out myself yet: Were you using the same PIDs for pid_controller 0 and 1? If I got that right, 0 and 1 are pretty similar? And did KISS and Oneshot help with your "slipping" problems with pid_controller 2 with the smaller quads, or did it only really work flawlessly with the bigger quads?

DIE_KUH:
Yes, you are spot on to what I was trying to say. p_c=0, and 1, are usually about the same pid's, certainly close enough for a starting point. However p_c=1 has it's own feel, and just yesterday, on my Minion H frame mini, I changed it out, in favour of p_c=2. That frame has BLHeli 12a Esc's, on it, and I couldn't tune out wobbles when lowering the throttle for rapid descent, and a generally loose feel. lowering Looptime too 1600, helped, but made both p_c=0, and 1, start rapididly surging up and down slightly, and difficult to hold a constant altitude in hover. I prob'ly could have tuned it out, by lowering/adjusting Yaw, and P/R pid's, but I just gave up, and switched to 2, as I had it working pretty good.
Yep, the larger Quads are awesome on 2, I only use 0, when easy flying, and don't feel like banging the sticks. On 2, they just seem to come to attention, just like I was really their Boss. 8-). I like flying these VC450's, maybe a bit more, as they are a little easier to see, and a bit more relaxingto fly, while a little slower, can be made to flip and roll and maneuver on a dime, using 2212-1000kv motors on 4s. I'm rapidly approaching 70 (67 in 2015), and don't have the desire to practice the frenetic type of flying the smaller quads deserve.
My issue with angle holding on the smaller quads may not be even be noticed with real Acro pilots, as they are on the sticks constantly, and the quad only starts to level after 20-30 yards of rapid flight, on angles of less than 20-25 degrees.
Matt

mstocker
Posts: 7
Joined: Sun Oct 28, 2012 8:14 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by mstocker »

jihlein wrote:
uses different algorithms, which lessen the effect of Looptime, and ignores the 'I'


Now I'm not familiar with the PID algorithms used in Cleanflight, but this make no sense to me. So feel free to take this for what it's worth.......

For the PID to function properly, the I and D terms are necessarily dependent on loop time. Loop time should be a constant, I don't get the need for a variable loop time. Changing the loop time will force a change to all the PID parameters, in general shorter loop times lead to higher gains before instability occurs.

I can easily run all the necessary inner loop stuff at 500 Hz, in floating point. I use 2 hardware timers, one to calculate the 500 Hz dt and one to calculate the 100 Hz dt. This helps keep the integral and derivative calculations as accurate as possible. Short loop times and accurate calculations are very important on the small, 250 quads which can respond so quickly.

So I would recommend coding a set loop time, and code the PID in floating point. Adjust the PID values for stability, and scale the PID control variable command to get the desired feel/sensitivity.

This is how I've set up my code over the last few years, and it has worked out quite well.
Changing the loop time will force a change to all the PID parameters, in general shorter loop times lead to higher gains before instability occurs.
From the for what it's worth department......

jihlein:
***Changing the loop time will force a change to all the PID parameters, in general shorter loop times lead to higher gains before instability occurs.*** {Short loop times and accurate calculations are very important on the small, 250 quads which can respond so quickly.}, Yes, I have noticed this.
[ recommend coding a set loop time, and code the PID in floating point.] I have never tried changing code. :? could be dangerous. ;) However, weather permitting, starting today, I will re-enter the arena, and start fiddling with the "I" parameter
Thanks again....Matt

User avatar
idefixRC
Posts: 3
Joined: Thu Dec 18, 2014 4:31 am
Contact:

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by idefixRC »

idefix wrote:Hello everyone,

I just migrated from Baseflight (awesome :mrgreen: ) and after the first flights would now like to get the rate adjustment going.
I had a look at Dominic's video on that (https://www.youtube.com/watch?v=RkSec6LTzMY) and set everything up. Works like a charm.

Only issue: the beeper is going nuts :? As soon as the adjustment channel is enabled, the beeper will beep constantly. Only when I go into the CLI, the beeping stops.
Reboot, power cycles..... nothing helps.

I played around with the adjustments a little and it looks like the beeping should correspond with rate changes once applied.
Maybe the 3 position switch method from the video induces some kind of feedback loop??

So for now (in order to not annoy the neighbors and local wildlife - as well as myself), I had to disable the adjustments.

Any suggestion how this can be fixed ?

Thanks !


Can anyone help?

Post Reply