Jump to content

When Gimbal Lock Is A Bad Thing.


NeoMorph

Recommended Posts

For all you guys waxing nostalgic, if you haven't seen this video of the Apollo flight computer being made you are missing out:

The whole thing is worth watching but when they start showing how they were hand-assembling the logic boards etc (approx 17 minutes in) it blew my mind.

Link to comment
Share on other sites

For all you guys waxing nostalgic, if you haven't seen this video of the Apollo flight computer being made you are missing out:

The whole thing is worth watching but when they start showing how they were hand-assembling the logic boards etc (approx 17 minutes in) it blew my mind.

That is completely bonkers right there! Gives a new appreciation for the sheer amount of work and brainpower that went into sending man to the moon!

Link to comment
Share on other sites

Thank you for all the great info an nostalgia. I wrote my 1st programs on punch cards in IBM System/360 Assembler using macho EBCDIC instead of lame ASCII :).

But I must offer 1 very slight correction to the above statement. There was at that time a 3rd type of computer: analog. Geez, I love analog computers. The sheer genius required, in what now seems a totally alien field to modern understanding...... Know any good stories about them, too? :)

I wrote my first real programs for a 370/158, 3033 and 3031... though I did manage to upset it logging into the APL interpreter using an ICL terminal... oh those were the days.

Actually I loved using APL. A great maths based computer language. Brilliant for coding in multi dimensional arrays. Looked total greek to most people though and you had to learn what all the weird symbols meant. Most didn't know their quote quad from their dels.

Edited by NeoMorph
Link to comment
Share on other sites

For the record, there was even a FOURTH sort of computer available at the time, though there was no way it was ever going to be used for Apollo, because it was too bulky, too heavy, too complex, and too inflexible ("reprogramming" it required a couple of weeks of work with actual wrenches and such and changing out physical components). That would be the MECHANICAL computer, which, despite what you might think, was actually a highly evolved and reliable piece of equipment well before the Space Race started. The main users of these were actually various navies, which used them to calculate fire control solutions for guns and torpedoes in the days before guided weapons. Examples include the US Navy's Mark 1 Fire Control Computer (https://en.wikipedia.org/wiki/Mark_I_Fire_Control_Computer and http://www.navweaps.com/index_tech/tech-056.htm ), the USN's Mark 38 Gun Fire Control System (https://en.wikipedia.org/wiki/Ship_gun_fire-control_system#MK_38_Gun_Fire_Control_System ), and the British Royal Navy's Admiralty Fire Control Table (https://en.wikipedia.org/wiki/Admiralty_Fire_Control_Table ).

Note that all three of those systems were designed to solve complex differential equations involving firing from a moving ship, at a moving target, at a significant range (up to 30 miles for the Mark 38), taking into account the ballistic performance of the type of gun being used *and* the type of shell it was firing, all using purely mechanical "clockwork" mechanisms to do this... and spit out a continuously-updated firing solution that was accurate to within 1% of the target range (so, for example, at a target 20 miles away, it'd be accurate to about 200 yards). Very effective, very quick, and very accurate (when the US Navy recommissioned the Iowa-class battleships in the 1980s, the mechanical fire control computers for the guns were retained rather than being replaced with electronic ones because the mechanical ones did the job just fine and didn't have development and purchasing costs to deal with), but with the negative of having only one "program" that it could run, albeit with a fairly large number of variables. (Different ballistics of different types of shells were dealt with by having multiple "ballistics" gears that it could switch between through a mechanism similar to an automotive transmission.) Changing the "program" required a technician to spend a day inside it, changing out gears for new ones that were cut specifically for the new program, and then two weeks of careful trials with precisely measured variables to recalibrate it. Still, given that these were designed between about 1910 and 1940, they were amazing pieces of engineering.

Beyond that, there was also the original meaning of the word "computer," the biological computer. Yes, before mechanical computers were perfected, a "computer" was someone with good math skills whose job was to sit around all day and do the actual arithmetic computations that people needed done, so that the physicists, engineers, and other people whose jobs included higher math education could just concentrate on doing the calculus and trigonometry and geometry needed to do things, then hand it off to the computers to plug in the numbers and come up with the actual result.

As a side note, Arthur C. Clarke once wrote a short story about a large interplanetary spaceship that was getting ready to return to Earth when it suffered a complete guidance computer failure. This was seen as a death sentence by all on board until one of the navigators remembered his orbital mechanics classes and that the actual computations being done by the guidance computer aren't difficult (they're probably junior high-level arithmetic), there's just a HELL of a lot of them to do. Since he could easily computer position and heading using a sextant to take star and horizon sightings, all that was needed was to do the computations themselves to figure out ejection angle and burn delta-V required to put them on a trajectory home. His idea: Have the engineers use spare rods and nuts to make a bunch of abacuses, one for each person on board, train them in how to use them (fairly simple and quick), and then have everyone pitch in to do the calculations that way. It'd take a week or two of work, particularly since he proposed having three groups work in parallel (to guard against errors), but it'd get the job done quickly enough for them to get home alive. (This, BTW, is similar to the hand-flying vs. MechJeb debate; MechJeb is like the guidance computer while hand-flying would be more akin to the abacus computations. Both do the same job; one just does it more quickly and with less effort...)

Link to comment
Share on other sites

  • 1 month later...

Has anyone tried to fly a kerbal over a pole? Every time I get a kerbal to hit 90*60'60'' exactly it suffer a kraken attack, it think the problem is virtual gimbal lock in which as a kerbal crosses over the pole the camera whips around and the kerbal does as well.

Link to comment
Share on other sites

Ah, so now I know why KSP's camera locks up over the poles and Uber's Planetary Annihilation's doesn't … :)

