All pastes #763688 Raw Edit

Untitled

public text v1 · immutable
#763688 ·published 2007-11-06 17:55 UTC
rendered paste body
# standard pinout config file for 3-axis steppers
# using a parport for I/O
#
# first load the parport driver
loadrt probe_parport
loadrt hal_parport cfg="0x0378  0xDFE0"
#
# next connect the parport functions to threads
# read inputs first
addf parport.0.read base-thread 1
# write outputs last
addf parport.0.write base-thread -1
#read inputs first
addf parport.1.read base-thread 1
#write outputs last
addf parport.1.write base-thread -1

# finally connect physical pins to the signals
linksp Xstep => parport.0.pin-03-out
linksp Xdir  => parport.0.pin-02-out
linksp Ystep => parport.0.pin-05-out
linksp Ydir  => parport.0.pin-04-out
linksp Zstep => parport.0.pin-07-out
linksp Zdir  => parport.0.pin-06-out

# create a signal for the estop force false
# alternate for estop force false pin 13 only with no ewrite
#linkpp parport.1.pin-13-in iocontrol.0.emc-enable-in

# connect e-stop write/sense to I/O controller
newsig EstopSense bit
newsig EstopWrite bit
linksp EstopSense <= parport.1.pin-13-in
linksp EstopSense => iocontrol.0.emc-enable-in
linksp EstopWrite <= parport.1.pin-16-out
linksp EstopWrite => iocontrol.0.user-enable-out
#estop may need to be inverted

# create feedhold signal
newsig feedhold bit
# connect signal to motion cotrol
linkps motion.feed-hold => feedhold
# conect feedhold to physical pin
linksp feedhold => parport.1.pin-11-in-not
# or this works too
net feedhold parport.1.pin-11-in-not motion.feed-hold

#use halui for run open program hardware button halui button non funtional now
#newsig runsignal bit
#net runsignal parport.1.pin-12-in-not  halui.program.run 

# use halui to abort on estop
#newsig abort bit
#net abort parport.0.pin-11-in-not halui.abort

# create a signal for "spindle brake"
# create a signal for "spindlefwd"
# create a signal for "spindlerev"
newsig spindle-brake bit
newsig spindle-forwrd bit
#newsig spindle-reverse bit
# connect the controller to it
linkps motion.spindle-brake => spindle-brake
linkps motion.spindle-forward => spindle-forwrd
#linkps motion.spindle-reverse => spindle-reverse
# connect it to physical pin
linksp spindle-brake => parport.1.pin-17-out
linksp spindle-forwrd => parport.1.pin-03-out
#linksp spindle-reverse => parport.1.pin-02-out
net spindle-rev motion.spindle-reverse parport.1.pin-02-out

# create a signle for mist coolant 
# create a signle for flood coolant
newsig MistOn bit
newsig FloodOn bit
# connect iocontroler to it
# connect it to a physical pin
linksp MistOn <= parport.1.pin-08-out
linksp MistOn => iocontrol.0.coolant-mist
linksp FloodOn <= parport.1.pin-09-out
linksp FloodOn => iocontrol.0.coolant-flood

# create signals for tool loading loopback
# use sig for tool prep to tool preped 
linkpp iocontrol.0.tool-prepare iocontrol.0.tool-prepared
# creat a signal for toolchange
newsig changetool bit
newsig toolchanged bit
# connect iocontroler to it
# connect it to pphyiscal pins 
linksp changetool <= parport.1.pin-04-out
linksp changetool => iocontrol.0.tool-change
linksp toolchanged <= parport.0.pin-10-in-not
linksp toolchanged => iocontrol.0.tool-changed

###
### You might use something like this to enable chopper drives when machine ON
### the Xen signal is defined in core_stepper.hal
###

# linksp Xen => parport.0.pin-01-out

###
### If you want active low for this pin, invert it like this:
###

# setp parport.0.pin-01-out-invert 1

###
### A sample home switch on the X axis (axis 0).  make a signal,
### link the incoming parport pin to the signal, then link the signal
### to EMC's axis 0 home switch input pin
###

# newsig Xhome bit
# linkps parport.0.pin-10-in => Xhome
# linksp Xhome => axis.0.home-sw-in

###
### Shared home switches all on one parallel port pin?
### that's ok, hook the same signal to all the axes, but be sure to 
### set HOME_IS_SHARED and HOME_SEQUENCE in the ini file.  See the
### user manual!
###

# newsig homeswitches bit
# linkps parport.0.pin-10-in => homeswitches
# linksp homeswitches => axis.0.home-sw-in
# linksp homeswitches => axis.1.home-sw-in
# linksp homeswitches => axis.2.home-sw-in

