Gmoccapy machine on button

More
09 Nov 2017 17:06 #101571 by auto-mation-assist
The question I have is what command is gmoccapy using for the “machine on” function and how can I disable it via a hal pin to prevent the conflict shown in the attached picture. I use the latest linuxcnc rip development version and gmoccapy as the linuxcnc gui available on this date.

Here is some background information:

When I converted my Bridgeport clone milling machine to CNC a number of years back I still wanted to be able to retain and use every one of its manual functions. As such, the Z axis has a manual clamp that disconnects its ball screw when total manual mode is used. All linear axis have glass scales to provide position information to linuxcnc. When using this mode linuxcnc is only used to display axis positions using its DRO displays from the glass scale data it receives and some control functions.

In order to prevent large errors in position generated in linuxcnc when the axis positions are manually changed while the servo drives disabled the cnc function is automatically turned off via the halui.machine.off command. The linuxcnc operating mode is checked to be sure that it is in manual mode before this is allowed.

While working on some changes to this process this week I ran into an issue with two inputs, halui.machine.on and halui.machine.off. Normally there would only be a toggle type function for on or off not two separate commands. My code uses halui.machine.off with gmoccapy to turn the machine off but then gmoccapy’s machine on button can still be pushed while in full manual mode turning the linuxcnc back to on mode while in full manual mode. This conflict is shown with the halui.machine.is-on output as show in the attached picture. I don’t know what command gmoccapy uses to do this but it does not appear to be halui.machine.on

This conflict causes me to continuously have to verify off state in case the gmoccapy’s machine on button is pushed and if so immediately turn it back off with the halui.machine.off. If gmoccapy is allowed to turn the machine on it will generate large position errors that can cause violent axis movement when switching back to cnc control mode. Internally linxcnc must not be allowed to generate position errors while in true man mode with the present hal code. It just needs to display axis position data in its normal DRO locations.

My plans are to allow the return to cnc mode to restore the machines axis positions automatically to the ones before the switch to true manual mode was made via a button and a mdi command with stored angles.. Or perhaps clamp down on the PID functions and allow generated position errors to move back to those angles itself in a slow controlled rate of movement way.
My hal code automatically sets the halui.machine.on when exiting the use of the fully manual mode with no problems and stays at the last used full manual mode angles without further movement. The Z ball screw clamp needs to be re-tightened manually and a warning message is displayed on the touch screen to do that.




Attachments:

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

More
10 Nov 2017 22:12 #101633 by newbynobi
Halui pins for on and off are momentary switches, but you do use them as no/nc switches.

You should connect motion.motion-enable to your switch and if your switch is in manual, that pin should not be able to get true, meaning signals in line not parallel as now.

Gmoccapy use a python binding to set machine on. There is no gmoccapy hal pin for machine on.

Norbert
The following user(s) said Thank You: auto-mation-assist

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

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