Machsupport Forum

Mach Discussion => Mach4 General Discussion => Topic started by: Bertho on February 23, 2023, 10:57:24 PM

Title: Keyboard jogging safety
Post by: Bertho on February 23, 2023, 10:57:24 PM
I had a nasty surprise today:
I was running a program and switched to editing the file and as expected, a new normal looking editing window opened up with the Gcode to be edited. All was fine until I used the cursor keys to move the cursor. The laser moved! The cursor keys were not released when the focus window was switched.

From a machine safety point, if something is non-standard or unexpected event happens, it can be a safety issue or a broken tool or part.
Mach4 ought to disable the modified keys when switching to the editor window.
Bertho
Title: Re: Keyboard jogging safety
Post by: joeaverage on February 26, 2023, 07:14:06 PM
Hi,
its your machine, if you want it to have specific behaviour then you'll have to program it that way.

According to the Keyboard plugin the Cursor keys are for jogging and jogging only. If yoyu wish them to have a different meaning then you'll
have to resolve the clash.

Craig
Title: Re: Keyboard jogging safety
Post by: rhtuttle on February 27, 2023, 11:42:56 AM
I almost never disagree with Craig!  But Bertho is correct on this one.  Quite dangerous. There was a thread on this when Mach4 first came out.  Mach should check to see if the main window has the focus.  If not then ignore it for Mach proper. 
MTCW
RT
Title: Re: Keyboard jogging safety
Post by: joeaverage on February 27, 2023, 02:16:00 PM
Hi,

Quote
Quite dangerous.

I don't disagree that it dangerous, but Bertho has created that danger by using the cursor keys which are as Mach standard jogging keys.
If you don't want the cursor keys to cause machine movement then for f*****ks sake, disable the jog features, otherwise you are relying on programming to prevent jogging
under some circumstances but not others....and then say Mach is dangerous when some unforeseen circumstance results in the underlying and standard jog functions of the
cursor keys to operate contrary to your intention.

Craig
Title: Re: Keyboard jogging safety
Post by: Bertho on February 27, 2023, 03:16:25 PM
Craig,
I understand the option is there to not use the jogging keys.  You are assuming that only one person is using a machine, there can be various employees, spouses, and kids.  I am not referring to my machine,  Mach4 is sold to the general public and it ought to not have unexpected behavior.

I cannot think of a situation where you need to use the cursor jogging while you are editing gcode.  They ought to be disabled if the main window is not in focus.

I have solved my problem by adding an iMach Vista CNC pendant.  I am writing this to help other people and help Mach4 to be even better.
Bertho
Title: Re: Keyboard jogging safety
Post by: joeaverage on February 27, 2023, 03:59:57 PM
Hi,
the use of the cursor keys for jogging has been standard in Mach, and I'm talking long before Mach4, in fact even Mach3, it was in Mach before that.
You seem to be under the misapprehension that the PC that runs Mach is a PC.....get this.....IT'S NOT!!. The PC that is used to run a Mach machine
is a 'MACHINE CONTROLLER' that just happens to use Windows as an operating system.

Once a PC is connected to a piece of machinery it is, and must now be considered dangerous. You would not tolerate unauthorised personnel come along
and start tapping buttons on a Fanuc machine controller on your VMC would you? No, of course not, it would be dangerous for an unqualified person to randomly start
pushing buttons or spinning the MPG. Why then would you permit such persons to randomly start using your machine controller on your machine. Just
because it looks like a PC does not mean it is so, and neither is it safe for an unqualified person to start using it as a PC as it could cause machine movement.
But, hey, that's what Mach4 IS, it's supposed to make a machine move, that is its primary purpose. If you start doing some word processing or something
then TURN MACH OFF!!

If you don't want the kids or your wife or anyone else to get hurt tell them to leave it alone....its not a toy. Do your kids jump in the car and try to drive it? No, you've taught them
that its not safe to do so.....yet! Well can you not teach them that your machine is potentially dangerous and that they shouldn't fiddle?.

Craig

PS The fact that you're still alive suggests tha you have not made the mistake of telling your wife not to drive the car, a man must be sensible after all!! :D
Title: Re: Keyboard jogging safety
Post by: Bertho on February 27, 2023, 04:51:05 PM
Craig,
You are arguing against a basic concept: Equipment should be as safe as is reasonably possible and they should behave in an expected manner.
Why argue that it needs to be unsafe?
Disable the keypad jogging if not in active mode and there is a safety improvement.

By the way, I was not using a word processor, I was using the Mach4 "Edit Gcode" function.
Bertho
Title: Re: Keyboard jogging safety
Post by: joeaverage on February 27, 2023, 05:01:32 PM
Hi,

Quote
By the way, I was not using a word processor, I was using the Mach4 "Edit Gcode" function.

That may be so but they keys are assigned as jogging keys in Mach4....are they not?. If you use those key what do you expect to happen?
The machine will move....that's what its supposed to do. If you don't want to have the machine move then disable the buttons, or Disable Mach.

Quote
Disable the keypad jogging if not in active mode and there is a safety improvement.

That is a perfectly good solution....then do it! Its not up to Mach4 or NFS to guess what your situation is. If they did that then there'd be hundreds complaining that
Keyboard Jogging disables all the time. If you have a requirement to make a machine safe then enact it, Mach4 provides all the tools necessary.

Craig

Title: Re: Keyboard jogging safety
Post by: SwiftyJ on February 27, 2023, 05:03:45 PM
You can use the following screen API call to get the active window name - scr.GetActiveWindowText(). You can monitor this in the PLC script and disable the keyboard output when it's not the name of the main GUI window. You can get the name of the main GUI with the following register "core/global/GuiName"
Title: Re: Keyboard jogging safety
Post by: joeaverage on February 27, 2023, 05:18:28 PM
Hi,
that's great idea Swifty.

What is the syntax to using 'scr.GetActiveWindowText()'?. I've never had much success with scr. functions.

Craig
Title: Re: Keyboard jogging safety
Post by: GOOMBA on February 28, 2023, 09:12:15 AM
KeyboardInputsToggle()
This is a function in the screen.

You can modify this function to also accept a variable for the state you'd like to set. ORR

Operator > Edit Screen > Click the Edit GCODE tab

Run the function once on enter (assuming your keyboard jogging is enabled always before going into EDIT GCODE.)
Then once again on exit. Essentially toggling it OFF on enter, then back ON upon exit.

Seems like too much logic involved when really. You've enabled keyboard jogging and lost your keyboard... it's a pendant now and nothing else.

I don't like the keyboard plugin for jogging, you should operate a machine tool with a pendant but the convince of a keyboard is unmatched.

Honestly we as a team at NFS should be better at providing end users with an easier "compatibility path" regarding what can and can't be used as a pendant in MACH4.
Many people don't even know where to start looking for a pendant compatible with MACH4 without some scripting or a plugin file. However we're fixing that.
We've helped this I think with the XHC pendant plugin we provide now. So thank Steve for that!, Also we've developed a pendant building utility that I'll make a post on

If anyone has safety concerns and would like their screen modified to meet their specific needs regarding the keyboard jogging OR ANY SAFTEY CONCERN. Message support and someone will help you with the coding aspect of this, we want to help :)
Title: Re: Keyboard jogging safety
Post by: Bertho on February 28, 2023, 09:46:26 AM
Thank you for responding.
My point is that the keyboard jogging only ought to be active in the main screen and that would solve the issue.

Pendant:
I have an old iMach pendant from Mach3 days.  Vista-CNC has a very easy procedure to update the firmware to be compatible with Mach4.
The installation on Mach4 was very smooth and it works fine.
Bertho