###
### Sample separate limit switches on the X axis (axis 0)
###

# newsig X-neg-limit bit
# linkps parport.0.pin-11-in => X-neg-limit
# linksp X-neg-limit => axis.0.neg-lim-sw-in

# create signal for pos-limits
 newsig pos-limits bit
# connect signal to physical pin
 linkps parport.0.pin-15-in-not => pos-limits
# connect signal to pos-limits
 linksp pos-limits => axis.0.pos-lim-sw-in
 linksp pos-limits => axis.1.pos-lim-sw-in
 linksp pos-limits => axis.2.pos-lim-sw-in
###
### Just like the shared home switches example, you can wire together
### limit switches.  Beware if you hit one, EMC will stop but can't tell
### you which switch/axis has faulted.  Use caution when recovering from this.
###
# create signal for neg-limits
 newsig neg-limits bit
# connect signal to physical pin
 linkps parport.0.pin-13-in-not => neg-limits
# create sig for neg-limits switches
 linksp neg-limits => axis.0.neg-lim-sw-in
 linksp neg-limits => axis.1.neg-lim-sw-in
 linksp neg-limits => axis.2.neg-lim-sw-in


###
### you can also use the "net" syntax to accomplish the "newsig" and "link"
### operations all at once.  This command does the same thing as the above
### block.
###

# net Xlimits parport.pin-13-in => axis.0.neg-lim-sw-in axis.0.pos-lim-sw-in

INI
EMC controller parameters for a simulated machine.

# General note: Comments can either be preceded with a # or ; - either is
# acceptable, although # is in keeping with most linux config files.

# General section -------------------------------------------------------------
[EMC]

# Version of this INI file
VERSION =               $Revision: 1.7.4.4 $

# Name of machine, for use with display, etc.
MACHINE =               Index CnC Mill

RS274NGC_SARTUP_CODE=G21 G90

# Name of NML file to use, default is emc.nml
NML_FILE =              emc.nml

# Debug level, 0 means no messages. See src/emc/nml_int/emcglb.h for others
# DEBUG =               0x00000003
# DEBUG =               0x00000007
# DEBUG =               0x7FFFFFFF
DEBUG = 0

# Sections for display options ------------------------------------------------
[DISPLAY]

# Name of display program, e.g., xemc
DISPLAY =             tkemc
#DISPLAY =             mini
#DISPLAY =             axis

# Cycle time, in seconds, that display will sleep between polls
CYCLE_TIME =            0.100

# Path to help file
HELP_FILE =             tkemc.txt

# Initial display setting for position, RELATIVE or MACHINE
POSITION_OFFSET =       RELATIVE

# Initial display setting for position, COMMANDED or ACTUAL
POSITION_FEEDBACK =     ACTUAL

# Highest value that will be allowed for feed override, 1.0 = 100%
MAX_FEED_OVERRIDE =     1.2

# Lowest value that will be allowed for spindle speed override, 1.0 = 100%
MIN_SPINDLE_OVERRIDE =     0.6

# Highest value that will be allowed for spindle speed override, 1.0 = 100%
MAX_SPINDLE_OVERRIDE =     1.2


# Prefix to be used
PROGRAM_PREFIX = /home/al/emc2/nc_files

# Introductory graphic
INTRO_GRAPHIC = emc2.gif
INTRO_TIME = 5

# Task controller section -----------------------------------------------------
[TASK]

# Name of task controller program, e.g., bridgeporttask
TASK =           milltask

# Cycle time, in seconds, that task controller will sleep between polls
CYCLE_TIME =            0.010

# Part program interpreter section --------------------------------------------
[RS274NGC]

# File containing interpreter variables
PARAMETER_FILE =        stepper.var

# Motion control section ------------------------------------------------------
[EMCMOT]

EMCMOT =              motmod

# Key for real OS shared memory, e.g., for simulated motion
SHMEM_KEY =             111

# Timeout for comm to emcmot, in seconds
COMM_TIMEOUT =          1.0

# Interval between tries to emcmot, in seconds
COMM_WAIT =             0.010

# Base task period, in nano-seconds - this is the fastest thread in the machine
BASE_PERIOD =               28000
# Servo task period, in nano-seconds - will be rounded to an integer multiple
#   of BASE_PERIOD
SERVO_PERIOD =               1000000
# Trajectory Planner task period, in nano-seconds - will be rounded to an
#   integer multiple of SERVO_PERIOD
TRAJ_PERIOD =                10000000

# Hardware Abstraction Layer section --------------------------------------------------
[HAL]
HALUI =	                     halui

