Welcome to Multi-Rotor UK. Please login or sign up.

Tuesday,August 20, 2019, 09:16:44

Login with username, password and session length

Shoutbox

Andy7:
19 Aug 2019 09:14:20
Good for you!  ~~
DarkButterfly:
18 Aug 2019 19:13:57
Had another negative encounter, it's been a few years since the last one, just an uneducated ******, going on about drones being illegal yada yada yada.    :-/
Still that didn't spoil my flying time, had an absolute blast  ~~
Gaza07:
07 Aug 2019 19:52:01
ooooh mrs jones  :D
hoverfly:
30 Jul 2019 15:26:34
D.B. you tightwad.. :cool:
atomiclama:
29 Jul 2019 20:14:10
DB that just means you have shed loads of props in the first place ;-)
DarkButterfly:
29 Jul 2019 18:53:33
Just had a thought, even with all the crashing I've done, I haven't bought any replacement props in over a year ~~
ched:
09 Jul 2019 19:45:42
May the sun shine and winds be light for BFU#8. Son't forget lots of vids for those of us unable to attend.  :D
Gaza07:
09 Jul 2019 18:10:30
Hope you all have a great day  :beer2:
Andy7:
09 Jul 2019 14:05:28
BFU#8 details locked in for this saturday - see the head of the forum thread for all details.
hoverfly:
05 Jul 2019 21:51:05
Good for genital warts as well......or so I'm told.. :hmm
Members
  • Total Members: 8066
  • Latest: badger1
Stats
  • Total Posts: 196558
  • Total Topics: 19801
  • Online Today: 39
  • Online Ever: 530
  • (Tuesday,June 26, 2012, 08:34:46 )
Users Online
Users: 0
Guests: 27
Total: 27

Theme Changer





3d - Printworx

Printing 3d Forum

Autotune in 3.1.0rc2

Started by rickp, Sunday,October 06, 2013, 12:25:58

Previous topic - Next topic

rickp

Tested the new ';autotune'; code this morning to see how it works. Quite nice - you trigger it with the aux switch, and it sets off doing roll first, then pitch. You can interrupt at anypoint to fly back to the centre, but best to try with as little wind as possible. Once its done, you can fly around with the new PID values to test it. If you';re happy, you land with and disarm to save them. If you don';t like them, you turn off autotune mode with the aux switch.

So, I tried it on my quad, and it got very close to the values I';d manually tuned to. First column are my tuning, second is the ';autotune'; value:

RATE_PIT_P             0.0600       0.0450
RATE_PIT_I             0.1000       0.0450
RATE_PIT_D             0.0040       0.0035

RATE_RLL_P             0.0600       0.0500
RATE_RLL_I             0.1000       0.0500
RATE_RLL_D             0.0040       0.0020

It flies pretty well with the autotune pids. I wouldn';t say it was better - its just as good. Which is quite pleasing in 2 ways - firstly, my tuning wasn';t a mile off. But more importantly, the autotune is pretty good. You will note that it separates pitch and roll, which I';ve never bothered doing before.

Hope thats of interest :)

Hands0n

Hey Rick, this is exciting stuff. Thanks for sharing. I';m sure that a lot of us will love the feature, if for no other reason than to get close to optimum, even if we later then go on to tweak the auto-tune settings manually.

I';m waiting eagerly to get my hands on 3.1.0 when it arrives with this feature.

In terms of where to perform the auto-tune, where is good?  Non-windy days can be rare for some people. Is it a case of doing it inside a building in such cases, perhaps a garage or large room?
--
Danny
"Its better than bad, its good"

Current FCs: Pixhawk, APM 2.6, Naza M V2, Naze32, Flip32+ CC3D, KK2.1.5
Aircraft: miniMax Hex, DJI 550 (clone) TBS Disco, 450 Firefly, 250 Pro, ZMR250, Hubsan X4, Bixler 2

rickp

