Cleanflight aka Multiwii port to STM32 F10x and F30x

Post Reply
zatalian
Posts: 6
Joined: Tue Sep 09, 2014 8:02 am

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by zatalian »

I'm testing sbus input between my FrSky Taranis -> X4R-SB -> Acro Naze with latest cleanflight.

I notice that my rc values are "somewhere" transformed...

Taranis : min = 988, mid = 1500, max = 2012 -> sounds correct, range of 1024 around 1500
CleanFlight Configurator: min=1074, mid=1484, max=1894 -> range of 820 around 1484?

where and how are these numbers transformed? As far as I can tell in the cleanflight code, the values are devided by 2 (2048 to 1024) and added to the minimum value 988, exactly as expected, yet the numbers are incorrect.
Does that mean that my taranis sends incorrect values to my receiver???

shadowjig
Posts: 16
Joined: Thu Jun 26, 2014 12:22 am

Post by shadowjig »

What's the status of autotune? Are folks successfully using it or is it still buggy?

presidenten
Posts: 26
Joined: Thu Aug 14, 2014 8:30 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by presidenten »

Im going to test autotune later today, Ill report my results here tonight.

Anyways, on to my issue. I have my ublox lea-6h gps connected, but even though I think I have everything setup correctly in the cli, the gps still wont see any satellites.
Any ideas on what may be wrong?

I am running full naze32 rev5 with Cleanflight/NAZE Sep 6 2014 / 00:24:11 (ca72890)
This GPS: http://hobbyking.com/hobbyking/store/__42833__UBLOX_LEA_6H_GPS_Module_w_Built_in_Antenna_2_5m_Accuracy_V1_01.html and I see satellites and get a fix when connecting the gps to ublox ucenter via usb.

Gps is connected according to this scheme: http://fpvlab.com/forums/attachment.php?attachmentid=43116&d=1394547175 and it lights up the "GPS" block top right in the cleanflight chrome configurator, so it seems to be active. Disconnecting a wire makes it turn red.

These are my gps settings:

Code: Select all

gps_baudrate = 38400
gps_passthrough_baudrate = 115200
gps_provider = 1
gps_sbas_mode = 1 (I have also tried gps_sbas_mode = 0)
...
serial_port_1_scenario = 1
serial_port_2_scenario = 2
serial_port_3_scenario = 0
serial_port_4_scenario = 0


These are my activated features:

Code: Select all

# feature
Enabled features: RX_PPM MOTOR_STOP GPS SONAR


But still ... no detecting satellites. Any ideas on how to make it work?

Edit: Not sure if it is of any importance, but I also have a mavlinkosd flashed with multiwii osd connected to the rx/tx pins on top. It does not matter for the gps if I have it powered ot not though. No satellites in anyways ... just that green box telling me stuff should work.

shadowjig
Posts: 16
Joined: Thu Jun 26, 2014 12:22 am

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by shadowjig »

presidenten wrote:Im going to test autotune later today, Ill report my results here tonight.

Anyways, on to my issue. I have my ublox lea-6h gps connected, but even though I think I have everything setup correctly in the cli, the gps still wont see any satellites.
Any ideas on what may be wrong?

I am running full naze32 rev5 with Cleanflight/NAZE Sep 6 2014 / 00:24:11 (ca72890)
This GPS: http://hobbyking.com/hobbyking/store/__42833__UBLOX_LEA_6H_GPS_Module_w_Built_in_Antenna_2_5m_Accuracy_V1_01.html and I see satellites and get a fix when connecting the gps to ublox ucenter via usb.

Gps is connected according to this scheme: http://fpvlab.com/forums/attachment.php?attachmentid=43116&d=1394547175 and it lights up the "GPS" block top right in the cleanflight chrome configurator, so it seems to be active. Disconnecting a wire makes it turn red.

These are my gps settings:

Code: Select all

gps_baudrate = 38400
gps_passthrough_baudrate = 115200
gps_provider = 1
gps_sbas_mode = 1 (I have also tried gps_sbas_mode = 0)
...
serial_port_1_scenario = 1
serial_port_2_scenario = 2
serial_port_3_scenario = 0
serial_port_4_scenario = 0


These are my activated features:

Code: Select all

# feature
Enabled features: RX_PPM MOTOR_STOP GPS SONAR


But still ... no detecting satellites. Any ideas on how to make it work?

Edit: Not sure if it is of any importance, but I also have a mavlinkosd flashed with multiwii osd connected to the rx/tx pins on top. It does not matter for the gps if I have it powered ot not though. No satellites in anyways ... just that green box telling me stuff should work.

Try connecting to a laptop and running u center and sit outside for a while. Just to make sure the GPS is working. You might have to change some of the config to see the satellite data in both u center and cleanflight.

presidenten
Posts: 26
Joined: Thu Aug 14, 2014 8:30 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by presidenten »

Any idea on which parameters that might have to be changed?

Ps. One of my motors finally gave up today before I had a chance to try autotune. Will switch it today and try the autotune tomorrow. Ill report back when it is done.

shadowjig
Posts: 16
Joined: Thu Jun 26, 2014 12:22 am

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by shadowjig »

