Kerbal Space Program, the game that teaches engineers at JPL and SpaceX the basics of rocket design and orbital mechanics, recently had a giant update. There are now science contracts that require you to fly Kerbals all over their tiny globe, collect data, and transmit it back to the Kerbal Space Center. As would be expected, this is a grind for XP, and the contracts sometimes don’t make sense – you need to collect data from cliff faces and mountain tops. Landing a Kerbal jet at these places is hard.
[Matt Thiffault] wanted to do these science contracts more efficiently. The best way to get to a remote location without a landing strip would be a helicopter, but a harrier jump jet would do just as well. This isn’t supported in the stock game, so [Matt] wrote a complete control system for four engines to control a hovering Kerbal jet.
[Matt]’s work is built on kOS, a scriptable autopilot mod for Kerbal that was originally intended to be something like the Apollo Guidance Computer. People have been using it to make computerized skycranes and automated rendezvous and docking programs, but these are actually relatively simple examples; there’s far more math involved in flying a quadcopter than there is getting into orbit.
To build his automated hovering harrier, [Matt] needed an aircraft. His Kerrier has parts from the Kerbal Aircraft Expansion, B9, and Infernal Robotics mods for KSP, but this is only half the problem. Anyone can put four tilt jets on an airplane, and it takes a real wizard to force a control system to hover. Hover control of the Kerbal harrier is accomplished with a complete control system for a four-engined aircraft, with proper PID control loops and code updating at 20Hz.
With kOS, the proper plane, and the right software running on this emulated guidance computer, [Matt] is able to park his plane in mid-air, have a Kerbal descend the ladder, perform some science, and return to base. It’s an impressive amount of work for a video game. A good thing, too: [Matt] is looking to get into controls engineering professionally. Whether this will go on his resume is another question entirely.
So?
If you knew more about KSP, you’d realize this takes a lot of skill, and would also apply to real life.
he probably uses kOS, a quite extensive scripting system that allows for scripting in much the same way these systems run in real life, the same skills apply most of the way.
not to mention with the full release they fixed atmospheric physics to be way more realistic.
so he used a scripting engine mod, which allows for from-scratch control of every system on a vehicle, to implement something generally running on a dedicated microcontroller, to run one of the few real life VTOLs, which he reproduced in the game using mod parts
[youtube http://www.youtube.com/watch?v=UTduy7Qkvk8&w=420&h=315%5D
Takes a lot of work to make a mod like this. Kudos.
Although there is a LOT fun to be had building a VTOL and flying it without any mods in the stock game too.
It actually looks like this /isn’t/ a mod itself – he’s just loading the existing kOS and b9 mods into the game, and getting to work writing the in-world code to run that jet. That’s what’s so beautiful about kOS – it /doesn’t/ give you these things. It gives you a vaguely basic-like language running on a processor part within the game, that can can use mostly the controls that you can use.
What he’s done is straight (advanced) gameplay for kOS – and pretty badS :)
best I’ve done VTOL wise was with the B9 parts pack, so not quite stock, but certainly no scripting like this. Extremely satisfying to take off normally at runway, fly to island runway, return but come in for a perfect vertical landing on the VAB.
Sweet, this will open up some possibilities.
Man, those Kerbal’s are more technologically advanced than North Korea, and cuter than Kim Jong Un, they got it all going on!
“There’s far more math involved in flying a quadcopter than there is getting into orbit”
With respect to Brian, this is simply untrue. I say this with authority as someone with a PhD and 10 years of experience specialising in quadrotor dynamics and control (and some familiarity with orbital mechanics). Computing orbital insertion trajectories is substantially harder. Quadrotors are second-order rigid body systems with added damping and cross-coupling from induced rotor drag (and flapping if present); the hard part of quadrotors is mostly doing the inertial estimation, which a sim environment gives you for free. In comparison, launch to orbit has rigid body dynamics, non-linear transsonic aerodynamics, orbital mechanics, variable thrust response with changing altitude, constantly changing vehicle centre of mass… the list goes on!
Developing quadrotors isn’t easy, but it’s also not rocket science. ;)
I believe that he was referring to the fact that in the game, using the same kOS scripting mod, it is possible to get a craft into orbit using far less math (at least explicitly) than involved in this style of controller.
I think most of us would agree that just about everything involved in REAL space flight is more complicated than aircraft controllers.
Heh – you might be right! :)
I’m actually not sure of that – getting a craft to orbit (but perhaps needing somewhat more fuel to compensate for suboptimality, which could get expensive) I do get the impression that you can opt to front-load a fair of the orientation control into relatively passive aerodynamics while you’ve got enough atmosphere. For that matter, you mostly don’t /get/ to control thrust on a rocket (although it’s possible to adjust chamber pressure through most of the range that produces choked flow in the nozzle to adjust thrust reasonably efficiently, it’s apparently more trouble than it’s worth).
I think what I’m saying is that /controlling/ a rocket for an orbital launch isn’t that hard. Building one and planning the mission are hard, but the actual controls aren’t necessarily so bad if you are just trying to get to orbit.
I think he was referring to the fact that in the game, it is possible to write a script (using the kOS mod) that will put a ship in orbit using far less math (at least explicitly) than it takes to do something like the harrier.
I think we’d all agree that basically anything involved in REAL space flight is going to be harder than the aircraft equivalent :P
Nicely put Paul.
This puts me in mind of this spectaculat SpaceX Grasshopper video I saw the other day…
https://www.youtube.com/watch?v=9ZDkItO-0a4
…which was filmed from a hexacopter hovering nearby. I’m certainly more impressed by the apparently sentient rocket than the camera rig :)
I keep telling myself, one of these days, I’ll have enough spare time to really delve deep in the whole KSP scene. Course I’ve been saying that for a few years now.
but..if I did it this way, it wouldn’t crash spectacularly!
wait, the point of KSP is to “succeed”? :)