This is my first attempt at merging the hal files and ini files following discussions over the crackling motors.
Using 7i76e.zip from Peter Wallace
I have attatched the Hal and ini file.
All i get is no movement and a joint following error. Could anyone have a look and see if there is anything obvious?.
Not sure if the files will be stripped from the post?

Regards Mark

# These buffer ALL siginal used on the DB25 port
# The board also has a pair of a set of four 0805 size jumper resistors
# these can be used to output either the standard Spindle/Mist/flood and
# input ALIM from the DB25 pins
# or allow BBB SPI singals to be routed to the DB25 connector instead.
# The ALIM RC buffer Capacitor would need to change if this
# option was used.  The LIM Switch input signals are pulled to 3V3 through
# 10K resistors
# then go through a 1K resistor and bypassed with a .22uF cap.   This is
# the cap that should be removed
# if the SPI port (untested option)  is used.  The 4 SPI signals are also
# directly routed
# to six through-holes which include 3V3 and GND.  This singals are
# otherwise Unbuffered and
# go directly to the BBB
# At powerup the LVC541 enabl;e signals are pulled high, disabling the
# drivers until
# the BBB and LinuxCNC pull the enable signal low.
#
########################################


# Launch the setup script to make sure hardware setup looks good
loadusr -w /home/linuxcnc/linuxcnc/configs/Xylotex/setup.sh

# ###################################
# Core EMC/HAL Loads
# ###################################

# kinematics
loadrt trivkins

# motion controller, get name and thread periods from ini file
loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD 
num_joints=[TRAJ]AXES


# load low-level drivers
loadrt hal_bb_gpio output_pins=107,113,119,126,214 
input_pins=109,110,114,118,241
loadrt [PRUCONF](DRIVER) [PRUCONF](CONFIG)
#(JP) Not suing PID loop so comment out
loadrt pid num_chan=3
loadrt limit1 count=2

# ################################################
# THREADS
# ################################################

addf [PRUCONF](DRIVER).capture-position   servo-thread
addf bb_gpio.read                         servo-thread
addf motion-command-handler               servo-thread
addf motion-controller                    servo-thread
#(JP) Not doing PID for temperature sensor for PWM output
addf pid.0.do-pid-calcs                   servo-thread
addf pid.1.do-pid-calcs                   servo-thread
addf pid.2.do-pid-calcs                   servo-thread
addf limit1.0                             servo-thread
addf limit1.1                             servo-thread
addf [PRUCONF](DRIVER).update             servo-thread
addf bb_gpio.write                        servo-thread


# ######################################################
# Axis-of-motion Specific Configs (not the GUI)
# ######################################################

# ################
# X [0] Axis
# ################

# axis enable chain
newsig emcmot.00.enable bit
sets emcmot.00.enable FALSE

net emcmot.00.enable <= axis.0.amp-enable-out
net emcmot.00.enable => [PRUCONF](DRIVER).stepgen.00.enable pid.0.enable

# position command and feedback
net emcmot.00.pos-cmd axis.0.motor-pos-cmd => pid.0.command
net emcmot.00.vel-cmd axis.0.joint-vel-cmd => pid.0.command-deriv
net motor.00.pos-fb <= [PRUCONF](DRIVER).stepgen.00.position-fb 
axis.0.motor-pos-fb pid.0.feedback
net motor.00.command pid.0.output [PRUCONF](DRIVER).stepgen.00.velocity-cmd
setp pid.0.error-previous-target true
setp pid.0.maxerror .0005
#net emcmot.00.pos-cmd => [PRUCONF](DRIVER).stepgen.00.position-cmd

#net motor.00.pos-fb <= [PRUCONF](DRIVER).stepgen.00.position-fb
#net motor.00.pos-fb => axis.0.motor-pos-fb

# timing parameters
setp [PRUCONF](DRIVER).stepgen.00.dirsetup        [AXIS_0]DIRSETUP
setp [PRUCONF](DRIVER).stepgen.00.dirhold         [AXIS_0]DIRHOLD

