Search This Blog

Tuesday, July 25, 2017

There is nothing like an Enterprise grade solution for a Consumer grade problem



In current times, there is an ever increasing separation between the consumer and physical storage media as a product: with the generalized increase of Internet availability and bandwidth along with massification of server side infrastructures to support storage and other services (e.g. from providers such as Dropbox, Google, Amazon, Microsoft), the user tends to replace the physical storage by the convenience of a cloud storage solution.

While it is not entirely clear that this will indeed be the trend, it is clearly apparent that local storage will tend to have a thinner role in the fabric that lies between the user and the preservation of digital data.

However in current days, the consumer, or more likely, the "prosumer" still lives in the borderline, where by one hand he has a great demand for a reliable and dense storage solution, but on the other hand still cannot see cloud storage as the solution to embrace, given the constaints that still poses: cost for large amounts of data, and the bandwidth required for effective transfer of very large files in acceptable lengths of time. This is the case for videographers and content creators, who constantly produce large amounts of raw footage and various versions of edited work that has to be archived for later use.

Taking cloud storage out of the equation, this leaves a limited number of choices for the "prosumer":

  • hard disks - have a reasonably large density and bandwidth, but are relatively delicate and reliability tends to drop abruptly after 3 to 4 years, if subject to intense use, according to several studies performed by the industry;
  • flash memory - has a high bandwidth and consistently low access times (just as RAM, individual memory cells can be accessed in nearly constant time). On the other hand, write operations wear out the media, limiting its longevity under intense rewrite use. Also, the integrity of the information is not guaranteed to persist after more than 3 years in the shelf;
  • optical media - has very limited density (by todays standards), e.g. a single-layer writable Blu Ray disk (BD-R) capacity of 25 GB is since long surpassed by the very accessible 32 GB SD cards. Storage life is good, but depends on the dye chemistry employed. M-Disc type disks are advertised (and some studies appear to support it) to last thousands of years, but these are written in a different method, where the laser beam actually carves pits in an otherwise difficult material to geometrically modify;
  • magnetic tape - in spite of being one of the most traditional storage technologies, it is still favoured and seen by the industry as the most important backbone for long term data storage. From small companies, to the largest enterprises in the Internet, it is present in every data center. It suffers from long seek times, for the obvious fact that tapes take some time to rewind and fast forward, but it achieves data transfer rates that equal or even exceed some performance hard drives. In spite of the high cost of the drive (on par with most enterprise grade hardware), the tape media is very cheap and the capacity competing with the best removable hard-drives (e.g. 30 USD for an LTO-6 2.5 TB tape).
Classifying myself as a "junior" prosumer, I stumbled upon the described storage challenge, from the moment I started to accumulate footage and photos both from leisure and from my modest dimension of content creator. Not only for having enough physical disk space to keep on producing content, but also because of having some redundancy in case of a catastrophic disk failure.

That is when I started to look at what options exist in the market, and realizing that essentially there are no consumer oriented tape storage products. There were options in the past, such as the Iomega Ditto tape drive, which in its latest models reached the 10 GB per tape.

Left without consumer grade options, I went to see how viable would it be to buy a tape drive that is commonly found in data centers, which is the case of LTO drives.

I quickly found that brand new, these devices cost north of 3000 USD, a bit too much for my modest consumer budget (which if it existed could well be used to go to the supermarket and buy 30 x 2 TB hard drives).

Taking the tape drive cost out of the equation, the cost per GB is very appealing, even for smaller LTO-4 tapes, which cost around 25 USD and can store 800 GB of uncompressed data.

So instead of buying brand new, I looked up the market of used tape drives, and decided to take the gamble of buying a  LTO-4 drive that would be at least two orders of magnitude below the original price. I went for an IBM LTO-4 drive (full height). For 78 USD + shipping, I got from eBay a complete unit that was taken out from a data center Dell tape library. The unit came enclosed in the aluminium sled from the tape library:






Also, this sled contained the board that converts the standard 48 Volts to the voltages required by the drive (12 V DC and 5 V DC):


Besides the voltages, this board would be responsible for establishing an interface between the tape drive RS-422 interface and the tape library CAN bus, for "out of band" control of the tape drive without intervention of the host. For a seemingly simple task this board has rather sophisticated combination of hardware: a Freescale MC68HC16Z 16 bit microcontroller, a 1 MByte flash memory chip, and 128 of static RAM, not to mention other smaller components such as a Microchip CAN transceiver.


