Hi Jon and Viesturs,

This maschine is flame cutting with semiautomatic Z high control.
The stepper motor is driven in all axis.

Where can I find the mistake?


PC latency time: 20287.

langvago.hal file:

loadrt gantrykins
setp gantrykins.joint-0 0
setp gantrykins.joint-1 1
setp gantrykins.joint-2 2
setp gantrykins.joint-3 0

loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD 
servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[TRAJ]AXES
loadrt probe_parport
loadrt hal_parport cfg="0x378 out"
setp parport.0.reset-time 5000
loadrt stepgen step_type=0,0,0,0

loadrt sum2 count=2
addf sum2.0 servo-thread

addf stepgen.make-pulses base-thread
addf parport.0.read base-thread 1
addf parport.0.write base-thread -1
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

setp parport.0.pin-01-out-invert 1
net xenable => parport.0.pin-01-out

setp parport.0.pin-02-out-invert 1
net xstep => parport.0.pin-02-out
setp parport.0.pin-02-out-reset 1
setp parport.0.pin-03-out-invert 1
net xdir => parport.0.pin-03-out

setp parport.0.pin-04-out-invert 1
net ystep => parport.0.pin-04-out
setp parport.0.pin-04-out-reset 1
setp parport.0.pin-05-out-invert 1
net ydir => parport.0.pin-05-out

setp parport.0.pin-06-out-invert 1
net zstep => parport.0.pin-06-out
setp parport.0.pin-06-out-reset 1
#setp parport.0.pin-07-out-invert 1
net zdir => parport.0.pin-07-out

setp parport.0.pin-08-out-invert 1
net astep => parport.0.pin-08-out
setp parport.0.pin-08-out-reset 1
setp parport.0.pin-09-out-invert 1
net adir => parport.0.pin-09-out

setp parport.0.pin-14-out-invert 1
net spindle-enable motion.spindle-on => parport.0.pin-14-out

net min-home-y <= parport.0.pin-11-in-not
net min-home-a <= parport.0.pin-12-in-not
net min-home-x <= parport.0.pin-13-in-not
net max-home-z <= 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 20915
setp stepgen.0.dirsetup 20915
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
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 20915
setp stepgen.1.dirsetup 20915
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
net min-home-y => axis.1.home-sw-in
net min-home-y => axis.1.neg-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 20915
setp stepgen.2.dirsetup 20915
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
net zki  => 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
net max-home-z => axis.2.home-sw-in
net max-home-z => axis.2.pos-lim-sw-in

setp stepgen.3.position-scale [AXIS_3]SCALE
setp stepgen.3.steplen 1
setp stepgen.3.stepspace 0
setp stepgen.3.dirhold 20915
setp stepgen.3.dirsetup 20915
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 min-home-a => axis.3.home-sw-in
net min-home-a => axis.3.neg-lim-sw-in

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

net tool-number <= iocontrol.0.tool-prep-number
net tool-change-loopback iocontrol.0.tool-change => iocontrol.0.tool-changed
net tool-prepare-loopback iocontrol.0.tool-prepare => 
iocontrol.0.tool-prepared




langvago.ini file:

[EMC]
MACHINE = Langvago
DEBUG = 0

[DISPLAY]
DISPLAY = axis
EDITOR = gedit
POSITION_OFFSET = RELATIVE
POSITION_FEEDBACK = ACTUAL
GRIDS = 10mm 20mm 50mm 100mm 1in 2in 5in 10in
MAX_FEED_OVERRIDE = 1.3
#MIN_SPINDLE_OVERRIDE = 0.5
#MAX_SPINDLE_OVERRIDE = 1.2
DEFAULT_LINEAR_VELOCITY = 25.00
MIN_LINEAR_VELOCITY = 0.1
MAX_LINEAR_VELOCITY = 50.00
INTRO_GRAPHIC = linuxcnc.gif
INTRO_TIME = 3
GEOMETRY = XYZ
PROGRAM_PREFIX = /home/cnc/linuxcnc/nc_files
INCREMENTS = 5mm 1mm .5mm .1mm .05mm .01mm .005mm
PYVCP = custompanel.xml
HELP_FILE =         doc/help.txt
CYCLE_TIME =        0.200

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

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

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

[HALUI]
# add halui MDI commands here (max 64)
MDI_COMMAND = G0 Z10 X0 Y0
MDI_COMMAND = G54 x0 y0 z0
MDI_COMMAND = o<align-start> call
MDI_COMMAND = o<align-y> call
MDI_COMMAND = o<align-x> call
MDI_COMMAND = o<clear-offset> call

