Step 8: Electronics - Arduino

You need an Arduino UNO board, I used a Seeeduino v2.21 here - it did the job very nicely back in the day, but a couple of new features have been added to the code and so it doesn't fit on anymore. Genuine UNOs have very slightly more space for programs.

Upload the source code to the arduino. Look at this fine guide courtesy of Adafruit for help.

Because it changes regularly, I have not attached a copy of the code itself to this step, but the very most recent version can be downloaded in a bundle from the polargraph code repository.

You should save the code file into a new folder inside your arduino sketch folder. Give the new folder the same name as the source code file. So if the file is called polargraph_server_a1.ino, you should create a new folder called polargraph_server_a1 and save the file into it.

It also uses Adafruit's AFMotor library and Mike McCauley's Accelstepper libraries. Please use the copy of Accelstepper that is in the zip file - the newest versions of it have a few fixes in them that the polargraph code isn't yet updated for.

The AFMotor library files should be put into a folder called AFMotor inside your Arduino/libraries/ folder.

The Accelstepper library files should be put into a folder called AccelStepper inside your Arduino/libraries/ folder.

Once they are moved, your arduino installation directory should look something like the second image on this page.

Of course the source code is also available in the code repository - https://github.com/euphy/polargraph_server_a1 - should you want the very most recent version.

Once you do that, you should confirm that it is working properly - use the serial monitor on the board, set to 57600 baud to make sure that it is issuing "READY" every couple of seconds (see the third image).

