Polargraph is go!

For Science and Engineering week, I thought it would be inspiring to make a giant Polargraph machine that would be left all day to draw at school.  They occupy a perfect space at the intersection of art, maths and technology.

The penrose triangle.  I drew this using vector drawing mode, and generated the file using StippleGen2 from EvilMadScientist labs.  <3
The penrose triangle. I drew this using vector drawing mode, and generated the file using StippleGen2 from EvilMadScientist labs. ❤

What is a Polargraph?

A polargraph is a line drawing machine that uses two fixed stepper motors to move a hanging gondola that holds the pen.  The machine usually draws pictures using a continuous line.

Why is it called a polargraph?

The machine uses a polar co-ordinate system to calculate where the pen is, and how far to move the motors in order to draw lines. (It can convert polar co-ordinates to Cartesian x-y co-ordinates)

How does it work?

The polargraph controller takes a .png, .gif or .jpg image as the input, and decides on the brightness of different areas in a grid. If an area is dark, then the machine tells the arduino to signal to the motors  to put the pen lines close together, and produce a dark shaded pixel. .  If an area is light then the machine tells the motors to put the lines further apart.

What can it draw?

It can draw any bitmap image that it is given.  It works best with high-contrast images.    It is quite versatile and can draw in a variety of ways – It can scribble, it can draw circles, or it can build pictures up in squiggles or perfect square waves.   The curved bands are due to the way that the motor instructions are generated, and which point is fixed in the picture. It can draw vector files directly, as they are path-based images.

How did I build it? 

I followed the truly incredible instructable form Sandy Noble at instructables.  It’s one of the best that I’ve ever followed – The instructions are clear, the walkthroughs are detailed to just the right level, he links to all the influences he used for the project, and it produces amazing results.

Polargraph Community

Although Sandy  has been inspired by others, including Der Kritzler machine and others he really has nurtured a community around polargraphs and V-plotters through a great forum, and excellent communication with customers or interested people.  He has also innovated in the area of v-plotters and really enabled a community to move forward by open-sourcing his designs and software.   It’s entirely possible to buy ready-made plotters from the polargraph store, but I really wanted to roll my own and follow the instructable.

Mark 1 – (prototype) 

I built a comedy home version at first, with the stepper motors velcroed onto the top of the board directly.  This had an advantage where there a bit of play in this mounting system, and it absorbed some of the resonance in the cables.

I built it using a an arduino uno (legit!), and an Adafruit motor shield V1 clone from ebay (only because the real one isn’t made anymore).   I don’t have access to a 3D printer, or a laser-cutter at home.   so I tried to make a home-grown solution to the gondola, but ended up buying a kit from the polargraph store.

Problems that I had while building the prototype machine and how I fixed them:

1. Motors turned backwards – Answer steppers wired in reverse. This was apparent as I moved my arduino from the front of the machine to the rear between revisions!

2. Gondola moved off edge of page when drawing – hadn’t set machine size before starting and uploaded to the arduino.  This is a really important stage that has to be done every time, or saved into the default_properties config file.

3. Pen would slip in picture – My counterweights were hitting the floor as the strings were too long.  This was solved by shortening the blind cables, but I think in future I will try and use a pulley system to stop the cables vibrating and resonating.

4. Stepper Motors were getting crazy hot -I stole some heatsinks from a PC graphics cards and  added small heatsinks to both the motor driver ICs on the motor board, and to the top of the steppers.  I also drove them at lower voltage and reduced the max speed.  This solved the problem nicely.

5. Pen was lifting from the paper causing incomplete pictures – I worked out a technique to get the paper as flat as possible in terms of using masking tape.  In future, I’ll use low-tack spray mount to get the paper to attach flat to the board, and then mask the outsides.

6. Servo failing to lift.  –  It took me a while to find this one out.  My servo was loose from the gondola, and was failing to lift in certain parts of the image.  This is a major headache if your machine has spent 6 hours drawing a flawless image, only for the servo to unstick, and then draw a line across the middle of the image.  Solution – Use a stronger adhesive or change the gondola.

Pl
Comedy Mk1 version.  Gaffer tape all round, counterweights made from bags of coins, stepper motors held with gaffer and velcro.  Amazing that it could still draw, all things considered.  This was my second ever image.