However installing a beast of a drive like this in a desktop computer, is not exactly a walk in the park. The first challenge: interfacing with the host - this drive features a Fiber Channel interface (a sophisticated optical link standard designed to interconnect storage devices in what is known as a Storage Area Network), which means that the host computer would need to have a Fiber Channel Host Bus Adapter (HBA).


Again, decommissioned enterprise grade hardware can be surprisingly cheap: shelled out 10 GBP and got myself a 4Gbit PCI Express QLogic HBA:











And between the two, of course, a fiber optic jumper cable was necessary. Another 5 euros paid 2 meters of LC-LC jumper cable.




As it wouldn't be perfect without a third challenge, so it came the power supply aspect: I had a dual 5V @ 2A  / 12 V @ 2A  power supply, but being the beast that it is, this drive would not be happy with this amount of juice, so a larger (at least 5V @ 4 A / 12 V @ 2A) was needed. The only option I found was buying (for another 32 Euros), a switching power supply module at a local electronics store.




As this is only the bare module, had to build a custom enclosure to safely operate it in a home environment.


Finally, the drive had to be housed in a proper enclosure. Had to modify a CD-ROM drive enclosure I had, to support the full height drive:

Also, had to be able to cram the original fan into this enclosure (yes, this drive produces quite a bit of heat - powerful reel spinning motors and realtime compression + encryption hardware adds to the party). This stuff has to encrypt and compress data on the fly, at a whooping 120 MBytes / second!





A bit of cutting and stitching and was able to adapt the back panel from the original sled, into this back of this enclosure.

At last it came the moment of truth, when I had put it all together and turn the thing on.

One curious aspect is that this does not boot up almost instantly like a hard drive or a CD-ROM drive. This device takes north of 20 seconds to initialize, while showing some animation in its single digit display, while doing so.

Then in the first test the computer simply wouldn't detect the drive. Installed SANsurfer, and nothing. After exhausting what I thought it was a comprehensive list of aspects, i.e.: checking that the HBA was operating correctly (the HBA diagnostic tools go to the level of having information about the current temperature of the optical transceiver, along with other aspects such as TX and RX power),


checking and playing with the configuration of the HBA (this thing even has code that loads on the PC during bootup, allowing to configure the board in a BIOS type menu system), checking that the fiber optic jumper cable was not broken, etc.

Until, at some moment when my hope was almost gone and after have found that only the HBA would emit IR light from its emitter, I looked at the rear of the drive and realized that there was a second slot, for another FC transceiver. With limited hope that it would be of any use, decided to swap the transceiver, to the second slot.





Initially nothing happened. Albeit the transceiver IR light was now on (a good sign), the drive still was not detected.











That was when I read one of the IBM manuals, and found that these drives only support the Arbitrated Loop and Switched Fabric modes. My HBA was in point-to-point mode. Changed the configuration, and voilá, drive being detected.



Ran the IBM Tape Diagnostics Tool, and was able to run some tests. All tests passed, in spite of the suprise of verifying that drive had quite a bit of mileage already (literally):

 PAGE                                : 14: Device Statistics


 #NO  PARAM CODE                PARAM VALUE 
 1    Lifetime Media Loads      6215
 2    Lifetime Cleaning Op.     86
 3    Lifetime POH              73322
 4    Lifetime MMH              10170
 5    Lt Meters Tape Processed  76506254

76506 Km of tape means that this drive have seen more tape than my car have seen asphalt. 

Another statistic, the POH (Power On Hours), means that this drive has over 8 years powered on,

And the MMH (Media Motion Hours), means that the drive have been moving tape for a total of 423 days.

Ran a 600 GB backup (took roughly 2 hours) and finalized it without any errors. 

In spite of the age, assuming that the MTBF figure is reliable (250 000 hours), it still should have many years of life before failing..lets backup files and see..

This is just some of the information, as this drive produces a dump with a comprehensive set of statistics and other information (relevant for the tape library and Sys Admins).


Monday, October 24, 2016

Peltier-based dehumidifier

This simple apparatus is a particularly interesting way of demonstrating the principle behind the common household dehumidifier:


The big difference however, lies in the way the low temperature (required for the condensation of the water vapour) is achieved.

