Cleanflight aka Multiwii port to STM32 F10x and F30x

Post Reply
User avatar
tungsten2k
Posts: 62
Joined: Sat Jun 21, 2014 10:49 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by tungsten2k »

dominicclifton wrote:i picked 5 positions because the usual range of 1000 to 2000 divides nicely into 5 equal bands with a center.


It will probably be a lot safer to chop the top and bottom 50 or 100 off and work with what's left, but is that any different from it not being there anyway ? *shrug*

I can't double-check on my DX9 sat. setup right now how the endpoints are configured, but I'll report back when I can.

-=dave

XeCutor
Posts: 15
Joined: Tue Sep 23, 2014 9:06 am

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by XeCutor »

I've edited my question about soft serial and added the board type and RX setup. Hoping for some answers. :?:

I've set all my 8 channels endpoints in the DX18 to be so close to 1000 <--> 2000 as possible, and it's within +-10 on all of them. Here's the channel output, look at aux1 for example:
Image
Image

Here is the corresponding result in the Auxiliary Configuration tab:
Image
Image

XeCutor
Posts: 15
Joined: Tue Sep 23, 2014 9:06 am

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by XeCutor »

I'll improve my issue report a bit. I've changed from a 2-pos switch to a slider, and if I got to the Aux-tab with the slider in low (1000-1200) it's showing LL as it should. As soon as it goes above 1200 it goes to L, above 1400 to M, above 1600 to H, so far so good. As soon as I go above 1800, HH never lights up, but H stays lit and M lights up too. It's the same thing you can see in the screen shot from my previous post. H then stays lit regardless of where the slider is turned, and M, L and LL are also lit up depending on the slider value. If I go to some other tab and back to aux again, the constantly highlighted H value is gone. It looks as though it's only a display issue, the 5 distinct steps seem to all work.

User avatar
tungsten2k
Posts: 62
Joined: Sat Jun 21, 2014 10:49 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by tungsten2k »

XeCutor wrote:Questions:
- What type of function/port/mode does the OSD need to hook up to, MSP?
- Where if anywhere is it documented what serial "number" in the CLI corresponds to what pins on the board?
- Is what I'm trying to achieve even possible without lowering the MSP (=main serial port?) baud rate to a value that will work for both soft serial and proper serial port and configure OSD and BT modules accordingly?


According to Shikra, MWOSD runs at 9600 (not sure about KVOSD) so you could move the OSD to soft serial if you wanted, leaving BT on the primary. There's lots of ways you could do it; try them until one works best with the components you have:

Cleanflight serial config info:
http://github.com/hydra/cleanflight/blo ... uration.md