setp [PRUCONF](DRIVER).stepgen.00.steplen         [AXIS_0]STEPLEN
setp [PRUCONF](DRIVER).stepgen.00.stepspace       [AXIS_0]STEPSPACE

setp [PRUCONF](DRIVER).stepgen.00.position-scale  [AXIS_0]SCALE

setp [PRUCONF](DRIVER).stepgen.00.maxvel          [AXIS_0]STEPGEN_MAX_VEL
setp [PRUCONF](DRIVER).stepgen.00.maxaccel        [AXIS_0]STEPGEN_MAX_ACC

#setp [PRUCONF](DRIVER).stepgen.00.step_type       0
setp [PRUCONF](DRIVER).stepgen.00.steppin         0x4C
setp [PRUCONF](DRIVER).stepgen.00.dirpin          0x4D

# set PID loop gains from inifile
setp pid.0.Pgain [AXIS_0]P
setp pid.0.Igain [AXIS_0]I
setp pid.0.Dgain [AXIS_0]D
setp pid.0.bias [AXIS_0]BIAS
setp pid.0.FF0 [AXIS_0]FF0
setp pid.0.FF1 [AXIS_0]FF1
setp pid.0.FF2 [AXIS_0]FF2
setp pid.0.deadband [AXIS_0]DEADBAND
setp pid.0.maxoutput [AXIS_0]MAX_OUTPUT

#(JP) Add home switch input
net home-xyz bb_gpio.p8.in-10 => axis.0.home-sw-in
setp bb_gpio.p8.in-10.invert 1

# ################
# Y [1] Axis
# ################

# axis enable chain
newsig emcmot.01.enable bit
sets emcmot.01.enable FALSE

net emcmot.01.enable <= axis.1.amp-enable-out
net emcmot.01.enable => [PRUCONF](DRIVER).stepgen.01.enable pid.1.enable

# position command and feedback
net emcmot.01.pos-cmd axis.1.motor-pos-cmd => pid.1.command
net emcmot.01.vel-cmd axis.1.joint-vel-cmd => pid.1.command-deriv
net motor.01.pos-fb <= [PRUCONF](DRIVER).stepgen.01.position-fb 
axis.1.motor-pos-fb pid.1.feedback
net motor.01.command pid.1.output [PRUCONF](DRIVER).stepgen.01.velocity-cmd
setp pid.1.error-previous-target true
setp pid.1.maxerror .0005
#net emcmot.00.pos-cmd => [PRUCONF](DRIVER).stepgen.00.position-cmd

#net motor.00.pos-fb <= [PRUCONF](DRIVER).stepgen.00.position-fb
#net motor.00.pos-fb => axis.0.motor-pos-fb

# timing parameters
setp [PRUCONF](DRIVER).stepgen.01.dirsetup        [AXIS_1]DIRSETUP
setp [PRUCONF](DRIVER).stepgen.01.dirhold         [AXIS_1]DIRHOLD

setp [PRUCONF](DRIVER).stepgen.01.steplen         [AXIS_1]STEPLEN
setp [PRUCONF](DRIVER).stepgen.01.stepspace       [AXIS_1]STEPSPACE

setp [PRUCONF](DRIVER).stepgen.01.position-scale  [AXIS_1]SCALE

setp [PRUCONF](DRIVER).stepgen.01.maxvel          [AXIS_1]STEPGEN_MAX_VEL
setp [PRUCONF](DRIVER).stepgen.01.maxaccel        [AXIS_1]STEPGEN_MAX_ACC

#setp [PRUCONF](DRIVER).stepgen.01.step_type       0
setp [PRUCONF](DRIVER).stepgen.01.steppin         0x4E
setp [PRUCONF](DRIVER).stepgen.01.dirpin          0x4F

