How to change the direction of the X and Y axes in Linuxcnc by changing entries

More
17 Jan 2022 17:50 #232142 by jarcysgru
How can I change the directions of the X and Y axes in a Hal file so that I don't have to run my Stepconf Wizard setup to overwrite the files.
There is a mention here, but it is not enough for me
odwrocenie-kierunku-osi-w-emc2-t35039.html

Here is my Hal file
# Generated by stepconf 1.1 at Fri Apr 3 19:32:57 2020
# Jeśli zmodyfikujesz ten plik zmainy zostaną
# nadpisane gdy uruchomisz ponownie Stepconf
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="0x378 out"
setp parport.0.reset-time 2000
loadrt stepgen step_type=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 coolant-flood <= iocontrol.0.coolant-flood

net estop-out => parport.0.pin-01-out
net xstep => parport.0.pin-02-out
setp parport.0.pin-02-out-reset 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
net xenable => parport.0.pin-17-out
net estop-ext <= parport.0.pin-10-in
net home-x <= parport.0.pin-11-in-not
net home-y <= parport.0.pin-12-in-not
net home-z <= parport.0.pin-13-in-not
net probe-in <= parport.0.pin-15-in

setp stepgen.0.position-scale [JOINT_0]SCALE
setp stepgen.0.steplen 1
setp stepgen.0.stepspace 0
setp stepgen.0.dirhold 95000
setp stepgen.0.dirsetup 95000
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
net home-x => joint.0.home-sw-in

setp stepgen.1.position-scale [JOINT_1]SCALE
setp stepgen.1.steplen 1
setp stepgen.1.stepspace 0
setp stepgen.1.dirhold 95000
setp stepgen.1.dirsetup 95000
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
net home-y => joint.1.home-sw-in

setp stepgen.2.position-scale [JOINT_2]SCALE
setp stepgen.2.steplen 1
setp stepgen.2.stepspace 0
setp stepgen.2.dirhold 95000
setp stepgen.2.dirsetup 95000
setp stepgen.2.maxaccel [JOINT_2]STEPGEN_MAXACCEL

setp parport.0.pin-16-out-invert 1
net coolant-flood => parport.0.pin-16-out

net zpos-cmd joint.2.motor-pos-cmd => stepgen.2.position-cmd
net zpos-fb stepgen.2.position-fb => joint.2.motor-pos-fb
net zstep <= stepgen.2.step
net zdir <= stepgen.2.dir
net zenable joint.2.amp-enable-out => stepgen.2.enable
net home-z => joint.2.home-sw-in

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

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

More
17 Jan 2022 18:50 - 17 Jan 2022 18:51 #232158 by tommylight
Add or remove:
setp parport.0.pin-03-out-invert TRUE
setp parport.0.pin-05-out-invert TRUE
Last edit: 17 Jan 2022 18:51 by tommylight.
The following user(s) said Thank You: jarcysgru

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

More
18 Jan 2022 17:18 #232299 by jarcysgru
I changed the directions of the X and Y axes, now I have a problem with the stopwatches based on them, I don't know what the problem is, how can I do it.

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

More
18 Jan 2022 17:23 #232300 by jarcysgru
I have changed the directions of the X and Y axes now I have a problem with homing limit switches, which means they do not rely on what the problem is, how to do it

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

More
18 Jan 2022 18:57 #232314 by Aciera
If you change the direction of your motors then you will have to reconfigure your limit/home switches because now you have also swapped the positive and negative ends of the axis.
I only see home switches in your config so you probably need to change the homing direction in the ini file and you will also need to change the joint and axis limits set there.

If unsure please post your .ini file

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

More
18 Jan 2022 20:01 #232325 by jarcysgru
# Generated by stepconf 1.1 at Sun Feb 9 16:54:21 2020
# Jeśli zmodyfikujesz ten plik zmainy zostaną
# nadpisane gdy uruchomisz ponownie Stepconf

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

