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

Friday,March 29, 2024, 15:02:14

Login with username, password and session length

Shoutbox

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:
Bad Raven:
01 Dec 2023 06:59:57
New Simulator Section started!   :beer2:
Bad Raven:
17 Jun 2023 06:52:23
Yes, smaller, same as lots of things as time passes.
Andy7:
08 Jun 2023 22:49:18
 ~~
Members
Stats
  • Total Posts: 201,420
  • Total Topics: 20,260
  • Online today: 35
  • Online ever: 530
  • (Tuesday,June 26, 2012, 08:34:46 )
Users Online
Users: 0
Guests: 32
Total: 32

Theme Changer





3d - Printworx

PID tuning for alt hold

Started by Tony Campbell, Sunday,August 18, 2013, 09:43:15

Previous topic - Next topic

Tony Campbell

Hey guys, I';ve recently finished converting my IFLY4 frame and motors to an APM 2.5 and simonk esc';s. I have the stabalise PID';s pretty much dialed in as tight as I can get them, but I';m a bit confused with tuning for the altitude holding part of loiter mode. When its in alt hold or loiter mode, the height varies by about 1-2m. The height change is very slow. It';ll initially hold height for about 5-10 seconds when it first goes into loiter, but then it will very very slowly lose height by about a metre then gain that height back, before overshooting by about .5-1metre. Its like its very slowly hunting for its original height. I have to emphasise, this happens over a period of about 20 seconds for a full cycle.
I have the baro covered with foam, and also sprayed the inside of the apm case black, to cut out the light penetration.I also have the hover throttle position set, at a healthy 52%. Also, If I go into forward flight whilst in loiter or alt hold mode, the multi will lose height........ I';m guessing that if the above can be tuned out, the forward flight issue would be fixed too.
Trouble is, even though I';ve read as many tuning guides as I can, I cant get my head round tuning this problem out. Can anyone help with some advice? I dont want to just stab around in the dark.

Tony Campbell

Forgot to add........ vibes are extremely low.......spent a lot of time on that  ;)

Hands0n

I';m just starting down this road with my first APM (well, second really as the first flew away forever!).  During its maiden flight I hit Loiter at low flight level and it landed :-D

Some tuning to be done :-)

Sent from my C6603 using Tapatalk 4

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

Tony Campbell

Did you go from althold to loiter or from stabalise to loiter? Where is your throttle position when holding a stable hover in stabalise mode? Just thinking that your throttle position might be below mid position before hitting althold or loiter.

Hands0n

I went from Stabilise to Alt Hold - and yes, you';re entirely correct, I did have the throttle below mid-point. That is mostly because the instability resulting from the current (default) PID makes the aircraft liable to accelerate sharply [upwards] and having already experienced a total loss through a fly-away I am a bit shy to do that just yet. 

Once I have stable Stabilise  and Acro  ::) I';ll turn my attention back to the various smart mode';s PID.

That';s today';s goal  :smiley:
--
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

Tony Campbell

I reckon that because your quad hovers at below mid point on the throttle, when you switched to althold, its outside of the deadband. If you download the logs, scroll down till you see a ctun entry, then scroll across till you see the part for throttle setting, you';ll find out what the average is for your hover point. Its then a simple matter of inputting that percentage into the software. As far as your quad being very sensitive to throttle on the standard pids......no idea. I haven';t got that far along the learning curve yet  ::)

Hands0n

Right, so a bit more flying just now (3 batteries) and I reckon I';ve a better idea what is going on right now.

The conditions are gusty winds - not as bad as in the maiden flight video - periods of still air sweep by.  Dark clouds closing in so I suppose we';re in for a bit of a storm later.

In Stabilise and Acro modes the quad will climb steadily at half throttle. It has to be one mark below centre throttle to prevent that - but then requires constant adjustment to throttle to stop it descending or climbing.  I probably need to introduce some Expo to the throttle, but can';t find the setting in the Turnigy 9X.

I also tried installing a file from Peter King';s site https://drive.google.com/folderview?id=0B-B7PQy0joGrUjFmb2pSTFlqcWc&usp=sharing#list  I went for the file APM2.5 v3.0p1 new.param   but when I install it I cannot arm the FC - that is despite putting the RC channel extents back to match those of my radio calibration.  I';ve not figured out why that is yet. 

Anyhooooo ... strange jittery behavior persists despite any "intelligent" or Acro mode.  I';ll chronicle this in my other thread on the new quad.  ~~

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

Tony Campbell

I done a similar thing the other day, done recalibration of radio and couldn';t get the quad to arm. Finally decided to redo the esc setup and it all was sorted.

barneyg

#8
Do you have the lpf configured ? ... Vibes can contribute to a "bouncy" throttle.

And do you have stock 9x firmware or one of the alternates ?

rickp

If you load someone else';s param file, don';t you need to do compass calibration etc again before it';ll arm?

Hands0n

@barneyg - The vibes are barely perceptible, which is cool.  What is LPF? I can';t expand the acronym in my head  :confused:

My 9x is stock firmware from Turnigy - I can';t find any setting for Throttle there so guess it doesn';t exist.

@rickp - I didn';t know that. Will be worth a try when the LiPo are charged.

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

barneyg

LPF = Low pass filter

have you graphed your raw data as per the instructions http://www.multi-rotor.co.uk/index.php?topic=1932.0

I know I';m using MultiWii at the moment but I believe there are the same options in ArduCopter for me dropping it to 42Hz made my quad a lot less bouncy.

