Polargraph Drawing Machine

 by Euphy
Featured
P1030510_p.jpg
This machine, a variation on the hanging-pen plotter is a conspicuous and wilfully naive attempt to break out of the pristine, pixel perfect, colour-corrected space that exists inside our computers. It's a drawing machine, that takes a pen (a human tool) and uses it to draw in a singularly robotic way, with some grand results.

It doesn't draw at all like we would (though it could), and we would struggle to draw exactly as it does (though we could).

It can draw on things bigger than itself - the question is really "how long is a piece of string?" when it comes to working out it's maximum area.

It's easier to look at what it does, than to explain it, so just have a look.



 
Remove these adsRemove these ads by Signing Up

Step 1: History

P1020768_c_p.jpg
Well there have been lots of new drawing machines doing the rounds lately, there's a real thirst to see devices that leap out of the virtual into the
physical. For me, it's all too easy to produce digital things which are interesting - programming or mash-ups or virtual experiments are devalued because they are intangible, you can run a hundred, a thousand, a million variations in a day - it's the proverbial roomful of monkeys with typewriters. The output becomes disposable, it get's hard to see the value, the craft.

So 3D printers and other desktop manufacturing tools and technologies (laser cutters etc) have got more and more popular, it's hard to overestimate how much hunger there is for a tangible, physical, touchable, smellable product of all this clever-clever digital work.

So this isn't wholly original, check out this prior art for more inspiration:

Hektor - the daddy of all hanging drawing machines
Der Kritzler - the smartest one yet
AS220 Drawbot - the basis for mine
SADBot - Instructable for an automatic drawing machine on the same pattern by Dustyn Roberts

Or have a look at what I've been doing with mine
Polargraph website
Polargraph project code and wiki
Flickr stuff

1-40 of 146Next »
smacneil says: Apr 29, 2013. 1:26 PM
Hi Sandy, love your project! I've managed to build a drawing machine of my own thanks to your help, but I wondered if you had any tips or information on how I might run a Processing sketch through it instead of using the Polargraph Controller?
Thanks in advance :)
Euphy (author) in reply to smacneilApr 29, 2013. 2:18 PM
Thanks! Well the polargraph controller is a processing sketch, so you you can just do it the same way as it does? I'm not really sure what you mean!

sn
unknowntothem says: Apr 28, 2013. 12:17 AM
Seriously awesome project!!
Euphy (author) in reply to unknowntothemApr 28, 2013. 1:09 AM
Thank you!
Mizchief100 says: Feb 13, 2013. 5:40 PM
Thank you! I built mine about a month ago and have had fantastic results. Such a cool program/project/instructable I'm amazed it isn't one of the top ones of all time. The idea for my first instructable was inspired by this.
Euphy (author) in reply to Mizchief100Feb 14, 2013. 3:52 AM
Brilliant work Mizchief, great achievement and I haven't seen anything like it before! You've got my vote :)
FamilyGuy2006 says: Feb 10, 2013. 11:28 PM
This is a great write up. I now plan to make my own with the confidence through knowledge that you have bestowed upon me. Thanks for being awesome like that.
chubchublolly says: Feb 6, 2013. 7:41 AM
Ok so one like this but lower current
http://www.circuitspecialists.com/nema_16_step_motor_39byg407.html
chubchublolly says: Feb 5, 2013. 10:00 AM
Thanks for quick reply so one like that but lower voltage
Euphy (author) in reply to chubchublollyFeb 5, 2013. 1:58 PM
Voltage isn't that important: Current is more significant. What I meant was that I would use a low-ish voltage power supply. I always use variable-voltage power supplies so I can turn it down when it's getting hot, or up if I need a bit more "bite". Running somewhere between 5 and 8v.
chubchublolly says: Feb 5, 2013. 8:31 AM
Sorry last motor for you to look at
http://www.circuitspecialists.com/nema_16_step_motor_39byg407.html
Euphy (author) in reply to chubchublollyFeb 5, 2013. 9:16 AM
0.65A is over current as far as the spec is concerned - that means it might draw more current than the motorshield is comfortable supplying. It's worth noting though that the L293D chips on the motorshield are rated to supply 0.6A continuously, but can handle peaks of twice that. Personally I would use those motors happily, but stick a couple of heatsinks onto the motorshield, maybe a fan if it came to it. And run it at as low a voltage as I could get away with.
chubchublolly says: Feb 4, 2013. 11:27 PM
So this one would work
http://www.circuitspecialists.com/nema_16_step_motor_39byg302.html
Euphy (author) in reply to chubchublollyFeb 5, 2013. 1:00 AM
Probably yes, the torque is a little low, but only in comparison to the other motor.
chubchublolly says: Feb 4, 2013. 1:45 PM
Thanks
So it doesn't anything under 0.6A will work doesn't mater what type of nema it is eg(34,21,17,16)
Euphy (author) in reply to chubchublollyFeb 4, 2013. 2:46 PM
Pretty much yes, it'll work in the sense that it won't burn your motorshield out! Very low current will usually require high voltage, and that's not really a problem up to 12v or so. But you might also find that very low current doesn't provide much torque or holding strength. The NEMA value just describes the physical size of the casing of the motor and the position of the mounting holes, 16/17 are pretty much the same.
chubchublolly says: Feb 4, 2013. 9:58 AM
For the motor wold these work or any other on this website I am a beginner and am not sure what to look for
http://www.circuitspecialists.com/nema_17_stepper_motor_42byg228.html
Euphy (author) in reply to chubchublollyFeb 4, 2013. 10:29 AM
Yes I don't see why not - current rating is the most important thing, should be under 0.6A, and these are 0.4 so will be ok. Six wires though, just cut the white and black wires, or tie them up somehow. Good luck!
b.sss says: Jan 29, 2013. 10:02 AM
Hi Sandy,
I liked your polargraph project and i had decided to create a replica of the same for one of our technical events at our college. Thanks to your help and all the steps you have given here I am succesfully able to complete the polargraph machine and it is drawing well... But I am still not able to understand how it works basically.. I mean how the commands are generated according to the image we load, how it drives the motors in sync with it.. I tried understanding the arduino code but it seems complicated..So can you please just elaborate about it a little in brief?
Euphy (author) in reply to b.sssJan 29, 2013. 1:46 PM
Hi there, thanks for your note, glad you got it running!

