• Adding Homing

    agp.cooper03/01/2019 at 11:55 0 comments

    Adding Homing to the SCARA

    After much thought I just super-glued the micro switches onto the SCARA arms:

    I have had big problems in the past with interference from stepper motor phase cables. So it was a relief that the RC filters worked (like magic). But I also twisted cables as that also helps.

    • I have been thinking about this problem and I think the answer is the "old" RS-232 current loop concept. Not the actual RS-232 current loop, but a pull-up resistor (between 1k and 10k) and a dedicated twisted pair signal and ground connection.

    The standard GRBL build assumes you have a Z axis for the Homing procedure. I do not so I downloaded GRBL V1.1 and recompiled it for X and Y axis only.

    After carefully aligning the arms with "jog", I ran the homing routine and recorded the stopped position (X=214.75 and Y=-124.25 degrees). With the stop position I can go to zero home after a Homing procedure.

    After increasing the step size from 1/16 to 1/4 the "SCARA" steps are obvious (note the image is about 50mm across and 1/4 step is less than 0.4 mm so big steps are oscillations from overshoot):

    Somewhat annoyed that after Homing the machine position (not the work position) is not zero. This could be a problem for some G code commands (G28/30 for example). After some research I found that I need to enable:


    in "config.h".

    Setting the machine position to zero is acceptable. I can then set G28/G30 to the work home position.

    A minor point is the the nuts and bolts come loose pretty easily. I don't want to over torque them. When I am finished playing with the setup I may glue the nuts and bolts.

    Well this project is pretty complete now. Many things learned for the next version.

    I made up a quick webpage to present a video of the SCARA: http://amaze.surge.sh/


  • Success

    agp.cooper02/26/2019 at 08:05 0 comments


    I wanted to get it working today. So instead of debugging my version of gCodeSender, I just hacked a copy of my gCodeFilter and used Rabbit gCodeSender.

    Rabbit gCodeSender has some faults but it worked:

    The Sticky Note is not very flat thus some variance in the burn. Here is a close up:

    The design is about 45mm x 45mm.

    Note how the lines are wavy, that is the oscillation of the SCARA arm. You can see it dies down after a few millimetres. Basically I need to add a light brake to the arm to dampen the oscillation (if I was to persist with this design).

    Now the truncation of the right is by design:

    To Home the SCARA I set zero for a fully outstretched or straighten arms. Pretty easy.


    I did spend a few hours looking a PID to control the overshoot/undershoot.

    Its feasible but you need to add optical encoders for the positional feedback, and a processor between GRBL and the A4988s.

    But the purpose of this project was to prove the gCode filter works rather than the basis for a proper SCARA.

    The easiest way to fix the overshoot/undershoot is to let "gear friction" dampen it.

    Limit Switches and Drawing Envelope

    I draw up a design for limit switches and the drawing envelop. Not much envelope:

    Should have used 60mm for Arm 2 rather than 50mm.


    Set the controller 1/4 stepping. 1/16 is over kill for this project. 1/4 stepping will increase torque.

    Cut the tracks to the reverse Y motor phases and jumped the limit switch sensors. I hope there is no interference from the stepper motor drive cables.

    I bought some micro-switches but I have not worked out how to install them. I don't have a M2 screw/bolt that is long enough. Perhaps epoxy is the way to go. Even then the "knock" bolts are not long enough. Needs more though.

    I need to turn the Laser off in the initialisation string for GRBL.

    Once I have tested the Homing sequence this project is done.

    Interference Prevention

    I had a project killed (could not get it to work) because of common power supply and electrical interference from the stepper motors. I did have some success by twisting the stepper motor cables and moving them away from the electronics. But I am still worried about the limit switches and the cables running near the stepper motor cables.

    Well I found a really good discussion (by chance) on the GRBL WIKI (https://github.com/gnea/grbl/wiki/Wiring-Limit-Switches). I will definitely try the RC filter option.


  • Grbl Controller Set Up

    agp.cooper02/23/2019 at 14:04 1 comment

    Grbl Controller

    Grbl does not have native support for SCARA. But I intend to convert a cartesian gCode file into a format that will fool grbl.

    I have an old Laser controller but it only supports grbl up to v0.9. The latest is v1.1, in this version the spindle on/off and spindle speed (PWM) pins have been swapped.

    I thought I would buy the latest Laser CNC controller as I would like to use grbl v1.1 (my old Laser uses grbl v0.7 and is not compatible with later grbl versions).

    Here is the controller I am using (except my is covered with labels):

    It has a built in power on/off buttons which are quite handy:

    As my laser module has a built in power supply and only needs PWM, but this gives you the idea:

    I am currently using a 12v 2.5A plug pack but I suspect this will be inadequate for both the motors (0.64A per phase, there are 4 phases) and the Laser (1A).

    GRBL Set Up

    Surprisingly GRBL did not work "out of the box", Basically, "$1=25" shut down the motors after doing a move. It confused me as I am used to the motors staying on.

    Other than that, I set the steps/mm ($100 ans $101) to steps/degree ($100=17.778 and $101=17.778). The stepper motors are 0.9 degrees per full step.

    The stepper drivers where set (hard-wired) to 1/16 micro-stepping.

    Next is to step up the laser model. Nothing to do here (I think), the spindle speed range is 0 to 1000 (i.e. 0% PWM to 100% PWM).

    Power Supply Upgrade

    Bought a 12v 9A power supply.

    The controller seem more quiet but hard to tell.

    The laser works.

    Under-Damped (i.e. over shoot) Motion

    The arms suffer badly from under-damped motion.

    This is seems to be a common theme!, and micro-stepping does not help (makes it worse).

    How to solve? Gearing and half stepping, PID, or physical damping?

    • Gearing and half-stepping is for the next planned generation of SCARA.
    • PID is not really practical via Grbl.
    • So perhaps a felt washer between the arms?


  • Prototype Assembled

    agp.cooper02/23/2019 at 07:05 0 comments


    The Laser Cut MDF arrived a few days ago.

    Here are the pieces after a wipe down to remove loose soot:

    And here it is assembled:

    Over all I am happy with the machine rigidity (good enough), but the wiring need more thought. I added extra holes to the arms for routing wires or adding wiring posts (refer to the white tape). Really the laser cable is too heavy for this machine.

    Tidy Up

    Tidy upped the stepper cables and added hard stops (i.e. brass standoffs):

    The homing procedure would be Arm 2 then straighten up, then Arm 1:

    Need of order some longer M3 bolts for the base, and make up a cable for the laser.

    After that I need to look at the controller hardware.

    Okay Hardware Done

    Here is the wired up machine:


  • Why Laser Cut MDF?

    agp.cooper02/23/2019 at 06:58 0 comments

    Material Mechanical Properties


    I often start a mechanical design with Aluminum (steel is too hard for my China CNC machine to cut (unless I am desperate). Aluminium is easy to cut if you use the right cutter (i.e. single flute). Aluminium angle is light and stiff, but cutting both sides of the angle accurately is an unresolved problem. Aluminium flat bar is a good compromise. It just becomes a design issue.

    Aluminium Mechanical Properties

    Alloy                          6061-T1

    Thickness                    3 mm

    Young's Modulus     69 GPa

    Ultimate Strength    210 MPa

    Yield Strength          110 MPa

    Working Stress         80 MPa

    Perspex (Acrylic)

    The stuff looks good and the "good" stuff lasts. I find most of the stuff I get stress cracks after a few months. So although I am keen to use it, I dare not as I don't know if I have the "good" stuff.

    Acrylic Mechanical Properties

    Thickness                    3 mm

    Young's Modulus     3.2 GPa

    Yield Strength          70 MPa

    Working Stress         45 MPa

    MDF (that cheap fibrewood board!)

    I use an online laser cutting service and the thickest they offer is 6mm.

    MDF Mechanical Properties

    Thickness                    6 mm

    Young's Modulus     4.0 GPa

    Bending Strength      18 MPa

    Working Stress          12 MPa

    So MDF is pretty weak but it is thicker. So why use it?

    Stress and Deflection

    There are lots of failure modes and serviceability requiements that real mechanical design needs to consider, but for toys only "stress" and "deflection" are important.

    For a canterlever flat bar (beam) of length (L), width (b), thickness (h) and a point load of (F):

    Young's Modulus     E

    Moment of Inertia    I=b*h^3/12   (m^4) 

    Section Modulus     Z=b*h^2/6   (m^3)

    Moment                   M=L*F           (Nm)

    Stress                       S=M/Z          (Pa)

    Deflection                d=F*L^3/I/E/3

    So what does all this mean?

    From a serviceability point of view, deflection is important.

    A "floppy" CNC machine is not much use.

    We can either use very stiff (high Young's Modulus (E)) materials or use thicker materials.

    The deflection equation tells us that if the material is twice as thick (6 mm versus 3 mm) then the deflection will be 1/8. So although Aluminium is 17 times stiffer than MDF,  as the MDF is twice as thick the deflection will only be twice that of Aluminium!

    One of the advantages of MDF is that you only need to glue two pieces together (for 12 mm thickness) and it will be much stiffer than Aluminium and just stiffer than 3 mm steel (E=210 GPa).

    The other reason to use MDF is that so long as it does not get wet it is dimensionally stable.


    Although I considered doubling up the thickness of the first arm of the SCARA, I have "another trick up my sleeve", I can epoxy fibreglass on both sides...

    Read more »

  • Very Simple Hardware

    agp.cooper02/23/2019 at 06:57 0 comments

    Very Simple Hardware

    A simple laser SCARA:

    It uses 50mmx25mmx3mm aluminum bracket.

    The main downsides are:

    • direct drive (with micro-stepping)
    • single motor axles
    • canter-lever design.

    Still it should be useful for testing.

    Reworked the design

    Reworked the design away from 50mm x 25mm 3mm aluminum angle.

    Here is a 6mm MDF design:

    And the laser cutout (300mmx300mmx6mm MDF sheet):

    The bending moment calculations suggest less than 0.5mm deflection (assumes 2.5N end load). Maximum end load is 30N (~5mm deflection).

    I sent the design away to be cut by a professional laser cutting company.