Hello Guest it is March 28, 2024, 09:52:02 AM

Author Topic: Remote jog pendant again  (Read 38393 times)

0 Members and 1 Guest are viewing this topic.

Remote jog pendant again
« on: January 17, 2013, 11:11:33 AM »
I know I have posted this topic before but I'd like to see if anyone has come up with anything new lately. Has anyone come up with a remote jog pendant for MACH with a Galil controller? I see that you cannot use the second parallel port with the Galil plugin. I can do the programming for the Galil to use the inputs for jogging but have no idea how to update the position info back to MACH or even if that can be done. Perhaps someone has discovered a way to do this. I thought it was worth asking again. It sure would be handy instead of reaching for the keyboard all the time.   Thanks, Allen

Offline smurph

*
  • *
  •  1,544 1,544
  • "That there... that's an RV."
    • View Profile
Re: Remote jog pendant again
« Reply #1 on: January 20, 2013, 05:49:02 PM »
Allen,

If you just do a JG based on an input going high and a ST when it goes low, then you are halfway there.  An axis selector switch would be required too.  You can use 2 inputs for a 4 position switch.  0 inputs high == X, 1st input high == Y, second input high == Z. and both inputs high == A.  So, two inputs for direction and two inputs for axis selection.  The rest is Galil programming.  You could burn your controller with a #AUTO to launch the code in it's own thread.  The tricky thing would be to honor the Mach jog enable.  You don't want to jog while the machine is running g code, etc...  Basically, I think you could check to see if the desired axis is moving or in a coordinated move before jogging it.

The EASY part is Mach will get updated with the position automatically from the data record.  :)

The other thing you can do is similar to what I do.  Use the inputs to drive a brain that presses mach buttons.  I use Modbus for this, but you could do it with Galil inputs as well.

I have a panel mount axis selector, two jog direction buttons, and a jog feed rate analog pot that I simply could NOT live without.

Steve
Re: Remote jog pendant again
« Reply #2 on: January 21, 2013, 08:27:54 AM »
smurph,
Thanks for the info. The Galil programming is the easy part for me.
So is Mach constantly talking to Galil or do you have to run a loop to tell Mach to access the data record?

Could I see the brain you are using? I have never tried to write one and have no experience with brains(barely use my own)

Thanks,
Allen

Offline smurph

*
  • *
  •  1,544 1,544
  • "That there... that's an RV."
    • View Profile
Re: Remote jog pendant again
« Reply #3 on: January 21, 2013, 10:15:59 PM »
Well... Mach is constantly talking to the Galil plugin which is constantly talking to the Galil.  The Galil plugin gets the data record from the Galil every 100ms.  And then it forwards all of that information to Mach.  Updating position, velocity, inputs, and outputs, etc...  So that is all automatic.  For instance, for a jog from the keyboard or the Mach screen, we just issue a Galil JG command.  And when you let off the button, we just issue a ST command.  We don't query the Galil for any information in the interim between the button press and when you release it because that is all happening behind the scene.  So the same thing will happen if your Galil code issues the JG command.

I'll post up my jog brains when I get downstairs to turn on the machine to get them.  They are based on user LEDs.  I have modbus driving the LEDs from the modbus device (Pokeys 56E) inputs and the jog brains just look at the LEDs to do the button presses, etc...  So you could use Galil inputs (regular or extended) to drive some LEDs and use the brain files pretty much unmolested.  LOL 

Steve
Re: Remote jog pendant again
« Reply #4 on: January 22, 2013, 06:52:15 PM »
Hi,

I am also looking for this solution for my Mach3 + Galil 1842 combo running on a TREE CNC Knee mill.  This link for a $115 PENDANT intrigues me as it states it is for MACH3. Has anyone tried it?


Offline smurph

*
  • *
  •  1,544 1,544
  • "That there... that's an RV."
    • View Profile
Re: Remote jog pendant again
« Reply #5 on: January 22, 2013, 07:20:22 PM »
That looks to be a MPG.  I think AMorris was looking for just a jog pendant.  However, I don't believe that you will get that one working with the Gall or any other external motion controller.  The problem comes from how Mach communicates to the external controller.  It is a timed loop.  So that loop time will introduce latency for every move you make on the hand wheel.  That is why we put MPG support in the Galil plugin.  The MPGs that normally plug into a parallel port can normally be wired into Galil inputs and AUX encoders to run the MPG directly on the Galil.  No latency what so ever and it has very smooth and precise MPG movements.