I';m afraid I don';t know the stock Firmware ... I';ve got a 9xr which comes with an older er9x firmware and the first thing I did was update it :).  My throttle has a nice S curve set up with the centre point @ about 40-45% throttle which is the hover point for my quad.

Since we all know you can';t stop buying new stuff ;) invest in one of these http://www.smartieparts.com/shop/index.php?main_page=product_info&cPath=3&products_id=331 and an AVR programmer and update to er9x or opentx :)

Hands0n

@barneyg - I';d best keep that last post of yours away from the Mrs  :laugh:

I';ve not done anything with the graphing of the logs - will see if I can get my head around this during this evening.

I';ve managed to get the basic PID sorted - the aircraft is as stable as a very stable thing in Stabilise and Acro modes.  Next up will be getting the various auto modes - Loiter is dreadful, sounds like a hive full of angry bees, with it bouncing all over the shop. 

I had to get radical with the PID though - started off at 0.1500 and now got it down to P = 0.0572, I = 0.0256 and D = 0.0040

The light is going so thats my lot for tonight.  Quite a productive day I';d say.
--
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

barneyg

Quote from: Hands0n on Sunday,August 18, 2013, 19:55:37
I had to get radical with the PID though - started off at 0.1500 and now got it down to P = 0.0572, I = 0.0256 and D = 0.0040

Yowch ... that is even lower than what I had on mine when I ran MegaPirateNG ... I was on about 0.07 - 0.08

Hands0n

I';m flying 10x4.5 props with 980KV motors in a 450 Firefly air frame. The standard DJI F450 uses, I believe, 750KV motors so I';m probably chucking out too much thrust, hence the lower value than you had (maybe).  I';m guessing mostly  ::)
--
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

Aye carrumba! This may be worth a quick read if you are flying Arducopter version 3.0.1 http://diydrones.com/forum/topics/arducopter-3-0-1-released

Also the page advises: Try out the new version in stabilize mode first, then alt-hold, then loiter and finally RTL and Auto.

Hmm, some reading to do.

Quote
Warning #1: Compass calibration and reducing interference is far more important than with 2.9.1b
Warning #2: GPS glitches can cause sudden and aggressive position changes while in loiter mode.  You may wish to reduce the Loiter PID P to 0.5 (from 1.0) to reduce aggressiveness (see image below of where this gain can be found in mission planner).
Warning #3: optical flow is not supported but will be back in the next release (AC-3.0.2 or AC-3.1.0).
Warning #4: loiter turns does not maintain altitude.  This bug will be fixed in AC-3.0.2.
Warning #5: This release has only been lightly tested on Traditional Helicopters.


Improvements over 2.9.1b include:

    Inertial Navigation for Loiter and Auto meaning much more accurate control (Randy,Leonard,JonathanC)
    3D navigation controller follows straight lines in all dimensions between waypoints (Leonard,Randy)
             WPNAV_SPEED, WPNAV_SPEED_UP, WPNAV_SPEED_DN, WPNAV_ACCEL allows configuring speeds and acceleration during missions
    "compassmot" to compensate for interference on compass from the pdb, motors, ESCs and battery.  (Randy,JonathanC) (Set-up video here)

Safety improvements:
simple Tin Can shaped Geo Fence
pre-arm checks to ensure all calibration has been performed before arming (can be disabled by setting ARMING_CHECK to zero).  (video description here)
GPS failsafe - switches to LAND if GPS is lost for 5 seconds
stability patch improvements to stop rapid climbs in very overpowered or overtuned copters
Circle mode improvements including "panorama" when CIRCLE_RADIUS set to zero (Randy,Leonard)
SONAR_GAIN parameter added to allow better tuning of sonar surface tracking
CH8 auxiliary switch (same features as CH7)
works on PX4 (some minor features still not available) (Tridge,PatH)
--
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

Tony Campbell

This   http://copter.ardupilot.com/wiki/table-of-contents/  answered a lot of questions for me, i found it invaluable ~~

rickp

Quote from: Hands0n on Sunday,August 18, 2013, 21:32:12 Also the page advises: Try out the new version in stabilize mode first, then alt-hold, then loiter and finally RTL and Auto.

Yes, thats what you should do with any new firmware as each level of autopilot control builds on the last....

Tony Campbell

Another thing which can save a lot of headaches and time, is to always save your params everytime you make some headway in the PID tuning. Its handy to be able to go back a step to a known good PID setup. You can save them with a descriptive name, so that you have some kind of idea what may have been the change that done good......or bad. :cool:

Hands0n

Definitely with you there. I keep paper notes of each change that I make, in tabular format, and then only one single change at a time.  Trying to keep conditions as controlled as possible.  I also take occasional "snapshots" of the config, saving a file away so I can retrieve it - especially if I';m trying out another parameter file such as Peter King';s. 

I';ve got to get the Bluetooth telemetry working somehow - it';ll make this entire process so much easier than having to hook back up to USB each time.

It is the very first maiden flight that is so lacking in such control - and is rooted in my fly away the other week. That and stupidly doing it late at night in the dark! What was I thinking?  :banghead:  :o  :laugh: :laugh: 
--
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

Tony Campbell

Quote from: Hands0n on Monday,August 19, 2013, 11:15:07
What was I thinking?  :banghead:  :o  :laugh: :laugh:

I';ve lost count of the amount of times that m ideas have resulted in me saying that  :wack0

rickp

I';m a command-line kinda guy, and I use tridge';s mavproxy python scripts to change params and save them. Also handy to check that ch6 tuning has the right range for the thing I';m changing!