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

Tuesday,April 23, 2024, 14:46:21

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,426
  • Total Topics: 20,261
  • Online today: 36
  • Online ever: 530
  • (Tuesday,June 26, 2012, 08:34:46 )
Users Online
Users: 0
Guests: 18
Total: 18

Theme Changer





3d - Printworx

Auto Tune No Worky?

Started by Hands0n, Saturday,December 28, 2013, 19:33:05

Previous topic - Next topic

Hands0n

I updated my Arducopter APM 2.5 to 3.1 software recently and today, as the clouds parted to reveal blue skies and near-still air, I went out to the big field to try the Auto Tune that I have been waiting for so long. 

Either it has not worked (for reasons as yet unknown) or I have my APM 2.5 dialed in perfectly!  Unlikely the latter. Hmmm  :hmm:

I followed the guide on the Arducopter wiki here: http://copter.ardupilot.com/wiki/autotune/

Having lifted off, climbed to about 3 metres, I hit up Alt Hold and the quad locked in perfectly. I flew it around a bit and then brought it back local to me and then hit the switch to enable Auto Tune.  Instantly the quad started its Auto Tune dance, first roll adjustments and then when that had finished it did the pitch adjustments. The whole process took approximately three minutes.  During that time I had to manually intervene to reposition the quad as the gentle breeze was taking it places I didn';t want it to go.

After the three minutes the quad stabilised and maintained altitude. It did no more, I waited another short while before bringing it back in for a landing - all the while with Alt Hold and Auto Tune switched on (as per the Wiki).

I landed and disarmed.  Then returned the switches back to their normal positions (Auto Tune = off, 3-position switch back to Stabilise).  I then took off and flew around a bit, tried Stabilise, Alt Hold and Loiter. I couldn';t see any difference but left it at that.

Returning home I took a copy of the PIDs and was shocked to see that they were identical to what they were before I went out. They had not changed at all, none of them!

Does anyone have any thoughts or ideas as to why this happened?

I';m hoping to get out tomorrow very early if the weather holds, I';ve got one shot at this before the New Year. I';ll take the laptop GCS with me too.

Before Auto Tune:
[attach=1]

After Auto Tune:
[attach=2]

http://youtu.be/js2GzeRysAc
--
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

If the values haven';t changed, then it probably didn';t complete - the log would be useful.

HowDoIfly

Sounds like it all completed as expected and if you';re adamant you disarmed with auto-tune still turned on (high PWM) then it';s been saved.

It is unusual that no pids have changed, however, there';s no harm in repeating the process to your hearts content if you want to be sure.
Ifly4 no more, Hubsan X4, R550v2, X650F-V4

Hands0n

@Rickp - attached are all of the logs for today - I cannot be sure which one it is. After the Auto Tune I did several land/disarm and one battery swap. Maybe you can glean what happened. 

