Monthly Archive for January, 2010

XS Venture fuselage part 1

Here’s one variant of XS Ventures fuselage, although it’s quite incomplete (lacks two distinctive tails, and also has some problems on the curvy side). It looks a bit wider and boxier than it really is, because of isometric projection.

Actually it has length of about 70 meters, and wingspan of only about 30 meters, and also I’m trying to fight with guidelines in SolidWorks:
test_shape4

I’m gonna call this one XSV Variant-1, there’s gonna be several distinct variations, to determine best aerodynamic shape (plus of course changes to every of those variations, in case it only needs some small fix).

XS Venture wing and fuselage blend sketch

Exams still going, so far really good. But also I’ve worked a bit more with solidworks, and I found out how to make complex surfaces, now I’ve got green light for starting for on final version of XS Venture’s hull. There will be several iterations, all of them roughly follow sketch I posted earlier, but I’ll test which one has better aerodynamics.

General sizes and parameters remain the same:

  • Length: 68 meters
  • Wingspan: 20 to 30 meters
  • Two slightly angled tails, two elevons

This is front view of one possible wing and fuselage configuration:
test_shape3

XS Venture ascent autopilot 3

Sorry for lack of updates, I’m currently having exams, so they will come with delays. Anyway, I worked more on the autopilot, altered constants a bit, so it’s now much smoother.

I also recorded a video. I’m sorry for the quality, but there is a problem with simulation – it has to run fast enough, else autopilot will not be able to compensate for increasing error. If spacecraft is traveling at 5000 meters per second (less than orbital), then FPS of 100 results in spacecraft skipping 50 meters every frame, while FPS drop to 20 will make it skip 250 meters per frame – that’s more than enough to create major error.

I had to record video quickly, so I just used my old videocamera, and TV tuner to record the video:

XS Venture ascent autopilot 2

I’ve been working more on ascent autopilot, now it’s much more fuel efficient (altough it doesn’t follow the equations I wrote up before, it’s just a general autopilot), and smoother. There are some small issues to fix with smoothing, but it’s already ready for XS10 mission (which will test it in a real mission).

Here’s altitude, in feet:
TELEMETRY_alt_ftmsl

And here’s graphs for engine fuel flows:
TELEMETRY_FF1_lbh
TELEMETRY_FF5_lbh

Here’s engine thrust and atmosphere density. Notice how engine thrust grows as density decreases (while aircraft speed increases):
TELEMETRY_dens_ratio
TELEMETRY_thrst_1_lb

After reaching certain maximum thrust output it starts to decay, because as we’re getting higher and higher, there is less and less oxygen for engines to work. Thrust and fuel flow are nearly similar, that’s just how X-Plane models the engines…

Scramjet CFD modelling

I want to learn more about aerodynamics, and hypersonic aerodynamics (actually aerothermodynamics), plus I need a model of scramjet engine for XS Venture, so I decided to check out one configuration I found on the internet. It’s a fixed-geometry scramjet engine designed for 5 mach airflow.

Here’s the original URL: http://www.cfd-online.com/Wiki/Scramjet_intake.

You can see CFD pictures below, shockwaves are clearly visible, and you can see why engines loose efficiency outside of pretty small range of about 4.5 to 5.5 mach. The red area is area of high pressure. The fuel is injected into high-pressure area to increase volume of resulting gas, increasing its velocity. As you can see, the high-pressure area starts moving from it’s intended location when you increase or reduce airflow (at some point it even touches engine surface, which is very bad stress for engine structure).

All simulations are done at about 30km altitude, so the pressures are quite low. Static pressure does not affect distribution, it only affects absolute values, so it should be fine.

Mach 3:
scramjet_3mach_30km_a

Mach 5 (intended speed):
scramjet_5mach_30km_a

Mach 7:
scramjet_7mach_30km_b

HybriC code generator

I’ve got it to work, well, I actually got it to work almost a week ago, but since I was unable to post that on time, here it is. Code generator now works, and outputs code tree, plus some intermediate code. There’s pretty much zero optimizing, it only does some tricks to the tree (converts tree leafs which hold constant values into operands for opcodes).

Every block is custom tree, optimizer works for every tree, then it runs again for the whole set of blocks:
illustr1

HybriC rewritten in pure C