A regular dehumidifier works in a similar way to a refrigerator or consumer air conditioning system: 
a coolant substance (usually HFC-134a) flows in a closed loop. This coolant cycles between the liquid and gaseous states. The cold section of the device is called evaporator - and is basically a heat exchanger that captures the heat from the environment and uses it to evaporate the coolant. Once in the vapor state, the coolant enters a compressor where its pressure and temperature increases. This heat is then released through another heat exchanger called condenser. As the temperature is decreased but the pressure remains the same, the vapor condenses, turning the coolant into a liquid.
As this cycle repeats the intended purposed of the system is achieved: moving heat from one surface to another.

In the peltier device, the same effect is achieved, but instead of mechanical parts and a coolant, a semiconductor junction is used. When properly designed, a PN junction is capable of moving heat in a single direction, depending on the direction in which the current flows.

The principle of the dehumidifier is simple: the air from the environment is pushed against the cold surface of the evaporator (or the cold side of the peltier) causing the water vapor to condense into droplets of water. These droplets are captured and stored in a reservoir. The same airflow is used to cool down the condenser, which is normally adjacent to the evaporator.

While interesting for demonstration of the principle, the peltier device is far from being the most efficient approach for this purpose. The overall efficiency is very low compared to conventional compressor technology, and the material cost for producing comparable refrigeration capacity is very high.


Saturday, September 10, 2016

Reconditioning a 50+ year old microscope - part 3 - LED conversion

The microscope came with what I believe it must have been the original illumination system:

  • a 30 Watt / 110 Volts tungsten bulb (in this case a GE branded one):


  • a light dimmer circuit apparently made up of just a Triac, some capacitors and the potentiometer to control at which threshold the waveform is chopped (therefore causing the light to dim proportionally to how much of the wave is chopped):

  • and interestingly, a Hitachi branded mains plug:



However for current use, this system would be impractical several fold:

  • the specific type of tungsten bulb it requires is very difficult to obtain today, and those available (mostly new old stock) are not cheap;
  • as listed in the specs of these light bulbs, the lifespan is stupidly small, in the range of 50 to 60 hours.

  • incandescent illumination is not ideal because of reddish spectrum of light in lower power levels. A blue filter is normally required to adjust to a more even spectrum:

  • given the low efficiency of tungsten bulbs, heat dissipation and IR radiation are high, affecting some types of specimen;
  • in my location the mains voltage is 220 Volts instead of the 110 Volts required. This would imply adding a transformer to convert the voltage;
As such I studied the conversion to an LED light source, which I knew it would have multiple advantages:
  • LEDs are widely available and cheap;
  • lifespan is high, in the order of tens of thousands of hours;
  • light spectrum is consistent across all levels of intensity. Also (depending on the selected LED), a nearly pure white source is possible without having to add any filter;
Nevertheless I had to take into consideration a few aspects:
  • make sure a good thermal dissipation would be allowed. LEDs don't like too much heat;
  • ensure the maximum current delivered to the LED is actively limited, ideally by some regulator circuit;
  • Like in the original system, provide a means for the LED intensity to be varied through a potentiometer installed in the same location of the original one.
As such I put my hands to work. Started by removing the original illumination gear:


Ordered from banggood:
  • a bunch of 3 Watt white LEDs (rated at about 210 lumens each);
  • a power LED tailored heatsink:
  • a step-down (buck) converter rated at a maximum of 3 Amps, with controls for constant voltage and constant current applications:

The work started with the preparation of the heatsink to fit the area originally occuped by the bulb. Some cutting had to be done in order to make it a good fit. Tested the LED mounted on the heatsink for proper operation:


Made some tests with the step-down converter, limiting the current to 500 mA (below the rated 700 mA but more than enough for the lighting requirements), and replacing the on-board multiturn pot by a 500 Ohm panel potentiometer and a 220 Ohm resistor in series (and as such obtaining only the safe voltage range to be used for controlling the light):


  • machined an aluminium disc to provide the necessary width for fitting a DC connector in the hole where originally the thick mains cable would pass through:

Well these specs won't remain true though (in particular the 20 Watts of consumption) :) 


While possibly not making much difference, preserved the original black mask:


Put it all together, inside the microscope base (mounted the LED + heatsink, the step-down converter PCB, the DC connector, and the potentiometer, in the place where the original one would go).

Fired it up and..Bob's your uncle:


See also:



Reconditioning a 50+ year old microscope - part 2 - XY specimen stage mechanism lubrication

Like pretty much every moving part in this microscope, the XY specimen stage mechanism also suffered from dried/sticky grease, preventing the X axis from moving at all. As such like in the previous case, the only solution was to tear it down, clean it and apply new grease and oil.