What am I looking for in the Log? I checked the MODE and can see that it has recorded I went into Alt Hold but not into Auto Tune (although it was very obvious by the quad';s behavior that I had in fact gone into Auto Tune).  Is that not logged?

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

Quote from: Hands0n on Saturday,December 28, 2013, 20:24:30
@Rickp - attached are all of the logs for today - I cannot be sure which one it is. After the Auto Tune I did several land/disarm and one battery swap. Maybe you can glean what happened. 

What am I looking for in the Log? I checked the MODE and can see that it has recorded I went into Alt Hold but not into Auto Tune (although it was very obvious by the quad';s behavior that I had in fact gone into Auto Tune).  Is that not logged?

You';re looking for the start/stop events. THey are numbered as below in 3.1:



Event valueMeaning
30AUTOTUNE_INITIALISED
31AUTOTUNE_OFF
32AUTOTUNE_RESTART
33AUTOTUNE_COMPLETE
34AUTOTUNE_ABANDONED
35AUTOTUNE_REACHED_LIMIT
36AUTOTUNE_TESTING
37AUTOTUNE_SAVEDGAINS

I can see you initialised AUTOTUNE in two of the logs and there are plenty of ATDE (autotune detail log messages) logged. However, in the first log these are followed by an AUTOTUNE_OFF, and in the second log they';re followed by an AUTOTUNE_REACHED_LIMIT and a bit later the autotune is abandoned.

You may want to ping Leonard and see if he can help you with the 2013-12-28 13-40.log as I can see the numbers are shooting up, but I';ve not yet read enough of the code to know what they mean and what the cause is:

ATDE, 17.18, 9425.094
ATDE, 18.15, 9690.336
ATDE, 19.13, 9790.945
ATDE, 20.10, 9757.409
ATUN, 1, 1, 9757.409, 9790.945, 0.014999, 0.006500, 4.400000
EV, 34
EV, 31

Rick

Hands0n

@rickp - thank you for looking at these.  One of the logs that show Auto Tune being switched on and off several times was me testing the function on the workbench at home before going out. I was running just the FC from the USB for power (no main LiPo), armed the APM 2.5, moved throttle to mid point, switched Alt Hold and then Auto Tune as if I were in the field.

The later log is the one of my activity in the field is most likely 13-40 then, as it has the actual in-flight events and it makes sense that it ended naturally - as that is the only time I have ever flown Auto Tune.

How do I get in touch with Leonard? Will that be on the APM Forum or DIY Drones?
--
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

Can you tell us more about the frame - maybe a picture of the mounting of the APM, as the normal issue is that the APM is too softly mounted...

Hands0n

The frame is a DJI 450 clone - a Firefly 450. 
The APM is mounted on two layers of Moongel at each of the four corners, held down with a rubber band that applies light pressure on the Moongel.  The props and hubs are balanced - the motors (SunnySky) are also factory balanced.

Piccies attached

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

#8
The only real difference to mine is that I strap mine down with a velcro strap against the moongel.

I';ve done so more code reading. Looks like your ROLL axis works, and gets to the value 0.049999 for ROLL_P. Its in the PITCH axis that its failing, the P & D values iterate smaller and smaller until it gets to 0.014999 and 0.006500. It fails because the next iteration tries to reduce D to less than the 0.004 minimum. I think.

It may be worth trying again and seeing if it just works this time...

Hands0n

Thanks rickp - I really appreciate your help.  :beer2:  I';ll take the GCS out with me on the next run also. At least I';ll know to try again a few times until it takes ::)

It was just a single shot that I gave it in the absence of any information to suggest that it had failed.

I will report on here the result of that.  Here';s hoping the weather holds for tomorrow morning then  ~~

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

To be honest, I';m not that familiar with the Autotune code - this is the first time I';ve read it. I know Leonard was keen to get logs where there';s a failure - I';ll see if he';s still interested.
It may be worth just trying the roll values on pitch and see how it flies. The ones from your log are: 0.049999 (for P and I), 0.004 for D and 4.40 for STAB. Those are pretty close to mine (4S, 1000KV and flies like a scolded cat ;)

Hands0n

@rickp - well thank you so much for looking. And I';m happy to do any tests if it';ll help the dev team fathom out any bugs in the code.

Earlier in the year I launched a rather long thread that ended up in me doing a lot of work on anti-vibration and the IMU logs of the day produced the chart in this posting http://www.multi-rotor.co.uk/index.php?topic=4006.msg33450#msg33450 

I don';t expect them to have changed as there have been no changes to the aircraft chassis, the load it carries, props/sizes/types/weight etc. 

Thanks re the values - I';ll take them along with me. If I can';t get it to pass Auto Tune I';ll patch them in manually and see what that does for me ::)  ~~
--
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

Hands0n

Success!  ~~ :cool:

I went out again this morning at 08:30hrs, the air was crisp and cold, frost everywhere. It was blithering cold I tell ya.

This time I took out my laptop GCS so I could see the result of the next attempt - the only real way of doing so out in the field as the APM does not give any clue without.

Same as before, I put it up to about 10 meters from the ground and hit Alt Hold and then positioned it where I wanted it to be.  Then I hit up Auto Tune and it began its dance, first Roll and then Pitch.  Pitch seemed to take a fair bit longer, I';d say about 50% more.  The air was nice and still so only a few manual repositions were required.  And, rewardingly, at the end of about four or  five minutes it stopped and the GCS reported "Auto Tune Success". 

The resulting parameters are below. They are quite different.

So how does it fly now?  I like it - it is quite crisp, very responsive and blisteringly fast (I tried a couple of high-speed passes at full throttle). Acceleration is very brisk, perhaps a bit harsh even - all that I read most folk seem to de-tune the PID a little to soften the edge a bit.  I';m likely to leave things as they are, however.

A special mention to @rickp for the help last night, trying to understand what may have gone wrong. I';m none the wiser but at least its a Job Done. 

Included in this post are the logs for today - there are a few as I did arm and fly two batteries, it is the first log that is the one that contains the Auto Tune episode.  But for the life of me I cannot figure out how to tell the order of the logs other than the order they come off the APM which I';m presuming is the order of flight!  The logic eludes me right now  ::)

Before Auto Tune
[attach=1]

After Auto Tune
[attach=2]

Log file(s) attached
--
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