Re: [Paparazzi-devel] Strange behavior: pitch down when engaging AUTO2,
From:
Eduardo lavratti
Subject:
Re: [Paparazzi-devel] Strange behavior: pitch down when engaging AUTO2, only after launch.
Date:
Wed, 19 Sep 2012 06:12:53 +0000
Christophe, i am using twog and can test energy control loops. where i can find this control ?
Date: Tue, 18 Sep 2012 20:51:07 +0200 From: address@hidden To: address@hidden Subject: Re: [Paparazzi-devel] Strange behavior: pitch down when engaging AUTO2, only after launch.
It would be awesome if anyone would want to try the energy control loops. I think they are on master only but for any LPC21 user that should work already.
System requirements:
-IMU
-airspeed sensor
Idea:
Lack/Excess of (total) energy controls the throttle, energy balance is controlled by pitch. Result: no stall on propulsion failure (battery-motor-prop) like in pitch from altitude and throttle from airspeed (current), no dive on take-off like in pitch from airspeed etc. And thanks to the integration of the imu, controlling acceleration rather than speed, the performance is increased a lot, allowing 100% throttle climbs and 0% throttle descends with very little airspeed error during the transitions, so no more need to limit v_climb to a low value in order to reduce airspeed errors on climb/descend. And after landing you get a list with the "spec's"of your airplane: max-climb-rate & max-climb-pitch (=the values for aggressive climb), cruise-throttle & cruise-pitch, aggressive-descend parameters etc (for a single airspeed at this point, maybe we could improve it for a full characterization). And the dash-cruise-loiter are replaced with airspeed commands.
main gains:
- cruise throttle/pitch (initial values: these are updated automatically afterwards)
- P & I for throttle
- P & I for pitch
[note that the P-gains are on the accelerations [m/s2] so they behave like a D-gain on airspeed, and the I-gain integrates these acceleration errors, so it can already start to integrate before a speed error is present]
There are a few extra gains that allow you to configure any of the 3 loops: energy - pitchFromSpeed - throttleFromSpeed.
So if this all sounds complex you can start easy first only filling the following gains: in its very simplest form you would have:
cruise_throttle = 0.5
throttle_increment = 0.1
pitch_of_vz = 0.15
throttle_from_airspeed_p = 0.01
(= automatic cruise throttle from airspeed only)
-Christophe
On Tue, Sep 18, 2012 at 6:58 PM, Gautier Hattenberger <address@hidden> wrote:
Hello Mitchel,
My first recommendation would be to stop using this control loop and
try to tune the control "new" or "energy". The problem is that their
is no documentation (yet...).
The main issue of the basic airspeed loop is that airspeed is
controlled with throttle and altitude with pitch, which is not a
good idea. The "new" control allow to balance the airspeed and climb
speed control between the pitch and throttle setpoints with four
PID. It is a bit more difficult to tune but if well done provides a
better control. For the "energy" control, I never used it but people
from Delft seems really happy about this one.
If you mainly use the pitch attitude to control airspeed and
throttle to control flight path, in your case it should avoid the
violent dive.
The other possibility is to have a non linear control with fixed
pitch/throttle when far from altitude setpoint and linear control
when close to the level flight (as it exists for the basic control
loop without airspeed control).
This airspeed control seems to be a really problem, so we will
probably take it out of the middle of the code into a separated file
and display a warning about the possible issues. Hopefully very
soon.
Cheers
Gautier
Le 18/09/2012 00:32, Mitchell SLOWER a écrit :
Dear Gautier,
I did some flight tests last weekend, and you were right,
thanks !
If I stabilize the plane in level flight for about 20
seconds after the climb, the plane does not engage in a dive
anymore.
Before you posted this message, I did actually try to fly
level before engaging AUTO2 after the initial climb - but not
for enough time - so the plane was still diving and I thought
the problem was elsewhere.
You provided me a solution that works, but requires a manual
operation (maintaining a level flight for 20 seconds) before
hitting AUTO2.
This is great, but prevents from fully autonomous flights,
which is one of my goals. It seems that if I use the auto
throttle control loop the diving phenomenom after lauch does not
occur, but I'm really happy with airspeed control :(
Do you have a solution in mind that would allow the UAV to
fly antonomously without that manual stabilization part ?
FYI, I'm starting with a bungee/catapult, then full throttle
at fixed pitch (CLIMB), and then airspeed control loops are
activated from the flight plan.
As you said, pitch is control by vertical speed error.
When you enter AUTO2 (just after 340s), the vertical speed
is +15m/s while the desired climb speed is 0 and rising
slowly because of a rate limiter. So the result is pretty
obvious: your climb speed is too high and thus the control
commands to pitch down, overshoot and then slowly recover.
And simple way to avoid this is probably to stabilize your
plane in level flight in manual before switching to AUTO2,
or at least with a climb rate and airspeed close to the
desired value for navigation.
Gautier
Le 15/09/2012 17:24, Mitchell SLOWER a écrit :
Dear all,
First of all, I'm sorry to put that topic on
the forefront, but this strange behaviour seems to
be still unexplained for many of us.
To resume what's happening: after MANUAL
launch, then switch au AUTO2 plane goes into a
violent dive of about 40m, then go back into a
normal flight, and from here everything is okay
until the end of the flight. So that's a severe,
but temporary problem.
I linked graphs of the situation here (real
flights):
It looks a bit similar, but as pitch is
controlled by the vertical speed error, I don't
understand why the plane pitches down when
switching to AUTO2, as altitude setpoint is >
than altitude, and cruise setpoint is never
negative. Look here: http://cjoint.com/12sp/BIjvQBPg2o3.htm
I'm pretty sure it's airspeed control laws
related (forther details are available in the last
messages), but I really don't understand what's
happening.
It would be really great if anyone could
pinpoint where we should have a look in order to
understand and correct what's wrong.
I did a flight this morning, it was very
similar to Jefferson's flight (holding 15°
pitch and 100% throttle after bungee launch,
then engaging standby), to see if I can
reproduce the behavior Jefferson decribed.
What happened was exactly what Jefferson
wrote: the plane hold really well the first
part, quickly gaining altitude after bungee
lauch, then when it switched to the standby
block, plane went into a violent dive of
about 40m, then went back in a normal
flight.
I had a look at the logs, and linked some
screenshots below.
Note about these log screenshots:
- At 320s: bungee launch
- At 343s: switch to standby block
- At 390s: standard flight (from here,
everything is ok, problem does not happen
anymore).
Comment: this graph shows the altitude
increase right after bungee, then the dive
when switching to standby, and the altitude
that decrease at a lower rate then
stabilizes and went up again.
2/ Desired climb / Estimated climbrate
(zdot) are plotted: http://cjoint.com/12sp/BIjvQBPg2o3.htm
Comment: climbrate goes from 6m/s
(setpoint) to 0m/s when standby block
engages. It's interesting how the climbrate
increases over time, slowly getting back to
the setpoint. There might something here
to look at.
3/ Desired pitch / attitude (theta) are
plotted: http://cjoint.com/12sp/BIjvRwfJAxP.htm
Comment: to Felix: you were right,
attitude:theta went up to 40 degrees during
bungee takeoff. That's another subject, but
interesting to mention here. Otherwise, we
clearly see that the control loops are
asking for a pitch down when switching to
standby block. This is not normal, as
altitude setpoint > current altitude and
airspeed > airspeed setpoint.
4/ Airspeed / Airspeed setpoint: http://cjoint.com/12sp/BIjvPfdZ16D.htm
As mentioned before: when switching to
standby block, airspeed is over the airspeed
setpoint, so the plane does not need to
pitch down in order to gain airspeed.
To summarize:
- Problem can be reproduced, on different
planes. Both planes were launched using a
bungee / catapult.
- It seems not to be AHRS related as plane
can hold a steady pitch attitude right after
bungee launch.
- It seems to be airspeed specific
control loops related, because these are not
used when flying at a fixed pitch/throttle
(vmode=throttle) but used in the standby
block, and we see on the graphs that control
loops are asking for a pitch down instead of
a pitch up right after bungee launch.
- Can anyone explain the desired
climbrate step down (from 6 m/s to 0m/s at
324s), then gradually increase here: http://cjoint.com/12sp/BIjvQBPg2o3.htm ?
Regards,
Mitchell
Le 9 sept. 2012
03:38, "Romney, Jefferson S" <address@hidden>
a écrit :
I
have had a similar problem that I
think is the same cause. I take
off in Auto2 with a catapult and
it holds 15 degrees pitch until it
gets to altitude. (that means it
must not be the AHRS) then as soon
as speed control kicks in when it
moves to the standby block, it
dives very violently it recovers
after losing about 10-30 meters
altitude, then flies normally. It
must be in the airspeed or
altitude loops because those are
the only ones not active on
takeoff when it works just fine. I
haven't been able to figure this
one out all year so if anyone can,
it would be great.
-Jefferson Romney
From:
paparazzi-devel-bounces+romneyj=address@hidden
[paparazzi-devel-bounces+romneyj=address@hidden]
on behalf of Gautier
Hattenberger [address@hidden] Sent: Saturday,
September 08, 2012 3:16 PM To:address@hidden Subject: Re:
[Paparazzi-devel] Strange
behavior: pitch down when
engaging AUTO2, only after
launch.
The attitude
estimation when taking
off with bungee might be
not perfect, we should
try the
int_cmpl_quat_gravity_heuristic
written by Felix.
As I said before, I
thought it was some
I-term winding up, so I
tried to decrease, even
set to zero the two
I-terms used in the
control
loops: v_ctl_auto_pitch_igain
and v_ctl_auto_airspeed_igain.
No improvement.
Improvement happened
when I commented out in
the config file the auto
pitch inner loop
parameters:
V_CTL_AUTO_PITCH_PGAIN
et V_CTL_AUTO_PITCH_IGAIN.
The plane was not diving
dangerously anymore, but
not getting altitude,
just gliding on its
track.
To: address@hidden
Subject: Re:
[Paparazzi-devel]
Strange
behavior:
pitch down
when engaging
AUTO2, only
after launch.
I'm pretty
sure that
the AHRS_GRAVITY_UPDATE_NORM_HEURISTIC
in 4.0.1 has
almost no
effect
compared to
not having it
defined.
Whereas
the
improvements
in
my int_cmpl_quat_gravity_heuristic
clearly should
help a lot (if
the
acceleration
of the bungee
takeoff is
indeed the
problem).
At least
in simulation
I see a large
(temporary)
pitch error of
up to
~20deg before
the
improvements
(of course
depends on
duration and
acceleration
in bungee
takeoff)
before the
improvements.
On Sat,
Sep 8, 2012 at
10:42 PM,
Mitchell
SLOWER <address@hidden>
wrote:
Felix,
I did a
bungee test in
AUTO1
with AHRS_GRAVITY_UPDATE_NORM_HEURISTIC
(4.0.1). It
worked.
the
pitching down
after a bungee
takeoff is
definitely
noticable,
however from
what you
describe I'm
not sure if
that is the
only effect
you are
seeing.
you can
test the
improved
gravity norm
heuristic from
my int_cmpl_quat_gravity_heuristic
branch which
is up-to-date
with v4.0
otherwise.
Would be
great to get
some feedback
on this as I
can't test
this with a
real bungee
takeoff
myself.
Cheers,
Felix
On Sat,
Sep 8, 2012 at
10:19 PM,
Eduardo
lavratti <address@hidden>
wrote:
I
have the same
behavior.
i am using
float_dcm and
bungee but i
think this is
not due
bungee.
this behavior
occur if i
engage auto2
when pitching
up.
If i pitch up,
stabilize
altitude and
engage auto2
this behavior
not occur.
this seem that
some I term
are working
but i not have
time to search
the cause.
i have to make
this test.
takeoff in
manual then
engage auto2.
this will
reset the
integrator.
regards
Date:
Sat, 8 Sep
2012 21:57:52
+0200
From: address@hidden
To: address@hidden
Subject: Re:
[Paparazzi-devel]
Strange
behavior:
pitch down
when engaging
AUTO2, only
after launch.
Marc,
Christophe:
initially, I
thought it
could be an
AHRS related
problem, but
I'm think it's
something
else.
(I'm
using
int_cmpl_quat
and the
AHRS_GRAVITY_UPDATE_NORM_HEURISTIC
flag).
I think
it's not
related to
AHRS because:
- I had a
look at the
estimator
(theta), and
pitch seems to
be correct.
- If I
lauch with the
capatult, fly
some time in
manual, and
engage AUTO2,
diving also
happens.
- When I
disable the
airspeed from
the airframe
config file,
everything
seems to work
(I say "seems"
because I did
only one try
that was
successful).
It has
flown several
times,
including
catapult
launches but
with the
complexity of
all aspects
involved (e.g.
gps latency
etc.) that is
not a
guarantee. If
you would be
so kind to
help test it
it would be
highly
appreciated.
copy the
file to your
repo, add USE_AHRS_GPS_ACCELERATIONS
to
your airframe
(should pop a
message during
compile)
-Christophe
On Sat,
Sep 8, 2012 at
8:58 PM, Marc
Schwarzbach <address@hidden>
wrote:
Hi Mitchell,
your problem
seems to be an
AHRS
calculation
thing related
with the high
acceleration
at bungee
take-off.
See the
conversation
one month ago:
Subject: Re:
[Paparazzi-devel]
int_cmpl_quat
and bungee
takeoff
As a short
note, I had a
similar, but
very light
behaviour when
hand throwing
my Easystar
also with
Lisa/M. It
does a little
pitch down
before
starting to
climb after
the throw...
Probably we
should look
into the ACC
signals for
fixed wing..
Cheers
Marc
--------
Original-Nachricht
--------
> Datum:
Sat, 8 Sep
2012 20:37:18
+0200
> Von:
Mitchell
SLOWER <address@hidden>
> An: address@hidden
> Betreff:
[Paparazzi-devel]
Strange
behavior:
pitch down
when engaging
AUTO2, only
after launch.
> Dear all,
>
> I
encounter a
really strange
behavior on a
fixedwing.
> I had a
look at the
logs, made a
lot of flights
in order to
find out
> what's
> wrong,
but I really
don't
understand
what's
happening.
> So here
is the
situation:
>
> First,
the setup:
> Lisa/M
2.0, PPZ
Version:
4.0.1. I'm
using an
airspeed
sensor,
> I'm
launching the
plane with a
bungee, in
manual mode.
> Before
launch,
current clock
is set to
circle over
home, 150m
AGL.
>
> What's
happening:
> After
launch, when I
change to
AUTO2 , the
plane does not
pitch up with
> motor on
as expected in
order to reach
the desired
altitude, but
pitches
> down,
gaining
airspeed and
loosing
altitude (I
checked that
airspeed is
> near or
over desired
airspeed when
I switch
mode).
>
> As things
get dangerous,
I switch to
MANUAL, get
some altitude,
engage
> AUTO2,
and the same
behavior
occurs.
> Then,
after a few
tries like
this,
everything
works ! And it
works really
> fine, as
I have a very
good airspeed
control and
climb rate.
> After
that, I can
switch from
MANUAL to
AUTO2, and the
plane behaves
> normally
(get some
altitude at
the right
airspeed and
climbrate).
>
> I did a
lot of tests
(I initially
thought of a
I-term winding
up), all
> were
>
unsuccessful.
> The only
clue I found:
this problem
might be
related to the
airspeed
> specific
control loops,
because when I
disable the
airspeed
sensor from
> the
> airframe
config file
the plane
seems to
behave
correctly (no
pitch down
> when
engaging
auto2).
>
> Did
anyone
encounter the
same behavior
?
> Do you
have any idea
about what
could be
happening ?
>
> Of
course, I can
provide
further
details, setup
and logs.
>
> Regards,
> Mitchell