Cncterm is a curses-based interface to linuxcnc. It is designed to be the user interface for machines with less-capable processors or no direct video output, such as running on a BeagleBone Green which does not have an HDMI or VGA interface.
As a curses program, the interface can run happily over a serial line, which could also be useful for remote control of a machine tool.
Current testing shows that running g-code on a BeagleBone Green with cncterm takes less than 30% of the CPU for everything, including loading code off a networked server.
The code should work with up to 5 motion axes, spindle control, and flood and mist coolant options. The code has provision for a MPG wheel, and hardware cycle start and feed hold buttons. While not tested with a tool changer, the code should work with manual and automatic tool changers correctly configured in the HAL layer.
Cncterm has been developed on a machinekit installation on a BeagleBone Green, but should work on any linuxcnc installation.
Cncterm uses a standard alphanumeric keyboard for most interface tasks. In addition to the alphanumeric keys, the interface needs the escape, backspace, and F1 keys. This limited set of required keys allows the use of serial terminals, including such ancient options as a VT52, for the full interface. No mouse or touch screen is supported. The interface uses the Python curses libraries, so any terminal supported by curses should work without code change. Testing has been done with xterm and vt220 terminals.
Key | Function | Key | Function |
---|---|---|---|
ESC, Backspace | Abort; stop immediately like E-Stop | TAB | Next display tab to right; wraps at end |
CR or LF | Clear messages, redraw | Up Arrow | Jog Y+ |
Home | Home current axis | Down Arrow | Jog Y- |
End | Home all axes, in order from INI file | Left Arrow | Jog X- |
F1 | Override limit switches; toggle | Right Arrow | Jog X+ |
A | Select A (4th) axis | Pg Up | Jog Z+ or previous page |
B | Select B (5th) axis | Pg Dn | Jog Z- or next page |
C | Automatic mode | \ | Toggle Block Delete |
D | MDI mode | / or ? | Spindle stop |
E | Toggle E-Stop | , or < | Spindle reverse |
F | Toggle Flood Coolant | . or > | Spindle forward |
G | Redraw screen, without clearing messages | [ or { | Jog - |
H | Toggle Optional Stop | ] or } | Jog + |
I | Toggle Mist Coolant | = or + | Spindle rpm + |
J | Move 1 screen left, wraps at start | - | Spindle rpm - |
K | Move 1 screen right, wraps at end | $ | Toggle diameter, radius mode for lathe |
L | Reload tool table from disk | 1 | 10% feed |
M | Manual mode | 2 | 20% feed |
N | Set coordinate offset of current work system | 3 | 30% feed |
O | Open program file from disk | 4 | 40% feed |
P | Pause executing program | 5 | 50% feed |
Q | Quit - NO CONFIRMATION! | 6 | 60% feed |
R | Run currently loaded program if in Auto mode | 7 | 70% feed |
S | Reset interpreter | 8 | 80% feed |
T | Toggle machine ready state; E-Stop must be off! | 9 | 90% feed |
U | Cycle through jog step options, wraps at end | 0 | 100% feed |
V | Page down on tool ,program listings | | | Redraw screen, without clearing messages |
W | Page up on tool, program listings | ' or " | Enter MDI line, execute immediately |
X | Select X (1st) axis | ; | Home current axis |
Y | Select Y (2nd) axis | : | Home all axes, in order from INI file |
Z | Select Z (3rd) axis | CTRL-O | Override limit switches, toggle |
% | Spindle RPM 50% | ! | Spindle RPM 110% |
^ | Spindle RPM 60% | @ | Spindle RPM 120% |
& | Spindle RPM 70% | # | Spindle RPM 130% |
* | Spindle RPM 80% | ||
( | Spindle RPM 90% | ||
) | Spindle RPM 100% |
These pins setup after starting the cncterm interface:
#### Start of HAL file # connect various pins for cncterm interface net cncterm-wheel cncterm.jog.wheel.increment => joint.0.jog-scale joint.1.jog-scale joint.2.jog-scale joint.3.jog-scale net cncterm-wheel-x cncterm.jog.wheel.x joint.0.jog-enable net cncterm-wheel-y cncterm.jog.wheel.y joint.1.jog-enable net cncterm-wheel-z cncterm.jog.wheel.z joint.2.jog-enable net cncterm-wheel-a cncterm.jog.wheel.a joint.3.jog-enable net cncterm-wheel cncterm.jog.wheel.increment => axis.x.jog-scale axis.y.jog-scale axis.z.jog-scale axis.a.jog-scale net cncterm-wheel-x cncterm.jog.wheel.x axis.x.jog-enable net cncterm-wheel-y cncterm.jog.wheel.y axis.y.jog-enable net cncterm-wheel-z cncterm.jog.wheel.z axis.z.jog-enable net cncterm-wheel-a cncterm.jog.wheel.a axis.a.jog-enable net encoder-counts cncterm.wheel-counts # these pins inverted in kneemill.hal net abort-raw debounce.0.5.in <= bb_gpio.p8.in-28 net cncterm-abort cncterm.abort <= debounce.0.5.out net start-raw debounce.0.6.in <= bb_gpio.p8.in-30 net cncterm-start cncterm.cycle-start <= debounce.0.6.out net block-raw debounce.0.7.in <= bb_gpio.p8.in-31 net cncterm-block cncterm.single-block <= debounce.0.7.out net cncterm-active cncterm.jog.active => bb_gpio.p8.out-32 net cncterm-status cncterm.status-light => bb_gpio.p8.out-33 #### EOF
In lathe mode, the display of the X (1st) axis can be switched from "radius" to "diameter", where the x coordinate is doubled; this tells the operator the diameter being cut, rather than the radius. Lathe mode is noted on startup, and the "*" in the Enabled column for the X axis is replaced with "D" for diameter mode, or "r" for radius mode. Switch between the two modes with "$". The display starts in diameter mode.
The screen layout should be self-explanatory, but perhaps not. Feedback welcome.