Softserial info from Baseflight (the basic new user softserial info like what pins to use isn't in the CF docs):
http://github.com/multiwii/baseflight/wiki/Telemetry

Cleanflight Telemetry info:
http://github.com/hydra/cleanflight/blo ... lemetry.md

-=dave

XeCutor
Posts: 15
Joined: Tue Sep 23, 2014 9:06 am

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by XeCutor »

So far I've tried to get BT to work on soft serial as a proof of concept before I mess up my nicely configured OSD by reflashing it with a FW with a different baudrate. My gut feeling is that the OSD would become slow if the baudrate was dropped too low I've tried what feels like everything but the best results so far have been getting some garbage being output on the CLI of my phone-app that I'm using to connect with the FC.

What type of scenario should I set my softserial port to use if all I want to connect to it is the OSD? And what RC-pin is RX and which is TX for each of the soft ports?

XeCutor
Posts: 15
Joined: Tue Sep 23, 2014 9:06 am

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by XeCutor »

I was out doing flight testing today and it was not all smooth sailing. I tested auto tune and it seemed to work even though conditions were not perfect as there was a steady breeze. It ended up giving me unflyable pids as it turned out. I landed and accidentally saved the settings. I value was about twice what I've ever had on manual tuning attempts. I managed to flip it on takeoff twice breaking props before I figured what was wrong.

Next came another interesting issue. Since soft serial still doesn't work for me so I used my osd to tweak my settings. I raised yaw rate and lowered pid stuff to sensible values. Flew a battery and crashed violently after putting in a new one, I actually hit a parked car but no damage done thankfully. It turns out that all pid settings had reset to the unflyable values set by auto tune. Weirdly enough, the stuff on page two of the osd settings, specifically yaw rate had been persisted. This problem persisted and values set via osd were reset after every power cycle. Is this a known issue or do I need to do something to persist settings from the osd configuration?

The days flying ended abruptly, still don't know why. Flew fpv and the quad was flying level at 10m height when it suddenly flipped backwards suddenly, I just saw it tumbling and then the signal was lost. I think/hope what happened may have been a lost prop blade on one of the rear motors. I had maximum bad luck as I managed to crash in a ditch running across the field, and I found the quad half submerged, it's drying out right now, hoping the electronics are still alright.

failsafe
Posts: 4
Joined: Wed Jul 09, 2014 10:18 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by failsafe »

Anyone interested in running cleanflight on a cc3d I have something you may interested in . A friend and I have worked out a patch to be able to flash cleanflight to cc3d without removing op bootloader. You can flash with openpilot gcs and use a usb. You Will still need to use a ftdi serial connection to connect to chrome configurator.
heres the bin file http://forums.openpilot.org/index.php?a ... h_id=44650
Last edited by failsafe on Fri Sep 26, 2014 1:14 am, edited 1 time in total.

XeCutor
Posts: 15
Joined: Tue Sep 23, 2014 9:06 am

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by XeCutor »

After going into the code and reading up on the constraints around serial ports I figured out that what had caused my settings to be ignored/reset so many many times was that I had set port scenarios where CLI was enabled on more than one, for example scenario 5 on two ports. The documentation was clear on that I had to have at least one, but didn't really say anything about that also being the absolute maximum. Anyway, right now I'm playing around with a combination of scenario 5 and scenario 8 and those two do not generate conflicts at least. I'm currently testing only port 1+2. I've set msp_baudrate to 9600 as that's what my BT module runs at for now. I can connect to the board over usb on port 1 regardless if it's scenario 5 or 8 with the configurator, everything works in it. Now if I connect to the board using the same PC and a bt dongle to port 2 running either scenario 5 or 8, doesn't matter it only works partially. I can connect to the initial setup tab, I can configure PID values and depending on scenario I can access CLI. But what doesn't work at all over the soft serial port is the AUX-config tab, if I go to it nothing happens except "Packet error" in the bottom bar starts to slowly tick upwards.

Also, EZ-GUI on my phone will not work at all over the soft serial port (port 2). It works if the BT module is connected to port 1, but when connected to port 2 I get nothing on any menu item of the app, if I go to CLI i will often display some semi-random garbage characters. Funnily enough it does report battery voltage and altitude occasionally, but often not even that. This app is a bit of a must-have for me so I can config the quad in the field, If there's anything I do to help make it work by testing something etc, let me know.

User avatar
stronnag
Posts: 114
Joined: Thu Oct 24, 2013 9:32 pm
Location: New Forest, England
Contact:

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by stronnag »

I have a set up with CLI + MSP on serial 1, GPS on serial 2 and MSP on (soft) serial 3. It works fine with USB or BT on serial 1 (MSP/CLI) and 3DR radio on serial 3 (MSP). I recall Dominic saying that MSP on soft serial is fixed at 19200 baud, which is what my 3DR is set to (and it appears with this serial scenario, any contrary baud rate is ignored, as my setup works just fine as:

Code: Select all

feature SOFTSERIAL
set serial_port_1_scenario = 1
set serial_port_2_scenario = 2
set serial_port_3_scenario = 8
set msp_baudrate = 115200
set cli_baudrate = 115200
set gps_baudrate = 38400

XeCutor
Posts: 15
Joined: Tue Sep 23, 2014 9:06 am

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by XeCutor »

XeCutor wrote:Next came another interesting issue. Since soft serial still doesn't work for me so I used my osd to tweak my settings. I raised yaw rate and lowered pid stuff to sensible values. Flew a battery and crashed violently after putting in a new one, I actually hit a parked car but no damage done thankfully. It turns out that all pid settings had reset to the unflyable values set by auto tune. Weirdly enough, the stuff on page two of the osd settings, specifically yaw rate had been persisted. This problem persisted and values set via osd were reset after every power cycle. Is this a known issue or do I need to do something to persist settings from the osd configuration?


I'll answer my own question, this is actually a documented feature of the OSD and there's a separate menu item on a different page of the OSD menu to persist the settings. It behaves this way to be able to try out settings and easily revert if they turn out to be not so great.

User avatar
Gaijin
Posts: 82
Joined: Sat Jan 14, 2012 8:00 am

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by Gaijin »

Is there a concise description of clean flights PID controllers e.g which is which?
The documentation is pretty good but I can't find anything in this regard.

Also do I need to set a soft serial scenario as well as led support to make it functional?

Fly&Fpv
Posts: 1
Joined: Fri Sep 26, 2014 5:03 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by Fly&Fpv »

Hello...

Im new here but im testing the cleanflight on my naze32 heres a video of its performance:



Thanks for developing the code.

Regards

Vertigo
Posts: 41
Joined: Mon Jul 08, 2013 6:58 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by Vertigo »

I was playing with the RSSI_ADC feature (using D4R-II, RSSI connected to chan 2), and Im afraid its all but useless. The values dance between 95 and 100% when actual RSSI is between 60 and 100+db. If RSSI drops further, the values begin to swing rapidly and enormously from like 60 to 100%. Even after filtering the values in multiwiiosd, it still hardly useable, particularly when flying a mini quad where RSSI can change rapidly as you fly behind objects.

Is there something to fine tune here, or a better way of reading the RSSI?

denof
Posts: 4
Joined: Fri Sep 26, 2014 7:57 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by denof »

hello, i am new to cleanflight, and did put the filmware yesterday on my naze32 acro board.
tonight i did try to do autotune with the standard pid settings to start with.
so i put it in angle and in hoover. then directly he do a few roll movements, and my quadx drops out the sky.

is this autotune still in test-phase?
i was hoping it would solve my drift problems in angle and horizon mode.

now at home i did re-flash with cleanflight tostandard pids.

what i wonder is:
is my quad to little for autotune? it moved so heavy when try that it felt.
i ques thata bigger quad is maybe stable more, or the autotune movements are less violent cos quad is bigger?
my quad is a 260.

greetz from denof, i enjoy your work :-)

Vertigo
Posts: 41
Joined: Mon Jul 08, 2013 6:58 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by Vertigo »

denof wrote:hello, i am new to cleanflight, and did put the filmware yesterday on my naze32 acro board.
tonight i did try to do autotune with the standard pid settings to start with.
so i put it in angle and in hoover. then directly he do a few roll movements, and my quadx drops out the sky.

is this autotune still in test-phase?
i was hoping it would solve my drift problems in angle and horizon mode.

now at home i did re-flash with cleanflight tostandard pids.

what i wonder is:
is my quad to little for autotune? it moved so heavy when try that it felt.
i ques thata bigger quad is maybe stable more, or the autotune movements are less violent cos quad is bigger?
my quad is a 260.

greetz from denof, i enjoy your work :-)