<p>Hi Euphy! I am having a problem with uploading files to aruino. I am using Mega 2560 with motorshield v1, and am using the latest polargraph controller(11-10) From what I understand, I have to first go to arduino-source &gt; polargraph_server_a1 and compile configuration.ino. But whenever I do that, it keeps saying that at sd.ino, &quot; 'SD' was not declared in this scope&quot; (im using Arduino 1.6.5) How should I deal with this problem? can I just delete the file?</p><p>I am really new to arduino... please save me :(</p>
HEllo! In the Arduino IDE, you should have all of the files open at once - there's 15 files in polargraph_server_a1, and configuration.ino is only one of them. You probably have this, but just making sure.<br><br>To compile for a MEGA, you should edit the lines shown here<br>https://github.com/euphy/polargraph_server_a1/blob/master/polargraph_server_a1.ino#L39-L40<br>So they look like:<br>//#define MICROCONTROLLER MC_UNO<br>#define MICROCONTROLLER MC_MEGA<br><br>Then also uncomment (remove the // on the beginning of) the two lines at<br>https://github.com/euphy/polargraph_server_a1/blob/master/polargraph_server_a1.ino#L48-L49<br><br>so they read<br><br>#include <br>#include <br><br>I think that's it!<br><br>sn
<p>Can I use the stepper motor with a smaller number of steps ? any problems ? </p>
<p>No problems!</p>
<p>thank you so much :))</p>
<p>This project is awesome and your didatic is really nice. Thanks for posting this.</p>
<p>can I use</p>Small Reduction Stepper Motor - 12VDC 32-Step 1/16 Gearing
Yep don't see why not. Move a bit more slowly, but you get good torque from those wee ones, and they are beautifully _quiet_ compared to regular steppers.
Thank you so much! Will I have to buy motor shields for such small stepper motors? <br><br>I have been wanting to build a polargraph (I know the name is a little deceiving according to your blog) for such a long time! It's been over a year and I haven't gotten around building one. I want to build one to print pictures and give them as gifts.
<p>I would always use a motor driver circuit, unless you specifically know that your motor is puny enough to not overload the arduino. If you read lots of things on the internet, suggesting, and showing people running these exact motors with only a microcontroller, then you'll probably be ok. Otherwise, no.</p>
<p>Hi.</p><p>My machine is working well, I wanted to ask, in vector mode, there is a method to fill the vector? I wish I could fill them and not only to draw the outline</p>
<p>The controller only draws lines, not styles, not colours or fills. So if you want a fill, you need to create a fill pattern using your SVG tool. Believe me, it will be a lot easier to mask off a cross-hatched pattern using inkscape than anything I can build into the app!</p>
<p>I have two spools of different diameters can be set separately &quot;MM per rev&quot;?</p>
<p>No way to do this with the Polargraph code, sorry.</p>
<p>would it be possible to have it ''print'' text, or is text too small to draw accurately?</p>
Good question, the answer is of course &quot;it depends&quot;. Is the text too small? Depends how small you are drawing it!<br><br>The main problem with drawing text is actually creating the artwork to draw. Every text layout or illustration application uses outline fonts (truetype, opentype etc), which means the machine ends up drawing an unfilled outline of each letterform. It's not wrong, it's just weird, and usually not what is expected.<br><br>So preparing the artwork is one problem, but is nothing really to do with Polargraph.<br><br>Drawing very small details is completely possible, but you end up having to move slowly, with plenty of weight, and a smooth tipped pen. There is plenty of resolution available, but it's overcoming the physical characteristics (the pen tip sticking in the paper) that takes a bit of tuning.<br><br>sn
<p>Hi! I'm having a bit of a problem with my motors, once they have been moving for a few seconds they starting shaking! This only happens when I use it with the chain, metal and plastic I've tried, both with the same outcome, my weights are 22g each, do you think it's too heavy? Thanks (: </p>
Impossible to say, because I don't know what kind of motors you have, your driver voltage, what kind of drivers you have etc.<br><br>22g is not heavy at all though.<br><br>Without the chain, when the motors are moving, try grabbing one of the sprockets and stopping it. You should be able to stop it from moving, but it shouldn't be easy to do.<br><br>If it is very easy to stop, then you need to get some more power somehow. Different motors, different voltage perhaps. Are the motors, or the driver chips hot?<br><br>
<p><a href="http://www.amazon.co.uk/gp/product/B00KKKP4YC?psc=1&redirect=true&ref_=oh_aui_detailpage_o04_s00" rel="nofollow">http://www.amazon.co.uk/gp/product/B00KKKP4YC?psc=1&amp;redirect=true&amp;ref_=oh_aui_detailpage_o04_s00</a> these are the motors I'm using, as for the power it's connected to my computer and the driver chips are only a little warm after a while. </p>
<p>USB doesn't supply enough power to actually do much - you'll probably need to try an external supply.</p>
<p>Did you use more then one pen / color or how did you create this effect?</p>
<p>One pen per layer. Draw multiple layers.</p>
<p>Aaaaaah, all right ;)</p><p>Thanks men and keep going on with such kind of cool projects (y)</p>
<p>I can not configure</p>
<p>Hey! I love this project, its great! I'm just having a slight (I hope) problem with the software, I think I have installed everything, but when I press play this message appears. Any ideas? (: </p>
<p>diwald_CV_kit is a library that the controller code requires. Exactly as the error message suggests, you are probably missing it. Put it into your libraries folder, along with geomerative and controlp5 libraries. </p><p>http://www.instructables.com/id/Polargraph-Drawing-Machine/step11/Controller-software-install/ has the details!</p>
<p>Hi, i've tried that and it still isn't working yet :/ any other things that might be the problem?</p>
<p>Nope, the only thing that could cause that error (library could not be found), is that it can't find the library. Now, I guess you've put it somewhere, but maybe not in the right place. It needs to be in &lt;processing sketchbook&gt;/libraries.</p>
<p>Hi, I got a Tower Pro mg995 servo but the it rotates only to 1 direction! I want to make it go back and forth to the initial position but have no lucks. I already test different ranges of rotational degree but couldnt make it. Any helps? Thanks.</p>
The control code for the servo motor is very simple, so there's not much to go wrong there. Could the motor be faulty?
<p>Hi, hello, I come from China, </p><p>Arduino to send commands from the controller directly with the SD Card This method http://www.polargraph.co.uk/2012/02/state-of-the-art-tangle/</p><p>I did not get success</p>
<p>Hi, the blog post you linked to is the only real documentation for this - it isn't really a supported feature. It requires a Arduino MEGA. You will need to figure the rest out yourself, unless you can tell me what you mean by &quot;did not get success&quot;. </p><p>Please post on the polargraph forum instead of here - the commenting system here is poor.</p>
Address Hello polargraph forum can be made about it
<p>Hello, I'm from China</p><p> I would like to ask you a few questions arduino Uno there can also directly read queue commands directly from the SD card in order to draw from their own controllers</p>
<p>Reading from the SD card requires an Arduino MEGA, as here </p><p>http://www.polargraph.co.uk/2012/02/state-of-the-art-tangle/</p>
<p>Just add an SD card from the computer controller will be able to continue drawing</p>
<p>嗨,你好, <br>我来自中国,非常喜欢你的机器人,我是一名ui设计师,不懂程序,但是一步一步的做了下来,我的图都是矢量图形,但是一直没有解决乱线的问题,请问在画适量图形的时候可以自动抬笔吗?</p><p>Hi, hello, I come from China, very like your robot, I am a UI designer, don't understand the procedure, but step by step down, my figure is vector graphics, but has not solved the problem of disorderly line, can when drawing a moderate amount of shapes to pen up automatically?</p>
Hi, I'm sorry I don't really understand what you mean. It looks like your drawings are working fine, but you don't have a pen lift servo motor fitted?<br><br>If it is fitted, then it is just not lifting the pen high enough?<br><br><br>sn
<p>do you think that it will work on android?</p>
Definitely not.
<p>Hello Windows8.1 control software control software crashes often generated when the queue is often stuck how to solve this problem</p>
Seriously, this could be anything. The app is exported from Processing 1.5, so you can try googling for problems with exported processing apps. The problems I've had with the controller have usually been generic problems with processing, java environments, that kind of thing.<br><br>sn
<p>Hi Euphy, </p><p>What does it mean by &quot;Have added MEGA as a compilation target&quot; in </p><p><a href="https://github.com/euphy/polargraphcontroller/releases/tag/1.2-1.2-1.11" rel="nofollow">https://github.com/euphy/polargraphcontroller/rele...</a></p><p>Does that mean I can upload &quot;polargraph_server_a1_adafruit_v1.cpp.hex&quot; to my mega using &quot;xloader&quot;?</p><p></p>
Hi, no, the precompiled hexes are for regular Arduino UNOs.<br><br>The note refers to these lines https://github.com/euphy/polargraph_server_a1/blob/master/polargraph_server_a1.ino#L35-L41 that allow you to compile for the MEGA, and access a couple of the features that don't fit onto an UNO.
<p>Hello euphy.</p><p>Im litterally in love with this machine, i am actually going to do this to make some art for my institution, i wonder does the pen lift if i use images/vectors ? (not including the beginning and end of the queue) .</p><p>im currently getting the 3d printed gears sometime this week and im going to finish this proyect, i will ask if i find any issues, thanks for your work </p>
<p>Thanks, no problem! The pen lift is definitely required for the vector drawing stuff. It's less essential for the bitmap work, because that is continuous anyway.</p><p>Good luck!</p><p>sn</p>
<p>This Is Comming Up Great!... Though... i have this problem where , even if fill the whole board with an image, it cames out REALLY SMALL like an 1:10 Ratio, searching the forum i have seen that increaing weights might help this...</p>
<p>Hello! Thanks for all the details. </p><p>I quickly hacked around with some hardware on a whiteboard, while i was trying to draw a square image, the output turns out rectangular (width is larger than height). How can I correct this?</p><p>I'm using two 200 steps motors with a 40T 2GT belt pulley (~24mm diameter), mmPerRev set to 70mm. And also I have set the step multiplier to 2.</p>

About This Instructable


834 favorites


Bio: Like everyone, I like making things. I'm currently a computer programmer by trade, which I adore, but I like building physical things when I ... More »
More by Euphy: Polargraph Drawing Machine Linear Clock Mechanical expanding cardboard lamp - This way up!
Add instructable to: