@Gozinya Drag would be a big factor for reentry if I were not in control. But I can change the rocket's angle of attack to steer. Even though there are no fins, the rocket body itself creates some lift forces. So heading and pitch angle will still have an effect in changing the trajectory in the atmosphere. I do a 0 degree pitch (flat horizontal) to go further, and pull up (vertical) to pump the brakes to slow down faster. There is also very slight amount of steering control by angling the rocket left and right. You can see near the end of the video how the rocket is changing attitudes to steer the prograde vector onto the pad. I am still improving that control algorithm.
The Eccentricity vector points from the focus of the orbit to the periapsis. In a suborbital flight, you can imagine most of the orbit as being underground. The periapsis will have a small radius, deep inside of the planet.
Since the Eccentricity vector and a PCI positon vector share the same origin at the center of the planet, we can find the angle between them to obtain the true anomaly.
The angle between the eccentricity vector and our current position is the true anomaly.
The angle between the eccentricity vector and the target is the target anomaly.
We can calculate the radius at a specific position in a orbit just by knowing the basic Keplerian orbital elements such as the true anomaly, semi-latus rectum and eccentricity vector. Plug those into the trajectory equation to find the radius of the orbit from the center of the planet at a specific true anomaly.
This means we can plug in the target anomaly into the equation to calculate the radius at that position. Since the orbit is probably not intercepting the target position yet, the radius will likely be smaller than the radius of the planet.
What we want to do is make the orbit's radius at the target anomaly equal to the planet's radius. So what my program does is burn towards the target location until the radius of the orbit at the target anomaly is equal to the planet's radius. When the radius is below the planet's surface, it has to make the orbit bigger. If the radius is above the planet's surface, it has to make the orbit smaller. When it is right on ground level, the orbit will be intercepting the target.
But there is a problem we have not accounted for yet, planet rotation. Droo takes 50,400 seconds to do one rotation. So we just have to rotate the target's position vector around the planet's axis of rotation by the amount of time it will take us to get there. The number degrees to rotate the target position vector is calculated by finding time to impact multiplied by 360 divided by 50,400.
The time to impact is calculated by finding the time between 2 positions of an orbit. Its very easy to calculate, but requires converting the true anomaly into a mean anomaly first. Convert the true anomaly and ground anomaly to the mean anomaly and subtract the first from the second.
The ground anomaly is derived by rearranging the trajectory equation to find the true anomaly given the radius, which will be set to the planet's radius. The ground anomaly is the angle where my current orbit will intersect the ground. It is only needed to calculate the time to impact.
You need to define what B is pointing at first.
@NebulaX Most of the time is spent casting rays to find the surface normals for shading. the colors are faster to get.
Needs some walking animation. no wheels
The rocket program has been released
@Rizkyman There is no PID in the program.
@Chtite451SR2 It will be part of my next navigation program release. But its not quite ready yet.
@sflanker How do you do the custom format with ##. I tried it but did not get any extra zeroes in front of my number.
Nevermind, I reread more carefully and used zeroes instead and it worked.
Can you use the Multi-function Display as a UI element instead of just for internal view?
I'm currently working on a v2 of the hover program. I simplified the logic. Now I get the steering angle from subtracting the prograde vector to the home direction vector directly and convert the result to a heading. This results in a much smoother turn.
The old way was converting all of the vectors to headings first and then using if statements to figure out angles between then to choose which way the rocket should point. It ended up producing some hard changes as it crosses the thresholds.
Its still WIP. I'm refining some other parts of the program as well.
My gravity turn is set to prograde the entire time after the initial tilt shortly after launch. I control my ascent entirely with throttle. I set throttle to a value to keep time to apo at a constant 55 seconds away until my Apoapsis reaches the desired altitude. At that point, its safe to stop engines and plan a circularization burn.
The efficiency depends on the initial tilt angle. Too much tilt will causes extra aero drag at best and not having the TWR raise the apo at worst, Not enough tilt will cause too much gravity drag. I set up a vizzy program that will control all of this and I can set different tilt angles to run trials and see which tilt gets into orbit with the least amount of dV used.
@crowxe You will reach zero degrees when you reach apoapsis.