Introduction: Earth-Moon Model (CNC Tellurion) From 3D Printer Parts
While walking my grandson home from school about a year ago, he asked me why the moon was visible in the sky during the daytime - and I found it difficult to explain without a visual aid. I started thinking about building a Tellurion (Earth-Moon-Sun) model. The problem with gear driven Tellurions is that they have only one "structural degree of freedom" - the crank has to be continuously turned to get a position. If you wanted to see moon-earth-sun alignment on a certain day - i.e. "Where was the moon at the time i was born?", a model is needed that could have any parameter aligned independently as well as show the natural progression.
My first prototype used the normal clock/geared tellurion drive method (tubes inside of tubes with a common rotational center) but with stepper motors, and had the moon lifting +/-5.14 degrees on a tilted plate. The moon's orbital tilt is +-/5.14 degrees - but I had missed the fact that due to the great distance the moon is from the earth, +/-5.14 degrees orbital tilt actually makes the moon appear above and below the earth – so the model needed much more lift. DOH! ( "why the moon's orbit is tilted" ).
Video below is sped up 4X over the maximum speed I could get before the Z drive started to slip..
Coincidentally, I purchased (unseen) a used old 3D printer that I had planned to make into a laser printer. The printer (a Mixshop Mix II) was not as advertised and was damaged beyond repair. (Z drive wooden rear board was broken). I thought it might be a better path to making a Moon-Earth-Sun model using the 3D printer's parts - the Earth rotation and tilt use the X and Y drives , while the moon rotation around the earth is the Z axis, and the moon orbital tilt uses the Extruder drive. The Sun lamp can be powered from the variable speed cooling fan output on the 3D printer board, and the elliptical orbit is indicated with inexpensive SG90 servos wired to the printer board's servo outputs. Using astronomic software (SkyField ), it is possible to get accurate coordinates of the current positions, drive to that position with G-codes, and thus have the model constantly showing current positions in real time. (I think it is astounding that the globe is being positioned by JPL NASA data!) Essentially, it is a 3D printer that's purpose is to spin a earth globe, rather then move a filament hotend.
My hope is to have my final build end up somewhat in the style of a table lamp with a "steampunk" look to it. (i.e. vintage globe, antique gauges, bronze filled printed gears, leather somewhere?) and would appreciate ideas to help achieve this. As well, as it will likely be used for teaching (Grades 7-8) , any suggestions on what/how to demonstrate would also be welcomed.
Step 1: Hardware / Software Overview
The model is supported by three 3D printer 8mm hardened chrome rods in a 51mm radius triangle, that as well as provide support, are rotated by the three outer stepper drive motors. The earth rotation and tilt (precession) are driven by Sun-Planet herringbone gears – two of the support rods drive their respective fixed planet gear to rotate the center sun gear. The planet gears idlers are pressed onto an axial roller bearing, with the drive gear for that axis fixed to the shaft (1st picture above). The earth gear rotations go up to a double crossed shaft helical gear set to rotate the earth, while the earth precession center gear rotates the crossed helical assembly. The moon rotation is supplied by a sun-planet-ring gear with 2 of the planet gears rotating on the support rods while the outer herringbone gear ring holds up the moon. The remaining support rod drives the moon rotation through a second 5mm rod beside the support (because the gear has to slide up and down), then through the fixed planet gear to rotate the outer ring. The moon's orbital tilt is provided by a T8 lead screw and nut (8mm rod with 2mm pitch, 4 starts) , with a plate underneath keeping everything aligned and separating rotation from lift. This is allowed for by a linear bearing inside the axial roller bearing. (This bearing arrangement came about after numerous iterations of trying other many other methods ). The sun-planet-ring gears are herringbone (double helix), so the moon outer ring can be supported by only the gears.
Stepper motor driving is done via a RAMPS (or equivalent) running Marlin firmware (http://marlinfw.org/ ) for G code translation. A Raspberry Pi running Raspian sends G codes via Python Serial, which gets its position information from Skyfield. All are incredibly clever open source software. This drive setup is standard 3D printer hardware/software, with the exception of Skyfield – I know very little about astronomy, and assumed getting the current location and position of the earth/moon would be the most difficult part – but Skyfield is amazing, well documented, and has clear examples. The hardest problem to overcome was the endstop for moon rotation - 3D printers have 3 endstops (XYZ), but none for the extruder. I tried using "filament out" and "dual endstops" as a work around - but could get neither to work. I found mention of an Extruder endstop ("Marlin Endstop issue" ), which works, but has to be done in an explicit order to work reliably. Two control boards ($22 each) running XY to earth motion, and the other board's XY to moon motion would give more options and make endstops easier.
- My ping-pong ball moon, should likely be a printed bump moon.
- The printer control board can support a fifth stepper motor, so the assembly could be made to rotate around a center sun shaft,using a windmill slip-ring (10 amp $17) to get 12 volt power to the arm ,and have the electronics rotate with the assembly.
- Additional gauges are possible (4 in total), moon phases (a white background with a black disc moving on the servo arm below a second layer with a hole?), moon illumination percentage, earth-sun distance are available via Skyfield.
- The sun could be RGB leds that randomly change colours to simulate swirling gas or sunspots.
- The globe could have a small LED sticking out (with battery inside) to show "You are here".
Step 2: Gears
Herringbone (aka double helical) teeth are used on all gears, except for the crossed shaft helical gears on the top earth rotation. (a beveled herringbone gear is difficult to do, and the cross shaft helicals made the 23.45 deg tilt easy to do). Spur gears are loud and seemed difficult to reduce backlash, while helical gears have a axial thrust that moved the gears on the shafts. The herringbone balances the axial force, but this force is trying to split the gear through the center line (see attached picture of split gear - very low infill test gear) - ensure your 3D printer is not under-extruding. (layers can separate if not fused completely). The planetary herringbone gears used to rotate the moon have to follow some planetary rules to work properly - with the three fixed posts on the planets, the sum of outer ring teeth plus the sun teeth , then divided by 3 has to be a whole number (see attached picture) to ensure no binding of the gears.
All gears were printed with PLA filament, 1.6mm wall/top/bottom (0.4mm nozzle) and 25% gyroid infill at 0.1mm layer thickness. They will be slightly tight, and can be run in using a drill to spin the drive rod to fit the gears. Once rotating smoothly, I lubed everything with SuperLube (a plastic compatible, clear grease).
When rotating the upper earth tilt (earth latitude), one has to compensate for the fact the globe spins while positioning the tilt because the first gear isn't moving while the others rotate about it. Because the three gears are all 21T (1 to 1 ratio), if I moved the earth latitude for example +30 degrees, I would move the earth longitude +30 degrees to put longitude back to where it was - except it didn't go back to where it was. (see first picture above - all 3 gears are identical with 45 degree helical) After an embarrassing amount of time, I realized that I could correct it if I rotated longitude twice the difference in the latitude change - and then realized the right gear and left gear were rotating in the same direction.I of the two gears has to be printed with the pitch at -45 degrees helical. DOH!
Step 3: Tools Needed
Standard hand tools (screwdriver, hammer, pliers) are needed, as well as some homemade tools: The 1/4" black pipe sections and female-female extender are used to place the bearing onto the shaft. The shaft outside diameter (8mm OD) is the same as the bearings inner diameter (8mm ID) - but the rods seem to vary in diameter very slightly, some will slide on easy, others take a bit of force to move. Place the pipe on the inner race and hammer on the pipe with the shaft base supported on the bottom. To seat bearings into gears or mounts, use an 8mm bolt and nuts with large or small washers to press the bearing in. If the rod sections have to be cut, an angle grinder makes quick work of it - then grind a slight chamfer on the end.Access to a 3D printer is also required.
Step 4: Parts
My model's parts were from a used printer bought on Kijiji. 3D printers are moving away from 8mm rods to extrusions or flat linear bars - so surplus stores may have some parts.
Parts from bottom to top (prices from Amazon USA):
- Stepper motors Nema 17 0.59N·m / 84oz.in (4) $48
- Printer control board (1) RAMPS or MKS $23
- 5mm - 8mm couplers (4) $9
- 8mm chrome hardened rods (3) 350mm, (1) 120mm $26
- 8mm T8 2mm pitch 4 start lead screw $12
- 608 "skateboard" bearings (22) $10
- 6202 bearing (3) $10
- 8mm washers (27) $10 (for 100)
- 5mm chrome rod (1) $6
- Optical sensors (4) $10 (for 5)
- Earth Globe 170mm dia (1) $4 Dollar Store
- Moon ping-pong ball (1) $1 Dollar Store
- 3D printer PLA filament 0.5kg $10
- Raspberry Pi Zero W $10
Step 5: Mechanical / Electrical Assembly
In my first assembly, I built the top "earth module" independent of the bottom "moon module" (first picture), and joined the two sections with printed 8mm-8mm couplers. The (blue) motor couplers in the second picture above were also 5mm-8mm printed couplers - but the printed couplers slipped, especially on the Z lead screw, which tended to pull up when driving down fast.So, I rebuilt it on continuous rods with metal couplers on the motors. I think building the upper "earth" section first from the top, and then doing the moon section from the bottom once the earth module is tested and working.
Print the 4 triangular bearing supports, press the bearings in one of them, and evenly pound the bearings down to the height of the top moon support - 260mm from the bottom of the rod. With two washers on each rod, place a second bearing support (earth lower support) evenly onto the rods. Press the 2 idler gears on 608 bearings, and with the fixed gear and the sun gear in the center, pound the 4 pieces into place evenly. The fixed gear is installed without a washer between the bearing and spacer, but an additional spacer on the bottom to keep everything at the same height - the spacer can be super-glued to the gear later to ensure it doesn't slip on the rod. Use the printed spacers between each section with metal washers between the plastic and the bearing (so the plastic spacer doesn't rub on the bearing shield). With a support under the center bearing, and two washers between the two supports, hammer the center 120mm 8mm rod through the sun gear and into the top center bearing only. Install another bearing support and repeat the above to add the earth tilt gears. Place bearings inside the center tilt gear at the top and bottom. Test the turning of the two driven rods, and if too tight, spin the rod with a variable speed drill to clean the bearing up. Once the gears are turning nicely, they can be lubed. (I used SuperLube).
Tip the assembly upside down with the bearing support on the tilt in a hole so all weight is on the three outer 8mm rods only. Assemble the sliding moon planetary gear set by pressing the planet gears onto the 6002 bearing for the two idlers, then pressing a LM8UU linear bearing into the 6002 roller bearing. Press the fixed planet onto a linear bearing. Press the T8 nut and spacer into a 6002 bearing. While evenly pressing the two idlers linear bearing into the plate, pulling the sun down with it until the flange of the T8 nut touches the plate. Bolt the T8 nut into place. Place the plate assembly into the outer ring gear, with the planets aligned to the 120 degree holes in the outer ring. Slide this assembly onto the top edge of two of the support rods. (With a second person) Place the drive gear on third rod into the ring gear, and with one person pulling outward on the drive rod the outer ring will flex enough to open up the gap between the sun - allowing the fixed planet to mesh with the sun. The whole assembly can be slid off the rods and everything will be supported by the herringbone gears. Ensure the gears are all lined up evenly at 120 degrees apart (printed holes on gears). Install the 5mm drive rod coupler onto the 8mm rod with a washer between it and the bearing, then insert the 5mm rod into the coupler. Slide the moon assembly onto the rods, install the lower 5mm drive rod coupler, a washer, and then the bottom bearing support triangular plate. Insert the 8mm lead screw through the bearing, turning it into the T8 nut until it just goes into the bearing at the top.Spin the drive rod to exercise the gears and wear them in, and lube. Mount the assembly to motors via the metal couplers. Turn it upright onto the motor base. Install the moon support bracket onto the outer ring, a 1/4" wooden dowel is pressed in to support the ping-pong ball at the top.
Upper drive module:
Install the helical gears onto the globe 8mm rod, and on the top center rod of the earth module. Insert the center helical in the bracket assembly (2 washers on each side of spacer). Lower the bracket over the top sun gear - leave the through bolt loose for homing adjustments later.
The stepper motor leads will plug into their respective connections on the printer board (X,Y,Z,E), as will the optical endstops (X_Min, Y_Min, Z_Min) - except for the endstop on the outer moon ring (E). This will plug into the Z-Max position, which is remapped in software to E_Min. The +12 volt power can be most any power supply - rated at about 12 volts / 3 amps.
Step 6: Files: 3D Printing STL , OpenScad Files, Marlin , Python
I am not a professional programmer - remember this when looking through the Openscad, Marlin and Python files! As well, I know virtually nothing about astronomy - I just use Skyfield.....
To change gears (literally), the library gears.scad is needed (from Thingiverse).
The Python script does the XYZE homing first, then goes into a continuous loop getting the position from Skyfield, converting to 360 degrees for XYE and a linear change for Z. Corrections are made to longitude to compensate for changes to longitude with a change in latitude. (through the gears). Hopefully, the inline comments will explain what each section does. For longitude, the Subsolar point is used to position the earth to the sun, and latitude is taken from the angle to the sun. The moon latitude (orbit tilt angle) from the ecliptic is taken from the sun, and the longitude is taken relative to the earth.
To test setup after loading Marlin, after the download, leave the Ardunio IDE open, and go to Serial Monitor. Set the serial port to match your PC, and type G Codes to command moves: i.e. G1X30F3000 will move X 30 degrees at a moderate speed. If desired, Python and Python Serial could be loaded on the PC and Skyfield_Serial.py run from the PC. To run on the Raspberry Pi, just change the serial port line in Skyfield_Serial.py to match the Raspberry Pi com port.
Step 7: Software Loading
The printer control board is loaded with the Marlin firmware files. I have attached my complete Marlin files (zipped) as there are many changes to files for Extruder endstop, bypassing temperatures limits, and speed / acceleration / jerk settings.The firmware download is nicely detailed in the Instructable in this link.
The Raspberry PI firmware can also be installed with another Instructable: Raspian Instructable. Python is used on the RPI to send G Codes to Marlin via USB serial.
(Python is pre-installed in Raspain, install python serial )
>sudo apt-get install python-serial
To make sure the Raspberry Pi is keeping the date/time correct, enable the Network Time Protocol
>sudo apt-get install ntp >ntpq -p >date
Skyfield requires Numpy for calculations, and doesn't seem to like being installed via pip so:
sudo apt-get install python-numpy
(install pip installer for the rest of Skyfield)
>sudo apt-get install python-pip
>pip install skyfield
Enable ftp to send Python files to Raspberry PI
>sudo apt-get install vsftpd
Ensure time is correct on RPI - NTP gets time, but check timezone is set.
Participated in the
Epilog X Contest