Autotune is still considered beta (if not alpha). But it works fine on smaller quads, although you should start out with a quad that flies more or less correctly. You speak of drift, did you calibrate your acc properly? Is your center of gravity in the center of the quad? AFAIK, autotune wont even touch the level PID's, so its going to help you in that regard.

If your cg is correct, you did calibrate acc's properly, your trims are centered and you configured your radio and naze for the same center (usually 1500), and it still drifts, you may have a bad board. ive been reading quite a few occurrences of this, although I wouldnt jump too quickly to this conclusions as there may be so many other causes too.

tjeerd750
Posts: 3
Joined: Wed Apr 02, 2014 7:44 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by tjeerd750 »

Hello,

After reversing the input voltage on my gps :oops: i cant get any data in through pin 3 and 4. So i thought i killed pin3/4 and a gps module . Today i discovered the gps is still working with ucentre and another naze32 acro. I started testing again but i couldn't get gps data into the naze32 full.
PWM is still working on all input pins and my quad is flying as it did before. Is it possible to break the uart and not the input pins?
I have tested this with 2 boards, baseflight, cleanflight and harakiri. However i can only get the acro board to see the gps position.

I have tried to do the following, but softserial settings keep resetting to the default.

feature gps
set serial_port_4_scenario = 2

after rebooting all serial ports are back to defaults.

Some extra info:
Receiver d8r_xp in PPM mode
Frsky telemetry on softserial 1
MinimOsd on RX/TX

I dont mind losing telemetry, as long as the osd and gps are working.

Any ideas how to get gps on other pins?
Thanks!

XeCutor
Posts: 15
Joined: Tue Sep 23, 2014 9:06 am

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by XeCutor »

I'm happy to report that changing my BT module's baud rate to 19200 and setting msp_baudrate in CLI to 115200 made it possible to use my OSD on serial 1 at full speed, and connect to the quad over a BT module on soft serial port 1 (RC ping 5+6). The problems I saw when trying to runt at 9600 are gone, now all I have to do is figure out how to make my wiring neat, the side facing ports of the Naze32 is a PITA on the 250 quad I've got.

On the problem of resetting serial config, make sure that you on no ports have the same feature enabled twice, except MSP which is allowed at most twice. So if you do set serial_port_4_scenario = 2, make sure you don't have serial port 2 set to it's default which is also 2. I've myself made the same mistake lots of time, trying to set scenario 5 on two ports.

tjeerd750
Posts: 3
Joined: Wed Apr 02, 2014 7:44 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by tjeerd750 »

Whenever i change uart2 to anything other then gps (default setting) the serial ports reset to default. I tried the following config:

feature -rx_parallel_pwm
feature rx_ppm
feature gps
feature telemetry
set serial_port_1_scenario=1 (default)
set serial_port_2_scenario=2 (wont accept anything else)
set serial_port_3_scenario=4 (telemetry)
set serial_port_4_scenario=2 (GPS)

This doesnt reset the serial config on reboot, but it wont recognize the gps either. I guess i will have to buy another naze32 full if I want to get PH and RTH working. Until that time I will fly without gps or put the acronaze in my fpv quad.

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

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by dominicclifton »

Hi guys!

Quick status update.

* I registered cleanflight.com since the previous owner let it expire last week, a simple website is now live at http://cleanflight.com
* A twitter account has been created, please follow it if you use twitter - https://twitter.com/cleanflight
* A facebook page has been created, please like it if you use facebook - https://www.facebook.com/pages/Cleanfli ... 4325195689
* I created a cleanflight github organization - https://github.com/cleanflight
* I have moved the cleanflight and cleanflight-configurator source repositories from my github account to the cleanflight organization.
* A website team has been created for people wishing to help with the website.
* The source for the website is here: https://github.com/cleanflight/cleanflight-web
* The cleanflight domain in hosted by github.

