If we adopt this then I think I'd like it to be a runtime selectable
option, so more people can use it without having to rebuild.
QGC WPL 110
0 1 0 16 0.000000 0.000000 0.000000 0.000000 -35.362938 149.165085 584.409973 1
1 0 3 22 15.000000 0.000000 0.000000 0.000000 -35.361164 149.163986 28.110001 1
2 0 3 16 0.000000 0.000000 0.000000 0.000000 -35.359467 149.161697 99.800003 1
3 0 3 16 0.000000 0.000000 0.000000 0.000000 -35.366333 149.162659 100.730003 1
4 0 3 16 0.000000 0.000000 0.000000 0.000000 -35.366131 149.164581 100.000000 1
5 0 3 16 0.000000 0.000000 0.000000 0.000000 -35.359272 149.163757 100.000000 1
6 0 3 177 2.000000 -1.000000 0.000000 0.000000 0.000000 0.000000 0.000000 1
7 0 3 16 0.000000 0.000000 0.000000 0.000000 -35.359272 149.163757 100.000000 1
On this flight there isn't so much differences between PID and L1, but L1 obviusly tracks the lines better. And still has the advantage of only one parameter needing to be tuned. PID has lost on the last waypoint (loiter) but that was probably because i set it the wrong way.
Brandon/Tridge,
I've finished looking through Brandons code patch and of the three patches out there at the moment I believe it to be the best solution. Leaving aside the normal implementation cleanup type of stuff (divide by zero protection, etc) there are a couple of algorithm modifications which I would like to propose which will reduce potential tuning difficulties across a wider range of vehicles:
1) Looking at the source paper, the natural frequency of the navigaton loop is proportional to the ratio of ground speed to reference length. Because of the potential for coupling between the navigation loop and autopilot bank angle control loop, it is preferable that this frequency be kept constant. For this reason I would recommend that reference length be scaled automatically with ground speed, and that the user selects a natural frequency for the loop. This way a conservative initial value can be set that will work for a wider range of airframes (users can always tweak the requency to a bigger number if they want to tighten up the tracking) and the risk of running into stability issues with higher speed vehicles and tailwinds is reduced.
2) The fixed damping ratio of 1/sqrt(2) will limit the natural frequency/gain that can be used before lag from demanded to achieved lateral acceleration eats away the phase margin and damping beccomes unacceptable. Looking at the paper there is simple way to incorporate additional damping using on the n2 angle that will scale automatically with ground speed and reference length. This would enable the user to select the damping ratio for the loop. Unfortunately many of the airframes out there (eg Skywalker) suffer from poor roll rates and adverse yaw, so some adjustment to damping is desirable.
I can provide the maths/code for these changes.
Regards,
Paul
> From: tri...@samba.org
> To: brnj...@gmail.com> CC: drones-...@googlegroups.com; p_rise...@live.com.au
> Subject: Re: [ardupilot] Plane: L1 Control for Straight and Curved Path Following (#101)
> Date: Mon, 11 Mar 2013 10:31:37 +1100
Brandon,I’ve spent a bit more time this week looking through your patch trying to work out where to best add the additional damping term and in the process I noticed that in the calc_nu_cd function, you are comparing a wind corrected bearing to the reference point to the yaw angle rather than the true bearing to a velocity vector. I assume this is because you still wish to use the ahrs heading rather than gps velocity heading to enable it to ride out GPs drop-outs?If so then getting inertial velocity added to the AHRS function moves up the priority list because bias errors in wind velocity estimate will still produce bias errors in tracking which reduces one of the main benefits of going to a second order control scheme.Regards,Paul
From: Brandon JonesSubject: Re: [ardupilot] Plane: L1 Control for Straight and Curved Path Following (#101)
Hi Paul,Thanks for sharing your design! I think adding in cross track error rate aspects of this design, as you mentioned in your other message would improve performance for those aircraft that need it. I am going to work on adding an inertial velocity output in the AHRS library that should help enable this.Overall we are pretty tough on the lateral guidance control laws because after each waypoint sequence there is a large step of cross-track error. I implemented this path geometry code here first, then found this approach as a way to do curved path following with simple transitions between straight and curved path following.I think one of the most powerful aspects of all this is the ability to prototype flight control laws, it is like we have our own variable stability aircraft!-BrandonOn Mon, Mar 11, 2013 at 3:54 AM, Paul Riseborough <p_rise...@live.com.au> wrote:
Brandon,Nice work on the AIAA paper. I like the way it looks after the track capture and following problem in a unified control law and also like the way that for small angles it behaves like a second order system which will effectively removes the reliance on wind estimation for accurate tracking. I have some reservations about the fixed equivalent damping ratio of 1/sqrt(2). My experience ois that phase delays from demanded to achieved lateral acceleration, particularly in a bank to turn airframe, act to reduce the effective damping in the tracking loops and require the damping ratio of the loop to be increased to compensate.To get around this problem in the past, I have used a simple linear controller with gain terms based on position and velocity perpendicular to the demanded trajectory, and set the velocity gain to a larger theoretical damping ratio of around 0.9. This has however required some additional complexity on the form of limiters to control the track capture angle across a range of wind conditions. Is there a way that your scheme can be adjusted to provide some additional damping to compensate for phase loss from demanded to achieved lateral acceleration? – it appears to be an intrinsic property of the control law, but maybe an additional term could be added.I have attached an example Simulink block diagram model showing a simple waypoint to waypoint follower scheme with adjustable damping and the limiter logic required for track capture. The wind estimate is only used to assist with track capture. Note the use of vector computations, with the only trig function required being the atan used to calculate roll angle from acceleration demand. Also note the lag from demanded to achieved acceleration|turn rate in the plant model. This technique can also be applied to curved pathsI haven't yet looked at the code itself, but will do so this week.Regards,Paul
From: Brandon JonesSent: Monday, March 11, 2013 12:49 PMTo: tri...@samba.orgSubject: Re: [ardupilot] Plane: L1 Control for Straight and Curved Path Following (#101)
Brandon,Yes, I’d like to collaborate on a model development as I find it to be an excellent way to prototype control laws and get all the maths sorted before the complexities of integration start clouding the issues. It is possible to run C and other code within S-function wrappers provided it conforms to the standard interface, but it’s been a while since I’ve used that facility. What version of Simulink do you use?We probably don’t need the complexities of a round earth physics model at this stage (unless we start going down the path of developing tightly integrated INS/GPS filters) so I can knock together a generic airframe model with basic undercarriage dynamics using an earth fixed NED reference frame fairly quickly.Regards,Paul
Subject: Re: [ardupilot] Plane: L1 Control for Straight and Curved Path Following (#101)
Hi Paul,That is awesome! I will study the Simulink model this weekend.It would be great if we could collaborate on an Arduplane relevant baseline Simlink model for very rapid control law prototyping, like you've done here. Perhaps run part of the SITL within a simulink environment? What are your thoughts?-Brandon
On Mon, Mar 18, 2013 at 12:28 AM, Paul Riseborough <p_rise...@live.com.au> wrote:
G’Day Brandon,I’ve implemented the L1 control law in Simulink and derived and added the additional calculations required to achieve a specified frequency, damping ratio and approach angle. I’ve attached the file for you to have a look at which compares the modified L1 scheme with the simple PD scheme I shared with you earlier. You can se that they essentially give the same results, however the L1 scheme gives explicit user control over approach angle for track capture.The Simulink simulation results indicate that I have the maths right, so I will now look at what is required to get these changes into your code base. I’m new to using GIT, so I haven’t yet worked out how to get the latest files from your L1 patch, other than copying and pasting the text from the github window.I agree with your sentiments on the large step demands we apply to our guidance loops. I’ve used circular arcs in the past to fly past waypoints, but the logic required does get messy after you’ve handled all the special cases(eg acute angle turns, overlapping arcs, etc). At the moment, the user can enter some pretty stupid waypoints (eg 180 deg direction changes), and it won’t fly tidily, but it doesn’t break either.