Right, there is a lot of stuff in the code, so I can't go through much of it without writing more than the code.but only a small bit of it does the interesting stuff about converting images.

First part - taking in an image, re-rasterising it using the native coordinates system.

Second part - driving the motors in sync to make straight lines.

First part is mostly in the Machine class in the controller. The Machine class is a model of the actual machine, the size of it, the size of the sprockets and the number of steps per revolution, along with the image that's loaded and the grid size.

There is a sub-class of Machine that is used to model the machine that is displayed on screen - DisplayMachine. This has all the properties of Machine, but also has zoom and colour and position settings.

The image gets loaded into Machine (imageBitmap) is given a position (imageFrame). And because I know the grid size that's being used (gridSize), I can cycle through all the intersections of the grid lines and then look at the coloured pixel that's at that coordinate.

There is a pair of algorithms at the heart of all the polargraph stuff:

public PVector asNativeCoords(float cartX, float cartY)
{
float distA = dist(0,0,cartX, cartY);
float distB = dist(getWidth(),0,cartX, cartY);
PVector pgCoords = new PVector(distA, distB);
return pgCoords;
}

public PVector asCartesianCoords(PVector pgCoords)
{
float calcX = int((pow(getWidth(), 2) - pow(pgCoords.y, 2) + pow(pgCoords.x, 2)) / (getWidth()*2));
float calcY = int(sqrt(pow(pgCoords.x,2)-pow(calcX,2)));
PVector vect = new PVector(calcX, calcY);
return vect;
}

These two routines convert a cartesian coordinate (x and y) into a native polargraph coordinate (usually a and b), and vice versa. Above is the version from the controller. PVector is a Processing object that has three properties, x, y and z.

The same calculation is done in the arduino code for doing stuff like vector graphics where the machine has to figure out where the gondola is in cartesian terms. This is the arduino version (it doesn't have the same PVectors so they're a bit more long-winded):

float getMachineA(float cX, float cY)
{
float a = sqrt(sq(cX)+sq(cY));
return a;
}
float getMachineB(float cX, float cY)
{
float b = sqrt(sq((pageWidth)-cX)+sq(cY));
return b;
}

float getCartesianXFP(float aPos, float bPos)
{
float calcX = (sq(pageWidth) - sq(bPos) + sq(aPos)) / (pageWidth*2);
return calcX;
}
float getCartesianYFP(float cX, float aPos)
{
float calcY = sqrt(sq(aPos)-sq(cX));
return calcY;
}

In the arduino, driving the motors is simple enough, I use changeLength:

void changeLength(float tA, float tB)
{
// Serial.println("changeLenth-float");
lastOperationTime = millis();

transform(tA,tB);
motorA.moveTo(tA);
motorB.moveTo(tB);


while (motorA.distanceToGo() != 0 || motorB.distanceToGo() != 0)
{
impl_runBackgroundProcesses();
if (currentlyRunning)
{
if (usingAcceleration)
{
motorA.run();
motorB.run();
}
else
{
motorA.runSpeedToPosition();
motorB.runSpeedToPosition();
}
}
}

reportPosition();
}

