Gmoccapy - A new screen for linuxcnc

More
15 Feb 2017 21:59 #88016 by Patrik T
Hi Norbert
Thanks for making Gmoccapy, and thanks for helping me.
I thought this would be easy to fix when i knew what to look for, but I have removed all the custom hal files like this:
[HAL]
HALUI = halui
HALFILE = emco-lathe-gmoccapy.hal
;HALFILE = joypad.hal
;HALFILE = custom.hal
;POSTGUI_HALFILE = custom_postgui.hal

# I also commented out the ui handler python script.
[DISPLAY]
#.......
;EMBED_TAB_NAME = xbox_1
;EMBED_TAB_LOCATION = box_left
;EMBED_TAB_COMMAND = gladevcp -u myuihandler.py -x {XID} xboxgui.ui

I don't think I have made any changes in emco-lathe-gmoccapy.hal. Anyway, I have commented out everything but this:
# Generated by stepconf 1.1 at Sun Jan 22 06:31:44 2017
# 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="0x378 out"
setp parport.0.reset-time 1000
loadrt stepgen step_type=0,0
loadrt encoder num_chan=1
loadrt abs count=1
loadrt scale count=1
loadrt lowpass count=1

#My stuff.
#loadusr -W hal_input -KRAL Gamepad
#loadusr io, was already loaded.

addf parport.0.read base-thread
addf stepgen.make-pulses base-thread
addf encoder.update-counters base-thread
addf parport.0.write base-thread
addf parport.0.reset base-thread

addf stepgen.capture-position servo-thread
addf encoder.capture-position servo-thread
addf motion-command-handler servo-thread
addf motion-controller servo-thread
addf stepgen.update-freq servo-thread
addf abs.0 servo-thread
addf scale.0 servo-thread
addf lowpass.0 servo-thread

#net spindle-cmd-rpm     <= motion.spindle-speed-out
#net spindle-cmd-rpm-abs <= motion.spindle-speed-out-abs
# The rest is also commented out.

Still getting the startup warning. I don't know what else I can disable to locate the error.

Patrik

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

More
03 Mar 2017 22:01 - 03 Mar 2017 22:05 #88965 by Patrik T
Hi
New information:
I have managed to get rid of the startup warning by commenting out one line in the ini file,
[EMC] MACHINE = my-emco-lathe, see below.

# Generated by stepconf 1.1 at Sun Jan 22 06:21:10 2017
# If you make changes to this file, they will be
# overwritten when you run stepconf again

[EMC]
;MACHINE = my-emco-lathe
DEBUG = 0

What does this mean? Where is this information used? Any ideas of where to go next?

Best regards
Patrik
Last edit: 03 Mar 2017 22:05 by Patrik T. Reason: Edited, I do not have full functionality on the machine as I erroneously stated initially.

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

More
03 Mar 2017 22:36 #88969 by Patrik T
Excuse my mildly confusing last post. I mistakenly thought EMC was an abbreviation for EMergenCy (stop).

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

More
03 Mar 2017 23:10 #88971 by Patrik T
Axis does not give any startup warnings if I switch to axis by doing this in the ini file, see below, and commenting some Gmoccapy stuff in the postgui.hal file.

[DISPLAY]
DISPLAY = axis
# CYCLE_TIME = 150

If I switch back to Gmoccapy with (or without) the same stuff commented out in the postgui.hal file, then the startup warning is still there.

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

More
05 Mar 2017 09:59 - 05 Mar 2017 10:00 #89031 by Patrik T
This seems to be a workaround.

In a comp:
///////////////////////////////////////////////////////////////
// Hack the startup warning.
///////////////////////////////////////////////////////////////

if (!is_manual && is_idle && !is_paused && warning_hack_counter++ < 200) // Overflow will not annoy.
	mode_manual = true;
Last edit: 05 Mar 2017 10:00 by Patrik T. Reason: Preview does not look like the actual post.

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

More
05 Mar 2017 11:35 #89035 by newbynobi
Hallo Patrik,

could you please post your complete config?
I will check what happen.

Norbert

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

More
05 Mar 2017 17:33 #89047 by Patrik T
Thank you.
This is one configuration that generates the startup warning.

The .ini file emco-lathe-gmoccapy.ini
# Generated by stepconf 1.1 at Sun Jan 22 06:21:10 2017
# If you make changes to this file, they will be
# overwritten when you run stepconf again
# File name emco-lathe-gmoccapy.ini

[EMC]
MACHINE = my-emco-lathe
DEBUG = 0