presidenten wrote:Any idea on which parameters that might have to be changed?

Ps. One of my motors finally gave up today before I had a chance to try autotune. Will switch it today and try the autotune tomorrow. Ill report back when it is done.

I used this tutorial and satellite data showed up in Cleanflight.

https://code.google.com/p/ardupirates/w ... PSTutorial

shadowjig
Posts: 16
Joined: Thu Jun 26, 2014 12:22 am

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by shadowjig »

presidenten wrote:Any idea on which parameters that might have to be changed?

Ps. One of my motors finally gave up today before I had a chance to try autotune. Will switch it today and try the autotune tomorrow. Ill report back when it is done.

I used this tutorial and satellite data showed up in Cleanflight.

https://code.google.com/p/ardupirates/w ... PSTutorial

zatalian
Posts: 6
Joined: Tue Sep 09, 2014 8:02 am

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by zatalian »

i did some further testing on the frsky sbus. There are 2 differences:

1. scale
* normal sbus uses 1/2 µs for one sbus unit
* frsky sbus uses 5/8 µs per for one sbus unit

2. offset
offsets are different. What's worse, frsky sbus offsets are dependent on the servo midpoint programmed in my taranis, which makes no sense

anyway, i think we will need separate sbus code for frsky. I also noted in the code that the inverted sbus channel is not a hardware restriction but can be changed in code. That would make it possible to read the frsky sbus channel without inverter. I'm going to test that later this week.

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

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by dominicclifton »

nebbian wrote:I glanced in the Baseflight code, and you can't select pid_controller = 2, so it appears to be a cleanflight thing. I'm curious as to how it was conceived.


Lux (on irc) created it, it uses floating point math. It's been in the baseflight repo on a seperate branch, unloved for months and months.

It was not merged into baseflight because TC also wanted the storage of all pid variables to be in floats, currently the implementation wastes a tiny amount of flash space but I figured it was better to have people testing a new pid controller than to let the code go stale.

nebbian wrote:Flying it yesterday showed up a bug in the horizon mode implementation: if you do a quick flip while in horizon mode, the first half of the flip is fine, but the second half turns into a shoulder roll as if the aileron is banged hard over. Doing the same flip in acro mode results in a normal flip. I can do a video for you if you like. Also, I noticed that if you don't get the "PID" parameters right then when in horizon mode, you can bang the stick hard over and it only goes over to 90 degrees instead of doing a full flip. This surprised me greatly the first time it happened.

Would you like me to give this mode a tuneup?


Yes to the video and Yes to the Tuneup! Please chat to Lux as I'm sure he'd be very interested in your findings.

His code can be found here, https://github.com/luggi

nebbian wrote:Also I'm wondering what the status of my pull request for the sonar flight mode is.


I thought you might ask about that. Before I merge it I want to flight-test it. On saturday I fitted a sonar sensor to my quad and flew it for the first time. I need to do a bit of tuning of the baro pids but it was definitely working! Now that is done I will look more into the flight mode support for it later this week.
Last edited by dominicclifton on Mon Sep 15, 2014 1:15 pm, 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

Post by dominicclifton »

zatalian wrote:i did some further testing on the frsky sbus.


keep us all posted with your findings zatalian, I plan on doing some FrSky sbus testing soon, I have an XJT and X8R here with a 9XR Pro TX.

zatalian wrote:... that would make it possible to read the frsky sbus channel without inverter. I'm going to test that later this week.


I'm confused. The F3 processors let you configure the serial ports to accept an inverted signal. The F1 does not have this capability. The RX always sends out an inverted signal.

The CC3D has a hardware inverter on the board for input (check the schematics), the naze32 has an inverter for telemetry output - always enabled, two hardware pins. but, iirc, not for sbus input, an external inverter is required which can be toggled using a spare gpio pin. perhaps TC is planning a new revision of the naze32 that has an onboard one, hence the code in baseflight.

right?

presidenten
Posts: 26
Joined: Thu Aug 14, 2014 8:30 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by presidenten »

Thanks! I will try it out!


shadowjig wrote:
presidenten wrote:Any idea on which parameters that might have to be changed?

Ps. One of my motors finally gave up today before I had a chance to try autotune. Will switch it today and try the autotune tomorrow. Ill report back when it is done.

I used this tutorial and satellite data showed up in Cleanflight.

https://code.google.com/p/ardupirates/w ... PSTutorial

presidenten
Posts: 26
Joined: Thu Aug 14, 2014 8:30 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by presidenten »

Edit: Added that the battery is 4s. This is very likely the root of the problem as the motors are specified for 3s.

Ok. Bad news about autotune.
Here is my setup:
    * Full naze32 rev5 with Cleanflight/NAZE Sep 6 2014 / 00:24:11 (ca72890)
    * Blackout spider hex (hex6x mixer)
    * T-motor mn1806 2300kv
    * Hqprop 5x3
    * Kiss 18A esc
    * 3000mah turnigy nanotech 25c 4s


First time I tried, I had a semi bad motor on middle right arm. When first pass came to small oscillations it dropped out of the sky. Closer inspections showed that motor was fried.

