background image background image background image
to DeskProto home page
Contact  
looking glass icon
to DeskProto Facebook page
to DeskProto Youtube page
to DeskProto Instagram page

CAM software for SainSmart Genmitsu machines (GRBL)

How to use DeskProto with SainSmart CNC machines


Tips & Tricks for users of a SainSmart Genmitsu milling machine. These are meant as help for correctly installing a few optional add-ons and using these with the DeskProto software. As SainSmart machines are based on GRBL, these tips may also prove to be useful for users of other GRBL-based machines.
We found that both rotary modules that SainSmart offers support Inverse Time feedrate for rotary movements. So we have enabled that advanced option in both SainSmart postprocessors (mm and inch). These updated postprocessors are present in DeskProto V8 Rev 12446 and newer. The result is that rotary movements indeed are performed at the feedrate that you entered.

1. How to use the SainSmart 4th axis on a Genmitsu 4040-PRO

In 2023 SainSmart released a rotation axis option for their Genmitsu 4040-PRO CNC milling machine: the "4th Axis CNC Rotary Module Kit".

1.1 Take care when using the homing cycle

We have found that with the Z-axis in it's lowest position the Z-axis part of the 4040-PRO machine will hit the rotation axis unit when the bridge travels over the rotation axis. So when you mount the rotation axis using you need to mount the Z-axis unit on its highest position. Even then a collision may happen: then the cutter may hit the rotation axis. So you need to take care with calling the homing cycle: when a cutter is inserted this is not a safe operation!

When on your machine the homing cycle is automatically performed on startup you can disable that by entering '$22=0'. If needed you can add '$X' to reset the alarm state.

1.2 Tutorial book by Graham Bland

We have been approached by SainSmart 'guru' Graham Bland, who writes independent reviews and tutorials about SainSmart machines. He was working on a tutorial about using the SainSmart Rotary axis, and asked for our support in calculating toolpaths with DeskProto. It has been our pleasure to cooperate with Graham on this issue !.

Title page of this tutorial PDF file
The title page of Graham's tutorial.

The tutorial that Graham wrote is called Intro to CNC - Using the SainSmart 4040-PRO Rotary axis.
It shows you how to install, setup and test this device, why he choose DeskProto as CAM software, how to create a project and toolpaths in DeskProto (both continuous rotation and indexed machining), and finally two sample projects. The following paragraphs are present:
  • What is a 4th rotary axis?
  • Limitations of a 4th Axis
  • Mounting and Alignment of the Rotary axis
  • Setup and Testing
  • Initial setup, Making things easier!
  • Setting up a job
  • Software
  • Setting up DeskProto
  • Sample Projects
  • TROUBLESHOOTING
Graham published the tutorial on the SainSmart Genmitsu CNC Users Group on Facebook, and he kindly permitted us to also share it here:
Intro to CNC - Using the SainSmart 4040-PRO Rotary Axis V1.0.zip (4.5 MB)
This ZIP file contains the tutorial, sample files and projects, macros, cutter definitions and some photos. Thanks for sharing !

1.3 Tutorial video

How to configure the SainSmart Genmitsu Rotary Module on a 4040-PRO machine   (15:14 min)

As we have a 4040-PRO machine in our small workshop we have also used the rotation axis module for a DeskProto project. That allowed us to create this tutorial video on how to install and configure this unit. Subtitles are available, both in English and in Dutch.
The video about the actual project will follow soon.

2. How to use the SainSmart 4th axis on a PROVerXL 4030

For a Genmitsu PROVerXL 4030 some extra instructions are needed, as the controller of this machine does not have an output for the A-axis: only for X, Y and Z. Nevertheless it still is possible to use a rotation axis: by unplugging the wiring between the Y-axis motors and the controller, and instead connecting the rotation axis cable to the Y-axis output of the controller box (this is assuming that the rotation axis unit has been mounted parallel to the X-axis). The Y-axis no longer can be used, so make sure that the Y-position is correct (cutter exactly above the rotation axis) before you start machining. The DeskProto rotary toolpaths that DeskProto generates do not contain Y-coordinates.