[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 = 4.0
MIN_SPINDLE_OVERRIDE = 0.3
MAX_SPINDLE_OVERRIDE = 2.2
# DEFAULT_SPINDLE_SPEED = 1000
;DEFAULT_LINEAR_VELOCITY = 5.0
;MIN_LINEAR_VELOCITY = 0.0
;MAX_LINEAR_VELOCITY = 8.0
INTRO_GRAPHIC = linuxcnc.gif
INTRO_TIME = 5
PROGRAM_PREFIX = /home/patrik/linuxcnc/nc_files
# OPEN_FILE = /home/patrik/linuxcnc/nc_files/g76_test_1.ngc
INCREMENTS = 5mm 1mm .5mm .1mm .05mm .01mm .005mm
LATHE = 1
BACK_TOOL_LATHE = 0
CYCLE_TIME = 150

;EMBED_TAB_NAME = xbox_1
;EMBED_TAB_LOCATION = box_left
;# EMBED_TAB_LOCATION = box_custom_1
;EMBED_TAB_COMMAND = gladevcp -u myuihandler.py -x {XID} xboxgui.ui

;EMBED_TAB_NAME = pyngcgui
;EMBED_TAB_LOCATION = ntb_preview
;EMBED_TAB_COMMAND = gladevcp -x {XID} pyngcgui_touchy_popupkeyboard.ui
;NGCGUI_FONT = Helvetca -12 normal
;NGCGUI_PREAMBLE = mm_lathe_std.ngc
;NGCGUI_SUBFILE = id.ngc
;NGCGUI_SUBFILE = od.ngc
;NGCGUI_SUBFILE = taper-od.ngc
;NGCGUI_SUBFILE = g76base.ngc
;NGCGUI_SUBFILE = g76diam.ngc
;NGCGUI_SUBFILE = ""
;NGCGUI_OPTIONS = nom2
;GCMC_INCLUDE_PATH = ../../nc_files/gcmc_lib

[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
RS274NGC_STARTUP_CODE = G7 G18 G21 G90 G92.2 G95 F0.03 G97 S1000 G64 P.01
SUBROUTINE_PATH = ../../nc_files:../../nc_files/ngcgui_lib/lathe:../../nc_files/ngcgui_lib/utilitysubs
USER_M_PATH = ../../nc_files/ngcgui_lib/mfiles

[MACROS]
MACRO = go_to_position X-pos Y-pos Z-pos

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

[HAL]
HALUI = halui
HALFILE = emco-lathe-gmoccapy.hal
;HALFILE = joypad.hal
;HALFILE = custom.hal
;POSTGUI_HALFILE = custom_postgui.hal

[HALUI]
# add halui MDI commands here (max 64) 
MDI_COMMAND = g90 g0 x40
MDI_COMMAND = g91 g0 x5

[TRAJ]
AXES = 3
COORDINATES = X Z
LINEAR_UNITS = mm
ANGULAR_UNITS = degree
CYCLE_TIME = 0.010
NO_FORCE_HOMING = 1
# These make squat in axis! But something in Gmoccapy.
DEFAULT_VELOCITY = 5.0
MAX_VELOCITY = 8.0

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

[AXIS_0]
TYPE = LINEAR
HOME = 0.0
HOME_SEQUENCE = 0
MAX_VELOCITY = 5.70003648023
MAX_ACCELERATION = 60.0
STEPGEN_MAXACCEL = 75.0
SCALE = 3200.0
FERROR = 1
MIN_FERROR = .25
MIN_LIMIT = -50.0
MAX_LIMIT = 0.1
HOME_OFFSET = 1.0
HOME_SEARCH_VEL = 5.000000
HOME_LATCH_VEL = -0.156250
HOME_IGNORE_LIMITS = YES

[AXIS_2]
TYPE = LINEAR
HOME = 0.0
HOME_SEQUENCE = 1
MAX_VELOCITY = 5.70003648023
MAX_ACCELERATION = 60.0
STEPGEN_MAXACCEL = 75.0
SCALE = 3200.0
FERROR = 1
MIN_FERROR = .25
MIN_LIMIT = -100.0
MAX_LIMIT = 100.0
HOME_OFFSET = 0.0

[SPINDLE]
MAX_RPS = 37.5
MAX_RPSS = 70

[JOYPAD]
DEADBAND_X = 0.13
OFFSET_X = -0.05
DEADBAND_Y = 0.09
OFFSET_Y = 0.12
SLOW_PERCENTAGE = .01


The .hal file emco-lathe-gmoccapy.hal
# Generated by stepconf 1.1 at Sun Jan 22 06:31:44 2017
# If you make changes to this file, they will be
# overwritten when you run stepconf again
# File name emco-lathe-gmoccapy.hal

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="0x378 out"
setp parport.0.reset-time 1000
loadrt stepgen step_type=0,0
loadrt encoder num_chan=1
loadrt abs count=1
loadrt scale count=1
loadrt lowpass count=1

# My stuff.
# loadusr -W hal_input -KRAL Gamepad
# loadusr -W hal_input -KRAL Keyboard
# loadusr io, was already loaded.

addf parport.0.read base-thread
addf stepgen.make-pulses base-thread
addf encoder.update-counters base-thread
addf parport.0.write base-thread
addf parport.0.reset base-thread

addf stepgen.capture-position servo-thread
addf encoder.capture-position servo-thread
addf motion-command-handler servo-thread
addf motion-controller servo-thread
addf stepgen.update-freq servo-thread
addf abs.0 servo-thread
addf scale.0 servo-thread
addf lowpass.0 servo-thread

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

setp encoder.0.position-scale 76.6512
# setp encoder.0.position-scale 76.000000
net spindle-position encoder.0.position => motion.spindle-revs
net spindle-velocity-feedback-rps encoder.0.velocity => motion.spindle-speed-in
net spindle-index-enable encoder.0.index-enable <=> motion.spindle-index-enable
net spindle-phase-a encoder.0.phase-A
net spindle-phase-b encoder.0.phase-B
net spindle-index encoder.0.phase-Z

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 estop-ext       <= parport.0.pin-10-in
net max-home-x      <= parport.0.pin-11-in-not
net spindle-phase-a <= parport.0.pin-12-in
net spindle-phase-b <= parport.0.pin-13-in
net spindle-index   <= parport.0.pin-15-in

setp stepgen.0.position-scale [AXIS_0]SCALE
setp stepgen.0.steplen 1
setp stepgen.0.stepspace 0
setp stepgen.0.dirhold 12000
setp stepgen.0.dirsetup 12000
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 max-home-x => axis.0.home-sw-in
net max-home-x => axis.0.pos-lim-sw-in

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

net estop-out <= iocontrol.0.user-enable-out
net estop-ext => iocontrol.0.emc-enable-in
# setp iocontrol.0.emc-enable-in 1

loadusr -W hal_manualtoolchange
net tool-change iocontrol.0.tool-change => hal_manualtoolchange.change
net tool-changed-clicked 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

Don't spend too much time on it, I have found a workaround. There are other things in Gmoccapy that I would rather have fixed.

Best regards
Patrik

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

More
05 Mar 2017 18:27 #89050 by newbynobi
Hallo Patric,

I just copied the files in gmoccapy, and saved them in my config dir. I can start the config, without any warning!

What release of gmoccapy do you use?

Norbert

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

More
05 Mar 2017 21:26 #89062 by Patrik T
Thanks for checking.
I use Gmoccapy 1.5.6.8.
I noticed that if I start with the wireless xbox controller turned off, I do not get any warning. But if I disable it altogether, like in the config I posted, I do get the warning. These are the changes I have made to linux since the install.

patrik@debian:~$ sudo nano /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="lapic quiet rootdelay=5 idle=poll nomodeset grub_gfxmode=1280x1024x24"
patrik@debian:~$ sudo update-grub

patrik@debian:~$ apt-get update
patrik@debian:~$ sudo apt-get install gedit
patrik@debian:~$ sudo apt-get install gedit-plugins

patrik@debian:~$ sudo apt-get install xboxdrv

patrik@debian:~$ sudo nano /etc/rc.local
xboxdrv --silent --detach-kernel-driver
patrik@debian:~$ sudo nano /etc/modprobe.d/fbdev-blacklist.conf
blacklist xpad
patrik@debian:~$ less /proc/bus/input/devices

patrik@debian:~$ sudo apt-get install linuxcnc-dev

patrik@debian:~$ sudo halcompile --install myxpadlathe.comp

patrik@debian:~$ sudo apt-get install gawk lm-sensors binutils mesa-utils hddtemp

patrik@debian:~$ cd /usr/local/bin/
patrik@debian:~$ sudo wget -Nc smxi.org/inxi
patrik@debian:~$ sudo chmod +x inxi
patrik@debian:~$ sudo inxi -F all

patrik@debian:~$ sudo apt-get install mesa-utils
patrik@debian:~$ glxgears

After the warning is reset it does not come back or cause any further problems.
So, I can live with the workaround I posted.

Best regards
Patrik

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

More
20 Mar 2017 22:58 #89973 by Patrik T
Hi again.

May i ask if it is possible to access the Gmoccapy Gremlin preview from a python script?
I am using an embedded tab with a python handler like so:

EMBED_TAB_NAME = xbox_1
EMBED_TAB_LOCATION = box_left
# EMBED_TAB_LOCATION = box_custom_1
EMBED_TAB_COMMAND = gladevcp -u myuihandler.py -x {XID} xboxgui.ui

I want to be able to clear, pan and zoom from my python script.

Best regards
Patrik

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

Moderators: newbynobiHansU
Time to create page: 0.315 seconds
Powered by Kunena Forum