paparazzi-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Paparazzi-devel] prebank


From: Gautier Hattenberger
Subject: Re: [Paparazzi-devel] prebank
Date: Wed, 30 Oct 2013 16:12:37 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.0

Hi Alonso,

The product CARROT*NOMINAL_AIRSPEED is actually used at several places in nav.c as a "length" scale adapted to each aircraft (if you give a correct value at least). In most cases, this could be better replaced by CARROT*ground_speed.
I guess the reasons it has not been done was that it would have been necessary to find proper bounds in order to avoid some stupid reactions and also to avoid oscillation of the control when the ground_speed value is varying a lot (due to turbulent wind for instance). Also this code dates back to a time where performance and code size was an issue, so a fixed precompiled value was a good option for an acceptable result.
If you think this can be improved, you can make a pull request to update this, but for most cases, the improvement is most likely to be within the accuracy of the trajectory tracking. So it will be difficult to evaluate, while the actual code is known to work good enough.

Anyway, thanks for poiting this.

Gautier

Le 28/10/2013 22:05, alonso acuña a écrit :
Hi. Right the value of the bank is calculated with the actual speed but it is set to 0 when the aircraft is not near the circumference and the distance is calculated using the nominal speed:

  float dist_carrot = CARROT*NOMINAL_AIRSPEED;
...
...
  circle_bank =
    (dist2_center > Square(abs_radius + dist_carrot)
     || dist2_center < Square(abs_radius - dist_carrot)) ?
    0 :
    atan((*stateGetHorizontalSpeedNorm_f())*(*stateGetHorizontalSpeedNorm_f()) / (G*radius));

So what I am saying is dist_carrot should not use NOMINAL_AIRSPEED but use the current speed.

I have been doing some comparisons in the simulator and it is hard to tell wether this makes any difference.  






On Mon, Oct 28, 2013 at 8:01 AM, Felix Ruess <address@hidden> wrote:
Hi Alonso,

I'm not that familiar with the fixedwing nav code, but to me it seems to be correct.
The circle_bank is computed using the horizontal ground speed...
If I'm missing something, could you please elaborate some more?

Cheers, Felix


On Sat, Oct 26, 2013 at 5:01 AM, alonso acuña <address@hidden> wrote:
What I meant by fly a good circle is really reaching the circumference in the correct angle when one is coming from deep inside the circle or from afar. It would depend on the direction the aircraft is flying with respect to the wind direction, if this is not exactly right then the prebank is applied too early or too late.


On Fri, Oct 25, 2013 at 8:44 PM, alonso acuña <address@hidden> wrote:
Hello. I have been reading the code in nav.c and it appears that the prebank is applied when the aircraft is close to the circumference, but this closeness is determined using the nominal airspeed defined in the airframe file and not the actual ground speed.  When the ground speed is different then the prebank is applied when it shouldn't and not applied when it should.  

For example if there is wind and the aircraft is going slower it would take more time to reach the circumference and at that speed it really isn't that close and the prebank should not be applied.  And in the other direction it will be flying faster and so the prebank should be applied at a greater distance but it isn't. 

This makes it very difficult to fly a good circle when there is wind. Is this a bug, a feature or a I am missing something?

Thanks.

Alonso Acuña


_______________________________________________
Paparazzi-devel mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel




_______________________________________________
Paparazzi-devel mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel


reply via email to

[Prev in Thread] Current Thread [Next in Thread]