In terms of space, I used a sheltered field and had to reposition a few times. You can reposition during the test, but it then takes longer of course. For me it took 5 minutes, with 2 or 3 re-positions as it started to drift to close to the trees on one side.

Marty McFly

Thanks Rick,its now come to a new level,brilliant,Marty, :scotland:

titeuf007


optiplex

hey rick, thx for this exciting news
i didnt get how to set it to work, what channel ? how to activate it on the tx ?
and once its working do i just leave it to do roll and pitch ? no input from my tx ? how do i know that it ended and i can test fly it ?

rickp

Quote from: optiplex on Monday,October 07, 2013, 05:58:45
hey rick, thx for this exciting news
i didnt get how to set it to work, what channel ? how to activate it on the tx ?
and once its working do i just leave it to do roll and pitch ? no input from my tx ? how do i know that it ended and i can test fly it ?


I set channel 8 to ';autotune'; - its just like any aux switch function. Low is off, mid is ';suspend'; though you don';t need to suspend to reposition and high is ';on';. I didn';t use ';suspend'; - all I did was use the sticks to move it back to a central point, then let go - and 1 second later it continues with its testing from where it was.

Start in alt-hold, then trigger it - and it automatically does the pitch/roll inputs - you don';t need to do anything. Once its finished, its just in alt-hold, drifting with wind. You can tell its stopped, believe me ;)

optiplex

ok, but how do i set some channel to auto tune ? in mission planner ?

rickp

I did it manually by setting CH8_OPT to 17, but I think thats just the same as doing it in mission planner.

optiplex

Quote from: rickp on Monday,October 07, 2013, 07:49:50
I did it manually by setting CH8_OPT to 17, but I think thats just the same as doing it in mission planner.


it can be done in mp, but what does 17 means ? auto tune ? its just not documented yet in mp ? cause theres no 17 in the options field

optiplex

and another question, ch8 is the input on the apm right ? need to connect channel from my rx to ch8 on the apm and thats how i trigger it ?

optiplex

ok found it
so ch8 is now controlled from aux2 switch on my tx, set to trigger ch8_opt when its above 1800 pwm to value 17

now need to wait for no wind to test out side

thx rick :)

optiplex

Morning, im outside now trying trigger the autotune, but nothing happens, I switch ch8 up and I see the pwm goes above 1800 and on mission planner ch8_opt the value is 17, but I dont see the quad doing the auto tune.... Any idea why?

Sent from my C6603 using Tapatalk 4 Beta


rickp

Quote from: optiplex on Tuesday,October 08, 2013, 09:36:53
Morning, im outside now trying trigger the autotune, but nothing happens, I switch ch8 up and I see the pwm goes above 1800 and on mission planner ch8_opt the value is 17, but I dont see the quad doing the auto tune.... Any idea why?


I don';t know if its in the image you can download. I had to turn off the MOUNT code to get it small enough to fit into the APM (we';re really really tight on space now). If you want, I can build an image for you - quad right?

optiplex

Yeah quad, simple 500 V shape, maybe itll work on latest rc2? Cause I didnt update again since the rc2 came out

Sent from my C6603 using Tapatalk 4 Beta


rickp

Here';s the firmware for a quad, based on 39bfd809c251c, with the camera mount disabled, and autotune enabled.

   https://dl.dropboxusercontent.com/u/8684464/ArduCopter-quad-3.1.0-rc2-autotune.hex

Be careful with it on the first flight in case I';ve screwed up something! Flies ok on my quad though...

optiplex

Quote from: rickp on Tuesday,October 08, 2013, 10:02:00
Here';s the firmware for a quad, based on 39bfd809c251c, with the camera mount disabled, and autotune enabled.

   https://dl.dropboxusercontent.com/u/8684464/ArduCopter-quad-3.1.0-rc2-autotune.hex

Be careful with it on the first flight in case I';ve screwed up something! Flies ok on my quad though...


