On 14/01/12 18:57, Kent A. Reed wrote:
> Bob:
> 
> Maybe I'm misreading this but you seem to be saying that the parallel 
> port works fine with EMC2 ("ptest.hal & ptest.xml work fine").
> 
> If that is so, then the problem lies in your (new) configuration. You 
> can nail this diagnosis by loading Halscope and looking at the signals 
> you are sending to the parport. If they do toggle as you run G-Code then 
> I don't understand what's going on. If they don't, you have some 
> detective work to do in your hal and ini files.

Hi Kent,

Halscope shows that there is no signal on the parport pin, but that
zstep (and stepgen) are producing output.
This seems to mean that my hal is wrong.
There have been some syntactical changes between my somewhat dated
original and the newest EMC2, maybe I have translated wrongly.
I have read the manuals and tried to see what is wrong, but cannot :-(

Maybe some kind soul could cast a quick eye over the following and say
"What kind of idiot wrote this then?" - or similar maybe with a pointer
to what is wrong.

Thanks,

Bob


###############################################################################
Here is the hal section of my ini:
###############################################################################
# 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_stepper.hal
#HALFILE =                      xylotex_pinout.hal
HALFILE =                       OptimumBF20L.hal

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

###############################################################################

Here is my core_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 num_joints=[TRAJ]AXES
# stepper module, three step generators, all three using step/dir
loadrt stepgen step_type=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
net Xpos-cmd axis.0.motor-pos-cmd => stepgen.0.position-cmd
net Ypos-cmd axis.1.motor-pos-cmd => stepgen.1.position-cmd
net Zpos-cmd axis.2.motor-pos-cmd => stepgen.2.position-cmd

# connect position feedback from step generators
# to motion module
net Xpos-fb stepgen.0.position-fb => axis.0.motor-pos-fb
net Ypos-fb stepgen.1.position-fb => axis.1.motor-pos-fb
net Zpos-fb stepgen.2.position-fb => axis.2.motor-pos-fb

# connect enable signals for step generators
net Xen axis.0.amp-enable-out => stepgen.0.enable
net Yen axis.1.amp-enable-out => stepgen.1.enable
net Zen axis.2.amp-enable-out => stepgen.2.enable

# connect signals to step pulse generator outputs
net Xstep <= stepgen.0.step
net Xdir  <= stepgen.0.dir
net Ystep <= stepgen.1.step
net Ydir  <= stepgen.1.dir
net Zstep <= stepgen.2.step
net Zdir  <= stepgen.2.dir

# set stepgen module scaling - get values from ini file
setp stepgen.0.position-scale [AXIS_0]SCALE
setp stepgen.1.position-scale [AXIS_1]SCALE
setp stepgen.2.position-scale [AXIS_2]SCALE

# 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

###############################################################################

Here is my OptimumBF20L.hal

loadrt probe_parport
loadrt hal_parport cfg="0x378"
setp parport.0.reset-time 5000

addf parport.0.read base-thread
addf parport.0.write base-thread
addf parport.0.reset base-thread

net spindle-cw <= motion.spindle-forward
net coolant-mist <= iocontrol.0.coolant-mist

setp parport.0.pin-01-out-invert 1
net spindle-cw => parport.0.pin-01-out
net xdir => parport.0.pin-02-out
net xstep => parport.0.pin-03-out
setp parport.0.pin-03-out-reset 1
net ydir => parport.0.pin-04-out
net ystep => parport.0.pin-05-out
setp parport.0.pin-05-out-reset 1
setp parport.0.pin-06-out-invert 1
net zdir => parport.0.pin-06-out
net zstep => parport.0.pin-07-out
setp parport.0.pin-07-out-reset 1
setp parport.0.pin-14-out-invert 1
net coolant-mist => parport.0.pin-14-out

#net estop-ext <= parport.0.pin-10-in-not
net estop-ext <= parport.0.pin-10-in
net min-home-x <= parport.0.pin-11-in-not
net max-home-y <= parport.0.pin-12-in-not
net max-home-z <= parport.0.pin-13-in-not

setp stepgen.0.position-scale [AXIS_0]SCALE
setp stepgen.0.steplen 1
setp stepgen.0.stepspace 0
setp stepgen.0.dirhold 35000
setp stepgen.0.dirsetup 35000
setp stepgen.0.maxaccel [AXIS_0]STEPGEN_MAXACCEL
net min-home-x => axis.0.home-sw-in
net min-home-x => axis.0.neg-lim-sw-in

setp stepgen.1.position-scale [AXIS_1]SCALE
setp stepgen.1.steplen 1
setp stepgen.1.stepspace 0
setp stepgen.1.dirhold 35000
setp stepgen.1.dirsetup 35000
setp stepgen.1.maxaccel [AXIS_1]STEPGEN_MAXACCEL
net max-home-y => axis.1.home-sw-in
net max-home-y => axis.1.pos-lim-sw-in

setp stepgen.2.position-scale [AXIS_2]SCALE
setp stepgen.2.steplen 1
setp stepgen.2.stepspace 0
setp stepgen.2.dirhold 35000
setp stepgen.2.dirsetup 35000
setp stepgen.2.maxaccel [AXIS_2]STEPGEN_MAXACCEL
net max-home-z => axis.2.home-sw-in
net max-home-z => axis.2.pos-lim-sw-in

net estop-out <= iocontrol.0.user-enable-out
net estop-ext => iocontrol.0.emc-enable-in

loadusr -W hal_manualtoolchange
net tool-change iocontrol.0.tool-change => hal_manualtoolchange.change
net tool-changed iocontrol.0.tool-changed <= hal_manualtoolchange.changed
net tool-number iocontrol.0.tool-prep-number => hal_manualtoolchange.number
net tool-prepare-loopback iocontrol.0.tool-prepare =>
iocontrol.0.tool-prepared
-- 
The Sun is out, the sky is blue, it's time to drive the MR2.

------------------------------------------------------------------------------
RSA(R) Conference 2012
Mar 27 - Feb 2
Save $400 by Jan. 27
Register now!
http://p.sf.net/sfu/rsa-sfdev2dev2
_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to