PLEASE UPDATE YOUR BOOKMARKS!

XeCutor
Posts: 15
Joined: Tue Sep 23, 2014 9:06 am

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by XeCutor »

How reliable is the GPS parts of the firmware? I've just gotten a micro GPS unit for my 250 quad and I'd love to try it out, but I wouldn't want to suffer a flyaway, like I've heard some people using baseflight have suffered.

Are there any gotcha's I should take care to avoid? I know making sure Magnetometer being calibrated and working is important.

XeCutor
Posts: 15
Joined: Tue Sep 23, 2014 9:06 am

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by XeCutor »

For those who suffer seemingly inexplicable resets of serial port config when trying to change what ports do, for example like me who want to change port1 from doing everything (scenario 1) to only MSP (scenario 8) and let soft serial port 3 take care of CLI+MSP using scenario 5, with a bluetooth module connected to that por with baud rate 19200. I managed to figure this out before, but after a settings reset it took me a long while to figure out what went wrong this time. Port 3 is limited to 19200 baud, that's not a problem for MSP, but it's certainly a problem for the cli_baudrate which has to be lowered accordingly, you may want to lower gps_passthrough_baudrate also but I'm not sure that matters. Fail to do this, and you'll have your settings reset all the time.

XeCutor
Posts: 15
Joined: Tue Sep 23, 2014 9:06 am

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by XeCutor »

XeCutor wrote:I'm happy to report that changing my BT module's baud rate to 19200 and setting msp_baudrate in CLI to 115200 made it possible to use my OSD on serial 1 at full speed, and connect to the quad over a BT module on soft serial port 1 (RC ping 5+6). The problems I saw when trying to runt at 9600 are gone, now all I have to do is figure out how to make my wiring neat, the side facing ports of the Naze32 is a PITA on the 250 quad I've got.

On the problem of resetting serial config, make sure that you on no ports have the same feature enabled twice, except MSP which is allowed at most twice. So if you do set serial_port_4_scenario = 2, make sure you don't have serial port 2 set to it's default which is also 2. I've myself made the same mistake lots of time, trying to set scenario 5 on two ports.


I'm sorry to say that I celebrated too early. I run CLI+MSP on port 3 with baud rate 19200, so far everything I've tried has worked until just now when I tried to change some aux configuration after having connected a GPS unit to my board. Before, with 9600 baud rate I could not even see the aux tab without getting packet errors, now I can see it just fine and it reacts to TX changes. But I cannot save anything. If I try to save, it'll start ticking up packet errors and if I return to the tab, nothing will have changed. This is the last reason I may need to connect a USB-cable (which is a pain given how my board is located on the quad) except for the occasional re-calibration of ESC's which require a USB cable to work. Please look into this issue and if at all possible, I'd be so happy if you could fix it.

41south
Posts: 28
Joined: Tue Jun 26, 2012 11:44 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by 41south »

Having moved my 250/260 quads over to Cleanflight with great success I'm now starting a 400 build with a full Naze32 board that will also be Cleanflight. On my acro's I used the align_board_yaw =-90 so I could easily access the usb connector from the side of the frames. If I do that with the full Naze32 does it also take care of the mag sensor being 'sideways' ? Thanks

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

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by dominicclifton »

Vertigo wrote:I was playing with the RSSI_ADC feature (using D4R-II, RSSI connected to chan 2), and Im afraid its all but useless. The values dance between 95 and 100% when actual RSSI is between 60 and 100+db. If RSSI drops further, the values begin to swing rapidly and enormously from like 60 to 100%. Even after filtering the values in multiwiiosd, it still hardly useable, particularly when flying a mini quad where RSSI can change rapidly as you fly behind objects.

Is there something to fine tune here, or a better way of reading the RSSI?


Hi vertigo,

How were you connecting the RX? Via digital to analog converter or directly to the RSSI ADC pin? If the former then yes, the values you see are expected, if the latter then can give you more details of what you used? If the voltages are betwen 0 and 3.3v going into the ADC pin then the reading should be fine.

Like the battery monitoring code there should problably also be a similar configurable scale that can be applied to the rssi voltage so that it can be fine tuned. I'll raise a ticket on the issue tracker now - https://github.com/cleanflight/cleanflight/issues/105

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

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by dominicclifton »

41south wrote:Having moved my 250/260 quads over to Cleanflight with great success I'm now starting a 400 build with a full Naze32 board that will also be Cleanflight. On my acro's I used the align_board_yaw =-90 so I could easily access the usb connector from the side of the frames. If I do that with the full Naze32 does it also take care of the mag sensor being 'sideways' ? Thanks


yes.

the align_board_* work for all the sensors.

bektorkhan
Posts: 10
Joined: Wed May 07, 2014 3:41 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by bektorkhan »

"Is it possible to use cmix to implement vtail and flapperon mixers for airplane? If so does anyone know howto?" Browsing the source code I found the answer myself:

