Experiments in optics and image processing

After successfully mating a web cam with my microscopes (http://www.thingiverse.com/thing:216821) and telescope (https://www.youmagine.com/designs/web-cam-adapter-for-meade-telescope-eyepiece), I decided to design and print adapters to mount my Droid Turbo phone on the same scopes (https://www.youmagine.com/designs/microscope-adapter-for-droid-turbo-phone and https://www.youmagine.com/designs/droid-turbo-phone-to-telescope-adapter) so I could shoot higher resolution stills (21 Mp) and 1080p (and even 4k) video.   The telescope adapter fits over a Meade 32mm focal length Super Plössl eyepiece and provides about 47X magnification with the telescope.  I printed a similar adapter for my surgical microscope.

IMG_0995_crop

 

 

 

 

 

 

 

 

 

 

 

 

The telescope adapter firmly grips the phone and the eyepiece.

 

IMG_0993_crop

 

 

 

 

 

 

 

 

 

 

 

 

Initial tests were a little disappointing.  The combination of the phone’s camera and the telescope’s optics has significant pincushion distortion.  The image has only been mirrored L-R and scaled down (original is 21 Mp).  Note the lack of contrast (looking through 1/2 mile of humid air) and the curves in the power line and pole, and even the grass line:

pinch test original

 

 

 

 

 

 

 

 

 

A quick search found that the Gimp has built in transform tools to correct (or create) lens distortion.

 

gimp

 

 

 

 

 

 

 

 

It only took a couple minutes of messing around to get acceptable results.  Here’s the same image with the pincushion distortion corrected (whole image), contrast stretched and white balance corrected (rectangular area).  The pole, power line, and even the grass line now look straight.

pinch test corrected

 

 

 

 

 

 

 

 

 

And here’s the final image with all corrections and cropping applied:

final

 

 

 

 

 

 

 

 

 

 

Next step: photograph known square grids through the microscope and telescope and then create and save some preset corrections to apply with Gimp.

I wonder if something like this exists for video.  Hmmmmm…

 

 

 

 

 

Son of MegaMax Enters Instructables 3D Printing Contest

Many 3D printers being given away as prizes!  If I win one I’ll be donating it to my son’s school or other school or library that would like a machine and doesn’t already have one.  To do that I need your votes!

Son of MegaMax

Son of MegaMax

Please see my Instructable here:  http://www.instructables.com/id/An-Almost-Reliable-High-Precision-3D-Printer-Son-o/and vote for me by clicking the little red “vote” ribbon in the upper right corner of the start page.

Thanks!

http://www.instructables.com/id/An-Almost-Reliable-High-Precision-3D-Printer-Son-o/

Sunday Morning Project – A 3D Printed WebCam Mount for a Telescope

I recently acquired a new eyepiece to replace the damaged one that came with the Meade ETX-90 telescope I bought at a swap meet last year.  I decided it needed to have a web-cam mount so I designed and printed one that is a variation of a previous design for a microscope.  It took about 20 minutes to recreate the CAD file in DesignSpark Mechanical, and about 90 minutes to print on Son of MegaMax.

This thing has an odd shape to accommodate the odd shape of the camera.  I designed the adapter in two pieces so it could be printed without any support material.  After printing the two pieces were glued together with a little super glue.

Unassembled 3D printed WebCam adapter and eyepiece.

Unassembled 3D printed WebCam adapter and eyepiece.

 

Assembled adapter on the eyepiece.

Assembled adapter on the eyepiece.

 

Telescope with WebCam mounted.

The adapter fits over the barrel of the 32mm fl eyepiece and stays put.

 

I shot a short video to test it and it works perfectly!  The cars driving by are about 1/2 mile away.

 

If we ever get a clear night I’ll try shooting Jupiter or Saturn and then run Registax to enhance the images.

Files are here:  https://www.youmagine.com/designs/web-cam-adapter-for-meade-telescope-eyepiece

Son of MegaMax Lives!

MegaMax was a great 3D printer, but it was time for some changes.  He was difficult to transport because the electronics were in a separate housing with many cables to disconnect and reconnect, barely fit through doorways, and required a positively gargantuan enclosure to keep the temperature up to control ABS delamination.  Though it hurt to do it, I tore him apart and did a complete redesign/build into a form that is more like what I would have done had I known anything at all about 3D printing when I started building MegaMax.

I reused what I could including a lot of the 8020 extrusions in the frame, the Z axis screw assemblies and drive belt, and the X and Z axis motors.

Changes include:

  • ball screw drive Y axis with high torque motor- precise but noisy
  • linear guides in X and Y axes instead of 1/2″ round guide rails and linear bearings
  • SmoothieBoard controller instead of Arduino/RAMPS
  • BullDog XL extruder and E3D v6 hot end
  • RepRapDiscount graphic LCD control panel
  • narrower frame design without giving up print volume- easier fit through doorways!
  • polycarbonate panels to enclose the print area yet provide a clear view of the print
  • electronics in a drawer for easy service and transport and neater appearance
  • DSP motor drivers and 32V power supplies for X and Y axes
  • Liberal use of screw terminals to make servicing easier
  • Modular X and Y axes that can be removed for service and replaced in minutes.

SoM will be making his public debut at the Milwaukee Makerspace very soon…

Son of MegaMax electronics drawer

Son of MegaMax electronics drawer

Side view of Son of MegaMax

Side view of Son of MegaMax

 

Our woodshop has a Router table!

The woodshop now has a Rockler router table! Thanks to Bill M for donating the table and James for adapting the plate to an existing Craftsman router we can now use this fantastic router table. The table has a convenient switch(visible in the picture with a large safety STOP button), an adjustable fence, anti-kickback finger, slots for jigs, and is conveniently placed on wheels so the whole unit can be wheeled to where ever it is needed. If your wondering “what the heck is a router table, or a router for that matter” then check out the links below to get started.

Some great information on using a router table from Rockler is available here:

A great video for absolute router beginners, Steve Ramsey also has a bunch of other great woodworking videos:

How to make a picture frame using a router table, another Steve Ramsey YouTube video:

An overall pic of the router table.

An overall pic of the router table.

A tight picture of the top of the router table showing slots for clamping  jigs, fence, and anti-kickback devices.

A tight picture of the top of the router table showing slots for clamping jigs, fence, and anti-kickback devices.

 

A close up shot of a craftsman router mounter under the router table

A close up shot of a craftsman router mounter under the router table.

Update on the Never-Ending Printer Project

I installed the Y-axis screw drive in MegaMax using the old NEMA-23 stepper motor.  A couple really good things came from this:

1) I can now adjust the bed leveling screws from the underside of the bed using thumbwheels instead of a screw driver.  I know, I know, everyone else in the world has been able to do this from day 1…