# set PID loop gains from inifile
setp pid.1.Pgain [AXIS_1]P
setp pid.1.Igain [AXIS_1]I
setp pid.1.Dgain [AXIS_1]D
setp pid.1.bias [AXIS_1]BIAS
setp pid.1.FF0 [AXIS_1]FF0
setp pid.1.FF1 [AXIS_1]FF1
setp pid.1.FF2 [AXIS_1]FF2
setp pid.1.deadband [AXIS_1]DEADBAND
setp pid.1.maxoutput [AXIS_1]MAX_OUTPUT


#(JP) Add home switch input
net home-xyz  axis.1.home-sw-in

# ################
# Z [2] Axis
# ################

# axis enable chain
newsig emcmot.02.enable bit
sets emcmot.02.enable FALSE

net emcmot.02.enable <= axis.2.amp-enable-out
net emcmot.02.enable => [PRUCONF](DRIVER).stepgen.02.enable pid.2.enable

# position command and feedback
net emcmot.02.pos-cmd axis.2.motor-pos-cmd => pid.2.command
net emcmot.02.vel-cmd axis.2.joint-vel-cmd => pid.2.command-deriv
net motor.02.pos-fb <= [PRUCONF](DRIVER).stepgen.02.position-fb 
axis.2.motor-pos-fb pid.2.feedback
net motor.02.command pid.2.output [PRUCONF](DRIVER).stepgen.02.velocity-cmd
setp pid.2.error-previous-target true
setp pid.2.maxerror .0005
#net emcmot.02.pos-cmd => [PRUCONF](DRIVER).stepgen.02.position-cmd

#net motor.02.pos-fb <= [PRUCONF](DRIVER).stepgen.02.position-fb
#net motor.02.pos-fb => axis.2.motor-pos-fb

# timing parameters
setp [PRUCONF](DRIVER).stepgen.02.dirsetup        [AXIS_2]DIRSETUP
setp [PRUCONF](DRIVER).stepgen.02.dirhold         [AXIS_2]DIRHOLD

setp [PRUCONF](DRIVER).stepgen.02.steplen         [AXIS_2]STEPLEN
setp [PRUCONF](DRIVER).stepgen.02.stepspace       [AXIS_2]STEPSPACE

setp [PRUCONF](DRIVER).stepgen.02.position-scale  [AXIS_2]SCALE

setp [PRUCONF](DRIVER).stepgen.02.maxvel          [AXIS_2]STEPGEN_MAX_VEL
setp [PRUCONF](DRIVER).stepgen.02.maxaccel        [AXIS_2]STEPGEN_MAX_ACC

#setp [PRUCONF](DRIVER).stepgen.02.step_type       0
setp [PRUCONF](DRIVER).stepgen.02.steppin         0x50
setp [PRUCONF](DRIVER).stepgen.02.dirpin          0x51

# set PID loop gains from inifile
setp pid.2.Pgain [AXIS_2]P
setp pid.2.Igain [AXIS_2]I
setp pid.2.Dgain [AXIS_2]D
setp pid.2.bias [AXIS_2]BIAS
setp pid.2.FF0 [AXIS_2]FF0
setp pid.2.FF1 [AXIS_2]FF1
setp pid.2.FF2 [AXIS_2]FF2
setp pid.2.deadband [AXIS_2]DEADBAND
setp pid.2.maxoutput [AXIS_2]MAX_OUTPUT


#(JP) Add home switch input
net home-xyz axis.2.home-sw-in

# ##################################################
# Standard I/O - EStop, Enables, Limit Switches, Etc
# ##################################################

# 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

# Axis enable and IO control enable signals are all on one pin P8-7 which
# goes to DB25-1
# and is used to place the LVC541 drivers on the interface board in active
# (LOW) or unactive (HIGH) state
# All external Inputs and Outputs on external boards
# should have pullups/downs since when the interface board is
# not enabled, it will look dosconnected for all signals

# this pin is output on DB25-1
# it is also used to enable the LVC541 driver/receiver on the interface board
net machine-on bb_gpio.p8.out-07 bb_gpio.p8.out-26 => halui.machine.is-on
setp bb_gpio.p8.out-07.invert 1

# this currently goes to an LED on the interface board
# it is simply a duplicate of the enable signal on DB25-1 right now
setp bb_gpio.p8.out-26.invert 1