ok thx rick, will try it
the feature is built in this image now, but still need to enable it with 17 for ch8 in mission planner right ?

rickp

Quote from: optiplex on Tuesday,October 08, 2013, 14:08:08
ok thx rick, will try it
the feature is built in this image now, but still need to enable it with 17 for ch8 in mission planner right ?


Yes.

optiplex

ok, i tested the latest rc2 from the download site, they dont have the autotune feature inside, yours has it ofcorse as u built it :)
still dont have a decent day outside without wind but i just gave it a guick test to see if flipping the switch works and it does
the quad starts to roll to the side, and there i stopped it cause no room in the under ground parking
will wait for windless day to test it outside

thx rick

rickp

Wednesday,October 09, 2013, 07:55:53 #19 Last Edit: Wednesday,October 09, 2013, 08:11:09 by rickp
Here';s an -rc3 image with autotune:

  https://dl.dropboxusercontent.com/u/8684464/ArduCopter-quad-3.1.0-rc3-autotune.hex

Warning - I';ve not had a chance to test fly this build yet, so extreme caution!!!

Quote
Improvements over 3.1-rc2
1) GPS Glitch protection - gps positions are compared with the previous gps position.  Position accepted if within 10m or copter could have reached the position with max accel of 10m/s/s.
2) Bug fix for pixhawk SPI bus contention that could lead to corrupted accelerometer values on pixhawk resolved
3) Auto Tuning (compile time option only add "#define AUTOTUNE ENABLED" to APM_Config.h and set CH7_Opt or CH8_Opt parameter to 17)
4) CPU Performance improvement when reading from MPU6k for APM
5) SUPER_SIMPLE parameter changed to a bit map to allow some flight modes to use super simpler while others use regular simple (MP release to allow easier selection will go out with AC3.1 official release)
6) Safety changes:
    a) safety button must be pushed before arming on pixhawk
    b) RGB LED (aka toshiba led) changed so that disarmed flashes, armed is either blue (if no gps lock) or green (if gps lock)
    c) sensor health bitmask sent to groundstations

optiplex

this rc3 u built yourself without mount and autotune ? or autotune is already on the download page images ?

rickp

Right, my builds have mount disabled and autotune enabled (hence -autotune). I think the nightly builds will not have autotune yet.

rickp

Thursday,October 10, 2013, 16:12:44 #22 Last Edit: Thursday,October 10, 2013, 16:18:46 by rickp
Just one more thing to add - it tunes STB_P too. So again, first value is what I had (default) and second value was the autotuned version:


STB_PIT_P        4.500000     5.812500
STB_RLL_P        4.500000     5.812500

optiplex

so rick, how do u find the autotune so far ? any difference in flight after  ?

i installed rc4 yesterday, quad is still flying great


rickp

Monday,October 14, 2013, 08:30:40 #24 Last Edit: Monday,October 14, 2013, 09:27:13 by rickp
Not really had a chance to fly it much. The auto-tuned results were pretty close to what I had before - and seemed fine to fly with. Probably great for novices who don';t want the hassle of tuning things - but main win is the time saving if you';ve been tuning without telemetry...

Not build an rc4 yet - will do that soon. Is autotune in by default now?

Edit: Yes, Autotune is enabled by default in rc4.

optiplex

Quote from: rickp on Monday,October 14, 2013, 08:30:40
Edit: Yes, Autotune is enabled by default in rc4.


ok great good to know they enabled it now
i didnt test it yet
still need to finish a complete auto tune cycle, need to do it with fpv cause it takes fes minutes and it drifts far away
can i bring it back to me while its doing the autotune and it keeps working or i must not touch the sticks ?


rickp

You can reposition at any time - it immediately stops tuning, goes back to the original PIDS whilst you move. When you let go of the sticks, it restarts the tuning.

optiplex

when i re-position, it restarts from the begining ? or continues from where it stopped ?

rickp

From where it stopped...