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

Sunday,August 18, 2019, 15:54:22

Login with username, password and session length

Shoutbox

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
DarkButterfly:
05 Jul 2019 21:48:24
Just fixed a busted SMA connector on my TBS unity pigtail, it suffered badly in a recent crash and split in two, nothing a touch of the soldering iron couldn't fix  :D
DarkButterfly:
05 Jul 2019 19:44:08
 :D
Members
Stats
  • Total Posts: 196548
  • Total Topics: 19799
  • Online Today: 48
  • Online Ever: 530
  • (Tuesday,June 26, 2012, 08:34:46 )
Users Online
Users: 2
Guests: 46
Total: 48

Theme Changer





3d - Printworx

Printing 3d Forum

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

Sunday,August 18, 2013, 16:08:13 #8 Last Edit: Sunday,August 18, 2013, 16:21:42 by barneyg
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!