On Thu, 2007-09-13 at 10:16 -0400, John Kasunich wrote:
> Klemen Dovrtel wrote:
> > Hello,
> > 
> > I also have a 4 axis hot wire cnc machine, and i have
> > the same problem as Ryan. I successfully set the
> > machine to xyza axes and it works fine, but I would
> > rudder have the correct setup xyuv. I set the .ini
> > files as described here, but i still get some errors. 
> > 
> > What version/release of EMC Ryan had? There was a
> > discussion at emc mirc channel, that emc release 1.7
> > doesn't support xyuv setup and emc release 2.x (which
> > can be downloaded from cvs) will.
> 
> Close.
> 
> The current release is "2.1.7", which does not have UVW.
> The latest version in CVS is "pre-2.2.0", which does have UVW.
> The next release will be "2.2.0", and will have UVW.

Yes, once I checked pre-2.2 out of CVS I managed to get it working
pretty quickly.  You will get an error message when Axis starts up
because the default .ngc file it loads uses xyz, and you will not have a
z axis, but that is not really a significant issue.

My config files for the foam cutter are attached.  I am using a HobbyCNC
stepper driver, and the config files are set up for mm with my 200
step/rev steppers driving 18tpi threaded rod.

Ryan

# core HAL config file for steppers

# first load the core RT modules that will be needed
# kinematics
loadrt trivkins
# motion controller, get name and thread periods from ini file
loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD 
servo_period_nsec=[EMCMOT]SERVO_PERIOD traj_period_nsec=[EMCMOT]TRAJ_PERIOD 
key=[EMCMOT]SHMEM_KEY num_joints=[TRAJ]AXES
# stepper module, three step generators, all three using step/dir
loadrt stepgen step_type=0,0,0,0

# hook functions to base thread (high speed thread for step generation)
addf stepgen.make-pulses base-thread

# hook functions to servo thread
addf stepgen.capture-position servo-thread
addf motion-command-handler servo-thread
addf motion-controller servo-thread
addf stepgen.update-freq servo-thread

# connect position commands from motion module to step generator
newsig Xpos-cmd float
linksp Xpos-cmd <= axis.0.motor-pos-cmd
linksp Xpos-cmd => stepgen.0.position-cmd
newsig Ypos-cmd float
linksp Ypos-cmd <= axis.1.motor-pos-cmd
linksp Ypos-cmd => stepgen.1.position-cmd
newsig Upos-cmd float
linksp Upos-cmd <= axis.6.motor-pos-cmd
linksp Upos-cmd => stepgen.2.position-cmd
newsig Vpos-cmd float
linksp Vpos-cmd <= axis.7.motor-pos-cmd
linksp Vpos-cmd => stepgen.3.position-cmd

# connect position feedback from step generators
# to motion module
newsig Xpos-fb float
linksp Xpos-fb <= stepgen.0.position-fb
linksp Xpos-fb => axis.0.motor-pos-fb
newsig Ypos-fb float
linksp Ypos-fb <= stepgen.1.position-fb
linksp Ypos-fb => axis.1.motor-pos-fb
newsig Upos-fb float
linksp Upos-fb <= stepgen.2.position-fb
linksp Upos-fb => axis.6.motor-pos-fb
newsig Vpos-fb float
linksp Vpos-fb <= stepgen.3.position-fb
linksp Vpos-fb => axis.7.motor-pos-fb

# connect enable signals for step generators
newsig Xen bit
linksp Xen <= axis.0.amp-enable-out
linksp Xen => stepgen.0.enable
newsig Yen bit
linksp Yen <= axis.1.amp-enable-out
linksp Yen => stepgen.1.enable
newsig Uen bit
linksp Uen <= axis.6.amp-enable-out
linksp Uen => stepgen.2.enable
newsig Ven bit
linksp Ven <= axis.7.amp-enable-out
linksp Ven => stepgen.3.enable

# connect signals to step pulse generator outputs
newsig Xstep bit
newsig Xdir  bit
newsig Ystep bit
newsig Ydir  bit
newsig Ustep bit
newsig Udir  bit
newsig Vstep bit
newsig Vdir  bit

linkps stepgen.0.step Xstep
linkps stepgen.0.dir  Xdir
linkps stepgen.1.step Ystep
linkps stepgen.1.dir  Ydir
linkps stepgen.2.step Ustep
linkps stepgen.2.dir  Udir
linkps stepgen.3.step Vstep
linkps stepgen.3.dir  Vdir

