New controller update for the weekend v1.1.8

Hello, a couple of things came up this week, these first two affect the controller only.  No need to update the firmware.

The first is the problem where the serial ports dialog box comes up empty.  Well, this was something that I’d been inconvenienced by plenty of times, but had never really looked into fixing, because I could get around it easy enough each time.   But I think I’ve made it safe now, and it should work in all cases.

The second thing is buttons for pen up / pen down.  Not really anything more to say about that:

The third thing is what’s in the download.  I’ve packaged the new versions in a zip as usual, but also included:

  • Precompiled binaries for the controller
  • Full source for the controller
  • All libraries required to compile from source (or run through Processing)
  • Source code for the firmware / polargraph server
  • Libraries required to compile firmware
So it’s a fair bit bigger (6MB), but should mean getting it running is a bit easier.
Get it from the downloads area.  Or the source on its own from the repository.


The last thing is an issue with microstepping on the polarshield devices.  I’m pretty sold on microstepping, it really does make things more quiet and neat and gives you all the notional resolution you could even need.  But there is a problem with it because if the machine stops drawing between full steps, then it’s suspended uncomfortably.  It gets pretty hot and pretty bothered.   So there _is_ a power timeout on the new polarshield firmware that lifts the pen and cuts the power if there’s been no activity after 10 minutes, in case it happens to end up stopped on a microstep.  But this itself presents issues, amongst them how to keep registration for long-running multilayer drawings.  You can’t be expected to be around for the end of a drawing to catch it in a 10 minute window.

So my solution to this is a pragmatic one, and that’s to use full steps to address the machine externally, but to use microsteps internally to get the smoothness that we like.  This means that your controller will send commands that will always get the machine to finish drawing on a full step, but internally, the machine will interpolate those steps with microsteps.  Anything that happens internally will benefit from that, with the slightly more coarse addressing being used externally.

The upshot of this is that setting up a polarshield requires two values – the steps per rev (400 as usual) and step multiplier (set to 8 because the polarshield uses 8x microstepping).  The adafruit shields don’t microstep nicely, so I wouldn’t recommend it on those.

This change only affects polarshield users, so don’t bother updating your firmware unless you are one of them.

Scribble and scale

Pioneer polargrapher and beta tester supreme Kongorilla tested out the scale pixel routines – I think this drawing is exceptional.

Tor Johnson Polargrah Drawing

Showing that pixel scaling is exactly the tonic that scribble pixel has been waiting for all these years.  He drops some science thusly:

The pixels were scaled to 1.4, if I remember correctly. I set the pixel samples to a much lower value than I would normally. I did one pass (row size 70 or 80) that looked OK, but I wanted more of a value range, so I ran it again at a smaller row size. I masked most of the higher value pixels on the second pass, and used pen lifts, to keep my brights bright.

Which confirms that the controller now has a good set of features to get around what I see as this drawing style’s biggest problem – how to add more darkness without also adding any density to the lightest areas.  Very pleased with that.

Also wanted to mention he’s been using StippleGen:

Ernie Kovacs StippleGen Polargraph Drawing

I never got the hang of stipplegen, but I expect I was just being a doofus.

Uploading firmware without Arduino

EDIT! – Use XLoader instead of this – it’s just as good and works on more boards.

Hello, a few people have had problems getting their programs uploaded to their arduinos.  I haven’t.  Not rubbing your faces in it, but if I can’t replicate it, I can’t fix it.  I think it might be something to do with bootloaders, but who knows.

EDIT! Looks like it is to do with bootloaders – Matt’s adventures confirm that.  I think it’s restricted to UNOs of a certain age.  The only UNO I ever owned I blew up literally hours after getting it, so can’t test.  And I don’t think this way of uploading will get around the issue – you might just have to reprogram your bootloader.

A second problem is that you need a couple of libraries installed, and not everybody want’s to harass themselves with that.  So I’ve made a precompiled hex file that you can load onto your arduino to save you that hassle.  You don’t even need to have arduino installed anymore.

