LinuxCNC distro is working correctly after installation however we will need to change some options like key configuration or how it operates. It is not a simple task because not every setting manager is graphical but also we need to change configuration in .ini files or axis file written in python. Also will use a few instructions in terminal. So below you can see more major changes and this less needed. Let's get to work.


1. First of all - install actualizations!!!

2. Changes in .ini file

   2.1. Maximum jog speed after program opening

   2.2. Incrementals

   2.3. Startup image

   2.4. NGCGUI – additional bookmarks for quick milling

3. Changes in axis file

   3.1. Keys

   3.2. Changing speed slower/faster using only two keys

   3.3. Additional slower/faster speed regulation LinuxCNC 2.7!!!!

   3.4. Fullscreen at startup

4. Autostart

5. Autologin

6. Important programs installation

7. Screen Saver Disabling

8. HeeksCAD installation!!!

1. First of all - install actualizations!!!

In the top right corner you can see an arrow icon inside orange star or something similar. Just after installing linuxCNC click it, type your password and install actualizations.{jcomments on}




Picture 1: Actualization pop-up in Debian


2. Changes in .ini file

If you do this, you should not change options by using stepconf!!!! Otherwise all settings you made will be set to default before .ini modification.


2.1. Maximum jog speed after program opening

It is annoying when we always have to change slider position after the program starts. Usually at start we need to set it to maximum for example to set zero position. Option to change it is hidden in our .ini file in home folder location linuxcnc/config in [DISPLAY] section. Change default value as below:

MAX_LINEAR_VELOCITY = 50.00 (mm/s)
DEFAULT_LINEAR_VELOCITY = 5.00 - change this to maximum value


2.2. Incremental

In home made machines people not always can reach as high accuracy as 0.005mm. So it is annoying when we are changing it using keyboard and there is so many options to choose (useless options in our case). We can change this also in .ini file in [DISPLAY] section. Just delete numbers, you do not need or add more.

INCREMENTS = 5mm 1mm .5mm .1mm .05mm .01mm .005mm


2.3. Startup image

If you want you can customize your loading screen. Settings are also in [DISPLAY] sections, only image name and time. Picture should be in .gif format located in config folder, otherwise it won't work.

INTRO_GRAPHIC = linuxcnc.gif


2.4. NGCGUI –  additional bookmarks for quick milling

If you are good at programming advanced g-code by hand you can use these options or just use the ones created by linuxCNC developers files (we not recommend to do it, there are many bugs). NGCGUI are like microprograms, you can fill some options like radius, number of holes etc. and create custom milling. A good solution for routine milling where there is need to change options like mentioned. For us it is useless, we are just using external programs. But if you want to add some code to your .ini file go to [DISPLAY] and [RS274NGC] sections as below. There is much better alternative - heexcad. You can easily draw object and create code then with one click send it directly to linuxcnc.

TKPKG = Ngcgui 1.0
TKPKG = Ngcguittt 1.0
# Ngcgui must be before Ngcguittt
NGCGUI_FONT = Helvetica -12 normal
NGCGUI_PREAMBLE = mm_std.ngc
# here type names of your programs
NGCGUI_SUBFILE = helix.ngc
NGCGUI_SUBFILE = helix_rtheta.ngc
NGCGUI_SUBFILE = iquad.ngc
NGCGUI_SUBFILE = hole_circle.ngc
NGCGUI_SUBFILE = qpocket.ngc
# symbol "" opens empty tab
#NGCGUI_OPTIONS = opt1 opt2 ...
# avalible options:
# nonew -- prevent from creating new tab
# noremove -- prevent from removing tabs
# noauto -- no autofilling
# noiframe -- images displaying in new window
GCMC_INCLUDE_PATH = /home/myname/gcmc_includes
# turning on engraving generator
TTT = truetype-tracer
TTT_PREAMBLE = mm_std.ngc
PROGRAM_PREFIX = ../../nc_files/examples/ngcgui_lib
PARAMETER_FILE = linuxcnc.var
# path to ngcgui files
SUBROUTINE_PATH = ../../nc_files/examples/ngcgui_lib:../../nc_files/examples/ngcgui_lib/utilitysubs
USER_M_PATH = ../../nc_files/ngcgui_lib/mfiles



