Spindle control using XHC-WHB04B-6 pendant

More
31 Oct 2023 16:07 #284197 by pistrix
Can somebody please point me to where I can read about how Gmoccapy operates the spindle. Specifically, how does it take into account the Spindle Starting RPM in Settings (or the parameter [DISPLAY] DEFAULT_SPINDLE_SPEED in the ini file) if S value is not yet specified?

I am asking this because I have an issue with starting the spindle using my pendant: The button to start the spindle activates the spindle through halui.spindle.0.start but if the S value is not yet specified, it sets the speed to 100 RPM (also, if S is specified, it starts the spindle to S+100 RPM which is even more puzzling). This creates all sorts of problems... I would like the pendant to start the spindle the same way as does the Gmoccapy - to the RPMs set in Settings if S is not yet specified or to the S value if specified.

I thought that understanding how Gmoccapy does it will give me an idea how to implement this on my pendant.

Here are the signals related to spindle and the pendant:

net   pdnt.spindle.is-on                           whb.halui.spindle.is-on                           spindle.0.on
net   pdnt.spindle.start                            whb.halui.spindle.start                            halui.spindle.0.start
net   pdnt.spindle.stop                            whb.halui.spindle.stop                             halui.spindle.0.stop
net   pdnt.spindle.forward                       whb.halui.spindle.forward                        halui.spindle.0.forward
net   pdnt.spindle.reverse                       whb.halui.spindle.reverse                        halui.spindle.0.reverse
net   pdnt.spindle.increase                      whb.halui.spindle.increase                      halui.spindle.0.increase      
net   pdnt.spindle.decrease                     whb.halui.spindle.decrease                     halui.spindle.0.decrease      
net   pdnt.spindle-speed-abs                   whb.halui.spindle-speed-cmd                  spindle.0.speed-out-abs         
net   pdnt.spindle-override.scale              whb.halui.spindle-override.scale             halui.spindle.0.override.scale 
net   pdnt.spindle.override.value              halui.spindle.0.override.value                  whb.halui.spindle-override.value
net   pdnt.spindle.override.increase         whb.halui.spindle-override.increase        halui.spindle.0.override.increase
net   pdnt.spindle.override.decrease        whb.halui.spindle-override.decrease       halui.spindle.0.override.decrease  

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

More
19 Nov 2023 15:40 #285909 by pistrix
Nobody? Anyway, I will try to find a solution and write here if I succeed. :)

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

More
12 Dec 2023 21:54 #287981 by HansU
Sorry for the late reply.
The [DISPLAY] DEFAULT_SPINDLE_SPEED value is only taken for the first time if no gmoccapy preference file is available. After that the starting speed will be set by the gmoccapy settings:
 Spindle
  • Starting RPM - Sets the rpm to be used if the spindle is started and no S value has been set.NoteThis value will be presetted according to your settings in
    [DISPLAY] DEFAULT_SPINDLE_SPEED of your INI file. If you change the settings on the settings page, that value will be default from that moment, your INI file will not be modified.

See linuxcnc.org/docs/devel/html/gui/gmoccapy.html#_hardware

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

More
24 Dec 2023 16:14 #289008 by pistrix
Thank you. I guess you missed what I wanted to ask. I would like to know "how" gmoccapy does it. I know where the settings are but I would like to know the mechanism behind operating the spindle. I wrote in my previous message why I need this.

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

More
30 Dec 2023 12:02 #289373 by HansU
If you have not programmed a S word or have set S 0, then the speed defined in the settings is used.
For any other programmed S word, this value will be used.

Attachments:

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

More
30 Dec 2023 15:01 #289383 by pistrix
Thank you for your patience and please allow me to explain my issue again:

I have a pendant with the button to start the spindle. It does so through halui.spindle.0.start but if the S value is not yet specified, it sets the speed to 100 RPM. This creates all sorts of problems...

I would like the pendant to start the spindle the same way as does Gmoccapy - to the RPMs set in Settings if S is not yet specified or to the S value if specified.

Do you maybe have an idea how to implement this?

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

More
30 Dec 2023 15:20 - 30 Dec 2023 15:21 #289384 by Aciera
Gmoccapy uses the python interface command channel to start the spindle:
        if command == "stop":
            # documentation of self.command.spindle()
            # linuxcnc.spindle(direction, speed, spindle=0)
            self.command.spindle(0)
            self.widgets.lbl_spindle_act.set_label("S 0")
        elif command == "forward":
            self.command.spindle(1, rpm_out)
        elif command == "reverse":
            self.command.spindle(-1, rpm_out)
        else:
            LOG.debug("Something went wrong, we have an unknown spindle widget {0}".format(command))
Last edit: 30 Dec 2023 15:21 by Aciera.
The following user(s) said Thank You: pistrix

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

More
30 Dec 2023 15:29 #289385 by Aciera
linuxcnc.org/docs/html/config/python-interface.html

You could create a custom python component to control the spindle using the python interface
The following user(s) said Thank You: pistrix

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

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