Jump to content

[0.90] Lazor System v35 (Dec 17)


Romfarer

Recommended Posts

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

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

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

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

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

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! :D

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

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

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

d = 1.2131e^-2E-04a

p = 0.986e^2E-04a

where 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 :o. 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

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

d = 1.2131e^-2E-04a

p = 0.986e^2E-04a

where 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 :o. 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

screenshot151m.png

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

Liking what you are doing here, Romfarer! Current remote control is great :D

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

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

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 :P

Link to comment
Share on other sites

screenshot152a.png

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

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

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 turquoise

It 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

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...