I have one similar to this:  http://www.cnc4pc.com/Store/osc/product_info.php?cPath=40&products_id=162  I don't remember where I got it.  But it looks the same.

It works really well.  What I did was buy a DB25 breakout board to wire it directly to the Galil.  It did use up quite a few of my inputs.  But inputs are cheap these days with Pokeys so if you run out, you can get more rather easily.  You ALWAYS wire the encoder wires to an AUX encoder (or spare axis main encoder) input on your Galil though.  Then you make up some brain files that turn on MPG jog mode, select the increment, and select the the axis to be moved via the inputs.

While that is not as simple as plugging a MPG into a USB port or a parallel port, it is really not that bad of a job.  And you will get the best MPG movement you can possibly have.

Steve
Re: Remote jog pendant again
« Reply #6 on: January 23, 2013, 07:35:52 AM »
Steve,
Let me make sure I understand. By going thru the Galil inputs and the brains, Mach will update the DRO's when the Galil is jogged?

Allen
Re: Remote jog pendant again
« Reply #7 on: January 23, 2013, 08:24:13 AM »
I would like to add a few follow on questions to Allen's:

1. The MPG MUST be connected to the Galil interconnect board, right?
2. If above is yes, then MACH3 will monitor this encoder input as part of the plugin?
3. When the TAB key is hit for the JOG pendant on screen, you will need to select the axis and resolution/speed?
4. Say you select Y axis, then when you turn the physical MPG from 1. Above it will move the axis?

How can one use one of the off the shelf usb pendants to get all of those features to work plug and play, except for the MPG which has to be wired in direct.  I like the DRO on the pendant, and would like to be able to zero the machine using the pendant.

If it is better to split my questions out to a new thread that is OK. Thank you,

Shafi

Offline smurph

*
  • *
  •  1,544 1,544
  • "That there... that's an RV."
    • View Profile
Re: Remote jog pendant again
« Reply #8 on: January 23, 2013, 12:53:56 PM »
AMorris:

The Galil inputs and Mach brains only have an indirect relationship with the position displayed by the Mach DROs.  The Galil inputs and the brains are the mechanism by which you will drive the axes.  The position information is a function of the Galil moving the axes and updating Mach with the new locations.

If you jogged an axis though the Galil terminal while Mach was up and idling (I can do that with my Ethernet controllers but I have not tried it with a bus controller), Mach's DROs would update.  The Galil plugin always updates Mach with the position information.  The Mach DROs display actual Galil positions, not Mach calculated positions.  It is not at all like a parallel port stepper system where Mach has to keep up with the position information.  

You basically have two ways of accomplishing what you want to do:
1.  Use Galil inputs to drive Galil code to jog your axes.
2.  Use any input device to drive brains that push virtual Mach buttons and let Mach drive the axes just like if you were pressing the jog buttons on the tab screen.

Option 1 is probably more complex as you will have to figure a way to honor Mach's jog rules.  And using Galil code will require using Galil inputs.
Option 2 works like a charm and you don't have to use Galil inputs if you don't want to.  

Either way, the position info will be updated automatically.

KeislerL

1. Yes, the MPG encoder wires must be hooked to the Galil.  
2. Mach 3 doesn't monitor the encoder input with the Galil plugin.  The Galil plugin gears (slaves) the desired axis to the MPG encoder.  There is nothing Mach has to do other than sit back and enjoy the ride.
3. If you wire the axis selection and increment switch outputs of the MPG to inputs on the Galil (or some other input device), then you can make a brain file to select the axis, jog mode, and increment without having to use the tab screen.

The end goal is to be able to select the Y axis on the pendant axis selection switch, select the increment on the pendant increment switch, hold the button down to select MPG jog mode, and move the Y axis with the hand wheel.  

Mach supports 3 MPGs.  I have one on my panel (MPG1) and a remote pendant (MPG2).  I can move X with the panel encoder and Y with the pendant encoder if I so chose.  Or any other combination.  But it is important to note that the actual MPG encoder movement is not processes by Mach.  The Galil does it all.  However, Mach is used for the setup information such counts per unit of the MPG, getting the selected axis and increment, etc... That is why a brain is needed.  And the Galil plugin code honors Mach's jog rules (can't move an axis with the MPG when Mach is moving that axis).

