Help with Gantry Setup - X Y Z X

More
06 Dec 2010 03:51 #5874 by BWay
I have a CNC router I am setting up using Gecko 320's with a X Y Z X configuration. I have gone over the INI and HAL files a million times and can't get X1 and X2 to move together. Ironically I had this working a few days ago but something changed and it isn't working now. Here are my INI and HAL files...

#Custom BDW24368.hal file created 11/24/10

loadrt probe_parport
loadrt hal_parport cfg="0x378 out "
setp parport.0.reset-time 3500
loadrt stepgen step_type=0,0,0,0

addf parport.0.read base-thread
addf stepgen.make-pulses base-thread
addf parport.0.write base-thread
addf parport.0.reset base-thread

addf stepgen.capture-position servo-thread
addf motion-command-handler servo-thread
addf motion-controller servo-thread
addf stepgen.update-freq servo-thread
net spindle-cmd <= motion.spindle-speed-out

# Invert pins to make motors move in right direction
setp parport.0.pin-02-out-invert 1
setp parport.0.pin-03-out-invert 1

# Hook up the step and dir signals to the parport pins
# Axis X and X2 are the same axis but different motors
net xstep => parport.0.pin-02-out
net ystep => parport.0.pin-04-out
net zstep => parport.0.pin-06-out
net astep => parport.0.pin-08-out
net xdir => parport.0.pin-03-out
net ydir => parport.0.pin-05-out
net zdir => parport.0.pin-07-out
net adir => parport.0.pin-09-out
setp parport.0.pin-02-out-reset 1
setp parport.0.pin-04-out-reset 1
setp parport.0.pin-06-out-reset 1
setp parport.0.pin-08-out-reset 1

# Hook up estop pins
net estop-ext <= parport.0.pin-10-in-not

setp stepgen.0.position-scale [AXIS_0]SCALE
setp stepgen.0.steplen 1
setp stepgen.0.stepspace 0
setp stepgen.0.dirhold 15200
setp stepgen.0.dirsetup 35000
setp stepgen.0.maxaccel [AXIS_0]STEPGEN_MAXACCEL
net xpos-cmd axis.0.motor-pos-cmd => stepgen.0.position-cmd
net xpos-fb stepgen.0.position-fb => axis.0.motor-pos-fb
net xstep <= stepgen.0.step
net xdir <= stepgen.0.dir
net xenable axis.0.amp-enable-out => stepgen.0.enable

setp stepgen.1.position-scale [AXIS_1]SCALE
setp stepgen.1.steplen 1
setp stepgen.1.stepspace 0
setp stepgen.1.dirhold 15200
setp stepgen.1.dirsetup 35000
setp stepgen.1.maxaccel [AXIS_1]STEPGEN_MAXACCEL
net ypos-cmd axis.1.motor-pos-cmd => stepgen.1.position-cmd
net ypos-fb stepgen.1.position-fb => axis.1.motor-pos-fb
net ystep <= stepgen.1.step
net ydir <= stepgen.1.dir
net yenable axis.1.amp-enable-out => stepgen.1.enable

setp stepgen.2.position-scale [AXIS_2]SCALE
setp stepgen.2.steplen 1
setp stepgen.2.stepspace 0
setp stepgen.2.dirhold 15200
setp stepgen.2.dirsetup 35000
setp stepgen.2.maxaccel [AXIS_2]STEPGEN_MAXACCEL
net zpos-cmd axis.2.motor-pos-cmd => stepgen.2.position-cmd
net zpos-fb stepgen.2.position-fb => axis.2.motor-pos-fb
net zstep <= stepgen.2.step
net zdir <= stepgen.2.dir
net zenable axis.2.amp-enable-out => stepgen.2.enable

setp stepgen.3.position-scale [AXIS_3]SCALE
setp stepgen.3.steplen 1
setp stepgen.3.stepspace 0
setp stepgen.3.dirhold 15200
setp stepgen.3.dirsetup 35000
setp stepgen.3.maxaccel [AXIS_3]STEPGEN_MAXACCEL
net apos-cmd axis.3.motor-pos-cmd => stepgen.3.position-cmd
net apos-fb stepgen.3.position-fb => axis.3.motor-pos-fb
net astep <= stepgen.3.step
net adir <= stepgen.3.dir
net aenable axis.3.amp-enable-out => stepgen.3.enable

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


Here is the Kinematics.hal file
############################## Kinematics & Motion Controller ####################################
# Kinematics
loadrt gantrykins

# Settings for gantrykins
setp gantrykins.joint-0 0
setp gantrykins.joint-1 1
setp gantrykins.joint-2 2
setp gantrykins.joint-3 0

# 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

Here is my INI File
[EMC]
MACHINE = BDW24368
NML_FILE = emc.nml
DEBUG = 0

[DISPLAY]
DISPLAY = axis
EDITOR = gedit
POSITION_OFFSET = RELATIVE
POSITION_FEEDBACK = ACTUAL
MAX_FEED_OVERRIDE = 1.2
INTRO_GRAPHIC = emc2.gif
INTRO_TIME = 5
PROGRAM_PREFIX = /home/brad/emc2/nc_files
INCREMENTS = .1in .05in .01in .005in .001in .0005in .0001in

