loading

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. Seriously. Actually do this. Nothing will work until you do this. Do it.

Look at this fine guide courtesy of Adafruit for help. Or anywhere on Instructables, or one of the hundreds of Arduino tutorials on the web.

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. Download the file called Polargraph.___.zip.

Unzip the bundle. Inside it is a folder called arduino-source which contains (you guessed it), the source code for the arduino part of the project.

Inside arduino-source there is a folder called libraries. It contains the libraries you need (

Adafruit's AFMotor and Mike McCauley's Accelstepper)

It also contains a folder called polargraph_server_a1. This is the polargraph firmware source code.

Copy the contents of arduino-source/libraries into your Arduino/libraries/ folder.

Copy arduino-source/polargraph_server_a1 into your Arduino/ folder.

You should have created three new folders on your disk:

  • Arduino/polargraph_server_a1/
  • Arduino/libraries/Accelstepper/
  • Arduino/libraries/AFMotor/

Start Arduino IDE.

Go to File->Sketchbook->polargraph_server_a1

Fourteen files will open up and be displayed as tabs in the IDE. This is the source code of the firmware.

Press the "verify" button in the toolbar to try and compile it.

If it compiles, press the "upload" button in the toolbar to upload it.


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, but you'll have to figure that one out yourself.

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 last image).