Picture 2.4: NGCGUI overlaps in LinuxCNC


3. Changes in axis file

Axis file is written in python programming language. But it is not that simple to edit. We should open this file with root permission. So press alt + F2 and type gksu thunar (gksu nautilus in ubuntu) or sudo thunar (sudo nautilus) in terminal. Axis is located in usr/bin directory, open it by gedit or mousepad and you are ready for modifications. Before that do a backup!


3.1.  Keys

Sometimes we want to use external controller for our machine and there is a problem with the keys. Functions are not connected to the keys we want to use. Like in our example here we used PlayStation3 pad to control our machine. We have to change:

  • escape key to do nothing

  • keys to not use alt, shift or ctrl to work

So open axis as root and modify the options below:

root_window.bind("<Escape>", "#nothing")
root_window.bind("l", commands.toggle_override_limits)
root_window.bind("o", commands.open_file)
root_window.bind("s", commands.task_resume)
root_window.bind("t", commands.task_step)
root_window.bind("p", commands.task_pause)
root_window.bind("v", commands.cycle_view)
root_window.bind("<Alt-p>", "#nothing")
root_window.bind("r", commands.task_run)
root_window.bind("<Control-r>", commands.reload_file)
root_window.bind("<Control-s>", commands.save_gcode)
root_window.bind_class("all", "<Key-F1>", commands.estop_clicked)
root_window.bind("<Key-F2>", commands.onoff_clicked)
root_window.bind("<Key-F7>", commands.mist_toggle)
root_window.bind("<Key-F8>", commands.flood_toggle)
root_window.bind("<Key-F9>", commands.spindle_forward_toggle)
root_window.bind("<Key-F10>", commands.spindle_backward_toggle)
root_window.bind("<Key-F11>", commands.spindle_decrease)
root_window.bind("<Key-F12>", commands.spindle_increase)
root_window.bind("B", commands.brake_on)
root_window.bind("b", commands.brake_off)
root_window.bind("q", commands.clear_live_plot)
root_window.bind("x", lambda event: activate_axis(0))
root_window.bind("y", lambda event: activate_axis(1))
root_window.bind("z", lambda event: activate_axis(2))
root_window.bind("a", lambda event: activate_axis(3))
root_window.bind("`", lambda event: activate_axis_or_set_feedrate(0))
root_window.bind("1", lambda event: activate_axis_or_set_feedrate(1))
root_window.bind("2", lambda event: activate_axis_or_set_feedrate(2))
root_window.bind("3", lambda event: set_feedrate(5))
root_window.bind("4", lambda event: set_feedrate(20))
root_window.bind("5", lambda event: set_feedrate(35))
root_window.bind("6", lambda event: set_feedrate(50))
root_window.bind("7", lambda event: set_feedrate(65))
root_window.bind("8", lambda event: set_feedrate(80))
root_window.bind("9", lambda event: set_feedrate(90))
root_window.bind("0", lambda event: set_feedrate(100))
root_window.bind("c", lambda event: jogspeed_continuous())
root_window.bind("d", lambda event: widgets.rotate.invoke())
root_window.bind("i", lambda event: jogspeed_incremental())
root_window.bind("k", lambda event: jogspeed_incremental(-1))
root_window.bind("!", "set metric [expr {!$metric}]; redraw")
root_window.bind("@", commands.toggle_display_type)
root_window.bind("#", commands.toggle_coord_type)
root_window.bind("$", commands.toggle_teleop_mode)  #old version: commands.toggle_joint_mode
root_window.bind("<Control-Home>", commands.home_axis)
root_window.bind("<KP_Home>", kp_wrap(commands.home_axis, "KeyPress"))
root_window.bind("<Home>", commands.home_all_axes)
root_window.bind("<Shift-Home>", commands.set_axis_offset)
root_window.bind("<End>", commands.touch_off_system) #old version: commands.touch_off
root_window.bind("<Control-KP_Home>", kp_wrap(commands.home_all_axes, "KeyPress"))
root_window.bind("<Shift-KP_Home>", kp_wrap(commands.set_axis_offset, "KeyPress"))
root_window.bind("<KP_End>", kp_wrap(commands.touch_off_system, "KeyPress")) #old version: commands.touch_off
widgets.mdi_history.bind("<Configure>", "%W see end" )
widgets.mdi_history.bind("<ButtonRelease-1>", commands.mdi_history_butt_1)
widgets.mdi_history.bind("<Double-Button-1>", commands.mdi_history_double_butt_1)
widgets.mdi_command.bind("<Control-m>", commands.clear_mdi_history)
widgets.mdi_command.bind("<Control-h>", commands.mdi_history_hist2clip)
widgets.mdi_command.bind("<Control-Shift-H>", commands.mdi_history_clip2hist)
widgets.mdi_command.bind("<Key-Return>", commands.send_mdi)
widgets.mdi_command.bind("<Up>", commands.mdi_up_cmd)
widgets.mdi_command.bind("<Down>", commands.mdi_down_cmd)
widgets.mdi_command.bind("<Key-KP_Enter>", commands.send_mdi)
widgets.mdi_command.bind("<KP_Up>", commands.mdi_up_cmd)
widgets.mdi_command.bind("<KP_Down>", commands.mdi_down_cmd)
widgets.mdi_command.bind("<KeyRelease-minus>", "break")
widgets.mdi_command.bind("<KeyRelease-equal>", "break")

