emc load error new configuration

More
10 May 2011 14:45 #9695 by fabworx
im trying to get emc up and running for the first time im hoping someone can take a look at my hal and ini file and tell me what im doing wrong. here is the error message im getting when i try to load emc.

Print file information:
RUN_IN_PLACE=no
EMC2_DIR=
EMC2_BIN_DIR=/usr/bin
EMC2_TCL_DIR=/usr/lib/tcltk/emc2
EMC2_SCRIPT_DIR=
EMC2_RTLIB_DIR=/usr/realtime-2.6.32-122-rtai/modules/emc2
EMC2_CONFIG_DIR=
EMC2_LANG_DIR=/usr/share/emc/tcl/msgs
INIVAR=inivar
HALCMD=halcmd
EMC2_EMCSH=/usr/bin/wish8.5
EMC2 - 2.5.0-pre1-285-g6d4247d
Machine configuration directory is '/home/denny/emc2/configs/hm2-servo'
Machine configuration file is '5i20.ini'
INIFILE=/home/denny/emc2/configs/hm2-servo/5i20.ini
PARAMETER_FILE=hm2-servo.var
EMCMOT=motmod
EMCIO=io
TASK=milltask
HALUI=halui
DISPLAY=axis
NML_FILE=
Starting EMC2...
Starting EMC2 server program: emcsvr
Loading Real Time OS, RTAPI, and HAL_LIB modules
Starting EMC2 IO program: io
Starting HAL User Interface program: halui
Shutting down and cleaning up EMC2...
Killing task emcsvr, PID=1691
Removing HAL_LIB, RTAPI, and Real Time OS modules
Removing NML shared memory segments
Cleanup done

Debug file information:
hm2-servo.hal:259: Pin 'spindle.4.motor-pos-fb' does not exist
1691
PID TTY STAT TIME COMMAND
Stopping realtime threads
Unloading hal components