V1 It took me about 8 hours total to construct, and more importantly about 8 hours to troubleshoot.  Getting to know the software is really important.  Once I’d worked out what worked and what didn’t (and how to get the best out of my pens, paper and machine, I set my sights on the largest machine that I could build and transport.

Polargraph Mark II. 

It took about 4 hours to build, including a hinged A-frame so that I can change the angle of the board, and prop it up in public spaces without too much hassle.

The machine measures 1100 mm x 1800mm (The largest board I could fit into my car).

The only significant changes I made were that the machine size is effectively tripled, the electronics are all hidden at the back (a bit of a shame for a public machine I thought, but it would reduce tinkering / breakage – I might make a perspex enclosure for all the goodies), and I drilled a 12mm hole centre bottom in the board to run the servo cable hrough from the bottom.  This serves to pull the gondola parallel to the board.

Subjects

Portraits seem to be the most popular polargraph subjects, as they are universally recognisable, and we have a significant amount of subconscious brainpower dedicated to face recognition.  I tried to go for a couple of portraits, but also tried to get kids talking about science, maths, art and technology through the pictures.

I’ve been plotting various famous scientists, impossible shapes, anatomy pictures and other random pieces for the foyer at school.

Madame Curie.  The picture looks a bit tatty towards the bottom left: The paper was not sitting flat, and the Pen got clogged with paper fibres.
Madame Curie. The picture looks a bit tatty towards the bottom left: The paper was not sitting flat, and the Pen got clogged with paper fibres.  I still love the detail in the top of the image. I’d like to repeat this one under optimum conditions.  Draw time: 11h!

Reception

Impossible shapes - Part 2.   I used an image, then used inkscape to trace vectors.  This .svg file was exported to the polargraph and then drawn.
Impossible shapes – Part 2. I used an image, then used inkscape to trace vectors. This .svg file was exported to the polargraph and then drawn. Draw time: 35m

The machine was almost universally well received, especially for portraits of people.  It generates so many questions from curious students, and there seems to be a constant phalanx of children in front of it walking back and forth to try and make the more abstract images resolve with distance.     It’s one of the most pleasing builds in terms of satisfaction, as it produces such amazing works of Art.

My next project is to get the machine to run from a Raspberry Pi, and to try and emulate the amazing work of the blackstripes.nl or the gocupi projects (who are ‘inspired by’ Sandy Nobles work themselves).

I’ll add a time-lapse video as I have time to make a full-length one of a long drawing!.

Taking Homework to the Next Level.

Ella's incredible piece of work showing the magnetic field lines in 3D around a bar magnet.
Ella’s incredible piece of work showing the magnetic field lines in 3D around a bar magnet.

Year 7 student Ella Lewis prodcuced an incredible piece of home learning for Mr Fairweather’s Physics homework (Make a model of a magnet).  Working with her father, she has used a variety of techniques that work exceptionally well in combination.

The best thing about this is that it forms an amazing teaching resource  –   I’d use this to teach about magnetic field lines at KS3/4 as it’s so immediate and clear, better than any diagram, experiment or simulation I’ve ever used in the classroom.

Perhaps she will find the time to put up some build instructions or an instructable to help other students to do the same.

My only wish would be to have two, so you could get students to imagine what would happen if you bought them pole to pole!

Raspberry Pi Radio.

While teaching students about how radio signals are used to send information using FM  I decided to make a raspberry pi radio transmitter using the instructions from Makezine and Instructables, so that we could explore the range of transmission, and the effects that different aerials would have on the radio signal.

http://www.instructables.com/id/Raspberry-Pi-Radio-Transmitter

http://makezine.com/projects/make-38-cameras-and-av/raspberry-pirate-radio.

The PiFM python module was created by Oliver Mattos and Oskar Weigl from the Imperial College Robotics society,  and can broadcast 16 bit mono WAV format sound files that can be played on any FM receiving radio.

Makezine made a pre-compiled install image that autoruns the transmitting software on boot, and will shuffle audio files that have been placed in the root directory.  I’ll be honest, their video was a bit Hipsterrific for my liking, but it got me interested enough to tinker.

The basis behind the generation of the signals sounds simple enough: GPIO4 is modulated via PWM fast enough to produce a signal in the FM (megahertz) range.   However, I quickly realised that it produces a lot of interference in nearby devices, and there are clear side bands of interference in neighbouring frequencies. (Just tune the radio through the frequency range and you’ll find many sidebands)  Although the power output of the device is so low, it might interfere with Emergency Service radio, and as we are located very close to a Fire Station, we decided to exercise caution!

With an FM radio right next to the Pi, it picked up the signal very clearly, but dropped off within 3-5m.  With a 15cm crocodile clip wire attachedto GPIO4  the range jumped to 20-30m radius, and was very clear.

Some builds have used Duck antennae in order to boost the signal broadcast radius, but presumably this would also boost the strength of the side bands, and would drown out commercial stations at short range.

Build Notes:

Extremely easy, and very quick to get results.

Minimal materials needed, and little expertise required for students.  Easily replicable.

Next Steps:

School radio station?

Using the piFM RDS code on github to send track information, and station Identification info.  Code:https://github.com/ChristopheJacquet/PiFmRds 

Doodlebots @ STEM club.

Inspired by an article at Makezine on scribblebots, we decided to roll our own using some bits at school.

This video shows the bots in action in slow motion, and clearly shows how the eccentric vibration motor allows the bot to move in a circle.   We just used rubber bungs stuck onto the motor to create the offset motor.  We experimented with a range of pens, pencils and markers.  Sharpie style markers worked well with the sugar paper, but if you are tiling smaller sheets of paper, make sure to tape on the underside and make the seams as flat as possible.  The activity was great fun, and produced some crazy generative art, which was my lab wallpaper for a couple of weeks.  Check out the videos:  Continue reading