Saturday, January 5, 2019

The motions

note: this is a work in progress...


Sketch of the Sandscope instrument


Before coming up with a final design for the sandscope instrument, all of its motion sub-systems will have to be prototyped and experimented with, to be sure they perform well. There will be at least three motions involved in the operation of the instrument:
  • Rotating the plate of glass. The sand grains will be deposited onto this plate, and will advance toward the microscope in small intervals of about 3 mm. Rotation will always go in one direction. There are no limits to the rotation, so end switches are not necessary. Driving the glass plate with a sturdy rubber wheel that is fixed to the motor axis seems a simple and reliable way to solve this. 
  • Adjusting the microscope focus distance. This is achieved by moving the whole camera system up and down. A resolution of at least 0.05 mm is necessary to make proper sets of stacked photos. There should be no detectable sideways motion in the mechanism. otherwise stacking won't work. Since this actuator is limited in its range, end switches will be necessary.
  • Controlling the flow of sand coming out of the container. A proper dose of sand is necessary to obtain an ideal spread of the particles onto the glass surface. The particle density should neither be too high nor too low.  A solenoid controlled valve mechanism could make this work.
Motor vibrations can be an issue when working with sensitive optical systems like this. Vibrations should be avoided at all cost, otherwise the photos that are taken will suffer from motion blur. During the initial experiments with stepper motors, it turned out that they can vibrate at high frequencies when driving them in micro-stepping mode. Vibrations during the actual stepping motion are normal, but it turned out that there can even be some vibration when the motor stands still. When in micro-stepping mode, the rotor of the stepping motor is often held in a position between the full steps by activating two coils simultaneously, with a proper dose of current for each coil. I don't know the details of this current regulation yet, i assume there is pulse width modulation involved at some point, and this is what can make a motor vibrate, even when it is supposed to stand still. Digital aliasing effects in the waveforms that are generated can lead to small oscillations of the motor axis. 
I have decided to also experiment with geared DC motors because they are guaranteed to be motionless when not activated. 




Assortment of geared DC motors under test

I have many geared DC motors in stock. For short and precise motions one would need motors with a high reduction in the gear train, so the outgoing axis turns slowly. I have tested several of such motors, and in principle they are suitable to drive the glass disk and the microscope focus mechanism. Without positional encoders, the action of these motors can only be controlled by accurate timing and speed control. The LM293 driver is used to implement forward and backward rotation. A PWM output of the Arduino is used to control the speed.
Even the expensive swiss precision engineered (minimot) motors make more noise and vibrations than a basic stepper motor. This type of motor will never be as durable and reliable as a stepper motor.




Two of the tested stepper motors

I have many stepper motors, both new and salvaged ones. The above two are new and it should therefore be possible to order extra ones as replacement parts, if necessary. These are candidates for use in the sandscope instrument.

  • Wantai 42BYGHM809, Nema17 form factor, 400 steps/revolution, coil resistance 1.6 Ohm. Extra long version for higher torque. Axis 5 mm diameter, fully round. Ball bearings.
  • MERCURY MOTOR SM-42BYG011-25, Nema17 form factor, 200 steps/revolution, coil resistance 35 Ohm. Axis 5 mm diameter, fully round. Ball bearings.

The Wantai motor seem ideal to drive the glass plate, because of its higher resolution. Smaller steps should result in smoother operation. The coil resistance is so low that the use of a driver with current limiter is mandatory.




2x Polulu DRV8824, 2x opto-interrupter, controlled by an Arduino Micro

Polulu DRV8824
https://www.pololu.com/product/2131

A low-current stepper motor driver module for bipolar stepper motors up to 0.75 A per coil (without heat sink). Uses the Texas Instruments DRV8824 stepper motor driver chip. Supports full step and 2/4/8/16/32 microstep operation.
This driver is a good choice to use with low-current motors. It isn't able to microstep motors with a low coil resistance (< 10 Ohm?). Even the DRV8825 based module, which is a higher current version, isn't able to microstep such motors. The sweet spot of the DRV8824 current limiter is narrow, but easily found by listening to the motor hum and by watching the axis move. Microstepping will fail when the coil current is too high or too low. I have not been able to attain settings that are free of motor vibrations, reliably, nor have i been able to establish completely silent operation, even when the motor stands still.