Thinking it was because the motor was about to go bad, I put on a new motor and tried again. This time I made it a bit longer but then smoke came from the new motor and I dropped from the sky once more. Closely inspecting all motors, because they were all hot, it turns out that the motor out on the left arm is now in semi fried state as well. :(

Conclusion: Do NOT try autotune on this setup.
I am now three expensive engines poorer because of it...
Last edited by presidenten on Tue Sep 16, 2014 7:39 am, edited 1 time in total.

strips
Posts: 163
Joined: Thu Apr 03, 2014 1:28 pm

Sv: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by strips »

presidenten wrote:Ok. Bad news about autotune.
Here is my setup:
    * Full naze32 rev5 with Cleanflight/NAZE Sep 6 2014 / 00:24:11 (ca72890)
    * Blackout spider hex (hex6x mixer)
    * T-motor mn1806 2300kv
    * Hqprop 5x3
    * Kiss 18A esc
    * 3000mah turnigy nanotech 25c


First time I tried, I had a semi bad motor on middle right arm. When first pass came to small oscillations it dropped out of the sky. Closer inspections showed that motor was fried.

Thinking it was because the motor was about to go bad, I put on a new motor and tried again. This time I made it a bit longer but then smoke came from the new motor and I dropped from the sky once more. Closely inspecting all motors, because they were all hot, it turns out that the motor out on the left arm is now in semi fried state as well. :(

Conclusion: Do NOT try autotune on this setup.
I am now three expensive engines poorer because of it...


An FC should not be able to fry a motor if esc/motors are dimensioned correctly. I have not tested autotune in Cleanflight, only on Harakiri. I have never spent batteries as fast as when I was playing around with it. I think heavy oscillations suck up amps like crazy.

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

Re: Sv: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by tungsten2k »

strips wrote:
presidenten wrote:Conclusion: Do NOT try autotune on this setup.
I am now three expensive engines poorer because of it...


An FC should not be able to fry a motor if esc/motors are dimensioned correctly.


I agree. If the signals going to the ESC are causing the motors to fry, then the ESC is at fault; it shouldn't allow signals to translate into motor-damaging operations.

-=dave

presidenten
Posts: 26
Joined: Thu Aug 14, 2014 8:30 pm

Re: Sv: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by presidenten »

tungsten2k wrote:
strips wrote:
presidenten wrote:Conclusion: Do NOT try autotune on this setup.
I am now three expensive engines poorer because of it...


An FC should not be able to fry a motor if esc/motors are dimensioned correctly.


I agree. If the signals going to the ESC are causing the motors to fry, then the ESC is at fault; it shouldn't allow signals to translate into motor-damaging operations.

-=dave


The mn1806 2300 is specified for 2s-3s, but I, as well as a few other who want to squeeze every possible bit of thrust from them, run them on 4s. Usually not a problem, but this was obviously pushing it to far. The kiss escs has some regenerative breaking feature. That might also be what screwed it up? I dont know. I just know I wont use it again.
I also want to point out that I dont blame anyone. Opensource comes as is. I know that. I appreciate the work done.

But some guy a few posts up asked it someone had tried it, now I have, and frying a few motors was my result. So I thought a friendly warning should be issued and I would not recommend anyone using my setup to use it. I am sure it works on some other setup though as I am pushing it with the 4s battery.

Edit: Just thought I should mention that I have a friend who is running lumenier 2350kv on 3s that is using a taulabs controller with autotune that seemed to be using the same shaking pattern and he has no problem at all with autotune. So I suppose that lesson is that is you are pushing it with the battery/escs/whatever, do autotune at your own risk.

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

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by dominicclifton »

With your setup if you waggled your sticks hard enough you'd get the same effect since that is all the autotune code is doing - except that it records some data and performs calculations too.

Just curious how long you think you were testing autotune before you had the problems?

presidenten
Posts: 26
Joined: Thu Aug 14, 2014 8:30 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by presidenten »

dominicclifton wrote:With your setup if you waggled your sticks hard enough you'd get the same effect since that is all the autotune code is doing - except that it records some data and performs calculations too.

Just curious how long you think you were testing autotune before you had the problems?



Haha, yes. I am sure if I put my back into it I could :)
There are many inspiring rc pilots with similar setups that are racing a lot harder than I am, so I think Ill be fine. Usually my motors are barely luke warm after flying.
New motors are mounted now, so I can fly tonight again and try out the sonar alt hold.

I ran it until the sequence ends. First time the motor actually didnt give up until I was a bit into the second pass if I remember it correctly.

Anyways, Im not sure if I feel the vibe from you guys correctly. But please try to see me as an unfortunate guy rather than some evil spy who tries to bash on your software. I know there is no magical autodestroy signal being sent out and that my naze do not attend hogwarts.
I just thought someone might appreciate the warning, even if it seems to be dependant on my setup.
The autotune maneuvers obviously stress the motors and make them hot. Which is bad news if you are pushing your setup with 4s battery on 3s motors.

Edit: I see I forgot to write that batteries are 4s on initial autotune post. It is now added.

strips
Posts: 163
Joined: Thu Apr 03, 2014 1:28 pm

Sv: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by strips »

presidenten wrote:
dominicclifton wrote:With your setup if you waggled your sticks hard enough you'd get the same effect since that is all the autotune code is doing - except that it records some data and performs calculations too.

Just curious how long you think you were testing autotune before you had the problems?



Haha, yes. I am sure if I put my back into it I could :)
There are many inspiring rc pilots with similar setups that are racing a lot harder than I am, so I think Ill be fine. Usually my motors are barely luke warm after flying.
New motors are mounted now, so I can fly tonight again and try out the sonar alt hold.