Thumb screw for leveling print bed.   Screw is threaded into teflon block.

Thumb screw for leveling print bed. Screw is threaded into teflon block.

 

 

 

 

 

 

 

 

 

2) Unlike everyone else in the world, with fully supported linear guide rails, the print bed does not move in any direction but along the Y axis.  In the old scheme, with the end-supported round guide rails, the rails would flex and the bed would move up and down when applying pressure to it (sometimes even the screw driver pressure to adjust the bed leveling screws).  Now, if the bed moves at all in the vertical direction it’s because the bed plate (1/4″ aluminum) itself is flexing!

A couple bad things were also discovered:

1) The vibration and noise problem I was hoping to solve has not been solved.  It has been made worse, though the character of the noise is improved to musical tones instead of just harsh buzzing and rattling.

2) Several failed test prints at ever decreasing jerk, acceleration, and speed settings have demonstrated that the old motor simply doesn’t have enough torque to drive the screw reliably at reasonable printing speeds.

Shift occurred in Y-axis due to insufficient motor torque.

Shift occurred in Y-axis due to insufficient motor torque.

 

 

 

 

 

 

 

 

 

 

 

 

Further research into the first problem indicates that the vibration and noise are inherent in using steppers, and worse in MegaMax than in machines that use NEMA-17 motors because of the higher detent torque in the NEMA-23 size motors.  Detent torque is the little bump-bump you feel when you turn the motor shaft by hand.  The solution to the problem is to use a good driver for the motor and a higher voltage power supply.  The little A4988 chips in the Pololu drivers on the RAMPS board are very unintelligent- all they do is provide microstepping.  They work OK for NEMA-17 size motors because of the speeds and low detent torques in those motors.  When used with NEMA-23 motors the driver limitations become apparent – as they have in MegaMax- lots of noise and vibration.

Good stepper drivers are DSP based and automatically sense resonance and damp it electronically.  They use phase controlled sine wave currents to drive the motors smoothly.  Fortunately, DSP stepper drivers for NEMA-23 size motors are pretty cheap.   Here’s video of the DM542a driver pushing a NEMA-23 motor around.  I have ordered a DM542a driver.

The best power supply for stepper drivers is not a switcher, and running steppers from a switching supply will often result in a dead power supply.  I will be building a simple, unregulated transformer, rectifier, and filter cap supply to go with the new driver.

Next came the question of how to determine how much torque is needed to properly drive the Y-axis.  A bit of research took me here: Motor size calculator.  You just select the scheme for which you want to size the motor, enter the appropriate data, and it magically tells you how much torque you need to do the job.  When I ran the numbers on MegaMax, it told me that I need about 350 oz-in of torque (about double the torque of the motor I have).  I did a quick search and found a Chinese made (of course) 425 oz-in motor for $50.  Also on order…