# this input signal must be active LOW to allow the system to energize.
# this should be fed through an NC STOP type switch from DB25-1 to DB25-10
#net estop-in bb_gpio.p8.in-09 => iocontrol.0.emc-enable-in
#setp bb_gpio.p8.in-09.invert 1
#newsig test bit
#sets test 1
#net test iocontrol.0.emc-enable-in
net estop-loop iocontrol.0.user-enable-out iocontrol.0.emc-enable-in
#setp iocontrol.0.emc-enable-in true

# This output is on DB25-14 and is currently tied to spindle control (M3/M5)
net Output1 bb_gpio.p8.out-13 => halui.spindle.is-on
#setp bb_gpio.p8.out-13.invert 1

# This output is on DB25-16
net Output2 bb_gpio.p8.out-19 => halui.mist.is-on
setp bb_gpio.p8.out-19.invert 1

# This output is on DB25-17 (M8/M9)
net Output3 bb_gpio.p9.out-14 => halui.flood.is-on
setp bb_gpio.p9.out-14.invert 1



[PRUCONF]
DRIVER=hal_pru_generic
# Altered for upside down pulse on Gecko's
#CONFIG=prucode=/home/linuxcnc/linuxcnc/rtlib/xenomai/pru_generic.bin pru=1 
num_stepgens=4
CONFIG=prucode=/home/linuxcnc/linuxcnc/rtlib/xenomai/pru_generic_fall.bin pru=1 
num_stepgens=3

[EMC]

# Name of machine, for use with display, etc.
MACHINE =               Xylotex

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




[DISPLAY]

#GLADEVCP = shuttlexpress.glade
#EMBED_TAB_NAME = GladeVCP demo
#EMBED_TAB_COMMAND = halcmd loadusr -Wn gladevcp gladevcp -c gladevcp -u 
shuttlexpress.py -x {XID} shuttleexpress.glade

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

EDITOR = mousepad

# Touchy currently won't work without some hardware buttons/jog-wheel
#DISPLAY = touchy

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

# Path to help file
HELP_FILE =             tklinucnc.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

# Prefix to be used
PROGRAM_PREFIX = ~/linuxcnc/nc_files/

# Introductory graphic
INTRO_GRAPHIC =         linuxcnc.gif
INTRO_TIME =            5

# Increments for the JOG section
INCREMENTS = 10 1 0.1 0.01


[FILTER]

PROGRAM_EXTENSION = .png,.gif,.jpg Grayscale Depth Image
PROGRAM_EXTENSION = .py Python Script

png = image-to-gcode
gif = image-to-gcode
jpg = image-to-gcode
py = python