Yep you should be able to do a vtail mixer with cmix on servo 5 and 6, if it works for servos (found TC comment it might not)!!
And flapperons by setting cli varable flaps_speed > 0 like this in theory:

cmix syntax:

cmix "motor" "throttle" "rollgain" "pitchgain" "yawgain"

Cli commands:

feature RX_PPM
mixer airplane
cmix 5 0 0 1 -1
cmix 6 0 0 1 1
set flaps_speed 3

Setting up how rx flap input is handled i haven't found yet, in old mw 2.1 you set the flap dir and limits in the config.h.

Now it's hardware testing to do.. to see if it works!

I built a hardware one by butchering old MWii 2.1 code and put it in a Arduino Nano board, but it should be in the FC!!

I also see a need to measure temperatures and more voltages on the hardware, the Dallas 1-Wire bus is a quite time critical protcol! Would it be possible to implement it on PA15 pin.
Otherwise there's the DS2482-100 I2C > 1-Wire Bridge. The DS18B20 is cheap and accurate and DS2450 is a 4-channel adc. How crowded is the is the I2C bus loadwise?

Not finding much info on howto setup cleanflight for airplanes, I'll try to make notes realising my X-UAV Talon FPV setup, Frsky DX4R-II , OSD will probably be in the groundstation.
Why fly it when you have frsky telemetry to the ground and maybe MSP through audio channel modem for redundancy. One OSD for all models!!....
Last edited by bektorkhan on Sun Oct 05, 2014 8:35 pm, edited 2 times in total.

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; 1st. post here I think.
Reluctant to ask, as usually an answer is somewhere in the forums, but haven't been able to find anything yet.
I have converted 5 Quads to Cleanflight, all using Naze32 Acro's and Frsky D4R-11's, ranging from the Warpquad 230 to Hoverthings VC450, and Looptimes from 1600-2500. Based on Nebbian's comments. I decided to try 'pid_controller=2', I like it! BUT Autotune doesn't seem to work, (no oscillations or changes too Pid's) not a big deal, AND, when changing any given profile from pid_controller=0 to pid_cont.=2, It changes the Pids to, P=2.5, I=60, D=60, no matter what the previous pids were at. Yaw and level pids are changed as well.
Is this normal, or something that may be changed. At present I'm not using any of the other advantages of Cleanflight, but I like it for Pid_controller=2.
Thanks...Matt
PS: I don't use Hor. Hold, but configured it for one of the 450 sized Quads and tried a Roll. It didn't go as screwy as Nebbian's seemed to in his vid., but when it got to a vertical position, it hesitated for a second, and then completed the roll, at what seemed like twice the 'rate', of a normal rate roll.

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

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by nebbian »

mstocker wrote:Hi; 1st. post here I think.
Reluctant to ask, as usually an answer is somewhere in the forums, but haven't been able to find anything yet.
I have converted 5 Quads to Cleanflight, all using Naze32 Acro's and Frsky D4R-11's, ranging from the Warpquad 230 to Hoverthings VC450, and Looptimes from 1600-2500. Based on Nebbian's comments. I decided to try 'pid_controller=2', I like it! BUT Autotune doesn't seem to work, (no oscillations or changes too Pid's) not a big deal, AND, when changing any given profile from pid_controller=0 to pid_cont.=2, It changes the Pids to, P=2.5, I=60, D=60, no matter what the previous pids were at. Yaw and level pids are changed as well.
Is this normal, or something that may be changed. At present I'm not using any of the other advantages of Cleanflight, but I like it for Pid_controller=2.
Thanks...Matt
PS: I don't use Hor. Hold, but configured it for one of the 450 sized Quads and tried a Roll. It didn't go as screwy as Nebbian's seemed to in his vid., but when it got to a vertical position, it hesitated for a second, and then completed the roll, at what seemed like twice the 'rate', of a normal rate roll.


Good to see someone trying pid_controller = 2 :)

To be clear, the problem with flips is when you do a rotation using the elevator (flip). If you do a rotation using the aileron (roll) it works without the screwy crosstalk, albeit with the hesitation as you describe.

I'm working on some code to fix this, it's working at the moment in development but needs a bit more tuning to make it properly ready for the general public.

I also briefly tried autotune, and like you it didn't do anything. I'll have a look at what's going on.

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

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by mstocker »

****I also briefly tried autotune, and like you it didn't do anything. I'll have a look at what's going on.****
Ah, OK, thanks nebbian. Nice to know I'm not screwing anything up. Autotune is nice to establish a baseline, or to experiment with, I think, but not terribly important to me.
thanks...Matt

41south
Posts: 28
Joined: Tue Jun 26, 2012 11:44 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by 41south »

Just changed both of my 250 quads (Mogo250 and a Spanky) to pid_controller = 2, I have to say that they both feel really great with this setting, very locked in and good smooth controls. Both using pids 'out of the box'. Liking CF more and more - cheers Dominic!

atomiclama
Posts: 3
Joined: Fri Feb 28, 2014 8:45 am

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by atomiclama »

Morning all.
Trying to get the code to build. Got a copy of GIT this morning, I'm getting errors at the link stage.
This is one error, all the vectors are the same.

Code: Select all

`HardFault_Handler' referenced in section `.isr_vector' of obj/main/NAZE/startup_stm32f10x_md_gcc.o: defined in discarded section `.text' of obj/main/NAZE/main.o (symbol from plugin)


Building on windows with a known working gcc setup, I'm using it to dev other prohjects. So what gives with clean flight. Not had this error before.
Any options to turn off section discarding?

Cheers

bektorkhan
Posts: 10
Joined: Wed May 07, 2014 3:41 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by bektorkhan »

bektorkhan wrote:"Is it possible to use cmix to implement vtail and flapperon mixers for airplane?


No cmix is for Motors only :cry: !!

Browsing the code in mixer.c custommixers only applies if numberMotor >1

I'll try to change the airplaneMixer to implement some functionality (V-tail).
Problem is that you only have Throttle,Pitch,Roll and Yaw to use as input. In an Airplane you might wan't AUX channels for Flaps, Gears etc, to implement FLAPPERONS etc...
Perhaps there could be an "amix" command that can do custommixers for airplanes to keep code separate

hwurzburg
Posts: 75
Joined: Sun Jan 01, 2012 3:28 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by hwurzburg »

Can the SONAR sensor be used when SOFTSERIAL and RX_PPM are enabled? I imagine you have to be sure to set UART4 to the UNUSED scenario to connect the RC7/8 pins to the sonar sensor if SOFTSERIAL is active,correct?

fyi, I am also using FRSKY telemetry on UART3....it seems that its baud rate is controlled by gps_baudrate, so that GPS and TELEMETRY must be the same speed, correct?



thanks

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

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by dominicclifton »

hwurzburg wrote:Can the SONAR sensor be used when SOFTSERIAL and RX_PPM are enabled?


yes, i have one quad that has PPM, OSD, GPS, FrSky telemetry and Sonar all enabled at the same time.

hwurzburg wrote:I imagine you have to be sure to set UART4 to the UNUSED scenario to connect the RC7/8 pins to the sonar sensor if SOFTSERIAL is active,correct?


no, softserial port 2 will be disabled when using sonar.

hwurzburg wrote:fyi, I am also using FRSKY telemetry on UART3....it seems that its baud rate is controlled by gps_baudrate, so that GPS and TELEMETRY must be the same speed, correct?


no, not correct. frsky baudrate is set automatically to 9600 when it's used by the code. similarly hott telemetry automatically selects 19200 baud.

there is no need for a user setting to control the baud rate for frsky or hott telemetry since the systems only work at one rate.

hwurzburg
Posts: 75
Joined: Sun Jan 01, 2012 3:28 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by hwurzburg »

Thanks!

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

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by dominicclifton »

XeCutor wrote:I'll improve my issue report a bit. I've changed from a 2-pos switch to a slider, and if I got to the Aux-tab with the slider in low (1000-1200) it's showing LL as it should. As soon as it goes above 1200 it goes to L, above 1400 to M, above 1600 to H, so far so good. As soon as I go above 1800, HH never lights up, but H stays lit and M lights up too. It's the same thing you can see in the screen shot from my previous post. H then stays lit regardless of where the slider is turned, and M, L and LL are also lit up depending on the slider value. If I go to some other tab and back to aux again, the constantly highlighted H value is gone. It looks as though it's only a display issue, the 5 distinct steps seem to all work.


yes, it'll be a bug in the configurator code I imagine, thanks for testing it and reporting back.

I'm currently still trying to decide how best to tackle aux configuration.

My current thinking is to stop using MSP_SET_BOX and MSP_BOX commands and do something different. Not least because the MSP commands are referring to visual representation of the UI rather than being named after the behavior they should invoke!

I'm thinking of an MSP command allowing you to simply say: When channel N is in range X to Y then activate mode Z.

This would then allow for people to use 5 pos, 6pos, 3pos, sliders, knobs, sticks, whatever. Being locked in to 3/5/6 is a bit pants no matter how you look at it.

Not only would this get rid of the horrible bitmask code that all the GUI and FC software has to deal with, it would enable users to do exactly what they want AND be able to provide meaningful configuration in a text based form rather than an unportable integer representation of a bitmask which means nothing to anyone and cannot be re-used if the list of modes change. This would also simplify sharing of aux configurations between users too.

I worked out the worst case storage scenario of the data for all the modes cleanflight has and it turns out that since most people never tick more than about 20 boxes the current solution is actually very wasteful of flash and ram usage.

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

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by dominicclifton »

atomiclama wrote:Morning all.
Trying to get the code to build. Got a copy of GIT this morning, I'm getting errors at the link stage.
This is one error, all the vectors are the same.

Code: Select all

`HardFault_Handler' referenced in section `.isr_vector' of obj/main/NAZE/startup_stm32f10x_md_gcc.o: defined in discarded section `.text' of obj/main/NAZE/main.o (symbol from plugin)


Building on windows with a known working gcc setup, I'm using it to dev other prohjects. So what gives with clean flight. Not had this error before.
Any options to turn off section discarding?

Cheers


please retry after installing a binary distribution of GNU Arm Tools from here:

https://launchpad.net/gcc-arm-embedded/+download

there are differences between distributions of GCC which can result in errors like you're seeing above. If you do find a solution to your problem using your gcc please let me know what version of gcc you're using, where you installed it from and wht you did to fix it. :D

atomiclama
Posts: 3
Joined: Fri Feb 28, 2014 8:45 am

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by atomiclama »

dominicclifton wrote:please retry after installing a binary distribution of GNU Arm Tools from here:

https://launchpad.net/gcc-arm-embedded/+download

there are differences between distributions of GCC which can result in errors like you're seeing above. If you do find a solution to your problem using your gcc please let me know what version of gcc you're using, where you installed it from and wht you did to fix it. :D


Sorry was not clear enough, don't have alot of time for detailed messages.

I'm using the gcc from launch pad as linked to above. think the version is 4.8 2013q4

I fixed it by removing the "-flto -fuse-linker-plugin" link options that seamed to be getting carried away with optimisations.

Anyway compiles / links fine now and the problem I was going to look at, can no longer be reproduced with my build. So going to go back to the one through the configurator and see if it comes back.

cheers

BarneyG
Posts: 39
Joined: Tue May 07, 2013 4:42 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by BarneyG »

dominicclifton wrote:I'm currently still trying to decide how best to tackle aux configuration.

My current thinking is to stop using MSP_SET_BOX and MSP_BOX commands and do something different. Not least because the MSP commands are referring to visual representation of the UI rather than being named after the behavior they should invoke!

I'm thinking of an MSP command allowing you to simply say: When channel N is in range X to Y then activate mode Z.

This would then allow for people to use 5 pos, 6pos, 3pos, sliders, knobs, sticks, whatever. Being locked in to 3/5/6 is a bit pants no matter how you look at it.

Not only would this get rid of the horrible bitmask code that all the GUI and FC software has to deal with, it would enable users to do exactly what they want AND be able to provide meaningful configuration in a text based form rather than an unportable integer representation of a bitmask which means nothing to anyone and cannot be re-used if the list of modes change. This would also simplify sharing of aux configurations between users too.

I worked out the worst case storage scenario of the data for all the modes cleanflight has and it turns out that since most people never tick more than about 20 boxes the current solution is actually very wasteful of flash and ram usage.


Can I suggest serious reflection here ... What you are proposing sounds like it might just break compatibility with MultiWii EZ-GUI on Android and any other tools that rely on this info ... I know I find MultiWii EZ-GUI essential for tuning my quad and I would have to think long and hard about using a firmware that didn't allow me that option.

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

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by dominicclifton »

It's already incompatible with the aux configuration page and has been for some time. I'm in talks with the author of that already which was partly how this and the 5 pos code has come about :D

What i'm planning should be able to be backwards compatible anyway. This evening I've set to work on the configurator UI and it's coming along nicely already. I should also note that i don't need any more testing done on the 5pos code as the new stuff will replace it.

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

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by dominicclifton »

Here's a screenshot of the UI controls.

The idea is that you have modes and you can assign a channel and range to a mode.

ui first cut.PNG


This is a first cut of the UI and allows you to add/delete rows and set ranges, there's no new msp/firmware code yet.

Comments?

41south
Posts: 28
Joined: Tue Jun 26, 2012 11:44 pm

Post by 41south »

Nice :)

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

Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by nebbian »

