Gmoccapy - A new screen for linuxcnc

More
23 Mar 2016 14:09 #72062 by cncnoob1979
Hey Norbert!

Thanks for the reply, Sorry I haven't responded as of yet. I will try to switch to a button to see if I get the same behavior. Where is the logic performed for Gmoccapy in reference to the E-Stop. I really like the design and will almost certainly be using this for my frontend.

I am replacing the computer I use to control the mill. I had a few complete freezes this past weekend. However I don't believe that this will be the culprit.

Did I mention I really like Gmoccapy? Also do you believe it will be possible to embed Linuxcnc-Features into a user tab? I have tried but failed at the attempt so far.

Thanks!

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

More
23 Mar 2016 20:20 #72070 by newbynobi
It is done in a combination of gladevcp, pytho status and gmoccapy.py.

Look in the gmoccapy.py file for on_hal_status as entry point.

Norbert

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

More
26 Apr 2016 00:08 #73881 by Robban
Is it possible to get rid of the error i get when i embed the gearchange tab in gmoccapy, see the two images!





The gearchange tab is connected to the postgui hal with this code that runs an "M" file that changes the scale and offset in for the pwm gen.
postgui hal 

net vaxel-580 halui.mdi-command-16 <= vaxlar.hal_radiobutton1
net vaxel-2800 halui.mdi-command-17 <= vaxlar.hal_radiobutton2
net vaxel-1700 halui.mdi-command-18 <= vaxlar.hal_radiobutton3
net vaxel-160 halui.mdi-command-19 <= vaxlar.hal_radiobutton4
net vaxel-800 halui.mdi-command-20 <= vaxlar.hal_radiobutton5 
net vaxel-490 halui.mdi-command-21 <= vaxlar.hal_radiobutton6 
net vaxel-450 halui.mdi-command-22 <= vaxlar.hal_radiobutton7 
net vaxel-2200 halui.mdi-command-23 <= vaxlar.hal_radiobutton8
net vaxel-1350 halui.mdi-command-24 <= vaxlar.hal_radiobutton9

gmoccapy.ini

#16
MDI_COMMAND=M100 P580 Q-0.005
#17
MDI_COMMAND=M100 P2800 Q-0.002
#18
MDI_COMMAND=M100 P1700 Q-0.005
#19
MDI_COMMAND=M100 P160 Q-0.005
#20
MDI_COMMAND=M100 P800 Q-0.005
#21
MDI_COMMAND=M100 P490 Q-0.005
#22
MDI_COMMAND=M100 P450 Q-0.005
#23
MDI_COMMAND=M100 P2200 Q-0.005
#24
MDI_COMMAND=M100 P1350 Q-0.005

M100 file

#!/bin/bash
scale=$1
offset=$2
halcmd setp pwmgen.0.scale $scale #Scale
halcmd setp pwmgen.0.offset $offset #Offset
exit 0
Attachments:

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

More
26 Apr 2016 19:28 #73932 by newbynobi
Please try to connect the signals with a own hal file, called together with the gladevcp embedding function in the ini file.
gladevcp -c gladevcp -u hitcounter.py -H manual-example.hal manual-example.ui

-c = the name of the component
-u = a python handler
-H a user hal file, please connect here

Norbert

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

More
02 May 2016 16:17 #74144 by lexxa
Hello!
1) I have a problem with halui.spindle.forward/reverse/stop and gmoccapy.

in mu postgui_halfile.hal
net hw_sp_fwd     halui.spindle.forward     hm2_5i25.0.7i70.0.2.input-16
net hw_sp_stop    halui.spindle.stop        hm2_5i25.0.7i70.0.2.input-15
net hw_sp_rev     halui.spindle.reverse     hm2_5i25.0.7i70.0.2.input-14

When spindle is stopped and I press "hw_sp_fwd", spindle starts to cw. When spindle is running and I pressing "hw_sp_rev", spindle stops, but software button spindle CCW is active and target speed of spindle equal of zero.
When spindle is running and I pressing "hw_sp_stop" spindle stops through time
After some cycle pressing of hw button stop-rev spindle starts with reverse direction yet.

When I run the spindle from gmoccapy sowtware button everything works as it should.

When changing direction, the output voltage change the sign to target voltage for a short time and then output voltage is set to zero.


2) When in list of G code is G95 and F0.1. The seted value of feed is zero. When F1.2 setted value of feed is 1.
I corrected it:
def _update_vel( self ):
        # self.stat.program_units will return 1 for inch, 2 for mm and 3 for cm
        real_feed = float( self.stat.settings[1] * self.stat.feedrate )
        if self.stat.program_units != 1:
            self.widgets.lbl_current_vel.set_text( "%d" % ( self.stat.current_vel * 60.0 * self.faktor ) )
            if "G95" in self.active_gcodes:
                feed_str = "%s" % self.stat.settings[1]
                real_feed_str = "F  %s" % real_feed
            else:
                feed_str = "%d" % self.stat.settings[1]
                real_feed_str = "F  %.d" % real_feed
        else:
            self.widgets.lbl_current_vel.set_text( "%.3f" % ( self.stat.current_vel * 60.0 * self.faktor ) )
            if "G95" in self.active_gcodes:
                feed_str = "%s" % self.stat.settings[1]
                real_feed_str = "F %s" % real_feed
            else:
                feed_str = "%.3f" % self.stat.settings[1]
                real_feed_str = "F %.3f" % real_feed

        # converting 0.0 to string brings nothing, so the string is empty
        # happens only on start up
        if not real_feed:
            feed_str = "0"
            real_feed_str = "F  0"

        self.widgets.lbl_active_feed.set_label( feed_str )
        self.widgets.lbl_feed_act.set_text( real_feed_str )