What you need:

  1. The hex file is here.
  2. ARP-Uploader.  This is the thing that uploads the hex.  Get it from here.

And that’s it.  Unzip and startup ARP-Uploader, load up your hex file that you downloaded.

Choose the COM port that your arduino is on, and m328p as the microcontroller.

Change the baud rate from 19200 to 57600 where I’ve highlighted in the pic.

Press upload!

I’d be interested in knowing if this helps anybody who is having sketch size issues too.

OK, this hex file is good for Arduino UNO, Duemilanove, or any ATMEGA328-based arduinos.

Polargraph Controller v1.1.7

Hello everyone, an update this way comes!

Version 1.1.7 of the Polargraph Controller brings some significant fixes AND a couple of new features.

  • Density Preview Styles.  This is a naive attempt to make the density preview look a bit like the square wave pixel drawing style.  It uses diamond-shaped squares instead of round spots.

It also uses transparency to give a kind of preview of what happens when they overlap (more on overlapping next).  I was a bit reluctant to add this mode, because it implies that the controller is able to give a preview of what the rendered drawing will look like, rather than simply giving a view of what detail has been captured.  But even though it isn’t perfect, it might be useful. It is the new default, but adding to the config file will make it use circles instead.

  • Pixel scaling.  A customer asked about this image that appears to use a pixel that is scaled AND has variable frequency.  I said of course, there are no secrets in this project, anything I can do you can do.  But then remembered that that drawing was the result of Tinkering, long ago, and there was no way to do this without more Tinkering though it is a good effect.   It was essentially a way to get detail in without obliterating everything else on the page.  Kind of worked.

So I’ve added a Scale Pixel function that will allow you to multiply the size of pixel that get’s drawn.  A value of 1.0 means the pixel is the same size as the grid – just as it always has been.

A value less than 1.0 makes them smaller than the grid, values larger than 1.0 makes them larger than the grid.  This was designed to be used with variable freq square wave, so your mileage may vary when using it with scaled pixels.

  • Crash Fixes!  This is quite a good one, and worth having if you are working with big queues.  This fixes the crash that often occurs when adding large numbers of pixels to an existing queue.  The issue was a ConcurrentModificationException when attempting to read from the command queue to draw it on the screen and adding to the command queue at the same time.  Not allowed to do that.  There are thread-safe versions of the List I use, but they are slow in themselves, so all I did is catch the exception and ignore it and continue on.  The issue is entirely limited to how accurate the command queue will look, on-screen, for a couple of milliseconds, so I am happy to behave badly with that one.  HOWEVER, it is unlikely to come up again anyway, because…
  • Performance is improved with long queues.  Previously it would write out all the entries in the queue, even if they weren’t on the page.  Now, writing anything to the screen is pretty slow, so this has been made 500 times faster (literally) by not doing that unless there’s something to show.  It was pretty lazy coding anyway.

Ok, that’s all folks, as usual, this code is available in the repository or in a couple of downloads.

If there’s any issues, please let me know.

Fistful of polargraphs

The Polargraph factory (my living room) is in full swing today.  I had a bit of downtime when my 3d printer decided to start acting the goat, but I stripped down the heated print bed and rebuilt it, and it’s going gangbusters again.  I’m printing in ABS.  It doesn’t look that nice, but it’ll be better at taking the heat that these more powerful stepper drivers can pump into the motors.

I’m hoping to have this first handful of PolargraphSD kits on their way to their owners during next week, and at that point I’ll take a little stock to figure out how much they really cost all-in.  The boards themselves are really cheap, but they use all SMT (surface mount) components and I know a lot of folk are wary of that – so will probably offer an assembled shield as part of an upgraded vitamins kit.  I’m getting the hang of it.  Don’t know what all the fuss was about!

Also, doing lots of drawings.  These micro-stepping step-stick drivers are wonderfully civilised, so quiet and gentle.  I miss the L293D’s singing a little though.