Romfarer Posted June 21, 2012 Author Share Posted June 21, 2012 tan Pitch = displacement + mass * (1-AtmDensity) / Velocity * sqrt(mass*((VelVert/10)+1)) ???That is my formula for optimal airplane pitch in my auto-altitude system. It works pretty good in practice but i\'m wondering if anyone can help to bring it in line with the classic mechanics of THIS universe? Link to comment Share on other sites More sharing options...
Romfarer Posted June 25, 2012 Author Share Posted June 25, 2012 the project is at a complete standstill :\'(I have become obsessed with calculating the pitch required for leveled flight and i can\'t figure it out. Link to comment Share on other sites More sharing options...
Taverius Posted June 26, 2012 Share Posted June 26, 2012 Because its so hard they don\'t even do it for latest-generation airliners, as I keep telling you - they don\'t put numbers into a formula and get out a pitch number, as that would be pointless since you still need to adjust up/down to chase altitude as weight/speed etc changes, so instead they just flat out chase altitude in the first place A pitch number coming out of a formula will always have a delay, both from the data coming into the formula, and from control adjustments and inertia delaying changes to pitch, and thus altitude would drift according to the tendency of the aircraft to rise or fall in altitude as weight and weight balance and speed changes as the flight progresses. You saw this behaviour in the alpha you gave me.In order to prevent the drift, you have to look at your altitude, your current altitude, your vertical speed and vertical acceleration and chase the target altitude, and adjust continuously to keep yourself at the desired altitude. Since the altitude tends to drift continuously and your changes have a delay, you are never at the ideal pitch angle. To some degree, you are always under-correcting, and your best hope is to be able to keep the dirft - which will be up or down depending on the aircrafts natural drift over time - inside a useful number. Adjusting how fast and hard you react with the weight of the aircraft, as well as altitude and speed, allows you to keep this relatively constant over the flight envelope.Now, in an ideal world with 0 control delay, no inertia and unchanging aircraft weight, once you\'ve achieved perfectly level flight and a perfectly unchanging speed, a pitch number coming out a formula would be of use, but logically, since you had to achieve level flight in the first place for a pitch number from a formula to give you leveled flight, you have already arrived at the right pitch angle, and so that makes it pointless It was an impressive effort, but since you need so so much of a chasing autopilot in order to stay at the desired altitude, there\'s little point to it, and a lot of extra complexity, as you\'ve noticed.Its also not very robust, as changes to the drag, thrust, lift models in the base game or mods to the above would break it horribly. Link to comment Share on other sites More sharing options...
Dred_furst Posted June 26, 2012 Share Posted June 26, 2012 Because its so hard they don\'t even do it for latest-generation airliners, as I keep telling you - they don\'t put numbers into a formula and get out a pitch number, as that would be pointless since you still need to adjust up/down to chase altitude as weight/speed etc changes, so instead they just flat out chase altitude in the first place A pitch number coming out of a formula will always have a delay, both from the data coming into the formula, and from control adjustments and inertia delaying changes to pitch, and thus altitude would drift according to the tendency of the aircraft to rise or fall in altitude as weight and weight balance and speed changes as the flight progresses. You saw this behaviour in the alpha you gave me.In order to prevent the drift, you have to look at your altitude, your current altitude, your vertical speed and vertical acceleration and chase the target altitude, and adjust continuously to keep yourself at the desired altitude. Since the altitude tends to drift continuously and your changes have a delay, you are never at the ideal pitch angle. To some degree, you are always under-correcting, and your best hope is to be able to keep the dirft - which will be up or down depending on the aircrafts natural drift over time - inside a useful number. Adjusting how fast and hard you react with the weight of the aircraft, as well as altitude and speed, allows you to keep this relatively constant over the flight envelope.Now, in an ideal world with 0 control delay, no inertia and unchanging aircraft weight, once you\'ve achieved perfectly level flight and a perfectly unchanging speed, a pitch number coming out a formula would be of use, but logically, since you had to achieve level flight in the first place for a pitch number from a formula to give you leveled flight, you have already arrived at the right pitch angle, and so that makes it pointless It was an impressive effort, but since you need so so much of a chasing autopilot in order to stay at the desired altitude, there\'s little point to it, and a lot of extra complexity, as you\'ve noticed.Its also not very robust, as changes to the drag, thrust, lift models in the base game or mods to the above would break it horribly.basically this, use a PID controller. It will solve most of your issues. Link to comment Share on other sites More sharing options...
Romfarer Posted June 26, 2012 Author Share Posted June 26, 2012 Edit..........deletedEdit.It sucks to program this stuff when i don\'t know all the parameters OR the flight model. Link to comment Share on other sites More sharing options...
Taverius Posted June 26, 2012 Share Posted June 26, 2012 You don\'t need to.You know the weight of the craft, the speed of the craft, air density, velocities, accelerations, and the various angles.You don\'t need anything else, unless you\'re trying to work out the aforementioned ideal pitch angle.Real aircraft APs don\'t know, because you\'d need to run CFD simulations in real time to do so Link to comment Share on other sites More sharing options...
Romfarer Posted June 26, 2012 Author Share Posted June 26, 2012 Its mostly the parameters you mentioned i\'ve been trying to put together in a formula. I want an output that makes a curved approach towards my target altitude and then 'stops' in a position with 0 vertical speed, preferably within a couple % of the target altitude.The problem is:1. To put the atmospheric density into the formula correctly so my plane a. don\'t overshoot b. don\'t get to an altitude with vertical speed 0 but somehow is unable to maintain pitch and DIVE.2. HEAVY airplanes at high altitude...see 1.b.1.b is the BIG problem! Link to comment Share on other sites More sharing options...
Taverius Posted June 26, 2012 Share Posted June 26, 2012 You\'re going about it wrong Its unnecessary to have a separate routine that computes a perfect ascent curve, and an another one that follows it. Once the PIDs that keep altitude are being properly tuned/weighted for atmospheric density and craft mass, that will comes of its own. Not to mention that the best climb rate for an aircraft is at a constant AoA Since once you arrive at target altitude you\'ll have to be constantly adjusting to stay there, don\'t make getting there too complicated. Chase the altitude, try to get there, and if the user input too high a number, well, its a user error, and the plane will eventually achieve equilibrium at a lower altitude. This altitude may be = 0. There may not be enough thrust to climb at the maximum pitch set by the user! Its ok for the plane to crash in this case! Free your mind of the thought of algorithmically arriving at a number that will solver your problems - flight doesn\'t work that way except in the most naive of models.FREE YOUR MIND NEO ??? Link to comment Share on other sites More sharing options...
Romfarer Posted June 26, 2012 Author Share Posted June 26, 2012 You don\'t know what i\'m trying to do. I\'m almost giving up the whole thing. I can\'t put atmospheric density into my most stupid 'equations' so it will never work if i try to put it in a pid controller anyways. i\'ve been adding 'random' numbers into this crap for over a week now i feel like im going insane.... ??? Link to comment Share on other sites More sharing options...
Taverius Posted June 27, 2012 Share Posted June 27, 2012 Then leave the altitude stuff alone for a while and work on something else Link to comment Share on other sites More sharing options...
Romfarer Posted June 27, 2012 Author Share Posted June 27, 2012 I am obsessed! ???Today at work i shot up some rockets to study the composition of the atmosphere. And when i analyzed the data i figured out that the density and pressure follows the following formulas, both with a coefficient of determination: R^2 = 0,9999 so it should be pretty accurate d = 1.2131e^-2E-04ap = 0.986e^2E-04awhere d is density, p is pressure and a is altitude.This was expected, but when i draw the graph for altitude * density i discovered that it peaks at 5km . So i\'m not totally sure about the terminology but it seems to me like the CHANGE in density per altitude is increasing up to 5km and then starts to decline. So if i\'m going to do anything that involves (wanted altitude - current altitude) and density i\'ll have to make a formula for below 5k and one for above 5k. ??? Link to comment Share on other sites More sharing options...
TheCardinal Posted June 27, 2012 Share Posted June 27, 2012 I am obsessed! ???Today at work i shot up some rockets to study the composition of the atmosphere. And when i analyzed the data i figured out that the density and pressure follows the following formulas, both with a coefficient of determination: R^2 = 0,9999 so it should be pretty accurate d = 1.2131e^-2E-04ap = 0.986e^2E-04awhere d is density, p is pressure and a is altitude.This was expected, but when i draw the graph for altitude * density i discovered that it peaks at 5km . So i\'m not totally sure about the terminology but it seems to me like the CHANGE in density per altitude is increasing up to 5km and then starts to decline. So if i\'m going to do anything that involves (wanted altitude - current altitude) and density i\'ll have to make a formula for below 5k and one for above 5k. ???Doesn\'t the temperature play a role as well in the density? Link to comment Share on other sites More sharing options...
Romfarer Posted June 27, 2012 Author Share Posted June 27, 2012 The temperature is constant below 25km. Unless i am reading it wrong.I only measured up to 25km. Link to comment Share on other sites More sharing options...
TheCardinal Posted June 27, 2012 Share Posted June 27, 2012 Strange! I would have expected the temperature to drop rapidly above a certain point causing a rise in density. (I probably compare it too much to earthly conditions). Link to comment Share on other sites More sharing options...
Taverius Posted June 29, 2012 Share Posted June 29, 2012 Something wrong with how you\'re reading the temperature: http://kerbalspaceprogram.com/forum/index.php?topic=14389.0As for the weirdness, that\'s because while the temperature changes follow earth\'s pretty closely, the pressure changes follow a very simple system ... well, read that thread, there\'s SCIENCE in it! Link to comment Share on other sites More sharing options...
Romfarer Posted July 4, 2012 Author Share Posted July 4, 2012 Lazor system. Now in beta!!! ...and animated buttons and stuff Link to comment Share on other sites More sharing options...
Philpax Posted July 5, 2012 Share Posted July 5, 2012 The awesomeness just doesn\'t stop! 8) Link to comment Share on other sites More sharing options...
Romfarer Posted July 5, 2012 Author Share Posted July 5, 2012 Soon with flight-paths and target location markers....Ok, so the green arrow shows where my plane is going and the red dotted line shows the optimal flight path towards my target location which is marked by a red triangle. And the big red cross with the numbers is the target marker.Its possible to do a lot of cool stuff with this 'tech'. Like a global positioning system that can draw locations on the map. OR maybe a system to mark regions on the map, like a colored line along the border of a country. But i have only plans to make the first of those ideas, unless someone has a better idea? Link to comment Share on other sites More sharing options...
Extraneous Posted July 9, 2012 Share Posted July 9, 2012 Liking what you are doing here, Romfarer! Current remote control is great I was just wondering if there was any idea of adding functionality to have a way of using your lasers to remote-control the lasers on another vessel. For example, when using fly-by-laser (as you plan it) you could aim the laser on, say, a scout plane from another ground-based vehicle and let it fly itself. Or, if you add more LOS-based issues, you could use a comsat\'s laser by communicating from another ship in order to see targets that would otherwise be around the Kearth\'s curvature. That would be so sweet! (I forsee a future where I can control by laser all of my flights from a single station in orbit.) Link to comment Share on other sites More sharing options...
Romfarer Posted July 9, 2012 Author Share Posted July 9, 2012 I was just wondering if there was any idea of adding functionality to have a way of using your lasers to remote-control the lasers on another vessel. For example, when using fly-by-laser (as you plan it) you could aim the laser on, say, a scout plane from another ground-based vehicle and let it fly itself. It is possible to add this functionality. However, the main challenge would be to make this system make sense to the user. I can easily pop up the targets whole lazor system and let you change its parameters, but how will you see the effect of what is being done? Likewise i can probably pop up any system on the target vessel, for example mechjeb or the like. Or, if you add more LOS-based issues, you could use a comsat\'s laser by communicating from another ship in order to see targets that would otherwise be around the Kearth\'s curvature. That would be so sweet! (I forsee a future where I can control by laser all of my flights from a single station in orbit.)I do plan to add more LOS to the system, and the case you describe is exactly the reason i haven\'t implemented it yet. Right now the way it is done, you connect to the tracking station at ksp, there is no los for this linkup or what the tracking station can see. Admittedly i am not sure how to design the system, that is i can figure out the technical stuff, but presenting it to the user in a understandable way is the challenge.I appreciate your input Link to comment Share on other sites More sharing options...
Romfarer Posted July 10, 2012 Author Share Posted July 10, 2012 I ran into a really annoying error with KSP. It turns out when you place a gui element behind one of the KSP gui elements, such as the button that opens and closes the navball, then that button is disabled. I wanted to draw all my overlays behind the regular gui\'s but i have to disable the feature because of this stupid bug.Edit: I found a workaround, the overlays will now draw behind my own gui, and clutter the ksp gui with a lot of lovely arrows, circles, target indicators and stuff Link to comment Share on other sites More sharing options...
Romfarer Posted July 13, 2012 Author Share Posted July 13, 2012 I\'ve been making a positioning system that comes with any configuration of lazor system. So if you find any interesting places, in next version of lazor system you will be able to mark them on your map. It will work on Kerbin, the Mun and Minmus....Do you approve of this??? Link to comment Share on other sites More sharing options...
TheCardinal Posted July 13, 2012 Share Posted July 13, 2012 Certainly! It would make the lasersystem even more éssential. Link to comment Share on other sites More sharing options...
skroid101 Posted July 14, 2012 Share Posted July 14, 2012 this mod looks amazing! But when I try and install the .dll I had access to the parts (instead of saying not available) but I have no idea how you open the GUI so could you post some keybindings and also what I\'ve been doing wrong Link to comment Share on other sites More sharing options...
dr.phees Posted July 14, 2012 Share Posted July 14, 2012 I love the Lazor System!I have three Lazor Fortresses, orbiting all three Planetary bodies (not the sun, though).Just a few thoughts:1) Small unobstrusive, unanimated button (like MechJeb\'s side-button)?I would prefer that to the huge Lazor Button.2) Shift the blue Lazor\'s color a bit to turquoiseIt would be better visible.3) Is there a way to check if Lazor UI is behind the top height and vertical speed gauge?Lazor UI is often hidden behind it and I would prefer it to be in front of it.4) Maybe a bit more fancy Color thingy.It could sparkle when turned on like the MechJeb modules?Everything else is cool, even though I cannot make my lazors lock permanently to a target.Brilliant plugin, thanks a lot. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now