[DISPLAY]
DISPLAY = axis
POSITION_OFFSET = RELATIVE
POSITION_FEEDBACK = ACTUAL
MIN_FEED_OVERRIDE = 0.000000
MAX_FEED_OVERRIDE = 1.200000
MAX_SPINDLE_OVERRIDE = 1.5
MIN_SPINDLE_OVERRIDE = 0.1
INTRO_GRAPHIC = linuxcnc.gif
INTRO_TIME = 5
PROGRAM_PREFIX = /home/cnc/linuxcnc/nc_files
INCREMENTS = 5mm 1mm .5mm .1mm .05mm .01mm .005mm
POSITION_FEEDBACK = ACTUAL
DEFAULT_LINEAR_VELOCITY = 6.000000
MAX_LINEAR_VELOCITY = 83.3333
MIN_LINEAR_VELOCITY = 0.500000
DEFAULT_ANGULAR_VELOCITY = 12.000000
MAX_ANGULAR_VELOCITY = 180.000000
MIN_ANGULAR_VELOCITY = 1.666667
EDITOR = gedit
GEOMETRY = xyz
PYVCP = custompanel.xml


TKPKG = Ngcgui 1.0
NGCGUI_FONT = Helvetica -12 normal
NGCGUI_PREAMBLE = mm_std.ngc

NGCGUI_SUBFILE = kanalek.ngc
NGCGUI_SUBFILE = kanalek_y.ngc
NGCGUI_SUBFILE = otwor.ngc
NGCGUI_SUBFILE = otwory_po_okregu.ngc
NGCGUI_SUBFILE = przejazd.ngc

[KINS]
JOINTS = 3
KINEMATICS = trivkins coordinates=XYZ