The motor mount I am using is designed for a NEMA-34 size motor with which I use an adapter plate to allow the NEMA-23 motor to fit.  Since I’m buying a new motor anyway, why not just get a NEMA-34 motor?  It turns out that the best stepper for the job is generally the smallest motor that can provide the necessary torque.  A NEMA-34 motor could provide much more torque but the detent torque and rotor inertia would work against smooth and fast operation, and require a bigger power supply.

Back side of MegaMax showing motor mount, adapter plate, flexible coupler, and drive screw  in Y-axis.

Back side of MegaMax showing motor mount, adapter plate, flexible coupler, and drive screw in Y-axis.

 

 

 

 

 

 

 

 

 

 

 

The ATmega2560 and RAMPS boards will be replaced by a SmoothieBoard.  It has a much faster processor, much better connections for motors/external drivers, etc.  It currently lacks an easy way to add an LCD controller, so I may have to connect to a computer to start prints up (it has ethernet and a built in web server so it can be accessed from any computer on the network).  When a clean way to add an LCD controller becomes available, I’ll add it.  SmoothieBoard review

 

The never-ending 3D printer project

MegaMax has been and continues to be my main project for the last 2+ years.  I am currently working on some upgrades that will make him more Mega and even more Max.  The Y axis is being converted from belt drive to screw drive and the round guide rails are being replaced with linear guides and bearing blocks.  The X-axis will also get converted to linear guide and bearing block and change from 5mm pitch belt to 2 mm pitch belt drive.  I feel confident saying that once these modifications are complete the flaws/errors in prints will be due primarily to the nature of liquid plastic squirting through a nozzle, not positioning system errors.

I recently updated my web site with a sort of historical look at the project, including all the mistakes I’ve made along the way and the often failed attempts at correcting them.  Here is the page that shows how it all started, how it has ended up, and where it is going.  http://mark.rehorst.com/MegaMax_3D_Printer/index.html

Don’t ask me why I do this-  I have no choice.

MegaMax beginning

From this…

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

MegaMax present state...

To this…

MegaMax is Too Noisy

As part of my effort to reduce the noise and vibration in the Y axis, I am going to try using a screw drive instead of the 5mm pitch belt.  I rescued a screw drive assembly from a big XY table but it uses a 200W servomotor for which I have neither power supply nor drive electronics.  Never fear!  The motor was a NEMA-34 size, so I designed an adapter to mount the NEMA-23 stepper that MegaMax uses in the NEMA-34 motor mount.  Next I needed a shaft coupler- the screw has a 9mm diameter attachment and the NEMA-23 motor has a 1/4″ shaft.

Adapter plate on NEMA-23 motor

Adapter plate on NEMA-23 motor

 

 

 

 

 

 

 

 

 

 

 

 

 

I used DesignSpark Mechanical to design the motor mount adapter and  flexible shaft coupler.  I uploaded the motor adapter to Thingiverse (http://www.thingiverse.com/thing:526424) and it proved surprisingly popular so I designed another that adapts a NEMA-23 mount for a NEMA-17 motor (http://www.thingiverse.com/thing:526443).  I had to make two attempts at the flexible shaft coupler- the first design proved a little too springy and flexible, so I tried again with a more beefy design.  It turns out it is pretty easy to design this sort of thing in DSM.  I probably spent 30 minutes on the first one and about 10 minutes on the second one.

I sliced in Cura because Slic3r was having some problems.  The prints look a little rough because of all the support material required to print the springs, but they work fine.

Flexible shaft couplers

Flexible shaft couplers- not-so-springy and super-springy.

 

 

 

 

 

 

 

 

 

 

 

 

Adapter and shaft coupler on motor

Adapter and shaft coupler on motor

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Motor mounted on screw assembly

Motor mounted on screw assembly

 

 

 

 

 

 

 

 

 

 

 

 

I’ll post an update when I get the screw mounted on the machine.

 

 

$5 Upcycled Desk Clock

Last summer I came across a collection of car parts at a garage sale; instrument clusters, lights, gauges, and some digital clock displays.  For $5, I became the proud owner of a JECO Japan, vacuum fluorescent clock display.  The plastic housing held all the clock electronics, membrane buttons for setting the time, and a four-pin connector.  After powering it up, I realized one of the pins could be used to dim the display, which is a pretty nice feature to have.

I’ve worked on it off and on for a few months, but finally decided to finish it this weekend.  On Saturday, I tweaked some dimensions and laser-cut the final enclosure.  I wasn’t happy with the button holes and text I had on the front of the first iteration, so I got rid of them for the final.  You can adjust the time by slipping a jeweler’s screwdriver or a paper clip through a gap in between the plexiglass sides and pressing the buttons to add hours or minutes. 

I added a small single-pole, double-throw toggle to switch between bright and dim, then soldered the connections before closing it up.  The whole thing is clamped together by a single #10-32 machine screw and a wingnut.  The final result doesn’t look half bad.