I ran it until the sequence ends. First time the motor actually didnt give up until I was a bit into the second pass if I remember it correctly.

Anyways, Im not sure if I feel the vibe from you guys correctly. But please try to see me as an unfortunate guy rather than some evil spy who tries to bash on your software. I know there is no magical autodestroy signal being sent out and that my naze do not attend hogwarts.
I just thought someone might appreciate the warning, even if it seems to be dependant on my setup.
The autotune maneuvers obviously stress the motors and make them hot. Which is bad news if you are pushing your setup with 4s battery on 3s motors.

Edit: I see I forgot to write that batteries are 4s on initial autotune post. It is now added.


Thinking on what requires most power when flying. I'd believe it would be quick changes in speed. The acceleration it self would require much more power than just keeping a high rev. I also use KISS ESCs. You might be onto something with the regenerative breaking. When breaking the ESCs will act as a very low resistance and suck up whatever amps generated by the motor momentum. So we get a faster stop with reverse current. And when the next instruction says "full throttle" it has to start from an lower rpm than regular ESCs. But this should be discussed in the KISS thread on Rcgroups. Juuut there is the or one of the KISS developers.

stevef1966
Posts: 5
Joined: Sun Sep 14, 2014 6:51 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by stevef1966 »

Hi did this ever get sorted, I'm having the same issue with my gps/rx or a very similar one, great project btw

Thanks keep up the amazing work.


dominicclifton wrote:
gerardo85 wrote:Hi Dominic,

Not sure if this has been touched on before, but I found some differences between baseflight and cleanflight in the receiver connections regarding gps. As per the manual of the Naze32, connections 3 and 4 are used for the gps. Hooked them up, got Cleanflight to show gps is connected but this is where the difference comes in. For baseflight once this is done, connections 5 and 6 becomes throttle and yaw as stated in the manual. But for cleanflight it doesn't. When I move my stick it moves Aux1 and Aux2. Thought I bring this up if no one has. Also are there any differences in gps performance between baseflight and cleanflight? Couldn't seem to get harakiri working for me at least for now. The chrome gui is a big plus in my opinion.


please can you create an new issue for this here:

https://github.com/hydra/cleanflight/issues

I'll take a look into it, i now have a spare rx/tx combo which should make my testing life easier.

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 just installed cleanflight on a spare naze board in an attempt to cure the overcorrection problem I was suffering with the other board + baseflight in acro mode. Ive only done a short test flight in my garden with stock settings, so I will try not to jump to conclusions, but its never flown better :). I also like some of the additional features.

A few questions though:
- the Frsky RSSI signal pin should be connected to pin 3, correct? Is there a way to use that, and a GPS?
- I was toying with MultiWii EZ-GUI on my android via bluetooth. Seems to work fine, but I noticed on the AUX page, that I had no less than 5 switches per aux channel, rather than 3. IS that a feature of cleanflight? If so, how do I enable it? If not, consider it a feature request :D.
- I configured autotune and if I feel brave enough, I may give it a try tomorrow. How long does a autotune cycle take more or less?
- lastly, a feature request for the GUI; would it be hard to make a page to configure all the CLI only options? I would even make it dynamic, it could query the firmware for all available features and settings, and generate a GUI based on what the firmware responds. That way, it would be future proof 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 »

Vertigo wrote:- the Frsky RSSI signal pin should be connected to pin 3, correct? Is there a way to use that, and a GPS?


yes, is that not in the documentation?

gps connets to pin 4 and 5, use `feature GPS` in cli too, don't forget `gps_provider` setting, should probably also be in documentation that comes with the naze, probably needs to be in cleanflight docs too. please submit pull requests for documentation improvements.

Vertigo wrote:- I was toying with MultiWii EZ-GUI on my android via bluetooth. Seems to work fine, but I noticed on the AUX page, that I had no less than 5 switches per aux channel, rather than 3. IS that a feature of cleanflight? If so, how do I enable it? If not, consider it a feature request :D.


don't use ez-gui to configure aux channels, bad things may happen since it's not using the correct protocol. always disconnect props before changing aux settings. only supported tool for aux config is cleanflight configurator.

please add a feature request to github issues page for support for more aux settings per channel if it's not already there: https://github.com/hydra/cleanflight/issues

Vertigo wrote:- I configured autotune and if I feel brave enough, I may give it a try tomorrow. How long does a autotune cycle take more or less?


run it for as long as you like, the bradwii author has some recommentations but i forget, google for bradwii autotune.

