Hot wire foam cutter - mapping Z and A axes to U and V

More
2 years 5 months ago #301259 by garthnoakes
Hi all

My hot wire machine is working, but the software I want to use (devFoam) issues X,Y, U,V parameters for G1 (four parameters on each line). I am not cutting tapered parts, so the U value is always the same as X, and V the same as Y.

I don't want to modify the gcode manually. My breakout (parallel) board is marked for X, Y, Z and A.

Can anyone help me with how to configure this?

Thanks
Garth

Please Log in to join the conversation.

More
2 years 5 months ago #301265 by tommylight
This is valid for configurations created with PncConf wizard, you did not give any info on the actual hardware used nor software.
Make a copy of the existing config and put it somewhere safe.
Edit the .ini file with a text editor:
display section change GEOMETRY = XYZA to XYUV
TRAJ section change COORDINATES = XYZA to XYUV
change [AXIS_Z] to [AXIS_U]
and change [AXIS_A] to [AXIS_V]
save, do not close the text editor, you might need to go back with CTRL Z
The hal file needs a bit more care
change
loadrt pid names=pid.x,pid.y,pid.z,pid.a
to
loadrt pid names=pid.x,pid.y,pid.u,pid.v
-
then
addf pid.z.do-pid-calcs servo-thread
to
addf pid.u.do-pid-calcs servo-thread
and
addf pid.a.do-pid-calcs servo-thread
to
addf pid.v.do-pid-calcs servo-thread
-
then everything under the section "AXIS Z JOINT 2" and "AXIS A JOINT 3" wherever there is z in any line, replace with u , and wherever there is a in the line replace with u .
DO not use "search and replace" feature for this, it will mess up the configuration beyond repair.

Please Log in to join the conversation.

More
2 years 5 months ago #301288 by jimmyrig
Not sure about the specifics of the foam cutter gui

But from a ini and hal side of thing you can link the two columns together.

1 copy everything tommylight said but name them x2 and y2 instead.

Now go to the ini move the joints for x2 and y2 under x and y axis sections. then delete the x2 and y2 "axis" sections

For example
X axis
Joint 1
Joint 3 (was u before)

Y axis
Joint 2
Joint 4 (was v)

Not sure if your software could only output x and y however. If it also does u and v no matter what follow tommylights suggestion

Please Log in to join the conversation.

More
2 years 5 months ago #301318 by tommylight
Very little difference between having 2 axis/4joints and having 4 axis/4joints as far as editing goes, so i decided to do the 4 version as it leaves the possibility of doing plane wings ! :)

Please Log in to join the conversation.

More
2 years 5 months ago #301322 by garthnoakes
Good point, I have already started wondering about adding a weight to tension the wire, which would enable tapered cuts. So I am going to try Tommy's settings now

Please Log in to join the conversation.

More
2 years 5 months ago #301331 by garthnoakes
My ini and hal files look like this (this is the latest version of Linuxcnc - 2.9.2)