i.e
feed_str = "%d" % self.stat.settings[1] change to feed_str = "%s" % self.stat.settings[1]
real_feed_str = "F %.2f" % real_feed change to real_feed_str = "F %s" % real_feed
real_feed_str = "F %.4f" % real_feed change to real_feed_str = "F %s" % real_feed
and
        if not real_feed:
            feed_str = "0"
            real_feed_str = "F  0"

How add hal pins to correct control the spindle (and coolant, mist)?

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

More
03 May 2016 16:53 - 03 May 2016 17:00 #74188 by newbynobi

) I have a problem with halui.spindle.forward/reverse/stop and gmoccapy.

in mu postgui_halfile.hal

net hw_sp_fwd halui.spindle.forward hm2_5i25.0.7i70.0.2.input-16
net hw_sp_stop halui.spindle.stop hm2_5i25.0.7i70.0.2.input-15
net hw_sp_rev halui.spindle.reverse hm2_5i25.0.7i70.0.2.input-14


When spindle is stopped and I press "hw_sp_fwd", spindle starts to cw. When spindle is running and I pressing "hw_sp_rev", spindle stops, but software button spindle CCW is active and target speed of spindle equal of zero.
When spindle is running and I pressing "hw_sp_stop" spindle stops through time
After some cycle pressing of hw button stop-rev spindle starts with reverse direction yet.

When I run the spindle from gmoccapy sowtware button everything works as it should.

When changing direction, the output voltage change the sign to target voltage for a short time and then output voltage is set to zero.


I am pretty sure, that that is caused due to non perfect Hal connections.

if you do:
setp halui.spindle.forward 1
setp haluie.spindle.stop 1
setp halui.spindle.reverse 1

you will get problems, because the halui pin do only react on getting high.
setp halui.spindle.forward 1
setp halui.spindle.forward 0
setp haluie.spindle.stop 1
setp halui.spindle.forward 0
setp halui.spindle.reverse 1
setp halui.spindle.reverse 0

will work. Do you use momentary switches?

2) When in list of G code is G95 and F0.1. The seted value of feed is zero. When F1.2 setted value of feed is 1.

I just tested on gmoccapy 1.6.0 and if I enter in MDI G95 F0.1 I do get F0.1 and if I enter G95 F1.2 I get F1.2
I tested in metric and imperial units.
Or do you refer to the F value in active gcode?

Please check from MDI and tell me if that does work.
What version of gmoccapy do you use?

Norbert
Last edit: 03 May 2016 17:00 by newbynobi.

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

More
11 May 2016 18:21 #74524 by lexxa
Dear...

Do you use momentary switches?

Yes, I am use a momentary switches for all spindle button.

I'll try
PB spindle forward                                               halui.spindle.forward
------------|   |-----------------------------------------------------------(  )----------
      |                                                                |
      |  h.sp.fwd           h.sp.stop        h.sp.rev                  |
      |------|   |-----------------| / |-------------| / |-------------|
etc

Or do you refer to the F value in active gcode?

Yes, I refer F value in active G-code. Value F in "feeed override" is coorect with override value.

Sorry for my English...

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

More
19 Aug 2016 20:43 #79100 by sxyuklad
I tried to change GUI but no success. It gives me a bunch of errors, please see attached file for error log. Can please someone point me out what I am doing wrong?

I did change my settings in my INI file as described in the following documentation link under display section:
linuxcnc.org/docs/html/gui/gmoccapy.html

And the settings I set:

[DISPLAY]
DISPLAY = gmoccapy
PREFERENCE_FILE_PATH = gmoccapy_preferences
DEFAULT_LINEAR_VELOCITY = 166.666
MAX_LINEAR_VELOCITY = 166.666
MAX_FEED_OVERRIDE = 1.5
MAX_SPINDLE_OVERRIDE = 1.2
MIN_SPINDLE_OVERRIDE = 0.5
LATHE = 1
BACK_TOOL_LATHE = 1
PROGRAM_PREFIX = ../../nc_files/

But that is the only thing I changed believing settings only will do the whole job, no file copying, no installation or anything else. Am I doing it correct or I need to copy past some file in my config/turn folder or need to install anything extra?

Please help me out looking at the error log. Error log link:

forum.linuxcnc.org/media/kunena/attachme...82/gmoccapyerror.txt

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

More
19 Aug 2016 21:19 - 19 Aug 2016 21:21 #79102 by newbynobi
custom_postgui.hal:15: Pin 'pyvcp.spindle-speed' does not exist

You have connections to a pyvcp panel, that will not work with gmoccapy.
Just comment everythink related to pyvcp out and restart the GUI.

Norbert

Later connect the spindle speed to the related gmoccapy hal pin.
Last edit: 19 Aug 2016 21:21 by newbynobi.

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

More
20 Aug 2016 13:56 #79126 by sxyuklad
Thank you for your quick reply sir.

But I do want the gmoccapy to show my spindle speed. On top of that I also have a an ATC comp link.

I am attaching my config folder. Can you please have a quick look at my files and let me know where and how to connect my which pins to qhich gmocappy signals?
Attachments:

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

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