3D Robotics

ArduCopter 2.3 released

Jason is travelling this week, so I'll take the helm for the next software release post. 

UPDATE: the motor remapping thing was confusing everyone, so we took that out and returned to the regular motor mapping. That means that APM 2 users with Hexas and Octos should wait for the next version. APM 1 users should be fine with any frame.  

NOTE: Hexa and Octo users: there have been motor mapping changes that may affect you. Please don't upgrade until we can update the documentation to reflect the changes. This should happen by the end of the day today (Feb 1).

ArduCopter 2.3 is now available in the Mission Planner.  This is the next revision of the ArduCopter 2.2B6 code, which is perhaps the most tested code we've ever released (1288 comments in the thread!)  and certainly in my experience the best code, too. 

The default PIDs are optimized for a 3DR/Jdrones quad with 850 motors and 10" props. If you're using more powerful motors/props, start by turning down Rate Roll P (default is 0.14, so start by turning it down to 0.1. In general tune PIDs in 25% steps).

Now that we've got solid code out there, we can turn to collecting suggested gains for standard frames, and a better guide to how to tune PIDs for your unique setups. 

Here are Jason's note on the latest changes (mostly from 2.2B6)

A dampening term called STAB_D has been refined. A D term for all of the Rate based control loops has been added based on Igor's work. Landing for Baro and Sonar has been refined based on JLN's work. A slightly new approach to Loiter and Navigation is being used to try and linearize the pitch and roll for rate control. It tends to use lower gains, yet has a more assertive response in the air.

STAB_D : This is the gyro accretion dampener. This can remove small wobbles during sharp changes in angle commands. Making this too high can have a negative effect in performance and add a memory effect that can cause temporary loss in control. The in flight tuning is ranged so you are just below that effect.

If you haven't noticed before the control loops are in two stages. The first is a PI stage that converts some sort of position or angle error into a desired rate. These generally do not need to be tuned. They are more of a user preference on how fast you want the copter to perform a motion. 

The second stage is the actual PID loop that needs to be tuned for the copter. This converts the desired rate into a motor command of some sort. I added a D term based on Igor's recommendation to the PI's for each rate controller. These should show up soon in the mission planner for the release. I cannot give you a concrete answer for how to tune the D terms, because they each depend on their function such as alt hold or loiter, etc.

Still, the absolute most important term is always the Rate_P term for each loop. Start tuning here.

The default PIDs are in the what flies great for a stock jDrones/3DR Quad with the purple motors in X mode.

Note the Mission Planner does not yet highlight these D terms on the main tuning page (it will soon), but you can find them and modify them on in the Parameters list.

Autolanding should now work well (see video above) and the Tri servo issue is now resolved. 

The code should now compile with Arduino 1.0 (thank, Randy!), but remember that you need to use the "relaxpatch" version of Arduino in our downloads section

