Jump to content

Racing Drone Plugin w/ potential ML integration


Recommended Posts

I'm trying to turn this kos racing script into a native c# plugin which I may be able to tune with machine learning/ reinforced learning.

 

Got the autopilot up and working, now its just about tuning the pids. I slow down time around the first gate, the fps isn't dropping. I'm begining to look into machine learning to see if i could set up ksp to loop the first gate, while having some kind of library set the pids.

The main difference between this and the kos script is that the autopilot is set to close the x & y proximity gap to its target, not point at the target. With the plane rolled the yaw is responsible for for closing the x(formally y) distance, but using yaw for pitch is proving to be difficult.

I'm thinking about having the pid unroll the plane to control altitude in the turns.

 

 

Edited by clown_baby
Link to comment
Share on other sites

58 minutes ago, Aelfhe1m said:

AFAIK KSP pugins need to be compiled as .NET 3.5 libraries.

Thanks a lot, I could have sworn i selected 3.5 when i made the project. Let me try again

Link to comment
Share on other sites

 

1 minute ago, clown_baby said:

So I made a new project and I'm 100% sure I selected the 3.5 library, but still the same error. Thats super frustrating, I'm gonna have to see if I can find were to change it in project. 

So I made a new project and I'm 100% sure I selected the 3.5 library, but still the same error. Thats super frustrating, I'm gonna have to see if I can find were to change it in project. 

 

Edited by clown_baby
Link to comment
Share on other sites

7 minutes ago, wasml said:

If you're using MS Visual Studio 2015 Alt+F7 will get you there. Or under Project | Properties | Application | Target Framework:

Thanks I found that too, for some reason 2017 doesn't have it. 

ovf12wI.png

 

Link to comment
Share on other sites

  • 4 months later...

 

Got the autopilot working, not its just tuning the pids. I'm begining to look into machine learning to see if i could set up ksp to loop the first gate, while having some kind of library set the pids.

 

The main difference between this and the kos script is that the autopilot is set to close the x & y proximity gap to its target, not point at the target. With the plane rolled the yaw is responsible for for closing the x(formally y) distance, but using yaw for pitch is proving to be difficult.

 

I'm thinking about having the pid unroll the plane to control altitude in the turns.

Edited by clown_baby
Link to comment
Share on other sites

On 9/27/2017 at 9:47 PM, clown_baby said:

but using yaw for pitch is proving to be difficult.

Hi, it may be of interest that the BD pilot AI (written by Ferram)  does not use yaw at all, all direction control and changes are by combination of pitch and roll

Very interested in seeing where this goes as I've a number of (mod custom built) drones now of various sizes,  and some other purpose apart from the occasional dogfight or recording GPS co ords  would be very welcome.

Link to comment
Share on other sites

On 9/29/2017 at 4:49 PM, SpannerMonkey(smce) said:

Hi, it may be of interest that the BD pilot AI (written by Ferram)  does not use yaw at all, all direction control and changes are by combination of pitch and roll

Very interested in seeing where this goes as I've a number of (mod custom built) drones now of various sizes,  and some other purpose apart from the occasional dogfight or recording GPS co ords  would be very welcome.

Hey thanks for the info. If I open up the roll to adjust pitch the radius of the turn will vary greatly. I actually have it tuned pretty good right now, and because the yaw only makes small adjustments it seems to work ok. The problem is I have two pids controlling the yaw. One to control the actual input, and one to set the target vector to close the gap. Getting two pids to work together is always difficult, but it seems to be working ok. I used a pid library I found online so I'm not sure if I'm using a good one or not.

Also I miss BDArmory, I used to do tons of dogfights with my jet and my gundam. Don't have much time for ksp anymore and when i do its just this project. I had some older drone kos scripts I would also like to make plugins. 

No video but I had an awesome wingman kos script back in the day.

0D9abkV.png

 

IR Tracking Cannon, skip to like 3 minutes in.

 

 

Edited by clown_baby
Link to comment
Share on other sites

  • 2 months later...
  • 2 weeks later...
On 1/1/2018 at 4:36 AM, ArmandoA said:

Hello , Im very interested in this autopilot work, do you think you can explain a little bit how the implementation works? Or maybe where can I read about programming one myself?

 

Thanks

It's all about pid loops. That's how the stock SAS works, and you can use them to control just about anything. I have them for pitch/yaw/roll, then the rest is just logic to get it to do what you want. Feel free to ask any questions I'll help explain where I can.

 

Link to comment
Share on other sites

  • 1 month later...

Hello again , thank you for your reply , that video was fascinating to watch

 

now my doubt is about flight control.. my understanding is that you also need a PID here but for each axis ? also my doubt comes with having a PID associated with with aileron control because the rate of turn is not instantaneous in a plane , I mean you first command an aileron deflection and after a while a turn will be initiated 

do you have any thoughts about how aircraft deal with this situation?

 

thank you again

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...