GRBL - How are steps per mm set?

HI,

My home-brew XY-plotter finally works, but scaling is a problem. The plot is 3 times too big.

I am using LibreCAD for the drawing, dxf2grbl to convert to g-codes, and UniversalGcodeSender to send the codes to an Arduino UNO based controller.

I use the Arduino IDE to build GRBL.

When I start UGS and connect to the UNO I see the configuration from defaults.h displayed. The values in DEFAULTS_GENERIC I'm interested in are STEPS_PER_MM and MAX_TRAVEL.

$100 = 250.000    (X-axis travel resolution, step/mm)
$101 = 250.000    (Y-axis travel resolution, step/mm)
$102 = 250.000    (Z-axis travel resolution, step/mm)
$130 = 200.000    (X-axis maximum travel, millimeters)
$131 = 200.000    (Y-axis maximum travel, millimeters)
$132 = 200.000    (Z-axis maximum travel, millimeters)

At least I think defaults.h is the source of the values.

  #define DEFAULT_X_STEPS_PER_MM 250.0
  #define DEFAULT_Y_STEPS_PER_MM 250.0
  #define DEFAULT_Z_STEPS_PER_MM 250.0
  #define DEFAULT_X_MAX_TRAVEL 200.0 // mm NOTE: Must be a positive value.
  #define DEFAULT_Y_MAX_TRAVEL 200.0 // mm NOTE: Must be a positive value.
  #define DEFAULT_Z_MAX_TRAVEL 200.0 // mm NOTE: Must be a positive value.

I need STEPS_PER_MM to be 40.0 and TRAVEL to be 350.0
I have made the changes:

  #define DEFAULT_X_STEPS_PER_MM 40.0
  #define DEFAULT_Y_STEPS_PER_MM 40.0
  #define DEFAULT_Z_STEPS_PER_MM 40.0
  #define DEFAULT_X_MAX_TRAVEL 350.0 // mm NOTE: Must be a positive value.
  #define DEFAULT_Y_MAX_TRAVEL 350.0 // mm NOTE: Must be a positive value.
  #define DEFAULT_Z_MAX_TRAVEL 350.0 // mm NOTE: Must be a positive value.

but the changes are not seen:

$100 = 250.000    (X-axis travel resolution, step/mm)
$101 = 250.000    (Y-axis travel resolution, step/mm)
$102 = 250.000    (Z-axis travel resolution, step/mm)
$130 = 200.000    (X-axis maximum travel, millimeters)
$131 = 200.000    (Y-axis maximum travel, millimeters)
$132 = 200.000    (Z-axis maximum travel, millimeters)

Where are these values coming from?
I disabled DEFAULTS_GENERIC in defaults.h and got a lot of errors, so the compiler needs it.

How do I set STEPS_PER_MM and MAX_TRAVEL?

You might be more likely to get the attention of someone who knows the answer on a CNC forum or on the RepRap forum

...R

It has been a while, but I believe the answer is simple. You do not need to change it in code.

From the terminal window just issue a command:

$100=40

and so on. It will be saved in permeant memory, so you only have to do it once.

This link shows how to set the configuration parameters.

Nathan

Thanks for the link, and I will check out the reprap forum.