ATC Macro / PLC Help please <success!>
Posted: Mon Feb 19, 2018 3:08 pm
So Ive been asked to start a new topic.
Just installed the Acorn board, really happy thus far but not sure how to get the ATC to work. Here is the logic of the ATC (from the Mach 3 macro code).
Video of one working on Mach 3.
https://www.youtube.com/watch?v=-cCDulVashA
Some of the guys on the UK forum have also been helping here:-
http://www.mycncuk.com/threads/11430-Ce ... -one/page6
I use the A Axis to rotate the ATC, no sensors.
The essence of the macro is as follows:-
I use the A Axis, set to rotational. 8 tool positions. The turret can only move one direction, in reverse it stops against a ratchet / pawl.
There are a number of variables set however these could all be hard-coded. Before any of this happens, the tool changer is moved to a suitable position.
Dim Num_Tools As Integer
Dim CW_Steps_Per_Tool As Integer
Dim CCW_Steps As Integer
Dim HoldingDRO As Integer
Dim Requested_Tool As Integer
Dim Current_Tool As Integer
Dim CW_Feed As Integer
Dim CCW_Feed As Integer
Dim moves As Integer
Dim total_move As Integer
Num_Tools = 8
CW_Move_Per_Tool = 360/Num_Tools
CCW_Move = 10
HoldingDRO = 1050
Requested_Tool = GetSelectedTool()
Current_Tool = GetUserDRO(HoldingDRO)
CW_Feed = 1500
CCW_Feed = 1000
Current_Feed = GetOEMDRO(818)
In this macro's case what it does is the following:-
Declares the variables and the variable type (as per above)
It then starts a tool change and checks some conditions.
If the tool change number requested is higher than the Num_Tools, then MSG the user that the Requested tool number is invalid and quit the routine.
If the tool change number is < 1, do the same.
If the tool change number is the same as the existing tool, do nothing.
Otherwise / Else, do the following.
Some quick maths to determine how many tool positions to move. Two conditions exist below (one to go from a lower number to a higher number) and one to go from a higher number to a lower number, keep in mind that the tool changer cannot reverse.
If Requested_Tool > Current_Tool Then moves = Requested_Tool -Current_Tool
If Requested_Tool < Current_Tool Then moves = Num_Tools - Current_Tool +Requested_Tool
The calculation then says:-
total_move = (moves * CW_Move_Per_Tool)+(CCW_Move/2)
So lets use an example. Say we want to go from Tool 4 to tool 7.
Based on this, moves = 7 - 4 which is 3.
total_move = (3 * 45 degrees (calculated from 360 degree / 8 tools)) + (10/2). The extra bit at the end is to get it to go past the ratchet / pawl.
The system then does the following code:-
Code "G91 G94" 'incremental & Feed per minute
Code "G0 A" & total_move '& "F" & CW_Feed
Code "G0 A" & "-" & CCW_Move '& "F" & CCW_Feed
Basically, sets incremental and sets G94
Then does G0 A Total_move at a set feed rate
Then does G0 A -10 to set against the ratchet / pawl.
That's all there is to it.
If the tool changer wants to go from tool 7 to tool 1, the sum will be
If Requested_Tool < Current_Tool Then moves = Num_Tools - Current_Tool +Requested_Tool
Which will be 8 - 7 + 1
Which means that it will move 2 sets of clockwise direction, then reverse 10 for the Pawl / ratchet.
Of course, once the move is done, the new tool now being used is updated whereever it is stored.
Many thanks, really liking this board, if I can get around this issue, any of my future retrofits will be done with this board / software.
If not bought the pro software yet, I believe I need this for M107? I dont mind buying the software but kinda pointless if I cant get the ATC to work, so a bit catch 22.
Thanks
Just installed the Acorn board, really happy thus far but not sure how to get the ATC to work. Here is the logic of the ATC (from the Mach 3 macro code).
Video of one working on Mach 3.
https://www.youtube.com/watch?v=-cCDulVashA
Some of the guys on the UK forum have also been helping here:-
http://www.mycncuk.com/threads/11430-Ce ... -one/page6
I use the A Axis to rotate the ATC, no sensors.
The essence of the macro is as follows:-
I use the A Axis, set to rotational. 8 tool positions. The turret can only move one direction, in reverse it stops against a ratchet / pawl.
There are a number of variables set however these could all be hard-coded. Before any of this happens, the tool changer is moved to a suitable position.
Dim Num_Tools As Integer
Dim CW_Steps_Per_Tool As Integer
Dim CCW_Steps As Integer
Dim HoldingDRO As Integer
Dim Requested_Tool As Integer
Dim Current_Tool As Integer
Dim CW_Feed As Integer
Dim CCW_Feed As Integer
Dim moves As Integer
Dim total_move As Integer
Num_Tools = 8
CW_Move_Per_Tool = 360/Num_Tools
CCW_Move = 10
HoldingDRO = 1050
Requested_Tool = GetSelectedTool()
Current_Tool = GetUserDRO(HoldingDRO)
CW_Feed = 1500
CCW_Feed = 1000
Current_Feed = GetOEMDRO(818)
In this macro's case what it does is the following:-
Declares the variables and the variable type (as per above)
It then starts a tool change and checks some conditions.
If the tool change number requested is higher than the Num_Tools, then MSG the user that the Requested tool number is invalid and quit the routine.
If the tool change number is < 1, do the same.
If the tool change number is the same as the existing tool, do nothing.
Otherwise / Else, do the following.
Some quick maths to determine how many tool positions to move. Two conditions exist below (one to go from a lower number to a higher number) and one to go from a higher number to a lower number, keep in mind that the tool changer cannot reverse.
If Requested_Tool > Current_Tool Then moves = Requested_Tool -Current_Tool
If Requested_Tool < Current_Tool Then moves = Num_Tools - Current_Tool +Requested_Tool
The calculation then says:-
total_move = (moves * CW_Move_Per_Tool)+(CCW_Move/2)
So lets use an example. Say we want to go from Tool 4 to tool 7.
Based on this, moves = 7 - 4 which is 3.
total_move = (3 * 45 degrees (calculated from 360 degree / 8 tools)) + (10/2). The extra bit at the end is to get it to go past the ratchet / pawl.
The system then does the following code:-
Code "G91 G94" 'incremental & Feed per minute
Code "G0 A" & total_move '& "F" & CW_Feed
Code "G0 A" & "-" & CCW_Move '& "F" & CCW_Feed
Basically, sets incremental and sets G94
Then does G0 A Total_move at a set feed rate
Then does G0 A -10 to set against the ratchet / pawl.
That's all there is to it.
If the tool changer wants to go from tool 7 to tool 1, the sum will be
If Requested_Tool < Current_Tool Then moves = Num_Tools - Current_Tool +Requested_Tool
Which will be 8 - 7 + 1
Which means that it will move 2 sets of clockwise direction, then reverse 10 for the Pawl / ratchet.
Of course, once the move is done, the new tool now being used is updated whereever it is stored.
Many thanks, really liking this board, if I can get around this issue, any of my future retrofits will be done with this board / software.
If not bought the pro software yet, I believe I need this for M107? I dont mind buying the software but kinda pointless if I cant get the ATC to work, so a bit catch 22.
Thanks