Gmoccapy - A new screen for linuxcnc
14 Jan 2018 20:42 - 14 Jan 2018 20:44 #104455
by dhanger
Replied by dhanger on topic Gmoccapy - A new screen for linuxcnc
Hi. This is dhanger's son, Caleb. Last March he posted (page 130 of this thread) about trying to get a button into gmoccapy to control his spindle brake. I am trying to help him with this endeavor as I am pretty expert with Linux (which he doesn't use at all beyond LinuxCNC) and also have a much deeper background in programming.
Mostly hoping that newbynobi can chime in on this; your help would be most appreciated!
I have created a glade file called spindle_brake_button.glade which contains "window1" (I read that GladeVCP expects the exact name "window1") and within that window I made a single HAL toggle button, named spindle_brake_button and labeled "Spindle Brake". His main config files for his machine are dm4400.ini and dm4400.hal. After backing these up, I added the EMBED lines into dm4400.ini as follows:
When I start LinuxCNC using the dm4400 configuration, the button loads and displays to the right of the other spindle controls, so that much is working perfectly. What I'm not sure how to do is correctly connect the new button to the spindle brake itself in the spindle_brake_button.hal file. I see in dm4400.hal the following lines relevant to the spindle brake:
...
I have tried numerous different contents for spindle_brake_button.hal. At first, I had put the button into the window with no "container" since all we needed was the one button. So it was just window1 containing spindle_brake_button. In that setup, I tried all of the following for spindle_brake_button.hal:
All of these attempts result in the button *not* being displayed in the interface when loaded. I thought, "Well, maybe it *needs* the button to be inside another container within the window." So I added a vertical box with only one slot, called vbox1, and placed the button inside of *that*. Then I tried all the following for spindle_brake_button.hal:
All of these attempts resulted in the same thing -- the button no longer displays at all in the interface. If spindle_brake_button.hal is empty, or has a commented line, the button loads fine, but of course does nothing.
Can anyone (especially newbynobi) give me any pointers? Many thanks to any/all!
Cheers,
Caleb
Mostly hoping that newbynobi can chime in on this; your help would be most appreciated!
I have created a glade file called spindle_brake_button.glade which contains "window1" (I read that GladeVCP expects the exact name "window1") and within that window I made a single HAL toggle button, named spindle_brake_button and labeled "Spindle Brake". His main config files for his machine are dm4400.ini and dm4400.hal. After backing these up, I added the EMBED lines into dm4400.ini as follows:
EMBED_TAB_NAME = spindle_brake_button
EMBED_TAB_LOCATION = custom_box_4
EMBED_TAB_COMMAND = gladevcp -x {XID} -H spindle_brake_button.hal spindle_brake_button.glade
When I start LinuxCNC using the dm4400 configuration, the button loads and displays to the right of the other spindle controls, so that much is working perfectly. What I'm not sure how to do is correctly connect the new button to the spindle brake itself in the spindle_brake_button.hal file. I see in dm4400.hal the following lines relevant to the spindle brake:
net spindle-brake <= motion.spindle-brake
net spindle-brake => parport.0.pin-08-out
I have tried numerous different contents for spindle_brake_button.hal. At first, I had put the button into the window with no "container" since all we needed was the one button. So it was just window1 containing spindle_brake_button. In that setup, I tried all of the following for spindle_brake_button.hal:
net spindle_brake_button spindle_brake_button => gmoccapy.spindle_brake
net spindle_brake_button spindle_brake_button => spindle_brake
net spindle_brake_button => gmoccapy.spindle_brake
All of these attempts result in the button *not* being displayed in the interface when loaded. I thought, "Well, maybe it *needs* the button to be inside another container within the window." So I added a vertical box with only one slot, called vbox1, and placed the button inside of *that*. Then I tried all the following for spindle_brake_button.hal:
net spindle_brake_button vbox1.spindle_brake_button => gmoccapy.spindle_brake
net spindle_brake_button vbox1.spindle_brake_button => spindle_brake
net vbox1.spindle_brake_button => gmoccapy.spindle_brake
All of these attempts resulted in the same thing -- the button no longer displays at all in the interface. If spindle_brake_button.hal is empty, or has a commented line, the button loads fine, but of course does nothing.
Can anyone (especially newbynobi) give me any pointers? Many thanks to any/all!
Cheers,
Caleb
Last edit: 14 Jan 2018 20:44 by dhanger.
Please Log in or Create an account to join the conversation.
14 Jan 2018 21:27 #104465
by newbynobi
Replied by newbynobi on topic Gmoccapy - A new screen for linuxcnc
Hallo Calip,
all what you have done is basicly correct, but you do use wrong hal pin names.
Go to settings page and open halshow when the button is displayed. Look in there the exact name of the hal pin it should be something like spindle_brake_button.hal_button
The hal entry would be then similar to
net spindle-brake. spindle_brake_button.hal_button
If you start the gui from a terminal, you will see the errors.
This is not gmoccapy relatet, but you need to get basic knowledge about hal connections
Norbert
all what you have done is basicly correct, but you do use wrong hal pin names.
Go to settings page and open halshow when the button is displayed. Look in there the exact name of the hal pin it should be something like spindle_brake_button.hal_button
The hal entry would be then similar to
net spindle-brake. spindle_brake_button.hal_button
If you start the gui from a terminal, you will see the errors.
This is not gmoccapy relatet, but you need to get basic knowledge about hal connections
Norbert
Please Log in or Create an account to join the conversation.
15 Jan 2018 03:32 #104492
by dhanger
Replied by dhanger on topic Gmoccapy - A new screen for linuxcnc
Thanks for the quick reply, Norbert!
Okay, I looked in halshow and I found:
So, I edited my spindle_brake_button.hal to read:
As such, the button is loaded and displayed. I'll have to wait until tomorrow to test it, because my dad's down for the night and I don't know how to work the machine.
I also noted that in halshow alongside the first, there is also the following (note the presence of "-not"):
I'm guessing that I can use this instead, if the polarity of the button's control of the brake is backwards?
Thanks again for the feedback!
Cheers,
Caleb
Okay, I looked in halshow and I found:
spindle_brake_button.spindle_brake_button
So, I edited my spindle_brake_button.hal to read:
net spindle_brake spindle_brake_button.spindle_brake_button
As such, the button is loaded and displayed. I'll have to wait until tomorrow to test it, because my dad's down for the night and I don't know how to work the machine.
I also noted that in halshow alongside the first, there is also the following (note the presence of "-not"):
spindle_brake_button.spindle_brake_button-not
I'm guessing that I can use this instead, if the polarity of the button's control of the brake is backwards?
Thanks again for the feedback!
Cheers,
Caleb
Please Log in or Create an account to join the conversation.
15 Jan 2018 22:27 - 15 Jan 2018 22:29 #104527
by dhanger
Replied by dhanger on topic Gmoccapy - A new screen for linuxcnc
Caleb here again. Well, we tested it out and made some progress. It wasn't working at first, but I realized that I was mistakenly calling "spindle-brake" as "spindle_brake" (using an underscore instead of a dash). I fixed that and then we got the following error:
We found the relevant line in dm4400.hal:
We didn't know whether this was doing anything important or useful, so we commented it out. Then, the button loaded and worked, which we were delighted to see. I did have to reverse the polarity, which was as simple as using that "spindle_brake_button-not".
However, there used to be an *automatic* triggering of the spindle brake in certain situations (my dad could elaborate on this a lot better than I can), which is now gone. Seems pretty certain that we lost that functionality by commenting out the line about "motion.spindle-brake" from dm4400.hal, above. But we haven't gotten the new button to work without removing/commenting that line, as linuxcnc complains of conflict, also above. The hope now is to be able to have the new button work for manually toggling the spindle brake *and* keep the automatic triggering of the spindle brake in the situation(s) where it's needed...
spindle_brake_button.hal:1: Signal 'spindle-brake' can not add OUT pin 'spindle_brake_button.spindle_brake_button', it already has OUT pin 'motion.spindle-brake'
We found the relevant line in dm4400.hal:
net spindle-brake <= motion.spindle-brake
We didn't know whether this was doing anything important or useful, so we commented it out. Then, the button loaded and worked, which we were delighted to see. I did have to reverse the polarity, which was as simple as using that "spindle_brake_button-not".
However, there used to be an *automatic* triggering of the spindle brake in certain situations (my dad could elaborate on this a lot better than I can), which is now gone. Seems pretty certain that we lost that functionality by commenting out the line about "motion.spindle-brake" from dm4400.hal, above. But we haven't gotten the new button to work without removing/commenting that line, as linuxcnc complains of conflict, also above. The hope now is to be able to have the new button work for manually toggling the spindle brake *and* keep the automatic triggering of the spindle brake in the situation(s) where it's needed...
Last edit: 15 Jan 2018 22:29 by dhanger.
Please Log in or Create an account to join the conversation.
15 Jan 2018 23:07 #104531
by dhanger
Replied by dhanger on topic Gmoccapy - A new screen for linuxcnc
Hi Norbert-
This is Dan, Caleb's dad, the machine owner. Caleb refers to the 'automatic' spindle operation -- what he means is that because I have the spindle brake connected already to LinuxCNC it knows to automatically release the brake when a spindle motion command is given, and to apply the brake upon spindle stop. Somehow our alterations of the .hal file have removed that functionality in favor of manually toggling the brake with the new glade switch he is trying to add to the GUI.
This is Dan, Caleb's dad, the machine owner. Caleb refers to the 'automatic' spindle operation -- what he means is that because I have the spindle brake connected already to LinuxCNC it knows to automatically release the brake when a spindle motion command is given, and to apply the brake upon spindle stop. Somehow our alterations of the .hal file have removed that functionality in favor of manually toggling the brake with the new glade switch he is trying to add to the GUI.
Please Log in or Create an account to join the conversation.
15 Jan 2018 23:36 #104533
by Patrik T
Replied by Patrik T on topic Gmoccapy - A new screen for linuxcnc
It seems you have both functions working separately. To get the combined behavior you want you can use the logic hal components AND2, OR2. I read there was a programmer there, he'll fix this in a jiffy.
Google "LinuxCNC man and2"
Google "LinuxCNC man and2"
Please Log in or Create an account to join the conversation.
16 Jan 2018 09:05 #104541
by andypugh
Replied by andypugh on topic Gmoccapy - A new screen for linuxcnc
You first need to decide what behaviour you want. then figure out how to make it happen.
My lathe has a 3-position switch Off - Auto - On. I think I did that with the LUT5 component but a mux_generic ("bb4") could be used too.
LUT5 is very useful, but not especially obvious to non-programmers.
My lathe has a 3-position switch Off - Auto - On. I think I did that with the LUT5 component but a mux_generic ("bb4") could be used too.
LUT5 is very useful, but not especially obvious to non-programmers.
Please Log in or Create an account to join the conversation.
16 Jan 2018 10:32 #104545
by rodw
I think there would be many programmers out there today who find LUT5 "not especially obvious".
Don't get me started about today's programmers. I think I've had the dopiest one in the world working on my web site this last week on a project which should have taken a couple of hours to implement what was a very clear brief! I'm glad it was a fixed price and I'm not paying by the hour!
Replied by rodw on topic Gmoccapy - A new screen for linuxcnc
LUT5 is very useful, but not especially obvious to non-programmers.
I think there would be many programmers out there today who find LUT5 "not especially obvious".
Don't get me started about today's programmers. I think I've had the dopiest one in the world working on my web site this last week on a project which should have taken a couple of hours to implement what was a very clear brief! I'm glad it was a fixed price and I'm not paying by the hour!
Please Log in or Create an account to join the conversation.
16 Jan 2018 12:23 #104547
by dhanger
Replied by dhanger on topic Gmoccapy - A new screen for linuxcnc
Maybe a little background on my machine setup is in order. When I first set it up I used StepConf wizard and assigned the spindle brake to parport pin 8. I've used Axis in the past for a cnc router with no spindle brake, but with this machine when I assigned the pin, a checkbox for the spindle brake appeared in the Axis interface automatically. So I can switch the brake on and off manually when needed, and when running a program LinuxCNC takes care of the brake automatically. This is the exact behavior I want in gmocappy. Caleb is an experienced programmer, but he knows only what I've been able to explain about LinuxCNC hal files, which is only a small amount, so we're 'the blind leading the blind'.
I'll dig into the hal docs sometime soon, obviously I need a lot more savvy about that but just haven't taken the time. I thought this one little thing wouldn't be so obscure--at the moment it's the only thing that prevents me from using gmocappy, which is what I would prefer over Axis, especially since I went to the trouble of setting up a touch screen.
Dan
I'll dig into the hal docs sometime soon, obviously I need a lot more savvy about that but just haven't taken the time. I thought this one little thing wouldn't be so obscure--at the moment it's the only thing that prevents me from using gmocappy, which is what I would prefer over Axis, especially since I went to the trouble of setting up a touch screen.
Dan
Please Log in or Create an account to join the conversation.
16 Jan 2018 15:13 #104549
by andypugh
Replied by andypugh on topic Gmoccapy - A new screen for linuxcnc
What does the spindle-brake HAL look like in the working Axis config?
Please Log in or Create an account to join the conversation.
Time to create page: 0.152 seconds