2x BigEasyDriver, 2x opto-interrupter, controlled by an Arduino Micro

BigEasyDriver
design and documentation : http://www.schmalzhaus.com/BigEasyDriver/
manufacturer: https://www.sparkfun.com/products/12859

A stepper motor driver module for bipolar stepper motors up to a max 2A/phase. Uses the Allegro A4988 stepper driver chip. Supports full step and 2/4/8/16 microstep operation.
This driver turned out to be especially useful for driving motors with low coil resistance. The sweet spot of the current limiter is narrow, but easily found by listening to the motor hum and by watching the axis move. Microstepping will fail when the coil current is too high or too low. With the proper current setting, there will be no noise nor any detectable vibration when the motor isn't stepping. 






Laser setup

For stepper motor position and vibration testing the setup show above has turned out to be very handy: a laser beam is directed at a mirror that is fixed to the motor axis. The movement of the motor axis is magnified substantially when the laser dot shines onto a wall that is meters away. Tiny angular displacements can be observed this way. The lasers turn out to have a sharp diffraction pattern which is helpful to detect the presence of vibrations. Any vibrations in the motor axis will blur the projected image. 




Some 3D printed parts for rapid prototyping

Thanks to my new Creality 3D Ender-3 printer I can design and fabricate functional prototyping parts easily. The parts shown here are used to test the glass plate drive mechanism. 3D printing is quite slow, all these parts together took about 18 hours to print. However, the printer has turned out to be reliable, so once a print has been started, you can go work on other things. The filament used here is Innofil InnoPET natural, which is a sturdy transparent material. Surprisingly strong. It can be bent, but it won't break easily. The accuracy in X and Y (width and depth) is high, the accuracy in Z (height) is disappointing, sometimes it is off by up to 0.3 mm. I will research this flaw and try to find a fix for it. 

UPDATE
I had a good look at the Z drive mechanism, and it turned out that the guide wheels were fixed too tightly. Loosening all these wheels and carefully tightening them again solved the Z irregularities completely. Make sure to stop tightening when everything just tight enough to remove all slack in the mechanism. I can make the wheels slip against the extrusion, by turning them with my fingers, which wasn't possible before. The whole assembly is much easier to move up and down now. No more step loss!

UPDATE
I noticed that all printed parts were slightly slanted to the right. Closer inspection of the printer geometry revealed that the x-axis was not perfectly square to the z-axis. The Ender 3 setup guide gives no warning about this potential issue, and does not advise to take special care when assembling the x-axis. There is some play in the way you can fix the parts together. Unfortunately you can't get at the screws when the x-axis is mounted on the machine, so you can't adjust it to be square while it is in place, and then tighten the screws. Solution: tighten the screws only lightly, so that it is still possible to fine-tune the alignment of the x-axis parts. Then mount the x-axis on the printer, measure the squareness, and fiddle with it until it is square. Then carefully take the x-axis off, tighten all screws well, and mount it again.
   


CBX 1605, Z-drive by RATTM MOTOR



CBX 1605 100mm Slide Stroke Linear Z Axis, RATTM MOTOR
www.ebay.com/itm/113145641019
€88 including DHL shipment from Changzhou, China (arrived after only 4 days!).

This is an industrial Z-axis assembly with a precision ball screw and linear guide, including a strong 200 steps per revolution Nema23 bipolar stepper motor to actuate it. The part is designed for vertical loads up to 30 kg, which is tens of times more than it will ever have to handle. The extra sturdiness and weight of this drive mechanism will help to keep microscope vibrations to a minimum. 

I can't feel any slack in the guide at all. According to the specs the maximal positional deviation is 30 μm 
The screw pitch is 5.0 mm. With 1/16th microstepping of the 200 steps/rev motor, this gives a Z resolution of 1.5625 μm.  This should be more than enough to make stacked sets of microscope photos with different focus distances.

UPDATE

