Page 2 of 3
Re: Can't change homing direction! & 4th Axis Info (Resolved)
Posted: Fri May 22, 2020 3:53 pm
by tblough
If you use F1 Setup/F6 4th Axis Off to turn the rotary table off, you can use the following in your CNC.HOM file to automatically skip the homing.
Code: Select all
; Check for rotary table homing
IF #50010 ; Prevent lookahead from parsing past here
IF [#20104 == 78] THEN GOTO 1000 ; "N" for 4th axis turned off
M92/$[#20104]
G91 G20 G1 $[#20104]30.596 F1800.0
M26/$[#20104]
N1000
Re: Can't change homing direction! & 4th Axis Info (Resolved)
Posted: Fri May 22, 2020 4:21 pm
by swissi
To follow up on Tom's post, if you want to get that F6 function to turn ON/OFF the 4th axis, you need to manually configure parameter 131 as follows:
Now be aware that parameter 131 is not synchronized with the Wizard. So if you set parameter 131 to 11 for Axis label A and go into the Wizard and select axis label B for your 4th axis, the Wizard will temporarily configure the 4th axis as B but when you turn off the 4th axis with F6 and turn it back on, it will default back to Axis label A.
I made suggestion to Centroid a while back to have the Wizard sync with parameter 131 for the 4th axis but I don't know what the priority is to fix this or if it even made it on the fix list.
Not a big deal and just something you need to be ware off if you have a 4th axis and use F6 to turn it ON/OFF.
-swissi
Re: Can't change homing direction! & 4th Axis Info (Resolved)
Posted: Fri May 22, 2020 4:34 pm
by cncsnw
If you leave out the G91 move, then you don't even need the GOTO and N1000 logic. You can just include, for example:
If Parameter 131 indicates that there is a part-time A axis (or other label), then CNC12 will silently ignore M9x and M26 codes for it when it is not active.
The "IF #50001" in the example is not necessary in any event, since the 4th axis label is not going to change between the time you press Cycle Start to begin homing, and when CNC12 gets to that line of the macro.
Re: Can't change homing direction! &4th Axis Info (Resolved)
Posted: Fri May 22, 2020 4:54 pm
by tblough
Finally!!! Someone finally explains the reason behind the "IF #50001"! Thank you Marc!
Re: Can't change homing direction! & 4th Axis Info (Resolved)
Posted: Sat May 23, 2020 6:17 am
by Muzzer
cncsnw wrote: ↑Fri May 22, 2020 4:34 pm
If you leave out the G91 move, then you don't even need the GOTO and N1000 logic. You can just include, for example:
If Parameter 131 indicates that there is a part-time A axis (or other label), then CNC12 will silently ignore M9x and M26 codes for it when it is not active.
The "IF #50001" in the example is not necessary in any event, since the 4th axis label is not going to change between the time you press Cycle Start to begin homing, and when CNC12 gets to that line of the macro.
That's neat! I'll try that out later when I get back into the workshop. I'm likely to be disconnected the 4th axis when not in use, so this would be a good approach.
I'm puzzled by the #50001 reference. Did you mean #50010? I can't see a #50001 anywhere, nor appreciate its significance. Something to do with lookahead...
Re: Can't change homing direction! & 4th Axis Info (Resolved)
Posted: Sat May 23, 2020 7:26 am
by tblough
Yeah. The G91 move was to align the t-slots on the rotary table parallel with the mill table before setting A0.
Re: Can't change homing direction! & 4th Axis Info (Resolved)
Posted: Sat May 23, 2020 11:03 am
by swissi
Muzzer,
I was told by Centroid in the past that their default sync variable is #50001 but when you look at all the macro files of the 4.49 Beta build, they all now use #50010. Would be good if Centroid could explain what the reason was behind this change.
Marc,
do you have any code samples that actually prove that the command "If #50001" does indeed stop the look ahead. I'm getting increasingly suspicious that this command doesn't do anything, at least not on the Acorn board.
-swissi
Re: Can't change homing direction! & 4th Axis Info (Resolved)
Posted: Sat May 23, 2020 7:57 pm
by cncsnw
swissi wrote:do you have any code samples that actually prove that the command "If #50001" does indeed stop the look ahead. I'm getting increasingly suspicious that this command doesn't do anything, at least not on the Acorn board.
Enter the following program:
Code: Select all
N10 #150 = 1.234
N20 G10 P701 R2.345
N30 G0 X0
N40 G1 F2 X2
N50 IF [#50001]
N60 #150 = 3.1416
N70 G10 P701 R2.7183
Start it running, but during the N40 move, press Cycle Cancel (ESC).
Look in the file "c:\cncm\job.xml", or use M225 or something similar, to inspect the value of #150. Look in the Parameters table to see what value is in Parameter 701. What values do you find there?
Now delete the "IF [#50001]" line; run the program again; and again cancel it while it is still doing the N40 move.
What values do you find in #150 and P701 this time?
Re: Can't change homing direction! & 4th Axis Info (Resolved)
Posted: Sat May 23, 2020 7:59 pm
by cncsnw
I don't think it makes the least bit of difference whether you use "IF #50001" or "IF #50010".
See
http://www.cncsnw.com/AdvancedMacroProgramming.htm, and scroll down to "Updating Parameters and Static User Variables".
Re: Can't change homing direction! & 4th Axis Info (Resolved)
Posted: Mon May 25, 2020 6:11 am
by Muzzer
Thanks for the link, Marc. Also your guide to 4th axis is very useful reading for me right now:
http://www.cncsnw.com/4thHowTo.htm
I've got the F1>F6 running now, which is something I hadn't been aware of.