Vertigo wrote:- lastly, a feature request for the GUI; would it be hard to make a page to configure all the CLI only options? I would even make it dynamic, it could query the firmware for all available features and settings, and generate a GUI based on what the firmware responds. That way, it would be future proof too.


I'm having thoughts about gui code, watch this space.

Please let us know how you get on with cleanflight, very interested to hear.

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

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by dominicclifton »

stevef1966 wrote:Hi did this (pwm mapping problem) ever get sorted, I'm having the same issue with my gps/rx or a very similar one, great project btw

Thanks keep up the amazing work.

please can you create an new issue for this here:

https://github.com/hydra/cleanflight/issues



did an issue get created for it? can't see one. probably why it got forgotten! ;) it's of utmost importance that issues get created for problems, a forum is a great place for discussion, but not for keeping track of issues and requests.

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 another project status update video:

https://www.youtube.com/watch?v=-w-Ikv5U1Lw

OLED display support and Configurable RBG LEDs - with demo on the bench and two quads.


stevef1966
Posts: 5
Joined: Sun Sep 14, 2014 6:51 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by stevef1966 »

Hi Dominic, i don't think the original poster did create an issue in github so ive done that now, sorry to add to the workload :-( hope it makes sense to you

dominicclifton wrote:
stevef1966 wrote:Hi did this (pwm mapping problem) ever get sorted, I'm having the same issue with my gps/rx or a very similar one, great project btw

Thanks keep up the amazing work.

please can you create an new issue for this here:

https://github.com/hydra/cleanflight/issues



did an issue get created for it? can't see one. probably why it got forgotten! ;) it's of utmost importance that issues get created for problems, a forum is a great place for discussion, but not for keeping track of issues and requests.

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

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by nebbian »

dominicclifton wrote:
Yes to the video and Yes to the Tuneup! Please chat to Lux as I'm sure he'd be very interested in your findings.



Here's a video I made today, apologies for the wind noise in the microphone...



dominicclifton wrote:His code can be found here, https://github.com/luggi


Awesome, thanks. I've been in contact and will take this further with him.

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

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by nebbian »

Does anyone know how (or if) I can add a GPS to the following setup:

* Naze full board
* Tricopter setup so PWM 1 is the tail servo, PWM 3-5 are motor ESC outputs
* Parallel PWM RC inputs for lines 1-6
* MWOSD connected to Tx and Rx lines

I've tried going through the softserial documentation, but I can't figure out where the different UARTS are connected to on the naze. The documentation mentions all the different UARTS on the board but I'm stumped as to how to connect the GPS to, for example, Rx lines 7 and 8. I'd prefer to have two lines for the GPS so that on startup it can tell the GPS to set the baud rate and so on. I had this working well on my multiwii board (but had flight and tuning issues so have moved to the naze).

strips
Posts: 163
Joined: Thu Apr 03, 2014 1:28 pm

Sv: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by strips »

nebbian wrote:Does anyone know how (or if) I can add a GPS to the following setup:

* Naze full board
* Tricopter setup so PWM 1 is the tail servo, PWM 3-5 are motor ESC outputs
* Parallel PWM RC inputs for lines 1-6
* MWOSD connected to Tx and Rx lines

I've tried going through the softserial documentation, but I can't figure out where the different UARTS are connected to on the naze. The documentation mentions all the different UARTS on the board but I'm stumped as to how to connect the GPS to, for example, Rx lines 7 and 8. I'd prefer to have two lines for the GPS so that on startup it can tell the GPS to set the baud rate and so on. I had this working well on my multiwii board (but had flight and tuning issues so have moved to the naze).

You need PPM. Not PWM inputs.

Soldier
Posts: 7
Joined: Sun Sep 14, 2014 4:36 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by Soldier »

Hi.

I installed the FW from cleanflight and got the gps working, connected to rc3-4, but now i am missing throttle and rudder channels? I have an frsky x8r rx, so what to do?

-kenneth

Spotter6
Posts: 63
Joined: Thu Sep 18, 2014 3:16 am

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by Spotter6 »

I don't see Auto Tune. Is it off the SW for now ??

stevef1966
Posts: 5
Joined: Sun Sep 14, 2014 6:51 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by stevef1966 »

Hi Kenneth, i had the same issue, had help to fix it from shuffleznl what i did was use the CLI and the command:
map AT12TR34 and all is working just fine so far, everything is back to the channels they were on before.

thanks to shuffleznl and this forum for the awesome clearflight..




Soldier wrote:Hi.

I installed the FW from cleanflight and got the gps working, connected to rc3-4, but now i am missing throttle and rudder channels? I have an frsky x8r rx, so what to do?

-kenneth

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

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by Vertigo »

Decided to try the autotune feature. It seems to work, but there is one thing I dont quite understand. Im using an acro naze, and Im not sure how the quad is attempting to maintain its altitude. Its climbing during the tuning and since I was doing this line of sight, I quickly risked it getting too far for comfort. So I tried throttling down, but while in autotune mode, that doesnt seem to do anything. Until, suddenly it did, and the quad flipped inverted and headed to the ground. Managed to save it, tried again, and while I may have disengaged it too soon, the result was marked improved from stock settings. Here is the video:



