MechJeb2

MechJeb2

4M Downloads

Orbit inclination discrepancy (Ascent Guidance)

polyath3911 opened this issue ยท 6 comments

commented

Hello devs,

I have been using MechJeb 2 quite frequently as of late to get my rockets into orbit. I have noticed, however, that it is not launching them into the desired inclination unless corrective steering is activated (see picture below for an example). This unfortunately is not feasible for the larger behemoths since they tend to be unstable by nature.

inclination_discrepancy

After going about it a little while, I noticed that MechJeb is calculating the inertial launch azimuth and not taking into consideration the body's rotation. The rotation effect is more pronounced for fast rotating bodies such as Kerbin and increases the discrepancy as the inclination is increased.

The good news is that calculating the azimuth corrected for rotation is actually quite simple and boils down to a quick vector subtraction and an inverse tangent calculation. I am attaching a screenshot that quickly goes over the math required.

corrected_launch_azimuth2

corrected_launch_azimuth

I assume this a quick fix to the code and easy to implement. The same procedure applies for launches that occur at the descending node. Hope this information helps. Thanks for providing us such an awesome flight and navigation tool!

commented

Indeed, with the full math and explanation it should be a quick fix. I will have a look when my jet lag is gone :)

commented

If only all issues could include the problem, the solution and the maths behind it!

enthusiasm

commented

Now implemented. The result is not perfect but the error is lower.
The error gets lower as the vessel burn longer before the Ap reach the desired value.

commented

If forgot to add the body radius when computing the orbital vel...
Fixed

commented

Hi sarbian,

Thanks for taking the time to implement this in Mechjeb. I went ahead and downloaded the latest dev version (#528) and tested the ascent guidance without the corrective steering.

A quick calculation with the above formulae shows that the corrected launch azimuth for a 45 deg inclined 80 km circular orbit should be 41.7 deg from true north. I am noticing, however, that the autopilot is launching the rocket at 44 degrees from true north.

Could you confirm that this is indeed true on your end?

Thanks,
polyath

commented

These are the numbers I got from my spreadsheet:

T_kerbin = 21599.912 s
lat_LS = -0.096944444 deg
u_kerbin = 3531.6 km^3/s^2
h_orbit = 80 km
r_kerbin = 600 km
inc = 45 deg

omega_k = 0.000290889 rad/s
beta_fixed = 45.00008202 deg
vel_LS = 0.174533386 km/s

v_rotx = 1.436916936 km/s
v_roty = 1.611445709 km/s

beta_LS = 41.7232057 deg