Powered Explicit Guidance: Should rocket be pitching down at orbital insertion?

I simulated an orbital insertion using Powered Explicit Guidance as used in the space shuttle.

The PEG algorithm works great. I hit all my targets: altitude, velocity, orbital inclination, longitude of ascending node.

But the algorithm does something I didn't expect: it causes the rocket to pitch down by >10 deg beginning maybe 30 seconds before orbital insertion (depending on altitude target, but generally a few tens of seconds).

Again, all my targets are hit. And if I try to stop the rocket from pitching down when it does, then I miss my targets. So the algorithm is clearly detecting that the rocket has to pitch down. It's doing its job, sort of.

But should the rocket be pitching down like this at orbital insertion? I thought it would be pointing at the horizon at the very end, but... no?

Just wondering if this is normal or (as I suspect) if I need to figure out what's wrong with the PEG algorithm (despite it working flawlessly otherwise, because it always always hits my targets, even when I change them mid-simulation).

Thanks!

• I would have thought it’d be something about the TWR in your simulation- maybe it was too great and the downwards pitch was to counteract any vertical speed the stage still had. Mar 12 '21 at 0:29
• Thanks Reuben! Sorry but what do you mean by TWR? I do have a sizable vertical rate late in the launch and my first guess was that the algorithm was not properly estimating the altitude left to go—maybe because my effective gravity calculation was wrong—but everything I’ve tried to correct this has failed... the rocket might pitch down less but it still pitches down (or worse it stops working entirely)...
– user39728
Mar 12 '21 at 0:55
• I believe downward pitch at the end of an insertion isn't unusual -- I'll try and find real-world examples. It might indicate that the acceleration curve of the launcher isn't optimal (but that PEG is doing the best it can with what it's got) but I'm not sure. Mar 12 '21 at 0:57
• @user39728 twr refers to thrust to weight, which relates to the acceleration curve, as mentioned by russel Mar 12 '21 at 1:02
• The pitch-down seems less severe if I raise my target altitude from the 225km I have now to 300 km, say... but even then, there is pitch down. Plus I can tell that at 225 km target, the rocket could well hit its targets without any pitch down. It’s just as if the algorithm is incorrectly estimating factoring in the altitude left to go or maybe the rate at which it’s getting there or both. But nothing I’ve tried to fix that has worked...
– user39728
Mar 12 '21 at 1:04

This seems like a "SpaceX" style version of orbiting, a mirror image of how they land. Orbiting involves reaching a certain amount of tangential velocity at a certain altitude. Gravity does the rest.

Logically, one would not carry extra fuel (weight) to oppose gravity, indeed, night time lapse photography shows orbital launches as gentle "up and over" curves.

There may be a fuel savings by overshooting, then correcting, vertical velocity, perhaps by shortening burn time. It could be applied to a rocket that needs more horizontal velocity component but needs to decelerate its vertical velocity component.

It is logical, but sort of funny, the a higher orbit "remedies" pitch down, but only because orbital velocity is less and orbital radius of turn is greater! Computers are "dumb" this way.

Rather than just following the programming, one may go back 50 years, when "algorithm" meant talking through it before translating to computer language. Most rockets are "staged", with the final "push" much less than launch thrust.

Lacking air drag at altitude, a longer burn with less thrust may require less pitch correction, but may use more fuel.

• It's an interesting point; one possible theoretical (but not very practical) powered trajectory to orbit is simply the time-reverse of a reentry; with instantaneous drag converted to instantaneous thrust.
– uhoh
Mar 12 '21 at 10:47