Maybe a feature request for KSP should be that it is also coded for quaternions rather than Euler rotations, so we have no 'gimbal lock' and can truly fly freely in space?

Link to comment
Share on other sites

  • 2 weeks later...
Ah, so now I know why KSP's camera locks up over the poles and Uber's Planetary Annihilation's doesn't … :)

Maybe a feature request for KSP should be that it is also coded for quaternions rather than Euler rotations, so we have no 'gimbal lock' and can truly fly freely in space?

The camera gimbal lock is the **single** reason I haven't played Kerbal Space Program in months. It is so incredibly frustrating to have the camera get stuck at the poles; it makes things like docking much harder than they need to be.
Link to comment
Share on other sites

  • 2 months later...

Quarternions. Even if human do not comprehend hyper-complex number... computer does. And Unity has a ultra easy way to deal with quarternions. I mean like, Quarternions.rotation .slerp and some others things like that.

For the camera... hum. Maybe you should post your issue in a appropriate section of the forum in order to be read by the right people?

Link to comment
Share on other sites

I'm pretty sure it had something to do with programming the computer.

Here: http://history.nasa.gov/computers/Ch2-7.html

You can try it here: http://www.svtsim.com/moonjs/agc.html

I also remember seeing a simulation of it that you could run through an entire moon landing. Fascinating how simple and easy to use it is!

Link to comment
Share on other sites

You can try it here: http://www.svtsim.com/moonjs/agc.html

I also remember seeing a simulation of it that you could run through an entire moon landing. Fascinating how simple and easy to use it is!

I think that the system's simplicity is more of a reflection on how spread out the entire program was, in general. Sure, the actual interface is simple, but there was so much more going on behind it, monitored and sometimes managed directly by dozens of people on the ground.

Also, the simplicity of the system, while presenting an easy to use interface for the ship's crew, could also serve to work against everybody in the event of an emergency. Case-in-point: Apollo 13. All they had to do was stir the cryo tanks, and when things went south, it took a lot of people analyzing sensors and relaying observations from the flight to determine wtf had actually happened, as the simple system could only indicate the fallout effects of the event. As a result, all they knew for certain right away was that power and air were falling, but it was up to the ground crew to collaborate with the flight engineers to determine what could have physically happened to result in the indications and observations they were receiving. The on-board computers could only store a (literally) hard coded set of instructions, so rather than try to anticipate every possible failure scenario and code the values relevant to the failures into the system, it was left up to the crews on the ship and the ground to work things out instead.

Speaking strictly from the electronics aspect, a kid with a Speak 'n Spell could have virtually flown those missions, when handed a time stamped, step-by-step flight manual, and also being prompted for each specific input by ground control.

Link to comment
Share on other sites

Thank you for all the great info an nostalgia. I wrote my 1st programs on punch cards in IBM System/360 Assembler using macho EBCDIC instead of lame ASCII :).

But I must offer 1 very slight correction to the above statement. There was at that time a 3rd type of computer: analog. Geez, I love analog computers. The sheer genius required, in what now seems a totally alien field to modern understanding...... Know any good stories about them, too? :)

The Torpedo Data Computer was a mechanical computer, not sure if that's exactly what you mean by analog. It did use cogs and cams etc.

Interestingly the firing solution in the form of a gyro angle was fed in real time to the torpedoes via a spindle assembly that was withdrawn at the moment of firing.

As for the Apollo Computer, I read somewhere that's it's not fair to call to compare it to other computers in terms of power as it was specifically designed for one job only and in many ways was more of an autopilot system than a computer.

What amazes me the most is how they did the rope memory by hand. They must have had incredible quality control.

BTW one way they avoided gimbal lock is they frequently changed the "REFSMMAT" (reference to a stable member matrix) which was basically the zero point of all three axes. If a certain maneuver or attitude could bring them close to gimbal lock they could just change the REFSMMAT ahead of time.

Edited by DrD
Link to comment
Share on other sites

Gimbal lock is a problem for programming too, if you use Euler rotations x,y,z , you can reach situation where they will not combine properly due to gimbal lock, to avoid it mostly Quaternions s,x,y,z (tho confusingly some programming languages have them x,y,z,s ) are used which have very nice ways of combining and also of rotating vectors, but I digress, the problem is, humans have a hard time intuitively understanding quaternions, if you see the Euler rotation, 90,0,0 you can probably tell it's 90 degrees off in the X axis, so you can easily visualise that, and tell that the top of the object would now be facing right, but with quaternions, it is pretty much incomprehensible, so you have to convert from quaternion rotations to Euler rotations for the stupid humans to understand it and input their controls and that's where the problems occur.

Also I heard that washing machines that have more computing power than the Apollo capsule, and I heard that one in the 90's before they started adding the silly little dot matrix screens on appliances.

OMG this! Dealing with Euler rotations in KOS nearly drove me insane. I got around it by using a lot of vector math and thus normalizing the data input so it could be used by regular people and not just mensa members. A few generations later KOS was finally updated to use Quaternions and everyone rejoiced.

http://en.wikipedia.org/wiki/Quaternion

P.S. My wife claims I still curse gimbal lock in my sleep.

Link to comment
Share on other sites

or what we lovingly call the "Nav Ball".

http://i.imgur.com/1vXOXmi.jpg

wow, is anyone doing a texture update to replace the KSP one?

When people say they flew to the moon using computers less powerful than most digital watches today, they aren't exaggerating.

Which is why Marty could have made a fortune selling his digital watch in B2tF in 1955.

MartyWatch.jpg

Its amazing to think of what a modern day capsule would look like and how (relatively) easy it would be to fly it.

simpsons suggestion:

m.png

Edited by Kruleworld
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...