[FILTER]
PROGRAM_EXTENSION = .png,.gif,.jpg Greyscale Depth Image
PROGRAM_EXTENSION = .py Python Script
png = image-to-gcode
gif = image-to-gcode
jpg = image-to-gcode
py = python

[TASK]
TASK = milltask
CYCLE_TIME = 0.010

[RS274NGC]
PARAMETER_FILE = emc.var

[EMCMOT]
EMCMOT = motmod
COMM_TIMEOUT = 1.0
COMM_WAIT = 0.010
BASE_PERIOD = 30382
SERVO_PERIOD = 1000000

[HAL]
HALUI = halui
HALFILE = kinematics.hal
HALFILE = BDW24368.hal
HALFILE = custom.hal
POSTGUI_HALFILE = custom_postgui.hal

[HALUI]
# add halui MDI commands here (max 64)

[TRAJ]
AXES = 4
COORDINATES = X Y Z
MAX_ANGULAR_VELOCITY = 10.00
DEFAULT_ANGULAR_VELOCITY = 1.00
LINEAR_UNITS = inch
ANGULAR_UNITS = degree
CYCLE_TIME = 0.010
DEFAULT_VELOCITY = 1.00
MAX_LINEAR_VELOCITY = 10.00

[EMCIO]
EMCIO = io
CYCLE_TIME = 0.100
TOOL_TABLE = tool.tbl

[AXIS_0]
NAME = X1
TYPE = LINEAR
HOME = 0.0
MAX_VELOCITY = 10.0
MAX_ACCELERATION = 100.0
STEPGEN_MAXACCEL = 125.0
SCALE = 2178.24
FERROR = 0.05
MIN_FERROR = 0.01
MIN_LIMIT = -36.0
MAX_LIMIT = 36.0
HOME_OFFSET = 0.0

[AXIS_1]
NAME = Y
TYPE = LINEAR
HOME = 0.0
MAX_VELOCITY = 10
MAX_ACCELERATION = 100.0
STEPGEN_MAXACCEL = 125.0
SCALE = 3291.36
FERROR = 0.05
MIN_FERROR = 0.01
MIN_LIMIT = -24.0
MAX_LIMIT = 24.0
HOME_OFFSET = 0.0

[AXIS_2]
NAME = Z
TYPE = LINEAR
HOME = 0.0
MAX_VELOCITY = 10.0
MAX_ACCELERATION = 100.0
STEPGEN_MAXACCEL = 125.0
SCALE = 1611.12
FERROR = 0.05
MIN_FERROR = 0.01
MIN_LIMIT = -8.0
MAX_LIMIT = 8.0
HOME_OFFSET = 0.0

[AXIS_3]
NAME = X1
TYPE = LINEAR
HOME = 0.0
MAX_VELOCITY = 10.0
MAX_ACCELERATION = 100.0
STEPGEN_MAXACCEL = 125.0
SCALE = 2178.24
FERROR = 0.05
MIN_FERROR = 0.01
MIN_LIMIT = -36.0
MAX_LIMIT = 36.0
HOME_OFFSET = 0.0


I have switched the X1 and X2 motors and it is not a hardware issue. My breakout board shows that both step and directions are working on both x1 and x2 pins but I have a feeling that somehow the encoder for X2 isn't working in when X1 is working. Just a hunch...

Thoughts...I really need some help with this!

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

More
06 Dec 2010 11:20 #5877 by Rick G
Not sure what you are describing "can't get x1 and x2 to move together" are they out of sync or only one moves?
It seems that if you are getting step and direction at the breakout board it could be a hardware problem.
Can you jog the axis? Check to make sure step and direction pins are not reversed?

Rick G

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

More
06 Dec 2010 11:37 - 06 Dec 2010 11:38 #5878 by BWay
I can't jog X2 in joint or world mode. If I switch my pin output then I can jog X2 but not X1. If I unplug the X2 encoder the motor will run at top speed. If I assign Y to X2 and then I can jog both X1 and X2 (y) but obviously they are not slaved or synced. For some reason when I have X1 and X2 assigned then I just can get X2 to slave.

Thoughts?
Last edit: 06 Dec 2010 11:38 by BWay.

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

More
07 Dec 2010 01:49 #5903 by BWay
Well it works. It seems most of my configuration was fine but I was having trouble with one of my servo's. I adjusted a few things and it seems to be working. Strange?!?

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

More
07 Dec 2010 12:10 #5905 by Rick G
Strange but good! Glad to hear it is now working.

Rick G

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

More
07 Dec 2010 12:56 #5906 by BWay
I seems that one of my servo's was "weak" so while it was getting power it didn't have enough torque to run. This was making it look like I didn't have signal when really it was something else. I am still concerned there is something going on but after switching motors around and adjusting a few things it seems to be running ok. Any ideas on what this could be? I am fairly confident that it is something with the motor and not the encoder, cables, drives, or power supply since I have been able to switch and swap just about everything without problems with the expection of this one motor that acts up from time to time. Really strange.

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

More
09 Dec 2010 11:18 #5936 by Rick G
I think it pays to start with the simple things. Mechanical binding? I would double check all connections and cables to the bad motor.
On brush motors check the brushes, armature and springs. Check the resistance of the motor, windings etc.
Use a amp meter to see what kind of current is flowing on the good and the bad motors.

Rick G

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

Time to create page: 0.115 seconds
Powered by Kunena Forum