BrettRyland / BDArmory

Gun turrets and other weapon systems for KSP
34 stars 23 forks source link

Small lockedSensorFOV IR Missile can't hit target correctly #626

Closed F8fate closed 3 months ago

F8fate commented 4 months ago

Describe the bug When you use a small FOV(such as lockedSensorFOV = 2.5) IR missile to shoot at a target,The IR missile will sharp turn in a different direction before hitting the target causing the IR missile to miss the target.

To Reproduce Let's take the BDArmory built-in Sidewinder missile(AIM-9) as an example 1.Modify the BDA Sidewinder missile cfg file,change lockedSensorFOV lockedSensorFOV = 6→2.5 or lower

2.reduce the BDA Sidewinder missile thrust(the BDA Sidewinder power is too strong,The purpose of this step is to prevent the missile from hit the target due to excessive speed before hitting, resulting in a rapid turn and still relying on inertia to collide with the target) thrust = 22 → 10.8 cruiseThrust = 12 → 0 boostTime = 3.5 → 5.3 cruiseTime = 30 → 0

3.Enhance the BDA Sidewinder missile maneuverability to better reproduce problems,Simultaneously modify the optimumAirspeed speed to adapt to the modified thrust. steerMult = 4 → 2 optimumAirspeed = 894 → 100

4.Open KSP,Use the modified BDA Sidewinder Missile Lock hostile and fire the missile.

Expected behaviour The missile will make a sharp turn in another direction just before hitting the target,causing the missile to miss the target.

Logs Please attach your <KSP Directory>/KSP.log file. KSP.log

Screenshots This reproduce is not easy to take screenshots,so i will provide the video link https://youtu.be/0GJWio5nSy8

Additional context lockedSensorFOV = 2.5 just is a example,In fact, they will also appear on small lockedSensorFOV missiles slightly higher than this FOV(such as lockedSensorFOV = 3.6),The better the maneuverability of IR missiles, the more obvious this issue becomes.I also found that setting the IR missile lockedSensorFOV = 0.1 would Missing the target as soon as it maneuvers when missile fire.

BillNyeTheIE commented 4 months ago

Please turn on the debug options when reproducing the bug, specifically the Missile debug option. Having the Telemetry debug option while you record the video would help as well. At a guess this is likely due to the missile looking in the wrong spot for the target at close range, the small FOV means the missile then can't find the target in its scan area and drops the lock. One thing you could try using is pronav guidance instead of aam, this would result in a lower g terminal maneuver which could potentially reduce the miss factor in terms of where the missile is looking. Additionally, this would help ensure the target is hit even if the lock is dropped.

F8fate commented 4 months ago

@BillNyeTheIE OK,I turn on the MSL DEBUG option to publish a new video https://youtu.be/8yJ0UzPw4sQ I enlarged the Debug frame to see it clearer

BillNyeTheIE commented 4 months ago

I'll look into it, for now I would recommend swapping to pronav like I said. Additionally, I'd reduce the detonation range of the missiles, that's what's causing the miss in the 2nd case as the AIM-9 config uses a continuous rod warhead which doesn't do that much damage in front and behind the missile.

F8fate commented 4 months ago

@BillNyeTheIE I found that the Debug lines mode in the Debug can view the tracking status of the Missile seeker,I didn't know about this before.Now I have recorded a new video, which allows to see the track of IR missile seeker more clearly.Perhaps this can better help you identify problems

https://youtu.be/UZROClof7tE

I notice that the seeker froze(or drop lock?) and led the Missile in the wrong direction before the Missile direct hit.The aam guidance mode operates very well,however,no matter how excellent the guidance mode is, it is ineffective when the Missile seeker is frozen(or drop lock),especially for aircraft

PS:I love debug lines mode,which reminds me of Tacview.

BillNyeTheIE commented 4 months ago

Yeah, the lock dropping seems to be the main issue, and that's probably just from how high the angular rates are changing at close range. The seeker predicts where the target will be at the next timestep and looks for the target there. When the seeker FOV is low, if the target is not exactly where the prediction says it will be, the seeker will lose sight of the target as its margin of error is low and thus the lock gets dropped. I think the solution will just require increasing the seeker FOV, the prediction is used as the missile doesn't have perfect knowledge of where the target is so we can't change it to point straight where the target is. Something we could try and implement would be to allow the missile to continue to turn towards where it thinks the target should be even if the lock is dropped. What's the intention behind using such a low seeker FOV? Is it for flare rejection? I did notice aam guidance does have a small bug in it that impacts its accuracy so I'll be correcting that.

F8fate commented 4 months ago

@BillNyeTheIE Because in reality,the IR missile seeker FOV is so low to reduce background noise(The AIM9B seeker FOV is 4,The AIM9D seeker FOV is 2.5,some modern missile FOVs are even smaller than 1).I want to use some realistic parameters in the BDA,but it seems that the built-in missile seeker tracking rate of BDA is relatively low.Even if I use BDA's Aim9 default FOV again(lockedSensorFOV = 6),through the Debug lines mode i can see the same issue will still occur,it's obvious increasing Fov just alleviated that.Perhaps improving the tracking rate of missiles is a good idea?Or the IR seeker may be adsorbed by the heat source near Fov,In this way even if the IR missile seeker cannot accurately see the position of the target at the next timestep,it can also be absorbed by the heat source to continue track correctly.

AIM9B 4° fov AIM9D 2 5° fov AIM9X

http://designation-systems.net/dusrm/m-9.html (The website link where I quote data)

Of course,I also know that there are many good IRCCMs in BDA,such as lockedSensorFOVBias and lockedSensorVelocityBias,These are both pretty good,but obviously, this issue will also affect lockedSensorFOVBias work,because when you reduce FOV of the seeker to a small value, for example,to lockedSensorFOV = 6 i set key = 0.0 1 key = 0.75 0 key = 3 0 flare unlikely to be within the missile's fov,but due to the issue,the missile can't hit target correctly. when you increase the FOV of the seeker to a big value, for example,to lockedSensorFov = 6 i set key = 0.0 1 key = 3 0 the missile seeker will see and lock the flare. Of course, the focus of this issue is the small Fov IR missile seeker something went wrong at close range rather than on how BDA irccm works,I'm glad you notice and fix a small bug of aam guidance.Sincerely thank you for your contribution and patient response!