altitude and speed control

61 views
Skip to first unread message

MIG-29

unread,
Sep 13, 2012, 7:51:14 AM9/13/12
to uavdevboard
Hello,

I tried to fly a UDB3 on a flying wing with altitude control and speed
control both enabled.

However, the plane would loose a lot of altitude and then would never
attempt to get back to the set altitude. I would need to override it
in order to maintain the altitude. If I didn't override it then it
would have hit the ground...

I have to mention that this happens only when BOTH altitude and speed
control are enabled. If I disable the speed control then everything
goes back to normal and the plane follows the waypoints at the correct
altitude.

Any thoughts on why this might happen?

The set speed is indeed high (possibly the highest that specific plane
can reach) but I would imagine that even if I set the speed larger
than the maximum that the plane can reach then it should not loose the
altitude at all costs... In the beginning it would try to trade
altitude for speed but then the error feedback in the altitude should
start to not allow it to loose continuously the altitude...

Best regards!

Peter Hollands

unread,
Sep 13, 2012, 4:36:03 PM9/13/12
to uavde...@googlegroups.com
Hi Florin,

Bill, Ben and possibly Matt, are the subject matter experts on this area.
But just to keep the conversation alive (as no one else has responded yet),
here are my thoughts ...

you wrote:-

"The set speed is indeed high (possibly the highest that specific plane
can reach) but I would imagine that even if I set the speed larger
than the maximum that the plane can reach then it should not loose the
altitude at all costs..."

I just read the code for this. I don't see any logic to prevent the plane "from losing altitude at all costs".
If you set the desired speed high enough, then I think the plane will dive to
try and obtain that speed. If it cannot reach the required speed, it will keep
diving. I don't see any logic to prevent that. So at the moment, I think it is requirement to
set the DESIRED SPEED, to as speed that is well within the normal operating capabilities of your plane.

I look forward to the comments of the other developers.

Best wishes, Pete



--
--



William Premerlani

unread,
Sep 13, 2012, 4:52:18 PM9/13/12
to uavde...@googlegroups.com
Hi Florin and Peter,
I think that Matt will have to answer Florin's question about how altitude and speed control now work. In browsing the code, I notice that Matt has made some changes to altitude and speed control that I have not taken time to understand. I recall that Matt explained the changes when he made them, but I cannot find that thread right now. Perhaps Matt can point to it.
The last time I worked on altitude and speed control, altitude control took precedence over speed control, but I am not sure how it works now.
Best regards,
Bill Premerlani

--
--
 
 

William Premerlani

unread,
Sep 13, 2012, 5:15:37 PM9/13/12
to uavde...@googlegroups.com
Florin and Peter,
(Just to save Matt some work, Matt I looked at the code, I will try to help Florin.)
I see that Matt has some altitude/speed control code that he developed, but you need to specifically select his code. Otherwise, you get the code that I developed, which you can look at here:
Here is how it works:
For throttle control, there is an error signal that is developed that is equal to the sum of the altitude error plus the equivalent height of the speed error. Normally, this signal will put the throttle to full throttle during a climbout, because both height and speed are below target values.
For pitch control, there is an error signal that is the difference between altitude error minus the speed error.
So, if you set the target speed too high, here is what I would expect would happen: The throttle would go to maximum, but pitch control would direct the plane downward to gain some speed.
So, I mis-spoke in one of my earlier emails to Florin: the controls use both throttle and pitch together to control altitude and speed together. If you specify a reasonable value of target speed, then altitude control will take precedence. But if the speed target is too large, then I would expect the plane to descend until the altitude error was equal to the energy of the speed error.
A numerical example might help.
Suppose you set a target of 100 meters/second for a plane that could only achieve 10 meters/second. The equivalent height of the speed deficit is 495 meters!!!
So, the plane would fly 495 meters below the target height in an effort to gain speed!
Lets take a more reasonable example, where the target speed is closer to what the plane will achieve. Suppose the target is 12 meters/second, and the plane is flying at 10 meters/second. In that case, the height of the energy deficit is only 2.2 meters, so the plane will only drop 2.2 meters in an effort to pick up speed.
So, the bottom line is you must set a reasonable value for the target speed if you wish to use both altitude and speed control, because the controls are based on total energy.
Best regards,
Bill

William Premerlani

