MPG Pendant Macro help request

This is where you talk about Macros, show examples of your macro scripting and SHARE handy segments of script code as examples.

Re: MPG Pendant Macro help request

Postby dezsoe » Tue Aug 22, 2017 8:03 am

Hi Dale,

I made a little table, could you fill it? And which ports/pins are connected to the encoder?

And one more question. Do you have any electronics on this pendant or is it just connected to the I/O pins? I ask it because the input pins have built-in pull-up resistors, so if there is no electronics in your pendant then you have to use low level column selection.
Attachments
pinmap.txt
(392 Bytes) Downloaded 807 times
dezsoe
 
Posts: 2049
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: MPG Pendant Macro help request

Postby Robertspark » Tue Aug 22, 2017 10:42 am

I've got a plugin with most of this already built in and it would probably be easier to just modify that to give you the functions you require. (done for the Contour ShuttlePro / Express)

The one I cannot really give you is the Keyboard Enter, as it's apparent from something else I was doing a while ago it depends which window has focus at the time (hence you may want to think about another function for that one)

All of the other button codes appear ok / doable.

You may want to think about other functions such as maybe the jog increment (encoder step increment) which can be adjusted via button press.

The one I'm not sure about is the "Run / Pause" >>> is this "Run" and "Feedhold" or Run and Stop??

You have stop listed seperatly but you have no e-stop on your MPG which a lot of MPG's have hence you may wish to change the "Stop" to "E-Stop" and maybe "Run & Stop" instead of what I presumed was "Run & Feedhold [Pause]"


You have another spare button (if you want to omit the Continious / Step jog or use the Keyboard Return) which you could enable a macro on to say call a feedhold, go to a tool change location, and then resume from the feedhold location and restart from there. [this would need a little work as I don't have a ready made macro for it]


suffix "a" and "b" indicate MPG jog
suffix "aT" and "bT" indicate button press toggle [require current state for toggle to other condition]


Output1Input1 = 113 ; // Home All (Buttoncode 113)
Output1Input2 = 106 ; // Set Work Zero Offsets (Buttoncode 106)
Output1Input3aT = 145 ; // Jog Mode (Continuous / Step Mode) (Buttoncode 145 / 146)
Output1Input3bT = 146 ; // Jog Mode (Continuous / Step Mode) (Buttoncode 145 / 146)
Output1Input4a = 134 ; // Spindle Speed Select for MPG increase or decrease. (Buttoncode 134 SRO+ / 135 SRO- )
Output1Input4b = 135 ; // Spindle Speed Select for MPG increase or decrease. (Buttoncode 134 SRO+ / 135 SRO- )
Output1Input5 = 1 ; // Select (Keyboard Return) [cannot be used without further code]
Output1Input6aT = 128 ; // Start / Feedhold (Buttoncode 128 / 135)
Output1Input6bT = 135 ; // Start / Feedhold (Buttoncode 128 / 135)
Output1Input7 = 130 ; // Stop (Buttoncode 130)

Output2Input1a = 147 ; // X Axis Select (buttoncode 147 X+ / 148 X-)
Output2Input1b = 148 ; // X Axis Select (buttoncode 147 X+ / 148 X-)
Output2Input2a = 149 ; // Y Axis Select (buttoncode 149 Y+ / 150 Y-)
Output2Input2b = 150 ; // Y Axis Select (buttoncode 149 Y+ / 150 Y-)
Output2Input3a = 151 ; // Z Axis Select (buttoncode 151 Z+ / 152 Z-)
Output2Input3b = 152 ; // Z Axis Select (buttoncode 151 Z+ / 152 Z-)
Output2Input4a = 132 ; // Feed Speed Select for MPG increase or decrease. (buttoncode 132 FRO+ / 133 FRO-)
Output2Input4b = 133 ; // Feed Speed Select for MPG increase or decrease. (buttoncode 132 FRO+ / 133 FRO-)
Output2Input5 = 1 ; // Z-Axis Probe / Zero Tool Length Offset (Via other macro >> G31 Z)
Output2Input6 = 131 ; // Goto Work Zero (Buttoncode 131)
Output2Input7 = 1 ; // Go To Home (via other macro >>> G28.1, Z, G28 [X & Y] sequence)

Pins have been read from Left to Right on the PCB as:
Output 1
Input 1
Input 2
Input 3
Input 4
Input 5
Input 6
Input 7
Output 2

And Correspond to:
-------- Output 1 Functions ------- Output 2 Function
Input 1 Home All ------------------- / X Select
Input 2 Zero Axis ------------------- / Y Select
Input 3 Jog Mode (Cont or Step) - / Z Select
Input 4 SRO Select ----------------- / FRO Select
Input 5 Keyboard Return ---------- / Zero TLO (Z)
Input 6 Start or Feedhold (Pause) / Go To Work Zero
Input 7 Stop ------------------------- / Return Axis Home
Robertspark
 
Posts: 1892
Joined: Sat Sep 03, 2016 4:27 pm

Re: MPG Pendant Macro help request

Postby Dale » Tue Aug 22, 2017 3:08 pm

Here is the mapping for my pendant as it was for LinucCNC.
I used a second standard PP with a CNC4PC C10S Breakout board. I can move wires if we don't get it exact.
As I use Gerry's 2017 Screenset, I could see C/V being changed to "Auto Zero" and the current Zero Z button being set for "Auto Zero Initialize"
We would have to call his two custom macros for that a would guess?

Thanks for everything your doing so far. Very much appreciated!!
Dale

Col1 Col2
Port 2 Port 2
Pin 01 Pin 14
Port 2 Pin 02 Feed +/- Z Select
Port 2 Pin 03 C/V Y Select
Port 2 Pin 04 Zero X,Y(Work Zero) X Select
Port 2 Pin 05 Home All Goto Home
Port 2 Pin 06 Start/Hold Zero Z TLO
Port 2 Pin 07 Cycle Stop Goto Work Zero leave Z alone
Port 2 Pin 08 Tool change Complete Spindle +/-



dezsoe wrote:Hi Dale,

I made a little table, could you fill it? And which ports/pins are connected to the encoder?

And one more question. Do you have any electronics on this pendant or is it just connected to the I/O pins? I ask it because the input pins have built-in pull-up resistors, so if there is no electronics in your pendant then you have to use low level column selection.
Dale
 
Posts: 27
Joined: Mon Aug 21, 2017 12:23 pm
Location: Alberta, Canada

Re: MPG Pendant Macro help request

Postby Dale » Tue Aug 22, 2017 3:14 pm

That cut and paste looks bad. I'll enclose the .txt file.
Dale
 
Posts: 27
Joined: Mon Aug 21, 2017 12:23 pm
Location: Alberta, Canada

Re: MPG Pendant Macro help request

Postby Dale » Tue Aug 22, 2017 3:15 pm

Pin Map
Attachments
pinmap.txt
(500 Bytes) Downloaded 811 times
Dale
 
Posts: 27
Joined: Mon Aug 21, 2017 12:23 pm
Location: Alberta, Canada

Re: MPG Pendant Macro help request

Postby Dale » Tue Aug 22, 2017 3:23 pm

Rob,

I plan on adding in the future a physical E-Stop button the side of the pendant. So the Stop button currently there is just Cycle Stop.
I really liked the Start/Feedhold button as I can pause movement, adjust a nozzle or something and then hit the button again to resume milling.
I Really like Gerry's "Auto Zero Initialize" routine from his 2017 Screenset, and would like to use that for one of the buttons, and the Simple "Auto Zero" for the z-zero button if possible.

Is it possible to use the "Check (Enter)" button for accepting the dialog box that pops up from the 2017 Screenset asking to resume zeroing the tool after changing it?

If we did a Plugin, I'm worried I would have a difficult time modifying it in the future if needed. I thought a macro would be easier for me to hack through with a little research if I need a function change. Would I be correct in this assumption? Or would a Plugin simply be more efficient or effective for timing reasons?

Love your help so far.

Cheers!
Dale
Dale
 
Posts: 27
Joined: Mon Aug 21, 2017 12:23 pm
Location: Alberta, Canada

Re: MPG Pendant Macro help request

Postby Dale » Tue Aug 22, 2017 3:26 pm

Clarification.
Start/Feedhold was used in LinuxCNC as a "Cycle Start", "Feedhold", "Resume Cycle" button. Kind of a tri-state setup.
Dale
 
Posts: 27
Joined: Mon Aug 21, 2017 12:23 pm
Location: Alberta, Canada

Re: MPG Pendant Macro help request

Postby Robertspark » Tue Aug 22, 2017 3:57 pm

Dale

Where did: "Tool change Complete" come from.... not seen that one listed before? (what does the button press do?)

With regards to the Check "Enter" button.
I've not been too successful at getting that to work in UCCNC (but it's probably more me than UCCNC). The issue [when I was trying it] was that I did not seem to have focus on the selected item when I was trying to sudo click the OK button via a macro

