Coprime Mk1 | a Puzzling Drawing Machine

by Rob Salmon in Living > Toys & Games

300 Views, 4 Favorites, 0 Comments

Coprime Mk1 | a Puzzling Drawing Machine

COPRIME_02.jpg
COPRIME_DETAIL_02.jpg
CoPrime Mk1 | Finally
CoPrime Drawing Machine

A three-knob drawing machine built from a five-bar linkage!... three LEGO motors and a sheet of paper that will not stay still. It has one setting where every joint runs at full speed and nothing appears on the page. Finding that setting is the game. I have still not found it!

Two cranks turn at speeds you set by hand. Two long arms run from those cranks and meet at one point, where a pen sits. Underneath, a turntable rotates at a third independent speed. The pencil is never told where to go. Every line it draws is the exact geometric consequence of three numbers.

You play it by turning three knobs and waiting. That is the whole interface. What comes out depends entirely on the arithmetic between those three speeds, and the arithmetic is where the machine gets its name.

WHY?

I really dont know: Ive always been fascinated with pen plotters but arduino controls etc, are a little outside my expertise (for now) so I toyed with the idea of making a spirograph machine. I had made one using Lego Technic a year before with my sun. We had great fun, with it, but it quickly got disassembled.. But what if it was more permanent, and what if I could control more parameters... (As per usual I forgot to photograph that machine, but if you google lego technic spirograph, you'll get the gist, there are many designs out there) .

As per all of my instructables, this is a loose guide, and of course, one of the reasons that it's entered in the toys, puzzles and games contest, is the making... The putting together is the puzzle, the game is a game called "Problem Solving", thats the best part of making!... & The game is the moment of fun, when it all comes together... the playing...until the novelty wears off!!!

Lastly, have you ever completed a project and wished that you had have documented it better! Thats me, every time!

Supporting FILES are included in the supplies Section.

Supplies

Printed: about 1 kg of PLA!

Refer to attached Sketchup file for 3d geometry. Also attached a zip file with *.STLs. To the best of my knowledge these are accurate - I generated the *STLs over multiple painstaking conversations with a LLM. I talk about this in step 1. I used the sketchup file as a work in progress assembly and trouble shooting file, ultimately modelling the parts that the LLM simply could not compute.

Turntable plate

210 mm square, printed solid. The mass is doing work: it damps the drive and holds the sheet flat.

Ring gear and three roller brackets

An internal ring gear, driven from inside rather than at the rim.

Crank discs ×2

Several pin holes each, so the throw is adjustable.

Coupler arms ×2

I-section, about 195 mm between pin centres.

Worms ×3

Single start. I printed on side, with supports... perhaps a better way (in hindsight) is to print standing up!!

Motor cradles, console box!

These were hand modelled, a bridge too far for AI. Note: the motor cradles were designed to fit Lego L Powerfunction Motors.

Bought:

6 mm stainless rod

Rails . Search Amazon: TA-VIGOR 5Pcs 6mm x 300mm Stainless Steel Round Rods Metal Solid Shaft Bars

3 × LEGO Power Functions motors

Two for the cranks, one for the paper. See the substitution note below before you buy!

LEGO extension cables

So you cut these and not the motors. Search Amazon: ( 2Pcs Extension Cables 250mm Compatible with Lego 8869,8870 Light Switch)

Lego Axels (Size 12) and 3no. Lego axel clamps.

3 × potentiometers

One per motor. Three independent speeds is the entire point of the machine.

(Search Amazon: Gebildet 3pcs DC 5V-35V 5A Mini DC Motor PWM Speed Controller, 6V 12V 24V Variable Voltage Regulator Dimmer Governor Switching Build with LED Indicator)

Plywood rectangle

The base. MDF, Plywood, Whatever... I Painted Mine White, for visual consistency.

M3 machine screws

Assorted lengths, about 20, plus nuts.

(Search Amazon: 1440 Pcs M3 Nuts and Bolts Set, Hex Socket Head Cap Screws Bolts and Nuts Set, Assorted Bolt and Nut Set with Washers, Stainless Steel Machine Screws Assortment Kit for Repair Fastener(M3)

Neodymium magnets

14.5 × 4 mm discs, to hold the paper without tape. Could be any size, just make sure the holes in underside of turntable correspond: these are how the paper gets held down.

Regulated 9 V 2 A supply, toggle, barrel jack

One supply for all three motors. See below. (Search Amazon: V 0.5A/500mA 1.8M Power Supply Adapter with 8 Tips, AC/DC 9V 4.5W Switching Adapter Power Cord for Arduino UNO MEGA/Excercise Bike/Elliptical Machine/Bench Scales and More, UKCA-Center Positive)


Pencil or Pen

2B or not 2B. Note, one of the key design flaws, is that a standard pencil or pen needs to be cut to fit!.. See if you can design this issue out!!


If you cannot get Power Functions. Nothing about the machine depends on Lego. Any 6–12 V geared DC motor with a 6 mm output will do - but you would have to change the geometry of the motor cables. I'd posit that some of my squiggly lines are due to the motors. I used LEGO because I already had three of them and because the motors survive the project unmodified. If you are buying from scratch, small worm-gear DC motors are cheaper and quieter. The power functions motors make a RACKET!!


TOOLS:

A 3D Printer - I used a Bambu labs PS1.

Also, Various screwdrivers & drillbits.

Note on the sketchup file:

This is an amalgam of STLs... generally put together so I could model and place motorhousings accurately. It is not perfect, but it's a good steer. I mean, nobody would actually make this machine anyway!

Note on the STL files:

Provided for inspiration - honeslty i have generated so many STL files here, all i can say is that I THINK these are correct... but really, who would ever want to build this machine exactly as I have done.

A Note on Modelling

LLM SCREEN.jpg
IMG_8290.JPEG
IMG_8292.JPEG
Drawing Machine Assembly | What is it?

As an architect, I've been virtually modelling for a long time. I started with Autocad (yes, It's 3d too!) and soon moved on to a multitude of other programmes. After finally succumbing to the purchase of a 3D printer (for my son...not for me :-)) I felt that being able to model was a bit of a super-power. But alas, sometimes even with a superpower, plain old laziness kicks in.

