How to. 2 or more motors on one axis. Gantry

More
02 Jan 2021 08:48 #193811 by nau

I have 2 Y axis... Now its not work after i edit INI file and HAL file...
Try to move z axis but in screen moving Y1 axis (join 2 in my hal file)
Its swaping... :( :(
This my ini and hal file

Problem in HAL file. You have to strip axis pins and connections. Instead
net ystep => parport.0.pin-05-out
net ystep => parport.0.pin-06-out
shall be:
net y0step => parport.0.pin-05-out
net y1step => parport.0.pin-06-out

same in rest of HAL (especially AXIS section)
The following user(s) said Thank You: Trihwangyudi1990

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

More
02 Jan 2021 09:26 #193814 by nau

I think we have reached the limits of what can be done with remote trouble shooting. The unfortunate thing is that there are thousands of machines that are homing correctly so it not Linuxcnc at fault. You need to walk away for a day or two and then come back with fresh eyes, study the homing configuration docs and resolve the issue.

I started fresh. New config with StepConf. Only thing is different that all step signals wasn't inverted and now it is. After inverting step's XYZ config won't worked (XZ worked and Y not) as before and I had to change Y limits to negative. After that XYZ config was fixed. Then I've changed all details for XYYZ configuration and now it's fully working XYYZ mode. At start in Joint mode and after homing it become Axis mode (world). Still don't understand logic of setting limits LinuxCNC but at least it's working.

dear rodw, tommylight, Clive S, phillc54 thank you for helping me!

including my new configs maybe that would help someone
Attachments:
The following user(s) said Thank You: rodw

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

More
02 Jan 2021 10:31 #193819 by Trihwangyudi1990

I have 2 Y axis... Now its not work after i edit INI file and HAL file...
Try to move z axis but in screen moving Y1 axis (join 2 in my hal file)
Its swaping... :( :(
This my ini and hal file

Problem in HAL file. You have to strip axis pins and connections. Instead
net ystep => parport.0.pin-05-out
net ystep => parport.0.pin-06-out
shall be:
net y0step => parport.0.pin-05-out
net y1step => parport.0.pin-06-out

same in rest of HAL (especially AXIS section)

Change litle bit but now the problem...
X axis work.... Limit and home work
Y0 axis work but Y1 axis is swaping with Z axis..
Z axis cant move
:ohmy: :ohmy: :ohmy:
The configuration of my ini and hal file after I change it
Attachments:

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

More
02 Jan 2021 10:50 #193821 by nau

Change litle bit but now the problem...
X axis work.... Limit and home work
Y0 axis work but Y1 axis is swaping with Z axis..
Z axis cant move
:ohmy: :ohmy: :ohmy:
The configuration of my ini and hal file after I change it

you have to home all first.
and set HOME_SEQUENCE = -1 to both joint 1 and 2 to home them together only
The following user(s) said Thank You: Trihwangyudi1990

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

More
02 Jan 2021 15:33 #193844 by Trihwangyudi1990

Change litle bit but now the problem...
X axis work.... Limit and home work
Y0 axis work but Y1 axis is swaping with Z axis..
Z axis cant move
:ohmy: :ohmy: :ohmy:
The configuration of my ini and hal file after I change it

you have to home all first.
and set HOME_SEQUENCE = -1 to both joint 1 and 2 to home them together only

Thanks its work.... :laugh: :laugh: :laugh: :
Now its time to add rotary axis...
Great comunityB)

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

More
27 Jan 2021 22:59 - 27 Jan 2021 23:00 #196842 by mf290997
I changed my files according to your manual, but somehow the second motor of my Y axis doesn't move. the first motor, which I configured using stepconf does still try to move, but only loses steps due to the other motor stopping it. Here are my hal and ini files. I hope someone can help me with this issue.

# Generated by stepconf 1.1 at Wed Jan 27 23:05:41 2021
# If you make changes to this file, they will be
# overwritten when you run stepconf again
loadrt [KINS]KINEMATICS
loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS
loadrt hal_parport cfg="0xcf00 out"
setp parport.0.reset-time 5000
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-rpm     <= spindle.0.speed-out
net spindle-cmd-rpm-abs <= spindle.0.speed-out-abs
net spindle-cmd-rps     <= spindle.0.speed-out-rps
net spindle-cmd-rps-abs <= spindle.0.speed-out-rps-abs
net spindle-at-speed    => spindle.0.at-speed

net estop-out       => parport.0.pin-01-out
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
net ystep           => parport.0.pin-04-out
setp parport.0.pin-04-out-reset 1
setp parport.0.pin-05-out-invert 1
net zdir            => parport.0.pin-05-out
net zstep           => parport.0.pin-06-out
setp parport.0.pin-06-out-reset 1
net ydir            => parport.0.pin-07-out
net y2step           => parport.0.pin-08-out
setp parport.0.pin-08-out-reset 1
setp parport.0.pin-09-out-invert 1
net y2dir            => parport.0.pin-09-out
net xenable         => parport.0.pin-14-out

setp stepgen.0.position-scale [JOINT_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 [JOINT_0]STEPGEN_MAXACCEL
net xpos-cmd joint.0.motor-pos-cmd => stepgen.0.position-cmd
net xpos-fb stepgen.0.position-fb => joint.0.motor-pos-fb
net xstep <= stepgen.0.step
net xdir <= stepgen.0.dir
net xenable joint.0.amp-enable-out => stepgen.0.enable

setp stepgen.1.position-scale [JOINT_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 [JOINT_1]STEPGEN_MAXACCEL
net ypos-cmd joint.1.motor-pos-cmd => stepgen.1.position-cmd
net ypos-fb stepgen.1.position-fb => joint.1.motor-pos-fb
net ystep <= stepgen.1.step
net ydir <= stepgen.1.dir
net yenable joint.1.amp-enable-out => stepgen.1.enable

setp stepgen.2.position-scale [JOINT_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 [JOINT_2]STEPGEN_MAXACCEL
net y2pos-cmd joint.2.motor-pos-cmd => stepgen.2.position-cmd
net y2pos-fb stepgen.2.position-fb => joint.2.motor-pos-fb
net y2step <= stepgen.2.step
net y2dir <= stepgen.2.dir
net y2enable joint.2.amp-enable-out => stepgen.2.enable

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

net estop-out <= iocontrol.0.user-enable-out
net estop-out => 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



# Generated by stepconf 1.1 at Wed Jan 27 23:05:41 2021
# If you make changes to this file, they will be
# overwritten when you run stepconf again

[EMC]
MACHINE = cnc
DEBUG = 0
VERSION = 1.1

[DISPLAY]
DISPLAY = gmoccapy
EDITOR = gedit
POSITION_OFFSET = RELATIVE
POSITION_FEEDBACK = ACTUAL
ARCDIVISION = 64
GRIDS = 10mm 20mm 50mm 100mm 1in 2in 5in 10in
MAX_FEED_OVERRIDE = 1.2
MIN_SPINDLE_OVERRIDE = 0.5
MAX_SPINDLE_OVERRIDE = 1.2
DEFAULT_LINEAR_VELOCITY = 20.00
MIN_LINEAR_VELOCITY = 0
MAX_LINEAR_VELOCITY = 200.00
INTRO_GRAPHIC = linuxcnc.gif
INTRO_TIME = 5
PROGRAM_PREFIX = /home/linuxcncaddi/linuxcnc/nc_files
INCREMENTS = 5mm 1mm .5mm .1mm .05mm .01mm .005mm

[KINS]
JOINTS = 4
KINEMATICS = trivkins coordinates=XYYZ

[FILTER]
PROGRAM_EXTENSION = .png,.gif,.jpg Greyscale Depth Image
PROGRAM_EXTENSION = .py Python Script
PROGRAM_EXTENSION = .nc,.tap G-Code File
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
BASE_PERIOD = 39062
SERVO_PERIOD = 1000000

[HAL]
HALFILE = cnc.hal
HALFILE = custom.hal
POSTGUI_HALFILE = postgui_call_list.hal

[TRAJ]
COORDINATES =  X Y Z
LINEAR_UNITS = mm
ANGULAR_UNITS = degree
DEFAULT_LINEAR_VELOCITY = 20.00
MAX_LINEAR_VELOCITY = 200.00

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

[AXIS_X]
MAX_VELOCITY = 200.0
MAX_ACCELERATION = 500.0
MIN_LIMIT = -0.001
MAX_LIMIT = 710.0

[JOINT_0]
TYPE = LINEAR
HOME = 0.0
MIN_LIMIT = -0.001
MAX_LIMIT = 710.0
MAX_VELOCITY = 200.0
MAX_ACCELERATION = 500.0
STEPGEN_MAXACCEL = 625.0
SCALE = 106.666666667
FERROR = 1
MIN_FERROR = .25
HOME_OFFSET = 0.0
HOME_SEARCH_VEL = 0
HOME_LATCH_VEL = 0
HOME_USE_INDEX = NO
HOME_SEQUENCE = 0

[AXIS_Y]
MAX_VELOCITY = 200.0
MAX_ACCELERATION = 500.0
MIN_LIMIT = -0.001
MAX_LIMIT = 1220.0

[JOINT_1]
TYPE = LINEAR
HOME = 0.0
MIN_LIMIT = -0.001
MAX_LIMIT = 1220.0
MAX_VELOCITY = 200.0
MAX_ACCELERATION = 500.0
STEPGEN_MAXACCEL = 625.0
SCALE = 106.666666667
FERROR = 1
MIN_FERROR = .25
HOME_OFFSET = 0.0
HOME_SEARCH_VEL = 0
HOME_LATCH_VEL = 0
HOME_USE_INDEX = NO
HOME_SEQUENCE = 0

[JOINT_2]
TYPE = LINEAR
HOME = 0.0
MIN_LIMIT = -0.001
MAX_LIMIT = 1220.0
MAX_VELOCITY = 200.0
MAX_ACCELERATION = 500.0
STEPGEN_MAXACCEL = 625.0
SCALE = 106.666666667
FERROR = 1
MIN_FERROR = .25
HOME_OFFSET = 0.0
HOME_SEARCH_VEL = 0
HOME_LATCH_VEL = 0
HOME_USE_INDEX = NO
HOME_SEQUENCE = 0

[AXIS_Z]
MAX_VELOCITY = 19.0002432031
MAX_ACCELERATION = 60.0
MIN_LIMIT = -80.0
MAX_LIMIT = 0.001

[JOINT_3]
TYPE = LINEAR
HOME = 0.0
MIN_LIMIT = -80.0
MAX_LIMIT = 0.001
MAX_VELOCITY = 19.0002432031
MAX_ACCELERATION = 60.0
STEPGEN_MAXACCEL = 75.0
SCALE = 1280.0
FERROR = 1
MIN_FERROR = .25
HOME_OFFSET = 0.0
HOME_SEARCH_VEL = 0
HOME_LATCH_VEL = 0
HOME_USE_INDEX = NO
HOME_SEQUENCE = 0
Last edit: 27 Jan 2021 23:00 by mf290997.

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

More
28 Jan 2021 07:58 #196904 by rodw
On your Y axis joints (joints 1 &2), change the home sequence on both to equal -1
HOME_SEQUENCE = -1

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

More
28 Jan 2021 09:45 #196913 by Clive S
[JOINT_1]
TYPE = LINEAR
HOME = 0.0 This is the final home position
MIN_LIMIT = -0.001
MAX_LIMIT = 1220.0
MAX_VELOCITY = 200.0
MAX_ACCELERATION = 500.0
STEPGEN_MAXACCEL = 625.0
SCALE = 106.666666667
FERROR = 1
MIN_FERROR = .25
HOME_OFFSET = 0.0 This is used to square the gantry (a small number) ie 0.25
HOME_SEARCH_VEL = 0 use this to search for the home switch ( if you change the sign it will reverse the direction) if it is zero it probably won't move
HOME_LATCH_VEL = 0 This number is set to the speed of the search to the switch ( if you change the sign it will reverse the direction)
HOME_USE_INDEX = NO
HOME_SEQUENCE = 0 It is usual to have 0 for the Z axis (so that the Z will lift out of the way first) but for dual homing both axis have to have the same -ve number ie -1

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

More
29 Jan 2021 02:32 #197026 by mf290997
Thanks for the help, the -1 did it. now, after homing, which at the moment does nothing, everything moves correctly.

I don't quite understand now, how I need to setup the homing. I don't want you use two endstops on Y, the system is rigid enough for me that homing on one side schould be enough for my needs.
Is there a good explanation on how to setup the hal/ini file for homing switch inputs? I think I can't use stepconf anymore, because that would override my previous changes, correct?
Clives explanations were very helpful, but I don't understand the difference between HOME_LATCH_VEL and HOME_SEARCH_VEL yet.

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

More
29 Jan 2021 02:47 #197027 by rodw
Yes, now you have a working config. forget pncconf and edit by hand

Homing is describered here. Read it all but check out section 5 for all the velocities.
linuxcnc.org/docs/2.8/html/config/ini-homing.html

The whole thing about gantry machines is the use of two home switches allows the gantry to be squared when it homes.

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

Time to create page: 0.427 seconds
Powered by Kunena Forum