August 23 2022

Ultimate CNC Configuration

Ultimate CNC provides you with some screens where you can conveniently configure your CNC machine with Grbl firmware. Also, for advanced users, you can configure Grbl directly using '$' commands if you feel more comfortable.

grbl console

Stepper motor tuning

In this screen, you will be able to configure all the parameters so that your stepper motors work without problems.

grbl stepper motor configuration

[X,Y,Z] Acceleration, mm/sec^2

This sets the axes acceleration parameters in mm/second/second. Simplistically, a lower value makes Grbl ease slower into motion, while a higher value yields tighter moves and reaches the desired feed rates much quicker. Much like the max rate setting, each axis has its own acceleration value and are independent of each other. This means that a multi-axis motion will only accelerate as quickly as the lowest contributing axis can.

Again, like the max rate setting, the simplest way to determine the values for this setting is to individually test each axis with slowly increasing values until the motor stalls. Then finalize your acceleration setting with a value 10-20% below this absolute max value. This should account for wear, friction, and mass inertia. We highly recommend that you dry test some G-code programs with your new settings before committing to them. Sometimes the loading on your machine is different when moving in all axes together.

[X,Y,Z] Max rate, mm/min

This sets the maximum rate each axis can move. Whenever Grbl plans a move, it checks whether or not the move causes any one of these individual axes to exceed their max rate. If so, it'll slow down the motion to ensure none of the axes exceed their max rate limits. This means that each axis has its own independent speed, which is extremely useful for limiting the typically slower Z-axis.

The simplest way to determine these values is to test each axis one at a time by slowly increasing max rate settings and moving it. For example, to test the X-axis, send Grbl something like G0 X50 with enough travel distance so that the axis accelerates to its max speed. You'll know you've hit the max rate threshold when your steppers stall. It'll make a bit of noise, but shouldn't hurt your motors. Enter a setting a 10-20% below this value, so you can account for wear, friction, and the mass of your workpiece/tool. Then, repeat for your other axes.

NOTE: This max rate setting also sets the G0 seek rates. 

[X,Y,Z] steps/mm

Grbl needs to know how far each step will take the tool in reality. To calculate steps/mm for an axis of your machine you need to know:

The mm traveled per revolution of your stepper motor. This is dependent on your belt drive gears or lead screw pitch. The full steps per revolution of your steppers (typically 200) The microsteps per step of your controller (typically 1, 2, 4, 8, or 16).

Tip: Using high microstep values (e.g., 16) can reduce your stepper motor torque, so use the lowest that gives you the desired axis resolution and comfortable running properties. 

The steps/mm can then be calculated like this:

steps_per_mm = (steps_per_revolution * microsteps) / mm_per_rev 

Compute this value for every axis and write these settings to Grbl.

Step pulse, microseconds

Stepper drivers are rated for a certain minimum step pulse length. Check the data sheet or just try some numbers. You want the shortest pulses the stepper drivers can reliably recognize. If the pulses are too long, you might run into trouble when running the system at very high feed and pulse rates, because the step pulses can begin to overlap each other. We recommend something around 10 microseconds, which is the default value.

Step idle delay, milliseconds

Every time your steppers complete a motion and come to a stop, Grbl will delay disabling the steppers by this value. OR, you can always keep your axes enabled (powered so as to hold position) by setting this value to the maximum 255 milliseconds. Again, just to repeat, you can keep all axes always enabled by setting $1=255.

The stepper idle lock time is the time length Grbl will keep the steppers locked before disabling. Depending on the system, you can set this to zero and disable it. On others, you may need 25-50 milliseconds to make sure your axes come to a complete stop before disabling. This is to help account for machine motors that do not like to be left on for long periods of time without doing something. Also, keep in mind that some stepper drivers don't remember which micro step they stopped on, so when you re-enable, you may witness some 'lost' steps due to this. In this case, just keep your steppers enabled via $1=255.

Step port invert

This setting inverts the step pulse signal. By default, a step signal starts at normal-low and goes high upon a step pulse event. After a step pulse time set by his value, the pin resets to low, until the next step pulse event. When inverted, the step pulse behavior switches from normal-high, to low during the pulse, and back to high. Most users will not need to use this setting, but this can be useful for certain CNC-stepper drivers that have peculiar requirements. For example, an artificial delay between the direction pin and step pulse can be created by inverting the step pin.

Direction port invert