dominicclifton wrote:Here's a screenshot of the UI controls.

The idea is that you have modes and you can assign a channel and range to a mode.

ui first cut.PNG


This is a first cut of the UI and allows you to add/delete rows and set ranges, there's no new msp/firmware code yet.

Comments?

Nice, very good.

I'd like the ability to specify AND/OR as well as NOT when adding another aux channel to a flight mode selector.

BarneyG
Posts: 39
Joined: Tue May 07, 2013 4:42 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by BarneyG »

dominicclifton wrote:It's already incompatible with the aux configuration page and has been for some time. I'm in talks with the author of that already which was partly how this and the 5 pos code has come about :D

What i'm planning should be able to be backwards compatible anyway. This evening I've set to work on the configurator UI and it's coming along nicely already. I should also note that i don't need any more testing done on the 5pos code as the new stuff will replace it.



Sorry ... I've not tried using the app in anger with Cleanflight yet ... the quad my Naze32 is in got turned into spam before I loaded Cleanflight on so I'm just bench testing atm. Thanks for working with the author to try and keep this powerful combination working.

And that UI for aux config looks awesome. It might be worth overlaying the current aux value so you can see what your switch positions are producing in the same pane as you are setting the ranges.

bektorkhan
Posts: 10
Joined: Wed May 07, 2014 3:41 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by bektorkhan »

