Formula to get required vertical acceleration for landing

Topper

Addon Developer
Addon Developer
Donator
Joined
Mar 28, 2008
Messages
666
Reaction score
20
Points
33
I've got this method in my code to get the reqired vertical acceleration for landing for my baseland autopilot, but I can't remember what k1 and k2 are...?
Are this values good? The code is working well, but I'm not sure how i came to this values and this formular... :-(
I hope it's possible to understand the code...

"interceptAlt" is the minimum altitude between ship and ground.

Getting "HorizontalSpeed" looks like this:

v->GetHorizonAirspeedVector(horizonAirspeedVector)
HorizontalSpeed = sqrt((horizonAirspeedVector.x*horizonAirspeedVector.x) + (horizonAirspeedVector.z * horizonAirspeedVector.z))

Code:
double autopilot::getRequiredVerticalAcceleration(double interceptAlt)    //VERTICAL ACCELERATION PROGRAMM
{
    double t = (distanceToMaxElevation * 2) / (HorizontalSpeed);  // Time to the point with maximum elevation angle
    double k1 = 0.75;
    double k2 = -8;
    double dh = v->GetAltitude(AltitudeMode::ALTMODE_MEANRAD) - maxElevation; //Current delta between altitude and maximum elevation
    return  k2 * (k1 * t * horizonAirspeedVector.y - interceptAlt + dh) / (t*t);
}
 
Last edited:

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
37,617
Reaction score
2,337
Points
203
Location
Wolfsburg
Preferred Pronouns
Sire
You mean form "Formular DIN 13312-X20 Antrag auf Bewilligung einer amtlichen Auskunft auf Geschwindigkeitsskalare entlang der lokalen Vertikalen (SI)"? :hmm:



Actually, its just some sort of PI guidance with two suitably chosen arbitrary constants.

k1 is used to scale the distance travelled at the current velocity.
k2 is used to scale the acceleration needed for slowing down.
 

Topper

Addon Developer
Addon Developer
Donator
Joined
Mar 28, 2008
Messages
666
Reaction score
20
Points
33
You mean form "Formular DIN 13312-X20 Antrag auf Bewilligung einer amtlichen Auskunft auf Geschwindigkeitsskalare entlang der lokalen Vertikalen (SI)"? :hmm:



Actually, its just some sort of PI guidance with two suitably chosen arbitrary constants.

k1 is used to scale the distance travelled at the current velocity.
k2 is used to scale the acceleration needed for slowing down.
:rofl:
And are this values good? How can I optimize them? Just by "Try and error"? I gues they are depending on the gravity force, the maximum hover engine acceleration and on the maximum angular acceleration of the ship... (= the ability to change the vertical acceleration) but I don't know how... Maybe it's to complate to optimize it and I let it as it is...
 
Last edited:

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
37,617
Reaction score
2,337
Points
203
Location
Wolfsburg
Preferred Pronouns
Sire
They look good enough to work. Of course, there could be some clean up or switching to a better algorithm.
 
Top