Kernel message information:
[ 1195.689618] I-pipe: Domain RTAI registered.
[ 1195.689631] RTAI[hal]: <3.8.1> mounted over IPIPE-NOTHREADS 2.6-03.
[ 1195.689639] RTAI[hal]: compiled with gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5) .
[ 1195.689720] RTAI[hal]: mounted (IPIPE-NOTHREADS, IMMEDIATE (INTERNAL IRQs DISPATCHED), ISOL_CPUS_MASK: 0).
[ 1195.689726] PIPELINE layers:
[ 1195.689732] f81bbe20 9ac15d93 RTAI 200
[ 1195.689737] c085cb20 0 Linux 100
[ 1195.717961] RTAI[malloc]: global heap size = 2097152 bytes, <BSD>.
[ 1195.718362] RTAI[sched]: IMMEDIATE, MP, USER/KERNEL SPACE: <with RTAI OWN KTASKs>, kstacks pool size = 524288 bytes.
[ 1195.718371] RTAI[sched]: hard timer type/freq = APIC/12472410(Hz); default timing: periodic; linear timed lists.
[ 1195.718377] RTAI[sched]: Linux timer freq = 250 (Hz), TimeBase freq = 2794143000 hz.
[ 1195.718382] RTAI[sched]: timer setup = 999 ns, resched latency = 2944 ns.
[ 1195.718481] RTAI[usi]: enabled.
[ 1195.797103] RTAI[math]: loaded.
[ 1195.904723] hm2: loading Mesa HostMot2 driver version 0.15
[ 1195.910229] hm2_pci: loading Mesa AnyIO HostMot2 driver version 0.6
[ 1195.910277] hm2_pci: discovered 5i20 at 0000:03:02.0
[ 1195.910369] hm2_5i20.0: firmware: requesting hm2/5i20/SV12_2X7I48_72.BIT
[ 1196.029346] hm2/hm2_5i20.0: 72 I/O Pins used:
[ 1196.029355] hm2/hm2_5i20.0: IO Pin 000 (P2-01): PWMGen #0, pin Not-Enable (Output)
[ 1196.029361] hm2/hm2_5i20.0: IO Pin 001 (P2-03): Muxed Encoder #0, pin Muxed A (Input)
[ 1196.029367] hm2/hm2_5i20.0: IO Pin 002 (P2-05): Muxed Encoder #0, pin Muxed B (Input)
[ 1196.029372] hm2/hm2_5i20.0: IO Pin 003 (P2-07): Muxed Encoder #0, pin Muxed Index (Input)
[ 1196.029378] hm2/hm2_5i20.0: IO Pin 004 (P2-09): Muxed Encoder #1, pin Muxed A (Input)
[ 1196.029384] hm2/hm2_5i20.0: IO Pin 005 (P2-11): Muxed Encoder #1, pin Muxed B (Input)
[ 1196.029389] hm2/hm2_5i20.0: IO Pin 006 (P2-13): Muxed Encoder #1, pin Muxed Index (Input)
[ 1196.029395] hm2/hm2_5i20.0: IO Pin 007 (P2-15): Muxed Encoder #2, pin Muxed A (Input)
[ 1196.029400] hm2/hm2_5i20.0: IO Pin 008 (P2-17): Muxed Encoder #2, pin Muxed B (Input)
[ 1196.029406] hm2/hm2_5i20.0: IO Pin 009 (P2-19): Muxed Encoder #2, pin Muxed Index (Input)
[ 1196.029412] hm2/hm2_5i20.0: IO Pin 010 (P2-21): Muxed Encoder Select #0, pin Mux Select 0 (Output)
[ 1196.029418] hm2/hm2_5i20.0: IO Pin 011 (P2-23): PWMGen #0, pin Out0 (PWM or Up) (Output)
[ 1196.029423] hm2/hm2_5i20.0: IO Pin 012 (P2-25): PWMGen #0, pin Out1 (Dir or Down) (Output)
[ 1196.029429] hm2/hm2_5i20.0: IO Pin 013 (P2-27): PWMGen #1, pin Out0 (PWM or Up) (Output)
[ 1196.029435] hm2/hm2_5i20.0: IO Pin 014 (P2-29): PWMGen #1, pin Out1 (Dir or Down) (Output)
[ 1196.029440] hm2/hm2_5i20.0: IO Pin 015 (P2-31): PWMGen #2, pin Out0 (PWM or Up) (Output)
[ 1196.029446] hm2/hm2_5i20.0: IO Pin 016 (P2-33): PWMGen #2, pin Out1 (Dir or Down) (Output)
[ 1196.029452] hm2/hm2_5i20.0: IO Pin 017 (P2-35): PWMGen #3, pin Out0 (PWM or Up) (Output)
[ 1196.029457] hm2/hm2_5i20.0: IO Pin 018 (P2-37): PWMGen #3, pin Out1 (Dir or Down) (Output)
[ 1196.029463] hm2/hm2_5i20.0: IO Pin 019 (P2-39): PWMGen #4, pin Out0 (PWM or Up) (Output)
[ 1196.029469] hm2/hm2_5i20.0: IO Pin 020 (P2-41): PWMGen #4, pin Out1 (Dir or Down) (Output)
[ 1196.029474] hm2/hm2_5i20.0: IO Pin 021 (P2-43): PWMGen #5, pin Out0 (PWM or Up) (Output)
[ 1196.029480] hm2/hm2_5i20.0: IO Pin 022 (P2-45): PWMGen #5, pin Out1 (Dir or Down) (Output)
[ 1196.029486] hm2/hm2_5i20.0: IO Pin 023 (P2-47): PWMGen #0, pin Not-Enable (Output)
[ 1196.029491] hm2/hm2_5i20.0: IO Pin 024 (P3-01): IOPort
[ 1196.029495] hm2/hm2_5i20.0: IO Pin 025 (P3-03): IOPort
[ 1196.029500] hm2/hm2_5i20.0: IO Pin 026 (P3-05): IOPort
[ 1196.029504] hm2/hm2_5i20.0: IO Pin 027 (P3-07): IOPort
[ 1196.029508] hm2/hm2_5i20.0: IO Pin 028 (P3-09): IOPort
[ 1196.029513] hm2/hm2_5i20.0: IO Pin 029 (P3-11): IOPort
[ 1196.029517] hm2/hm2_5i20.0: IO Pin 030 (P3-13): IOPort
[ 1196.029522] hm2/hm2_5i20.0: IO Pin 031 (P3-15): IOPort
[ 1196.029526] hm2/hm2_5i20.0: IO Pin 032 (P3-17): IOPort
[ 1196.029530] hm2/hm2_5i20.0: IO Pin 033 (P3-19): IOPort
[ 1196.029535] hm2/hm2_5i20.0: IO Pin 034 (P3-21): IOPort
[ 1196.029539] hm2/hm2_5i20.0: IO Pin 035 (P3-23): IOPort
[ 1196.029544] hm2/hm2_5i20.0: IO Pin 036 (P3-25): IOPort
[ 1196.029548] hm2/hm2_5i20.0: IO Pin 037 (P3-27): IOPort
[ 1196.029552] hm2/hm2_5i20.0: IO Pin 038 (P3-29): IOPort
[ 1196.029557] hm2/hm2_5i20.0: IO Pin 039 (P3-31): IOPort
[ 1196.029561] hm2/hm2_5i20.0: IO Pin 040 (P3-33): IOPort
[ 1196.029566] hm2/hm2_5i20.0: IO Pin 041 (P3-35): IOPort
[ 1196.029570] hm2/hm2_5i20.0: IO Pin 042 (P3-37): IOPort
[ 1196.029574] hm2/hm2_5i20.0: IO Pin 043 (P3-39): IOPort
[ 1196.029579] hm2/hm2_5i20.0: IO Pin 044 (P3-41): IOPort
[ 1196.029583] hm2/hm2_5i20.0: IO Pin 045 (P3-43): IOPort
[ 1196.029588] hm2/hm2_5i20.0: IO Pin 046 (P3-45): IOPort
[ 1196.029592] hm2/hm2_5i20.0: IO Pin 047 (P3-47): IOPort
[ 1196.029596] hm2/hm2_5i20.0: IO Pin 048 (P4-01): IOPort
[ 1196.029601] hm2/hm2_5i20.0: IO Pin 049 (P4-03): IOPort
[ 1196.029605] hm2/hm2_5i20.0: IO Pin 050 (P4-05): IOPort
[ 1196.029609] hm2/hm2_5i20.0: IO Pin 051 (P4-07): IOPort
[ 1196.029614] hm2/hm2_5i20.0: IO Pin 052 (P4-09): IOPort
[ 1196.029618] hm2/hm2_5i20.0: IO Pin 053 (P4-11): IOPort
[ 1196.029623] hm2/hm2_5i20.0: IO Pin 054 (P4-13): IOPort
[ 1196.029627] hm2/hm2_5i20.0: IO Pin 055 (P4-15): IOPort
[ 1196.029631] hm2/hm2_5i20.0: IO Pin 056 (P4-17): IOPort
[ 1196.029636] hm2/hm2_5i20.0: IO Pin 057 (P4-19): IOPort
[ 1196.029640] hm2/hm2_5i20.0: IO Pin 058 (P4-21): IOPort
[ 1196.029645] hm2/hm2_5i20.0: IO Pin 059 (P4-23): IOPort
[ 1196.029649] hm2/hm2_5i20.0: IO Pin 060 (P4-25): IOPort
[ 1196.029653] hm2/hm2_5i20.0: IO Pin 061 (P4-27): IOPort
[ 1196.029658] hm2/hm2_5i20.0: IO Pin 062 (P4-29): IOPort
[ 1196.029662] hm2/hm2_5i20.0: IO Pin 063 (P4-31): IOPort
[ 1196.029667] hm2/hm2_5i20.0: IO Pin 064 (P4-33): IOPort
[ 1196.029671] hm2/hm2_5i20.0: IO Pin 065 (P4-35): IOPort
[ 1196.029675] hm2/hm2_5i20.0: IO Pin 066 (P4-37): IOPort
[ 1196.029680] hm2/hm2_5i20.0: IO Pin 067 (P4-39): IOPort
[ 1196.029684] hm2/hm2_5i20.0: IO Pin 068 (P4-41): IOPort
[ 1196.029689] hm2/hm2_5i20.0: IO Pin 069 (P4-43): IOPort
[ 1196.029693] hm2/hm2_5i20.0: IO Pin 070 (P4-45): IOPort
[ 1196.029698] hm2/hm2_5i20.0: IO Pin 071 (P4-47): IOPort
[ 1196.029892] hm2/hm2_5i20.0: registered
[ 1196.029897] hm2_5i20.0: initialized AnyIO board at 0000:03:02.0
[ 1196.452759] hm2_5i20.0: dropping AnyIO board at 0000:03:02.0
[ 1196.452765] hm2/hm2_5i20.0: unregistered
[ 1196.452826] hm2_pci: driver unloaded
[ 1196.456835] hm2: unloading
[ 1196.522860] RTAI[math]: unloaded.
[ 1196.563669] SCHED releases registered named ALIEN RTGLBH
[ 1196.592392] RTAI[malloc]: unloaded.
[ 1196.692019] RTAI[sched]: unloaded (forced hard/soft/hard transitions: traps 0, syscalls 0).
[ 1196.696339] I-pipe: Domain RTAI unregistered.
[ 1196.696435] RTAI[hal]: unmounted.

