Program stop causes random movement

More
08 Jun 2018 05:04 #111962 by mistik1
Every time I try to stop a job by using the stop button in my machine just goes off in a seemingly random direction before it finally stops

It maintains the current z height and tear off through the work or clamps or whatever happens to be there, it has cost me a few bits doing that.
Everything stops fine with EStop button or ESC keystroke, pause in the GUI also works fine.

I'm not sure if I should be posting this here is in the general forum but I am using gmoccapy. with linuxcnc 2.7.13

Thanks
More
08 Jun 2018 20:44 #112023 by PCW
I think a bit more information is needed here:

Hardware? (pc with parallel port, Mesa card, Ethercat, servo, steppers etc etc)

Specific setup options (post your hal and ini files)
More
09 Jun 2018 02:14 #112044 by andypugh
What is your stop button connected to?
More
10 Jun 2018 20:26 #112147 by mistik1
Here is my ini file:
# Generated by stepconf 1.1 at Sun May 22 17:50:12 2016
# If you make changes to this file, they will be
# overwritten when you run stepconf again

[EMC]
MACHINE = JamaicaCNC
DEBUG = 0

[DISPLAY]
DISPLAY = gmoccapy
PREFERENCE_FILE_PATH = gmoccapy_preferences
EDITOR = gedit
POSITION_OFFSET = RELATIVE
POSITION_FEEDBACK = ACTUAL
ARCDIVISION = 64
GRIDS = 10mm 20mm 50mm 100mm 1in 2in 5in 10in
MAX_FEED_OVERRIDE = 1.5
MIN_SPINDLE_OVERRIDE = 0.5
MAX_SPINDLE_OVERRIDE = 1.2
DEFAULT_LINEAR_VELOCITY = 0.40
MIN_LINEAR_VELOCITY = 0
MAX_LINEAR_VELOCITY = 4.00
#INTRO_GRAPHIC = linuxcnc.gif
INTRO_GRAPHIC = ./reggaebot.gif
INTRO_TIME = 4
PROGRAM_PREFIX = /home/mistik1/GCode
#PROGRAM_PREFIX = nc_subroutines
INCREMENTS = .1in .05in .01in .005in .001in .0005in .0001in
PYVCP = custompanel.xml

EMBED_TAB_NAME = Job Timer
EMBED_TAB_LOCATION = box_custom_1
EMBED_TAB_COMMAND = gladevcp -x {XID} job_timer.ui

EMBED_TAB_NAME = CNR
EMBED_TAB_LOCATION = box_cooling
EMBED_TAB_COMMAND = gladevcp -x {XID} jobboss.ui

EMBED_TAB_NAME = Probe Screen 
EMBED_TAB_LOCATION = ntb_user_tabs
EMBED_TAB_COMMAND = gladevcp  -x {XID} -u python/probe_screen.py probe_icons/probe_screen.glade

;EMBED_TAB_NAME = tool sensor
;EMBED_TAB_LOCATION = box_cooling
;EMBED_TAB_COMMAND = gladevcp -x {XID} -H tool_sensor.hal tool_sensor.glade

[MACROS]
MACRO = columns_and_rows X-Count Y-Count X-Gap Y-Gap Job_File Do-Finish Do-Cutout 

