Spindle Control, external buttons, a gearbox comp, and Gmoccapy

More
02 Dec 2018 20:33 #121727 by RotarySMP
Hello Norbert,

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
More
03 Dec 2018 16:07 - 03 Dec 2018 16:09 #121753 by newbynobi

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


What do I need to do to have Gmoccapy's display and report the last commanded speed, rather than drop to zero?

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 see
gmoccapy.jog.jog-velocity......
you may use a potentiometer through analog value or a encoder, counting increments.
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
Last edit: 03 Dec 2018 16:09 by newbynobi.
The following user(s) said Thank You: RotarySMP
More
03 Dec 2018 18:57 - 03 Dec 2018 18:57 #121761 by RotarySMP

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?

newbynobi wrote:

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 see
gmoccapy.jog.jog-velocity......
you may use a potentiometer through analog value or a encoder, counting increments.
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

I think I'll use that button to toggle bettween rabbit and tortoise.

Mark
Last edit: 03 Dec 2018 18:57 by RotarySMP.
More
06 Dec 2018 17:14 #121962 by andypugh

RotarySMP wrote: 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
More
07 Dec 2018 10:17 - 07 Dec 2018 10:18 #121997 by newbynobi
Hallo Mark,

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
Last edit: 07 Dec 2018 10:18 by newbynobi.
More
07 Dec 2018 20:48 - 07 Dec 2018 20:49 #122016 by RotarySMP
Hello Norbert,

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
Last edit: 07 Dec 2018 20:49 by RotarySMP.
Moderators: newbynobi
Time to create page: 0.087 seconds
Powered by Kunena Forum