PapaJoesSoup / BDArmory

Gun turrets and other weapon systems for KSP
114 stars 57 forks source link

Low TWR AI pilot #105

Open FourLeopard opened 7 years ago

FourLeopard commented 7 years ago

The AI pilot seems to not be able to get low power planes (think WW1 biplanes) to their default altitude and just gets stuck going up and down in an orbit when they reach their minimal altitude and not being able to climb. It looks like the AI pilot doesn't want to dip below around 55m/s when climbing and just keeps dipping down to gain speed so it cant climb. Mods are BDArmoury Continued, Aviator Arsenal and Airplane plus. Strangely I remember the same plane working in a previous version...

TheDestroyer111 commented 7 years ago

@FourLeopard this sounds like you used the default settings of the AI pilot module, which is, by default, configured for modern high-TWR jet fighters, NOT slow and low-TWR WW1 propeller biplanes. You can right click the AI pilot part and adjust the sliders to make it able to fly almost any imaginable plane.

gomker commented 7 years ago

As pointed out the the AI settings will need customization. Here are some notes from the original Author on how this works

Steer factor is the amount it steers depending on the magnitude of the error.
So say a desired destination A is 10 degrees above the plane, and B is 30 degrees up.
With a low steer factor, it might do a 50% pull to steer to A, and a 100% pull to reach B (then decrease to 50% by the time B is only 10 degrees up).
With a high steer factor, it might do a 100% pull already to get to A.
Pulling hard when its not that far off might mean overshooting because you're building up angular momentum.

That's where damping comes in, as it applies steering to counteract angular momentum. 
So you want to tweak and balance both steer factor and damping until you get the results you want.
It's kind of like a spring and damper system, where steer factor is the spring constant.

Also checkout the KSPedia in game , it has detailed instructions on how to configure as well.

gomker commented 7 years ago

As noted the AI will need tweaking to suit your planes configuraiton. Here are some notes on how this functions from the original author of the mod

Steer factor is the amount it steers depending on the magnitude of the error.
So say a desired destination A is 10 degrees above the plane, and B is 30 degrees up.
With a low steer factor, it might do a 50% pull to steer to A, and a 100% pull to reach B (then decrease to 50% by the time B is only 10 degrees up).
With a high steer factor, it might do a 100% pull already to get to A.
Pulling hard when its not that far off might mean overshooting because you're building up angular momentum.

That's where damping comes in, as it applies steering to counteract angular momentum. 
So you want to tweak and balance both steer factor and damping until you get the results you want.
It's kind of like a spring and damper system, where steer factor is the spring constant.

You can also checkout the KSPedia in game for instructions on configuration

FourLeopard commented 7 years ago

What is the Pitch Ki used for?

Edit: I can confirm that editing all the AI settings wont do anything, I dont think the AI pilot starts climbing if its below 55 m/s (I have my min combat speed 20 so its not that). I just stops climbing when it reaches its minimum altitude and starts doing turns and keeping the same Altitude.

DoctorDavinci commented 7 years ago

Pitch Ki essentially controls your trim ... it is a feedback loop system that makes adjustments to your lift profile in realtime so as to assist with the stability in flight

Look up PID controller

TheDestroyer111 commented 7 years ago

Edit: I can confirm that editing all the AI settings wont do anything, I dont think the AI pilot starts climbing if its below 55 m/s (I have my min combat speed 20 so its not that). I just stops climbing when it reaches its minimum altitude and starts doing turns and keeping the same Altitude.

If you can confirm that, then it is a BUG.

FourLeopard commented 7 years ago

Here is the video: https://www.youtube.com/watch?v=hNT3qbEN2_8 (Make sure to watch in 1080p and full screen so you can see how minimum altitude affects the plane)

Craft: K-8A Spud test.zip (mods needed airplane plus, aviator arsenal and bdarmory)

Log: output_log.zip

Zarbizaure commented 3 years ago

Hey, any updates on this ? I have the same issue with a similar WWI plane, with a top speed of about 55m/s. In a manual flight it is totally able to pitch up at about 40° but with this issue it takes forever to reach 500m since it nevers pulls up.