[Update: we've reverted the below. See update at the top of the post]

Important for Octo users:


We've changed some of the motor orders for some more exotic airframes. We'll be updating the docs on the Wiki in a day or two to reflect this. Pat Hickey explains:

As before, the hexa plus APM2 motor setup has changed from the ordering [1, 2, 3, 4, 5, 6] to [ 5, 6, 1, 2, 3, 4 ].

The Octa V layout for APM2 is:
6            4
  2        5
    8    1
      3 7
Motors 1 through 4 spin clockwise, and 5 through 8 spin counterclockwise.
Support for roll/tilt camera control on APM 2 should be coming in the next version. Traditional Heli will also be updating to this latest code as well once we track down a memory issue. 
As always, you can see a complete list of changes in the changelogs.

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • Comparing stock params with maxed out PIDT1 tuned params.


    For info the 'tuned' params found below are reluctant to play ball on anything other than a very well balanced, vibration free airframe, or one with a very good APM mount. Vibration seems to be a factor in causing 'the twitches', especially with some Rate_D dialed in. I have improved mine dramatically with my new mount (see earlier) and checking the quad over for any imperfection/imbalance. This has helped me, at least a bit,  to increase Rate_P and Stab_P dramatically with the Rate_D term without the oscillations I would have experienced if using Stab_D instead at these higher levels of P.

     

    The two flights in the video are set up on a stock arduquad frame, +mode, jdrone escs 20a and 850kv motors, 10*4.5 props, sanded and balanced (they are cheap though, saving the good ones for the field ;) lots of balancing and vibration damping.

     

    Arducopter v2.3 Stock params vs PIDT1 style tuning from Kamakaze UK on Vimeo.

     

    Flight One – easy to fly indoors, very smooth, gentle reactions. Stock parameters that come with MP version of 2.3. All I have changed to suit my frame is;

    Stab_***_P to 4.2 from 4.5

    Rate_***_P to 0.13 from 0.14. This is the point where I lose all oscillations.

    Stab_D set as default 0.12

    Results: Quad flies really very well – perfect for AP, FPV and just general smooth flying. It seems to me all that anyone would need to do to for a pleasant stable flight with this would be to dial your rate_***_P and stab_***_P in for your frame. I think most of us are really really happy with this release – GREAT STUFF!

    Flight Two Default params then...  PIDT1 style tuning.

    Stab_D set to zero.

    Rate_D at 0.012 (start at 0.004 then work up till you see tiny oscillations at half throttle when tipping it over in your hand.

    Stab_P to 7.5, (i could go higher but it becomes too aggressive for my liking – stable but aggressive, i did try 12, but think I need a field...

    Rate_P to 0.23 (as high as i can go before oscillations set in (slow over-corrections to stick input is actually a more accurate description) in real life I’d probably come down a bit, but this is a test...

    Rate_I of anywhere between 0.08 and 0.120, as long as it’s between 25 – 50% of rate_P it seems to make little difference. Outside this range i have noticed sluggishness.

    Results: Still very easy to fly indoor but reacts much more quickly to stick input, external reactions (pushing it with your finger – and I’m hoping wind) and return to level much quicker when you release the sticks. (I’ve had to put a bit of expo on my Tx for the first time on this quad, I’ll be reversing that out in the field though ;)). In the vid I try to push it a bit, but with the tuning it’s quicker than I am in this small space, hence a little blanket tapping with the props at the end (good prop saving tip – blankets everywhere.)  But I think you can see how ninja-like it is. I’m hoping this speed of reaction and stubbornness to stay completely level at mid stick will make my loiter and nav set up a whole lot more straight forward.

    It will probably knock it all to cock ;)

    Something for your bedtime, if it is your bed time, this is one beautiful video, not mine unfortunately. 

    http://vimeo.com/29099102

    This sort of caper is why I’m interested in fpv and autonomy and a super stable, reactive platform all rolled into one. I have a very specific purpose in mind for this platform which can involve going quickly through trees all fpv. I need the precision aspect of the tuning described above (or similar) to give me the quick responses needed. Then provided I make it to the other side I can use autonomy to do panoramic shots of the area or track back up the recorded path to demonstrate the route from above the tree tops and then of course to get my baby home.

  • I can hardly wait to get my APM2 so I can get started. Great job team!

  • Moderator

    I'm off to the Kalahari Desert on the border between South Africa and Botswana tomorrow, taking the quad with too. Did a quick test today with my FPV setup, quality's not very good as it's recorded with the laptop via an analog usb video card but you'll get the idea. This was before some tuning as it's much smoother now but it's dark out. The OSD values are way off too, they need to be reset.

    Hopefully v2.4 or v3 will be out when I get back and it'll be "issue-less", cheers

    https://www.youtube.com/watch?v=J08tCz-EqYQ

  • Moderator

    The twitches I'm seeing are there with all D values at zero, the twitches have been there since B2 when I started testing. It's not a wobble or oscillation, it's a twitch, a single random twitch as if one or more motors gets no signal for a fraction of a second, in fact you can hear the motor pitch change for that fraction a of second. But maybe it's my ESC's if no-one else is seeing these.

  • I think reading about PID control is driving me mental... this just popped into my head.

    There was a young man from Kings Heath.

    He flew a strange bird from beneath.

    T’was nimble, twas fast,

    To fly t’was a blast,

    Until he tried catch, in his teeth.

    ;)

  • Weird Alt Hold/Loiter behaviour. Have kept Throttle Rate P and Alt Hold P as per Tomas's parameters, but this afternoon I found that Alt Hold and Loiter became incredibly sensitive to throttle/climbing/descending. I have always been pretty careful to make sure that the quad was static in all directions before invoking Alt Hold or Loiter, but this afternoon I had to be incredibly precise, otherwise if the quad was moving vertically at all, then it kept on going. Not sure what I am doing wrong or what if anything has changed - all I want it to do is to stay at an altitude. In fact, I find the ability to change altitude in either Alt Hold or Loiter a pain, as when I am doing camera work, it is all too easy to nudge the throttle without noticing. Is there anyway of either setting a parameter, or commenting out some code to disable the altitude change functionality? In Config.h - what does this do?:

    #define AUTO_THROTTLE_HOLD 1

    Any advice much appreciated, thanks, Bill

  • 2.3. (version now live in MP with wobbles ‘disabled’) Rate_D tuned - test results

    Success in stab mode with the two lines commented out. No wobbles on take-off and I can now do dead-drops again. No problems at all found as yet.

    I also tested acro mode to see if I could replicate Marco’s acro accident in the hand. It seemed to behave itself, tipping left/right/fore and aft smoothly to stick input. I wouldn’t dare fly it in acro mode though, rate’s WAY to slow to have any decent control, despite cranking rate_p till just below oscillation point.

    In other news...please excuse the delay in reporting, as I started to test I noticed a few issues with the quad – it wasn’t flying right. AND I HAVE THE DREADED TWITCHES IN FLIGHT – OH NO! Last night’s testing I believe – I’d had a glass of wine or two... and yes I had full armour on ;)

    But thankfully these issues I noticed have taught me some valuable lessons. All related to the mystical RATE_D.

    1. I noticed a rumbling bearing in one of my motors, some contamination issue I think.  I swapped this out, control improved enormously, twitches reduced. (Twitches would disappear if rate_d was set to zero. This rate_d is one sensitive puppy!)
    2. I noticed 2 very slightly chipped props, twitches disappeared if I set rate_D to zero. They also subsided significantly when I swapped for new, carefully balanced props (the scotch tape method) and rate_d dialled back in.
    3. One very slightly twisted motor = regular twitches in the air, and the inability to yaw very well in one direction. Again the twitches disappear when rate-D is set to zero. And with the other fixes I've eliminated the twitching due to rate_d altogether, (at my usual rate_d of .012)

    In fixing these issues my quad was also noticeably quieter under throttle, very few vibes from frame (finger touch test) and almost no vibes on the apm.

    What’s more it is now flying better than ever, and I’ve dialled rate_D right up to 0.02, no oscillations although it’s far too edgy for me so i settled back to 0.012 YIPPEE!

    These findings do suggest that currently rate_D is not for the faint-hearted, it has taken me a while to get the quad tuned again, one prang and I’ll have to go over it with a fine toothed comb – or of course if I’m in a hurry just go back to stock params that don’t seem to care that much about the odd vibration.

    Hope that helps :)

    TIP:  (I’m sure most of you know this, but) before you fly look at each prop from above, and each motor from the side. Spin in with your finger. Does the prop track ok? Is it running in a flat plane with the others? The very centre of the prop shaft should not ‘swirl’ it should spin exactly about its axis, right in the centre. Even well balanced props and motors will be all over the place if you are not very careful when mounting props.

    SO...Rate_D appears very sensitive to vibrations. Just a chip out of your prop, or a very slight twist somewhere will cause this common rate_D problem. I wonder if that’s why it’s so hard to get it right on the big birds, there’s a lot more going on to be dampened on a big octo than my little quad.

  • Moderator

    @ Dave C: I do get the wobbles if Rate_D is 0.008 but not if it's 0.003. Can't feel much difference in flight behaviour between the two.

  • Developer

    Important, at the moment do not try to engage RTL at very low altitude (or just disable the Autoland), as a friend has already happened (i'm sorry) that could happen:

  • Guys, anyone tried loiter/rtl/auto with 2.3 yet? Any advice on tuning?

This reply was deleted.

Activity