This setting inverts the direction signal for each axis. By default, Grbl assumes that the axes move in a positive direction when the direction pin signal is low, and a negative direction when the pin is high. Often, axes don't move this way with some machines. This setting will invert the direction pin signal for those axes that move the opposite way.

This invert mask setting works exactly like the step port invert mask and stores which axes to invert as bit flags. To configure this setting, you simply need to send the value for the axes you want to invert.

Step enable invert

By default, the stepper enable pin is high to disable and low to enable. If your setup needs the opposite, just invert the stepper enable pin by select 'Invert' option. (May need a power cycle to load the change.)

Spindle

The spindle setup page contains settings for the main spindle in your machine. The spindle is a spindle with PWM control, also you can setup to switch the spindle on/off ( in this case, you can setup Min. Speed and Max. Speed with the same value )

grbl spindle

Max speed, RPM

This sets the spindle speed for the maximum 5V PWM pin output. For example, if you want to set 10000rpm at 5V, set 10000. For 255rpm at 5V, set 255. If a program tries to set a higher spindle RPM greater than the max value spindle speed, Grbl will just output the max 5V, since it can't go any faster. By default, Grbl linearly relates the max-min RPMs to 5V-0.02V PWM pin output in 255 equally spaced increments. When the PWM pin reads 0V, this indicates spindle disabled. Note that there are additional configuration options are available in config.h to tweak how this operates.

Min speed, RPM

This sets the spindle speed for the minimum 0.02V PWM pin output (0V is disabled). Lower RPM values are accepted by Grbl but the PWM output will not go below 0.02V, except when RPM is zero. If zero, the spindle is disabled and PWM output is 0V.

Laser mode

When enabled, Grbl will move continuously through consecutive G1, G2, or G3 motion commands when programmed with a S spindle speed (laser power). The spindle PWM pin will be updated instantaneously through each motion without stopping. Please read the Grbl laser documentation and your laser device documentation prior to using this mode. Lasers are very dangerous. They can instantly damage your vision permanently and cause fires. Grbl does not assume any responsibility for any issues the firmware may cause, as defined by its GPL license.

When disabled, Grbl will operate as it always has, stopping motion with every S spindle speed command. This is the default operation of a milling machine to allow a pause to let the spindle change speeds.

1% Speed, 10% Speed

This indicates the increment to use on the Run/Manual Control tab when you click on the overrides panel.

Commands

The commands setup page contains you will customize the G-code commands that will be executed when pressing the buttons in Ultimate CNC interface. Also, if you need, you can use a semicolon to execute multiple commands. Between your commands, Ultimate CNC will add G04 P0.

ultimate cnc commands buttons

Custom commands / macros

In the 'Custom Commands' tab you can customize some special functions for your cnc machine. Also, if you need, as standard commands, you can use semicolon to execute multiple commands. Between your commands, Ultimate CNC will add G04 P0.

There are 10 buttons that you can customize.

ultimate cnc commands custom buttons

  • Press on number => configure your command
  • Press on arrow to send the command.
  • In the input box field you can set your description.

Virtual Homing

This feature allows you to configure your home position in machine coordinates when your CNC machine hasn't switch limits installed. Ultimate CNC will read the current machine position and throw an alarm when detecting that your machine is out of limits. The position is always saved on your computer when the software is closed. Later, when starting the Ultimate CNC will put your CNC machine in 0 positions. If the software is closed incorrectly or forced to close, Ultimate CNC automatically will disable the Virtual Homing.

We recommend use this feature with caution. 

To enable this feature you need to follow these instructions:

  • Move axes X, Y to the coordinates that you want the position 0,0 (use "Manual Control tab")
  • Move axis Z to the max. top.
  • Press the SET ORIGIN button.
  • Configure the machine position: top right, topLeft, ...
  • Configure width (x) of the CNC machine
  • Configure height (y) of the CNC machine
  • Configure depth (z) of the CNC machine
  • Press ON, toggle button
  • Restart the Ultimate CNC

The width, height, and depth are configured in Grbl Settings. When you start the Ultimate CNC with Virtual Homing enabled it to show you a confirmation to start the Homing cycle:

ultimate cnc virtual homing

Virtual Homing is a great feature, but we recommend you install switch limits in your machine because it is the correct way to protect your CNC machine. If you have a bad configuration of stepper motors or Grbl lose steps, Virtual Homing will not be able to protect your machine. Virtual Homing is useful when you need to have your machine referenced to an origin point, but you shouldn't use it if you want to protect your CNC machine.