Arduino UNO CNC Shield not drawing properly

I have this Arduino UNO CNC Shield A4988x2 set up with old dvd drive frames & motors which seems to be quite popular.

Ive managed to make the cnc move using x & y buttons on universal g-code sender app, which is to say when I click on X+ one of the motors moves in one direction and X- moves in opposite direction. Likewise with Y, so I know that much works.

I downloaded a circle.nc program which has this code:

G17 G20 G90 G94 G54
G0 Z0.25
X-0.5 Y0.
Z0.1
G01 Z0. F5.
G02 X0. Y0.5 I0.5 J0. F2.5
X0.5 Y0. I0. J-0.5
X0. Y-0.5 I-0.5 J0.
X-0.5 Y0. I0. J0.5
G01 Z0.1 F5.
G00 X0. Y0. Z0.25

My config for the cnc & gcode sender is this. Originally it had 200 for x,y & z max travel at the bottom, and it did the same thing it does now, so I changed it to 10 each thinking that would make the motors not want to overshoot their max, but that didnt work:

$0 = 10    (step pulse, usec)
$1 = 25    (step idle delay, msec)
$2 = 0    (step port invert mask:00000000)
$3 = 0    (dir port invert mask:00000000)
$4 = 0    (step enable invert, bool)
$5 = 0    (limit pins invert, bool)
$6 = 0    (probe pin invert, bool)
$10 = 3    (status report mask:00000011)
$11 = 0.010    (junction deviation, mm)
$12 = 0.002    (arc tolerance, mm)
$13 = 0    (report inches, bool)
$20 = 0    (soft limits, bool)
$21 = 0    (hard limits, bool)
$22 = 0    (homing cycle, bool)
$23 = 0    (homing dir invert mask:00000000)
$24 = 25.000    (homing feed, mm/min)
$25 = 500.000    (homing seek, mm/min)
$26 = 250    (homing debounce, msec)
$27 = 1.000    (homing pull-off, mm)
$100 = 250.000    (x, step/mm)
$101 = 250.000    (y, step/mm)
$102 = 250.000    (z, step/mm)
$110 = 500.000    (x max rate, mm/min)
$111 = 500.000    (y max rate, mm/min)
$112 = 500.000    (z max rate, mm/min)
$120 = 10.000    (x accel, mm/sec^2)
$121 = 10.000    (y accel, mm/sec^2)
$122 = 10.000    (z accel, mm/sec^2)
$130 = 20.000    (x max travel, mm)
$131 = 20.000    (y max travel, mm)
$132 = 20.000    (z max travel, mm)

Here is a video of what it does. The issue is that it seems to want to overshoot its max and mins as evidenced by the clicking once it cant go any further in a particular direction:

Write a few lines of GCode by hand to make it slowly draw a square of specific size and measure what it does.

If that works properly then the fault is probably in your circle GCode.

...R

.. or in your accleration values. Or in your drive assembly (soft belts? even acme screws are more precise) ...

I just zeroed the machine and ran

G00 X00 Y00
G00 X10 Y00
G00 X10 Y10
G00 X00 Y10

but I get the X longer than the Y. For X it moves 2.5cm whereas for Y only 2.0cm.

well then adjust your settings. You have:

$100 = 250.000    (x, step/mm)

change that to:

$100 = 200.000    (x, step/mm)

Marciokoko:
I just zeroed the machine and ran

G00 X00 Y00
G00 X10 Y00
G00 X10 Y10
G00 X00 Y10

but I get the X longer than the Y. For X it moves 2.5cm whereas for Y only 2.0cm.

And why is it not moving 10mm since that is what you instructed it to do?

...R

LOL .. that point I missed completly ... :

$100 = 125
$101 = 100

What do you mean? I don't understand.

Well, use your gcode sender and set the 2 variable to the given values.

OK I set those values. Now the long axis travels 1cm and the short axis travels 0.6 cms.

And the zero position has changed.

Which is which?

Marciokoko:
OK I set those values. Now the long axis travels 1cm and the short axis travels 0.6 cms.

RTFM

The variables $100, $101 and $102 set the steps/mm for the X, Y and Z axes.

You need to enter a value in each variable and then do a test to see what happens.

If your device has been told to move 10mm and it only moves 1mm then the value is 1/10th of what it should be.

...R

Here is a picture of my canvas.

The complete thing measures:

The blue rectangle (with a green #2 inside is the one with original settings and measures 2.5 x 2.0 cm.

The smaller pencil one with a red #1 is the one drawn after making the setting changes you suggested. The zero point changed as did the dimensions which are now 1 x 0.6 cm.

gcode is the same?

oops ... IMO it should be:
$101 = 125

so in my case I told it to live 10 and it moved 2.5, so it's 1/4th.

But the other axis I told it to move 10 and it moved 2.0 so it's 1/5th.

I need to make the 1/4th one smaller, is that it?

In your first posting you said:
$100 = 250.000 (x, step/mm) --> 25 mm
$101 = 250.000 (y, step/mm) --> 20 mm
and "g1 x10 y10" moved 25mm / 20mm
So
X: 25010 --> 2500 step == 25mm --> 100 steps == 1mm --> $100 = 100
Y: 250
10 --> 2500 steps == 20mm --> 125 steps == 1mm --> $101 = 125

zwieblum:
In your first posting you said:

I think it will be more straightforward to work from the data in Reply #3.

...R

Marciokoko:
so in my case I told it to live 10 and it moved 2.5, so it's 1/4th.

But the other axis I told it to move 10 and it moved 2.0 so it's 1/5th.

I need to make the 1/4th one smaller, is that it?

If it only moved 2.5 when it should have moved 10 then the value needs to be 4 times bigger. How could you imagine it should be smaller?

...R

Please don't mix units :slight_smile: