Hi, I haven't made a whole lot of progress on my electron microscope digitizing project this month, but I hope to finish in the next 6-8 weeks. Perhaps sooner. The last decision is whether to use an MCU or DSP in the project, or to stick with discrete logic as I'd originally planned. To recap and give some background, the heart (arguably) of a scanning electron microscope consists of a pair of X and Y scanning coils which are driven in a raster-scan pattern not too unlike a television deflection yolk. In fact NTSC scan rates, interlace and all, are sometimes used so that the output can be displayed on a TV monitor. As it turns out, scan/image rotation is a fairly common feature of high end scopes. I'm wondering what it would take for me to incorporate such a feature into my project. I'm not sure whether or not this feature is limited to digitally controlled scopes: I'd very much like to know. I'll be driving my coils with 16 bit D/A converters: I want to experiment with ultra-high resolution images blown up to poster size. Of course rotating the scan in multiples of 90 degress is trivial, but ultimately I'd like arbitrary rotation or at least in 45 degree increments. I could probably get an idea of the algorithm I'm looking for by drawing some superimposed squares, mapping point to point and finding the pattern. For example: if the baseline (non-rotated) image is generated using 0,0 as the upper-left origin and proceeds right and down as it does with traditional TV, then for a 45 degree counter-clockwise rotation I'd load 0,32K in for the origin. I see a shift problem looming. I think I see the solution, though. Although I'm using 16 bit D/A, software limitations will limit my image to 32K by 32K pixels. In the example above, then, for the baseline image I'd load 16K,16K in as the upper-left origin and 48K,48K as the lower-right end of frame. For 45 degree counter-clockwise I'd load approximately 11K,32K in for the origin: that's 16K divided by 1.414 for X and center of range for Y. But perhaps you're familiar with this algorithm? Are sin, cos, or tan a necessary part of the algorithm for arbitrary rotation? Do I really need more that 16 bits of D/A resolution to do this right? If the rotation angle is very small, for example such that the origin of the first line is at ~16K,16001K and the end of the first scan line is at ~48K,16K it seems like I might need as much as 30 or 32 bits of resolution to slowly jack up the Y value by one pixel over the course of the scan line. I should probably be using signed notation in these examples to make them more clear. Is there a way to do this in the analog domain? In actuall fact I'll probably have 4 D/A converters total, two MDACS for the scanning and two more driving the reference of the MDACS to set gain. Normally the gain dacs would be loaded with the same values to give equal magnification in x and y: in fact a single DAC could be used to set both gains but I want to be able calibrate them. At some level it seems like I'm just changing the "slope" of the scan lines and that perhaps only a pair of analog multiplications is needed: perhaps the output of the X DAC is simply multiplied by a term that varies with the degree of rotation and then multiplied by the Y term. And vice versa? I can't quite get my head around it, though I think I'm almost there. Anyone know how this type of thing is done in practice, or have any comments? -Jeff
Raster Scan (Electron Microscope) Rotation Algorithm?
Started by ●April 4, 2005
Reply by ●April 4, 20052005-04-04
Hey, I would do the rotation mechanically (rotate the 2 coils). Saves a shitload of work. This is how your TV set gets its picture straight. -- Luhan Monat (luhanis 'at' yahoo 'dot' com) "The future is not what it used to be..." http://members.cox.net/berniekm
Reply by ●April 4, 20052005-04-04
On Mon, 04 Apr 2005 22:22:12 +0000, Jeff Miller wrote:> I haven't made a whole lot of progress on my electron microscope > digitizing project this month, but I hope to finish in the next 6-8 > weeks. Perhaps sooner. The last decision is whether to use an MCU or DSP > in the project, or to stick with discrete logic as I'd originally planned. > > To recap and give some background, the heart (arguably) of a scanning > electron microscope consists of a pair of X and Y scanning coils which > are driven in a raster-scan pattern not too unlike a television > deflection yolk. In fact NTSC scan rates, interlace and all, are > sometimes used so that the output can be displayed on a TV monitor....> Anyone know how this type of thing is done in practice, or have any > comments?If you really mean "yoke", ( ;-) ), then just mount it on a bearing so it can be twirled around the gun. Use a worm and spur gear for fine adjust. Or, scan orthogonally, grab the picture, and rotate it in software, like with a paint program. Good Luck! Rich
Reply by ●April 4, 20052005-04-04
Jeff Miller wrote:> Hi, > > I haven't made a whole lot of progress on my electron microscope > digitizing project this month, but I hope to finish in the next 6-8 > weeks. Perhaps sooner. The last decision is whether to use an MCU or DSP > in the project, or to stick with discrete logic as I'd originally planned. > > To recap and give some background, the heart (arguably) of a scanning > electron microscope consists of a pair of X and Y scanning coils which > are driven in a raster-scan pattern not too unlike a television > deflection yolk. In fact NTSC scan rates, interlace and all, are > sometimes used so that the output can be displayed on a TV monitor. > > As it turns out, scan/image rotation is a fairly common feature of high > end scopes. I'm wondering what it would take for me to incorporate such > a feature into my project. I'm not sure whether or not this feature is > limited to digitally controlled scopes: I'd very much like to know. > > I'll be driving my coils with 16 bit D/A converters: I want to > experiment with ultra-high resolution images blown up to poster size. > > Of course rotating the scan in multiples of 90 degress is trivial, but > ultimately I'd like arbitrary rotation or at least in 45 degree > increments.Get a copy of the 'Graphics gems' series of books (Andrew Glassner et al), they discuss drawing lines at arbitary angles in discreet systems in some depth. IIRC "The Bresenham Line Drawing Algorithm" should turn up some possibilities. One possible method goes like this, Vy = Line + KVx where Vy is the value of the Y deflection signal, Line is the scan line number, Vx is the X deflection value and K is a constant that sets the slope of the line (school geometry). Obviously (0,0) is the point around which this rotation operates. Compute K to give your rotation within the quadrant and play with the signs and deflection drive signals to select the quadrant. I would consider using those two extra DACs to provide a controlled bleed from Vx->Vy and vice versa, if you have no processing power driving the DACs, otherwise just do the math in thee processor to generate the rotation. There are easy matrix methods for computing the values to feed the dacs to give rotation, scaling & skew around arbitary points, I know that they appear in the referenced series of books but cannot be bothered to look them up now. Your uni library will be easily able to find them. An easy alternative of course is just to post process the video in software, which offers some useful tricks anyway.... Regards, Dan.
Reply by ●April 4, 20052005-04-04
On Mon, 04 Apr 2005 22:22:12 GMT, Jeff Miller <cornheadorama@hotmail.com> wrote:>Hi, > >I haven't made a whole lot of progress on my electron microscope >digitizing project this month, but I hope to finish in the next 6-8 >weeks. Perhaps sooner. The last decision is whether to use an MCU or DSP >in the project, or to stick with discrete logic as I'd originally planned. > >To recap and give some background, the heart (arguably) of a scanning >electron microscope consists of a pair of X and Y scanning coils which >are driven in a raster-scan pattern not too unlike a television >deflection yolk. In fact NTSC scan rates, interlace and all, are >sometimes used so that the output can be displayed on a TV monitor. > >As it turns out, scan/image rotation is a fairly common feature of high >end scopes. I'm wondering what it would take for me to incorporate such >a feature into my project. I'm not sure whether or not this feature is >limited to digitally controlled scopes: I'd very much like to know. > >I'll be driving my coils with 16 bit D/A converters: I want to >experiment with ultra-high resolution images blown up to poster size. > >Of course rotating the scan in multiples of 90 degress is trivial, but >ultimately I'd like arbitrary rotation or at least in 45 degree >increments. I could probably get an idea of the algorithm I'm looking >for by drawing some superimposed squares, mapping point to point and >finding the pattern. For example: if the baseline (non-rotated) image is >generated using 0,0 as the upper-left origin and proceeds right and down >as it does with traditional TV, then for a 45 degree counter-clockwise >rotation I'd load 0,32K in for the origin. > >I see a shift problem looming. I think I see the solution, though. >Although I'm using 16 bit D/A, software limitations will limit my image >to 32K by 32K pixels. In the example above, then, for the baseline image >I'd load 16K,16K in as the upper-left origin and 48K,48K as the >lower-right end of frame. For 45 degree counter-clockwise I'd load >approximately 11K,32K in for the origin: that's 16K divided by 1.414 for > X and center of range for Y. > >But perhaps you're familiar with this algorithm? Are sin, cos, or tan a >necessary part of the algorithm for arbitrary rotation? Do I really need >more that 16 bits of D/A resolution to do this right? If the rotation >angle is very small, for example such that the origin of the first line >is at ~16K,16001K and the end of the first scan line is at ~48K,16K it >seems like I might need as much as 30 or 32 bits of resolution to slowly >jack up the Y value by one pixel over the course of the scan line. > >I should probably be using signed notation in these examples to make >them more clear. > >Is there a way to do this in the analog domain? In actuall fact I'll >probably have 4 D/A converters total, two MDACS for the scanning and two >more driving the reference of the MDACS to set gain. Normally the gain >dacs would be loaded with the same values to give equal magnification in >x and y: in fact a single DAC could be used to set both gains but I want >to be able calibrate them. At some level it seems like I'm just changing >the "slope" of the scan lines and that perhaps only a pair of analog >multiplications is needed: perhaps the output of the X DAC is simply >multiplied by a term that varies with the degree of rotation and then >multiplied by the Y term. And vice versa? > >I can't quite get my head around it, though I think I'm almost there. > >Anyone know how this type of thing is done in practice, or have any >comments? > >-JeffIf the deflection coils are symmetric and can be driven with arbitrary waveforms, and you have a pair of scan sawtooth waveforms or whatever, you can do arbitrary rotation with four multiplying DACs and two summing amps. D1 = k1 * saw1 + k2 * saw2 D2 = k3 * saw1 + k4 * saw2 where D1 and D2 are the analog deflection amp inputs Saw1 and saw2 are the old analog x, y sweep sawtooths (sawteeth?) K1..K4 are digital vals you load from your PC into the multiplying DACs, with the usual sin/cos triggish stuff. This is cool because K1..K4 do rotation and zooming, too. You can even sort of un-bend trapezoidal distortion, like if you're not hitting a surface straight-on. A little dynamic focussing helps here. There are more digital ways to do this, too, but quantization issues can get nasty. Linear Technology has some nice fast 4Q 16-bit mdacs. John
Reply by ●April 5, 20052005-04-05
There is scertainly a way to do it in the analog domain - the older Cambrdige Instruments elelctron microsccopes just had four sin and cos tapered pots on one shaft. Two of the pots were fed with the display's horizontal scan sawtooth (X-waveform) and two with the display's vertical scan sawtooth (Y-waveform) and the microscopes scan coils were fed with a weighed sum of the tese waveforms, weighed according to the postion of the shaft. A point of detail - the two ends of each of the fours pots were respectively fed with display scan waveform and its inverse. Later machines used multiplying DACs for the job, though they were a bit dodgy for TV speed horizontal scans. Once we went over to driving the user display from a frame store, we gratefully stopped driving the scan coils in the microscope at TV rates. It took rather longer for us to go over to using DACs to drive the scan - we definitely needed good 16-bit DACs to get a acceptable blank white picture from the 4000 line photomonitor - even a 1/4 LSB error in the output from a 12-bit DAC gave a very obvious line structure on a blank white screen that customers found totally objectionable. The old machines all used constant current sources driving integrators to generate the scanning ramps, with different FET-input op amps in the horizonal and vertical scan ramp generators. You needed a fast op amp in the horizontal scan generator and they ran quite warm, while you needed a low-input leakage current amplifier in the vertical scan generator, so you wanted a low-powered amplifer that ran cool. ----------- Bill Sloman, Nijmegen
Reply by ●April 5, 20052005-04-05
Luhan Monat wrote:> Hey, I would do the rotation mechanically (rotate the 2 coils). Saves a > shitload of work. This is how your TV set gets its picture straight. >Heh heh. Well the scan coils are embedded deep in the column. -Jeff
Reply by ●April 5, 20052005-04-05
Rich Grise wrote:> On Mon, 04 Apr 2005 22:22:12 +0000, Jeff Miller wrote: > > >>I haven't made a whole lot of progress on my electron microscope >>digitizing project this month, but I hope to finish in the next 6-8 >>weeks. Perhaps sooner. The last decision is whether to use an MCU or DSP >>in the project, or to stick with discrete logic as I'd originally planned. >> >>To recap and give some background, the heart (arguably) of a scanning >>electron microscope consists of a pair of X and Y scanning coils which >>are driven in a raster-scan pattern not too unlike a television >>deflection yolk. In fact NTSC scan rates, interlace and all, are >>sometimes used so that the output can be displayed on a TV monitor. > > ... > >>Anyone know how this type of thing is done in practice, or have any >>comments? > > > If you really mean "yoke", ( ;-) ), then just mount it on a bearing > so it can be twirled around the gun. Use a worm and spur gear for fine > adjust. > > Or, scan orthogonally, grab the picture, and rotate it in software, like > with a paint program. > > Good Luck! > Rich >The coils are deep inside the column and can't be moved. Rotation after the fact is a plenty fine idea. Just about the only reason to do it in the scope, so far as I can imagine, is to avoid artifacts if regularities in the sample beat with the scan lines, a rare occurance I would imagine. And maybe 'cause it looks cool in real time. I'll be carting this scope (a Mini-SEM) around to primary schools. -Jeff -Jeff
Reply by ●April 5, 20052005-04-05
This message decimated with embedded responses old-school style: John Larkin wrote: Jeff Miller wrote: <snip>>>Is there a way to do this in the analog domain? In actuall fact I'll >>probably have 4 D/A converters total, two MDACS for the scanning and two >>more driving the reference of the MDACS to set gain. Normally the gain >>dacs would be loaded with the same values to give equal magnification in >>x and y: in fact a single DAC could be used to set both gains but I want >>to be able calibrate them. At some level it seems like I'm just changing >>the "slope" of the scan lines and that perhaps only a pair of analog >>multiplications is needed: perhaps the output of the X DAC is simply >>multiplied by a term that varies with the degree of rotation and then >>multiplied by the Y term. And vice versa? >> >>I can't quite get my head around it, though I think I'm almost there. >> >>Anyone know how this type of thing is done in practice, or have any >>comments? >> >>-Jeff > > > > If the deflection coils are symmetric and can be driven with arbitrary > waveforms, and you have a pair of scan sawtooth waveforms or whatever, > you can do arbitrary rotation with four multiplying DACs and two > summing amps. > > D1 = k1 * saw1 + k2 * saw2 > > D2 = k3 * saw1 + k4 * saw2 > > where D1 and D2 are the analog deflection amp inputs > > Saw1 and saw2 are the old analog x, y sweep sawtooths (sawteeth?)Mmmm hmmmm. That's about where I was headed.> > K1..K4 are digital vals you load from your PC into the multiplying > DACs, with the usual sin/cos triggish stuff.Screeeeech.... what usual sin/cos stuff? Dynamically? Or statically, ie: knowing desired angle of rotation you calculate a pair of sin/cos values and load them into the appropriate (static) K's and then "go".> > This is cool because K1..K4 do rotation and zooming, too. You can even > sort of un-bend trapezoidal distortion, like if you're not hitting a > surface straight-on. A little dynamic focussing helps here.Mmmm hmmm, dynamic focus is next on the agenda: I might try dynamic astigmatism correction as well. I'm even considering "zoned" or pixel-by-pixel (ie: digital dynamic) focus: auto-tuned by FFT'ing the samples and optimizing for the higher frequencies, of course :)> > There are more digital ways to do this, too, but quantization issues > can get nasty. > > Linear Technology has some nice fast 4Q 16-bit mdacs. > > John > >I think I've heard about those linear parts.... was it you mentioned them before? -Jeff
Reply by ●April 5, 20052005-04-05
["Followup-To:" header set to sci.electronics.design.] On Tue, 05 Apr 2005 10:18:40 GMT, Jeff Miller <cornheadorama@hotmail.com> wrote in Msg. <4Ct4e.9428$FN4.8074@newssvr21.news.prodigy.com>>> If you really mean "yoke", ( ;-) ), then just mount it on a bearing >> so it can be twirled around the gun. Use a worm and spur gear for fine >> adjust. > > The coils are deep inside the column and can't be moved.Rotate the sample? But really, I'd use multiplying DACs. --D.






