ATC Macro / PLC Help please <success!>

All things related to the Centroid Acorn CNC Controller

Moderator: cnckeith

footpetaljones
Posts: 10
Joined: Sun Jan 07, 2018 8:53 pm
Acorn CNC Controller: No
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC11: No
CPU10 or CPU7: No

Re: ATC Macro / PLC Help please

Post by footpetaljones »

Scott, if I'm understanding the syntax correctly, in example 1 moving from position 3 to position 8 would require the G code to read "G53 A#101" correct?
diycncscott

Re: ATC Macro / PLC Help please

Post by diycncscott »

No. Example 1 is moving from 8 to 3. From 3 to 8 you could simply command the requested tool.



Example2
ie.. Max position = 12. Sitting on 8, requested 11 Assuming direction always counts up when moving from tool to tool.

;If current machine position of turret is < requested position:
;simply command a move to requested position
G53 A#4120
ie.. Max position = 12. Sitting on 8, requested 11 Assuming direction always counts up when moving from tool to tool.

;If current machine position of turret is < requested position: your case current pos = 3, requested position = 8 (#4120)
;simply command a move to requested position
G53 A#4120
diycncscott

Re: ATC Macro / PLC Help please

Post by diycncscott »

footpetaljones wrote: Tue Feb 20, 2018 9:13 pm Scott, if I'm understanding the syntax correctly, in example 1 moving from position 3 to position 8 would require the G code to read "G53 A#101" correct?
However, if you were moving from 8 to 3, you would use the syntax you show. (provided you properly calculated the value of #101 as shown in example 1)
Chaz
Posts: 392
Joined: Thu Feb 08, 2018 7:57 am
Acorn CNC Controller: No
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC11: No
CPU10 or CPU7: No

Re: ATC Macro / PLC Help please

Post by Chaz »

So, we tried the code and it kinda works, but doesnt.

The main reason is the logic, my turret goes high to low in terms of numbers. So Ill modify the logic and try again.

We did struggle a bit initially, as the first reset / home and T command basically tells the tool changer what tool is active and doesnt actually move, irrespective of the previous tool in the GUI.

Once I can get the logic sorted and then work out how to reverse against the pawl, I think we should be OK.

Thanks
Chaz
Posts: 392
Joined: Thu Feb 08, 2018 7:57 am
Acorn CNC Controller: No
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC11: No
CPU10 or CPU7: No

Re: ATC Macro / PLC Help please

Post by Chaz »

Still struggling however I suspect I know why.

There is a DRO that says 'Distance to go'. After a move, these should be reset to Zero, correct? My Axis seems to keep a number of sorts which interferes with the next set of maths.

Also, in the logic flows, what is the correct format for doing IF statements? You have two examples and you show something like this.

IF CONDITION = A
DO STUFF and then it does the below line.
M26 /A L[#4120*#20603]

How does it know to end here? Should there be a GOTO 1000 line?

Also, does it then completely bypass this IF statement if CONDITION IS NOT A, and do whatever is below it? There is no need to put another condition statement or ELSE?

Thanks
Chaz
Posts: 392
Joined: Thu Feb 08, 2018 7:57 am
Acorn CNC Controller: No
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC11: No
CPU10 or CPU7: No

Re: ATC Macro / PLC Help please

Post by Chaz »

Image

You can see there, Tool 3, A = 3, so all good.

Dist to go however is on 4, why? Should this not be zeroed after the most recent move?
diycncscott

Re: ATC Macro / PLC Help please

Post by diycncscott »

When requesting support, please ALWAYS post a current report.zip from your system. If your question is program or macro related, please ALWAYS post a copy of the the macro or program in question. Without these files, we don't have enough information to help you.
Chaz
Posts: 392
Joined: Thu Feb 08, 2018 7:57 am
Acorn CNC Controller: No
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC11: No
CPU10 or CPU7: No

Re: ATC Macro / PLC Help please

Post by Chaz »

diycncscott wrote: Wed Feb 21, 2018 3:10 pm When requesting support, please ALWAYS post a current report.zip from your system. If your question is program or macro related, please ALWAYS post a copy of the the macro or program in question. Without these files, we don't have enough information to help you.
Thanks, I cant get to these now as the PC is in the garage. It will have to wait till tomorrow. No view on how to reset the DRO or the question about IF statements, would have assumed these can be answered without seeing the current code?

Thanks
diycncscott

Re: ATC Macro / PLC Help please

Post by diycncscott »

I can't see how you are commanding the move, what kind of move it is, where in the sequence your are, tool offsets, WCS offsets..
Chaz
Posts: 392
Joined: Thu Feb 08, 2018 7:57 am
Acorn CNC Controller: No
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC11: No
CPU10 or CPU7: No

Re: ATC Macro / PLC Help please

Post by Chaz »

diycncscott wrote: Wed Feb 21, 2018 4:05 pm I can't see how you are commanding the move, what kind of move it is, where in the sequence your are, tool offsets, WCS offsets..
I had tried using your code, that uses G53. I tried with just G0, aiming to do incremental but got an error trying G91 in the MDI screen, perhaps it can on be used in the macro code?

Ive not set any tool or WCS offsets, im illiterately starting from scratch.

Also, your code, these first few lines, give an error. I assume the only variable that are meant to be declared are #100?

;------------------------------------------------------------------------------
; Filename: cnctch.mac
; Description: Axis driven tool change macro for lathe
; Notes: Turns/rev must be configured 1 = 1 turret position change
; Turret is on 3rd axis, positions are in machine position.
; Requires: Machine home must be set prior to use.
;
#100 = 12 ;Number turret positions
#101 = ;Calculated position to move to when requested position < current position.
#4120 = requested tool
#20601-#20604 = Counts per unit for axes1-4
#5021-#5024 is the current machine position for axes 1(#5021) through 4(#5024)

The #101 onwards should all be commented out as they are comments, not declaration of variables, is this correct?

Thanks

Ill get the report in the morning (UK time) and provide this.
Post Reply