# set stepgen module scaling - get values from ini file
setp stepgen.0.position-scale [AXIS_0]INPUT_SCALE
setp stepgen.1.position-scale [AXIS_1]INPUT_SCALE
setp stepgen.2.position-scale [AXIS_6]INPUT_SCALE
setp stepgen.3.position-scale [AXIS_7]INPUT_SCALE

# set stepgen module velocity limits - get values from ini file
setp stepgen.0.maxvel [AXIS_0]STEPGEN_MAXVEL
setp stepgen.1.maxvel [AXIS_1]STEPGEN_MAXVEL
setp stepgen.2.maxvel [AXIS_6]STEPGEN_MAXVEL
setp stepgen.3.maxvel [AXIS_7]STEPGEN_MAXVEL

# set stepgen module accel limits - get values from ini file
setp stepgen.0.maxaccel [AXIS_0]STEPGEN_MAXACCEL
setp stepgen.1.maxaccel [AXIS_1]STEPGEN_MAXACCEL
setp stepgen.2.maxaccel [AXIS_6]STEPGEN_MAXACCEL
setp stepgen.3.maxaccel [AXIS_7]STEPGEN_MAXACCEL
# EMC controller parameters for generic controller. Make these what you need
# for your system.

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

# Settings with a + at the front of the comment are likely needed to get
# changed by the user.
# Settings with a - at the front are highly unneeded to be changed
###############################################################################
# General section
###############################################################################
[EMC]

#- Version of this INI file
VERSION =               $Revision: 1.15 $

#+ Name of machine, for use with display, etc.
MACHINE =               EMC-HAL-STEP-MM

#- 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 = 10
# DEBUG =               0x00000007
# DEBUG =               0x7FFFFFFF

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

#+ Name of display program, e.g., xemc
DISPLAY =              axis
# DISPLAY =              usrmot
# DISPLAY =              mini
# DISPLAY =             tkemc
# Cycle time, in seconds, that display will sleep between polls
CYCLE_TIME =            0.200

#- 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 =     4.0

#- Prefix to be used
PROGRAM_PREFIX = ../../ncfiles/

#- Introductory graphic
INTRO_GRAPHIC =         emc2.gif
INTRO_TIME =            1


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

# Name of task controller program, e.g., milltask
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]

#- Name of the motion controller to use (only one exists for nontrivkins)
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 nanosecs - this is the fastest thread in the machine
BASE_PERIOD =                50000
#- Servo task period, in nanosecs - will be rounded to an int multiple of 
BASE_PERIOD
SERVO_PERIOD =               1000000
#- Trajectory Planner task period, in nanosecs - will be rounded to an
#   integer multiple of SERVO_PERIOD
TRAJ_PERIOD =                10000000

###############################################################################
# Hardware Abstraction Layer section
###############################################################################
[HAL]

# 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_foam_stepper.hal
#HALFILE =                    xylotex_pinout.hal
HALFILE =                    foam_pinout.hal


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

###############################################################################
# Trajectory planner section
###############################################################################
[TRAJ]
#+ machine specific settings
AXES =                  8
# COORDINATES =         X Y Z A B C
COORDINATES =           X Y U V
HOME =                  0 0 0 0
LINEAR_UNITS =          mm
ANGULAR_UNITS =         degree
CYCLE_TIME =            0.010
DEFAULT_VELOCITY =      3.0
MAX_VELOCITY =          10
DEFAULT_ACCELERATION =  30.0
MAX_ACCELERATION =      50.0

###############################################################################
# Axes sections
###############################################################################

#+ First axis
[AXIS_0]