This uses the accelstepper library. First I set the position to mode to (motorA.moveTo(...)) and then go into a loop where I run both motors until they're there (motorA.run()).

Drawing straight lines is a bit awkward, uses:

void exec_drawBetweenPoints(float p1a, float p1b, float p2a, float p2b, int maxSegmentLength) { ... }

This basically chops the line into lots of segments (maxSegmentLength), and uses the regular changeLength() method (above) to draw a tiny short line. Then I calculate the pens position in cartesian space, and then begins to plot a new line from that position to the end. Then another short line, and a new positional check and so on. So eventually we end up with a straight-ish line. It's not possible to make a truly straight line - for a polargraph machine, it's cardinal directions are all curves, so it's really hard to get it to do something that looks straight in cartesian.

That might not shed any light on it at all, but maybe it will. If you have a more specific question, I am happy to help - email is a better medium (sandy.noble@gmail.com), or better still leave a note on the polargraph forum!

sandy noble

Euphy (author) says: Jan 29, 2013. 11:28 AM
Well you're right, it _is_ off centre - but weirdly the centreline looks entirely straight and the outline of the image is square and regular. I mean, it's not straight down the centre of the board. Normally distortions that go to one side or another are because of mis-homing, that is the home point is too far to one side, but in those cases the centreline is actually curved - it sort of swerves off and the distortion gets worse as the drawing goes on.

This _looks_ like one motor was lower than the other, or the paper was wonky - but I'm assuming that isn't the case, and everything looks square and level to me.

Does this happen with every drawing?
sweta_rocks says: Jan 29, 2013. 10:24 AM
Hey sandy,
at last i succeeded in designin the polargraph and everything seems to be going fine... I am facin a small problem though... its drawing the image a bit tilted, even though the setup and everything is perfect as far as i know and i havent got any idea y is it happening so...have u any idea about wat cud be going wrong??
i have attached a pic of the same for ur refernce..
Photo-0040.jpg
chubchublolly says: Jan 25, 2013. 9:17 AM
Can you use a belt instead of beaded cord
Euphy (author) in reply to chubchublollyJan 25, 2013. 11:15 AM
No reason why not, lots of machines do - including Hektor, der kritzler and Harvey Moon's machine.
sweta_rocks says: Dec 29, 2012. 4:56 AM
are yu sure that libraries folder should be copied into the arduino sketchbook folder ? cos yu mentioned in step 8 that it shud be saved in arduino libraries folder !

Also i am finding a gr8 difficulty in finding the components yu hav listed !
can you tell me wat NEMA 16 signifies about the motor ?
n what shud be the torque required to be handled by the motor if i am supposing to make this project on a A3 size paper ?
the reason for asking dis is that in the markets here i am gettin 1.8 degree stepper motors but their torque values are different for different models n i dunno wich one to go for ?
Euphy (author) in reply to sweta_rocksDec 29, 2012. 5:19 AM
Arduino sketchbook folder has a libraries folder in it (usually), and the main arduino application folder also has one - it doesn't actually matter which one you use. Originally I used the application one, but now I tend to just use the one in the sketchbook folder. It only might get to be a problem if you had different versions of the same library in two different places - I'm not sure which version it would use first.

NEMA 16 just describes the physical size of the casing of the motor. NEMA 16 seems pretty rare actually, I've only really seen them from that one supplier I've got them from. NEMA 17 is slightly larger, but a lot more common. The current and voltage is more important. Torque required isn't related to size - that is, you don't need more torque for a bigger machine. I also don't really know the torque that's required. If I've lacked torque I've always been able to fix it by turning up the voltage on the power supply, or by adding more weight to the counterweight. So it's not that critical, but if you have a choice, go for higher (bulkier) rather than lower (slimline or compact).

sn
sweta_rocks says: Dec 28, 2012. 8:21 AM
hey sandy i am a bit confused with the files yu hav added in yur recent polargraph code repository -polargraph1.2.4 !
i hav unzipped it and hav 4 folders out of wich application.windows32/application.macosx contains the polargraph controller. Polargraph Arduino code contains d code to be frst saved in the arduino sketch folder as yu hav said above n libraries to be saved in arduino library.
am i correct with this ?
also i aint able to understand the use of Processing libraries ?
what is to b done with this folder ?
Euphy (author) in reply to sweta_rocksDec 28, 2012. 11:19 AM
Forgot to mention - the new download is http://code.google.com/p/polargraph/downloads/detail?name=Polargraph1.2.5.zip
Euphy (author) in reply to sweta_rocksDec 28, 2012. 11:14 AM
Hi Sweta, I've actually just uploaded a new zip file that includes a couple of fixes.