I know it is possible via a keyboard emulator (a device such as the POKEY's USB interface), although I've personally not been successful at calling an emulated "Enter" keypress from a macro
https://www.poscope.com/product/pokeys57u/

Yes a plugin is more of a closed code item (you can edit the sourcecode though and recompile the DLL). Lets see what can be done with Dezsoe and myself for you to edit if you wish later (I expect it will require a fair bit of code though)

[To be fair, Dezsoe has more code experience + code available at his finger tips as CNC Drive have developed most of the plugins for MPG's than I, I just thought challenge would be interesting, although I have another project waiting, hence thought this would be a quick one to sort, not sure now I look at the jogging functions, as you need most of the code done from within the macroloop which need to set the software outputs, and pass back from the macroloop and then restart the loop checking for previous status]
Robertspark
 
Posts: 1892
Joined: Sat Sep 03, 2016 4:27 pm

Re: MPG Pendant Macro help request

Postby Dale » Tue Aug 22, 2017 4:03 pm

I think the tool change dialog box is from Gerry's 2017 Screenset. It move the spindle to the tool change location and waits for you to put a new tool in the spindle. The wait box says "Replace tool in Spindle with tool#. When finished click OK to continue."

I thought it would be great if it was possible to use the pendant to click that button, then I could take care of 95% of the CNC machine operation through just the pendant. Other than loading the G-Code file of course.
Dale
 
Posts: 27
Joined: Mon Aug 21, 2017 12:23 pm
Location: Alberta, Canada

Re: MPG Pendant Macro help request

Postby dezsoe » Tue Aug 22, 2017 4:05 pm

Dale,

Thank you for the txt file. The MPG port and pin is not important yet: when all others will be ready then I'll have some comments on it.

If we did a Plugin, I'm worried I would have a difficult time modifying it in the future if needed. I thought a macro would be easier for me to hack through with a little research if I need a function change.

This question was not for me, but I tell you my opinion. From the beginning I was thinking of writing a macroloop. The reason is what you wrote: to let you check and modify it as you want. Now I think it's clear in my mind, I just have to start coding. :)

The Start/Hold/Continue button is a good idea, I like it! With the Accept button I have to think a little, because I don't have Gerry's 2017 screenset.
dezsoe
 
Posts: 2049
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

PreviousNext

Return to Macros

Who is online

Users browsing this forum: No registered users and 25 guests

cron