Skip to content

User Guide

Cheton Wu edited this page Mar 20, 2019 · 56 revisions

index


Workspace

Visualizer Widget

This widget visualizes a G-code file and simulates the tool path.

Connection Widget

This widget lets you establish a connection to a serial port.

Axes Widget

This widget shows the XYZ position. It includes jog controls, homing, and axis zeroing.

Console Widget

This widget lets you read and write data to the CNC controller connected to a serial port.

G-code Widget

This widgets shows the current status of G-code commands.

Grbl Widget

This widet shows the Grbl state and provides Grbl specific features.

Set $10=2 for Grbl v1.1d (or $10=15 for Grbl v0.9) to see planner buffer and receive buffer in queue reports.

Smoothie Widget

This widget shows the Smoothie state and provides Smoothie specific features.

TinyG widget

This widget shows the TinyG state and provides TinyG specific features.

Laser Widget

This widget allows you control laser intensity and turn the laser on/off.

Macro Widget

This widget can use macros to automate routine tasks.

Statements

Each line prefixed with % is a JavaScript statement. You can set a variable to the value of a mathematical expression.

%p1x = posx
%p1y = posy
%p2x = posx
%p2y = posy
%p3x = posx
%p3y = posy
%ma = (p2y - p1y) / (p2x - p1x)
%mb = (p3y - p2y) / (p3x - p2x)
%cx = (ma * mb * (p1y - p3y) + mb * (p1x + p2x) - ma * (p2x + p3x)) / (2 * (mb - ma))
%cy = (-1 / ma) * (cx - (p1x + p2x) * 0.5) + (p1y + p2y) * 0.5

%wait is a reserved word that was used in CNCjs to wait until the planner queue is empty.

Variables

To use variables in a G-code program, you need to surround each variable with a pair of square brackets:

%cx = 10
%cy = 10
G0 X[cx] Y[cy]

System Variables

Bounding Box

xmin, xmax, ymin, ymax, zmin, zmax

Machine Position

mposx, mposy, mposz, mposa, mposb, mposc

Work Position

posx, posy, posz, posa, posb, posc

Modal Group

modal.motion, modal.wcs, modal.plane, modal.units, modal.distance, modal.feedrate, modal.program, modal.spindle, modal.coolant

Examples

  • Wait until the planner queue is empty

    %wait
    
  • Print the value of a variable in the console

    %X0=posx
    (X0=[X0]) ; Print the value in the inline comment
    G4 P0 (X0=[X0]) ; Print the value in the inline comment right after a G4 dwell command
    
  • Keep a backup of current work position

    %X0=posx, Y0=posy, Z0=posz, A0=posa, B0=posb, C0=posc
    
  • Go to previous work position

    G0 X[X0] Y[Y0]
    G0 Z[Z0]
    
  • Save modal state

    %WCS=modal.wcs
    %PLANE=modal.plane
    %UNITS=modal.units
    %DISTANCE=modal.distance
    %FEEDRATE=modal.feedrate
    %SPINDLE=modal.spindle
    %COOLANT=modal.coolant
    
  • Restore previously saved modal state

    [WCS] [PLANE] [UNITS] [DISTANCE] [FEEDRATE] [SPINDLE] [COOLANT]
    
  • Set bounding box

    %xmin=0,xmax=100,ymin=0,ymax=100,zmin=0,zmax=50
    
  • Traverse around the boundary

    G90
    G0 Z10 ; go to z-safe
    G0 X[xmin] Y[ymin]
    G0 X[xmax]
    G0 Y[ymax]
    G0 X[xmin]
    G0 Y[ymin]
    

    Once a G-code file is loaded, run the macro for perimeter tracing with respect to current G-code boundary.

    image

Probe Widget

This widget helps you use a touch plate to set your Z zero offset.

Spindle Widget

This widget provides the spindle control.

Webcam Widget

This widget lets you monitor a webcam.

Checkout FAQ to learn how to setup and configure webcam streaming with Raspberry Pi.


Settings

General

Workspace

My Account

image

Commands

Events


Keyboard Shortcuts

