Fighting with computers

Computers are not always friendly.

Tuesday, April 05, 2016

4xiDraw: Another pen plotter

After watching a video of a new pen plotter made by Evil Mad Scientist we wanted to have a similar device.



And having a 3D printer at hand plus some CAD software like Onshape or Fusion 360 it was a good exercise to design the whole thing.



As usual the process was not completely straightforward, as initially it was more about copying the model we saw but as things were coming together some new ideas were explored. So while the first mock-up was based entirely on laser-cut parts (some of them glued together to make them thicker as the crappy laser I have access to is really depth limited as it is low-power).  Why laser-cut? Well because it was faster (or so it was supposed, but don't get me started on that).


Once the first model was put together several ideas pop up: First, motors are in the way of carriage motion and reduce a bit carriage travel along smooth rods. Second, motors require another part that could be fused with the machine feet and rods support. Third, the initial belt path created non-parallel belt runs that will cause poor accuracy and variable belt tension, so central carriage needs to be revised.

Eventually, the model became more and more made of printed parts and once published there have been more ideas pouring in from some of the readers, like an easier to orient pen holder that already replaced the original one.

Controller firmware

My initial approach was to try to imitate the design and tools of AxiDraw but then I learned they use a PIC-based board that I do not have around and that it will take a while till I get one, but I had Arduinos laying around instead, so it was settled my plotter would be operated by Arduino. A CNCshield a friend gave me away (thanks Ernes) could hold a couple of stepper drivers to control the machine. 

A logical choice was to use GRBL firmware but a few details needed to be solved: this contraption is not a regular cartesian design but it uses a single belt configuration called H-bot. From the math point of view h-bot and corexy work the same so I was happy to learn the latest versions of GRBL do in fact support corexy. That was one thing solved. The next one was that I needed to control a servo por pen-up and pen-down movements. For doing that I learned that robottini's version of GRBL could do that too. So another need was solved too and firmware was settled. You can use mine. Servo is controlled by M3 and M5 commands.

Software workflow

So my drawing machine will receive drawing commands as g-code but, how is that drawing code being created. I looked around and what was designed for AxiDraw was an Inkscape plugin  that would create code suitable for the board they sell which is nothing similar to the g-code mine uses, so I had to use something else. 

I learned about several projects for outputting g-code for laser cutters from Inkscape. I settled with one plugin that seemed very powerful not only cutting but doing raster images too, but intended for a laser cutter. The good thing was that output was g-code, so I had to hack my way to adapt it to draw with a pen. After some struggle I manage to get a stable response. 

The problems I faced were that pen up and pen down commands took time and I needed to add an extra delay so drawing would be ok. Where original plugin controlled the laser output power I just needed to set the pen down so lines would be printed. It took a while but now it is working nicely.


If you wonder why there is a 608 bearing on the pen carriage which is not present in the CAD files it is because it adds a bit more weight so the ball-pen will draw a more consistent line.

Another project  I tested was LaserWeb, which uses your browser to convert SVG or DXF files into GCODE and can stream the file directly to you machine's serial port. It is based on javascript and I installed the server side on Cloud9, but I had to replace the 8000 port to 8080 to get it working on that platform. 

Once the g-code files are obtained, in my case using the Inkscape plugin, another tool is needed to send the file to the drawing machine. I am using a Java-based program called Universal Serial Sender that does the job brilliantly and it includes a preview and a live view of the print too. 

That makes the whole workflow based on open source software that can run on any operating system you are using.

Some of you asked me why the 4xiDraw name: well, AxiDraw is a registered trademark and FreeDraw was already taken too.



37 Comments:

  • At 3:54 pm, Blogger Michael Ball said…

    Miguel! This is awesome! Now I want one! LOL

    Keep making my friend! You are an inspiration to us all!

    Michael

     
  • At 8:30 pm, Anonymous Robottini said…

    Very good job Miguel! I want to make one. I see we have a common friend: Mauro Manco.
    The world of makers is little. Robottini - Alessandro

     
  • At 9:25 pm, Blogger Miguel Sánchez said…

    Very good job Alessandro, not only your version of GRBL is powering the machine but it also implements G4 command that comes in handy for servo delay. What Mauro does not know is that there is in the pipeline another version using g-slot and his wheels.

     
  • At 4:26 pm, Blogger Vinícius said…

    This is simply fantastic. Me and my friend are trying to do the same project for a college work, and we are also using arduino. So I have a request: can you plis share your codes with me, and if possible some tips?

     
  • At 4:42 pm, Blogger Vinícius said…

    This is simply fantastic. Me and my friend are trying to do the same project for a college work, and we are also using arduino. So I have a request: can you plis share your codes with me, and if possible some tips?

     
  • At 4:51 pm, Blogger Miguel Sánchez said…

    Code is already linked in the blog entry. You can use Bluetooth to make it work wirelessly.

     
  • At 4:52 pm, Blogger Miguel Sánchez said…

    Code is already linked in the blog entry. You can use Bluetooth to make it work wirelessly.

     
  • At 6:24 am, Anonymous Nicolas said…

    Hello your work is amazing!!!,and please, I need your help...when you open Universal Serial Sender, do you select "baud rate=9600 or 115200 "?? Cause my stepper motor doesnt work with 115200 and i cant find GRBL v0.9i with baud rate 9600.. Thank!

     
  • At 6:39 am, Anonymous Nicolas said…

    how do you upload your firmware grbl to your arduino?

     
  • At 9:03 am, Blogger Miguel Sánchez said…

    Using this process: https://github.com/grbl/grbl/wiki/Compiling-Grbl

     
  • At 1:13 pm, Blogger nicotox3 ro said…


    Hello your work is amazing!!!,and please, I need your help...when you open Universal Serial Sender, do you select "baud rate=9600 or 115200 "?? Cause my stepper motor doesnt work with 115200 and i cant find GRBL v0.9i with baud rate 9600.. Thank!

     
  • At 1:29 pm, Blogger Miguel Sánchez said…

    Firmware is configured to use 115200bps, source code is provided so you can change that to 9600 if you have to.

     
  • At 10:22 am, Blogger Andreas Hölldorfer said…

    Good job, but now I have to find time to build one.

     
  • At 10:24 am, Blogger Miguel Sánchez said…

    I could not have done it without Easter holidays :-)

     
  • At 12:28 am, Blogger Santiago López said…

    Hi Miguel
    I'm looking for the F623ZZ bearings, and I found this.
    https://www.moebyus.com/partes-filamento/mecanica/rodamiento-con-canal-1-unidad-detail
    But I don't know where are assemble 10 of them.
    Maybe are this others bearings?
    https://www.moebyus.com/partes-filamento/mecanica/rodamiento-con-canal-1-unidad-1-detail
    if they are assembled in pair of two, maybe the counts are ok.

     
  • At 12:56 am, Blogger Miguel Sánchez said…

    The first one is not useful here, the second looks ok but I am not sure about dimensions. I would stay with F623 unless you redesign the two central plates that hold the linear bearings.

     
  • At 8:48 am, Blogger Santiago López said…

    ok thanks you!
    I think i'm going to buy in eBay :)
    http://www.ebay.es/itm/10-PCS-flange-bush-F623ZZ-3x10x4mm-Miniature-deep-groove-ball-bearing-3-10-4mm-/221963156824?hash=item33ae08fd58:g:nbUAAOSw7FRWZ9G5

     
  • At 7:45 pm, Blogger Miguel Sánchez said…

    Or cheaper http://es.aliexpress.com/store/product/Free-Shipping-10-pcs-lot-F623-ZZ-flange-bushing-ball-bearings-F623ZZ-3-10-4-mm/837425_32363767627.html?spm=2114.04020208.3.72.vB5flf&ws_ab_test=searchweb201556_10,searchweb201602_5_10037_10034_507_10032_10020_10017_10005_10006_10021_10022_10009_10008_10018_10019,searchweb201603_1&btsid=e1a434cf-f917-4e9a-bcf0-befa29c08e20

     
  • At 10:18 am, Blogger Max Mi said…

    Good job,Is there a more detailed implementation to set the pen down ?

     
  • At 10:58 am, Blogger Miguel Sánchez said…

    There in now an instructable http://www.instructables.com/id/4xiDraw/ but the details of the pen mechanism are not very detailed. It is just the servo lever that pushes up the carriage (pen-up) and gravity (maybe a spring can help) to push it down. Command M3 S100 (or another number) will allow you to set the level to a certain angle. M5 is equivalent to M3 S0.

     
  • At 12:45 am, Blogger holman william grajales velasco said…

    Cordial saludo. muchas gracias por toda la información la cual me ayudo mucho para completar mi maquina.

     
  • At 1:06 am, Blogger Miguel Sánchez said…

    de nada :-)

     
  • At 4:17 pm, Blogger ATV Rider said…

    great job! what size linear shaft?

     
  • At 5:37 pm, Blogger Miguel Sánchez said…

    8mm, there is an instructable with more details www.instructables.com/id/4xiDraw/

     
  • At 6:53 pm, Blogger ATV Rider said…

    ok thanks you!)

     
  • At 6:11 pm, Blogger ATV Rider said…

    please tell me how to set up restrictions on X and Y?

     
  • At 7:03 pm, Blogger Miguel Sánchez said…

    What do do you mean restrictions? Limiting travel range of one axis?

     
  • At 7:06 pm, Blogger ATV Rider said…

    yes.is it possible to put limit switches?

     
  • At 8:16 pm, Blogger Miguel Sánchez said…

    Yes, it is possible do put limit switches (look grbl info for that). It is possible to limit the length of axis too, again look for guidance here https://github.com/grbl/grbl/wiki/Configuring-Grbl-v0.9

     
  • At 12:48 am, Anonymous Carlos P said…

    Hola buenas, estoy montando un 4xidraw, enhorabuena por el trabajo realizado, queria preguntar si podia subir un par de fotos donde se vea como está montado en el centro donde los rodamientos ya que no consigo montarlo de forma correcta con los manuales de instructables y demás. Me falta por poner la correa.

     
  • At 8:24 am, Blogger Miguel Sánchez said…

    http://imgur.com/2PF3Kza

     
  • At 4:04 am, Blogger Andres Amorin said…

    Felicitaciones por un buen laburo Miguel!. Consulta: conseguiste los rodamientos y smoth rods acá en Uruguay o los importaste?

     
  • At 8:50 am, Blogger Miguel Sánchez said…

    Hola Andrés: Los pedí a Aliexpress (pero no estoy en Uruguay).

     
  • At 3:52 pm, Blogger gcom said…

    Hi Miguel,
    thank you for this, I am putting one together at the moment.
    Is a 2A x 12v wall wart enought o power the whole thing if the modification with the wire is done?
    My Nema 17 motors specification says 1.6 amps each but I dont know under what conditions they draw this 1.6 amps.
    Also My 8mm rosa are 600 long, would it work at 600m x 600mm?
    Thank you,
    George
    Ireland

     
  • At 4:23 pm, Blogger Miguel Sánchez said…

    I reckon 12V 2A will be ok. Motors cannot be run at 1.6A per coil with the drivers we use but more around 1A each, plus switch coils draw and return current to the power rails. Moving cart uses around 80mm so total motion is always lower than rod length. What would worry me is the stability of a machine this size (it can tilt as the arm with the servo moves back and forth. Let us know how it goes.

     
  • At 7:08 pm, Blogger gcom said…

    Hi Miguel,
    Thank you for replying. I couldn't find the website again to thank you,
    it seems you have a few websites on the go.
    I am putting my 4xidraw together and making it a bit bigger to take an A3 page but I bought the 3d printed parts online in PLA and they all just broke when pushing in the bearings etc. I have re-ordered them in ABS. To be fair, they are very cheap.
    I have no experience of 3d printed parts but it seems that, structurally, the are a bit borderline; hopefully the ABS will be better.
    Thank you for all the work.
    George

     
  • At 10:34 pm, Blogger Miguel Sánchez said…

    Hi George,

    Yep, different activities on several blogs :-)

    Sorry to hear you got some parts not up to the task. I am still intrigued on whether A3-size will work ok stock or if some extra weight will need to be added to the base to prevent it from tilting. I prefer ABS parts too. 3D printed parts can be quite robust if printed well. Main problem with PLA is it gets soft with temperature (motors can get hot and a PLA part could bend).

    Thank you for your kind donation.

     

Post a Comment

<< Home