As attractive as that USB pendant seems, I would be very wary of using it.  There is no telling if the MPG could be hacked to wire directly to the Galil encoder inputs.  But...  If you could do that, then you basically would not have to use a brain at all.  The USB connection would drive the axis selection, increment, and jog mode.  And the encoder would drive the axis.  And you would gain the rest of the functionality that the pendant offers.

The other unknown is what kind of information does the pendant stream through the USB connection?  If the encoder was disconnected from it and wired straight to the Galil, then is the pendant going to provide Mach with bogus information?  I'm not sure if it would even matter.  But that is the problem.  We just don't know.  Or will the pendant simply fault out and just refuse to work if the encoder is not wired to it?  Lots of questions here...

I guess it all depends on if you are willing to take the gamble.  If it works, it will rock.  If not, you have a paper weight.

Steve

Offline smurph

*
  • *
  •  1,544 1,544
  • "That there... that's an RV."
    • View Profile
Re: Remote jog pendant again
« Reply #9 on: January 23, 2013, 02:27:10 PM »
Ok Allen, I finally got off my ass and fired up the machine.  :)  Here is the brain info:

In the screen shot of the brain (my X axis jog brain), you will see the OEM LEDs in the left hand column.  1125 is the positive jog direction switch and 1126 is the negative jog direction switch.  LED 1122 is lit when the axis selector switch is selecting axis X.

I used a modbus device to update the status of those LEDs.  Basically, there is another brain I used to do that.  But you could use the Galil inputs just as easily.  You would map the Galil inputs to some spare OEMTRIGGERs in ports and pins and use those instead of LEDs.  Or, if you have extended IO on your controller, you could map those inputs to LEDs.  What ever you choose will be in the left column as the brain lobe inputs. 

So to go over the logic a bit...  if the axis selector switch is in the X position, my LED 1122 is set to ON.  If I then press the jog + button on my panel, then LED 1125 is also set to on.  I then take the logical and of these two brain inputs to drive a pulse timer that "pushes" the Mach JogX-Right button.  So IF 1125 is on AND 1122 is on, push jog right.

Same thing for the left or negative jog.  Just a different LED that gets lit up when the jog - button is pressed on the panel.

The last action the brain does is test see if the direction buttons have been let off.  And it presses the Jog off X button if so.

It is important to note that to jog an axis in Mach with the brains, you have to provide the button down event to start the jog and then provide the button up event to stop the jog.  If the third action were not there, the axis would start jogging when you pressed a direction button and it would continue to jog until it hit a limit or the end of the table travel!

Also, the brains only perform an action once per state change.  So when you let off a direction button, it only runs the third action one time.  You can see this in action if you "view" the brain file in the brain control dialog.  (Operator->Brain Control).

I have three brain files.  One for each axis.  They are different only by which LEDs are processed and by which mach "buttons" are pressed.  X for X actions, Y for Y actions, etc...  The separate brain files are purely a matter of being able to see what you are doing in the brain editor.  A large brain file gets hard to read.  The brain editor leaves a lot to be desired, unfortunately.  But it does work.

I also have a brain that reads my analog Jog Feed Rate pot on the panel.  So I can adjust the jog rate without having to use the tab screen.  (See the attached pic of my panel.)

It was all a bit of a pain to setup and get working.  But...  it was well worth it.  I don't have to use the keyboard for any jog ops.  I have a button on the screen that selects the jog mode (cont, incr, or MPG) and a button that toggles the jog increment.  If I had more real estate on my panel, I could have put buttons on it for those as well.  But my screen is a touch screen, so it is almost like having a button anyway.  It is a large panel, but I put a large monitor in it.  Which is nice because I can't see the way I used to!  :)  But it did make the area for "real" buttons a bit tight.  All of the buttons got recycled from the original Yasnac controller.  I quite like the feel of the jog buttons and I wanted to keep them.  The Cycle Start and Feed Hold buttons were retained, as well as the analog spindle RPM and load gauges.  And I love having the original tool changer controls on the panel as well.  I think it turned out to be a nice combination of the "new" and the "old". 

Steve