Example for LinuxCNC 2.7 version(in 2.6 is needed to replace commented #old version commands)


3.2. Changing speed slower/faster using only two keys

It is the most useful modification!!! In default there is an option to choose percentage speed by hitting keys from 1 to 0 on keyboard. 1 is 10%, 2 is 20% other keys at same scheme and 0 is 100%. We want to change the key before "1" to be 0%, key "1" to decrement speed for about 5% and key "2" to increment speed. It is also very useful for our PS3 pad as we described above. Modifications should be done as in 2.1 point to work correctly. We need to change function activate_axis_or_set_feedrate(n):

def set_feedrate(n):
def set_rapidrate(n):
def activate_axis_or_set_feedrate(n):
    speed_change = widgets.feedoverride.get()
    if n == 0:
    if n == 1:
        speed_change -= 5
        if speed_change < 0:
            speed_change = 0
    if n == 2:
        speed_change += 5
        if speed_change > 100:
            speed_change = 100



3.3. Additional slower/faster speed regulation LinuxCNC 2.7!!!!

In LinuxCNC version 2.7 feed override won't work correctly in hand mode. It is working only in automatic milling. But there is always a solution to the problem by using old 2.6 settings in axis or just changing jog speed slider but it is annoying( recommended only for noobs :P). The function we have to change is jog_on(a,b) like below:

def jog_on(a, b):
if not manual_ok(): return
if not manual_tab_visible(): return
if isinstance(a, (str, unicode)):
a = "xyzabcuvws".index(a)
if a < 3:
if vars.metric.get(): b = b / 25.4
b = from_internal_linear_unit(b)
if jog_after[a]:
jog_after[a] = None
b = b*vars.feedrate.get()/100.0
jogincr = widgets.jogincr.get()
if s.motion_mode == linuxcnc.TRAJ_MODE_TELEOP:
if jogincr != _("Continuous"):
jogging[a] = 0
print "WARNING: do not allow incremental jogging in TELEOP mode"
jogging[a] = b
jog_cont[a] = True
if jogincr != _("Continuous"):
if s.state != 1: return
distance = parse_increment(jogincr)
jog(linuxcnc.JOG_INCREMENT, a, b, distance)
jog_cont[a] = False
jog(linuxcnc.JOG_CONTINUOUS, a, b)
jog_cont[a] = True
jogging[a] = b


3.4. Start LinuxCNC Fullscreen

That is simple. We only need to add the command to our axis file and change resolution below:"wm","geometry",".","1920x1080")