TYPE =                          LINEAR
HOME =                          0.000
MAX_VELOCITY =                  4
# NOTE:  the step generator module applies its own limits to
# acceleration and velocity.  We have discovered that it needs
# to have a little "headroom" over the accel by the trajectory
# planner, otherwise it can fall slightly behind during accel
# and later overshoot as it catches up.  In the long term we
# hope to come up with a clean fix for this problem.  In the
# meantime, please set STEPGEN_MAXACCEL below to a few percent
# higher than the regular acceleration limit MAX_ACCELERATION
MAX_ACCELERATION =              30.0
STEPGEN_MAXVEL =                8.0
STEPGEN_MAXACCEL =              35.0
BACKLASH = 0.000
# for 1/2 steps
#INPUT_SCALE =                   255.118110236
# for 1/4 steps
#INPUT_SCALE =                   510.236220472
# for 1/8 steps
INPUT_SCALE =                   1020.472440945
OUTPUT_SCALE = 1.000
MIN_LIMIT =                     -1000.0
MAX_LIMIT =                     1000.0
FERROR = 1.270
MIN_FERROR = 0.254
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
MAX_VELOCITY =                  4
MAX_ACCELERATION =              30.0
STEPGEN_MAXVEL =                8.0
STEPGEN_MAXACCEL =              35.0
BACKLASH = 0.000
# for 1/2 steps
#INPUT_SCALE =                   255.118110236
# for 1/4 steps
#INPUT_SCALE =                   510.236220472
# for 1/8 steps
INPUT_SCALE =                   1020.472440945
OUTPUT_SCALE = 1.000
MIN_LIMIT =                     -1000.0
MAX_LIMIT =                     1000.0
FERROR = 1.270
MIN_FERROR = 0.254
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_6]

TYPE =                          LINEAR
HOME =                          0.0
MAX_VELOCITY =                  4
MAX_ACCELERATION =              30.0
STEPGEN_MAXVEL =                8.0
STEPGEN_MAXACCEL =              35.0
BACKLASH = 0.000
# for 1/2 steps
#INPUT_SCALE =                   255.118110236
# for 1/4 steps
#INPUT_SCALE =                   510.236220472
# for 1/8 steps
INPUT_SCALE =                   1020.472440945
OUTPUT_SCALE = 1.000
MIN_LIMIT =                     -1000.0
MAX_LIMIT =                     1000.0
FERROR = 1.270
MIN_FERROR = 0.254
HOME_OFFSET =                    0.0
HOME_SEARCH_VEL =                0.0
HOME_LATCH_VEL =                 0.0
HOME_USE_INDEX =                 NO
HOME_IGNORE_LIMITS =             NO

#+ Fourth axis
[AXIS_7]

TYPE =                          LINEAR
HOME =                          0.0
MAX_VELOCITY =                  4
MAX_ACCELERATION =              30.0
STEPGEN_MAXVEL =                8.0
STEPGEN_MAXACCEL =              35.0
BACKLASH = 0.000
# for 1/2 steps
#INPUT_SCALE =                   255.118110236
# for 1/4 steps
#INPUT_SCALE =                   510.236220472
# for 1/8 steps
INPUT_SCALE =                   1020.472440945
OUTPUT_SCALE = 1.000
MIN_LIMIT =                     -1000.0
MAX_LIMIT =                     1000.0
FERROR = 1.270
MIN_FERROR = 0.254
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

#- cycle time, in seconds
CYCLE_TIME =            0.100

#- tool table file
TOOL_TABLE =            stepper.tbl

# standard pinout config file for 3-axis steppers
# using a parport for I/O
#
# first load the parport driver
loadrt hal_parport cfg="0x0378"
#
# 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
#
# 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 Ustep => parport.0.pin-07-out
linksp Udir  => parport.0.pin-06-out
linksp Vstep => parport.0.pin-09-out
linksp Vdir  => parport.0.pin-08-out

# create a signal for the estop loopback
net estop-loop iocontrol.0.user-enable-out iocontrol.0.emc-enable-in

# create signals for tool loading loopback
net tool-prep-loop iocontrol.0.tool-prepare iocontrol.0.tool-prepared
net tool-change-loop iocontrol.0.tool-change iocontrol.0.tool-changed

# create a signal for "spindle on"
newsig spindle-on bit
# connect the controller to it
linkps motion.spindle-on => spindle-on
# connect it to a physical pin
linksp spindle-on => parport.0.pin-01-out

###
### 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

# newsig X-pos-limit bit
# linkps parport.0.pin-12-in => X-pos-limit
# linksp X-pos-limit => axis.0.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.
###

# newsig Xlimits bit
# linkps parport.0.pin-13-in => Xlimits
# linksp Xlimits => axis.0.neg-lim-sw-in
# linksp Xlimits => axis.0.pos-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.0.pin-13-in => axis.0.neg-lim-sw-in axis.0.pos-lim-sw-in

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Emc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to