If I use this on a full naze with baro, will autotune use the baro to maintain its altitude? Anyway Ill give it another go soon, while flying FPV and making sure I changed my aux config so the beeper isnt on when I engage autotune, so I can hear when it finishes. I think I disengaged it too quickly, but my old eyes cant see a 250 sized mini quad when its getting too high.

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 »

Dominic,

I noticed that the backup command offers an auto-generated file name starting bf_. You may wish to consider changing this to a cf_ prefix, if nothing else to avoid abusive trademark claims on the letters 'b' and 'f'.

brm
Posts: 287
Joined: Mon Jun 25, 2012 12:00 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by brm »

Vertigo wrote:Decided to try the autotune feature. It seems to work, but there is one thing I dont quite understand. Im using an acro naze, and Im not sure how the quad is attempting to maintain its altitude. Its climbing during the tuning and since I was doing this line of sight, I quickly risked it getting too far for comfort. So I tried throttling down, but while in autotune mode, that doesnt seem to do anything. Until, suddenly it did, and the quad flipped inverted and headed to the ground. Managed to save it, tried again, and while I may have disengaged it too soon, the result was marked improved from stock settings. Here is the video:

If I use this on a full naze with baro, will autotune use the baro to maintain its altitude? Anyway Ill give it another go soon, while flying FPV and making sure I changed my aux config so the beeper isnt on when I engage autotune, so I can hear when it finishes. I think I disengaged it too quickly, but my old eyes cant see a 250 sized mini quad when its getting too high.


now you need to report the pid settings.

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 »

brm wrote:
Vertigo wrote:Decided to try the autotune feature. It seems to work, but there is one thing I dont quite understand. Im using an acro naze, and Im not sure how the quad is attempting to maintain its altitude. Its climbing during the tuning and since I was doing this line of sight, I quickly risked it getting too far for comfort. So I tried throttling down, but while in autotune mode, that doesnt seem to do anything. Until, suddenly it did, and the quad flipped inverted and headed to the ground. Managed to save it, tried again, and while I may have disengaged it too soon, the result was marked improved from stock settings. Here is the video:

If I use this on a full naze with baro, will autotune use the baro to maintain its altitude? Anyway Ill give it another go soon, while flying FPV and making sure I changed my aux config so the beeper isnt on when I engage autotune, so I can hear when it finishes. I think I disengaged it too quickly, but my old eyes cant see a 250 sized mini quad when its getting too high.


now you need to report the pid settings.


MassiveOverkill published his 250 class quad autotune results on rcgroups. Applying those PIDs to my 250 class acro naze home-build has cured the "hard yaw to left on horizon mode level from flips and rolls" infection.

renatoa
Posts: 1
Joined: Sat Sep 20, 2014 8:38 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by renatoa »

Tried today to install Configurator and was slapped for the Chrome version, because I have V33, which is the last on XP.
Please don't tell me to update, XP, as discontinued as is, has still more than 30% of market, and I don't intend to stop using it too soon. And I have a business based on this... and nothing else than XP in the organization.
As a side-note, baseflight configurator works on this outdate V33, so wondering if you can recompile Cleanflight Configurator to be available on XP too.
Thank you.

Spotter6
Posts: 63
Joined: Thu Sep 18, 2014 3:16 am

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by Spotter6 »

Here's my AutoTune Result.

Starting point:
Roll: 4.3, .032, 23
Pitch: 4.3, .032, 23
Yaw: 13.5, .05, 23

With 9" 9334 props,
Roll: 6.0, .036, 23
Pitch: 4.2, .032, 23
Yaw: 12.0, .036, 23

With 8" 8045 props,
Roll: 8.2, .041, 23
Pitch: 4.2, .032, 23
Yaw: 16.4, .041, 23

FWIW, I'm a little suspect/questioning of why Pitch didn't change much.
F330 DJI Frame
DJI Red motors with Ceramic bearings
DJI 30A Opto
3s batt.

There was slight wind left to right at the craft. I wonder if this mess up the resulting PID somehow.

It flew much nicer than before.

Then I experimented more.. Started with the resulted 8" numbers, I did another round of AutoTune. This time PID got even higher across the board as I bought it in to save the numbers. Flight behavior was definitely oscillating! Too high.

