My Open Source Rubik’s Cube Scrambling Robot Project – Overview, Demo, and Links to Build Your Own

 

When my son was much younger he learned to solve a Rubik’s Cube in less than a minute. Which is really neat – until you have a kid asking you to mix up his Rubik’s Cube every. single. minute.

This year he’s taken back up to the hobby (and dropped his solve time into the 25-30 second realm) and jokingly asked me to build him a cube-scrambling robot. I said I’d think about it and being able to do it was never a question, but could I do it simply? There are three planes of motion on three different levels – that’s either a lot of motors or moving motors. Then there’s the question of how to hold the cube in place while moving part of it. I didn’t own or know how to use a 3d printer at the time of project conception, either. I’ve gotten decent at machining intricate parts out of metal and wood with regular homeowner tools, but I am glad I acquired a 3d printer for this one. Mission accomplished:  Demo Video Here

**Please note that this is not intended to be a complete tutorial, but rather provide enough information for someone with a certain amount of electronic and general maker skills to more or less duplicate the project without starting from ground zero as I did. Given things like printer tolerances and such, don’t be surprised if tweaks to the 3d model files are in order. There are certainly things I would print differently if doing it again. That said, I will try to answer questions and keep the project maintained**

Naturally, I turned to the internet for examples and found…. nothing useful. I guess it shouldn’t be a surprise, but it’s far easier to find code and examples of Rubik’s Cube Solving than it is to find anything about scrambling machines. Even trying to repurpose the solver robot’s hardware was a bust, because most required specials cubes and/or clamping the cube in place. This didn’t make sense for what was supposed to be a tool of convenience. Thinking about what the machine needed to be at all practical, I came up with the following:

DESIGN PARAMETERS:

  1. No more than two motors
  2. No clamping or special cubes required – just drop in and press go
  3. Per my standard practice – try to use parts I already have in the mad-engineers laboratory

I could give you the long story and go off on a tangent for all the little problems I feel were solved very cleverly, but we’d be here for days. Instead, I’ll just brag about the exceptionally clever, articulating flipper arm. You see, early on I decided to capture the two non-moving rows and lift/lower the cube to the right row, then push a corner to rotate the row part way, and with the same motor reversed use a ram to complete the rotation and square the cube back up. Quickly I realized that the Pythagoras’ ghost demanded I prove myself worthy before he’d allow a single complete rotation.

Obviously, if the flipper did not match the change in position of the moving cube edge, it would quickly bind up. This is also where I learned that the tolerances on everything would have to be much tighter than I expected to prevent binding, missing the flip, or popping corners off the cube. Indeed, even the edges of the color stickers on the cube can catch the flipper and jam up the works, so this one piece has to be a very precise height, and move at a very precise ratio along both x and y axis, but with a force only along y. It has to reset precisely and stay out of the way of other moving parts.

Scrambler FlipperAfter a few tries gravity and springs, I settled on a flipper shaped such that the body of the scrambler would fulcrum it at a precise rate in both directions (yes, kids – algebra and trig are useful after high school). It cost a little extra friction, and the salvaged CD ROM Drive ejector motor struggled at times but I worked that out in the software. Oh, I guess I also thought that my decision to tilt the entire machine 45 degrees and use gravity to help flip the cube without using another motor was also very clever.

So the rest in a nutshell – I did acquire a 3d printer and, aside from having to learn how to use it, was a huge time-saver because it could print and reprint while I slept or worked. The scrambler robot captures the cube in square cutouts that have to be just the right size to allow free movement but prevent tilting when you try to rotate. Indeed, sometimes the stickers catch and the whole thing hangs up if the pieces are .4mm off.  A CD ROM drive ejector motor moves the flipper piece we just talked about and reverses to ram/flatten the cube. The same motor also moves the upper tumbling/flip mechanism on top of the machine.   This motor occasionally stalls flattening the cube and I kinda wished I used a more powerful motor, but inserting some code to detect incomplete rotate and retry seems to have handled the problem.  A stepper motor I had lying about serves to precisely position the cube up and down within the chamber.

PARTS LIST:

  • Filament – I used PETG, but if I did it again I might use PLA+
  • Arduino R3 Clone
  • Old Computer DVD Drive ejector motor and frame
  • Nema 17 Stepper motor
  • (2) Velleman L298N Dual Bridge Motor Controllers (There are probably better choices, but they had these in stock at my local Microcenter. I only use one of two channels for the CD Drive motor, the stepper requires both channels.)
  • (3) End Switches. I like that the ones I used have LEDS built in, but that is optional
  • I2C 16×2 LCD display
  • 12V power supply
  • 6mm Timing belt and sprocket for stepper
  • Rollerblade bearing and some 3/8 (or was it 5/16?) nuts, washers, and a bolt.
  • Felt or rubber stick-on pads for feet to avoid the Mrs from complaining about the vibration noise
  • Bunches of m3 screws – nylon and steel

 

I think that about does it for parts – not too much. If requested, I’ll try to get you an exploded drawing with part numbers, but for the most part, I think you’ll be able to figure out what goes where with between examining the file I made these pics with on Thingiverse, and pausing the video to study it.

ExplodedMontage

In a lot of places, I used a tap to thread the plastic itself instead of using nuts. Be careful, not all of the holes are already the correct size. Early on I wasn’t sure what size hole to add into the stl, so I erred on the side of smaller so I could drill as needed. Also, in some places, I wasn’t sure where I’d be fastening parts so I didn’t even draw in a pilot hole  – I just drilled where needed. I printed with pretty thick walls so I’d have plenty of material to hold threads, etc. In a couple of places I use nylon screws as guides for sliding parts.

***Please bear with me as I take a minute to organize some files and get some other work done. Keep an eye here for the next day or so as I complete this post. Meanwhile, you can access the code and stl files here on github. Schematic forthcoming. Thanks for your patience – Lloyd 5/21/2019***

 

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s