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

Thursday,April 25, 2024, 21:14:08

Login with username, password and session length

Shoutbox

Gaza07:
23 Apr 2024 08:09:45
The Domain expires for the forum in 60 days, I'm not going to renew it this time unless I see any activity  :beer2:
Gaza07:
20 Apr 2024 18:02:50
Is there anyone who would like to see this forum stay open ? :shrug:
hoverfly:
17 Apr 2024 17:15:13
 :rolleyes:
Bad Raven:
26 Mar 2024 08:41:05
 :(
Andy7:
25 Mar 2024 14:49:21
An excess of work and rain.  :thumbdown:
Bad Raven:
23 Mar 2024 18:12:38
Almost a personal Blog, it would seem. LOTS of members, but NO posts.  :-/   :shrug:
Gaza07:
06 Mar 2024 16:59:49
Anyone still here  :shrug:
ched:
24 Dec 2023 11:48:48
Hope you all have a Great Christmas and a happy New Year.
Bad Raven:
20 Dec 2023 06:17:47
 ~~   :beer2: 
Gaza07:
19 Dec 2023 22:20:27
Merry Christmas All  :beer2:
Members
  • Total Members: 8,195
  • Latest: lokloks
Stats
  • Total Posts: 201,427
  • Total Topics: 20,261
  • Online today: 31
  • Online ever: 530
  • (Tuesday,June 26, 2012, 08:34:46 )
Users Online
Users: 0
Guests: 33
Total: 33

Theme Changer





3d - Printworx

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

#19
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

#22
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

#24
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...