I added to the ini file but have not changed the hal file yet (I can't see where to change it)

ini

# Generated by stepconf 1.1 at Tue May 21 18:01:10 2024
# If you make changes to this file, they will be
# overwritten when you run stepconf again

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

[DISPLAY]
DISPLAY = axis
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 = 2.50
MIN_LINEAR_VELOCITY = 0
MAX_LINEAR_VELOCITY = 25.00
CYCLE_TIME = 0.100
INTRO_GRAPHIC = linuxcnc.gif
INTRO_TIME = 5
PROGRAM_PREFIX = /home/garth/linuxcnc/nc_files
INCREMENTS = 5mm 1mm .5mm .1mm .05mm .01mm .005mm
GEOMETRY = XYUV

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

[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 = 100000
SERVO_PERIOD = 1000000

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

[TRAJ]
COORDINATES = X Y U V
LINEAR_UNITS = mm
ANGULAR_UNITS = degree
DEFAULT_LINEAR_VELOCITY = 2.50
MAX_LINEAR_VELOCITY = 25.00

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

#*** AXIS_X *******************************
[AXIS_X]
MAX_VELOCITY = 25.0
MAX_ACCELERATION = 750.0
MIN_LIMIT = -60000.0
MAX_LIMIT = 60000.0

[JOINT_0]
TYPE = LINEAR
HOME = 0.0
MIN_LIMIT = -60000.0
MAX_LIMIT = 60000.0
MAX_VELOCITY = 25.0
MAX_ACCELERATION = 750.0
STEPGEN_MAXACCEL = 937.5
SCALE = 320.0
FERROR = 1
MIN_FERROR = .25
HOME_OFFSET = 0.0
#******************************************

#*** AXIS_Y *******************************
[AXIS_Y]
MAX_VELOCITY = 25.0
MAX_ACCELERATION = 750.0
MIN_LIMIT = -60000.0
MAX_LIMIT = 60000.0

[JOINT_1]
TYPE = LINEAR
HOME = 0.0
MIN_LIMIT = -60000.0
MAX_LIMIT = 60000.0
MAX_VELOCITY = 25.0
MAX_ACCELERATION = 750.0
STEPGEN_MAXACCEL = 937.5
SCALE = 320.0
FERROR = 1
MIN_FERROR = .25
HOME_OFFSET = 0.0
#******************************************

#*** AXIS_U *******************************
[AXIS_U]
MAX_VELOCITY = 25.0
MAX_ACCELERATION = 750.0
MIN_LIMIT = -60000.0
MAX_LIMIT = 60000.0

[JOINT_2]
TYPE = LINEAR
HOME = 0.0
MIN_LIMIT = -60000.0
MAX_LIMIT = 60000.0
MAX_VELOCITY = 25.0
MAX_ACCELERATION = 750.0
STEPGEN_MAXACCEL = 937.5
SCALE = 320.0
FERROR = 1
MIN_FERROR = .25
HOME_OFFSET = 0.0
#******************************************

**********************

#*** AXIS_V *******************************
[AXIS_V]
MAX_VELOCITY = 25.0
MAX_ACCELERATION = 750.0
MIN_LIMIT = -60000.0
MAX_LIMIT = 60000.0

[JOINT_3]
TYPE = LINEAR
HOME = 0.0
MIN_LIMIT = -60000.0
MAX_LIMIT = 60000.0
MAX_VELOCITY = 25.0
MAX_ACCELERATION = 750.0
STEPGEN_MAXACCEL = 937.5
SCALE = 320.0
FERROR = 1
MIN_FERROR = .25
HOME_OFFSET = 0.0
#******************************************

#******************************************

hal

# Generated by stepconf 1.1 at Tue May 21 18:01:10 2024
# 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="0 out"
setp parport.0.reset-time 5000
loadrt stepgen step_type=0,0,0
loadrt pwmgen output_type=1

addf parport.0.read base-thread
addf stepgen.make-pulses base-thread
addf pwmgen.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
addf pwmgen.update servo-thread

net spindle-cmd-rpm => pwmgen.0.value
net spindle-on <= spindle.0.on => pwmgen.0.enable
net spindle-pwm <= pwmgen.0.pwm
setp pwmgen.0.pwm-freq 100.0
setp pwmgen.0.scale 1166.6666666666665
setp pwmgen.0.offset 0.11428571428571428
setp pwmgen.0.dither-pwm true
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 spindle-cw <= spindle.0.forward

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
net ystep => parport.0.pin-04-out
setp parport.0.pin-04-out-reset 1
net ydir => parport.0.pin-05-out
net zstep => parport.0.pin-06-out
setp parport.0.pin-06-out-reset 1
net zdir => parport.0.pin-07-out
net astep => parport.0.pin-08-out
setp parport.0.pin-08-out-reset 1
net adir => parport.0.pin-09-out
net spindle-cw => parport.0.pin-14-out
net spindle-pwm => parport.0.pin-16-out
net xenable => parport.0.pin-17-out

setp stepgen.0.position-scale [JOINT_0]SCALE
setp stepgen.0.steplen 1
setp stepgen.0.stepspace 0
setp stepgen.0.dirhold 37000
setp stepgen.0.dirsetup 37000
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 37000
setp stepgen.1.dirsetup 37000
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 37000
setp stepgen.2.dirsetup 37000
setp stepgen.2.maxaccel [JOINT_2]STEPGEN_MAXACCEL
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 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

Please Log in to join the conversation.

More
2 years 5 months ago #301356 by garthnoakes
I've wired the A and B outputs to two drivers (so according to the breakout board I now have X,Y,A and B). I've made an attempt to configure the ini and hal files - X and Y are working, but a U or V G1 does nothing

Please Log in to join the conversation.

More
2 years 5 months ago #301635 by garthnoakes
Managed to figure this out - I have independent X,Y,U and V working now. If anyone wants the config files, let me be more helpful than the forum was

Please Log in to join the conversation.

More
2 years 5 months ago #301638 by cmorley
You could make a 'filter' program to remove the U and V automatically before loading the program.
linuxcnc.org/docs/devel/html/gui/filter-programs.html

Please Log in to join the conversation.

More
2 years 5 months ago #301659 by andypugh
Using XY/UV is probably best if running LinuxCNC, then you can use the special "FOAM" mode supported by Axis (At least, other GUIs may also support this)

linuxcnc.org/docs/html/gui/axis.html#_us...in_foam_cutting_mode

Please Log in to join the conversation.

Time to create page: 0.142 seconds
Powered by Kunena Forum