linuxcnc EMC2 User Manual

0 (0)

User Manual V2.4

The EMC Team

October 26, 2011

EMC V2.4 User Manual

This manual is a work in progress. If you are able to help with writing, editing, or graphic preparation please contact any member of the writing team or join and send an email to emcusers@lists.sourceforge.net.

Copyright (c) 2000-9 LinuxCNC.org

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and one Back-Cover Text: "This EMC Handbook is the product of several authors writing for linuxCNC.org. As you find it to be of value in your work, we invite you to contribute to its revision and growth." A copy of the license is included in the section entitled "GNU Free Documentation License". If you do not find the license you may order a copy from Free Software Foundation, Inc. 59 Temple Place, Suite 330 Boston, MA 02111-1307

I

Contents

Cover

 

 

I

1

Foreword

 

1

2

EMC2

 

3

 

2.1

This Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

3

 

2.2

How EMC2 Works . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

3

 

2.3

User Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

4

 

2.4

Languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5

 

2.5

Thinking Like a Machine Operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

6

 

2.6

Modes of Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

6

3

User Concepts

7

 

3.1

Trajectory Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7

 

 

3.1.1

Trajectory Planning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7

 

 

3.1.2

Path Following . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7

 

 

3.1.3

Programming the Planner . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

8

 

 

3.1.4

Planning Moves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

9

 

3.2

G Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

9

 

 

3.2.1

Defaults . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

9

 

 

3.2.2

Feed Rate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

9

 

 

3.2.3

Tool Radius Offset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

10

 

3.3

Homing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

10

 

3.4

Tool Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

10

 

3.5

Coordinate Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

10

 

 

3.5.1

G53 Machine Coordinate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

10

 

 

3.5.2

G54-59.3 User Coordinates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

10

 

 

3.5.3

When You’re Lost . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

11

II

EMC V2.4 User Manual CONTENTS

I

Interfaces

 

12

4

AXIS

 

 

13

 

4.1

Introduction

. . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

 

4.2

Getting Started . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

 

 

4.2.1

A Typical Session . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

 

4.3

AXIS Display .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

 

 

4.3.1

Menu Items . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

 

 

 

4.3.1.1

File Menu . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

 

 

 

4.3.1.2

Machine . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

 

 

 

4.3.1.3

View . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

 

 

 

4.3.1.4

Help . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

 

 

4.3.2

Toolbar buttons . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

 

 

4.3.3

Graphical Display Area . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

 

 

 

4.3.3.1

Coordinate Display . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

 

 

 

4.3.3.2

Preview Plot . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

 

 

 

4.3.3.3

Program Extents . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

 

 

 

4.3.3.4

Tool Cone . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

 

 

 

4.3.3.5

Backplot . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

 

 

 

4.3.3.6

Interacting . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

 

 

4.3.4

Text Display Area . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

 

 

4.3.5

Manual Control . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

 

 

 

4.3.5.1

The "Axis" group . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

 

 

 

4.3.5.2

Homing . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

 

 

 

4.3.5.3

Touch Off . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

 

 

 

4.3.5.4

Override Limits . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

 

 

 

4.3.5.5

The "Spindle" group . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

 

 

 

4.3.5.6

The "Coolant" group . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

 

 

4.3.6

MDI . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

 

 

4.3.7

Feed Override . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

 

 

4.3.8

Spindle Speed Override . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

 

 

4.3.9

Jog Speed . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

 

 

4.3.10Max Velocity . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

 

4.4

Keyboard Controls . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

 

4.5

Show EMC Status . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

 

4.6

MDI interface .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

 

4.7

axis-remote . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

 

4.8

Manual Tool Change . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

 

4.9

Python modules . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

 

 

 

 

 

III

EMC V2.4 User Manual

CONTENTS

 

4.10Lathe Mode .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 27

 

4.11Advanced Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 27

 

 

4.11.1Program Filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 27

 

 

4.11.2The X Resource Database . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 28

 

 

4.11.3Physical jog wheels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 29

 

 

4.11.4axisrc .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 29

 

 

4.11.5External Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 29

 

 

4.11.6Virtual Control Panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 29

 

 

4.11.7Special Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 29

5

Touchy

 

 

31

 

5.1

Hard Controls

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 32

 

5.2

Configuration .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 32

6

TkEMC

 

 

33

 

6.1

Introduction .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 33

 

6.2

Getting Started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 33

 

 

6.2.1 A typical session with TkEMC . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 34

 

6.3 Elements of the TkEMC window . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 34

 

 

6.3.1

Main buttons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 35

 

 

6.3.2 Offset display status bar . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 35

 

 

6.3.3

Coordinate Display Area . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 35

 

 

 

6.3.3.1

Backplot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 35

 

 

6.3.4

Automatic control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 36

 

 

 

6.3.4.1

Buttons for control . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 36

 

 

 

6.3.4.2

Text Program Display Area . . . . . . . . . . . . . . . . . . . . . .

. . . . . 36

 

 

6.3.5

Manual Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 36

 

 

 

6.3.5.1

Implicit keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 36

 

 

 

6.3.5.2

The “Spindle” group . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 37

 

 

 

6.3.5.3

The “Coolant” group . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 37

 

 

6.3.6

Code Entry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 37

 

 

 

6.3.6.1

MDI: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 37

 

 

 

6.3.6.2

Active G-Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 37

 

 

6.3.7

Jog Speed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 38

 

 

6.3.8

Feed Override . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 38

 

 

6.3.9

Spindle speed Override . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 38

 

6.4

Keyboard Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 38

IV

EMC V2.4 User Manual

CONTENTS

7

MINI

 

39

 

7.1

Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 39

 

7.2

Screen layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 40

 

7.3

Menu Bar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 41

 

7.4

Control Button Bar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 42

 

 

7.4.1

MANUAL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 42

 

 

7.4.2

AUTO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 43

 

 

7.4.3

MDI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 44

 

 

7.4.4

[FEEDHOLD] – [CONTINUE] . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 44

 

 

7.4.5

[ABORT] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 45

 

 

7.4.6

[ESTOP] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 45

 

7.5

Left Column . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 45

 

 

7.5.1

Axis Position Displays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 45

 

 

7.5.2

Feed rate Override . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 46

 

 

7.5.3

Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 46

 

7.6

Right Column . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 46

 

 

7.6.1

Program Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 47

 

 

7.6.2

Backplot Display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 48

 

 

7.6.3

Tool Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 48

 

 

7.6.4

Offset Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 49

 

7.7

Keyboard Bindings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 50

 

 

7.7.1

Common Keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 50

 

 

7.7.2

Manual Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 50

 

 

7.7.3

Auto Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 51

 

7.8

Misc

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 51

8

KEYSTICK

52

 

8.1

Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 52

 

8.2

Installing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 52

 

8.3

Using

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 53

II

Using EMC

 

54

9

CNC Machine Overview

55

 

9.1 Mechanical Components . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . 55

 

9.1.1 Axes .

. . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . 55

 

9.1.1.1

Primary Linear Axes . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . 55

 

9.1.1.2

Secondary Linear Axes .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . 55

 

9.1.1.3

Rotational Axes . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . 55

 

 

 

V

EMC V2.4 User Manual

CONTENTS

 

9.1.2

Spindle . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . 56

 

9.1.3

Coolant . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . 56

 

9.1.4 Feed and Speed Override . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . 56

 

9.1.5

Block Delete Switch . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . 56

 

9.1.6 Optional Program Stop Switch . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . 56

9.2 Control and Data Components . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . 56

 

9.2.1

Linear Axes . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . 56

 

9.2.2

Rotational Axes . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . 56

 

9.2.3

Controlled Point . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . 57

 

9.2.4

Coordinated Linear Motion . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . 57

 

9.2.5

Feed Rate . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . 57

 

9.2.6

Coolant . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . 57

 

9.2.7

Dwell . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . 57

 

9.2.8

Units . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . 58

 

9.2.9

Current Position . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . 58

 

9.2.10Selected Plane . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . 58

 

9.2.11Tool Carousel . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . 58

 

9.2.12Tool Change . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . 58

 

9.2.13Pallet Shuttle . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . 58

 

9.2.14Feed and Speed Override Switches . . . . . . . .

. . . . . . . . . . . . . . . . . . . 58

 

9.2.15Path Control Mode . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . 58

9.3 Interpreter Interaction with Switches . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . 59

 

9.3.1 Feed and Speed Override Switches . . . . . . . .

. . . . . . . . . . . . . . . . . . . 59

 

9.3.2

Block Delete Switch . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . 59

 

9.3.3 Optional Program Stop Switch . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . 59

9.4

Tool File . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . 59

 

9.4.1 Mill Format Tool Files . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . 60

 

9.4.2 Lathe Format Tool Files . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . 60

9.5

Parameters . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . 61

10 Coordinate System

63

10.1Introduction . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . 63

10.2The Machine Position Command (G53) . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . 63

10.3Fixture Offsets (G54-G59.3) . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . 64

 

10.3.1Default coordinate system . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . 65

 

10.3.2Setting coordinate system values within G-code.

. . . . . . . . . . . . . . . . . . . 65

10.4G92 Offsets . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . 66

 

10.4.1The G92 commands . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . 66

 

10.4.2Setting G92 values . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . 66

 

10.4.3G92 Cautions . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . 67

10.5Sample Program Using Offsets . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . 67

VI

EMC V2.4 User Manual

CONTENTS

11 Tool Compensation

69

11.1Tool Length Offsets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 69

11.1.1Touch Off . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 69

11.1.2Using G10 L1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 69

11.2Tool Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 70

11.2.1Tool Changers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 70

11.3Cutter Radius Compensation . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 71

11.3.1Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 71

11.3.2Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 73

11.3.2.1Outside Profile . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 73

11.3.2.2Inside Profile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 73

12 G Code Overview

75

12.1Format of a line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 75

12.2Line Number . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 76

12.3Word . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 76

12.4Number . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 77

12.5Numbered Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 77

12.6Named Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 78

12.7Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 78

12.8Binary Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 79

12.9Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 79

12.10Repeated Items . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 80

12.11Item order . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 80

12.12Commands and Machine Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 81

12.13Modal Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 81

12.14Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 82

12.15File Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 82

13 G Code Order of Execution

83

14 G Code Best Practices

84

15 G Code Reference

86

15.1Polar Coordinates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 86

15.2Quick Reference Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 89

15.3G0 Rapid Linear Motion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 90

15.4G1 Linear Motion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 90

15.5G2, G3 Arc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 91

15.5.1Center format arcs (preferred format) . . . . . . . . . . . . . . . . . . . . .

. . . . . 91

VII

 

EMC V2.4 User Manual

CONTENTS

15.5.2Full Circles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 94

15.5.3Radius format arcs (discouraged format) . . . . . . . . . . . . . . . . . . .

. . . . . 94

15.6G4 Dwell . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 94

15.7G5.1 Quadratic B-spline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 95

15.8G5.2 G5.3 NURBs Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 95

15.9G7 Diameter Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 96

15.10G8 Radius Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 96

15.11G10

L1 Set Tool Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 96

15.12G10

L2 Set Coordinate System . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 97

15.13G10

L10 Set Tool Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 98

15.14G10

L20 Set Coordinate System . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 98

15.15G17, G18, G19, G17.1, G18.1, G19.1 Plane Selection . . . . . . . . . . . . . . .

. . . . . 98

15.16G20, G21 Length Units . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 98

15.17G28, G28.1 Go to Predefined Position . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 99

15.18G30, G30.1 Go to Predefined Position . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 99

15.19G33

Spindle-Synchronized Motion . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 99

15.20G33.1 Rigid Tapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 100

15.21G38.x Straight Probe . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 100

15.22G40

Compensation Off . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 101

15.23G41, G42 Cutter Radius Compensation . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 101

15.24G41.1, G42.1 Dynamic Cutter Radius Compensation . . . . . . . . . . . . . . .

. . . . . 102

15.25G43, G43.1, G49 Tool Length Offsets . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 102

15.25.1G43, G43.1: Activate Tool length compensation . . . . . . . . . . . . . . .

. . . . . 102

 

15.25.1.1G43: Use current tool loaded . . . . . . . . . . . . . . . . . . . . .

. . . . . 102

 

15.25.1.2G43 Hn: Offsets from tool table . . . . . . . . . . . . . . . . . . .

. . . . . 102

 

15.25.1.G43.1: Dynamic tool compensation . . . . . . . . . . . . . . . . .

. . . . . 103

15.25.2G49: Cancel tool length compensation . . . . . . . . . . . . . . . . . . . .

. . . . . 103

15.26G53

Move in Absolute Coordinates . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 103

15.27G54

G59.3 Select Coordinate System . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 103

15.28G61, G61.1, G64 Set Path Control Mode . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 104

15.29G73

Drilling Cycle with Chip Breaking . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 104

15.30G76

Threading Cycle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 105

15.31G80

Cancel Modal Motion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 107

15.32Canned Cycles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 107

15.32.1Common Words . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 107

15.32.2Sticky Words . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 107

15.32.3Repeat Cycle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 108

15.32.4Retract Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 108

VIII

EMC V2.4 User Manual

CONTENTS

15.32.5Canned Cycle Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 108

15.32.6Preliminary and In-Between Motion . . . . . . . . . . . . . . . . . . . . . .

. . . . . 109

15.33G81

Drilling Cycle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 109

15.34G82

Drilling Cycle with Dwell . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 110

15.35G83

Peck Drilling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 110

15.36G84

Right-Hand Tapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 111

15.37G85

Boring, No Dwell, Feed Out . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 111

15.38G86

Boring, Spindle Stop, Rapid Out . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 111

15.39G87

Back Boring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 111

15.40G88

Boring, Spindle Stop, Manual Out . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 111

15.41G89

Boring, Dwell, Feed Out . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 112

15.42G90, G91 Set Distance Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 112

15.43G90.1, G91.1 Arc Distance Mode . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 112

15.44G92, G92.1, G92.2, G92.3 Coordinate System Offsets . . . . . . . . . . . . . . .

. . . . . 112

15.45G93, G94, G95: Set Feed Rate Mode . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 113

15.46G96, G97 Spindle Control Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 114

15.47G98, G99 Set Canned Cycle Return Level . . . . . . . . . . . . . . . . . . . . . .

. . . . . 114

16 M Codes

 

115

16.1M0, M1, M2, M30, M60 Program Stopping and Ending . . . . . . . . . . . . . .

. . . . . 115

16.2M3, M4, M5 Spindle Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 116

16.3M6 Tool Change . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 116

16.3.1Manual Tool Change . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 116

16.3.2Tool Changer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 116

16.4M7, M8, M9 Coolant Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 116

16.5Overrides . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 117

16.5.1M48, M49 Override Control . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 117

16.5.2M50 Feed Override Control . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 117

16.5.3M51 Spindle Speed Override Control . . . . . . . . . . . . . . . . . . . . .

. . . . . 117

16.5.4M52 Adaptive Feed Control . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 117

16.5.5M53 Feed Stop Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 117

16.6M61 Set Current Tool Number . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 117

16.7M62 to M65 Output Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 118

16.8M66 Input Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 118

16.9M67 Analog Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 119

16.10M68 Analog Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 119

16.11M100 to M199 User Defined Commands . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 119

IX

EMC V2.4 User Manual

CONTENTS

17 O Codes

121

17.1Subroutines: sub, endsub, return, call . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 121

17.2Looping: do, while, endwhile, break, continue . . . . . . . . . . . . . . . . . . . .

. . . . . 122

17.3Conditional: if, else, endif . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 122

17.4Repeat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 122

17.5Indirection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 122

17.6Computing values in O-words . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 123

17.7Calling Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 123

18 Other Codes

124

18.1F: Set Feed Rate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 124

18.2S: Set Spindle Speed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 124

18.3T: Select Tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 124

18.4Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 125

18.5Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 125

18.6Probe Logging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 125

18.6.1(LOGOPEN,filename) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 125

18.6.2(LOGCLOSE) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 125

18.6.3(LOG,. . . ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 125

18.7Debugging Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 126

18.8Parameters in special comments . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 126

19 Lathe Specifics

127

19.1Lathe Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 127

19.2Tool Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 127

19.3Tool Touch Off . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 129

19.4Threading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 130

19.5Constant Surface Speed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 130

19.6Arcs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 131

19.7Tool Path . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 131

20 RS274NGC

136

III Examples

139

21 G-Code Examples

140

21.1Mill Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 140

21.1.1Helical Hole Milling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 140

21.1.2Slotting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 140

21.1.3Grid Probe . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 140

X

 

EMC V2.4 User Manual

CONTENTS

21.1.4Smart Probe . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 140

21.1.5Tool Length Probe . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 141

21.1.6Hole Probe . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 141

21.1.7Cutter Compensation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 141

21.2Lathe Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 141

21.2.1Threading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 141

22 Image-to-gcode: Milling “depth maps”

142

22.1What is a depth map? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 142

22.2Integrating image-to-gcode with the AXIS user interface . . . . . . . . . . . . . .

. . . . . 142

22.3Using image-to-gcode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 143

22.4Option Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 143

22.4.1Units . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 143

22.4.2Invert Image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 143

22.4.3Normalize Image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 143

22.4.4Expand Image Border . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 143

22.4.5Tolerance (units) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 143

22.4.6Pixel Size (units) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 144

22.4.7Plunge Feed Rate (units per minute) . . . . . . . . . . . . . . . . . . . . .

. . . . . 144

22.4.8Feed Rate (units per minute) . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 144

22.4.9Spindle Speed (RPM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 144

22.4.10Scan Pattern . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 144

22.4.11Scan Direction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 144

22.4.12Depth (units) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 144

22.4.13Step Over (pixels) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 144

22.4.14Tool Diameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 145

22.4.15Safety Height . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 145

22.4.16Tool Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 145

22.4.17Lace bounding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 145

22.4.18Contact angle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 145

22.4.19Roughing offset and depth per pass . . . . . . . . . . . . . . . . . . . . . .

. . . . . 145

IV Diagnostics

147

23 Steppers

148

23.1Common Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 148

23.1.1Stepper Moves One Step . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 148

23.1.2No Steppers Move . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 148

23.1.3Distance Not Correct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . 148

XI

 

EMC V2.4 User Manual

CONTENTS

23.2Error Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148 23.2.1Following Error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148 23.2.2RTAPI Error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149 23.3Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149 23.3.1Step Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149

V

Appendices

151

A

Glossary

152

B

Legal Section

156

 

B.1

Copyright Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. 156

 

B.2

GNU Free Documentation License . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. 156

XII

Chapter 1

Foreword

EMC2 is modular and flexible. These attributes lead many to see it as a confusing jumble of little things and wonder why it is the way it is. This page attempts to answer that question before you get into the thick of things.

EMC started at the National Institute of Standards and Technology in the USA. It grew up using Unix as it’s operating system. Unix made it different. Among early Unix developers there grew a set of code writing ideas that some call the Unix way. These early EMC authors followed those ways.

Eric S. Raymond, in his book The Art of Unix Programming, summarizes the Unix philosophy as the widely-used engineering philosophy, "Keep it Simple, Stupid" (KISS Principle). He then describes how he believes this overall philosophy is applied as a cultural Unix norm, although unsurprisingly it is not difficult to find severe violations of most of the following in actual Unix practice:

*Rule of Modularity: Write simple parts connected by clean interfaces.

*Rule of Clarity: Clarity is better than cleverness.

*Rule of Composition: Design programs to be connected to other programs.

*Rule of Separation: Separate policy from mechanism; separate interfaces from engines.1

Mr Raymond offered several more rules but these four describe essential characteristics of the EMC2 motion control system.

The Modularity rule is critical. Throughout these handbooks you will find talk of the interpreter or task planner or motion or HAL. Each of these is a module or collection of modules. It’s modularity that allows you to connect together just the parts you need to run your machine.

The Clarity rule is essential. EMC2 is a work in progress – it is not finished nor will it ever be. It is complete enough to run most of the machines we want it to run. Much of that progress is achieved because many users and code developers are able to look at the work of others and build on what they have done.

The Composition rule allows us to build a predictable control system from the many modules available by making them connectable. We achieve connectability by setting up standard interfaces to sets of modules and following those standards.

The Separation rule requires that we make distinct parts that do little things. By separating functions debugging is much easier and replacement modules can be dropped into the system and comparisons easily made.

What does the Unix way mean for you as a user of EMC2. It means that you are able to make choices about how you will use the system. Many of these choices are a part of machine integration, but

1Found at http://en.wikipedia.org/wiki/Unix_philosophy, 07/06/2008

1

EMC V2.4 User Manual

Chapter 1. Foreword

many also affect the way you will use your machine. As you read you will find many places where you will need to make comparisons. Eventually you will make choices, "I’ll use this interface rather than that” or, “I’ll write part offsets this way rather than that way." Throughout these handbooks we describe the range of abilities currently available.

As you begin your journey into using EMC2 we offer two cautionary notes:2

Praphrasing the words of Doug Gwyn on UNIX: "emc2 was not designed to stop its users from doing stupid things, as that would also stop them from doing clever things."

Likewise the words of Steven King: "emc2 is user-friendly. It just isn’t promiscuous about which users it’s friendly with."

2Found at http://en.wikipedia.org/wiki/Unix_philosophy, 07/06/2008

2

Chapter 2

EMC2

The Enhanced Machine Control

2.1This Manual

The focus of this manual is on using EMC. It is intended to be used once EMC is installed and configured. For standard installations see the Getting Started Guide for step by step instructions to get you up and going. For detailed information on installation and configuration of EMC see the Integrator Manual.

2.2How EMC2 Works

The Enhanced Machine Controller (EMC2) is a lot more than just another CNC mill program. It can control machine tools, robots, or other automated devices. It can control servo motors, stepper motors, relays, and other devices related to machine tools.

There are four main components to the EMC2 software: a motion controller, a discrete I/O controller, a task executor which coordinates them, and graphical user interfaces. In addition there is a layer called HAL (Hardware Abstraction Layer) which allows configuration of EMC2 without the need of recompiling.

3

EMC V2.4 User Manual

Chapter 2. EMC2

Figure 2.1: Simple EMC2 Controlled Machine

Figure 2.1 shows a simple block diagram showing what a typical 3-axis EMC2 system might look like. This diagram shows a stepper motor system. The PC, running Linux as its operating system, is actually controlling the stepper motor drives by sending signals through the printer port. These signals (pulses) make the stepper drives move the stepper motors. The EMC2 can also run servo motors via servo interface cards or by using an extended parallel port to connect with external control boards. As we examine each of the components that make up an EMC2 system we will remind the reader of this typical machine.

2.3User Interfaces

A user interface is the part of the EMC2 that the machine tool operator interacts with. The EMC2 comes with several types of user interfaces:

AXIS an OpenGL-based GUI (Graphical User Interface), with an interactive G-Code previewer. This interface is one of the few that are still under active development and improvement.

4

linuxcnc EMC2 User Manual

EMC V2.4 User Manual

Chapter 2. EMC2

Keystick a character-based screen graphics program suitable for minimal installations (without the X server running).

Xemc an X Windows program

two Tcl/Tk-based GUIs named TkEMC and Mini

a HAL based user interface called halui, which allows to control emc2 using knobs and switches

a telnet based user interface called emcrsh, which allows commands to be sent to emc2 from remote computers

2.4Languages

EMC2 uses translation files to translate EMC User Interfaces into many languages. You just need to log in with the language you intend to use and when you start up EMC it comes up in that language. If your language has not been translated contact a developer on the IRC or the mailing list if you can assist in the translation.

5

EMC V2.4 User Manual

Chapter 2. EMC2

2.5Thinking Like a Machine Operator

This book will not even pretend that it can teach you to run a mill or a lathe. Becoming a machinist takes time and hard work. An author once said, "We learn from experience, if at all." Broken tools, gouged vices, and scars are the evidence of lessons taught. Good part finish, close tolerances, and careful work are the evidence of lessons learned. No machine, no computer program, can take the place of human experience.

As you begin to work with the EMC2 program, you will need to place yourself in the position of operator. You need to think of yourself in the role of the one in charge of a machine. It is a machine that is either waiting for your command or executing the command that you have just given it. Throughout these pages we will give information that will help you become a good operator of the EMC2 mill. You will need some information right up front here so that the following pages will make sense to you.

2.6Modes of Operation

When an EMC2 is running, there are three different major modes used for inputting commands. These are Manual, Auto, and MDI. Changing from one mode to another makes a big difference in the way that the EMC2 behaves. There are specific things that can be done in one mode that can not be done in another. An operator can home an axis in manual mode but not in auto or MDI modes. An operator can cause the machine to execute a whole file full of G-codes in the auto mode but not in manual or MDI.

In manual mode, each command is entered separately. In human terms a manual command might be "turn on coolant" or "jog X at 25 inches per minute". These are roughly equivalent to flipping a switch or turning the hand wheel for an axis. These commands are normally handled on one of the graphical interfaces by pressing a button with the mouse or holding down a key on the keyboard. In auto mode, a similar button or key press might be used to load or start the running of a whole program of G-code that is stored in a file. In the MDI mode the operator might type in a block of code and tell the machine to execute it by pressing the <return> or <enter> key on the keyboard.

Some motion control commands are available and will cause the same changes in motion in all modes. These include ABORT, ESTOP, and FEED RATE OVERRIDE. Commands like these should be self explanatory.

The AXIS user interface hides some of the distinctions between Auto and the other modes by making Auto-commands available at most times. It also blurs the distinction between Manual and MDI because some Manual commands like Touch Off are actually implemented by sending MDI commands. It does this by automatically changing to the mode that is needed for the action the user has requested.

6

Chapter 3

User Concepts

This chapter covers important user concepts that should be understood before attempting to run a CNC machine with g code.

3.1Trajectory Control

3.1.1Trajectory Planning

Trajectory planning, in general, is the means by which EMC follows the path specified by your G Code program, while still operating within the limits of your machinery.

A G Code program can never be fully obeyed. For example imagine you specify as a single-line program the following move:

G1 X1 F10 (G1 is linear move, X1 is the destination, F10 is the speed)

In reality, the whole move can’t be made at F10, since the machine must accelerate from a stop, move toward X=1, and then decelerate to stop again. Sometimes part of the move is done at F10, but for many moves, especially short ones, the specified feed rate is never reached at all. Having short moves in your G Code can cause your machine to slow down and speed up for the longer moves if the "naive cam detector" is not employed with G64 Pn.

The basic acceleration and deceleration described above is not complex and there is no compromise to be made. In the INI file the specified machine constraints such as maximum axis velocity and axis acceleration must be obeyed by the trajectory planner.

3.1.2Path Following

A less straightforward problem is that of path following. When you program a corner in G Code, the trajectory planner can do several things, all of which are right in some cases: it can decelerate to a stop exactly at the coordinates of the corner, and then accelerate in the new direction. It can also do what is called blending, which is to keep the feed rate up while going through the corner, making it necessary to round the corner off in order to obey machine constraints. You can see that there is a trade off here: you can slow down to get better path following, or keep the speed up and have worse path following. Depending on the particular cut, the material, the tooling, etc., the programmer may want to compromise differently.

Rapid moves also obey the current trajectory control. With moves long enough to reach maximum velocity on a machine with low acceleration and no path tolerance specified, you can get a fairly round corner.

7

EMC V2.4 User Manual

Chapter 3. User Concepts

3.1.3Programming the Planner

The trajectory control commands are as follows:

G61 (Exact Path Mode) visits the programmed point exactly, even though that means it might temporarily come to a complete stop in order to change direction to the next programmed point.

G61.1 (Exact Stop Mode) tells the planner to come to an exact stop at every segment’s end.

G64 (Blend Without Tolerance Mode) G64 is the default setting when you start EMC. G64 is just blending and the naive cam detector is not enabled. G64 and G64P0 tell the planner to sacrifice path following accuracy in order to keep the feed rate up. This is necessary for some types of material or tooling where exact stops are harmful, and can work great as long as the programmer is careful to keep in mind that the tool’s path will be somewhat more curvy than the program specifies. When using G0 (rapid) moves with G64 use caution on clearance moves and allow enough distance to clear obstacles based on the acceleration capabilities of your machine.

G64 P- Q- (Blend With Tolerance Mode) This enables the "naive cam detector" and enables blending with a tolerance. If you program G64 P0.05, you tell the planner that you want continuous feed, but at programmed corners you want it to slow down enough so that the tool path can stay within 0.05 user units of the programmed path. The exact amount of slowdown depends on the geometry of the programmed corner and the machine constraints, but the only thing the programmer needs to worry about is the tolerance. This gives the programmer complete control over the path following compromise. The blend tolerance can be changed throughout the program as necessary. Beware that a specification of G64 P0 has the same effect as G64 alone (above), which is necessary for backward compatibility for old G Code programs. See the G Code Chapter for more information on G64 P- Q-.

Blending without tolerance The controlled point will touch each specified movement at at least one point. The machine will never move at such a speed that it cannot come to an exact stop at the end of the current movement (or next movement, if you pause when blending has already started). The distance from the end point of the move is as large as it needs to be to keep up the best contouring feed.

Naive Cam Detector Successive G1 moves that involve only the XYZ axes that deviate less than Q- from a straight line are merged into a single straight line. This merged movement replaces the individual G1 movements for the purposes of blending with tolerance. Between successive movements, the controlled point will pass no more than P- from the actual endpoints of the movements. The controlled point will touch at least one point on each movement. The machine will never move at such a speed that it cannot come to an exact stop at the end of the current movement (or next movement, if you pause when blending has already started) On G2/3 moves in the G17 (XY) plane when the maximum deviation of an arc from a straight line is less than the G64 Q- tolerance the arc is broken into two lines (from start of arc to midpoint, and from midpoint to end). those lines are then subject to the naive cam algorithm for lines. Thus, line-arc, arc-arc, and arc-line cases as well as line-line benefit from the "naive cam detector". This improves contouring performance by simplifying the path.

In the following figure the blue line represents the actual machine velocity. The red lines are the acceleration capability of the machine. The horizontal lines below each plot is the planned move. The upper plot shows how the trajectory planner will slow the machine down when short moves are encountered to stay within the limits of the machines acceleration setting to be able to come to an exact stop at the end of the next move. The bottom plot shows the effect of the Naive Cam Detector to combine the moves and do a better job of keeping the velocity as planned.

8

EMC V2.4 User Manual

Chapter 3. User Concepts

Figure 3.1: Naive Cam Detector

3.1.4Planning Moves

Make sure moves are "long enough" to suit your machine/material. Principally because of the rule that "the machine will never move at such a speed that it cannot come to a complete stop at the end of the current movement", there is a minimum movement length that will allow the machine to keep up a requested feed rate with a given acceleration setting.

The acceleration and deceleration phase each use half the ini file MAX_ACCELERATION. In a blend that is an exact reversal, this causes the total axis acceleration to equal the ini file MAX_ACCELERATION. In other cases, the actual machine acceleration is somewhat less than the ini file acceleration

To keep up feed rate, the move must be longer than the distance it takes to accelerate from 0 to the desired feed rate and then stop again. Using A as 1/2 the ini file MAX_ACCELERATION and F as the feed rate *in units per second*, the acceleration time is ta = F/A and the acceleration distance is da = (1=2) F ta the deceleration time and distance are the same, making the critical distance d = da + dd = 2*da = F^2 / A.

For example, for a feed rate of 1 inch per second and an acceleration of 10 inch/sec^2, the critical distance is 1^2 / 10 = .1 inch. For a feed rate of .5 inch per second, the critical distance is .5^2 / 10 = .025 inch.

3.2G Code

3.2.1Defaults

When EMC first starts up many G and M codes are loaded by default. The current active G and M codes can be viewed on the MDI tab in the "Active G-Codes:" window in the AXIS interface. These G and M codes define the behavior of EMC and it is important that you understand what each one does before running EMC. The defaults can be changed when running a G-Code file and left in a different state than when you started your EMC session. The best practice is to set the defaults needed for the job in the preamble of your G-Code file and not assume that the defaults have not changed. Printing out the G-Code Quick Reference (15.2) page can help you remember what each one is.

3.2.2Feed Rate

How the feed rate is applied depends on if an axis involved with the move is a rotary axis. Read and understand the Feed Rate section (9.2.5) if you have a rotary axis or a lathe.

9

EMC V2.4 User Manual

Chapter 3. User Concepts

3.2.3Tool Radius Offset

Tool Radius Offset (G41/42) requires that the tool be able to touch somewhere along each programmed move without gouging the two adjacent moves. If that is not possible with the current tool diameter you will get an error. A smaller diameter tool may run without an error on the same path. This means you can program a cutter to pass down a path that is narrower than the cutter without any errors. See the Tool Compensation Section (11.3) for more information.

3.3Homing

After starting EMC2 each axis must be homed prior to running a program or running a MDI command.

If you want to deviate from the default behavior, or want to use the Mini interface you will need to set the option NO_FORCE_HOMING = 1 in the [TRAJ] section of your ini file. More information on homing can be found in the Integrators Manual.

3.4Tool Changes

There are several options when doing manual tool changes. See the [EMCIO] section of the Integrators Manual for information on configuration of these options. Also see the G28 and G30 section of the User Manual.

3.5Coordinate Systems

The Coordinate Systems can be confusing at first. Before running a CNC machine you must understand the basics of the coordinate systems used by EMC. In depth information on the EMC Coordinate Systems is in the coordinate section 10 of this manual.

3.5.1G53 Machine Coordinate

When you home EMC you set the G53 Machine Coordinate System to 0 for each axis homed.

No other coordinate systems or tool offsets are changed by homing.

The only time you move in the G53 machine coordinate system is when you program a G53 on the same line as a move. Normally you are in the G54 coordinate system.

3.5.2G54-59.3 User Coordinates

Normally you use the G54 Coordinate System. When an offset is applied to a current user coordinate system a small blue ball with lines will be at the machine origin when your DRO is displaying "Position: Relative Actual" in Axis. If your offsets are temporary use the Zero Coordinate System from the Machine menu or program G10 L2 P1 X0 Y0 Z0 at the end of your G Code file. Change the "P" number to suit the coordinate system you wish to clear the offset in.

Offsets stored in a user coordinate system are retained when EMC is shut down.

Using the "Touch Off" button in Axis sets an offset for the chosen User Coordinate System.

10

EMC V2.4 User Manual

Chapter 3. User Concepts

3.5.3When You’re Lost

If you’re having trouble getting 0,0,0 on the DRO when you think you should, you may have some offsets programmed in and need to remove them.

Move to the Machine origin with G53 G0 X0 Y0 Z0

Clear any G92 offset with G92.1

Use the G54 coordinate system with G54

Set the G54 coordinate system to be the same as the machine coordinate system with G10 L2 P1 X0 Y0 Z0

Turn off tool offsets with G49

Turn on the Relative Coordinate Display from the menu

Now you should be at the machine origin X0 Y0 Z0 and the relative coordinate system should be the same as the machine coordinate system.

11

Part I

Interfaces

12

Chapter 4

AXIS

4.1Introduction

AXIS is a graphical front-end for EMC2 which features a live preview and backplot. It is written in Python and uses Tk and OpenGL to display its user interface.

Figure 4.1: AXIS Window

13

EMC V2.4 User Manual

Chapter 4. AXIS

4.2Getting Started

To select AXIS as the front-end for EMC2, edit the .ini file. In the section [DISPLAY] change the DISPLAY line to read

DISPLAY = axis

Then, start EMC2 and select that ini file. The sample configuration sim/axis.ini is already configured to use AXIS as its front-end.

When you start AXIS, a window like the one in Figure 4.1 is shown.

4.2.1A Typical Session

1.Start EMC.

2.Clear the E-STOP (F1) and turn the Machine Power (F2) on.

3.Home all axes.

4.Load the g-code file.

5.Use the preview plot to verify that the program is correct.

6.Set the proper offsets for each axis by jogging and using the Touch Off button.

7.Run the program.

8.To run the same file again, return to step 6. To run a different file, return to step 4. When you’re done, exit AXIS.

4.3AXIS Display

The AXIS window contains the following elements:

A display area that shows a preview of the loaded file (in this case, "axis.ngc"), as well as the current location of the CNC machine’s "controlled point". Later, this area will display the path the CNC machine has moved through, called the "backplot"

A menu bar and toolbar that allow you to perform various actions

"Manual Control Tab" , which allows you to make the machine move, turn the spindle on or off, and turn the coolant on or off if included in the ini file.

"MDI Tab” , where G-code programs can be entered manually, one line at a time. This also shows the "Active G Codes" which shows which modal G Codes are in effect.

"Feed Override" , which allows you to increase or decrease the speed at which EMC executes Feed Moves the selected program. The default maximum is 120% and can be set to a different value in the ini file. See the Integrators Manual for more information on this setting.

"Spindle Override" , which allows you to increase or decrease the speed at which EMC commands the spindle to run if spindle control is configured.

"Jog Speed" , which allows you to set the jog speed within the limits set in the ini file. See the Integrators Manual for more information on the ini file.

14

EMC V2.4 User Manual

Chapter 4. AXIS

"Max Velocity", which allows you to set the maximum velocity for rapids and cap feed rates (except spindle synchronized motion) for dry runs. Currently only AXIS and Halui allow you to set it.

A text display area that shows the G-code source of the loaded file.

A status bar which shows the state of the machine. In this screen shot, the machine is turned on, does not have a tool inserted, and the displayed position is "Relative” to the machine offset (as opposed to “Absolute”), and the “Actual” (as opposed to “Commanded” position)

4.3.1Menu Items

Some menu items might be grayed out depending on how you have your .ini file configured. For more information on configuration see the Integrators Manual.

4.3.1.1File Menu

Open... Opens a standard dialog box to open a g code file to load in AXIS. If you have configured EMC to use a filter program you can also open it up. See the Integrators manual for more information on filter programs.

Recent Files Displays a list of recently opened files.

Edit... Open the current g code file for editing if you have an editor configured in your ini file. See the Integrators Manual for more information on specifying an editor to use.

Reload reload the current g code file. If you edited it you must reload it for the changes to take affect. If you stop a file and want to start from the beginning then reload the file. The toolbar reload is the same as the menu.

Save gcode as... Save the current file with a new name.

Properties The sum of the rapid and feed moves. Does not factor in acceleration, blending or path mode so time reported will never be less than the actual run time.

Edit tool table... Same as Edit if you have defined an editor you can open the tool table and edit it.

Reload tool table After editing the tool table you must reload it.

Ladder editor If you have loaded Classic Ladder you can edit it from here. See the Integrators Manual on setting up Classic Ladder

Quit Terminates the current EMC session.

4.3.1.2Machine

Toggle Emergency Stop F1

Toggle Machine Power F2

Run Program

Run From Selected Line Select the line you want to start from first. Use with caution as this will move the tool to the expected position before the line first then it will execute the rest of the code.

Step Single step through a program.

Pause Pause a program.

15

EMC V2.4 User Manual Chapter 4. AXIS

Resume Resume running from a pause.

Stop Stop a running program.

Stop at M1 If you have a M1 in your g code and this is checked program execution will stop on the M1 line. Press Resume to continue.

Skip lines with "/" If a line begins with / and this is checked it will skip that line.

Clear MDI history Clears the MDI history window.

Copy from MDI history Copies the MDI history to the clipboard

Paste to MDI history Paste from the clipboard to the MDI history window

Calibration This is a servo testing pop up widow for each axis. After making changes and testing them it can save them to your .ini file.

Show HAL Configuration Opens up the HAL Configuration widow where you can monitor HAL Components, Pins, Parameters, Signals, Functions, and Threads.

HAL Meter Opens up a window where you can monitor a single HAL Pin, Signal, or Parameter.

HAL Scope Opens up a Scope window where you can set up and monitor Pins and Signals.

Show EMC Status Opens up a window showing EMC’s status.

Set Debug Level Opens a window where debug levels can be viewed and some can be set.

Homing Home any or all axis.

Unhoming Unhome any or all axis.

Zero Coordinate System Zero work offsets.

4.3.1.3View

Top View

Rotated Top View

Side View

Front View

Perspective View

Display Inches

Display MM

Show Program

Show Live Plot

Show Tool

Show Extents

Show Machine Limits

Show Velocity

Show Distance to Go

Clear Live Plot

16

EMC V2.4 User Manual

Chapter 4. AXIS

Show Commanded Position

Show Actual Position

Show Machine Position

Show Relative Position

4.3.1.4Help

About Axis

Quick Reference Shows the keyboard shortcut keys.

4.3.2Toolbar buttons

From left to right, the toolbar buttons (keyboard shortcuts in []).

1. Toggle Emergency Stop [F1] (also called E-Stop)

2. Toggle Machine Power [F2]

3. Open G Code file [O]

4. Reload current file [Ctrl-R]

5. Begin executing the current file [R]

6. Execute next line [T]

7. Pause Execution [P] Resume Execution[S]

8. Stop Program Execution [ESC]

9. Toggle Skip lines with "/" [Alt-M-/]

10. Toggle Optional Pause [Alt-M-1]

11. Zoom In

12. Zoom Out

13. Top view

14. Rotated Top view

17

Loading...
+ 145 hidden pages