# BBC Micro Bit projects

## IN THIS ISSUE, WE ENJOY THE MATHEMATICS OF CYCLOID CURVES TO MAKE A DRAWING MACHINE — AN EASY-TO-BUILD PROJECT TO DRAW INCREDIBLE GRAPHIC TEXTURES AND PATTERNS

A drawing machine in the spirit of the 1960s Spirograph

Acycloid geometrical movement has a number of applications in the study of equations, as well as in mechanics, science, and other fields.

‘Cycloids’ — curves traced from a point on a circle rotating along a linear path — are involved in a number of equations in trigonometry and geometry. For example, cycloids are used in mechanics to calculate the movement and size of the gears to design gearboxes for speed reduction.

As shown in the cycloid scheme

(page 73), if we ideally put a pen where the rotating point lays, it draws a series of chained arcs. Things become more interesting if we apply some constraints to the circle with the drawing point.

Suppose, for example, you add support to the rotating circle by placing the point external to its circumference — the design is more interesting than the previous scheme but is it always a series of repeated curves along a linear path.

Toys from the ’60s

Do you remember the Spirograph from the 1960s? When I was a child I spent hours making designs with this simple but fascinating toy. It is based on cycloid maths, where the ideal point on the circumference rotates inside a larger circle instead of a straight line; every full rotation the curve is replicated, shifted by some circular degrees, creating the drawing texture. Spirograph drawing tools are limited to creating circular drawings.

Following the same mathematical principle of the cycloid are the more complex curves of the same family, named ‘hypocycloids’.

How can we make mechanical drawings over rectangular paper sheets? We should connect two cycloid movements interacting together. Using a BBC Micro Bit and a few more components we can easily create a versatile drawing machine.

Mechanical principles

Before designing the parts in practice, let me explain the mechanical principle.

Do you remember the Spirograph from the ’60s?

Based on the mathematical assumptions of cycloid movement, the drawing scheme (top right page 73) shows the minimal mechanical components to generate the movement. D1 and D2 are the two wheels generating the movement. D1 alters the simple rotation of the wheel D2 that drives the pen in S. The length of the two bars, L1 and L2, change the pattern of the drawing, as well as the distance of the centre of the two wheels and the attach point of the bars to the rotating wheels.

Starting from this essential design we can add other rotating wheels — and up to four motors — and bars, whose diameter and length can create new patterns of different sizes and shapes.

I designed the platform as a modular and general-purpose tool, easy to make and assemble, as well as modify or change some of its features. To move the wheels with a good speed control I have used micro-geared motors from Kitronik, which I have used for other projects and found they perform very well.

Starting from the few geometric and mathematical concepts described I have designed the mechanical components to generate the recursive movement. I suggest exploring the possibilities for using this design with other wheels and bars to create different curves that can be customized to change the speed and rotation direction of the wheels.

Creating the components

Determined by the shaft diameter and the size of the motors, I designed a

first draft of the idea, then created the components with Fusion 360 for the 3D-printed parts, and Inkscape for the 2D vectorial designs for the parts that I have laser-cut using 3mm Perspex sheet.

The Micro Bit software has been designed using the Microsoft Makecode web platform, accessible from the Micro Bit website. The same software, based on graphic blocks, has been converted to JavaScript (one of the features available from the web application). It has been saved on the GitHub repository, where you can also find the STL files to build the components (alicemirror.github.io/ drawingmachine).

Programme usage notes

The drawing process can be controlled by the Micro Bit with the two buttons, A and B, and shaking the Micro Bit board:

• Press button A + B: Switch between controlling the big wheel or the small wheel.

• Press Button A: Decrease the motor speed.

• Press Button B: Increase the motor speed.

• Shake the board: Start/Stop the drawing process.

The Java source and the corresponding blocks programme from the Microsoft Makecode site. The full source is available on the GitHub repository

Left: Draft sketches of the mechanical parts and sizes for 3D design of the 3D-printed parts and the laser-cut flat parts (wheels and drawing bars)

Right: Schematic drawing of the mechanical parts. D1 and D2 are the two wheels generating the movement. D1 alters the simple rotation of the wheel D2 that drives the pen in S. The length of the two bars L1 and L2 change the pattern of the drawing, as well as the distance of the centre of the two wheels and the attach point of the bars to the rotating wheels

Right: Cyclodic movement

Below left: One of the wheels with the motor shaft, top, and bottom side. The motor shaft hole has been 3D printed about 0.25mm smaller, then the shaft has been inserted by heating the metal

Below right: The motors connected for testing, and the motor supports with the motors assembled inside

Above and left: Details of the 3D-printed pen holder. A screw is used to lock the pen at the right height. Note the nut inserted in the plastic part to drive the lock screw

Above: The finished kit. The laser-cut pieces are red while the 3D printed are black. The holes have a diameter to hold an M2 Allen screw

Left and right: 3D printing the motor supports

Below, left to right: Assembling the mechanical parts of the drawing machine

Above and right: The drawing machine finished with the set-up connected to the BBC Micro Bit. Everything is ready for designing

Below: The drawing machine at work