State of the art tangle

In case anyone’s interested, here’s my current brain.

Polargraph machine - DFRduino Mega with Adafruit motorshield and micro-sd breakout.

It’s a DFRduino Mega (1280) (ebay) with an adafruit motorshield (oomlout) on top, and an adafruit micro sd breakout (also oomlout) on the side.

This is the jalopy currently running my standalone drawings. The circuit is shown a little better here:

Connections for arduino mega to adafruit micro SD breakout board.

Running commands off the SD card eliminates the pause in between commands completely, it’s brilliant. Currently no way to interrupt it once it’s started, but I plan to add a rudimentary physical interface, a pause/run button at least. Will will be testing various endstop / limit detectors at some point.

I also have a sanguino and a couple of stepstick drivers to test out this weekend.  I think that hardware combo is likely to be the basis of future polargraph machines – the chip in the mega is awful expensive.

-EDIT – Firmware
I realised I didn’t mention anything about the firmware I’m using in the MEGA. It’s available from this branch of the repository. It broadcasts its version in it’s READY statement, saying READY_100 instead, and the controller will spot that and the new buttons will appear:

  • Signal store… This pops up a window that lets you input a filename that any new commands issued will go into instead of being executed.  This will create a file on the sd card on the machine, and fill it command-by-command.  This is still pretty slow.  It puts the machine into store mode.
  • Signal play This signals the machine that it should go back into play mode, and start executing commands again, instead of storing them.
  • Exec from store… This pops up a window to input the name of a file that contains your commands and when you hit submit it starts executing all the commands from that file.

A better way to do it is to hit export queue and save your queue to the card directly using a usb card reader – same result, and much faster, then swap the card back into the machine once you’re done.

So I still need to use the controller.

  1. I layout my artwork, then make sure I have an empty, paused queue before generating all my drawing commands.
  2. Then plug my sd card into the pc so it appears as a drive.  Now export queue to a text file on the sd card.
  3. Take the card out and put it into the polargraph machine and reset it.  It needs to be reset to initialise the card.
  4. Connect the controller and start the queue.
  5. Set home and move the gondola to the home point.
  6. Queue->Exec from store and enter the name of the file I just saved onto the sd card.
  7. The machine gets that message and starts drawing.  Now I can just close the controller and turn the computer off if I want to.

Remember that the machine still needs power, and depending on how you have your machine set up, part of it might be being powered by USB.  So if you turn the pc off, it might lose that power.  It might not! Because you might have a powered hub or something.  But If you have a power supply that plugs into your arduino board rather than your motorshield you will be ok to remove the usb entirely.

This works great for vector graphics where there’s thousands of little lines. Not such an issue for bitmap stuff, but still might be useful for bigger things.

9 thoughts on “State of the art tangle

  1. i’ll have to get that SD breakout, i have a mega, then I can try it out. It looks great. So does it run as soon as you put the card in? How hard would it be to add a LCD display to show what is on the SD card with button interface? Thanks for the pictures. I’m excited to see what you come up with. Great job.

  2. Neato!

    Without a UI or endstops, how are you homing it now? Do you just hold the gondola at home until the motors lock on then start drawing? Or are you just drawing some wacky, distorted drawings at this phase?

  3. No it’s not smart enough to do any of that stuff – I hit it up with the controller first, home it, set the speed and pen size and stuff, then initiate the drawing from that point. If you load the new mega firmware (I’ve updated the post with the link to it if you can’t find it) the controller will recognise it and give you the saving to store / draw from store options.

    • Hi, there are two problems with using an SD card on an uno –
      1) All card shields need to have pins 10, 11, 12 and 13 free to use the SPI bus to talk to the SD card. The motorshield also uses some of those pins, so a motorshield can’t easily coexist with an SD card. The MEGA doesn’t have that problem because the SPI interface is on different pins, so the motorshield can have them all to itself – no conflict. But for this same reason, SD-card shields don’t work on the MEGA.
      2) The SD library that I’m using to access the SD cards is really big, (like 15k) so there’s no room left for it on an uno. This is the bigger problem.

      Solutions: Modify a bit of the AFmotor library so that the control signals are routed away from those SPI pins on 10, 11, 12, and 13 (, and add a couple of wires to make it work physically. This will get the thing working, just, but might break the servo movement. Then create a very cut-down card access routine that can read commands from a SD card. Also tried this, with a small amount of success but it’s horribly awkward.

      The benefit of using the breakout board is that you can wire it up anyway you like – doesn’t have to match the pin layout of the arduino. So it can be used with the MEGA.

  4. Hello, Sandy! I’ve made this version of Polargraph but have a problem: I cannt Exec file from my sd-card. Maybe because it renaming: when I make file in card I name it “comm.txt”, but when I start terminal I see in it: “COMMT~1.TXT”. Then in polargraph server I cannt start this file.

    What should I check?

Leave a Reply