Noiredd / PEGAS

Powered Explicit Guidance Ascent System - a KSP & RO autopilot using the Space Shuttle guidance algorithm, UPFG
http://forum.kerbalspaceprogram.com/index.php?/topic/142213-pegas-powered-explicit-guidance-ascent-system-devlog
MIT License
114 stars 31 forks source link

some problems #25

Closed GYskyfall closed 6 years ago

GYskyfall commented 6 years ago

In the negative guidance program, the spacecraft will keep the attack angle zero. However, when I was running the program, the angle of the spacecraft pitch over too fast and pitch over about 90 degrees at the altitude of 20km. would you like to tell me how to fix it?

GYskyfall commented 6 years ago

i think i had fixed the problem. it may be related to speed and altitude. i think it's better to use the MJ's algorithm in nagetive guidance.

Noiredd commented 6 years ago

Would you mind giving some details about the craft that you're using? For each stage, what is the initial TWR, burn time, Isp? When do you engage the UPFG phase and what is the velocity and altitude at that point?

You have to know that much of the algorithm's performance depends on the settings, sometimes it is difficult to pick them right.

GYskyfall commented 6 years ago

My problem is during the negative guidance.After the rocket took off, if the speed and altitude do not reach a certain value and they pitch, the rocket will reduce the pitch angle to 0 too quickly, causing the launch to fail.At the beginning I didn't realize this, I was pitched too early, and it led to failure.This should be the result of keeping the attack angle at zero at negative guidance.

Maybe you can use the Mechjeb2 model during negative guidance.

GYskyfall commented 6 years ago

Another problems

1.Pegas will not work properly,If you switch to another spacecraft while using Pegas. For example, if you want to reclaim the first stage booster, after switching to the first stage booster, the second stagel will not be able to work properly. Pegas will report an error and cannot read the parameters properly.

2.It is difficult to hit the GTO orbit with pegas, and pegas does not support second stage multiple ignition. That is important for missions.

Noiredd commented 6 years ago

Yeah you're observing the typical behavior of UPFG - if the passive part of the ascent isn't tuned well, the active guidance will go haywire. Sorry about that, there's little I can do about it at the moment. Would need a more complex atmospheric ascent guidance and unfortunately I don't have the time to develop it.

Regarding your other problems: I didn't know about number 1, as I've never tried to do something like this. It is definitely worth looking deeper into this. As for point 2, this is a known feature request - see #8.

Patrykz94 commented 6 years ago

I'm pretty sure that number 1 is more of a KSP/kOS limitation rather than an issue with PEGAS.

For example, you can only use the STAGE. command on an active vessel, otherwise kOS will return an error. Another thing is that once an inactive vessel goes outside of the physics range ~20km away your active vessel, KSP will unload it and put it "on-rails" meaning kOS can no longer control it.

To go around this, if you want to reclaim the first stage, you could use the FMRS mod (Flight Manager for Reuseable Stages) which creates a save point whenever you stage. So you can finish the PEGAS mission as normal, then go back in time to moment of stage separation using FMRS, do what you need to do with the first stage and then come back to the main mission with upper stage.

GYskyfall commented 6 years ago

Maybe considering writing reentry procedures, or perfecting pegas for interstellar launches with gravity assitance,is another direction of development.

Here is the link of programs about flyby: 1, 2.

Here is the link of programs about the mod aims to replace KSP's unstable physics integration with a higher-order symplectic integrator, adding n-body Newtonian gravitation in the process - Principia.

Noiredd commented 6 years ago

@Patrykz94 You're probably right, I wouldn't know since - as I've said - I've never fiddled around with multiple craft at the same time. It would be pretty exciting to fully automate a launch & booster landing mission, but I simply do not have that amount of time to dedicate to developing something of such scale.

@GYskyfall Interplanetary launches are beyond the scope of PEGAS and will never be implemented - I gave a detailed explanation under #11, but a tl;dr is that PEGAS is a guidance tool and not a mission planner. If anything, there would have to be a separate tool for planning, integrated with PEGAS to do the guidance work. I would cooperate with someone willing to code such a thing and provide all the help I could to make PEGAS compatible with it, but definitely would not do it myself.
As for reentry guidance, this is a whole another can of worms, with its own methods and algorithms. A matter of several weeks/months of research, development and tests. Maybe some day ;)

@GYskyfall I would like to give this issue some status - either there's something I could help you with or should we close it as resolved (since I've answered your original question)?