In emc2 after altering core_stepper.hal to:

stepper.hal

# 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
# stepper module, three step generators, all three using step/dir
loadrt stepgen step_type=2,2,2

# 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 Zpos-cmd float
linksp Zpos-cmd <= axis.2.motor-pos-cmd
linksp Zpos-cmd => stepgen.2.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 Zpos-fb float
linksp Zpos-fb <= stepgen.2.position-fb
linksp Zpos-fb => axis.2.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 Zen bit
linksp Zen <= axis.2.amp-enable-out
linksp Zen => stepgen.2.enable


# connect signals to step pulse generator outputs
newsig Xstep bit
newsig Xdir  bit
newsig Ystep bit
newsig Ydir  bit
newsig Zstep bit
newsig Zdir  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 Zstep
linkps stepgen.2.dir  Zdir

# 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_2]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_2]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_2]STEPGEN_MAXACCEL

and standard_pinout.hal to:

pinout.hal

# standard pinout config file for 3-axis steppers
# using a parport for I/O
#
# first load the parport driver
loadrt hal_parport cfg="0x0378" "0xdff0"
#
# next connect the parport functions to threads
# read inputs first
addf parport.0.read base-thread 1
addf parport.1.read base-thread 1
# write outputs last
addf parport.0.write base-thread -1
addf parport.1.write base-thread -1
#
# finally connect physical pins to the signals
linksp X_phaseA => parport.0.pin-09-out
linksp X_phaseA => parport.0.pin-08-out
setp parport.0.pin-08-out-invert TRUE
linksp X_phaseB => parport.0.pin-07-out
linksp X_phaseB => parport.0.pin-06-out
setp parport.0.pin-06-out-invert TRUE
linksp Y_phaseA => parport.0.pin-05-out
linksp Y_phaseA => parport.0.pin-17-out
setp parport.0.pin-17-out-invert TRUE
linksp Y_phaseB => parport.0.pin-04-out
linksp Y_phaseB => parport.0.pin-16-out
setp parport.0.pin-16-out-invert TRUE
linksp Z_phaseA => parport.1.pin-09-out
linksp Z_phaseA => parport.1.pin-08-out
setp parport.1.pin-08-out-invert TRUE
linksp Z_phaseB => parport.1.pin-07-out
linksp Z_phaseB => parport.1.pin-06-out-invert

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

# create signals for tool loading loopback
linkpp iocontrol.0.tool-prepare iocontrol.0.tool-prepared
linkpp 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-09-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-03-out
linksp Yen => parport.0.pin-02-out
linksp Zen => parport.1.pin-03-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.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.pin-13-in => axis.0.neg-lim-sw-in axis.0.pos-lim-sw-in

I get the following emc2 error:

Print file information:
RUN_IN_PLACE=no
EMC2_DIR=
EMC2_BIN_DIR=/usr/bin
EMC2_TCL_DIR=/usr/share/emc/tcl
EMC2_SCRIPT_DIR=
EMC2_RTLIB_DIR=/usr/realtime-2.6.15-magma/modules/emc2
EMC2_CONFIG_DIR=
EMC2_LANG_DIR=/usr/share/emc/tcl/msgs
INIVAR=/usr/bin/inivar
HALCMD=/usr/bin/halcmd
EMC2_EMCSH=/usr/bin/emcsh
EMC2_IOSH=/usr/bin/iosh
EMC2 - 2.1.0
Machine configuration directory is '/home/jack/emc2/configs/stepper'
Machine configuration file is 'test.ini'
INIFILE=/home/jack/emc2/configs/stepper/test.ini
PARAMETER_FILE=stepper.var
EMCMOT=motmod
EMCIO=io
TASK=milltask
HALUI=
DISPLAY=tkemc
NML_FILE=emc.nml
Starting EMC2...
Starting EMC2 server program: emcsvr
Loading Real Time OS, RTAPI, and HAL_LIB modules
Starting EMC2 IO program: io
Running HAL config file /home/jack/emc2/configs/stepper/stepper.hal
HAL: ERROR: pin 'stepgen.0.step' not found
HAL:62: link failed
HAL config file /home/jack/emc2/configs/stepper/stepper.hal failed.
Shutting down and cleaning up EMC2...
Killing task emcsvr, PID=2631
Removing HAL_LIB, RTAPI, and Real Time OS modules
Cleanup done

Big Snip

[22.719459] USB Universal Host Controller Interface driver v2.3
[183775.112454] MOTION: setting Traj cycle time to 10000000 nsecs
[183775.112462] MOTION: setting Servo cycle time to 1000000 nsecs
[183775.112467] MOTION: init_threads() complete
[183775.112475] MOTION: init_module() complete
[183775.121375] STEPGEN: installed 3 step pulse generators
[183775.237549] MOTION: cleanup_module() started.
[183775.237556] HAL: threads stopped
[183775.237764] MOTION: cleanup_module() finished.
[183775.436195] RTAPI: WARNING: tried to delete task 02 while running
[183775.436211] RTAPI: WARNING: tried to delete task 01 while running
[183775.442900] RTAPI: Exiting
[183775.442950] RTAPI: Exit complete
[183775.449755] RTAI[math]: unloaded.
[183775.558123] RTAI[malloc]: vfreed extent d0b10000, size 2097152.
[183775.558406] RTAI[malloc]: unloaded.
[183775.658094] RTAI[sched_lxrt]: unloaded (forced hard/soft/hard transitions:
traps 0, syscalls 0).
[183775.663378] I-pipe: Domain RTAI unregistered.
[183775.663392] RTAI[hal]: unmounted.

Debug file information:
Can not find -sec HAL -var HALUI -num 1
Stopping realtime threads
Unloading hal components
2631
  PID TTY      STAT   TIME COMMAND


Can you see what the problem may be?

Also I want to make one of the parallel port output pins a 1.  What would the
commands to do this be?

Jack Ensor
Delete | Reply | Reply to All | Forward | Redirect | Blacklist | Whitelist |
Message Source | Save as | Print        Back to sent-mail   Previous Message
Move | Copy 



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Emc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to