Monday, 14 July 2014

AC3.2 - 3 new parameters

Holy crap batman the sky is falling!

This is pre beta people :)

First up I would like to say a couple of things:
- A big first up. Everybody please try to keep the feedback constructive until you understand what the new features are.
- Thanks Marco for your feedback! and... relax I am confident you will like these features once you understand them.
- As far as I can see this isn't lag, it is doing exactly what it is supposed to do.
- These features are designed to improve the performance for the sharpest acro pilot, the gun fpv pilot, the instructor for a new beginner (on the gun acro quad), and the massive camera ship. If you don't understand how this can be true then you have some learning to do. :)
- Finally my whole interest in the control code of Arducopter is to make it possible to squeeze every last bit of performance out of a frame. And I understand I need to do this in a way, that keeps tuning parameters to a minimum, and makes it easy for a beginner to start using arducopter.

First up you should be able to get back to the sharp feel you like by setting:
RC_FEEL_RP to 100
ATC_ACCEL_RP_MAX to 216000 but anything over 108000 shouldn't be noticeable. I would suggest 94500.
ATC_RATE_RP_MAX to 54000 but don't do this on your big copter! I also don't think this parameter is your problem.

This should make things very similar to your original experience.

Ok so what are these parameters doing and how have I chosen the defaults. The defaults are chosen to make a sharp-as-hell copter feel like a stock 3dr quad on the old default setting before we discovered that autotune could turn it into a razor blade. So if you had a sharp-as-hell copter before, expect it to feel like a docile beginner quad.

So how have we done this? There are three layers.
1. RC_FEEL_RP
2. ATC_ACCEL_RP_MAX
3. ATC_RATE_RP_MAX 

1. For the old hats, RC_FEEL_RP is basically an artificial Stab_P. It controls how aggressively the copter reacts to small changes in the stick inputs. A value of 25 will give you the equivalent of Stab_P of 4.5 and a value of 100 will give you an equivalent Stab_P of 12. "12!" I hear you say, "that will make it oscillate". Well, that is the point, it won't. If your value is higher than the copter is capable of, all that will happen is your commanded position will leave your actual position behind and your copter will just do it's best to keep up. 

Why use 0 to 100? That was just to make it easy for people to adjust the way it feels. 

Finally for those of you digging into the physics of motion that we design these control systems around. RC_Feel_RP basically defines the Jerk and therefore stops the hunting around zero.

2. Now the big one, ATC_ACCEL_RP_MAX. This is the maximum acceleration you can request of your frame. If you set this to 18000 it will feel like you are flying the avengers aircraft carrier. I would not recommend going below 36000 and 54000 is a nice number for everyday relaxed flying. Most agile frames, running 10" props, are capable of 100000 to 120000 (on high powered micro quads this could easily double again). How do I know this? Because I have been looking at this on everybodies autotune logs since it was released. This brings me to my next point. The next release of Autotune will set this parameter to something like 75% of the maximum your copter is capable of while staying in control.

Ok, so why did we want to include this. There are 3 basic reasons. Many people were detuning their Stab_P after autotune because they found it too aggressive and fast. Camera ships need smooth movements to get the best video. And finally my favorite, FPV and acro pilots get a slight bounce back or digital feel to acro.

For people that aren't ready or don't like the ultra sharp control afforded by autotune on many copters can make their copter feel like a larger, lower powered copter without sacrificing the stability of a small agile tune. This is where 54000 is a good number.

Camera ships are able to make much smoother movements without relying as heavily on the steady hands of a talented pilot. The camera ship operator is effectively able to control both the Jerk (change in acceleration per unit time) and the angular acceleration with the RC_FEEL_RP and ATC_ACCEL_RP_MAX parameters respectively. The aggressiveness of copter movement can then be controlled to ensure that camera gimbals can stay perfectly level or to remove that last little wobble on very large copters.

Finally Acro and especially FPV pilots, flying in ACRO, can choose ATC_ACCEL_RP_MAX just under what their frame is capable of. What this does is slow the desired point as it reaches the final target. Without this the pilot can request changes in rate the copter is capable of, the result of which is a small overshoot and bounce back. This means that a well setup copter (one that has done autotune) will stop reliably and repeatedly without bounce back or overshoot when performing aggressive maneuvers like rolls or loops. This is where the last little bit of precise control is squeezed out of the copter. This is the pointy end of the stick that all but the most talented pilots won't even notice and even the pilots that do will only be able to describe the performance in terms of confidence or feel. Of course the FPV pilot will be able to pick this up much easier. The most obvious axis that this improves is Yaw.

3. Now ATC_RATE_RP_MAX is the safety net that sits below everything else to ensure the copter is always in control. The two parameters I just described bypass the stabilised controller and feed their commands directly into the rate controller. This provides a very fast response (faster than any other Arducopter release) because we don't need to wait for the position error to build up before the copter reacts. The ATC_RATE_RP_MAX acts on the output of the Stability controller that is working to minimise the remaining error between where the pilot's filtered input says it should be and where it is. 

We choose ATC_RATE_RP_MAX to be a rate we know the copter can safely stop from and again I can calculate this from Autotune. Here I will probably go to something like 30 to 50% the maximum value calculated by Autotune.

This addresses the problem with large copters that fly fine until they are commanded to go from full right 45 degrees to full left. The copter then overshoots and flips. This is being caused by the Stab controller asking for a higher de-acceleration than the copter can achieve because of a large Stab_P value. When correcting small angle errors, say 45 degrees, the copter doesn't build up too much speed. However, when the angle error becomes large the copter is able to get a real head of steam up and it is like comparing the stopping distance of a car from 60 km/h to doing 120 km/h (the stopping distance isn't double, it is quadruple).

The beauty of this parameter in the new system is we are able to set this to very conservative values without compromising the performance of the copter. This value is really only used when the copter is forced away from it's desired attitude by an outside force, impact, or mechanical failure.



Ok, it looks like I have finished my essay just in time for Marco to have worked out the settings without my help but I hope this has explained a couple of things here. Thanks again for everybodies feedback! And remember that the ATC_ACCEL_RP_MAX and ATC_RATE_RP_MAX parameters will be set by Autotune based on measurements of the system. It is only RC_FEEL_RP that is purely a user defined parameter. The defaults for the ATC_ACCEL_RP_MAX and ATC_RATE_RP_MAX parameters should be chosen as safe numbers for everybody to start with and leave autotune to update them or experienced users to tune them as they please.

Ok, this has taken me longer than I thought.

Good night everybody and sorry I didn't discover this earlier!!!