Spindle Control, external buttons, a gearbox comp, and Gmoccapy
Thank you for Gmoccapy. Brilliant work. Now that I have my MAHO MH400E up and running, I am getting to know it, and it works great.
The MAHO uses discrete spindle speeds from gear ratios rather than continuously variable speeds from a VFD. Our gearbox comp sets the speed nearest to commanded speed, and returns this actual speed to the hal. I still have a bit of work still to get the gearbox.comp playing nicely with Gmoccapy. I would appreciate your input to the following issues...
1) I added a physical spindle Off button to my control panel. I wanted theis to mirror the behavior of the spindle off button in gmoccapy. I netted halui.spindle.stop to the gearbox.comp, to enable it to stop the spindle. How does gmoccapy's virtual button stop the spindle? I see no gmoccapy pin for this.
2) The Maho provides "Spindle is stopped" feedback with a time relay which closes 5 sec after a stop is commanded. In our gearbox.comp, we monitor this this signal as the inhibit to not change gear while the spindle is running. When a stop is commanded in Gmoccapy, in addition to the stop command, it sets the commanded speed to zero. Is this gmoccapy behavior, or linuxcnc? The result for my installation:
> spindle is commanded stop.
> it stops.
> after 5 sec the "spindle is stopped" relays closes removing the gearbox inhibit.
> gearbox.comp sees the new commanded speed = zero
> gearbox.comp changes gear into neutral.
What do I need to do to have Gmoccapy's display and report the last commanded speed, rather than drop to zero?
3) I have two encoders, one of feed-rate override, and the other I would like to use to set the continuous jogging speed, with its push button resetting a standard value. What do I need to do to add this to gmoccapy?
Mark
Please Log in or Create an account to join the conversation.
1) I added a physical spindle Off button to my control panel. I wanted theis to mirror the behavior of the spindle off button in gmoccapy. I netted halui.spindle.stop to the gearbox.comp, to enable it to stop the spindle. How does gmoccapy's virtual button stop the spindle? I see no gmoccapy pin for this.
gmoccapy sends the command to stop or start the spindle directly to the linuxcnc component, there is no pin for this.
To whatch the spindle state, you may use:
spindle.0.on
or
halui.spindle.0.is-on
to start or stop just use the corresponding halui pin
If you look at the info panel you will see, that gmoccapy is displaying the commanded spindle vel correct, go to MDI and enter S2000 M3, see the S value in the info panel. But there is no hal pin to get the values. If you look at spindle.0.speed-cmd-rps you will see, that this value will drop to null as soon as the spindle is not spinning. Internally gmoccapy uses the stat interface to get the speed,What do I need to do to have Gmoccapy's display and report the last commanded speed, rather than drop to zero?
its around line 3220 you will find speed = self.stat.spindle[0]. That value is not exported as hal pin.
3) I have two encoders, one of feed-rate override, and the other I would like to use to set the continuous jogging speed, with its push button resetting a standard value. What do I need to do to add this to gmoccapy?
gmoccapy offers several hal pin to set the jog velocity, please see
gmoccapy.jog.jog-velocity......
There is no way to use a button to reset to default value. You may include a button as embedded tab and handle that behavior in hal.
I am not sure if you will get unexpected behavior if you set a direct value with a hal pin and use at the same time an encoder, so please test first in a sim config.
Norbert
Please Log in or Create an account to join the conversation.
1) gmoccapy sends the command to stop or start the spindle directly to the linuxcnc component, there is no pin for this.
To whatch the spindle state, you may use:spindle.0.on or halui.spindle.0.is-on
to start or stop just use the corresponding halui pin.
Oh, we didn't realise you could interact with the main linuxcnc component directly. Our comp creates pins and we interface everything externally. Is there a "how to" somewhere which describes how to do this direct interface?
What do I need to do to have Gmoccapy's display and report the last commanded speed, rather than drop to zero?
I think I'll use that button to toggle bettween rabbit and tortoise.
If you look at the info panel you will see, that gmoccapy is displaying the commanded spindle vel correct, go to MDI and enter S2000 M3, see the S value in the info panel. But there is no hal pin to get the values. If you look at spindle.0.speed-cmd-rps you will see, that this value will drop to null as soon as the spindle is not spinning. Internally gmoccapy uses the stat interface to get the speed,
its around line 3220 you will find speed = self.stat.spindle[0]. That value is not exported as hal pin.3) I have two encoders, one of feed-rate override, and the other I would like to use to set the continuous jogging speed, with its push button resetting a standard value. What do I need to do to add this to gmoccapy?
gmoccapy offers several hal pin to set the jog velocity, please seeyou may use a potentiometer through analog value or a encoder, counting increments.gmoccapy.jog.jog-velocity......
There is no way to use a button to reset to default value. You may include a button as embedded tab and handle that behavior in hal.
I am not sure if you will get unexpected behavior if you set a direct value with a hal pin and use at the same time an encoder, so please test first in a sim config.
Norbert
Mark
Please Log in or Create an account to join the conversation.
Oh, we didn't realise you could interact with the main linuxcnc component directly. Our comp creates pins and we interface everything externally. Is there a "how to" somewhere which describes how to do this direct interface?
If you are working in Python then it is fairly easy:
linuxcnc.org/docs/2.7/html/config/python-interface.html (note that some things are different in the master version, look at the master docs if that is what you are using)
I don't think you can do anything like that in C. The "canonical interface" is in C++ and I don't think that works in realtime comps. (But I have never tried, and this is a guess).
You could _try_ calling functions direct: github.com/LinuxCNC/linuxcnc/blob/master...l_intf/canon.hh#L242
Please Log in or Create an account to join the conversation.
I need to retrofit a DECKEL FP4, that machine also uses a gearbox.
Are you willing to share your gearbox.comp?
That would help, need to begin from Null.
Norbert
Please Log in or Create an account to join the conversation.
It is all posted to github . My friend Sergey did the programming. Since he is a professional coder, it is very well documented. We also posted all the assumptions into the associated Wiki.
I'll be happy to help you with this.
I believe that the big difference between the MAHO MH and the Deckel FPgearboxes is that the MAHO rotates the shafts in both directions between ends stops, the FP shafts can rotate in 360° till they reach the correct position.
Mark
Please Log in or Create an account to join the conversation.
When I net gmoccapy.turtle-jog to an external momentary switch the state change do not latch, the way it does with the on screen button. It only goes to turtle as long as I hold down the button. What would I have to do to have the state change and latch with each push of my physical momentary button please?
Mark
Please Log in or Create an account to join the conversation.
turtle jog button is a toggle button and the corresponding hal pin will react to any change. So if you want to use a momentary switch to toggle the button, please take a look to the hal component toggle2nist.
That exactly to solve your issue.
Norbert
P.S. Sorry for the very late answer
Please Log in or Create an account to join the conversation.
Are you making progress on implementing that Deckel gearbox.comp?
Mark
Please Log in or Create an account to join the conversation.
Or even later, lot of work to do?
Norbert
Please Log in or Create an account to join the conversation.