I work as an architect all day, why would I want to model contraptions in the evening! And so, my experiments with AI began. On a free subscription to Claude (other AI's available). I was fascinated to see that it had the ability to model, essentially to code a 3d volume.... after further testing, behold, it could export to STL files...

So here was a lazy way out, of having parts from screen to printer bed, in a matter of minutes. If only it were that simple.


After the initial novelty, and even wow factor, of seeing what Large Language Models are capable of, designing by conversation became (almost) fun. I mean it's a little like collaborating with a draftsperson...

"Now fillet the edges by 3mm"

"There is a clash at the penholder, fix it" etc.

So after describing the machine, in various plain english prompts, I got to the point that you see in the screengrab. Remember each of those parts was exportable as an STL file, already modelled. Days of prompts later, days of resolving clashes. I got to a point where I felt it was ready to print.


You Solve One Problem. Then You Solve the Next One....and If You Solve Enough Problems, You Get to Come Home

IMG_8303.JPEG

Quote above from "The Martian".....So not as simple as telling AI that you want a drawing machine!

Long story short, the process of printing and assembly, even without the motors, led me to the conclusion. THIS WILL NEVER WORK...

COPRIME Mk0 — cycloid drawbot

See link above, It certainly looks like it works, and feel free to go ahead and try! .It even could animate it, and plot the drawing paths. Pure witchcraft, but ultimately useless. The Skotch Yoke style mechanisms, just produced too much friction, too much lever arm, too many forces... Only by the process of assembling... the dry run process... did I realise that it would never work outside the screen, or maybe outside of a precision milled componentry...lubricated to death... I toyed with the idea of adding bearings... and ultimately resigned myself to a position of closure... It wouldnt work. It wasnt a waste of time, as these things are fun, but it was a waste of filament... or was it?

The Redesign

SKP05.jpg
SKP04.jpg
SKP03.jpg
SKP02.jpg
SKP01.jpg

This is the interesting step that resulted in a machine, that simply never would have been designed like this if done from scratch. This happens in my day job, architecture, when designing a building, we problem solve with builders all the time, sometimes wonderful things happen, borne even of a mistake, how do we push forward!

So I thought of a way to salvage much of what I had.

The Arms

I would utilise the stainless steel rail system, post rationally believing that I could use them to adjust the position of support arms which hold the cranks, which hold the pen.

The Turntable

It was too wobbly, AI had decided to put holes in it, maybe to save filament, but certainly no use for a solid drawing surface. Also, the circlular shape would require me to cut paper circles for every print. I settled on a 210mm x 210mm Square Turntable (The short side of an A4 sheet), and modelled some plastic bearings and a profiled edge, to keep it from wobbling.

In addition, i recessed holes for flat magnets, so i could then use metal washers to hold the paper in place, rather than masking tape.

More Prompts. More trouble shooting. More clashes. Up to Version 11.

At that point I accepted that the AI modelling process would only get me so far. I was able to export the full assembly in *.dae format, take that into sketchup, and solve the problems myself, the old fashioned way.

Moving the worm gears to interface with the cogs. Moving the motors, creating precision housing for the Lego Motors. From sketchup, one can simply, select the component, and export to an *.stl file. It's an efficient process. Once i got 90 % there, I started to print again.

Print the Parts

IMG_8453.JPEG
IMG_8323.JPEG
IMG_8468.JPEG

Again, you get to a point, where you just print... I used a Bambu Lab P1S, and white PLA (which i eventually ran out of, and used a striking Orange) . Print Settings were default PLA settings (with tree supports turned on)

  1. Turntable plate face down. The bed side becomes your drawing surface, so it comes out smooth. Print it solid, no lightening holes. Let it cool on the bed before you take it off, or a 210 mm plate will cup, and flatness is the entire point of the part.
  2. Worms standing on end. The thread is a helix. Lying down, every turn is an overhang; standing up, each layer is a simple ring. 0.12 mm layers or finer, no supports.
  3. Arms and brackets flat. Nothing needs supports if you orient it sensibly. Bambus slicer, has a pretty good auto orient, which I (kind of) trust to do the right thing!

Base and Rails & Motors

IMG_8301.JPEG
IMG_8500.JPEG
  1. Cut and finish the plywood. Mine is painted white, which makes the whole thing read as laboratory equipment rather than a workshop offcut..kind of!
  2. Mount the two rail supports at either end and fit the rods. Friction fit for the rods. The Rail supports are glued (couple of drops of super glue) and screwed from below. Because the prints are essentially hollow. I used a brad to make a pilot hole in the PLA, and drilled and countersunk the plywood, so the screws wouldnt create a wobbly surface. Image bove shows the rails and supports in place (salvaged from the original machine).
  3. Slide the two motor mount arms to the rails. 6mm holes, 6mm Rod. Enough friction to keep in place, but slidable along the rails. Sliding these is how you change the crank spacing, and crank spacing is one of your controls... and this is how I post rationalised keeping the rails!!!
  4. Mount the motor housings to the arms using machine screws. 2.5mm Pilot Hole for a 3mm screw, and a brad point pilot hole in the recieving plastic. Very agricultural, but it worked.
  5. Similar process for the motor axel supports.
  6. I used Lego technic axel, (12 length) to connect the motor to the worm gear.. it should slide through the worm gear, at a push, and not require glue.
  7. Mount the Main Cogs, using 3d printed plastic flared rods. It really felt like bearings were required here...but again somehow it worked.
  8. NOTE: I recall having a few drill bits during the entire process. There are some components that need to be loose, there are some that need to be tight. Common sense tells you which is which. I found that using a drillbit 0.5mm wider than the hole, would ream it out enough to be a loose fit. Test, if it still snags, move up another 0.5mm.
  9. Note, when i was modelling the pins, for various components, especially the penholder, I modelled various 0.25mm incremental increases of diameter. This meant that i had my choice of friction fit washers and clips to hold in place.

Turntable Assembly

IMG_7188.JPEG
IMG_8492.JPEG
IMG_8486.JPEG
IMG_8503.JPEG


A large plate on a small central spindle is a lever. With a 105 mm plate on a 6 mm shaft, any slop at the hub is amplified at the rim.

  1. Fit the spindle and check it upright with a square before anything else. Everything keys off this axis, and a rod a degree out reintroduces every wobble you are trying to remove.
  2. Drop the plate on and mesh the worm with the ring gear. Light contact. A worm jammed into its gear will simply stall the motor. At this point you can fix down the motor and housing for the turntable motor.
  3. Set the three roller brackets so each just kisses the rim. Not tight. The rollers locate the plate, the spindle still carries it. The rollers are fitted with machine screws, same process for pilot holing etc. as above.
  4. Fix the rollerbrackets to the baseboard with standard 1/2 inch wood screws.
  5. Turn the plate a full revolution by hand. It should run freely with no tight spot, and you should not be able to lift any edge.

Holding the paper

Masking tape works, but it lifts the sheet slightly wherever it is applied, and on a machine where a pencil leans on the surface that is a real variable. Magnets are better. I used four of them, recessed into the plate from underneath, leaving a thin skin, so the drawing face stays perfectly continuous with no edge for the paper to catch on. Matching Washers on top hold the sheet down. Keep all of them outside the pencil's reach. A drop of super glue held my magnets in place.

The Linkage, and the One Detail That Matters

IMG_8487.JPEG
IMG_8478.JPEG
linkage_schematic.png

Both arms must pivot on one shared axis at the pen.

The tidy answer is to run the pencil itself through a hollow pin that both arms turn on. The pencil becomes the joint.

  1. Press a bearing into each arm end.
  2. Pin both arms to the crank discs at the same throw radius to begin with.
  3. Join both arms at the pen pivot, one above the other on the shared pin.
  4. Drop the pencil or cut pen in so it floats on the paper under its own weight.

Pen length is set by the frame, not by the holder. The rails cross above the paper, so anything taller than about 100 mm will foul them. A golf pencil is the right answer rather than a compromise. I cut a pen in half for the first drawings and never turned back (though what a mess)

The Coprime Console (Also a Handy Lego Motor Control Unit)

IMG_8383.JPEG
IMG_8384.JPEG
IMG_8396.JPEG
IMG_8488.JPEG
IMG_8565.JPEG
wiring_diagram (1).png

I mean this is a kind of project unto itself, and as it happens, is a really good speed control for lego motors (if you're into that sort of thing)

I modelled the Console Unit and Lid, based on the accurate dimensions of the potentiometers that i had purchased, the 9v DC input, and the switch that I had to hand, and added labelling with the text function in sketchup. To the rear, the console has place for the Power functions lego to lego connectors (No Lego Damaged here)

  1. Cut the extension cables, not the motors. This is the whole reason to buy them. The motors stay original and the entire build can be undone. No unhappy children, no damaged lego.
  2. A Power Functions cable has four conductors. Two drive the motor, two are a pass-through supply for other LEGO parts. You need the motor pair only.
  3. Identify the wires by testing. Simply hold the cables onto a battery until the motor moves. THis identifies the 2 cables to use. Note, they are thin, and finicky to strip. I used a small needle nose pliers cutter.
  4. Wire one potentiometer per motor, all fed from the single supply.
  5. Fit the toggle and the jack to the console box and screw it to the base.
  6. No soldering here. For connecting cables I utilised a 3amp choc block. Similarly the potentiometers and DC input jack i chose, all had screw connectors. Soldering is another days work & I'm terrible at it.

Turn it on, test and troubleshoot. By Miracle, this worked first time for me. Now the motrs turn, and furthermore, you can individually control the speed.

How to Play

IMG_8572.JPEG
IMG_8485.JPEG
IMG_8555.JPEG
  1. Start symmetric. Same throw on both cranks, all three dials roughly level. You should get a simple closed loop. That tells you everything is working.
  2. Change one thing at a time. Move one pin hole, or nudge one dial. Watching what each change does is how you learn the machine instead of fighting it.
  3. Slow is better. Fast is more fun.
  4. Write down the dial positions. This is the difference between a machine you can play and a machine that surprises you. Mark the console with a pencil line and record what produced what.
  5. Layer the drawings.
  6. TO WIN THE GAME - FIND THE STASIS POINT - SEE STEP 11.

Test it virtually here.

COPRIME Mk1 — five-bar drawbot

The Puzzle in the Game

plate_symmetry.png
fig_coprime (1).png
fig_coprime.png
fig_ring.png
fig_rosette.png
IMG_8506.JPEG
IMG_8482.JPEG
IMG_8480.JPEG
IMG_7194.JPEG

The puzzle in the name!

Two numbers are coprime when they share no common factor except one. Four and six are not, because both divide by two. Four and nine are, even though neither is prime on its own.

Think of two meshing gears. If their tooth counts share a factor, the same teeth keep meeting each other and the pattern comes round early. If the counts are coprime, every tooth must meet every other tooth before anything lines up again, so the pattern takes as long as it possibly can to repeat.

Coprime is the setting where nothing repeats, and it is the setting the machine is named for. Basically the machine goes nuts!

Examples of whats possible in the plates above, amd examples of some of the drawings that came out of my machine while testing.

The Setting That Draws Nothing!!

plate_stasis.png

The setting that draws nothing!

According to my AI friend - & Note, I didnt write the italicised text!

...There is one configuration in which every motor runs, every joint turns, the cranks sweep their full circles, and after forty revolutions the sheet carries a single dot.

I have called it the Salmon Stasis...that's right I claimed it first.. (or maybe not!)


The conditions

  1. Both cranks set to the same throw.
  2. Both cranks turning at the same speed, and starting in phase.
  3. The sheet turning at that same speed too — all three dials level.
  4. The sheet centred under the circle the pen makes.

With equal throws, equal speeds and matching phase, the two crank pins never change their separation. The triangle formed by the two arms and that separation is therefore rigid, so the pen holds a fixed offset from the first pin and simply travels in a circle of its own, a circle whose radius is exactly the crank throw.

Every part is in motion and the output is a dot?? It is the only setting on the machine that is difficult to find by accident and impossible to mistake once you have. in fact it may be outright impossible... So the Game is to try to find the Stasis! what a game!


Epilogue

COPRIME_03.jpg
IMG_8569.JPEG
IMG_8465.JPEG

What went wrong?

What the AI did: The CAD that generated say 70% of the printed parts, creating clashes, and solving clashes, and doing its best.

What I did: Everything else... remember, the real errors were found on the workbench.

Finally, Build it, and expect to be wrong!

This is maybe the 10th whole version, despite the fact that I've called it the Coprime Mk1. The first eight or nine could not move. Failures are what make instructables fun.

The Result:

A build that I would never have designed "like that" from scratch. It is a bizarre machine, in and of itself a result of an unusual hybrid of machine and human collaboration.

The GAME is making the TOY. The PUZZLE is how to get there.... Play with it until you get bored, salvage the parts, and onto the next project!

Thank you for reading this far!! What a Marathon. Remember if you are planning on making a drawing machine, start from scratch... This is as much of an instructable , about what not to do!... it's the fun of the build!