Now you have to make sure that DeskProto writes G-code with a "Y" for all A-axis angle values. You can achieve this by editing the postprocessor:
  • Options > Library of postprocessors > OK on warning
  • Select your postprocessor [SainSmart (GRBL) - mm or inch] and press Copy
  • Give the new postprocessor a different name, for instance [SainSmart Rotary (GRBL) - mm or inch]
  • Open page Movement.
  • Now in column (A) replace " A" by " Y" ("space Y" resp "space A").
  • Press OK and close all dialogs.
Now open the library of machines, select your machine and again press Copy.
Again give this new machine a proper name
As postprocessor select the one that you just created
Press OK and close all dialogs.
Now select this new machine (in the project settings) for a rotary project.
Be careful to use this machine definition only for rotary toolpaths !

More information about editing the postprocessor in Videos-configure-a-postprocessor-in-DeskProto.

Finally you need to enter different values for two GRBL settings:
$101 sets the number if steps to move the Y-axis 1 mm
$131 sets the maximum travel distance for the Y-axis
It is clear that in order to control a rotation axis different values are needed. Do not forgot to write down the original values, as later you will need to restore these for XYZ machining, after dismounting the rotation axis. Here is what we found:
$101=44.444
$131=9999
The value for $101 is different from the SainSmart instructions as given in the Genmitsu PROVerXL 4030 Rotary Module Kit User Manual. The manual assumes that you want to wrap a flat XYZ relief around a cylinder. DeskProto instead outputs angle coordinates in degrees, so we used formula $101= Steps per revolution x Microsteps x Gear ratio /360°. For this machine $101= 200 x 8 x 10 / 360° = 44.444

Note that on this machine it is not possible to use the homing cycle when the rotary axis has been mounted: when homing the Y-axis now the rotary axis will start to rotate, in search of a limit switch. As no such switch is present on the rotary axis it will keep rotating, and the homing cycle cannot be completed.

3. The SainSmart laser engraving option

This paragraph applies only to DeskProto Version 8, as the previous DeskProto versions do not support laser engraving.

Most SainSmart machines can be equipped with an optional laser extension, offering laser engraving. The laser module replaces the spindle unit, so milling and laser engraving cannot be combined in the same NC file. In addition to changing the hardware you also need to set the control software to use laser mode, which can be done with command $32. Entering $32=1 sets the machine to laser mode, $32=0 sets it to milling mode. We do not recommend to include these commands in the G-code, just enter them as manual commands (you will need to change the hardware anyway).

Screenshot of the DeskProto machine settings dialog
Screenshot of the DeskProto postprocessor dialog
Laser settings in one of the SainSmart machines and the SainSmart GRBL postprocessor.
Click on an image for a larger version.

For the machine:
The laser unit and the spindle motor have the same position as the two units are exchanged.
The laser power has been set in a range from 0 to 1000, which is in fact an arbitrary range (independent of the actual power). You can for instance also use 0 and 100, so you can set the S-value as a percentage. The min and max value simply must match the GRBL Spindle Speed Minimum ($31) and Maximum ($30) that you have set for your machine. When you change these to 0 and 1000 for the laser: do not forget to restore the correct settings for your spindle motor when switching the machine back to spindle mode.

For the postprocessor:
We have changed both the NC output code and this postprocessor: this information is valid for DeskProto Version 8, Revision 12277 (July 2025) and newer, see the DeskProto Service Releases.
The Laser mode command is left empty. It is possible to insert the commands $32=1 and $32=0 here, however as explained above we prefer to enter these manually. Feel free to change that if you like.
As Laser on/off switch we use M4 S{S}. The M4 mode will automatically reduce the laser power when the feedrate is reduced (M3 will result in a constant laser power). The S value in this command sets the laser power. In this command "{S}" is a placeholder, which will be replaced by the actual S-value when DeskProto writes the NC file. M4 S0 will again switch off the laser.
Note that GRBL automatically switches off the laser for G0 positioning movements. That feature cannot be used though, as after a G0 positioning movement a downward G1 movement follows, and some positioning movements are done with a G1 movement, so with the laser switched on.

The definition of a laser cutter contains in fact only one parameter: the beam width (Kerf). Graham Bland has tested a number of SainSmart laser modules, and found these Beam width values: Adjust the Maximum S-Value in each cutter definition to match your router's $30 setting (for Maximum Spindle Speed). And when you check the option to automatically set the speeds you can adjust the Feedrate and the S-Value according to your needs. Graham: thanks for sharing these results !

You can find more information in the SainSmart laser instructions