Hello, really nice project.<br>You already answer this was possible wigh a mega 2560 wigh light modifications of the sketch but i owned a mega with a Ramps. Still realizable ?<br><br>Thanks in advance,<br><br>Vivian
<p>Now I think is working, but my stepper motors are making strange noise (squeak and like boiling noise) and got hot very quick. Anyone can help? :) </p>
<p>Use only steppers with lower amp rating. Like 0.4A which is common with 30mm steppers. 1.3A motors can fry the L293D. 2.0A motors will fry it.</p>
<p>What's more I've just noticed is that when I want my gondola to move right it is going down, and when I want it to go left it moves up :(</p>
<p>switch motor cables. left &lt;&gt; right </p><p>OR(!)</p><p>change wire-couples -&gt; if red+blue is on the top connectors and black+green is on the bottom connectors, switch both pairs. Put red+blue down and black+green up.</p>
<p>When I set my 200step motor to 400steps and a multiplier of 1 the movement is totally messed up. Approximately a 1cm move downwards moves the gondolo more like 10cm. </p><p>So I don't understand why you recommend to set the stepper motors to these values (doubled steps) that do not work. And as they don't work for me, they will not work for anybody else. No just kidding. Is there some math behind it or why is this?</p>
<p>nevermind. see this :</p><p>http://www.polargraph.co.uk/forum/polargraphs-group2/troubleshooting-forum5/cant-get-my-settings-calibrated-thread530/</p>
<p>When I move vector it won't release when I click. Weird. </p>
<p>Figured it out. One has to Select Area and Set frame to Area before placing vectors. </p>
<p>Thanks for a great tutorial! More details on </p><p>http://pappmaskin.no/2016/08/pen-plotter-1/</p>
<p>Hello euphy!</p><p>i loved this proyect!</p><p>i have one problem though... in my &quot;powerfull&quot; laptop it works great, everything</p><p>then i try a netbook or basically any other computer and it stays in busy (when trying to upload sizes to the machine) for over one second, even though, if i SET HOME , it doesnt compute, and it doesnt change place, i tried changing the cable, reinstalling arduino, reinstalling java, (i need to try picking another serial library for processing, though my powerfull laptop doesnt have it and still works), i need to check if the arduino co processor requires diferent drivers, great job BTW</p>
<p>Hey Euphy,</p><p>I've build my own polargrpah using Arduino Uno and two steppers( Nema 17) but it seems that something is off. I have checked my measurements and configurations 5 times (step by step with this tutorial) and it all seems correctnut for some reason the machine is still off (doesn't go to where it suppose to, doesn't come back to where it was suppose to and goes off the page).<br>When I upload the machine specs I get this error message:<br>E14:15:00 C25, PGXXABCD,END not recognized.</p><p>this happens every time I try to upload and I couldn't find the reason or meaning of it, could you help me?</p>
The error is nothing to worry about - just an old command that doesn't do anything any more.
<p>The machine is still off. What else can be the problem??</p>
<p>Euphy,</p><p>New Problem. Well two actaully.</p><p>First, when I so a pen tip test it prints out super small not matter how much I change the setting.</p><p>Second, I am assuming also pen size related is that the lines it draws in the on pixel areas are really close together. When is gets to detail areas it just ends up filling in solid because I have not been able to figure out what the right setting are.</p>
Show me a pic of what you mean by super small. Small pixel, or small lines, or small spaces - you need to consider how you might expect me to be able to help based on what you state as the problem.<br><br>&quot;No matter How much you change the setting&quot; - which setting? Does the pixel density (the number of lines) change at all?<br><br>Are you using a very small grid size?<br><br>
<p>Euphy,</p><p>Here it what it looks like when I try to do a pen tip test and my settings. Not sure what I have done wrong.</p>
<p>i have the same problem... if you found the solution can you help?</p>
<p>Did you read my reply below?</p>
<p>yes i made those changes, but it wont work also my machine drawing things horizontally, instead of virtically </p>
<p>https://github.com/euphy/polargraph/wiki/It's-going-the-wrong-way!</p>
<p>yes and this is one sample !</p>
<p>this is the drawing of that picture, it just drawing lines of it</p>
<p>http://www.instructables.com/id/Polargraph-Drawing-Machine/step18/Finish-configuring-your-controller/</p><p>Is the step with the machine settings in it.</p>
<p>thanks Euphy all things working fine... </p>
<p>The messages up the right-hand-side of your screen: they mean something. &quot;You probably won't get any detail ...&quot; means that with your pen size (which is huge, 4.12mm tip), you can't fit any waves into your grid. Your pen tip is potentially larger than your grid size.</p><p><a href="https://github.com/euphy/polargraph/wiki/Empty-pixels" rel="nofollow">https://github.com/euphy/polargraph/wiki/Empty-pix...</a></p><p>I seem to have lost the step that shows the settings though .. that's weird.</p><p>For Adafruit motorshield v1:</p><p>STEPS PER REV is 2x your motor steps per rev. So if you have 200 step motors, then set STEPS PER REV to 400.</p><p>STEP MULTIPLIER is 1.</p><p>Remember to do a &quot;upload machine spec&quot; too.</p><p>It looks like you've got a slightly sloppy gondola too, perhaps the pen is sticking too far out of the holder, so it doesn't cleanly translate the cord movement into pen movement.</p><p>sn</p>
<p>I almost did every thing correct, re-measurement and all but it still drawing lines of any picture, can you share configuration file or .svg file if you have of any picture!</p>
<p>How will an SVG help?</p><p>You've made all the adjustments suggested in </p><p><a href="https://github.com/euphy/polargraph/wiki/Empty-pixels#solution" rel="nofollow">https://github.com/euphy/polargraph/wiki/Empty-pix...</a></p><p>Small pen, large pixels?</p><p>Does drawing vector art work?</p><p>Does &quot;draw box outline&quot; work? </p><p>What error messages are you seeing next to the command queue?</p>
<p>SVG wont help, i need configuration file to configure my machine according to which i m gonna rebuilt it if it doesn't work</p><p>ye i almost made all the adjustments</p><p>no, vector art work do not working</p><p>neither draw box outline working</p><p>E02:14:04 C25,PGXXABCD,END not recorg.</p><p>for vector E02 :13:50 this point falls outside the machine, skipping it</p><p>for box outline E02:17:24 line not on the page skipping it</p>
<p>Ok, &quot;this point falls outside the machine&quot; and &quot;line not on the page skipping it&quot;.</p><p>These both mean either:</p><p>Machine is not set up (do this with &quot;upload machine spec&quot;)</p><p>or</p><p>Home point is not set (do this with &quot;set home&quot;)</p><p>or both.</p><br><p>Every time you change the machine size, or motor settings you must &quot;upload machine spec&quot;.</p><p>Every time you turn the machine on, you must &quot;set home&quot;.</p><p>When you say you &quot;almost made all the adjustments&quot;, which ones did you _not_ make?</p><p>Someone else's configuration file would have their machine size and their motor settings in - how would it be useful to you?</p>
<p>i will design my machine according to those parameters, kinda reverse enginering </p>
<p>Euphy,</p><p>Here it what it looks like when I try to do a pen tip test and my settings. Not sure what I have done wrong.</p>
<p>Nothing wrong as such, but:</p><p>- Grid size is very very small. There is no effective way to express any differences in shade in a pixel that small, because of the thickness of the pen.</p><p>- Gondola is a bit wobbly by the looks of things. Even small details should have sharp corners and regularly curved edges.</p><p>You could try one (or all of):</p><p>- Put your grid size up to 50 and try again. </p><p>- Make sure your pen is not sticking too far out of the gondola, so the tip doesn't trail behind the movement of the gondola. Ideally you want the pen tip barely protruding.</p><p>- Knock your pen acceleration speed down (or up) to try and get some better control in the corners.</p><p>- Add a bit of weight to the gondola to pull the pen more taut</p><p>Pen width test is a great way of testing this though.</p>
<p>Hey Euphy,<br>I've build my own polargrpah using Uno and two steppers but it seems that something is off. I have checked my measurements and configurations 5 times (step by step with this tutorial) and it all seems correct but for some reason the machine is still off (doesn't go to where it suppose to, doesn't come back to where it was suppose to and goes off the page).<br>When I upload the machine specs I get this error message:<br><strong>E14:15:00 C25, PGXXABCD,END not recognized.</strong><br>this happens every time I try to upload and I couldn't find the reason or meaning of it, could you help me?</p>
<p>When trying to test pen widths this is what I got.</p>
<p>Hello, can you help me with this step?</p><ol><li><strong>Install project: </strong>In the code bundle, copy the whole <em><strong>processing-source/polargraphcontroller</strong></em> folder into . </ol><p>Into where? Having problems with the software and I have no idea where you intended to tell us where to put this file.</p>
<p>Aha, I don't know why I'd removed that key part of the sentence, sorry... I've fixed the step.</p><p>The polargraphcontroller folder should be moved into your Processing sketchbook folder.</p>
<p>hey do you think I can built this project using labVIEW and my dec ?? It's really cool </p>
<p>I also plan to use this free standing with a raspberry pi zero and a display, to remove the need for a host PC in outdoor or mobile settings. The controller box is going to be very exciting since I am building it to support up to 4 stepper motors (Connected over a 5-pin MIDI cable, Supports both bipolar and unipolar steppers without wasting pins. MIDI Cables are perfect for this), as well as allow for on-board image processing, and real-time status info on the display.</p>
Controller doesn't really work on raspberry pi, but something lighterweight will run fine. Once the command queue is generated, the load to deliver it is very low.<br><br>https://github.com/euphy/polargraph/wiki/Standalone-command-queue-runner describes a low-cpu method.
<p>Awesome tutorial! I really love the design you used for the gondola, however, I have a question. How do you keep the drawing utensil tightly locked inside the brass tube? I recently started assembling and noticed that there is a bit of movement room even with a full-sized sharpie marker. I thought of possibly using some foam wrap or possibly making the tube longer to add some locking screws in the back. Thanks!</p>
I use this (https://github.com/euphy/polargraph_models/blob/master/Gondola_mod_v4_cutout.STL), which is very like this http://www.thingiverse.com/thing:31973.<br><br>But I used to just use a blob of blu-tack, worked fine!<br><br>sn
<p>In advance thank you very much for your great work ...</p><div><p>I do not know much about programming, but why Processing v.3 gives many errors when running the driver source ?</p></div>
There's lots of changes in Processing 3, so there's lots of work to adapt the code. I haven't done the work.
<p>I'm trying to verify polargraph_server_a1 to push it to my Arduino UNO, but I keep getting this error: polargraph_server_a1:157: error: 'multiplier' was not declared in this scope</p><p>The multiplier function is clearly defined in util.ino, but polargraph_server_a1.ino can't seem to see it. Am I making a basic mistake here?</p>
Nope not a mistake here, but there was a change brought in in the Arduino IDE v1.6.6 and later that broke some things, and this is one of them. There is a fix for it in the main repository (https://github.com/euphy/polargraph_server_a1), but it's not been bundled up for a official release yet. There's no reason not to use it though, if you can get it downloaded.<br><br>Workaround is just to use ARduino v1.6.5 for a bit longer.<br><br>sn
Can I use a Arduino uni R3?
<p>The Polargraph firmware works on an Arduino UNO.</p>
Can you send a circuit diagram of the polargraph
<p>Please don't spam the comments section. I would recommend you start with a more simple project to introduce you to Arduino, I can't help you with such basic questions.</p><p><a href="http://www.instructables.com/id/Arduino-Beginner-and-Basic-Electronics-Kit-Primer/," rel="nofollow">http://www.instructables.com/id/Arduino-Beginner-a...</a> or </p><p><a href="https://learn.adafruit.com/adafruit-motor-shield" rel="nofollow">https://learn.adafruit.com/adafruit-motor-shield</a></p>

About This Instructable

376,412views

1,013favorites

License:

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: