V2.1 User Handbook
Total Page:16
File Type:pdf, Size:1020Kb
V2.1 User Handbook August 24, 2007 i The EMC Team This handbook 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 emc- [email protected]. Copyright (c) 2000-6 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 Contents I Introduction & installing EMC2 1 1 The Enhanced Machine Control 2 1.1 Introduction ........................................... 2 1.2 The Big CNC Picture ....................................... 2 1.3 Computer Operating Systems ................................. 3 1.4 History of the Software ..................................... 3 1.5 How the EMC2 Works ...................................... 4 1.5.1 Graphical User Interfaces ............................... 5 1.5.2 Motion Controller EMCMOT .............................. 6 1.5.3 Discrete I/O Controller EMCIO ............................ 7 1.5.4 Task Executor EMCTASK ............................... 7 1.6 Thinking Like a Machine Operator .............................. 8 1.6.1 Modes of Operation ................................... 9 1.6.2 Information Display .................................. 10 1.7 Thinking Like An Integrator .................................. 11 1.7.1 Units ........................................... 12 1.7.2 Some things we may not want to change. ...................... 12 1.7.3 Some things we will need to change. ......................... 12 2 Installing the EMC2 software 14 2.1 Introduction ........................................... 14 2.2 EMC Download Page ...................................... 14 2.3 EMC2 Live CD .......................................... 15 2.4 EMC2 install script ....................................... 15 2.5 Manual installing using apt commands. ........................... 15 II Configuring EMC2 17 3 Running EMC2 18 3.1 Configuration Selector ..................................... 18 ii CONTENTS iii 3.2 Copying Sample Configurations ................................ 19 3.2.1 Copy and Paste ..................................... 19 3.2.2 Drag and Drop ...................................... 20 3.2.3 Comand Line Copy ................................... 21 3.3 Starting a Custom Configuration ............................... 21 4 Basic configurations for a stepper based system 23 4.1 Introduction ........................................... 23 4.2 Maximum step rate ....................................... 23 4.3 Pinout ............................................... 23 4.3.1 standard_pinout.hal .................................. 24 4.3.2 Overview of the standard_pinout.hal ......................... 26 4.3.3 Changing the standard_pinout.hal .......................... 26 4.3.4 Changing the polarity of a signal ........................... 26 4.3.5 Adding PWM Spindle Speed Control ......................... 27 4.3.6 Adding an enable signal ................................ 27 4.3.7 Adding an external ESTOP button .......................... 27 5 INI Configuration 28 5.1 Files Used for Configuration .................................. 28 5.2 The INI File Layout ....................................... 28 5.2.1 Comments ........................................ 29 5.2.2 Sections .......................................... 29 5.2.3 Variables ......................................... 30 5.3 INI Variable Definitions ..................................... 30 5.3.1 [EMC] Section ...................................... 30 5.3.2 [DISPLAY] Section .................................... 30 5.3.3 [EMCMOT] Section ................................... 30 5.3.4 [TASK] Section ...................................... 31 5.3.5 [HAL] section ....................................... 31 5.3.6 [TRAJ] Section ...................................... 31 5.3.7 [AXIS_<num>] Section ................................. 32 5.3.7.1 Homing-related items .............................. 34 5.3.7.2 Servo-related items ............................... 34 5.3.7.3 Stepper-related items .............................. 35 5.3.8 [EMCIO] Section .................................... 36 5.4 Homing .............................................. 38 5.4.1 Overview ......................................... 38 5.4.2 Homing Sequence .................................... 38 CONTENTS iv 5.4.3 Configuration ...................................... 38 5.4.3.1 HOME_SEARCH_VEL .............................. 38 5.4.3.2 HOME_LATCH_VEL ............................... 38 5.4.3.3 HOME_IGNORE_LIMITS ............................. 40 5.4.3.4 HOME_USE_INDEX ............................... 40 5.4.3.5 HOME_OFFSET ................................. 40 5.4.3.6 HOME ....................................... 40 5.4.3.7 HOME_IS_SHARED ............................... 40 5.4.3.8 HOME_SEQUENCE ............................... 40 6 Introduction 43 6.1 What is HAL? ........................................... 43 6.1.1 HAL is based on traditional system design techniques ............... 43 6.1.1.1 Part Selection ................................... 43 6.1.1.2 Interconnection Design ............................. 43 6.1.1.3 Implementation .................................. 44 6.1.1.4 Testing ....................................... 44 6.1.2 Summary ......................................... 44 6.2 HAL Concepts .......................................... 45 6.3 HAL components ......................................... 46 6.3.1 External Programs with HAL hooks .......................... 46 6.3.2 Internal Components .................................. 46 6.3.3 Hardware Drivers .................................... 47 6.3.4 Tools and Utilities .................................... 47 6.4 Tinkertoys, Erector Sets, Legos and the HAL ........................ 47 6.4.1 Tower ........................................... 47 6.4.2 Erector Sets ....................................... 47 6.4.3 Tinkertoys ........................................ 48 6.4.4 A Lego Example ..................................... 49 6.5 Timing Issues In HAL ...................................... 50 6.6 Dynamic Linking and Configuration ............................. 50 7 HAL Tutorial 52 7.1 Before we start .......................................... 52 7.1.1 Notation .......................................... 52 7.1.2 The RTAPI environment ................................ 52 7.2 Tab-completion .......................................... 53 7.3 A Simple Example ........................................ 53 7.3.1 Loading a realtime component ............................. 53 CONTENTS v 7.3.2 Examining the HAL ................................... 53 7.3.3 Making realtime code run ............................... 55 7.3.4 Changing parameters .................................. 56 7.3.5 Saving the HAL configuration ............................. 56 7.3.6 Restoring the HAL configuration ........................... 57 7.4 Looking at the HAL with halmeter ............................... 57 7.4.1 Starting halmeter .................................... 57 7.4.2 Using halmeter ...................................... 59 7.5 A slightly more complex example. ............................... 60 7.5.1 Installing the components ............................... 60 7.5.2 Connecting pins with signals ............................. 61 7.5.3 Setting up realtime execution - threads and functions ............... 62 7.5.4 Setting parameters ................................... 64 7.5.5 Run it! ........................................... 64 7.6 Taking a closer look with halscope. .............................. 64 7.6.1 Starting Halscope .................................... 64 7.6.2 Hooking up the “scope probes” ............................ 67 7.6.3 Capturing our first waveforms ............................. 68 7.6.4 Vertical Adjustments .................................. 69 7.6.5 Triggering ......................................... 69 7.6.6 Horizontal Adjustments ................................ 71 7.6.7 More Channels ...................................... 72 8 Hardware Drivers 74 8.1 Parport .............................................. 74 8.1.1 Installing ......................................... 74 8.1.2 Removing ......................................... 75 8.1.3 Pins ............................................ 75 8.1.4 Parameters ........................................ 75 8.1.5 Functions ......................................... 77 8.1.6 Common problems ................................... 77 8.2 probe_parport .......................................... 77 8.2.1 Installing ......................................... 77 8.3 AX5214H ............................................. 77 8.3.1 Installing ......................................... 78 8.3.2 Removing ......................................... 78 8.3.3 Pins ............................................ 78 8.3.4 Parameters ........................................ 78 8.3.5 Functions ......................................... 79