Page 1 of 2

How to program an aux key to home an individual axis (answered)

Posted: Sat Nov 11, 2017 5:26 pm
by DICKEYBIRD
On my lathe, I want to enable the Aux 10 key to re-home (to switch & back off) the X-axis on demand & the Aux 11 key to re-home the Z. I went to the Parms screen & tried resetting lines 197 & 198 to 9111, 9211 & 2611 but those mfuncxx.mac files aren't in the program folder so the program won't execute those macros when the key is pressed. I'm pretty sure those are wrong anyway. Will I have to write macros myself to do this? Mach has buttons to do this already so no special skills were needed.

This is a stretch of my 'puter skills. Anyone care to comment on how I can do this? :)

Re: Enabling "Aux" keys

Posted: Sat Nov 11, 2017 7:15 pm
by cnckeith
Please take a look at TB300 for Details. Thxs

http://www.centroidcnc.com/dealersuppor ... ds/300.pdf

Re: Enabling "Aux" keys

Posted: Mon Nov 13, 2017 1:21 pm
by PLData
Hi,
is it possible to change the AUX 8-11 key label text out which my on text or graphic for my one layout ?

\PLData

Re: Enabling "Aux" keys

Posted: Mon Nov 13, 2017 1:46 pm
by cnckeith
Without programming skill currently no. We are adding the ability to change the button labels in the new version of the vcp that will be out soon. It will be a simple drag and drop user interface.
So for now you can program them to function pretty much whatever you want as outlined in tb399..but the label of the button will stay the same.. make yourself a Post-It note for now to remind yourself. And when we release the next version of the VCP you'll be able to change the labels.

Programming an aux key to home an individual axis

Posted: Mon Nov 13, 2017 2:57 pm
by diycncscott
We mixing topics here. To avoid confusion, please do not post in a topic unless it specifically relates to the original topic. Yes, custom macros are part of that but the OP was specifically asking about using an aux key to re-home an individual axis. I have changed the subject to more accurately reflect the question.

The OP asked about adding a button(s) for re-homing the an axis individually by moving back to the home switch and how to change parameters to use aux keys to do so.

To individually home an axis to a switch using an aux key:

1. Create macro(s) - I'll use M12 for X (you create an M13 for Z)

;------------------------------------------------------------------------------
; Filename: mfunc12.mac - to run from aux 10, p197(aux 10 function) = 1211 -mfunction number(12) + function of aux key = run macro(11)
; M12 macro
; Description: Home X axis
; Notes:
; Requires:
; Please see TB300 for tips on writing custom macros.
;------------------------------------------------------------------------------

IF #50010 ;Prevent lookahead from parsing past here
IF #4201 || #4202 THEN GOTO 1000 ;Skip macro if graphing or searching

N100

M92 /X L1 ;Home X in + direction. Change to M91 to home in negative direction.
;Note X home switch must be set correctly in Wizard

M26 /X ;Set X axis Machine 0 (home) here.

N1000 ;Insert your code between N100 and N1000




FWIW The Wizard already configures the PLC, parameters and aux keys and macros are automatically re-home all axes by moving to home switch when the Wizard is configured to "home to switch" on an axis.

Re: How to program an aux key to home an individual axis (answered)

Posted: Mon Nov 13, 2017 7:34 pm
by DICKEYBIRD
Like this, Oh Great One? Have I interpreted thy teachings with truth and correctness? If so, I am most unworthy but humbly bow and accept the gift of your magical powers. :D

IF #50010
IF #4201 || #4202 THEN GOTO 1000
M92 /X
M26 /X
N100

(I had the M92/X & M26/X but missed the other stuff including the spaces before the forward slashes.)

Re: How to program an aux key to home an individual axis (answered)

Posted: Mon Nov 13, 2017 11:18 pm
by DICKEYBIRD
Oh well, I was hoping for success but it's a no go. Improper translation on my part probably.

X & Y do move with the press of Aux 10 & 11 keys but only .1673" & it stops & reads out:
302 Moving...
457 Unable to find home
388 Job cancelled

Report attached

Re: How to program an aux key to home an individual axis (answered)

Posted: Tue Nov 14, 2017 8:40 am
by diycncscott
A couple of things:

1. In the lathe, Z is the first axis, X is the second, there is no "Y". I know you probably understand this and, being a mill person, I often think in terms of X & Y myself but I wanted to clarify for others who may be reading this.

2. Your macro you post here said you are using M92 /X - the macro in your report (M12) is actually written with an M91 /X but your machine is configured with only a + Home (2)

Axis Label Motor Encoder Lash Comp. Limit Home Dir Screw
revs/in counts/rev. (inches) - + - + Rev Comp
1 Z 12.7000 1600 0.0000 0 0 3 0 Y N
2 X 12.7000 1600 0.0000 0 0 0 2 Y N

3. In addition to that error, your macro would generate an error if graphing or searching, there is no N1000 in your macro. Same thing in M13.

IF #50010
IF #4201 || #4202 THEN GOTO 1000
M91 /X
M26 /X
N100

4. What color are your home inputs in the I/O screen? - They must be green before attempting to home.

BTW Your home file (cnct.hom) is configured to home wherever it is at (jog/simple). Remember, the home files are one of those that the Wizard will not overwrite. If you want the Wizard to create a home to switch cnct.hom, delete the existing cnct.hom before running the Wizard.

Lastly, my bad. I apologize. The M91 and M92 lines should be written with an L1 switch at the end. -> M91 /X L1
By default, the control is looking for an index pulse when coming off the switch in an M91 or M92 command. The L1 tells to look for the switch to change change state to stop instead of looking for the index pulse. (My mind gets stuck in closed loop mode sometimes.)

Re: How to program an aux key to home an individual axis (answered)

Posted: Tue Nov 14, 2017 10:17 am
by DICKEYBIRD
Thank you Scott; I'll try again when I get home tonight & let you know how it goes. The report probably was a little silly because I had been trying a couple different things & got myself confused. We'll get there! :oops:

Re: How to program an aux key to home an individual axis (answered)

Posted: Tue Nov 14, 2017 10:27 am
by diycncscott
No problem.

BTW It is VERY unusual to home X or Z in the negative direction on a lathe and when I say "unusual", I mean I can only think of bad things that could happen when trying to home X or Z on a lathe in a negative direction.