This z-axis has some slack after all. When looking at the microscope image while he camera is being moved up and down, you see a sideways shift. The shift is mostly vertical, and it is caused by the sliding block being driven off-center by the spindle. The block tends to rotate due to the leverage effect. This is a problem when stacking images: the images will be out of alignment. I am considering buying a high precision linear bearing and upgrading this z-axis with it.  





above: Z-drive, below: glass plate drive

In the test setup for the glass plate drive, a rubber wheel with an effective diameter of 10 mm is used,
which is pressed onto the motor axis directly. Combined with a 400 steps/rev motor in 16th microstep mode, this gives a resolution of 4.9 μm per step. Well beyond the minimum requirements!
The final design will likely have an O-ring with an effective diameter of 14 mm, which will give a resolution of
6.8 μm per step. 

Both the glass plate drive and the Z drive mechanisms have been tested for days on end. No anomalies have been detected so far. The stepper motors hum happily, and i cannot feel any vibrations when they do not turn. Both motors warm up only slightly. Passive cooling will suffice. The driver chips on the BigEasyDriver modules get warm to the touch, i guess about 50 to 60 degrees, which is very modest.




SandScope prototype #1

The first setup of all the prototyped parts turned out to be a working ensemble already. The basic functionality of the SandScope is up and running. No automatic sand dispersal and removal yet.

Observing things though a microscope makes their deviations clearly visible. I assumed that the glass disk would be flat enough, keeping the zero plane at virtually the same height. The glass is not flat... there is a wobble of about 0.2 mm, which is in the same range as the height of a small sand particle: very noticeable. Since the instrument will make several photos, each at a different focus layer, perfect flatness is not required. However, in the next iteration i will position a glass guide wheel as close as possible to the microscope lens to maximize the height stability there.

I will try to make all mechanisms as low as possible, to be sure that everything will fit under the perspex dome that will protect the instrument from dust and undesirable human intervention. As a bonus, stability will increase when minimizing the height.




Glass disk drive, prototype #2

The second iteration of the glass disk drive mechanism works well. The rubber dampens the motor microsteps, resulting in very smooth movement of the disk and the sand particles it carries. There is some slippage when testing sequences of clockwise and counter-clockwise motions. This slippage is fairly regular, and occurs when the direction of movement changes. In practice, this isn't a problem, because the disk will always rotate in a single direction.




Detail of the sand being observed

The 4.5 x 3.0 mm large viewing area of the SandScope usually contains 5 to 30 grains of sand. The sand as seen above has not yet been dispersed automatically. I have spread it out in a circle by hand. Ideally, a dispersal mechanism would achieve a more equal density with less dilution to the sides, so that less sand is 'wasted'. The sand handling is the next subsystem to design and implement!




The sand dispenser under test

The very first idea for a reliable and computer controllable sand dispenser that came up turned out to work really well. A thin and flexible silicone rubber tube is squeezed shut by a metal spring. A solenoid is attached to one end of the spring and on demand, it can pull the end of the spring away from the tube and in so doing, opens it, letting the sand particles through. A brief activation of a few hundreds of a second suffices to release a small quantity of sand.
Some refinements were necessary to ensure longevity of this mechanism. Initially the thin metal spring was in direct contact with the rubber tube, and after a few thousands of activations the tube was cut open and sand began to leak. Too much pressure! A lighter spring was used, in combination with a rubber damper where it touches the tube. There is no noticeable wear on the tube even after a million activations. 



Laying down the sand

In order to have a nice homogeneous density of deposited sand, the falling particles go through a spreader that has a few ^ shaped dividers in it. These dividers work as obstacles, the sand collides and bounces inside the spreader, disturbing the gaussian distribution that the sand grains would normally settle into. After some experimentation with the placement of the dividers, the particles come out in a quite uniform random way. 



The next generation of 3D-printed parts

Some of the next gen parts fresh from the printer, ready to be assembled. After the fine-tuning and calibration of the Creality Ender 3 printer, the printed parts come out much better. Squareness is good, the dimensions in X Y and Z are accurate. None of the parts have noticeable warping. Even the parts with a large footprint are nice and flat, and stand stable as a rock on a flat surface. Note that i have used the double amount of clamps to fix the flexible print bed, doing this may have contributed to prevent warping during 3D printing.



The real thing


note: this is a work in progress...

Finding the faces