General Question Autopilot Misalignment

othoudt

New member
Joined
Sep 8, 2009
Messages
50
Reaction score
0
Points
0
Location
Naples
I have noticed a couple of problems (?) with the Pro-grade, Retrograde, Orbit Normal and Orbit Anti-Normal (attitude hold) autopilots:

Pro-grade autopilot is misaligned by about 0.2 degrees starboard yaw to the pro-grade indicator. Which one is incorrect, the autopilot or the pro-grade circle with the cross inside? I know it's a small amount but little things add up over long times and distances.

The Orbit Normal and Anti-Normal autopilots are also off a small amount but a bigger problem occurs when thrust is applied; the autopilot is unable to hold the correct attitude beyond a certain level of thrust. I also see my periapsis and apoapsis altitudes vary during the time thrust is applied but I think I can see how changing planes would add or subtract from the orbital velocity componant and only by hand-flying the ship can I keep that to a minimum in lieu of a much more complex autopilot.
 
Pro-grade autopilot is misaligned by about 0.2 degrees starboard yaw to the pro-grade indicator. Which one is incorrect, the autopilot or the pro-grade circle with the cross inside? I know it's a small amount but little things add up over long times and distances.

Prograde indicator in Surface HUD or Orbit HUD? Surface HUD uses the rotating surface of the planet as reference, Orbit HUD and the autopilots uses the non-rotating center of the planet as reference.
 
I have noted this misalignment in all vessels in the orbit HUD. Is it just my computer displaying this wrong?
 
Last edited:
I have noted this misalignment in all vessels in the orbit HUD. Is it just my computer displaying this wrong?

Have you been waiting long enough for the ship to drift there? The AP takes some time.

Is there a difference when switching to the glass cockpit?
 
i noticed this, it happens if you use a low FOV
 
It is a real offset, I have noticed in Attitude MFD testing. My standard test scenario is the stock "DG Mk4 in orbit" and it consistently shows a 0.2 - 0.3° error for the prograde autopilot. I don't have time right now but I'll come back and post some screenies later.
 
i have also noted this. i always though it was just the autopilot being inaccurate, just like after you turn it off and go to 100x ur ship still spins
 
At 100x time acceleration any tiny residual angular velocity will appear as 100 times higher than it really is, which is why your ship may appear to "spin rapidly" at 100x even though it's actually spinning very slowly in real time. It is virtually impossible for an autopilot to completely kill all angular velocity unless it would "cheat" and kill all the angular velocity via an Orbiter core call (which I believe is how the "Absolute Killrot" add-on does it) rather than just using thrusters. Since thrusters can only be adjusted once per timestep, the higher your framerate the more accurate your autopilots will be.
 
I have noticed something similar when doing a large orbital plane change burns the orbitnoemal and antinormal autopilots don`t align the ship precisely and as a result there is an increase or decrease in orbital velocity and altitude.
 
I have noticed something similar when doing a large orbital plane change burns the orbitnoemal and antinormal autopilots don`t align the ship precisely and as a result there is an increase or decrease in orbital velocity and altitude.
I've found that the Normal/Anti-normal autopilots are pretty good (<0.03° offset).

Here are the prograde offsets I was talking about earlier:

Using the Orbiter autopilot:
picture.php


Using Attitude MFD:
picture.php
 
...and that's why we use Attitude MFD.
 
ok well that explains why the autopilots arnt perfect. but im still wondering about the offset

The offset is all due to the same same thing: the small delta is just a matter of the prograde/retrograde autopilot continuously "chasing" the velocity vector trying to keep the ship's nose perfectly aligned as you orbit (even normal/anti-normal will require constant minute adjustments). Since the autopilots do not "cheat", they must constantly make minute adjustments each frame by adjusting the thrusters. This is not as easy as it sounds -- if the autopilot is too "aggressive" (i.e., by using higher thrust) to try and hold a yaw of zero, it will be inefficient because (depending on the framerate) the ship would often "overshoot" the target yaw rate by a small amount and then have to fire thrusters in the reverse direction. An inefficient autopilot would be particularly noticeable at lower framerates -- it would burn a relatively large amount of fuel.

Continuing...remember that when you are in orbit you will constantly need a tiny amount of yaw to keep the ship aligned with the velocity vector as you orbit the planet. So the trick, then, is to have an efficient autopilot that still manages to keep you very close to your target yaw rate even at low framerates. That is not particularly easy to do, especially under time acceleration where the effective framerate is reduced. For example, suppose you get 60 fps at 1x speed. At 10x speed the autopilots will still get invoked every frame (60 times a second), but each frame the ship has moved 10x the distance it normally would, and so any thruster levels applied by the autopilot during the previous frame would burn 10x as long from a simulation time standpoint (which is all that counts here). So the effective framerate in that case is 60/10 = 6 frames per second. This is why autopilots have more trouble holding attitude under time acceleration.

