Developer

Arducopter 2.2 beta

I just pushed Arducopter 2.2 to the Mission planner. This version went through extensive testing by a brave group of flyers and with both HIL and SIL testing.

See this link for more:

http://www.diydrones.com/forum/topics/arducopter-2-1-1-alpha

If you run into any problems please let me know here. If you find a reproducible bug, please add it to the issues list.

tuning tips:

If you run into Loiter issues, try adjusting LOITER_P. It's 2.0 right now which may or may not be to aggressive for your copter. Nav is no longer used in Loiter control, which should make tuning easier.

If you run into a circling issue, try lowering LOITER_I to 0 and see if it goes away. If not, check your compass declination. A negative error will produce CCW rotations, a positive error CW.

If you have issues with alt hold, try lowering your THROTTLE_P, it may be too high for higher thrust copters.

If you have wobbles and can't seem to get rid of them, there is a new term called STAB_D, which is a derivative term used to tune out the wobbles. You can increase it until they stop, but just like driving a cadillac, you loose some performance and handling. In the CLI "tune 16" in setup will let you control this in flight, and "tune" in test menu will let you see the value printed out interactively before flight. See the wiki for more detail.

Many testers gave me a thumbs up on the code, so if you have an issues please post the flash log from the copter. The tLog isn't that much help to me for debugging as it doesn't capture the needed values at high enough rates.