The separation of the mechanism from the stage is simple: in the bottom of the geared side (where the knobs are) this forelock is moved as shown in the picture, and by moving the Y axis to the end of its travel range, the mechanism is removed:


Then it is possible to separate the parts that compose the mechanism:


For cleaning of the stage it is also interesting to be able to remove this part entirely:


The first thing to remove are the knobs. An Alan and a Philips key are sufficient to remove the two knobs:


As seen above I have also removed the slide retainer tweezer to also clean and lubricate with grease.

The X movement is simply driven by a long worm gear turned by the inner knob. To better clean the worm gear and have access to the sliding rail underneath it, I  dislodged it from the casing by removing the two screws of the holder part (left side of the worm gear):


The Y movement is simply a pinion that rolls against the geared rail in the stage. I cleaned and lubricated both parts with standard mineral oil:


After all the cleaning and lubrication was done (gears with oil and contact rails with grease), it was time to put it all back together and start doing some observations.

Next part will be about how I did the conversion of the specimen illumination to LED.

Saturday, August 27, 2016

Reconditioning a 50+ year old microscope - part 1 - Fine Focus recovery

I thought of giving my daughter a toy microscope, to let her know of some of the things that exist but go beyond what the eyes can see. But from searching in toy stores, I could not find any product that seemed to inspire proper optical quality. Some products seemed both expensive and very basic at the same time. Some products averaged 50 Euros retail, VAT included.

So I tried to take a look at what eBay had to offer. I quickly turned my attention to real lab grade microscopes. Some were obviously very expensive, but a very wide range of offer in price/age/condition could be found. After some extensive browsing, I managed to calibrate my price expectations and define a budget. My reasoning was that given I had a initial intention of buying a 50 Euro toy microscope, now that I was looking at real lab grade microscopes, I should at least relax my budget to be double that value. I even considered going beyond that, if I found an item that I could see, decide and obtain locally (decreased risk).

After some struggle with comparing and watching auctions and bidding on interesting microscopes, I decided to bid on one that was apparently left forgotten (I will go on that later) - a Olympus KHC binocular microscope.



It was still at 50 USD initial price. I bid a few hours before the auction ended, and to my content I won the auction for the 50 USD. It cost another 65 USD to ship to Portugal, but overall it was within the budget I had defined.

Of course there would be some dimension of gamble involved: I was buying something for which I only had some photos and brief description saying that everything was ok, except for the missing 4x objective. However comparing with the photos I could see that the 4x objective was there. Still I decided assuming that it would not be there and without confirmation of the seller if it was or not there.

After a couple of weeks, to my satisfaction the microscope arrived intact in spite of being packaged simply in a cardboard box with some newspaper and air pillows. Surprisingly, it had the 4x objective mounted on it, just like in the pictures from the seller. Like all the other 3 objectives (10x, 40x, 100x) it was in perfect condition. Perhaps given the small profile of the 4x objective, the untrained eye of the seller led him to think the objective was missing...

Like I expected it was just the bare microscope, complete with all funcional parts. It didn't of course had the wooden box and accessories these instruments were tipically sold with back in the days.

The only issue I immediately noticed was related to the lubrication of the parts. The specimen XY movement mechanism was a bit stiff (especially the X axis), and the fine focus would simply not work, in spite of the corresponding knob turning.

I searched online for technical details and diagrams for this microscope, but with limited success. Essentially, the only information I could find was this copy of the instructions manual:


  • http://www.alanwood.net/downloads/olympus-khc-instructions.pdf
And the exploded parts diagram:

  • http://www.alanwood.net/downloads/olympus-kh-parts-diagram.pdf
Both in Alan Wood's web site.

The exploded parts diagram lacks enough detail, with most of the individual parts of the focus assembly not represented in this document.



So I decided to start disassembling, being careful to keep track of what I was doing. First, I started by removing the focus knobs. At this point I truly had no idea how to reach the focus mechanism.


To remove the fine focus, I used a set of pliers of the type used for installing retaining rings. docking its pins to the pair of holes in the face of the fine focus knob:


This exposed the fine focus shaft and the cillindrical  part populated with 5 screws in different areas of the part (from the parts diagram, parts AA 233700 and AA 750800, from left and right side of the microscope, respectively).

After its removal on the right knob, it exposes a nut that retains the coarse focus knob:



For removing it, one must turn the coarse focus knob counterclockwise, while keeping the coarse focus knob for the other side fixed. After that, the coarse focus knob can just be pulled off:



Later I found that I could control the friction of the fine focus knob by adjusting the screws in the bearing removed right after the fine focus knob:


This part has an o-ring which is in contact with the fine focus shaft. Apparently it is made of nylon or eventually teflon. This is one of the very few plastic parts I could find in this microscope.

I must admit I was fascinated with the robustness and precision metal machining work present in this 50 year old instrument. I can only assume this was a very expensive product back in its days.

Considering that CNC, precision automation and a lot of the things we take for granted today were still experimental technologies, at a distance from the mass production arena, it is remarkable to see this piece of precision work, that most certainly had a large share of manual labour.

It worth to remember that this was manufactured in a period only a couple of decades away from the end of WWII, in a Japan that had to struggle to put itself back together.

In this particular bearing, the o-ring is fractured. Given that the damage does not seem to affect the function, I kept there, instead of searching for a replacement ring.

On the other side, the ring was in good condition:



Then in the left side knob, I got stuck with the coarse focus knob retaining bolt. Unlike the right side one, this has the two holes for removal with a special wrench.


As I only had the tweezers, I attempted to remove with these. The part was quite stuck, and in only realized I was applying too much torque on the tweezers when this happened:


So I gave up going in this direction, and decided to disassemble the base of the microscope, in order to have a different angle for accessing the focus assembly. Removed the four screws that keep the base attached to the body of the microscope:


And could now have access to the bottom of the focus and condenser elevation control asssemblies:


The bottom rectangular part held together by four screws, have behind two springs. After removing the screws, to avoid having to remove the springs (and later having the challenging task of placing these again), I simply moved the part to the bottom, keeping the springs under tension:


In order to remove the focus assembly I had to remove the specimen stage by removing the four alan screws that keep it attached:


A cover in the top of the assembly must also be removed in order to allow the focus assembly to slide out of the microscope body:


Then by sliding towards the bottom the part comes off easily:


At this point I still did not undestand how the fine focus mechanism worked. There was indeed a disc that would move to the left or right as I would turn the fine focus shaft, but I could not see any relationship between that happening and the moving of the focus assembly.

That is when I gave attention to the fact that there was an intermediate moving part (sorry for my lack of microscope morphology knowledge, up to this point). So I thought that the spinning disc had to play a role in respect to this part:


So I found that there was a lever that would cause this intermediate part (to which the specimen stage actually is attached) to move, based on the position of the disc. The lever is hidden behind the disc and the pinions, so that it was difficult to identify it at first. As it moves, it pushes against the long, adjustable screw that can be seen on the photo, causing the assembly to be moved up or down:


So, at this point the problem seemed obvious: the dampening grease aged and became sticky (as in most joints in this microscope), and the disc mechanism was no longer able to move the fine focus body. The short travel lenght the fine focus rail has to move clearly must have contributed to cause the part to become stuck.

So I removed the spring that can be seen in the photo, and the cap that encloses another spring. 



After applying considerable force I managed to slide out the fine focus body:



With the fine focus body removed, it was now a matter of cleaning very well all the dampening grease bearing parts, and apply fresh grease (I used standard lithium based grease, which should be ok, even though there are more specialized greases). The cleanup was a particularly time consuming task, as the grease was persistently attached to the metal surfaces.

Another view of the lever that contacts the disc and raises the fine focus body:



Applying grease to the surfaces. In respect to the pinions and toothed rails, I used standard lubricant oil:


After lubrication was done, it was time to assemble everything again, and prey for no leftover parts appearing on the table :)

After assembly and testing the focus knobs I was quite happy with the smooth operation, like if it was brand new. I also had to clean and apply grease to the fine focus shaft friction bearings, and adjust the screws for the appopriate level of friction (not too tight nor not too loose).

The friction level of the coarse adjustment knobs was done as described in the manual, by turning both knobs in opposite directions.

A small test, having as specimen a colony of yeast cells, from a beer yeast pill. Test was performed at 1000x magnification (10x eyepiece + 100x objective) under oil immersion. Fully closed condenser iris for optimal contrast. Photo captured with Nikon D5200 DSLR in manual mode, with a 35mm lens in close proximity to the eyepiece:



In a later post I will detail the removal, disassembly and lubrication of the XY movement mechanism of the specimen in the stage.