The folders called "application. ..." are the ones that have the precompiled controller app inside them - different version for different operating systems. Use the version that matches the kind of computer you have. You don't need to install any libraries if you are just going to use the precompiled applications.

Inside the arduino-source folder is all the source code that you'd open up in the Arduino IDE and upload to your arduino board. There is a libraries folder inside that that should be copied into your arduino sketchbook folder.

Inside the polargraph-source folder is all the source code for the controller app. If you want to run this you will need to add the two libraries that are in the libraries folder there too. Just put them in your libraries folder in your processing sketchbook folder.

Good luck!
sweta_rocks says: Dec 24, 2012. 5:04 AM
m sry if my question looked silly to yu ! :P
but can d same mechanism work wen yu place the board horizontal ?
n also can yu tell me mre about yur polargraph SD prototype ?
Euphy (author) in reply to sweta_rocksDec 24, 2012. 6:03 AM
If you mean having a board landscape (short and wide) rather than portrait (tall and thin), yes there's no reason why the same mechanism won't work. It's just like only using the top half of my own machine. The only problem might be with the counterweighting system then the weights will eventually hit the ground because it is wider than it is tall.

The solution to that is to use plain bobbins instead of sprockets and gather up the thread instead of hanging it over and using a counterweight. Unless you have a really heavy gondola, there's no real problem with that except homing (calibration) is a bit more of a pain.

The PolargraphSD prototype - not much more to say about it other than what you see in the pics on [url=http://www.polargraph.co.uk/2012/04/polargraph-sd-prototypes/]http://www.polargraph.co.uk/2012/04/polargraph-sd-prototypes/[/url]. It uses an arduino mega loaded with the firmware at [url=http://code.google.com/p/polargraph/source/browse/#svn%2Fembedded%2Fbranch%2Fpolargraph_server_mega]Polargraph_server_mega[/url] and allows you to read a load of commands off an SD card rather than having to have the PC connected. It doesn't really change the speed of the drawing much.

sweta_rocks says: Dec 22, 2012. 11:43 PM
hey sandy,

i am an engineering student studying in India and i am truly inspired by yur work !
i decided to make your work as a project fr an exhibition to b held in my college but d problem with it is that it is too big n also it requires a long time to complete the picture. No i am not criticizing your work but den it'l be difficult fr me to demo its working at the exhibition !

i saw the prototype link yu posted in the comments but dunno how to go bout it cos yu haven't provided any guidelines on that page.

so as a request i was wondering if yu can help me build a smaller version of your main project providing me wid the guidelines as you've mentioned above fr yur main work ! also if only yu can provide me a solution to demo the working of this machine in a short time period !

thanking in advance,
Sweta
Euphy (author) in reply to sweta_rocksDec 24, 2012. 3:32 AM
Hi thanks Sweta, not quite clear what it is you're looking for - a smaller version is just the same as the one you see here, but .. er, smaller. Just mount the motors on a smaller board?
MrStein says: Dec 3, 2012. 11:35 AM
That not work with the AFmotor exemples,that make a step at right and a step at left but no rotation..
Euphy (author) in reply to MrSteinDec 3, 2012. 12:16 PM
Ok, if the examples aren't working either then there might be a fault in your wiring / assembly - check that your ICs (chips) are in the right way around, and that your resistor network is in the right way around too. I've put them in wrong before. You should probably direct any questions to the adafruit forum though - they're the experts on diagnosing motorshield issues!
MrStein says: Dec 2, 2012. 12:24 PM
I don't know why that don't work, my adafruit driver become hot (the ship in the center not the l293D) and my motors shaking as if they were powerless (it's 7.5v 0.2a motors and i use a variable power supply 1a )
Euphy (author) in reply to MrSteinDec 3, 2012. 4:31 AM
Does the shield work ok otherwise? With the other AFMotor examples in Arduino?
hilukasz says: Dec 2, 2012. 3:18 PM
ok so been at it for a few hours, new to stepper motors. would something like this work: http://store.kysanelectronics.com/servlet/-strse-71072/20BYGH33/Detail voltage rating is a bit lower, but correct amps.
Euphy (author) in reply to hilukaszDec 3, 2012. 4:30 AM
Hi they look good, voltage doesn't matter so much, but amperage is the most important. They are fairly dinky by the looks of thing though, so you might find they aren't very strong - I don't really know how to read and compare the torque specs. Probably ok though - the machine doesn't need an awful lot of power.
MrStein says: Dec 2, 2012. 8:16 AM
Hello, great project :D
I would like make it with a arduino duemilanove, can it work? And i have two bipolars motors (1.8degres, 0.2a) I think it's good?

Thank you!
1-40 of 146Next »
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!