[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




[RS274NGC]

# File containing interpreter variables
PARAMETER_FILE =        pru-stepper.var
RS274NGC_STARTUP_CODE = G00 G17 G21 G40 G49 G64 P0.1 Q0.1 G80 G90

[EMCMOT]

EMCMOT =                motmod

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

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

# Servo task period, in nanoseconds
SERVO_PERIOD =          1000000


[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 =                Xylotex.hal
#HALFILE =              shuttlexpress.hal

# list of halcmd commands to execute
# commands are executed in the order in which they appear
#HALCMD =               save neta
HALUI = halui
#POSTGUI_HALFILE =       Xylotex.postgui.hal


[TRAJ]

AXES =                     3
COORDINATES =              X Y Z 
MAX_ANGULAR_VELOCITY =     45.00
DEFAULT_ANGULAR_VELOCITY = 4.50
LINEAR_UNITS =             mm
ANGULAR_UNITS =            degree
CYCLE_TIME =               0.010
DEFAULT_VELOCITY =         10.0
MAX_LINEAR_VELOCITY =      35.0
NO_FORCE_HOMING =          1

################################################################
[AXIS_0]

#
# Step timing is 40 us steplen + 40 us stepspace
# That gives 80 us step period = 12.5 KHz step freq
#
# Bah, even software stepping can handle that, hm2 doesnt buy you much with
# such slow steppers.
#
# Scale is 200 steps/rev * 5 revs/inch = 1000 steps/inch
#
# This gives a maxvel of 12.5/1 = 12.5 ips
#
TYPE =              LINEAR
MAX_VELOCITY =       35.0
MAX_ACCELERATION =   300.0
# Set Stepgen max 20% higher than the axis
STEPGEN_MAX_VEL =    42.0
STEPGEN_MAX_ACC =    400.0

BACKLASH =           0.000
# scale is 200 steps/rev * 8 mirostep * 10 tpi
SCALE =  1000

MIN_LIMIT =             -999.0
MAX_LIMIT =             999.0

FERROR =     .1
MIN_FERROR = 0.05

HOME =                  0.000
HOME_OFFSET =           0.00
HOME_SEARCH_VEL =       -10
HOME_LATCH_VEL =       0.5
#HOME_USE_INDEX =        YES
#HOME_IGNORE_LIMITS =    YES
HOME_IS_SHARED = 1
HOME_SEQUENCE = 2

# these are in nanoseconds
DIRSETUP   =              1000
DIRHOLD    =              20000
STEPLEN    =              500
STEPSPACE  =              4000

# PID tuning params
DEADBAND =              0
P =                     50
I =                     0
D =                     0
FF0 =                   0
FF1 =                   1
FF2 =                   0
BIAS =                  0
MAX_OUTPUT =            0


##################################
[AXIS_1]

TYPE =              LINEAR
MAX_VELOCITY =       35.0
MAX_ACCELERATION =   300.0
# Set Stepgen max 20% higher than the axis
STEPGEN_MAX_VEL =    42.0
STEPGEN_MAX_ACC =    400.0

BACKLASH =           0.000

SCALE =  -500

MIN_LIMIT =             -999.0
MAX_LIMIT =             999.0

FERROR =     0.1
MIN_FERROR = 0.05

HOME =                  0.000
HOME_OFFSET =           0.00
HOME_SEARCH_VEL =       10
HOME_LATCH_VEL =        -0.5
#HOME_USE_INDEX =        YES
#HOME_IGNORE_LIMITS =    YES
HOME_IS_SHARED = 1
HOME_SEQUENCE = 1

# these are in nanoseconds
DIRSETUP   =              1000
DIRHOLD    =              20000
STEPLEN    =              500
STEPSPACE  =              4000

# PID tuning params
DEADBAND =              0
P =                     50
I =                     0
D =                     0
FF0 =                   0
FF1 =                   1
FF2 =                   0
BIAS =                  0
MAX_OUTPUT =            0


#####################################
[AXIS_2]

TYPE =              LINEAR
MAX_VELOCITY =      35.0
MAX_ACCELERATION =  300.0
# Set Stepgen max 20% higher than the axis
STEPGEN_MAX_VEL =    42.0
STEPGEN_MAX_ACC =    400.0

BACKLASH =           0.000

SCALE = 500

MIN_LIMIT =            -999.00
MAX_LIMIT =            999.0

FERROR =     .1
MIN_FERROR = 0.05

HOME =                  0.000
HOME_OFFSET =           0.00
HOME_SEARCH_VEL =       10
HOME_LATCH_VEL =        -0.5
#HOME_USE_INDEX =        YES
#HOME_IGNORE_LIMITS =    YES
HOME_IS_SHARED = 1
HOME_SEQUENCE = 0

# these are in nanoseconds
DIRSETUP   =              1000
DIRHOLD    =              20000
STEPLEN    =              500
STEPSPACE  =              4000

# PID tuning params
DEADBAND =              0
P =                     50
I =                     0
D =                     0
FF0 =                   0
FF1 =                   1
FF2 =                   0
BIAS =                  0
MAX_OUTPUT =            0


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

[EMCIO]

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

# cycle time, in seconds
CYCLE_TIME =            0.100

# tool table file
TOOL_TABLE =            tool.tbl

------------------------------------------------------------------------------
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis & security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
_______________________________________________
Emc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to