here is my ini

Please Log in or Create an account to join the conversation.

More
10 May 2011 14:47 #9696 by fabworx
[HOSTMOT2]
DRIVER=hm2_pci
BOARD=5i20
CONFIG="firmware=hm2/5i20/SV12_2X7I48_72.BIT num_encoders=5 num_pwmgens=6 num_stepgens=0"




[EMC]

# Name of machine, for use with display, etc.
MACHINE = KASUGA 4 AXIS KNEE MILL

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




[DISPLAY]
DISPLAY = axis
POSITION_OFFSET = RELATIVE
POSITION_FEEDBACK = ACTUAL
MAX_FEED_OVERRIDE = 2.000000
MAX_SPINDLE_OVERRIDE = 1.000000
MIN_SPINDLE_OVERRIDE = 0.500000
INTRO_GRAPHIC = emc2.gif
INTRO_TIME = 5
PROGRAM_PREFIX = /home/denny/emc2/nc_files
PYVCP = custompanel.xml
INCREMENTS = 5mm 1mm .5mm .1mm .05mm .01mm .005mm
POSITION_OFFSET = RELATIVE
POSITION_FEEDBACK = ACTUAL
DEFAULT_LINEAR_VELOCITY = 0.250000
MAX_LINEAR_VELOCITY = 1.000000
MIN_LINEAR_VELOCITY = 0.010000
DEFAULT_ANGULAR_VELOCITY = 0.250000
MAX_ANGULAR_VELOCITY = 1.000000
MIN_ANGULAR_VELOCITY = 0.010000
EDITOR = gedit
GEOMETRY = xyza