(Remember, if you'd rather pull the code from the repository and load it with Arduino, you must use the "relaxpatch" version of Arduino in our downloads section.)

 

Update 2.2b2

I believe I found the simple mode error. It was a bug that was working OK until Tridge fixed it so it was declared properly. Then the bug became active. I made the Simple mode function internal variables static and this should fix it hopefully.

I updated alt hold to not use dampener for now until we get more testing. Some folks saw a latency induced oscillation which was pumped up by the D term.

I added the automatic throttle cruise or hold value as a compile time option for testers. This basically looks at your throttle and climb rate while in stabilize or acro and determines your optimal hover value. This means you can enter any autopilot mode and not have to worry about your throttle position. It should make alt hold more reliable if it works. This is off by default until we get good field tests back.

Update pushed to GIT.

Update 2.2b3

Just some refinements. I added JLN's throttle curve mod for landing. Hopefully that's correctly implemented. 

Made the landing delay from RTL user settable

removed the ADC gyro filter, I was doing a lot of testing and determined it wasn't worth it.

Enabled the auto-throttle control by default. Please test in the sim

Altitude no longer resets when flying in Loiter mode

Pitch and roll dampening is smoother now. try values up to .08 for very dampened flight.

Mavlink can now trigger auto-land

I'll push a hex when I hear some good news from HIL testers.

Update 2.2b4

Flew today and saw the WP speed governor wasn't quite working right. It was going down to 0 rather than the minimum.
Made internal switch to CM for distance calcs. This should not make any change to gains or MP.
Modified a few default gains for jDrones frame based on AP test flights of this code in some heavy wind on my roof.
Fixed an issue with the landing code not kicking in right away.
Decreased the slowdown near WPs
Added a limit to the amount the pitch compensation can effect the throttle if the throttle input is really high or maximum

 

Update 2.2b6

This is a rollup of all the code that's been flying around for the last week as well as a few bug fixes. I'll be posting it saturday night after reviewing all of my logs.
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.
I have one small loiter control issue to sort out tonight based on my logs, then I'll post to GIT.
Here is the auto-landing code in action. 

OK, 2.2b6 is on GIT. The Mission planner is going to be out of sync until the release code. until then you can use the APM_Config.h or the parameters list in the Mission planner. 

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.

Thanks,

Jason

 

 

 

 

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

Join diydrones

Email me when people reply –

Replies

  • 2.2b2 HIL (aerosim) tested this with traditional heli code. Loiter worked really well, Stabilise was good as usual. Hopefully this will be quite close to the field test.

    Thank's Jason.

  • Developer

    Just got a chance to test 2.2 in the field and had an issue. For some reason I could not arm the copter. I rebooted about 15 times. All the lights looked good and I was able to connect to the APM via my xbee. When I went to the configuration window to check my radio inputs they were all at zero (no radio input detected essentially). These are the steps I took when I setup the APM before leaving for the park.

    1. Uploaded new code to board (2.2 with GPS fix)

    2. Cleared EEPROM

    3. Ran initial setup (Radio limits, modes, leveling), all of which went as usual

    4. Set my PIDs

    5. Disconnected from MP

    6. Went to park and ran into the issue

    Logs attached.

    2012-01-14 03-12 8.log

    2012-01-14 03-12 7.log

    2012-01-14 03-12 6.log

  • Developer

    Tested latest GIT 2.2ß2 with AeroSim:

    - Simple: OK
    - WP recorded with CH7 and the related mission "Auto": OK (note: if i record the latest WP with the quad at the ground then the landing in this case is perfect, the only difference have see is the increased speed of descent, maybe with "Land" mode we're coming down too slowly, please investigate...)
    - Loiter: no difference here from previous version, need test in real flight
    - Auto Throttle Hold: OK
    - Autoland: doesn't work, the only one ok with this sim is the version inside 2.1.1R7

    Thanks Jason...!

    Bests

  • Just tested my quad with v2.2.

    Setup: 3DR frame, 750kv motors, 12x3.8 SF props (reduced to 11"), APM 2.0

    Results:

    Simple mode has issues like everyone else is saying. Control authority is very weak and sporadic.

    Stable mode works very well! Best I have seen it yet.  I have been in the process of tuning the PIDs to suit my quad, but I definitely believe the code is an improvement in and of itself.  I was using 2.1 prior to this

    Alt hold would work for 5-10 seconds then started to oscillate.  I haven't had much time with Alt hold and my tuning may be off.

    Loiter seemed to hold a point +/- 5m.  Again, no tuning or flying experience with this mode yet.

    Definitely seems to be an improvement from 2.1 as far as I can tell.  Best of all, no crashes yet (knock on wood)! I will try to post logs and videos later today.  Thanks

  • One minor issue - in this release, the .kmzs produced as part of the log download process seem to be slightly different. Previously, if you double clicked on them, Google Earth zoomed in to the relevant area, sometimes to the grass. Now it seems to stop at the country level (well, England in my case).

  • Observations on flying 2.2, stock 3DR APM 1 board.

    A frustrating day made worse by 2 crashes (self-inflicted as many have been so kind to point out!).

    Started off looking quite good, but with a lot of vertical pulsing in Loiter. Reduced  Throttle Rate P to 0.3 and that seemed to fix that. The next problem was that although Loiter looked quite good laterally, it was very twitchy. No matter what I did on tuning, changing PIDs, there was little effect on this - it was consistently around arms 1 and 2 as an axis, pretty rhythmically every 2-3 seconds and normally started off with arm 4 dipping back and then twitching back up. Very uncomfortable to watch. I don't know if this was a config or a hardware problem (unlikely to be code unless others report it as a common problem). Any ideas? (I cannot seem to find the log, will keep looking). Anyway, that problem seems to have been overtaken by events.

    My second crash did not seem to have caused too much damage. It must have bounced hard because it was upside down when I got to it, but the damage was to the landing gear, easily sorted. I did also have to graunch the arms back into a regular flattish cross. I did an EEPROM erase and a reload of the 2.2 firmware. To my surprise on the next flight, the twitching had gone, but Loiter was now back in the familiar big circles. Is it possible that the crash may have given the hardware just the right type of impact maintenance to fix it?

    Running out of light and batteries, I flew through many and varied PID changes, not very scientifically, but ended up with something that was not too bad (log 17 and .kmz attached) and I am sure that I can improve on it first thing tomorrow. The curious thing to me is how far I have moved from the standard PIDs to achieve that. If anybody else is flying something similar to me and is struggling, I offer this evenings PIDs as a starter for 10:

    3692334779?profile=originalAny advice most welcome. If I could make one request to the development team - I know that it is probably the last thing you want to contemplate after such a frantic coding and testing effort, but it would be really helpful if the wiki could be updated so that the more amateur amongst us could understand better what the PIDs do with the current code, what effects we should expect to see if we change them, and what the interactions between different PIDs are. Thanks, Bill

    2012-01-14 05-53 17.log

    2012-01-14 05-53 17.kmz

  • Developer

    ArduCopter V2.2ß - Loiter and Autolanding test at the airfield

    I'm back now from the airfield, impossible to do more testing, very thick fog with visibility not over 15 meters, in soft wind.
    In this bad wheather condition my tests have focused about Loiter and Autolanding.
    I replaced the propellers in my quad with GWS 9x5 three-bladed (from the kit of X525) because APC 12x3.8 SF are too big for my little motors (you can see this setup in my latest video about Loiter with V2.1.1R10).
    Takeoff, some little pid tuning and the quad is perfect still... switch to Loiter... damn, only big circle!

    I play with Loiter PID for half an hour, always circles (big, small, random)... the latest value is "Loiter P 0,1" and "Loiter I 0,005", nothing to do, the quad is always in a circle.
    So I decide to replace the propeller with EPP 10x4.5 two-bladed, i put the default Loiter PID, takoff... much better now, but always circles, but the result is greatly improved.
    With GWS props i'm in hovering at 65% of throttle stick, with EPP is "the perfect 50%".
    This means that the size of the propellers affects the Loiter quality about the circles effect.
    I conclude by saying that the Loiter, though I do not think that level of code is changed from the R10, unfortunately has worsened considerably,
    has nothing to do with my last video (recorded with zero wind):

    https://www.youtube.com/watch?feature=player_detailpage&list=UUP...


    At this point I ask Jason to restore the loiter of R9 to perform new tests tomorrow, or check the current because form R10 to the latest there's really much difference (and worse).
    I believe in all this that the GPS has nothing to do.
    Autolanding in the sim is ok, in the reality the quad kissing the ground and drift like my
    previous attempts (documented with a video), and I think this greatly affects by the bad Loiter because the effect is generated by the first shot that is not perfectly leveled, and after the first bounce the APM do not understand anything.
    About Simple: it doesn't work, there's bug in the code.
    Now it's time to test all again with AeroSim... :-)

    3692334820?profile=original

  • Here's the video from my test flight today. Too bad I runned out of camera's battery and can't show RTL and Simple problems.

  • WARNING - Be very careful about plugging in the Ch 8 lead into your Rx.

    I have had 2 crashes today. One was when selecting Acro for the first time, ever. The second was when I selected my RTL flight mode. Both times my quad just slammed straight in the deck. The problem has been that to get as many flight modes as possible on my Tx, I have a mix between Ch 5 and Ch 8, with Ch 8 being on a 2 position switch to affect Ch 5 ppms on a 3 position switch, which has always worked fine. However, I swapped my boards over to fly 2.2 and get camera stabilisation so I am back to the APM 1 board. I have one of those all in one leads, and being a heli pilot, hate loose flappy leads so had plugged in the Ch 8 lead into my Rx. I have no idea what Ch 8 is supposed to do on an APM 1 board using 2.2, but if you have a similar setup to me, don't plug the lead in. When I tested it without the lead plugged in, RTL worked (although I thought it was supposed to climb).

    I really don't like being the real world idiot tester who finds all the never to be thought of exception conditions...

  • Just been out for a test after flashing the new FW.

    Copter is 990kv motors, 10x4.5 props, 4000mah lipo with gps & compass.

    General flight performance was great in stabilise mode. Did lots of zooming around the field and lots of very very stable hovering at 1-2m height. Stable enough to take off and land from my hand (got no legs at the moment!!). I was even inspecting the GPS status lights while in the air as it was so stable. Very nice.

    I also gave loiter a go but it was awful. The lat, lon and altitudes were all over the place. It was bouncing up and down +-10m and moving around horizontally around the same.

    I also notice that when flying around in stabilise, should the yaw not be held? As long as I never touch yaw, it shouldnt move from it's compass direction? What I found was that when doing large circles around the field (by moving my pitch/roll stick in slow circles) was that it slowly changed yaw and didnt correct itself to original position.

    I think it would be better to constantly correct for YAW to whatever the compass direction was after last manual yaw adjustment, I find it very difficult to fly when it keeps changing yaw without me asking it to.

    Overall, better stabilise than previous versions and excellent fun!

This reply was deleted.

Activity