Software update: Skipping blank pixels, and faster comms

In response to Kongorilla’s request for cleverer pixel skipping routines, I’ve just uploaded some new code.

Note, if you’re going to use the controller, you also need to update the firmware too.

v1.1.6 Controller binariesController source code

Firmware source code for arduino with adafruit motorshield  / for arduino with serial ITead motorshield / for arduino mega

1. Pixel skipping.

Skipped pixels are ones that are masked, or that are outside of the brightest/darkest thresholds.  Normally skipped pixels are simply omitted from the command queue – they just aren’t transmitted, and this is fine for ones around the outside of an image.  It does mean though, that skipped pixels that are in the centre of an image get drawn as blanks – a line through them as the pen trundles towards the next drawable pixel.

So this is changed now: The default behaviour is now to lift the pen while moving over skipped pixels.   For one reason or another, it does mean that even skipped pixels get transmitted so it might take longer, but the pen will be up during that time.  You can still go back to the old continuous-line way by choosing the other option in the dialog.  I believe this still works as before.
This works best if you use it in conjunction with masking and reducing the brightest pixel threshold a bit to weed out the false positives that are not completely blank, but are nevertheless too bright to be expressed by the machine as anything other than a straight line.

2. Faster communication

With this release (v1.1.6) I have switched over to using a CRC-based system to verify the integrity of the command.  Each command has a checksum appended to it when it’s transmitted, and when the machine receives it it recalculates the sum and if it matches what’s on the end then hurray, the command was not corrupted.  If it doesn’t match, then it will signal to the controller to resend the last command.  This is twice as fast as before, so that’s good.  But it’s not compatible with the old way of doing it.  Well, it might work, but it probably won’t.

How it used to work: Basically the controller used to send a command, then the machine would acknowledge it by sending it back, and the controller would check to see if it came back unchanged, and if it did then it’d conclude the message was properly transmitted and send a final execute command.  It was fairly safe, but it was slow because there are three messages exchanged for every command.

I put it in as a response to some dropped pixels I was having back in the day, where every couple of hundred commands, one would get truncated or mangled for some reason.

I’m off on holiday for a few days from tomorrow, so if it all goes wrong, goes on fire or destroys your drawings, please wait until next weekend to be cross with me.

6 thoughts on “Software update: Skipping blank pixels, and faster comms

  1. I’d also like the controller to turn lead into gold. I’m going to take a nap now, so you have plenty of time.

    Thanks, Sandy! Have a good holiday!

  2. Hi, I’ve built a polargraph and have the basic set up working well. However, I’m having a very difficult time getting the image drawing function to work. Could you possibly write an ‘idiots guide’ to show how this function works?

    For example, I’ve created a very simple line drawing in Photoshop, 300×300 pixels, load image, move image to center of board, select area of image, set frame to area. A series of black dots appears in the frame then I’m not quite sure what to do! I’ve tried playing with resize, dark/bright pixel etc but nothing I do seem sto produce anything resembling the image. Frequently the pen moves to one spot and just draws a short straight line over and over again.

    Any help would be much appreciated 🙂

    btw, using this on a Mac with Arduino Uno/Motor Shield and latest rev s/w


  3. Hey Bob, this would better addressed in the forum. But a few quick recommendations:

    What I suggest beginning with, instead of a line drawing, is a simple photograph. That’s what the polargraph is best at. Faces are good. When you get the hang of that move on to challenging images.

    If you want a line drawing, you should probably do it as “vector” art rather than pixel art. Do a vector drawing in a program like Inkscape or Illustrator, save it as .svg and then load it into the controller with the “load vector” button.

    If for some reason you *really* want to do line art as pixels, you’ll have to adjust “sample area” until the lines show up consistently. If the lines are very thin, I doubt it will ever look good.

    A beginners guide to the controller is a good idea. Sandy is the best author of such a thing, but the next time I prepare a drawing perhaps I’ll take notes on the process and post them in the forum.

    Good luck!

  4. Oh yeah, Bob, in the paragraph about doing line art as pixels, I forgot to mention something important. You’re going to need a very small grid size.

Leave a Reply