dominicclifton wrote:Here's a screenshot of the UI controls.


Very nice and flexible!!

bektorkhan
Posts: 10
Joined: Wed May 07, 2014 3:41 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by bektorkhan »

I have have a Naze32 Acro with inconsistant detection of external BMP180 baro (GY-68) there's also an HMC5883 Mag (GY-271).. the Baro is not detected in current version of cleanflight 09.28, it is however detected by current version of baseflight where both Baro and Mag detected. Tested with only Baro connected also.
I fried my Full Naze32.. so now I upgraded an Acro. The GY-271 have has SCL/SDA switched, so when you convert it to 3.3V, switch the connections!!
I have tried current version of cleanflight on Afro Mini and there the BMP180 is detected. Should test to connect the HMC5883 mag also.

First no external I2C was detected, so I had to change the pullups (1k) to 2k7 resistors or the external I2C sensors would not be detected with any firmware!!

Any clues why ... the BMP180 timing, what is the I2C frequency 100kHz or 400kHZ. I s it possible to relax some timing in the init of the barometer?

Should maybe try 2k2 or 1k8 resistors.. reading the datasheets of BMP180 and HMC5883 they are real lowpower devices, so 1k ohm pullup must be putting a strain on them!

It is probably better to have as little pullup as possible on the I2C bus, so when you connect external devices they can add between 4k7 to 10k on each device.

