Quick Guide to Setting Up Your Machine for the First Time - fra589/grbl-Mega-5X GitHub Wiki
Grbl's default configuration is intentionally very generic to help ensure users can see successful motion without having to tweak settings.
Stepper Motor Basics
Generally, the (1) first thing you'll want to do is get your stepper motors running.
- If your steppers are powered and making a grinding noise when trying to move, try lowering the
$
acceleration and max rate settings. This sound is a sign that your steppers is losing steps and not able to keep up due too much torque load or going too fast. - Grbl's default step pulse settings cover the vast majority of stepper drivers on the market.
Stepper Motor Orientation
Direction
(2) Next, you will need to make sure your machine is moving in the correct directions according to a Cartesian(XYZ) coordinate frame and satisfies the right-hand rule, as shown:
Send Grbl some motion commands, such as G91 G0 X1
or G91 G0 X-1
, which will move the x-axis +1mm and -1mm, respectively. Check all axes. If an axis is not moving correctly, alter the $3
direction port mask setting to invert the direction.
If you are unfamiliar with how coordinate frames are setup on CNC machines, see the diagram as shown: Just keep in mind that motions are relative to the tool. So on a typical CNC gantry router, the tool will move rather than the fixed table. If the x-axis is aligned positive to the right, a positive motion command will move the tool to the right. Whereas, a moving table with a fixed tool will move the table to the left for the same command, because the tool is moving to the right relative to the table.
Cloning
If you have two motors controlling a single axis, such as two Y motors or two Z motors, you need to tell grbl-Mega-5X to clone two of the motor drivers.
fra589 commented on Jul 3, 2019 how to do this:
In config.h under "Axis definitions" (near line 53), define the number of axis you need (max 6 axis), then give the name of each axis you need. If you give the same name to more than one axis, this named axis will be cloned.
For example:
#define N_AXIS 5 // Number of axes
(...)
#define AXIS_1_NAME 'X'
(...)
#define AXIS_2_NAME 'Y'
(...)
#define AXIS_3_NAME 'Z'
(...)
#define AXIS_4_NAME 'Y'
(...)
#define AXIS_5_NAME 'A'
Then, you will have 5 reals axis with 4 logical : X, Y cloned on axis number 2(Y) and 4(E0), Z and the rotational A.
Also set the number of linear (real) axes:
#define N_AXIS_LINEAR 4 // Number of linears axis
Tuning
(3) Finally, tune your settings to get close to your desired or max performance. Start by ensuring your $10x
axes step/mm settings are correct for your setup. This is dependent on your stepper increments, micro steps on your driver, and mechanical parameters. Tweak your $12x
acceleration and $11x
max rate settings to improve performance. Set to no greater than 80% of absolute max to account for inertia, cutting forces, and motor torque reductions with speed. Set your $13x
max travel settings if you plan on using homing or soft limits.
At this point, you're pretty much ready to get going! Grbl can now move your CNC machine and run g-code jobs.