I have rewritten HybriC compiler in pure C (so it would be possible to integrate parts of it into virtual machine itself, probably, since virtual machine is written in C).

Along with that I changed how it generates code (it was an obvious change). Now it creates a code tree (which is pretty much one of cases of general syntax tree), then optimizes it, and writes down.

This is a bit different to alternate approach – generate code first, then optimize known patterns. But I think I’ll add both ways later.

To illustrate, here’s how it would compile expression R0 = (1 - R1*R2) + (R0 - R0):
scheme

Some leaves would be cut off, and here’s roughly the code it should generate:
mov R3,R1;
mul R3,R2;
mov R4,1;
sub R4,R3;
mov R0,R4;

XS9

Sorry for delays with posts, I was away for 10 days. Now I’m back, and I’m gonna try to post on all things I did. First of all, I performed another space mission, XS9. Primary goal of this mission was to determine orbit pertubations and any errors that occur in X-Plane calculations, and as you will see later, it did find errors. A real lot of errors!

Now this mission is also the longest one – total duration was 4 days, 2 hours, and 30 minutes (which is 98 and a half hours). It’s been running live, realtime, for 4 days on my machine. Some fancy statistics for you number-fans:

  • I had to restart simulator itself 3 times (the restarts were seamless, I made a special service which stores simulation state, and allows to restore it)
  • Because of restarts, pauses and stuff like that the mission was appox 3 minutes longer than realtime. Not much if you compare to 98 hours.
  • The spacecraft completed 60 orbits around the planet (or to be precise, it re-entered during 60th orbit)
  • It traveled 1,490,800 miles in total (that’s 2,400,000 km)
  • It gathered approx. 1.8 gigabytes of telemetry. Not that much, but more than plenty for X-Plane.

There was plenty of happenings during the mission, you can read full report here: http://xsag.wireos.com/~xmiss/xs9/mission/, but here are some key moments.

First of all, during take-off one of guidance computers failed, which automatically triggered safety mechanism, resulting in control transferred to second computer. I do not know why it did that, but most likely it was just some small software bug. It didn’t affect mission though, the ascent continued nominally (it was manual ascent). When I reached space I tried to restart first computer, and it did start up, although GDC CAUTION/WARNING alert was lit up.
I’m not exactly sure why it was lit up, but computers seemed to work fine, so I continued flight. It was later fixed after X-Plane restart, and I didn’t have any problems with computers until flight finished.

Also somewhere in middle of flight one of gyroscopes suddenly failed, but since I had two, I just altered software a bit, and it disabled the malfunctioning gyroscope.

That’s pretty much all, and for the mission goal: it turns out X-Plane fails at conserving kinetic energy, which results in orbit height growing with time, and that doesn’t allow to perform realistic flights (since amount of fuel to go back from space would be much higher than it should be).

Growth in orbit height is about 200km after 20 hours, as you can see here, on altitude graph. It covers timespan of over 2 days, which is about 35 orbits:
TELEMETRY_alt_ftmsl

Interestingly enough during some times it decreased, or remained nearly stable. It is not autopilot or spacecraft issue, reaction control system was shut down, so were the primary engines. It’s just mistake in how X-Plane transfers space vehicle from one coordinate system to another. I might post about this in greater detail, but I’m thinking of overriding physics at these altitudes. I want to include own physics calculations into X-Space plugin, which concern two primary problems:

  1. Lack of one global coordinate system, lack of seamless transfer between local coordinate systems, lack of precision at high altitudes.
  2. Euler angles orientation representation, tied to local coordinate system is very very bad. I will use quaternions, or set of vectors (both really) for representing angles, which will help developing orbital autopilots.

Both of these will make X-Plane more spaceworthy, and in perspective will allow to bring it’s space part to same level as in orbiter (just without ability to travel between celestial bodies).

The only limitation for latter is lack of ability to change planets from plugin. And some problems with overriding certain rendering

Anyway, there’s plenty of telemetry for the flight, and you can download it here: http://xsag.wireos.com/~xmiss/xs9/telemetry/. It’s compressed in 7-zip archives, and split into three parts. There’s also some wrong data in beginning of each, just ignore it.

I’d post graphs, but there’s plenty of them.

Here are some pictures:
Continue reading ‘XS9′