unread,
Sep 13, 2012, 7:06:29 PM9/13/12
to uavde...@googlegroups.com
Hi Florin,
A couple more comments on speed/altitude control.
There is a remote possibility that you have someone turned on the speed/altitude controls that Matt designed. I am not sure how you select Matt's controls nor how they work, I will let Matt speak to that.
The controls that I implemented are supposed to work as follows, assuming that you have a reasonable value for target airspeed.
At launch time, altitude control does in fact override speed control, simply due to the fact that the altitude error is much larger than the airspeed error, in terms of energy.
So, during the climbout, the altitude/speed controls will set maximum throttle, and maximum up pitch. The controls were implemented that way so that the plane will do everything that it can to gain altitude.
Then, as it approaches the target altitude, the controls will modulate throttle and pitch to achieve the desired altitude and speed. The altitude at which that begins to happen depends on the speed energy deficit. The larger the deficit, the lower the altitude at which the speed controls begin to kick in.
Normally, if the target speed is anywhere reasonable, the plane will be only a few meters below the target when speed control kicks in.
However, if the target speed is very large, then the plane may be many meters below the target.
But, back to your case. First, I have a question: what was your target airspeed, and how fast was the plane actually flying, according to telemetry? I can better help you figure out what happened if I have that information.
For more information, if you have not already done so, please take a look at the instructions for setting up the altitude/speed control.
Best regards,
Bill


--
--



Crashmatt

unread,
Sep 14, 2012, 4:56:26 PM9/14/12
to uavde...@googlegroups.com
Hi,

My apologies for not being more help.  I am taking some time out from the project for a few weeks.  I predict that normal service will resume in 3-4 weeks.

Regards Matt

Peter Hollands

unread,
Sep 14, 2012, 4:59:37 PM9/14/12
to uavde...@googlegroups.com
Matt,

Thanks very much. Hope to hear from you later in the year.

Best wishes, Pete


--
--
 
 

crashmatt

unread,
Sep 15, 2012, 2:07:18 AM9/15/12
to uavde...@googlegroups.com
a short answer for now..

There are several steps to my alternative airspeed control code.  It takes quite a bit of effort to switch on all the options.  The first two options are:
1. Make height gains variable for mavlink modification of gains.  This also introduces a subtle change in the way that airspeed is chosen.
2. Set gliding airspeed control.  Only operates when throttle is low.  Has no influence on the actual throttle setting.

I would not recommend using #2 unless you are intending to glide which I doubt you are.  The control changes between powered and non powered flight are not so smooth.

The next generation of airspeed control is much smoother but is not in the main repository.  I suspect it will need a winter of testing and modification.

Regards Matt

MIG-29

unread,
Sep 21, 2012, 4:29:40 PM9/21/12
to uavdevboard
Hello,

So the lessons learned are:

1.) never use set speed with a speed outside the plane's flight
envelope: the set speed should well within plane's capabilities.
2.) altitude should be set quite high so it can accomodate the
set_speed behaviour

Thanks!

On Sep 15, 9:07 am, crashmatt <uavflightdirec...@gmail.com> wrote:
> a short answer for now..
>
> There are several steps to my alternative airspeed control code.  It takes
> quite a bit of effort to switch on all the options.  The first two options
> are:
> 1. Make height gains variable for mavlink modification of gains.  This also
> introduces a subtle change in the way that airspeed is chosen.
> 2. Set gliding airspeed control.  Only operates when throttle is low.  Has
> no influence on the actual throttle setting.
>
> I would not recommend using #2 unless you are intending to glide which I
> doubt you are.  The control changes between powered and non powered flight
> are not so smooth.
>
> The next generation of airspeed control is much smoother but is not in the
> main repository.  I suspect it will need a winter of testing and
> modification.
>
> Regards Matt
>
>
>
>
>
>
>
> On Friday, September 14, 2012 10:59:39 PM UTC+2, Pete wrote:
>
> > Matt,
>
> > Thanks very much. Hope to hear from you later in the year.
>
> > Best wishes, Pete
>
> > On Fri, Sep 14, 2012 at 9:56 PM, Crashmatt <crash...@hotmail.com<javascript:>
> >>> look at the instructions for setting up the altitude/speed control<http://gentlenav.googlecode.com/files/AltitudeHoldSetup.pdf>
> >>> .
> >>> Best regards,
> >>> Bill
Reply all
Reply to author
Forward
0 new messages