[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 = hm2-servo.var




[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 = hm2-servo.hal
HALUI = halui

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

MDI_COMMAND = G0 G53 Z0
MDI_COMMAND = G28
MDI_COMMAND = G92 X0
MDI_COMMAND = G92 Y0
MDI_COMMAND = G92 Z0
MDI_COMMAND = G92.1

[TRAJ]
AXES = 4
COORDINATES = X Y Z A
MAX_ANGULAR_VELOCITY = 1.67
DEFAULT_ANGULAR_VELOCITY = 0.17
LINEAR_UNITS = mm
ANGULAR_UNITS = degree
CYCLE_TIME = 0.010
DEFAULT_VELOCITY = 0.17
MAX_LINEAR_VELOCITY = 1.67




#********************
# Axis X
#********************
[AXIS_0]
TYPE = LINEAR
HOME = 0.0
FERROR = 0.005
MIN_FERROR = 0.0005
MAX_VELOCITY = 1.667
MAX_ACCELERATION = 2.0
P = 1.0
I = 0.0
D = 0.0
FF0 = 0.0
FF1 = 0.0
FF2 = 0.0
BIAS = 0.0
DEADBAND = 0.0
ENCODER_SCALE = 8000.0
INPUT_SCALE = 81920
OUTPUT_SCALE = 1.0
OUTPUT_OFFSET = 0.0
MAX_OUTPUT = 10.0
MIN_LIMIT = -0.01
MAX_LIMIT = 800.0HALUI = halui
HOME_OFFSET = 0.000000
HOME_SEARCH_VEL = 0.833333
HOME_LATCH_VEL = -0.416667
HOME_FINAL_VEL = 0.166667
HOME_USE_INDEX = YES
HOME_SEQUENCE = 1

#********************
# Axis Y
#********************
[AXIS_1]
TYPE = LINEAR
HOME = 0.0
FERROR = 0.005
MIN_FERROR = 0.0005
MAX_VELOCITY = 1.667
MAX_ACCELERATION = 2.0
P = 1.0
I = 0.0
D = 0.0
FF0 = 0.0
FF1 = 0.0
FF2 = 0.0
BIAS = 0.0
DEADBAND = 0.0
ENCODER_SCALE = 8000.0
INPUT_SCALE = 81920
OUTPUT_SCALE = 1.0
OUTPUT_OFFSET = 0.0
MAX_OUTPUT = 10.0
MIN_LIMIT = -0.01
MAX_LIMIT = 412.75
HOME_OFFSET = 0.000000
HOME_SEARCH_VEL = 0.833333
HOME_LATCH_VEL = -0.416667
HOME_FINAL_VEL = 0.016667
HOME_USE_INDEX = YES
HOME_SEQUENCE = 2

#********************
# Axis Z
#********************
[AXIS_2]
TYPE = LINEAR
HOME = 0.0
FERROR = 0.005
MIN_FERROR = 0.0005
MAX_VELOCITY = 1.667
MAX_ACCELERATION = 2.0
P = 1.0
I = 0.0
D = 0.0
FF0 = 0.0
FF1 = 0.0
FF2 = 0.0
BIAS = 0.0
DEADBAND = 0.0
ENCODER_SCALE = 8000.0
INPUT_SCALE = 81920
OUTPUT_SCALE = 1.0
OUTPUT_OFFSET = 0.0
MAX_OUTPUT = 10.0
MIN_LIMIT = -0.01
MAX_LIMIT = 165.0
HOME_OFFSET = 0.000000
HOME_SEARCH_VEL = 0.833333
HOME_LATCH_VEL = -0.416667
HOME_FINAL_VEL = 0.166667
HOME_USE_INDEX = YES
HOME_SEQUENCE = 0

#********************
# Axis A
#********************
[AXIS_3]
TYPE = ANGULAR
HOME = 0.0
FERROR = 0.005
MIN_FERROR = 0.0005
MAX_VELOCITY = 1.667
MAX_ACCELERATION = 2.0
P = 1.0
I = 0.0
D = 0.0
FF0 = 0.0
FF1 = 0.0
FF2 = 0.0
BIAS = 0.0
DEADBAND = 0.0
ENCODER_SCALE = 22.2222
INPUT_SCALE = 81920
OUTPUT_SCALE = 1.0
OUTPUT_OFFSET = 0.0
MAX_OUTPUT = 10.0
MIN_LIMIT = -9999.0
MAX_LIMIT = 9999.0
HOME_OFFSET = 0.000000
HOME_SEARCH_VEL = -0.050000
HOME_LATCH_VEL = -0.016667
HOME_FINAL_VEL = 0.008333
HOME_USE_INDEX = YES
HOME_SEQUENCE = 3

#********************
# Spindle
#********************
[SPINDLE_4]
MAX_VELOCITY = 1.667
MAX_ACCELERATION = 2.0
P = 1.0
I = 0.0
D = 0.0
FF0 = 0.0
FF1 = 0.0
FF2 = 0.0
BIAS = 0.0
DEADBAND = 0.0
ENCODER_SCALE = 8000.0
INPUT_SCALE = 81920
OUTPUT_SCALE = 1.0
OUTPUT_OFFSET = 0.0
MAX_OUTPUT = 10.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



and my hal

# #######################################
#
# HAL file for HostMot2 with 3 servos
#
# Derived from Ted Hyde's original hm2-servo config
#
# Based up work and discussion with Seb & Peter & Jeff
# GNU license references - insert here. www.linuxcnc.org
#
#
# ########################################
# Firmware files are in /lib/firmware/hm2/7i43/
# Must symlink the hostmot2 firmware directory of sanbox to
# /lib/firmware before running EMC2...
# sudo ln -s $HOME/emc2-sandbox/src/hal/drivers/mesa-hostmot2/firmware /lib/firmware/hm2
#
# See also:
# <www.linuxcnc.org/docs/devel/html/man/man...ml#config%20modparam>
# and wiki.linuxcnc.org/cgi-bin/emcinfo.pl?HostMot2
#
# #####################################################################


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

# standard components
loadrt pid num_chan=5

# only the 7i43 needs this, but it doesnt hurt the others
loadrt probe_parport

# hostmot2 driver
# if you have any firmware trouble, enable the debug flags here and see what's going on in the syslog
#loadrt hostmot2 debug_idrom=1 debug_module_descriptors=1 debug_pin_descriptors=1 debug_modules=1
loadrt hostmot2

# load low-level driver
loadrt [HOSTMOT2](DRIVER) config=[HOSTMOT2](CONFIG)

setp hm2_[HOSTMOT2](BOARD).0.pwmgen.pwm_frequency 40000

setp hm2_[HOSTMOT2](BOARD).0.watchdog.timeout_ns 10000000


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

addf hm2_[HOSTMOT2](BOARD).0.read servo-thread

addf motion-command-handler servo-thread
addf motion-controller servo-thread

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 pid.3.do-pid-calcs servo-thread
addf pid.4.do-pid-calcs servo-thread

addf hm2_[HOSTMOT2](BOARD).0.write servo-thread
addf hm2_[HOSTMOT2](BOARD).0.pet_watchdog 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 => pid.0.enable
net emcmot.00.enable => hm2_[HOSTMOT2](BOARD).0.pwmgen.00.enable
net emcmot.00.enable <= axis.0.amp-enable-out

# encoder feedback
setp hm2_[HOSTMOT2](BOARD).0.encoder.00.counter-mode 0
setp hm2_[HOSTMOT2](BOARD).0.encoder.00.filter 1
setp hm2_[HOSTMOT2](BOARD).0.encoder.00.index-invert 0
setp hm2_[HOSTMOT2](BOARD).0.encoder.00.index-mask 0
setp hm2_[HOSTMOT2](BOARD).0.encoder.00.index-mask-invert 0

setp hm2_[HOSTMOT2](BOARD).0.encoder.00.scale [AXIS_0]INPUT_SCALE
net motor.00.pos-fb hm2_[HOSTMOT2](BOARD).0.encoder.00.position => pid.0.feedback
net motor.00.pos-fb => axis.0.motor-pos-fb #push copy back to Axis GUI

# 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

# position command signals
setp hm2_[HOSTMOT2](BOARD).0.pwmgen.00.output-type 2 #pwm up pin1, down on pin2
setp hm2_[HOSTMOT2](BOARD).0.pwmgen.00.scale [AXIS_0]OUTPUT_SCALE

net emcmot.00.pos-cmd axis.0.motor-pos-cmd => pid.0.command
net motor.00.command pid.0.output => hm2_[HOSTMOT2](BOARD).0.pwmgen.00.value


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

# axis enable chain
newsig emcmot.01.enable bit
sets emcmot.01.enable FALSE
net emcmot.01.enable => pid.1.enable
net emcmot.01.enable => hm2_[HOSTMOT2](BOARD).0.pwmgen.01.enable
net emcmot.01.enable <= axis.1.amp-enable-out

# encoder feedback
setp hm2_[HOSTMOT2](BOARD).0.encoder.01.counter-mode 0
setp hm2_[HOSTMOT2](BOARD).0.encoder.01.filter 1
setp hm2_[HOSTMOT2](BOARD).0.encoder.01.index-invert 0
setp hm2_[HOSTMOT2](BOARD).0.encoder.01.index-mask 0
setp hm2_[HOSTMOT2](BOARD).0.encoder.01.index-mask-invert 0

setp hm2_[HOSTMOT2](BOARD).0.encoder.01.scale [AXIS_1]INPUT_SCALE
net motor.01.pos-fb hm2_[HOSTMOT2](BOARD).0.encoder.01.position => pid.1.feedback
net motor.01.pos-fb => axis.1.motor-pos-fb #push copy back to Axis GUI

# 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

# position command signals
setp hm2_[HOSTMOT2](BOARD).0.pwmgen.01.output-type 2 #pwm up pin1, down on pin2
setp hm2_[HOSTMOT2](BOARD).0.pwmgen.01.scale [AXIS_1]OUTPUT_SCALE

net emcmot.01.pos-cmd axis.1.motor-pos-cmd => pid.1.command
net motor.01.command pid.1.output => hm2_[HOSTMOT2](BOARD).0.pwmgen.01.value


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

# axis enable chain
newsig emcmot.02.enable bit
sets emcmot.02.enable FALSE
net emcmot.02.enable => pid.2.enable
net emcmot.02.enable => hm2_[HOSTMOT2](BOARD).0.pwmgen.02.enable
net emcmot.02.enable <= axis.2.amp-enable-out

# encoder feedback
setp hm2_[HOSTMOT2](BOARD).0.encoder.02.counter-mode 0
setp hm2_[HOSTMOT2](BOARD).0.encoder.02.filter 1
setp hm2_[HOSTMOT2](BOARD).0.encoder.02.index-invert 0
setp hm2_[HOSTMOT2](BOARD).0.encoder.02.index-mask 0
setp hm2_[HOSTMOT2](BOARD).0.encoder.02.index-mask-invert 0

setp hm2_[HOSTMOT2](BOARD).0.encoder.02.scale [AXIS_2]INPUT_SCALE
net motor.02.pos-fb hm2_[HOSTMOT2](BOARD).0.encoder.02.position => pid.2.feedback
net motor.02.pos-fb => axis.2.motor-pos-fb #push copy back to Axis GUI

# 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

# position command signals
setp hm2_[HOSTMOT2](BOARD).0.pwmgen.02.output-type 2 #pwm up pin1, down on pin2
setp hm2_[HOSTMOT2](BOARD).0.pwmgen.02.scale [AXIS_2]OUTPUT_SCALE

net emcmot.02.pos-cmd axis.2.motor-pos-cmd => pid.2.command
net motor.02.command pid.2.output => hm2_[HOSTMOT2](BOARD).0.pwmgen.02.value


# ################
# A [3] Axis
# ################

# axis enable chain
newsig emcmot.03.enable bit
sets emcmot.03.enable FALSE
net emcmot.03.enable => pid.3.enable
net emcmot.03.enable => hm2_[HOSTMOT2](BOARD).0.pwmgen.03.enable
net emcmot.03.enable <= axis.3.amp-enable-out

# encoder feedback
setp hm2_[HOSTMOT2](BOARD).0.encoder.03.counter-mode 0
setp hm2_[HOSTMOT2](BOARD).0.encoder.03.filter 1
setp hm2_[HOSTMOT2](BOARD).0.encoder.03.index-invert 0
setp hm2_[HOSTMOT2](BOARD).0.encoder.03.index-mask 0
setp hm2_[HOSTMOT2](BOARD).0.encoder.03.index-mask-invert 0

setp hm2_[HOSTMOT2](BOARD).0.encoder.03.scale [AXIS_3]INPUT_SCALE
net motor.03.pos-fb hm2_[HOSTMOT2](BOARD).0.encoder.03.position => pid.3.feedback
net motor.03.pos-fb => axis.3.motor-pos-fb #push copy back to Axis GUI

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

# position command signals
setp hm2_[HOSTMOT2](BOARD).0.pwmgen.03.output-type 2 #pwm up pin1, down on pin2
setp hm2_[HOSTMOT2](BOARD).0.pwmgen.03.scale [AXIS_3]OUTPUT_SCALE

net emcmot.03.pos-cmd axis.3.motor-pos-cmd => pid.3.command
net motor.03.command pid.3.output => hm2_[HOSTMOT2](BOARD).0.pwmgen.03.value

# ################
# SPINDLE [4]
# ################

# spindle enable chain
newsig emcmot.04.enable bit
sets emcmot.04.enable FALSE
net emcmot.04.enable => pid.4.enable
net emcmot.04.enable => hm2_[HOSTMOT2](BOARD).0.pwmgen.04.enable

# encoder feedback
setp hm2_[HOSTMOT2](BOARD).0.encoder.04.counter-mode 0
setp hm2_[HOSTMOT2](BOARD).0.encoder.04.filter 1
setp hm2_[HOSTMOT2](BOARD).0.encoder.04.index-invert 0
setp hm2_[HOSTMOT2](BOARD).0.encoder.04.index-mask 0
setp hm2_[HOSTMOT2](BOARD).0.encoder.04.index-mask-invert 0

setp hm2_[HOSTMOT2](BOARD).0.encoder.04.scale [SPINDLE_4]INPUT_SCALE
net motor.04.pos-fb hm2_[HOSTMOT2](BOARD).0.encoder.04.position => pid.4.feedback
net motor.04.pos-fb => spindle.4.motor-pos-fb #push copy back to Axis GUI

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

# position command signals
setp hm2_[HOSTMOT2](BOARD).0.pwmgen.04.output-type 2 #pwm up pin1, down on pin2
setp hm2_[HOSTMOT2](BOARD).0.pwmgen.04.scale [SPINDLE_4]OUTPUT_SCALE

net emcmot.04.pos-cmd spindle.4.motor-pos-cmd => pid.4.command
net motor.04.command pid.4.output => hm2_[HOSTMOT2](BOARD).0.pwmgen.04.value

# ##################################################
# Standard I/O Block - EStop, Etc
# ##################################################

# 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


# homing and limits will be on 7i37ta

net home-x <= hm2_[HOSTMOT2](BOARD).01.gpio.01.in
net home-y <= hm2_[HOSTMOT2](BOARD).01.gpio.13.in
net home-z <= hm2_[HOSTMOT2](BOARD).01.gpio.25.in
net home-a <= hm2_[HOSTMOT2](BOARD).01.gpio.03.in
net x-neg-limit => hm2_[HOSTMOT2](BOARD).01.gpio.05.in
net x-pos-limit => hm2_[HOSTMOT2](BOARD).01.gpio.09.in
net y-neg-limit => hm2_[HOSTMOT2](BOARD).01.gpio.17.in
net y-pos-limit => hm2_[HOSTMOT2](BOARD).01.gpio.21.in
net z-neg-limit => hm2_[HOSTMOT2](BOARD).01.gpio.29.in
net z-pos-limit => hm2_[HOSTMOT2](BOARD).01.gpio.31.in

#x, y, z, and a, have home indexing

net x-index-enable hm2_[HOSTMOT2](BOARD).0.encoder.00.index-enable <=> axis.0.index-enable
net y-index-enable hm2_[HOSTMOT2](BOARD).0.encoder.01.index-enable <=> axis.1.index-enable
net z-index-enable hm2_[HOSTMOT2](BOARD).0.encoder.02.index-enable <=> axis.2.index-enable
net a-index-enable hm2_[HOSTMOT2](BOARD).0.encoder.03.index-enable <=> axis.3.index-enable
net spindle-index-enable hm2_[HOSTMOT2](BOARD).0.encoder.04.index-enable <=> spindle.4.index-enable

Please Log in or Create an account to join the conversation.

More
10 May 2011 15:58 #9697 by PCW
the debug message:

hm2-servo.hal:259: Pin 'spindle.4.motor-pos-fb' does not exist

says it all

Note that spindles are not normally run under position control under EMC so the setup of the spindle would be different than a motion axis (typically they are run open by EMC loop, that is no PID loop) You will probably have to look at the HAL manual and some example HAL files to see how spindle speed controls are implemented

Please Log in or Create an account to join the conversation.

Time to create page: 0.081 seconds
Powered by Kunena Forum