热度 12
2012-1-24 10:39
1596 次阅读|
0 个评论
My degree course was of a kind known as a sandwich course (referred to as a "co-op" in America), which meant that we spent a year in college, then six months working for a company (whatever company you could persuade to take you on), then a year back in college, then another six months out in the field, then a final year at the university. I also noted that my second industrial placement was at the Research and Development centre for a large glass manufacturer. This second placement occurred around 1979, when microprocessors and microcomputers were still relatively new on the scene. To put things into some sort of perspective, one of the computers we used at the university was a humongous analogue beast composed of voltage/current summers (adders and subtractors), amplifiers (multipliers and dividers), integrators, differentiators, and so forth. In order to make this work, we had to use flying leads to connect different functional units together, turn knobs and twiddle dials, and hop up and down on one leg while whistling the national anthem ... well, maybe not, but it sometimes felt like it. An analogue computer (no, that's NOT me :-) The only digital computer we had access to at that time was a honking mainframe that lived in its own building. We captured our programs on decks of punched cards using teletype machines, and then we hand carried them across to the computer building, handed them in, and were told something like "Come back next Wednesday." And when you did return, it was only to be told that there was a syntax error and you'd missed a comma, and the whole thing started again ... it took at least a semester to get even the simplest program to run. (Ah, the good old days :-) But we digress... I had been at the RD centre for only a week or so when my supervisor took me to one side and asked if I knew anything about computers (I later discovered that most of the electronics in a glass factory at that time was either analogue or relay-based digital sequencing type "stuff"). It turned out that someone had ordered a Texas 9000 (or was it a 9900?) microcomputer system, which had just arrived. The problem was that the person who had ordered this little rascal had subsequently accepted a position with another company, and no one else in the RD centre had ever seen a microcomputer before. The bottom line was that they put me in a room with the microcomputer and a manual and left me to it. My instructions were (a) learn how to use the computer and (b) come up with something useful for it to do so that they could justify having purchased it in the first place. What a great opportunity!!! The first step was to learn how to use the computer, which had to be programmed in assembly language (this was the first time I'd been exposed to assembly language, all I knew at that time was FORTRAN on the mainframe). I still remember the feeling of triumph when I managed to get my first "Hello World" type program to work. Once I had mastered "the beast", the next step was to think of something to do with it. The folks at the RD centre already had a laser, and they allowed me to purchase a diode-array camera. I think the resolution of the camera was either 32 x 32 or 64 x 64 pixels; whatever it was, it was pathetic by today's standards, but it really great for the time. I no longer remember how I did it (some simple cable interface – perhaps it was even RS-232), but it was possible to use the microcomputer to instruct the camera to capture (latch) whatever image was currently being detected by the sensor, and to then read the output from the sensor byte-by-byte. My idea was to bounce the laser off the liquid glass as it flowed in channels from the furnace to the bottle-forming machines, and to use the diode array camera to detect the reflected laser beam and use this to calculate the level of the glass (it's not like you can use a float or something... in fact, I'm not sure how they used to do it). But my real triumph was using the camera-microcomputer combo to read the numbers on the bottom of the glass bottles as they zipped down a conveyer belt. There was already some way to detect cracks in the body of the bottles – the trick was to be able to determine which glass-forming machine a damaged bottle had come from based on the number on its bottom. This was actually a non-trivial task, because the numbers were formed by raising the level of the glass on the underside of the bottle, which was illuminated by two light sources aimed at 90 degrees from each other. The thing was that, depending on the orientation (rotation) of the bottle, different faces of the raised numbers would be illuminated. So first I had to detect the bottle going by and trigger the camera to take a snapshot. Next I had to identify the facets forming the number from random "noisy" areas of the glass, calculate the "centre-of-gravity" of the number, rotate everything around until it was "vertical" and then identify it – all before the next bottle shot past. Actually, when I consider how little I knew in those days, I now realise how amazing it was that I got any of this to work at all. Fortunately, I had no idea as to just how out of my depth I was, so I beavered away and eventually got it all working. I was dancing my happy dance that day, let me tell you! Apart from the (not insignificant) boost to my confidence, this experience was really important to me because (a) I got a chance to work with a microcomputer before a lot of other folks even saw one, (b) I learned an assembly language and (b) I discovered that I was actually pretty good at assembly-level programming (I know that it's not very modest of me to say so, but it's true). I also think I was really lucky to be learning all this stuff at that time when memory was so limited and processor clocks speeds were so low, because you had to use all sorts of tricks to minimise your memory usage and wring the last drop of performance out of your programs. All of these tricks and techniques have served me well over the years in all sorts of esoteric applications.