in older ubuntu version:"wm","maxsize",".")
fullsize=maxgeo.split(' ')[0] + 'x' + maxgeo.split(' ')[1]"wm","geometry",".",fullsize)


4. Automatic start

In debian version go to the Applications menu/Settings/Session and startup and add a line and path to your configuration .ini file below. You can test how it works in terminal instead of constantly rebooting.

usr/bin/linuxcnc '/home/linuxcnc/linuxcnc/configs/Fox_conf/Fox_conf.ini'

or if it won't work (in linuxCNC 2.7)

/usr/bin/linuxcnc '/home/linuxcnc/linuxcnc/configs/Fox_conf/Fox_conf.ini'


Picture 4: Automatic start setting in LinuxCNC(Debian)


5. Autologin

In debian we do not have the option to change autologin. Nor during installation. It has to be done by hand in lightdm.conf as root of course. File is located in etc/lightdm/ and the options to change are in section [SeatDefaults]. It is needed to uncomment lines below and add your login name.



6. Important programs installation

In debian we need to install some missing programs like CALCULATOR (e.g. Qalculate!) or file editor (we recommend gedit).



Picture 6a: Qalculate! installed on debian


Go into Applications menu/Settings/Synaptic Packet Manager, click find button and type a known program name. Find it simply on the Internet. Then left click and select install. After that hit the yellow "Apply" button.


Picture 6b: Synaptic Package Manager


7. Screen Saver Disabling

If we want to work on lower jitters than possible and for other reasons we recommend to disable screen saver. Or just disable it for safety. In our case for long milling we have an issue (of course we lowered the jitter). Our program was suspended for a while but milling in one axis continued for a while. You know what happened next! And we have to start the operation from beginning. You can disable screen saver in Applications menu/Settings/Screen Saver


Picture 7: Disabling Screen Saver


8. HeeksCAD installation!!!

HeeksCAD is a very powerful and on this day the best free program for cnc milling. It is working on debian distro only after compilation. The best thing is that we can send our created code directly to linuxcnc with one click. All installing instruction is available here and described below.


Picture 8: Sending g-code to machine with HeeksCAD


Libraries update:

sudo apt-get update

Important library installation:

sudo apt-get install subversion build-essential debhelper cmake libboost-python-dev liboce-visualization-dev libwxgtk2.8-dev libgtkglext1-dev python-dev python-area bzr git libboost-dev liboce-ocaf2 liboce-ocaf-dev oce-draw

Make directory "heekscad" (default in /home directory):

mkdir heekscad

Open "heekscad" folder:

cd heekscad

Fetch sources:

svn checkout libarea

Open "trunk" directory:

cd libarea/trunk

Build packages:

dpkg-buildpackage -b -us -uc 

Move up:

cd .. 

Install .deb packages:

sudo dpkg -i libarea*.deb python-area*.deb
cd ..

Download HeeksCAD source:

svn checkout heekscad
cd heekscad
sudo apt-get install wx2.8-i18n
cd ..

HeeksCAD compilation:

sudo dpkg -i *heeks*.deb

Installation of HeeksCNC(require HeeksCAD installation):

svn checkout heekscnc
cd heekscnc
dpkg-buildpackage -b -us -uc
cd ..
git clone
cd opencamlib
bzr branch lp:~neomilium/opencamlib/packaging debian
dpkg-buildpackage -b -us -uc -d
cd ..
sudo dpkg -i python-ocl*.deb
sudo dpkg -i heekscnc*.deb


Done! Do you have more ideas on how to improve milling with LinuxCNC? Something is not working for you? Write it down in the comment section or contact us.