I was expecting PID to converge to stability (shouldn't it?), but it didn't. During each AutoTune, I'd let it rock about 5 times, then stopped. Noticed it did same behavior as Vertigo saw, the gaining of altitude while rocking.

So to those who use AutoTune, I'd advise then to stay with the first set of numbers they got.

ArrogantDuck
Posts: 17
Joined: Tue Jul 15, 2014 7:59 pm

Re:

Post by ArrogantDuck »

shadowjig wrote:What's the status of autotune? Are folks successfully using it or is it still buggy?


My take: Love it; makes a naze32 setup crazy easy.

Took me some tests to understand it. The wording needs to be changed, though.

Used all three of my pid settings to understand it. Glad I realized I had them to test with.

On the first two, I waited for the system to indicate something. No buzzer so...
Figured it out: let it go until it is uncomfortable. Next phase: do it until uncomfortable.
When it started to descend too low, I had learned from my previous attempts that that was the time to move on.

The best tuning I have had on a naze32. This is to say, I would never have come up with these numbers as the direction they went in hasn't been my tendency.

Autotune, as it has been envisioned here, works really nicely. I like that I get to move on with the phases; especially, I like that I don't need a computer afterward to save the settings.

Dominic,
Thank you and well done.
Cheers,
Robert

Spotter6
Posts: 63
Joined: Thu Sep 18, 2014 3:16 am

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by Spotter6 »

Are PID values, either exactly the same or approximately the same, across FW forks ? In other words, are they the same in Cleanflight, BaseFlightC, and HaraKiri ?

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

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by Vertigo »

Edit: someone on rcgroups pointed me in the right direction by linking this document:
https://github.com/hydra/cleanflight/bl ... 0Naze32.md

Perhaps its a good idea to link or refer to it in the document explaining serial ports. Below for reference my original post, but I can probably work it out now.
Im confused about the serial port settings. Ive read the docs, but cant quite follow. To what pins do UART1 and UART2 correspond to? When you configure a serial port, like "set serial_port_2_scenario = 3", which serial port is 2, I mean, to what pin does that correspond?

What Im trying to achieve, if its possible:
- OSD connected to the rx/tx pins 8 on the naze
- GPS on pins 3/4 (Im using CPPM)
- frsky telemetry, if possible "always on", so also when not armed (therefore, I guess using softserial via receiver pins?) or if need be, via the dedicated telemetry pin.

Any help would be appreciated.
Last edited by Vertigo on Sun Sep 21, 2014 12:49 pm, edited 1 time in total.

Soldier
Posts: 7
Joined: Sun Sep 14, 2014 4:36 pm

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by Soldier »

stevef1966 wrote:Hi Kenneth, i had the same issue, had help to fix it from shuffleznl what i did was use the CLI and the command:
map AT12TR34 and all is working just fine so far, everything is back to the channels they were on before.

thanks to shuffleznl and this forum for the awesome clearflight..




Soldier wrote:Hi.

I installed the FW from cleanflight and got the gps working, connected to rc3-4, but now i am missing throttle and rudder channels? I have an frsky x8r rx, so what to do?

-kenneth


Thanks for the help stevef1966, that did the trick. On stock PID it flyes great and very stable in acro/angle/horizon, and even the gps gets a fast lock. It still seem to drift a lot, if i put it in gps-hold mode. it keeps altitude as well as it normally does "bopping" a little, and even heading it seem to hold.

Has anyone gotten gps hold and gps home working perfectly?

My setup is 450 X, simonk 30A esc, durafly 960KV motor, full naze and ublox neo-6m gps - cleanflight FW on stock settings gps hold = checked angle, baro, mag gps hold and still drifting away even though gps has 3d fix and tells position on the dot.

-Kenneth

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 »

Dominic,

Questions ref setup ( finally built the 250)

When you refer to RC_5 as the control pin for RGB Leds on a Naze32, I presume you mean Input pin 5 not output pin M5 as running from input pin 5 I get nothing, I do have some of the 6v batch of AfroEsc V3 Lites so could I have burnt out the test Led?

Ublox Neo-6 GPS, I'm pretty sure that any Ublox module I've ever had in binary mode has never shown as functional in the GUI (baseflight or otherwise), is there any other way I can confirm it's communicating (without flight testing of course)

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

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by dominicclifton »

Been busy this weekend, I will reply to questions tomorrow, in the mean time check this out:

Screen Shot 2014-09-22 at 00.32.31 small.png


What you're looking at is 5 position support for 12 aux channels!

If anyone is feeling brave they can try out the 5 position and 12 aux channel support.

https://github.com/hydra/cleanflight-co ... s/aux-5pos
https://github.com/hydra/cleanflight/commits/aux-5pos

You will need latest configurator and latest binary, attached for naze.



Configurator: https://github.com/hydra/cleanflight-configurator/archive/aux-5pos.zip
Installation instructions: https://github.com/hydra/cleanflight-co ... native-way

Note from the commit message:

Code: Select all

Support 5 positions per aux channel and configuration of 12 aux channels.

Do NOT use old any version of onfgurator. Minimum configurator version is 0.51.0.
WARNING: REMOVE PROPS WHEN TESTING!
WARNING: Do not use your old aux config dumps from the CLI.

RX channels positions are:

LL < 1200
L  1200 - <1400
M  1400-1600
H  >1600 - 1800
HH >1800

5 positions, not 6 positions, were chosen because:
a) it fits in the flash better
b) it fits in ram better (all flags fit in 60 bits)
c) it’s easier to transition to, since there is still a Low Middle and High

strips
Posts: 163
Joined: Thu Apr 03, 2014 1:28 pm

Post by strips »

Awesome Dominic! Then it's only robust GPS and PH remaining! That's really the only reason to need more positions and channels.

Are there any merits to the rumors about porting Harakiri PH code?

stevef1966
Posts: 5
Joined: Sun Sep 14, 2014 6:51 pm

Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by stevef1966 »