[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

# the Python plugins serves interpreter and task
[PYTHON]
# where to find Python code
# code specific for this configuration	
PATH_PREPEND=python
# generic support code
#PATH_APPEND=./python-stdglue

# import the following Python module
TOPLEVEL=python/toplevel.py

# the higher the more verbose tracing of the Python plugin
LOG_LEVEL = 0

[RS274NGC]
PARAMETER_FILE = linuxcnc.var
# Enables the reading of INI and HAL values from gcode
FEATURES=30

# is the sub, with is called when a error during tool change happens
ON_ABORT_COMMAND=O <on_abort> call

# The remap code
# parameters exposed by change_prolog/evaluated by change_epilog:
#    #<tool_in_spindle>
#    #<selected_tool>
#    #<current_pocket>
#    #<selected_pocket>
REMAP=M6  modalgroup=6 prolog=change_prolog ngc=change epilog=change_epilog
SUBROUTINE_PATH = nc_subroutines:/home/mistik1/GCode/Aubin

[TOOLSENSOR]
X = 4
Y = 12
Z = -1
MAXPROBE = -7
PROBEFEED=5
PROBEFEED_FAST=20
RAPID_SPEED=20


[CHANGE_POSITION]
X = 4
Y = 2
Z = -1

[EMCMOT]
EMCMOT = motmod
COMM_TIMEOUT = 1.0
COMM_WAIT = 0.010
#BASE_PERIOD = 65616
BASE_PERIOD = 89477
SERVO_PERIOD = 1000000

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

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

[TRAJ]
AXES = 3
COORDINATES = X Y Z
LINEAR_UNITS = inch
ANGULAR_UNITS = degree
CYCLE_TIME = 0.010
DEFAULT_VELOCITY = 0.40
MAX_VELOCITY = 4.00
POSITION_FILE = position.txt

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

[AXIS_0]
TYPE = LINEAR
HOME = 0.0
MAX_VELOCITY = 3.4
MAX_ACCELERATION = 10.0
STEPGEN_MAXACCEL = 12.5
SCALE = 320.0
FERROR = 0.05
MIN_FERROR = 0.01
MIN_LIMIT = -0.01
MAX_LIMIT = 82.0
HOME_OFFSET = 0.0

[AXIS_1]
TYPE = LINEAR
HOME = 0.0
MAX_VELOCITY = 4.0
MAX_ACCELERATION = 10.0
STEPGEN_MAXACCEL = 12.5
SCALE = 572.0
FERROR = 0.05
MIN_FERROR = 0.01
MIN_LIMIT = -0.01
MAX_LIMIT = 49.0
HOME_OFFSET = 0.0

[AXIS_2]
TYPE = LINEAR
HOME = 0.0
MAX_VELOCITY = 1.04500527519
#MAX_VELOCITY = 2
MAX_ACCELERATION = 3.0
STEPGEN_MAXACCEL = 3.75
SCALE = -10160.0
FERROR = 0.05
MIN_FERROR = 0.01
MIN_LIMIT = -8.0
MAX_LIMIT = 0.01
HOME_OFFSET = 0.0

Hal file:
# Generated by stepconf 1.1 at Sun May 22 17:50:12 2016
# If you make changes to this file, they will be
# overwritten when you run stepconf again
loadrt trivkins
loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[TRAJ]AXES
loadrt hal_parport cfg="0 out"
setp parport.0.reset-time 2500
loadrt stepgen step_type=0,0,0
loadrt pwmgen output_type=1
loadrt classicladder_rt numPhysInputs=15 numPhysOutputs=15 numS32in=10 numS32out=10 numFloatIn=10 numFloatOut=10

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 classicladder.0.refresh servo-thread
addf stepgen.update-freq servo-thread
addf pwmgen.update servo-thread

net spindle-cmd-rpm => pwmgen.0.value
net spindle-on <= motion.spindle-on => pwmgen.0.enable
net spindle-pwm <= pwmgen.0.pwm
setp pwmgen.0.pwm-freq 100.0
setp pwmgen.0.scale 1166.66666667
setp pwmgen.0.offset 0.114285714286
setp pwmgen.0.dither-pwm true
net spindle-cmd-rpm     <= motion.spindle-speed-out
net spindle-cmd-rpm-abs <= motion.spindle-speed-out-abs
net spindle-cmd-rps     <= motion.spindle-speed-out-rps
net spindle-cmd-rps-abs <= motion.spindle-speed-out-rps-abs
net spindle-at-speed    => motion.spindle-at-speed
net spindle-cw <= motion.spindle-forward
net spindle-ccw <= motion.spindle-reverse

net probe-in => motion.probe-input

net estop-out       => 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
net spindle-pwm     => parport.0.pin-14-out
net spindle-ccw     => parport.0.pin-16-out
net spindle-cw      => parport.0.pin-17-out
net estop-ext       <= parport.0.pin-10-in
net probe-in        <= parport.0.pin-15-in-not

setp stepgen.0.position-scale [AXIS_0]SCALE
setp stepgen.0.steplen 1
setp stepgen.0.stepspace 0
setp stepgen.0.dirhold 22425
setp stepgen.0.dirsetup 17425
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 22425
setp stepgen.1.dirsetup 17425
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 22425
setp stepgen.2.dirsetup 17425
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 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

# Load Classicladder without GUI (can reload LADDER GUI in AXIS GUI
loadusr classicladder --nogui custom.clp
Moderators: newbynobi
Time to create page: 0.064 seconds
Powered by Kunena Forum