# The run script first uses halcmd to execute any HALFILE
# files, and then to execute any individual HALCMD commands.
#

# list of hal config files to run through halcmd
# files are executed in the order in which they appear

HALFILE =                    core_stepper.hal
HALFILE =                    standard_pinout.hal
HALFILE =                    halvcp.hal

                
# list of halcmd commands to execute
# commands are executed in the order in which they appear
#HALCMD =                    save neta




# Trajectory planner section --------------------------------------------------
[TRAJ]

AXES =                  3
# COORDINATES =         X Y Z A B C
COORDINATES =           X Y Z 
HOME =                  0 0 0 
LINEAR_UNITS =          inch
ANGULAR_UNITS =         degree
CYCLE_TIME =            0.010
DEFAULT_VELOCITY =      0.167
MAX_VELOCITY =          .65
DEFAULT_ACCELERATION =  4.0
MAX_ACCELERATION =      4.0

# Axes sections ---------------------------------------------------------------
# Changed STEPGEN_DIRHOLD in core_stepper.hal to dirhold period = 2 AL Smart
# First axis
[AXIS_0]

TYPE =                          LINEAR
HOME =                          0.000
STEPGEN_DIRHOLD =               2
MAX_VELOCITY =                  .65
MAX_ACCELERATION =              4.0
STEPGEN_MAXVEL = .7
STEPGEN_MAXACCEL = 3.3
BACKLASH = 0.001
SCALE =                         25000 
OUTPUT_SCALE = 1.000 
MIN_LIMIT =                    -12.0
MAX_LIMIT =                     12.0
FERROR = 0.050
MIN_FERROR = 0.010
HOME_OFFSET =                    0.0
HOME_SEARCH_VEL =                0.0
HOME_LATCH_VEL =                 0.0
HOME_USE_INDEX =                 NO
HOME_IGNORE_LIMITS =             NO

# Second axis
[AXIS_1]

TYPE =                          LINEAR
HOME =                          0.000
STEPGEN_DIRHOLD =               2
MAX_VELOCITY =                  .65
MAX_ACCELERATION =              4.
STEPGEN_MAXVEL = .7
STEPGEN_MAXACCEL = 3.3
BACKLASH = 0.000
SCALE =                         25000
OUTPUT_SCALE = 1.000 
MIN_LIMIT =                     -6.0
MAX_LIMIT =                      6.0
FERROR = 0.050
MIN_FERROR = 0.010
HOME_OFFSET =                    0.0
HOME_SEARCH_VEL =                0.0
HOME_LATCH_VEL =                 0.0
HOME_USE_INDEX =                 NO
HOME_IGNORE_LIMITS =             NO


# Third axis
[AXIS_2]

TYPE =                          LINEAR
HOME =                          0.0
STEPGEN_DIRHOLD =               2
MAX_VELOCITY =                  .65
MAX_ACCELERATION =              4.0
STEPGEN_MAXVEL = .7
STEPGEN_MAXACCEL = 3.3
BACKLASH = 0.000
SCALE =                         25000   
OUTPUT_SCALE = 1.000
MIN_LIMIT =                    -4.75
MAX_LIMIT =                     0.050
FERROR = 0.050
MIN_FERROR = 0.010
HOME_OFFSET =                    0.0
HOME_SEARCH_VEL =                0.0
HOME_LATCH_VEL =                 0.0
HOME_USE_INDEX =                 NO
HOME_IGNORE_LIMITS =             NO

# First axis
[AXIS_A]

# 4th axis config

#TYPE =                          ANGULAR
#HOME =                          0.000
#STEPGEN_DIRHOLD =               2
#MAX_VELOCITY =                  .65
#MAX_ACCELERATION =              20.0
#STEPGEN_MAXVEL = .71
#STEPGEN_MAXACCEL = 21.0
#BACKLASH = 0.000
#SCALE =                          25000 
#OUTPUT_SCALE = 1.000 
#MIN_LIMIT =                     -10.0
#MAX_LIMIT =                     10.0
#FERROR = 0.050
#MIN_FERROR = 0.010
#HOME_OFFSET =                    0.0
#HOME_SEARCH_VEL =                0.0
#HOME_LATCH_VEL =                 0.0
#HOME_USE_INDEX =                 NO
#HOME_IGNORE_LIMITS =             NO



# section for main IO controller parameters -----------------------------------
[EMCIO]

# Name of IO controller program, e.g., io
EMCIO = 		io
TOOL_CHANGE_POSITION = 0 0 0

# cycle time, in seconds
CYCLE_TIME =    0.100

# tool table file
TOOL_TABLE =   index.tbl