A flurry of activity

So you wait months for an update and then three come along at once:

Controller updated to v1.42

Main new feature is live drawing from webcam.  This is pretty cool actually, almost better than I expected.  There is a new tab in the controller, labelled CAMERA, and by default, it’ll show a vectorised version of your webcam’s live feed.  There are a couple of settings that simplify the raw video in order to make for faster drawings.


It works by grayscaling, then posterising each frame, then performing a vector trace on each layer of colour.

The simplify control works  to remove complexity from the resulting vectors, and creates some amazing abstracted forms at higher levels.  Posterise controls how many different layers of colour the image is reduced to, and blur reduces the actual detail.

Hit capture to snap a frame, and get to see (to some extent) the drawing sequence too – darker lines are drawn first.   Cancel capture discards the snap and returns to the live feed.  Add caption doesn’t work yet! Oops!  Draw capture confirms the snap and converts it to commands, and packs them into the command queue.  It also saves the image as a SVG somewhere too, in case you need to repeat it.

The drawing is scaled to fit into the picture frame.  You know, the picture frame.  Everyone uses that, right?

Path length cutoff throws away paths below a certain number of points.  This was intended as a way of trying to filter out rubbish single point, or single line paths, but actually simplify works better.  The problem with the cutoff is that it counts points in the path rather than actual path length, so you could have a path that forms one whole edge of the snap, but it’d get thrown away because it only had two points in it.  Doesn’t make much sense.

Good fun, and good results, I took and gave away portraits all day at the Mini Maker Faire here in Edinburgh week before last, people seemed to like it.

On windows it can be a bit of a cow to get running, it requires the infernal Quicktime, and WinVDIG.

The Firmware updated v1.61 for Arduino MEGA based systems (aka Polarshield / PolargraphSD).

So, Accelstepper, the wonderful library that I use to control the stepper movements in Polargraph got a couple of fixes, unfortunately fixing bugs it looks like I was relying on!  So at least one person encountered issues using the new versions, and the main part of this update is to fix that.  Vector drawing works again, three cheers.

It was a bit of a weird problem (that I went into briefly on the forum), but while I was there I “fixed” a few other things, the main one being the spiral pixel drawing style (aka circular pixel)!  It is very working, very quick, and very handsome indeed.

Grace Kelly in spirals
It’s the first “polargraph” style new feature for a long time, and is now quick enough to actually experiment with.  Gorgeous.

The code no longer fits on an Arduino Duemilanove, and I think probably not on an Uno either, so I have not included any updates for polargraph_server_a1.

Pen lift height

The servo positions were hard-coded into the firmware previously, but not all servos are created equally, and what was logically a 90 degree move often only turned out to be a 45 degree move (or less!).  I have made the servo up and down positions settable and saveable.  There is a test lift range button on the setup tab of the controller, along with two number spinners to set up and down position.  The test lift range will wiggle to both extremes a couple of times.  Once you are happy with the range, press save lift range to load it to the non-volatile EEPROM on the machine.  Remember to test it with pen lift and pen drop on the input tab to make sure you’ve got them the right way around.  There might be some foibles around that.

Finally, re-upload your machine spec

Maybe you always do this anyway after loading new firmware, but the EEPROM addresses of the various values that get saved there has changed, so they’ll be all over the place.  So you need to upload machine spec after updating the firmware.

Speedy chat!

The serial comms handling on the arduino end is now significantly quicker.  Very good!

Oddness on the mega line

The version of firmware for the Arduino MEGA using the adafruit shield (polargraph_server_mega) is almost identical to the polarshield variety, but I was getting some really weird results when doing vector drawings on my little machine here last night. It was badly dropping or gaining steps.  It works fine on the polarshield machine, but on this one, with a adafruit motorshield, no dice.  I think it must be down to the speed that I was driving it at (too high), but I’d be interested to hear if anyone has success with it, or otherwise.  Drop me a line please.  Thanks!


All the cool kids are using github now, so I am too.  The main code packages (polargraph_server_* and polargraphcontroller) are there at https://github.com/euphy. For the time being, the google code project will continue to be the official hub of the project though, but that might change.

Get the bundle at https://code.google.com/p/polargraph/downloads/list


10 thoughts on “A flurry of activity

  1. Haha! This is awesome, great work Sandy!

    However, I’ve encountered a problem, the webcam preview is displayed sideways e.g 90 degrees clockwise rotation. Am I doing something wrong here, or maybe some webcam settings? I’m on win7 64 by the way.

    • Oh yes! Ha ha, you can fix it by turning your web cam through 90 degrees! Sound silly perhaps, but I wanted a portrait shapes image, so that’s what I did. I guess I should make it configurable eh. Well, next version!

  2. Oh. Well, darn it. I only have a built in webcam on my laptop. Guess I’ll just flip the whole thing on the side then..Or just plank sideways in front of the laptop:)

    Also, just tried to update the firmware (hex via xloader) and all hell broke loose. First of all the polarity of the pen lift was suddenly opposite, so as I powered up the arm popped the other way and forced the gondola apart. Ok, so I flip the servo around, all good. Now when I try to draw (circles) from SD it moves into place,pen drop and then seems stuck with the motors making a horrible increasing grinding sound. I quickly disconnected. Phew. I’ll try some more here, but probably get back to you on the forum.

  3. Disregard! Mi stupido. In my childish eager to try out the new features I totally missed the part about having to re-upload the machine specs. It’s working perfectly now. And wow, how cool those circles are! I like the sound of the motors accelerating and decelerating as well. Niiice

  4. Hey Sandy,

    I’m sorry if i need you to spell this out, but does this mean Uno users will not have vector drawing anymore? Not even from a separate file? I have resisted getting a mega as much as I could but this looks like the nail in the coffin.

    • Aha, sorry yes, I was a bit offhand there Kyle. This particular update doesn’t fit on the arduino uno, but old versions will still work fine – the control language is the same, new controller functions (pen lift height) will simply not work. And I hope to get it to fit on eventually too, I’m not sure what the issue is – where the big expansion has suddenly crept in, and just haven’t had a chance to look more closely at it.

      Actually I don’t even have an uno, but I assumed if it didn’t fit on a duemilanove then it wouldn’t fit on an uno either.

      In the worst case, the uno version becomes slightly less functional (only one pixel style), or splits into a pixel version and a vector version. But vector drawing is a core part of the functionality, so there will always be a version that does that.

      OTOH, megas rock 🙂

Leave a Reply