The MAG device is one that many might want to relocate from the electronics some distance.

bektorkhan
Posts: 10
Joined: Wed May 07, 2014 3:41 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by bektorkhan »

I started a BLOG to document my build/setup of X-UAV Talon Vtail FPV, here's the link:

There's a dirty VTAIL & FLAPPERON mod..

http://www.rcgroups.com/forums/showthread.php?t=2262056

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

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by dominicclifton »

BarneyG wrote:And that UI for aux config looks awesome.


Thanks. :D

BarneyG wrote: It might be worth overlaying the current aux value so you can see what your switch positions are producing in the same pane as you are setting the ranges.


Yes, i was going to add some kind of visual indication of current channel status and current mode status so that fiddling with switches and knobs shows what is active.

A suggestion for a later date was to allow you to 'add control' and then specify how many positions the control has and what channel it's on and then what each position should do.

I might have a think about doing that before I go much further.

T0nkaTruckDriver
Posts: 1
Joined: Fri Oct 10, 2014 7:02 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by T0nkaTruckDriver »

I fly with a Naze32 board connected via SBUS to an X8R receiver (PPM output is not an option on this receiver). The Naze board was recently damaged in a crash - the pad for pin 4 (UART 2) has lifted and is no longer usable. I'm hoping I can use Cleanflight to connect my SBUS receiver to one of the two soft serial ports available. However the documentation shows all of the predefined serial port "scenarios" with the serialRX connected to UART2. Is there a reason for this? Is it possible to connect a serialRX (SBUS in particular) to a soft serial port? If so, is there documentation on how I would go about this?

Alternately, what would happen if I set the serialRX to UART1 and used the TX/RX pins in the center of the board for my receiver connection? Obviously I couldn't read data from the receiver while connected to a PC, but would the board work otherwise?

Any other thoughts on how to get back in the air? The board is fine other than this single lifted pad, and I'd rather not junk it.

I don't use any other serial devices, just the receiver.


Thanks for your help!

XeCutor
Posts: 15
Joined: Tue Sep 23, 2014 9:06 am

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by XeCutor »

XeCutor wrote:
XeCutor wrote:I'm happy to report that changing my BT module's baud rate to 19200 and setting msp_baudrate in CLI to 115200 made it possible to use my OSD on serial 1 at full speed, and connect to the quad over a BT module on soft serial port 1 (RC ping 5+6). The problems I saw when trying to runt at 9600 are gone, now all I have to do is figure out how to make my wiring neat, the side facing ports of the Naze32 is a PITA on the 250 quad I've got.

On the problem of resetting serial config, make sure that you on no ports have the same feature enabled twice, except MSP which is allowed at most twice. So if you do set serial_port_4_scenario = 2, make sure you don't have serial port 2 set to it's default which is also 2. I've myself made the same mistake lots of time, trying to set scenario 5 on two ports.


I'm sorry to say that I celebrated too early. I run CLI+MSP on port 3 with baud rate 19200, so far everything I've tried has worked until just now when I tried to change some aux configuration after having connected a GPS unit to my board. Before, with 9600 baud rate I could not even see the aux tab without getting packet errors, now I can see it just fine and it reacts to TX changes. But I cannot save anything. If I try to save, it'll start ticking up packet errors and if I return to the tab, nothing will have changed. This is the last reason I may need to connect a USB-cable (which is a pain given how my board is located on the quad) except for the occasional re-calibration of ESC's which require a USB cable to work. Please look into this issue and if at all possible, I'd be so happy if you could fix it.


It seems I probably jumped to conclusions. It turns out the aux tab (running the 5-pos firmware + configurator) has failed to function for me completely, be it over usb or bluetooth when it comes to saving values. It turns out that it starts working again if I "feature -GPS" and stops working again if I enable GPS.

Post Reply