These are the current keys used in the cnc (from v0.15.3).
! - Feed Hold
~ - Resume
ctrl + alt + command + h - Homing
ctrl + alt + command + u - Unlock
ctrl + alt + command + r - Reset
ctrl + alt + command + x - Select/Deselect X Axis
ctrl + alt + command + y - Select/Deselect Y Axis
ctrl + alt + command + z - Select/Deselect Z Axis
ctrl + alt + command + a - Select/Deselect A Axis
ctrl + alt + command + b - Select/Deselect B Axis (Supported in v1.9.15)
ctrl + alt + command + c - Select/Deselect C Axis (Supported in v1.9.15)
ctrl + alt + command + = - Toggle Jog Distance
ctrl + alt + command + + - Increase Jog Distance (Supported in v1.9.15)
ctrl + alt + command + - - Decrease Jog Distance (Supported in v1.9.15)
ctrl + alt + command + [ - Jog Backward
ctrl + alt + command + ] - Jog Forward
ctrl + alt + shift + 7 - Shuttle Backward (Fastest)
ctrl + alt + shift + 6 - Shuttle Backward (Faster)
ctrl + alt + shift + 5 - Shuttle Backward (Fast)
ctrl + alt + shift + 4 - Shuttle Backward (Normal)
ctrl + alt + shift + 3 - Shuttle Backward (Slow)
ctrl + alt + shift + 2 - Shuttle Backward (Slower)
ctrl + alt + shift + 1 - Shuttle Backward (Slowest)
ctrl + alt + command + 0 - Shuttle Stop
ctrl + alt + command + 1 - Shuttle Forward (Slowest)
ctrl + alt + command + 2 - Shuttle Forward (Slower)
ctrl + alt + command + 3 - Shuttle Forward (Slow)
ctrl + alt + command + 4 - Shuttle Forward (Normal)
ctrl + alt + command + 5 - Shuttle Forward (Fast)
ctrl + alt + command + 6 - Shuttle Forward (Faster)
ctrl + alt + command + 7 - Shuttle Forward (Fastest)


Contour ShuttleXpress

You can use the ShuttleXpress jog dial to work with a CNC controller. The ShuttleXpress has five programmable buttons, a 10 counts jog dial (the inner wheel), and a 15-position shuttle wheel (the outer wheel) that returns to center when released.

To work with cnc, configure three buttons to select/deselect X/Y/Z axis, and another one button to switch the distance value. Set turn jog dial left (CCW) to jog backward/down, and set turn jog right (CW) to jog forward/up.

ShuttleXpress Settings

Buttons

  • Button 1 - Select/Deselect A Axis
    ctrl + alt + command + a
  • Button 2 - Select/Deselect X Axis
    ctrl + alt + command + x
  • Button 3 - Select/Deselect Y Axis
    ctrl + alt + command + y
  • Button 4 - Select/Deselect Z Axis
    ctrl + alt + command + z
  • Button 5 - Select Jog Distance (1, 0.1, 0.01, 0.001, or a custom value)
    ctrl + alt + command + = or d

Jog Wheel

  • Jog Backward
    ctrl + alt + command + [ or b
  • Jog Forward
    ctrl + alt + command + ] or f

Shuttle Wheel

Adjust the keystroke repeat rate to 10 times per second for all Shuttle Zones except the Shuttle Zone 0.

  • Shuttle Zone -7
    ctrl + alt + shift + 7
  • Shuttle Zone -6
    ctrl + alt + shift + 6
  • Shuttle Zone -5
    ctrl + alt + shift + 5
  • Shuttle Zone -4
    ctrl + alt + shift + 4
  • Shuttle Zone -3
    ctrl + alt + shift + 3
  • Shuttle Zone -2
    ctrl + alt + shift + 2
  • Shuttle Zone -1
    ctrl + alt + shift + 1
  • Shuttle Zone 0
    ctrl + alt + command + 0
  • Shuttle Zone 1
    ctrl + alt + command + 1
  • Shuttle Zone 2
    ctrl + alt + command + 2
  • Shuttle Zone 3
    ctrl + alt + command + 3
  • Shuttle Zone 4
    ctrl + alt + command + 4
  • Shuttle Zone 5
    ctrl + alt + command + 5
  • Shuttle Zone 6
    ctrl + alt + command + 6
  • Shuttle Zone 7
    ctrl + alt + command + 7

Reduce humming sound when accelerating and decelerating

If you'd hear a strange humming noise during acceleration and deceleration, try to increase the max feed rate and the acceleration speed, and make sure it will not miss steps. Use '$'-commands to tweak Grbl system settings, like below:

> $$
   :    :
$110=2500.000 (x max rate, mm/min)
$111=2500.000 (y max rate, mm/min)
$112=500.000 (z max rate, mm/min)
$120=250.000 (x accel, mm/sec^2)
$121=250.000 (y accel, mm/sec^2)
$122=50.000 (z accel, mm/sec^2)
   :    :
ok
> $110=2500.000
ok
> $120=250.00
ok

In the general case, higher acceleration (mm/sec^2) can significantly reduce humming sound when accelerating and decelerating, but you may need to adjust various settings with your CNC machine. To adjust ShuttleXpress specific settings, click on the button at the top of the Axes widget.

  • Feed Rate Range: 100-2500 mm/min (default: 500-2000 mm/min)
    • Defines the minimum feed rate for Shuttle Zone +1 and -1
    • Defines the maximum feed rate for Shuttle Zone +7 and -7
  • Repeat Rate: 60Hz - 1Hz (default: 10Hz)
    • The repeat rate should be equal to your keystroke repeat rate for each Shuttle Zones.
  • Distance Overshoot: 1x - 1.5x (default: 1x)
    • Defines the overshoot of the travel distance
Clone this wiki locally
You can’t perform that action at this time.