strips wrote:Awesome Dominic! Then it's only robust GPS and PH remaining! That's really the only reason to need more positions and channels.

Are there any merits to the rumors about porting Harakiri PH code?


:-)
ha ha, We are an impatient bunch and to be honest we should hold the like of Dominic in hi regard, but yeah when for GPS/PH LOL
(Not implying we don’t btw)
:-)

Is there anyway us normal “end users” can show our respect and gratitude to the likes of Dominic and his coders?

Small donations via PayPal, don’t know if it’s been suggested before so don’t shoot me, I for one am extremely happy with the support from the people on this forum.

Just an idea

Thanks Dominic and the other code contributors and for keeping this new addiction of mine friendly

(Ha just found the paypal donations in the gui.... Doh talk about wood for trees or sumit)

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

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by dominicclifton »

stevef1966 wrote:(Ha just found the paypal donations in the gui.... Doh talk about wood for trees or sumit)


Much appreciated, thanks for that!

Working on this stuff requires considerable amount of time, and to make sure it works on all the different hardware you guys have it means I also have to have similar hardware. If people have unused old kit they can send me or can make donations that I can put towards buying kit for tested that would be awesome.

Currently on my wanted list is a Spektrum DSM2 transmitter module, a Turnigy 9XR (non-pro) + LiPo, an FrSky DJT, an FrSKY Telemetry display and a Taranis TX. - My last 9XR was stolen but i replaced it with a 9XR Pro + XJT but it turns out there are sufficient differences in telemetry between the them all. :(

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

Re: Cleanflight aka Multiwii port to STM32 F10x and F30x

Post by XeCutor »

Hi and thanks for the good work on cleanflight

I've spent an evening trying to set up soft serial to do what I want, connect several serial devices with so far, no success at all. I've read all the documentation I'm able to find.

This is what I'm trying to achieve:
- Run a minimosd/kvosd on the standard serial headers
- Have a bluetooth module for configuration on some soft serial port
- In extremely rare cases, so optional, be able to hook up to the USB port and run cleanflight config from there
- In the coming weeks, most likely I want to connect a GPS unit together with OSD + BT.

I've got a bluetooth module set to baud rate 115200 which works fine when connected to the serial pins, but ofc not togheter with the OSD which also runs at 115200. I've go another bluetooth module with baud rate 9600 that I'm trying to get to work over soft serial, no luck so far.
Edit:
I'm running the latest hw revision full Naze32 with a LemonRX PPM receiver so no serial receiver is going to take up a port and my RC pins are all free except for the first one used by the PPM-wire.

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?
Last edited by XeCutor on Tue Sep 23, 2014 4:33 pm, 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 »

Issue report:
Using the latest configurator and FW, I do get steps per channel in the configurator, but what's highlighted as current TX output and what's actually output doesn't really match. Example, on aux1 which is currently a 2 pos switch on my DX18 it says that for one endpoint that "two bands" in the middle are active at that endpoint by highlighting in orange. Checking the tickbox in those bands doesn't activate for example the beeper like expected, but it does work if I select the extreme values and the center values. I haven't actually tested hooking anything up to a slider or knob so I can test if there are 6 distinctive modes available.

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:Issue report:
Using the latest configurator and FW, I do get steps per channel in the configurator, but what's highlighted as current TX output and what's actually output doesn't really match. Example, on aux1 which is currently a 2 pos switch on my DX18 it says that for one endpoint that "two bands" in the middle are active at that endpoint by highlighting in orange. Checking the tickbox in those bands doesn't activate for example the beeper like expected, but it does work if I select the extreme values and the center values. I haven't actually tested hooking anything up to a slider or knob so I can test if there are 6 distinctive modes available.


Certainly with my FrSky gear that gives me ~1000 when low and ~1500 when middle and ~2000 when high the correct bands (LL,M,HH) were selected, I ran out of time to test the code for the two new bands (L,H), i will be using a rotary dial to check it ASAP.

can you give me the min/max values that the your rx gives you when toggling your switches - check the receiver tab to get the values.

have you tried adjusting the 'endpoints' on your tx, i don't have any spektrum gear here to test with so can't tell you how, but on some radios you can change the range from +/-100% to +/-125%.

I'll be doing a bit more testing with this new code later this week, i picked 5 positions because the usual range of 1000 to 2000 divides nicely into 5 equal bands with a center.

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 »

I can't hit the extreme ranges on my DX9 with the sticks using Spektrum sat on UART2 on Flip32+, running out of adjustment at the +/- 125 values in the Spektrum TX. However, I don't remember having a problem on the switches (although I think I tuned them down to the same 1050 - 1500 - 1950 range as the sticks). I too suspect either the ranges aren't adjusted correctly in the TX, or the TX center points, or both. However, the DX18 is a different beast so maybe something else is going on.

If the ranges and centers are correct, what is the setup ? What FC HW ? Are you running discrete PWM ? A PWM multiplexer ? A Spektrum satellite ? (Your softserial question omitted all this required info, which I probably why it was skipped over).

-=dave
Last edited by tungsten2k on Tue Sep 23, 2014 4:10 pm, edited 1 time in total.

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.

-=dave

Post Reply