Controlling the spindle speed with

G96 and G97 G-Codes

G96 and G97 G-Codes

We have two different modes to choose from when controlling the rotational speed of our component, the G96 constant surface cutting speed and the G97 constant spindle speed.


G96 constant surface cutting speed

G96 constant surface cutting speed

The G96 command is used when we require a constant surface speed or cutting speed. This speed indicates the distance that the tool moves along the components surface per minute. When G96 is selected, the spindle speed is automatically changed by the machine controls so that the speed of the material's surface stays constant when as the diameter changes during the machining operation.



A typical G96 block may look like this :

G96 S150 M03 (or M04) ;

  • G96 calls the constant surface speed mode
  • S cutting speed m/min
  • M03 / M04 spindle rotation direction
  • The cutting speed is determined by the material, the cutting tool, the components shape and the chucking method.

    As the tool approaches the centerline of the part, the spindle speed will increase until it reaches the maximum spindle speed for the machine. This is generally a bad idea as at this speed the centrifugal force may course the chick to fail at securely holding the workpiece.

    To set a maximum speed that we wish the machine to reach as the diameter of the part decreases, we use a G50 command as described below.


    G50 speed clamp

    G50 speed clamp

    The machine will not exceed the RPM set by the G50 speed clamp command.

    When using G96 it is important to set the maximum speed of the spindle using G50.

    For operations such as facing or parting off, as the tool reaches the centreline the spindle will be rotating at its maximum speed. We can temporarily set this speed lower with G50.



    An example G50 block

    G50 S2000;

    Note, this speed can still be overridden by using the spindle speed override switch on the machine controls. Setting the spindle speed above the maximum recommended speed for your chuck may cause personal injury or damage to the machine.

    When using a G97 constant spindle speed command, the spindle speed set by the G50 will be ignored.

    G97 constant spindle speed

    G97 constant spindle speed

    To control the RPM of the spindle directly we use a G97 constant spindle speed command.

    This would be used for many reasons including centreline work such as drilling and tapping.

    An example:

    G97 S2000 M03;

  • G97 constant spindle speed command
  • S RPM of the spindle/workpiece
  • M03 spindle direction
  • When switching between G96 and G97 always define a spindle speed.

    Since G50 command does not work with G97, care must be taken to ensure that the lowest allowable speed of the chuck and fixture is not exceeded.

    Share this article

    For a complete tutorial on CNC Lathe Programming check out my course.

    The quickest way to learn CNC Programming