[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
SUBROUTINE_PATH = ../../nc_files/ngcgui_lib:../../ngcgui_lib/utilitysubs:/home/j/linuxcnc/nc_files/ngcgui
[EMCMOT]
EMCMOT = motmod
COMM_TIMEOUT = 1.0
BASE_PERIOD = 39062
SERVO_PERIOD = 1000000

[HAL]
HALUI = halui
HALFILE = huanyang.hal
HALFILE = custom.hal
HALFILE = xhc-whb04b-6.hal
POSTGUI_HALFILE = custom_postgui.hal

[HALUI]
MDI_COMMAND=(debug,00)
MDI_COMMAND=(debug,macro1)
MDI_COMMAND=(debug,macro2)
MDI_COMMAND=(debug,macro3)
MDI_COMMAND=(debug,macro4)
MDI_COMMAND=G1 G53 X0 Y0 Z0 F4000
MDI_COMMAND=(debug,macro6)
MDI_COMMAND=G1 X0 Y0 Z0 F4000
MDI_COMMAND=(debug,macro8)
MDI_COMMAND=(debug,macro9)
MDI_COMMAND=(debug,macro10)
MDI_COMMAND=(debug,macro11)
MDI_COMMAND=(debug,macro12)
MDI_COMMAND=(debug,macro13)
MDI_COMMAND=(debug,macro14)
MDI_COMMAND=(debug,macro15)
MDI_COMMAND=(debug,macro16)
MDI_COMMAND=G1 G53 Z0 F4000
MDI_COMMAND=(debug,macro17)
MDI_COMMAND=(debug,macro18)
MDI_COMMAND=(debug,macro19)

[TRAJ]
COORDINATES = X Y Z
LINEAR_UNITS = mm
ANGULAR_UNITS = degree
DEFAULT_LINEAR_VELOCITY = 8.00
MAX_LINEAR_VELOCITY = 80.00

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

[AXIS_X]
MAX_VELOCITY = 76.0009728125
MAX_ACCELERATION = 500.0
MIN_LIMIT = -460.0
MAX_LIMIT = 0.001

[JOINT_0]
TYPE = LINEAR
HOME = 0.0
MIN_LIMIT = -460.0
MAX_LIMIT = 0.001
MAX_VELOCITY = 76.0009728125
MAX_ACCELERATION = 500.0
STEPGEN_MAXACCEL = 625.0
SCALE = 320.0
FERROR = 1
MIN_FERROR = .25
HOME_OFFSET = 0.000000
HOME_SEARCH_VEL = 1.500000
HOME_LATCH_VEL = 1.500000
HOME_OFFSET = 0.0
HOME_SEQUENCE = 1

[AXIS_Y]
MAX_VELOCITY = 70.0
MAX_ACCELERATION = 500.0
MIN_LIMIT = -510.0
MAX_LIMIT = 0.001

[JOINT_1]
TYPE = LINEAR
HOME = 0.0
MIN_LIMIT = -510.0
MAX_LIMIT = 0.001
MAX_VELOCITY = 70.0
MAX_ACCELERATION = 500.0
STEPGEN_MAXACCEL = 625.0
SCALE = 320.0
FERROR = 1
MIN_FERROR = .25
HOME_OFFSET = 0.000000
HOME_SEARCH_VEL = 1.500000
HOME_LATCH_VEL = 1.500000
HOME_OFFSET = 0.0
HOME_SEQUENCE = 2

[AXIS_Z]
MAX_VELOCITY = 60.0
MAX_ACCELERATION = 500.0
MIN_LIMIT = -190.0
MAX_LIMIT = 0.001

[JOINT_2]
TYPE = LINEAR
HOME = 0.0
MIN_LIMIT = -190.0
MAX_LIMIT = 0.001
MAX_VELOCITY = 60.0
MAX_ACCELERATION = 500.0
STEPGEN_MAXACCEL = 625.0
SCALE = 320.0
FERROR = 1
MIN_FERROR = .25
HOME_OFFSET = 0.000000
HOME_SEARCH_VEL = 1.500000
HOME_LATCH_VEL = 1.500000
HOME_OFFSET = 0.0
HOME_SEQUENCE = 0

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

More
19 Jan 2022 08:34 - 19 Jan 2022 08:35 #232413 by Aciera
Presuming that, after changing motor direction in X and Y, the machine now moves in the wrong direction during the homing process you can try these settings:

[AXIS_X]
MAX_VELOCITY = 76.0009728125
MAX_ACCELERATION = 500.0
MAX_LIMIT = 460.0
MIN_LIMIT = -0.001

[JOINT_0]
TYPE = LINEAR
HOME = 0.0
MAX_LIMIT = 460.0
MIN_LIMIT = -0.001
MAX_VELOCITY = 76.0009728125
MAX_ACCELERATION = 500.0
STEPGEN_MAXACCEL = 625.0
SCALE = 320.0
FERROR = 1
MIN_FERROR = .25
HOME_OFFSET = 0.000000
HOME_SEARCH_VEL = -1.500000
HOME_LATCH_VEL = -1.500000
HOME_OFFSET = 0.0
HOME_SEQUENCE = 1

[AXIS_Y]
MAX_VELOCITY = 70.0
MAX_ACCELERATION = 500.0
MAX_LIMIT = 510.0
MIN_LIMIT = -0.001

[JOINT_1]
TYPE = LINEAR
HOME = 0.0
MAX_LIMIT = 510.0
MIN_LIMIT = -0.001
MAX_VELOCITY = 70.0
MAX_ACCELERATION = 500.0
STEPGEN_MAXACCEL = 625.0
SCALE = 320.0
FERROR = 1
MIN_FERROR = .25
HOME_OFFSET = 0.000000
HOME_SEARCH_VEL = -1.500000
HOME_LATCH_VEL = -1.500000
HOME_OFFSET = 0.0
HOME_SEQUENCE = 2
Last edit: 19 Jan 2022 08:35 by Aciera.

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

More
19 Jan 2022 17:39 #232453 by jarcysgru
Dziekuje Aciera i tommylight bardzo za pomoc , teraz wszystkie osie działają tak jak chciałem .
Pozdrawiam i życzę wszystkiego dobrego.
The following user(s) said Thank You: tommylight

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

More
19 Jan 2022 17:46 #232455 by tommylight
I can not recall how to say "you are welcomed" in Polish ! :(

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

More
19 Jan 2022 17:52 #232456 by Aciera
The following user(s) said Thank You: tommylight

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

Time to create page: 0.532 seconds
Powered by Kunena Forum