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

  • Today , I test 2.2 b4 in Loiter mode altitude 10 - 15 meters. In Area test not have wind (0 km/h). It's very stable but have sometime drift out of center about 3 meters.

    2555-01-25 06-49 1.log

    2555-01-25 08-55 1.log

    2555-01-25 08-58 2.log

  • Ok, Ioaded 2.2b4, the following (bad) video is in my house, somewhat cluttered.

    Hey, I'm a bachelor, and it is MY house!

    I like stabilize.......

    https://www.youtube.com/watch?v=5WetPjpEnF8&feature=youtu.be

  • Moderator

    Any secrets to getting Alt Hold to work well? I have a cover from a 25 CD holder over my APM, it has a 3cm hole in the bottom for all the cableling and there's no disturbed air getting in so I've taken the piece of foam that I had over the baro sensor off.

    But I'm still struggling with good Alt Hold though, default THR_RATE_P is 0.4 but I was getting large up/down oscillations which got worse and worse. Went to 0.1 and still get the oscillations but not so bad but again they get slowly worse. To get rid those would one increase THR_RATE_I ?

    Anything else?

  • Developer


    I just came back from flying a corrected thrust version of the code. I added an expo to the navigation pitch and roll to try and make the thrust output linear. I have to say it felt really good. 

    3692341607?profile=original

    Here is a test of RTL off of my back porch. Flying conditions are tight...

    Jason

    https://storage.ning.com/topology/rest/1.0/file/get/3692341607?profile=original
  • Moderator

    Marco, some video of Stabilized flight with the PIDT1 mod, there's an occasional twitch which is a little disconcerting, seen briefly at about 0:52s

    https://www.youtube.com/watch?v=HDnmhRXtCYM

  • Developer

    Procedure for tuning the "PIDT1" patch (from the Igor's blog post, i follow this one for my quad):


    Be really carefull, propellers are dangerous!  I do the tuning of the control loops while I hold the copter in my hand and try if it compensates the disturbances without overshot or oscillation. You should decide for yourself if cou can hold your copter in one hand while you throttle up and test the stability. Even small propellers can harm your fingers! If you want to proceed, I do it like this:

    1. Reload your last setup and level the copter.
    2. Set all parameters for stabilize STB_***_P and STB_***_I to zero.
    3. Set all parameters for rate control RATE_***_P, RATE_***_I and RATE_***_D to zero.
    4. Hold the copter with one hand, throttle up until it becomes weightless, then turn it. Nothing should happen, because all control loop parameters are zero. You have just manual throttle control.
    5. Increase the D-Terms and test again while holding the copter in your hand. Remember, it can't fly with most parameters set to zero. Increase the D-Term and test again, until you got some oscillation. Let's call the value you found 100 percent. Now reduce it to 50..70 percent. Do this for ROLL and PITCH.
    6. Proceed with the P-Terms. Increase and test until it gets unstable. Then reduce it to 50..70 percent of the original value.
    7. Set the I-Terms to 30..50 percent of the P-Terms. Test again. If it is unstable, reduce P and I and maybe D a little bit.
    8. Now go to the STABILIZE control parameters. Increase the P-Term. Now the copter should return to level position automatically. Increasing of the P-Term will lead to a faster return to level position after disturbance or also to a fast respond to the desired angle by pilot input. Find a value where the copter returns fast from a disturbance without overshot or oscillation.
    9. Always leave the STABILIZE I-Term STB_***_I zero in this controller configuration!
    10. For YAW you can leave the D-Term zero and use your previous settings for STABILIZE and RATE control. Or you tune it, but I didn't try it at YAW yet.
    11. If everything works well and the copter returns to level position after disturbance or pilot input without overshot or oscillation, then you can try to hover and fly carefully. Not before!
  • Developer

    Yes Graham, i tried now, is because I have attached the "camera.pde" current, which provides for changes elsewhere.
    That's because I cleaned this version so as not to make too personalized, free to all.
    Thanks for the warning, you can fix the problem simply by overwriting the camera.pde with this attached.

    Enjoy

    Camera.pde

  • Developer

    I upload here the cleaned "AC V2.2ß2XP2" version about my "PIDT1" test if someone wants to try (thanks Rui for the fix).

    ArduCopter_2.2ß2XP2_PIDT1.zip

  • Hi droners,

    I maidened my brand new Y6 hexa yesterday, using 2.2b2, tested STABLE and ALT-HOLD, all with default parameters, so no PID tunning done yet. All I can say is WOW!

    specs:
    AC2: v.2.2b2
    Motors: BC-2836/7 1120kv
    Props: 10x4.5
    Weight: 1950gr + Batt. + Camera(s) (GoPro/HD Wing)
    Batts:  4S  2650mA, 3000mA, 3700mA
    APM1
    Size: 57cm from motor to center

    Check the video it's a 3 views shooting, stabilized GoPro, HD wing on arm pointing at Gimbal, and main screen taken with mobile phone.
    Last minute of the video is a detailled close up of the gimbal working.

    https://www.youtube.com/watch?v=jqsKP_lNmT4

    You can see the pitch is a bit nervous, I had expo on roll but not on pitch (grrrr.)
    Things to tune:
    - AltHold, although is quite rock solid, is slow on response
    - Yaw, good, but overshoots a bit, previous versions yaw jump is gone!
    - ...

    I must thank the Dev team, your doing a great job!!!

    btw, I might take the landing gear off, why do you need it if you can simply catch it in the air ;-)

    Dani



  • Developer

    ArduCopter V2.2ß2XP2 "PIDT1" (APM1) - Flight test at the airfield:

    Hi all!
    Premise: i have abnormal sound vibration induced by the gear, I apologize for the strange noises in the air... tomorrow i fix it! :P
    In order of importance I think the first thing is "quad must fly well", then automation can be introduced after this.
    Here we focused on placing the automatic flight, but if a quad first does not fly very well all the automation may not work correctly... and with "fly" i mean really fly, not just hovering.
    After countless flights in recent days my little quad did not give me any security and feeling, where I felt a little "in my thumbs", I decided to test the change by Igor Van Aird called "PIDT1" (library called "PID_fast"), I introduced this mods in the code "AC V2.2ß2XP2" edited by Jean-Louis Naudin as regards the autolanding.
    One of the huge advantages of "PIDT1" is to have a high reactivity in the controls without making a quad instable.
    What about ... for the first time I'm excited! Today I really enjoyed it without heartache of mind!
    The quad that is totally under control, has no hesitation in flight, no wobbles (even in vertical descents), tow that is a pleasure, is not plagued by the "command memory effect" when you leave the sticks for a long time in the same position... look at the video and judge for yourself.
    In the final part of video I put my little quad in a large schneider at high speeds without any problem, less than a meter above the ground, with a perfect control.
    I hope that Jason take seriously into account this change, which in reality is nothing more than to return to the good flight style of "ArduCopter NG", removing first of course other stab system from the code because it does not work very well like this, I would of course be denied!
    The only problem with this mods ("PIDT1") is if you use the AutoTrim function, because during takeoff the quad wobbles quite possibly setting a deadline of control that is stored when the quad is stable on the ground, so once armed engines if you do not take off immediately generates an error correction which then automatically resets when you are flying, just after one or two seconds (of panic).
    I enclose, beyond video, the version of firmware that I modified and the parameters that I used in this flight test.
    This fixed release are provided without warranty but if you want use at your own risk, I suggest all to take it as a reference, only as an example because there are few changes in the code related to my quad (led pattern control in channel 8, roll gimbal control in ch 7 and other).
    Look forward to your comments, enjoy!


    Bests,

    Marco

    ArduCopter_2.2ß2XP2_PIDT1_Quaddino.zip

    2.2ß2XP2_PIDT1_Quaddino.param

This reply was deleted.

Activity

Jose Araujo liked Jose Araujo's profile
Aug 29
spencer harvey liked spencer harvey's profile
Jul 9
More…