CoreXY CNC Plotter

111,847

631

113

Introduction: CoreXY CNC Plotter

About: 55+ years in electronics, computers, and teaching ... now retired.

This instructable describes an A2 plotter made from low cost aluminium extrusion, a piece of particle board, two NEMA17 stepper motors, and a few belts and pulleys.

The plotter is:

    • high resolution (80 steps/mm),
    • fast,
    • low-cost,
    • and scaleable

    The plotter has an on-board interpreter that recognizes the g-code output from "Inkscape" .

    Metal work is simple ... all you need is a hacksaw, three drills, a rat-tail file, and a screwdriver.

    12 October 2017:

    An improved pen-lift is described in instructable https://www.instructables.com/id/CNC-Pen-Lift/

    16 November 2017:

    Bluetooth is added in instructable https://www.instructables.com/id/Add-Bluetooth-to-...

    Z-axis control is added in instuctable https://www.instructables.com/id/CNC-Pen-and-Wash-...

    17 March 2018:

    GRBL (optional) installed in instructable https://www.instructables.com/id/How-to-Control-a-...

    Step 1: Circuit

    The wiring diagram for this plotter is shown in photo 1.

    The EasyDriver module expects the wires from each motor coil to be adjacent. Check that the motor wires don't alternate ... if so swap the two center wires.

    Adjusting the motor current(s):

    Set your CPS-3205 power supply to 12 volts.

    Attach a 12 volt 30 ohm NEMA17 stepping motor to a Big EasyDriver module and apply power to the motor assemby.

    Now adjust the small potentiometer on the Big EasyDriver module for a current reading of 0.4 amps (400mA) on the CPS-3205 power supply.

    Repeat this process for the remaining motor and Big EasyDriver module.

    Disconnect the power.

    Substitute motors:

    The plotter also works with 6 volt 8 ohm stepping motors in which case the CPS-3205 power supply should be set to 6 volts and the motor currents set to 0.6 amps (600mA).

    Step 2: Software

    The source code for this plotter is attached.

    Software installation:

    • copy the contents of coreXY_plotter.ino into an arduino sketch. [1]
    • save the file as "coreXY_plotter" (without the quotes).
    • compile and upload the sketch to your arduino.

    [1]

    22 December 2018:

    The "bool" definitions in the file coreXY_plotter_1a.ino have been rewritten in the following format:

    • bool CW = true; //flag ... does not affect motor direction
    • bool CCW = false; //flag ... does not affect motor direction
    • bool DIRECTION1; //motor directions can be changed in step_motors()
    • bool DIRECTION2;

    For some reason the original format (in some compilers) no longer works ????

    Otherwise the code has not been altered.

    Step 3: Parts List

    The parts list for either an A4 or A2 coreXY plotter is attached ...

    Wood saws are not required if you ask your timber merchant to cut the particle board and and pine supports to length.

    Step 4: Theory

    The timing belts are arranged in a "coreXY" configuration.

    An excellent explanation of the "coreXY" principle may be found at http://corexy.com/theory.html

    The pen moves:

    • horizontally when the motors rotate in the same direction.
    • vertically when the motors rotate in opposite directions.
    • diagonally if only one motor rotates.

    Step 5: The Mathematics

    This step derives the pen motion equations and may be ignored ...

    If we rotate motor A counter-clockwise by an amount ∆A then the pen carriage will move horizontally to the right by an amount ∆X and vertically upwards by an amount ∆Y. The equation for this is:

    ∆A = ∆X + ∆Y ...................................................... (1)

    If we rotate motor B counter-clockwise by an amount ∆B then the pen carriage will move horizontally to the right by an amount ∆X and vertically down by an amount ∆Y. The equation for this is:

    ∆B = ∆X - ∆Y ....................................................... (2)

    The reason for the ∆Y sign/direction change is that the two timing-belts are moving in opposite directions... the timing-belt for motor A is being fed towards the pen which lets the pen to move upwards, whereas the timing-belt for motor B drags the pen downwards.

    Horizontal motion:

    Rearranging equations (1) and (2) we get:

    ∆Y = ∆A - ∆X ....................................................... (3)

    ∆Y = -∆B + ∆X ..................................................... (4)

    Equating equations (3) and (4) we get:

    ∆A - ∆X = -∆B + ∆X ............................................. (5)

    From which:

    ∆X = (∆A + ∆B)/2 ................................................. (6)

    Translating: the pen moves horizontally when both motors rotate in the same direction

    Vertical motion:

    Rearranging equations (1) and (2) we get:

    ∆X = ∆A + ∆Y ....................................................... (7)

    ∆X = ∆B - ∆Y ...................................................... (8)

    Equating equations (7) and (8) we get:

    ∆A + ∆Y = ∆B - ∆Y .............................................. (9)

    From which:

    ∆Y = (∆A - ∆B)/2 ..................................................(10)

    Translating: the pen moves vertically when the motors to rotate in opposite directions.

    Collectively equations (6) and (10) infer diagonal movement if only one motor rotates.

    Step 6: Evolution ... a Story of Trial and Error

    H-Bot design:

    My first build comprised a single timing belt arranged in the shape of a letter 'H', or "H-Bot" configuration, as shown in photo1.

    I quickly abandoned this design for three reasons:

    • If both motors rotate in the same direction the tension at opposite ends of the gantry caused unacceptable "wracking" [1].
    • pen wobble was excessive
    • the timing-belt tension spring was not a good idea ... the belt tension needs to be firm.

    CoreXY design:

    A few modfications eliminated all of the above problems.

    • The timing belt was cut in half and arranged in a "coreXY" configuration [2]. This arrangement has the advantage that all unbalanced timing-belt tension is in the direction of pen movement as shown by the arrows in photo 2 and photo 3.
    • Pen wobble was eliminated by using an extra guide rail for the pen assembly.
    • Variations in belt tension were eliminated by replacing the spring with cable-ties.

    The design is scalable:

    Photo 4 compares the original A4 plotter with the base of a larger A2 plotter described in step 7.

    The gantry and pen carriage dimensions are common to all plotters. The only additional parts required for the larger plotter shown in photo 5 are:

      • a larger base board.
      • longer side rails.
      • longer timing belts

      [1]

      An H-Bot timing belt pulls the gantry ends in opposite directions whenever the pen moves horizontally (see arrow directions in photo 1). This causes a twisting motion known as "wracking".

      [2]

      CoreXY requires two full-length timing-belts. Halving the original H-bot timing belt allowed the coreXY concept to be tested before longer timing belts were ordered. It also accounts for the reduced plot area shown in photo 2.

      Step 7: Construction ... the Base

      Decide on your plot area:

      • An A4 plotter requires a 6mm x 600mm x 400mm piece of particle board.
      • An A3 plotter requires a 6mm x 800mm x 600mm piece of particle board.
      • or larger ... the design is scalable

      Bolt a length of 1.5mm x 20mm x 20mm aluminium "Tee Section" extrusion along opposite sides of the base. Ensure that both rails are parallel.

      The extrusions should be flush with the long edges of the base and positioned under the base such that the edges just protrude (see photo). These extrusions act as railway lines for the overhead gantry.

      Screw 65mm x 18mm timber end supports to the base. The timber supports will need a rebate for the aluminium extrusions ... make a shallow cut then knock a sliver of timber out using a chisel positioned against the end grain.

      Step 8: Adding the Fixed Pulleys and Motors

      The two timing-belts are stacked vertically above each other.

      This is achieved as follows:

      • One motor pulley is inverted as shown in photos 1, 2, & 3.
      • The toothed idler pulleys are stacked in sets of two as shown in photos 4 & 5.

      Mounting the motors:

      Drill four x 3mm mounting holes, and one spindle clearance hole, for each NEMA17 stepping motor as shown in photos 2 & 3.

      The outside 3mm holes are 25mm from each edge of the base [1]. This distance ensures the the motors avoid the wooden support and the aluminium side rails.

      Mounting the fixed pulleys:

      Drill two 4mm holes for the fixed pulleys.

      These holes are located 25mm from the opposite end to the motors and 40.5mm from the side rails. This distance ensures that the pulleys avoid the wooden support. It also ensures that the timing-belts are parallel with the side rails.

      Key points:

      • Timing belts stretched between each motor and the associated fixed pulleys MUST be parallel to the side rails.
      • Separate the pulleys with a 4mm washer. The washer prevents the pulley edges from rubbing.

      [1]

      The 3mm motor mounting holes are spaced 31mm apart. This means that each spindle is 40.5mm from the nearest siderail.

      Step 9: The Gantry

      Vertical (Y-axis) motion is provided by a movable gantry that runs along the fixed side-rails attached to the base.

      Horizontal (X-axis) motion is obtained by running a pen carriage-assembly across two rails attached to the gantry end brackets.

      The gantry wheels are fashioned from VZ624ZZ V-groove sewing machine pulleys (photo 3). The V-groove prevents the gantry moving sideways.

      End brackets:

      Cut two 60mm x 130mm brackets from a sheet of 18 gauge aluminium using the method described in instructable https://www.instructables.com/id/How-to-Cut-Fold-S...

      Drill two 3mm holes and four 4mm holes at the locations shown in photo 1.

      Fold a 50mm top for each bracket.

      Mounting the wheels:

      Sandwich four "V-groove" pulleys between a 4mm nut and bolt. The nut prevents the sides of the pulleys touching the aluminium.

      Now bolt these wheels through the 4mm diameter holes as shown in photo 2.

      Attaching the end brackets to the base

      Attach a gantry end plate to each side of the plotter.

      To do this:

      • the grooved wheels must straddle the side-rails.
      • elongate the bottom holes as required to eliminate any vertical play in the gantry.

      When correctly adjusted the gantry end-brackets should roll freely when the base is tilted slightly.

      Top rails:

      The over-head gantry rails are attached when we attach the pen carriage-assembly ...

      Step 10: The Gantry Pulley Brackets

      The gantry pulley brackets:

      The gantry pulley brackets are cut from 18 gauge aluminium sheet. An approximate [1] drilling template is shown in photo 1.

      Photo 2 shows the pulleys attached to the motor 1 (left-hand) bracket.

      Photo 3 shows the pulleys attached to the motor 2 (right-hand) bracket.

      Key points:

      • The smooth side of the timing belts always sees a smooth pulley.
      • The ribbed side of the timing belts always sees a toothed pulley.
      • One of the double pulleys on each bracket is NOT used ... it simply acts as a spacer.

      Attaching the pulley brackets to the gantry:

      Press each pulley bracket against the inside of the gantry bracket such that the bracket is centered and the heads of the pulley bolts are clear of the base.

      Mark these positions by means of a pencil through the two existing holes in each of the gantry brackets.

      Now drill 3mm mounting holes and bolt the bracket pairs together.

      [1]

      The 4mm hole positions for the idler wheels depend on the sharpness of the upturned folds.

      Fold each pulley bracket then custom position the holes such that:

      • both timing-belts over-lap when viewed from above.
      • the idler wheels used as spacers don't touch any belts.

      Step 11: Pen Support

      The pen support is made from 18 gauge aluminium sheet. The dimensions are shown in photo 1

      Custom size the large holes such that your pen slides freely but without any sideways wobble.

      Attach a pen-lift collar to your pen. Mine was made from the brass fitting found inside a radio knob and a circular piece of plastic but anything will do ... so long as the position can be adjusted.

      Step 12: Pen Carriage Assembly

      The pen carriage is made from 18 gauge aluminium sheet. A drilling template (not to scale) is shown in photo 1.

      Assemble as follows:

      • drill and fold the metal
      • attach 8 x v-groove pulleys as shown in photo 2. Elongate the lower holes such that there is no vertical play when the aluminium "tee section" rails are fitted.
      • use a cable-tie to attach the SG90 servo as shown in photo 2. Drill the cable-tie holes to suit.
      • use the 3mm holes in the pen-support as a drilling template when attaching the pen.

      Fitting the top gantry rails:

      Attaching the rails:

      • Pass two 600mm lengths of aluminium "tee section" between the "V-groove" pulleys as shown in photo 2.
      • Attach each gantry bracket to one of the rails by means of two 3mm nuts and bolts.
      • Position the second rail such that the pen carriage-assembly moves freely. Now drill and bolt the rail to the gantry brackets.

      Step 13: Attaching the Timing Belts

      Key points:

      • the plotter has TWO timing belts.
      • each timing belt forms a continuous loop (see photo 2)
      • the timing belts are mounted at different heights ... the pulleys share a common shaft.
      • the timing belts are tensioned using cable-ties.
      • both timing belts are attached to a common 3mm bolt (see photo 3)

      Method:

      • push the pen carriage-assembly to one side.
      • tape both gantry ends to prevent movement (photo 1).
      • thread the bottom timing belts and fix the ends (photo 2).
      • thread the top timing belt and fix the ends (photo 3).
      • the timing belts should look like this (photo 4)
      • remove the tape.
      • tension the belts such that the carriage-rails are the parallel to the base end.

      Step 14: Attaching the Pen Carriage Assembly

      Two 25mm long threaded spacers are joined together (by means of a 3mm head-less bolt) to form a solid rod.

      The belts are attached to this rod as shown in photo 1.

      Attach the top of the rod to the center of the pen carriage-assembly using a 3mm bolt.

      Testing:

      The pen should:

      • move to the left when BOTH motors are turned clock-wise.
      • move to the right when BOTH motors are turned counter-clockwise.
      • move diagonally if only one motor is rotated.

      Step 15: The Menu

      Upload coreXY_plotter.ino to your arduino if you haven't already done so. Instructions for this are given in step 2.

      Connect a USB cable to your arduino and left-click "Tools|Serial Monitor" ... a menu similar to photo 1 should appear.

      Apply 12 volts power to your motors and your plotter is ready to use.

      The menu is not case sensitive. Typing:

      • MENU brings up the menu
      • G00 allows you to send the pen to a specific XY co-ordinate with the pen raised.
      • G01 allows you to send the pen to a specific XY co-ordinate with the pen lowered.
      • T1 allows you to position your pen over your 0,0 co-ordinate. Type 'E' to exit.
      • T2 allows you to scale your drawiing. For example "T2 S2.5" will scale your drawing 250%. The default scale is 100%.All pen moves use the drawing scale last set using this menu option
      • T3 and T4 allow you to raise or lower the pen.
      • T5 draws an "ABC" test pattern.
      • T6 draws a "target".
      • T7 draws a set of radial lines

      The internal wiring of some motor brands are reversed. If your motor directions are reversed then use the alternate code in the step_motors() function.

      Step 16: Creating and Sending Gcode Files to Your Plotter

      This plotter assumes that co-ordinate (0,0) is at the lower-left corner of your paper. As such it is 100% Inkscape compatible.

      Instructions for creating gcode files are given in the following instructables:

      Instructions for sending your gcode file to this plotter are given in instructable:

        Click here   to view my other instructables.

      1 Person Made This Project!

      Recommendations

      • Mason Jar Speed Challenge

        Mason Jar Speed Challenge
      • Bikes Challenge

        Bikes Challenge
      • Remix Contest

        Remix Contest

      113 Discussions

      0
      bloodsuc007
      bloodsuc007

      Question 3 months ago

      HI Thanks 4 the project.
      can I change the "Big Easy driver" to Microstep Driver.
      And how to wire it
      Thanks

      0
      lingib
      lingib

      Answer 3 months ago

      Thank you for your interest in my project :)

      Alternate controllers may be substituted providing they match the Big Easy Driver specifications. Download and compare the data sheets.

      The controllers MUST have a:
      - Direction input
      - Step input
      - Current-limit that supports your motor current.

      The motors in my project only draw 400 mA. Heat-sinks will be required if your motor currents are higher. Again this may be confirmed by looking at the data sheets.

      As to the wiring ... I do not have your controllers.

      0
      axispower123
      axispower123

      Question 5 months ago

      Need some help. Stuck building half way. Would be glad to have some Printable substitutes. Not an engineer but a political scientist, so any help would be appreciated.

      1. How to make my set up square.
      2. I am stuck with the motor mounts. Already tried a printed Z type mount but it is too weak.
      3. Corner idlers. Using something picked online, but alignment is again the issue.

      0
      lingib
      lingib

      Answer 3 months ago

      Thank you for your interest in my project :)

      Assuming your setup is similar to mine ...

      1.
      "How to make my set up square."
      This is achieved by adjusting the belt/tensions and is explained in Step 13.

      2.
      "I am stuck with the motor mounts. Already tried a printed Z type mount but it is too weak.}
      3D printing is not required ... just mount the motors through the base-board as shown in Step 8.

      3.
      "Corner idlers. Using something picked online, but alignment is again the issue."
      Unable to answer this without seeing what you have done.

      0
      kroghm5
      kroghm5

      Question 10 months ago

      Hi,
      Can anyone explain why FINISH = START + 8; in the process function of the given code?
      Thank you

      0
      lingib
      lingib

      Answer 10 months ago

      Thank you for your interest in my project :)

      The g-code output from Inkscape comprises a g-code instruction (G00,G01,G02,G03) followed by a data value. This data value is found in the 8 locations that immediately follow the g-code instruction.

      Not all g-code lines contain an instruction ... and we don't necessarily know where that that instruction will appear.

      To confirm that the instruction is present we search for the g-code instruction and, if found, mark its position as START.

      The data we need is contained within the next 8 locations ... we mark this position as FINISH using the formula FINISH = START+8;

      These START and FINISH locations allow us to read the data value using sub-string extraction.

      0
      jjjunkify
      jjjunkify

      Question 1 year ago

      Hi

      Awesome project, I have embarked on recreating your plotter and plan to scale it up. I don't have big easy drivers but I have two XC4492 by duinotech. I assume these will be fine except the wiring diagram doesn't suit. I'd appreciate any help thank you

      0
      lingib
      lingib

      Answer 1 year ago

      I have not tried an XC4492 so am unable to comment.

      Big Easy Drivers are specifically designed for the motor configuration in this project as they feature:
      - a single direction pin
      - a single step pin
      - adjustable current limit

      Unless the XC4492 has these features I suggest that you replicate my design as Big Easy Drivers are readily available and extremely cheap.

      Good luck with your project :)

      0
      jjjunkify
      jjjunkify

      Reply 1 year ago

      Thank you for taking the time to reply. I have decided to be patient and order the big easy drivers.
      I'll keep you posted with my progress, thank you again for sharing your project.

      0
      jjjunkify
      jjjunkify

      Reply 1 year ago

      Hey mate. I Recieved the big easy drivers and have wired everything together for a test. The neema 17 motors i have, draw a current of 1.7 A, so i have set the pots to suit. Its working when running the tests... very exciting.
      I will now start on the table

      0
      lingib
      lingib

      Reply 1 year ago

      Well done ... thanks for your update :)

      I am a little concerned at your NEMA motor currents of 1.7amps as Big Easy Drivers are only rated to about 1.4 amps per phase at room temperatures. Beyond that heatsinks (and/or cooling fans) are recommended.

      The reason for this is explained in the "heat Dissipation" paragraph in http://www.schmalzhaus.com/BigEasyDriver/BigEasyDr...

      The NEMA motors I specified for use in this instructable only draw 400mA which means that heatsinks are not required.

      0
      jjjunkify
      jjjunkify

      Reply 1 year ago

      Yes i too shared your concern.
      The research i did said they were rated to a maximum of 2A but will need heat sinking at 1.4 A and above.
      I have already purchased some nice little copper heatsinks.
      I will also look into running a cooloing fan if overheating becomes a problem.
      Thank you again for your reply and sharing your project, it has really reignited my enjoyment of electronics

      1
      jjjunkify
      jjjunkify

      Reply 1 year ago

      Hi Lingib
      I finally got a chance to finish the plotter off and it is looking good.
      As mentioned i scaled it up, which created some challenges. Its drawing area is 2.2m x 3.4m
      It draws the test patterns great
      It is calibrated and drawing accurately
      I am exporting 2Ddxf files from sketchup and importing them into inkscape successfully.
      I am however having 2 issues
      1. the path the plotter takes is no the most efficient. It will begin drawing and will move to another line, instead of continuing on the next closest.
      2. when I create the gcode for larger images, it sends the pen to a negative coordinate (the pen begins in the bottom left 0,0 coordinate, it then tries to drive off the table but of-course runs into the frame etc).
      I have tested this by creating a simple 100mmm square and a 500mm square.
      the gcode for both looks fine in the simulator. the plotter successfully draws the 100mm square but fails for the 500mm square.

      Thank you again and i look forward to your suggestions

      1
      lingib
      lingib

      Reply 1 year ago

      Thank you for your interest in my plotter ... and congratulations in scaling it up :)

      Another user has also scaled my design to upwards of 2m ... you may find his video of interest



      Regarding your issues:
      (1)
      The plotter does not think for itself which means the program that you are using to generate the g-code is the source of your problem.
      (2)
      The plotter is "Inkscape compatible" which means that the "home" (0,0) coordinate is in the lower-left corner. There should be no problem if you generate your drawings using Inkscape.

      Some drawing packages, however, expect the "home" (0,0) coordinate to be in the top-left corner in which case you will need to subtract each of your Y-axis coordinates from the Y-axis height of your plotter.

      Finally ... consider replacing my code with that in my instructable https://www.instructables.com/id/How-to-Control-a...

      GRBL is widely used and has the advantage of acceleration and deceleration control which means that your final plots will look much better.

      0
      jjjunkify
      jjjunkify

      Reply 1 year ago

      Hi Lingib

      Thanks once again for your reply.

      I have replaced your code with GRBL, it is much easier to use

      Im having a different issue now, when i send the gcode to the plotter it draws the image at a 45 degree angle and off scale. Im guessing this is due to either a setting with GRBL that needs to be changed or the wiring of the motors.

      I have tested the wiring and when reversed the drawing is reversed still at an angle and therefore assume its a setting

      i have spent a few hours looking through other peoples issues on github and also tested changing some of the settings but not had any luck so far

      any ideas?

      0
      fkzl
      fkzl

      Reply 1 year ago

      Hi, congrats on your finished plotter! Sadly I can't help but I have a question about your build. Did you reinforce the gantry in any way or is the original design good enough even at your size?

      0
      jjjunkify
      jjjunkify

      Reply 1 year ago

      Hi Fkzl

      I have increased the size of the aluminium T section to a 40mm T section as the 25mm T section was too flexible over the width of my plotter.
      I also increased the side rail T sections to 40mm.
      The biggest challenge with this is the V groove pulleys are best suited to the smaller T section, If i did it again I would also increase the size of the V pulleys to better suit.
      increasing the size of the T section has meant that all the dimensions of the bracket, hole spacings, belt lengths etc in this insructable need to be modified to suit

      0
      fkzl
      fkzl

      Reply 1 year ago

      What do you think is the maximum width of the t section the pulleys can handle?
      Do you think it will be ok if I'd go with 2mm width instead of 1.5mm as in the original? I guess the width of your 40x40 t section is 4mm in?

      0
      jjjunkify
      jjjunkify

      Reply 1 year ago

      The 40x40 is 3mm thick and the full length of their span is 2.4m ( the draw area of mine is 2.2m wide ) .
      I definitely could not go smaller on mine as they still flex a little.

      Id reccomend going to a hardware store and having a look at the different sizes. They will also need to support the weight of the pen carriage
      I also had to use steel for the end brackets of the gantry.

      Some of the nuts tend to work themselves loose, i used nylock nuts and thread locktight in some cases.

      I built a steel frame for mine to sit on with adjustable feet to counter any un-eveness in the floor. Un-eveness caused a slight twist in the side rails, which affected how smoothly the gantry moved.

      As Lingib mentioned it is a pretty forgiving design, i think making it larger amplified the potential issues