So to sum up, the small delta between the velocity vector and the ship's nose is not a "bug" -- it is a result of the autopilots trying to be efficient but yet still be precise. It's a lot of work to tune an autopilot to be good at holding attitude even at low framerates (e.g., under time acceleration) and yet still be very efficient so it doesn't waste propellant.

Of course, in theory an autopilot could "cheat" and just manually set the ship's velocity parameters via an Orbiter core call instead of manipulating thrusters, but what self-respecting autopilot would want to do that? :)
 
The offset is all due to the same same thing: the small delta is just a matter of the prograde/retrograde autopilot continuously "chasing" the velocity vector trying to keep the ship's nose perfectly aligned as you orbit (even normal/anti-normal will require constant minute adjustments).

That's true, but I wonder if that's the cause of this issue in particular. Here's a screenshot from the DG Mk4 in orbit with the Prograde autopilot on and at 10 degrees FOV. Shouldn't it be constantly moving slightly around the prograde vector?

2qd61bs.png


It just constantly stays pointed in that direction, offset from, but not moving at all relative to the actual prograde velocity vector.

Edit: I see abouve that Attitude MFD doesn't have this problem, I wonder what it does different. Maybe some of it's code could be integrated into Orbiter 2009?
 
Last edited:
Shouldn't it be constantly moving slightly around the prograde vector?

Actually, no, it's good that the ship's nose is not constantly overshooting the velocity vector -- that would be quite inefficient. Maybe "chasing" was the wrong word -- perhaps "lagging" describes it better. When the ship is in orbit the autopilot is constantly "lagging" the velocity vector since the velocity vector is constantly moving as you orbit the planet. In other words, the ship's nose "lags behind" slightly because the velocity vector is constantly moving away from where the ship's nose is currently pointed. By not "overshooting" all the time, the autopilot is being efficient -- i.e., it is using lower thruster levels as it approaches the velocity vector, so it never completely "catches up". This maximizes efficiency (particularly at low frame rates) while sacrificing a small amount of accuracy. The XRs' Attitude Hold autopilot behaves similarly, particularly during reentry -- you will always see a small delta from the target attitude because the autopilot keeps reducing thrust as the ship approaches its target attitude, which 1) maximizes efficiency, and 2) significantly increases stability (and therefore, efficiency) under time acceleration. I can't speak for how the internal Orbiter autopilot is coded, but I suspect it does something similar.

Edit: I see abouve that Attitude MFD doesn't have this problem, I wonder what it does different. Maybe some of it's code could be integrated into Orbiter 2009?

Either it is a) tuned to be more aggressive (which is still OK provided the framerate doesn't drop too low), b) it is simply tuned "better" (i.e., it has a better thruster level algorithm) than the internal Orbiter autopilots, or c) it is "cheating" and setting attitude without using thrusters. :) In any case, it's a nice piece of software. :thumbup:
 
Ok, you're right, that explains it. I just tested it by making a clean install of Orbier and deleting all planets and moons except Earth, setting the sun's mass to 1kg, and the Earth's mass to 1e20kg. I used the same scenario (after removing all vessels except the DG in Earth orbit) and set my orbital speed to 0 in scenario editor, then established a circular orbit, which had a speed of 32 m/s. I turned on the prograde autopilot and it stayed almost perfectly on the prograde vector even at a 10 degree FOV.
 
Either it is a) tuned to be more aggressive (which is still OK provided the framerate doesn't drop too low), b) it is simply tuned "better" (i.e., it has a better thruster level algorithm) than the internal Orbiter autopilots, or c) it is "cheating" and setting attitude without using thrusters. :) In any case, it's a nice piece of software. :thumbup:
a) and b), but definitely not c) ;)

In relation to a), the autopilot deadbands and thrust curves are adjusted depending on both the time acceleration and framerate. It gives good stable control in the stock scenario at up to, and including, 1000x (~50 fps). The stock autopilot is loses control above 100x in the same scenario.

In relation to b), the tuning is optimised in the rotating reference frame modes (velocity and target) for situations where the angular velocity of the reference frame is constant. Generally that is a pretty fair approximation since the angular velocity typically changes very little between time steps.
 
I've found that the Normal/Anti-normal autopilots are pretty good (<0.03° offset).

It looks like preciseness of normal and antinormal autopilots depends of how much acceleration the vessel is capable off. I tried with various vessels and those with normal acceleration of 1 - 3 G were following the autopilot rather precisely vith very little increase or decrease of orbital velocity while vessels capable of very high acceleration dozens of of G`s and more like various sci-fi spacecraft caused much bigger increase or decrease of orbital velocity when doing large plane changes.
 
[...]vessels capable of very high acceleration dozens of of G`s and more like various sci-fi spacecraft caused much bigger increase or decrease of orbital velocity when doing large plane changes.
When doing a plane change, such vessels would change the direction of the velocity vector relatively quickly, making the autopilots job much harder.
 
Back
Top