[TRAJ]
AXES = 4
COORDINATES = X Y Z X
LINEAR_UNITS = 1.0
ANGULAR_UNITS = 1.0
CYCLE_TIME = 0.010
DEFAULT_VELOCITY = 15.00
MAX_VELOCITY = 50.00
DEFAULT_ACCELERATION =    100
MAX_ACCELERATION =    150

[AXIS_0]
# X axis
TYPE = LINEAR
HOME = 0.0
MAX_VELOCITY = 50.0
MAX_ACCELERATION = 150.0
STEPGEN_MAXACCEL = 187.0
SCALE = 96.4
FERROR = 3
MIN_FERROR = 10.5
MIN_LIMIT = -0.001
MAX_LIMIT = 3200.0
HOME_OFFSET = -20.0
HOME_SEARCH_VEL = -20.10000
HOME_LATCH_VEL = 4.020000
HOME_IGNORE_LIMITS = YES
HOME_SEQUENCE = 1

[AXIS_1]
# Y axis
TYPE = LINEAR
HOME = 0.0
MAX_VELOCITY = 50.0
MAX_ACCELERATION = 150.0
STEPGEN_MAXACCEL = 187.0
SCALE = 96.4
FERROR = 3
MIN_FERROR = 10.5
MIN_LIMIT = -1.001
MAX_LIMIT = 1600.0
HOME_OFFSET = -50.0
HOME_SEARCH_VEL = -20.20000
HOME_LATCH_VEL = 25.020000
HOME_IGNORE_LIMITS = YES
HOME_SEQUENCE = 1

[AXIS_2]
# Z axis
TYPE = LINEAR
HOME = 150.0
MAX_VELOCITY = 9
MAX_ACCELERATION = 80.0
STEPGEN_MAXACCEL = 100.0
SCALE = 533.333333
FERROR = 18.5
MIN_FERROR = 55.25
MIN_LIMIT = -1.02
MAX_LIMIT = 160.0
HOME_OFFSET = 150.0
HOME_SEARCH_VEL = 7.20000
HOME_LATCH_VEL = -3.520000
HOME_IGNORE_LIMITS = YES
HOME_SEQUENCE = 0

[AXIS_3]
# X1 axis
TYPE = LINEAR
HOME = 0.0
MAX_VELOCITY = 50.0
MAX_ACCELERATION = 150.0
STEPGEN_MAXACCEL = 187.0
SCALE = -96.4
FERROR = 3
MIN_FERROR = 10.5
MIN_LIMIT = -0.001
MAX_LIMIT = 3200.0
HOME_OFFSET = -20.0
HOME_SEARCH_VEL = -20.10000
HOME_LATCH_VEL = 4.020000
HOME_IGNORE_LIMITS = YES
HOME_SEQUENCE = 1

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



custop_postgui.hal file:

net Z-korrek pyvcp.spin-zkorrekcio  => sum2.0.in1
net zpos-cmd axis.2.motor-pos-cmd   => sum2.0.in0
net zki                    <= sum2.0.out

net min-home-x pyvcp.led-11
net min-home-y pyvcp.led-12
net max-home-z pyvcp.led-13
net min-home-a pyvcp.led-14


net remote-futo0 halui.mdi-command-00 <= pyvcp.fut0
#net remote-null0 halui.mdi-command-01 <= pyvcp.null0
net align-start halui.mdi-command-02 <= pyvcp.align-start
net align-y halui.mdi-command-03 <= pyvcp.align-y
net align-x halui.mdi-command-04 <= pyvcp.align-x
net clear-offset halui.mdi-command-05 <= pyvcp.clear-offset





Joint 2 is your Z axis.  (Joint numbers start from zero.)
So, either your servo tuning is not good, or something you
did when
setting up the XYZX configuration in the hal files has broken
the proper connection of signals related to the Z axis.
You should NOT need to set up 4 axes in [TRAJ], as far as
LinuxCNC is concerned, this is a 3-axis machine.
Only the motor side needs to know about the 4th motor.
It is NOT a separate axis, it is only an extra motor added
to an existing axis.

So, you DO need 4 PIDs if you have encoders feeding back
position,
but you don't need a 4th AXIS.  If you don't have encoders, then
you may  not need any special details to move the 4th motor.
Or, you could use another step generator for the 4th motor, and
gate that with something related to homing the gantry so that
motor is in proper alignment to the other side of the gantry.

Jon



IIRC it will complain about all axis.3.nnn.xxx pins (home switches
etc) in HAL file, if there will be only 3 axes specified in TRAJ
section of INI file.

Viesturs



---
Ezt az e-mailt az Avast víruskereső szoftver átvizsgálta.
http://www.avast.com


------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Emc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to