Arm type ATC component?
18 Apr 2016 18:15 #73556
by terkaa
Arm type ATC component? was created by terkaa
Hi,
I need to make arm type ATC to work. Machine is big HMC with 30-tool arm type atc. All ATC movements are with hydraulic cylinders. I would like to make it work in steps. Ie. atc ready is step 1 -> step 2 rotate atc to correct tool pot --> step 3 grip tool with arm -> .... etc. In other words Case structure. One good reason for this is that if tool change cycle does not finish user can backup or advance steps easily. So basically I would like to know if writing a HAL component would be a good way to go? Any examples?
Tero
I need to make arm type ATC to work. Machine is big HMC with 30-tool arm type atc. All ATC movements are with hydraulic cylinders. I would like to make it work in steps. Ie. atc ready is step 1 -> step 2 rotate atc to correct tool pot --> step 3 grip tool with arm -> .... etc. In other words Case structure. One good reason for this is that if tool change cycle does not finish user can backup or advance steps easily. So basically I would like to know if writing a HAL component would be a good way to go? Any examples?
Tero
Please Log in or Create an account to join the conversation.
19 Apr 2016 12:26 #73588
by andypugh
Replied by andypugh on topic Arm type ATC component?
Writing a HAL component is one way.
Alternatively you could (probably) use ladder-logic.
Both those approaches are difficult if you need to include axis movements, for example moving the head up and down.
A third alternative is to use a G-code subroutine mapped to the M6 command. An example can be seen in the sim->axis->vismach->vmc-toolchange sample config. The G-code sub looks like this:
github.com/LinuxCNC/linuxcnc/blob/master...hange/toolchange.ngc
That example uses the "carousel" HAL component to handle the positioning of the tool carousel.
linuxcnc.org/docs/2.7/html/man/man9/carousel.9.html
Alternatively you could (probably) use ladder-logic.
Both those approaches are difficult if you need to include axis movements, for example moving the head up and down.
A third alternative is to use a G-code subroutine mapped to the M6 command. An example can be seen in the sim->axis->vismach->vmc-toolchange sample config. The G-code sub looks like this:
github.com/LinuxCNC/linuxcnc/blob/master...hange/toolchange.ngc
That example uses the "carousel" HAL component to handle the positioning of the tool carousel.
linuxcnc.org/docs/2.7/html/man/man9/carousel.9.html
Please Log in or Create an account to join the conversation.
19 Apr 2016 13:34 #73594
by terkaa
Replied by terkaa on topic Arm type ATC component?
Hi,
I want advance step/reverse step with pushbuttons. I believe this can not be done with G-code subprogram? Also case structure is needed. I do not need axis movements.
Tero
I want advance step/reverse step with pushbuttons. I believe this can not be done with G-code subprogram? Also case structure is needed. I do not need axis movements.
Tero
Please Log in or Create an account to join the conversation.
19 Apr 2016 13:57 #73597
by andypugh
Well, I am sure it probably could be, but it would get complicated. (G-code is Turing Complete, but not convenient)
If you do not need axis movements then I would definitely look at doing it as a HAL component. Actually moving the carousel might still be conveniently done with the carousel component.
Replied by andypugh on topic Arm type ATC component?
I want advance step/reverse step with pushbuttons. I believe this can not be done with G-code subprogram?
Well, I am sure it probably could be, but it would get complicated. (G-code is Turing Complete, but not convenient)
Also case structure is needed. I do not need axis movements
If you do not need axis movements then I would definitely look at doing it as a HAL component. Actually moving the carousel might still be conveniently done with the carousel component.
Please Log in or Create an account to join the conversation.
19 Apr 2016 14:07 #73598
by terkaa
Replied by terkaa on topic Arm type ATC component?
Hi,
Ok I will dig into this. I have downloaded source for EMC2. How to compile just this one hal component? Lets say file name is arm_atc.comp Yes I was thinking of using carousel and spindle orient components.
Tero
Ok I will dig into this. I have downloaded source for EMC2. How to compile just this one hal component? Lets say file name is arm_atc.comp Yes I was thinking of using carousel and spindle orient components.
Tero
Please Log in or Create an account to join the conversation.
19 Apr 2016 14:51 #73599
by andypugh
Replied by andypugh on topic Arm type ATC component?
You don't need the source to compile a single component (I don't think)
You need the linuxcnc-dev package (sudo apt-get install linuxcnc-dev) then follow the instructions here:
linuxcnc.org/docs/2.7/html/hal/comp.html
You need the linuxcnc-dev package (sudo apt-get install linuxcnc-dev) then follow the instructions here:
linuxcnc.org/docs/2.7/html/hal/comp.html
The following user(s) said Thank You: terkaa
Please Log in or Create an account to join the conversation.
19 Apr 2016 18:13 #73607
by terkaa
Replied by terkaa on topic Arm type ATC component?
Ok,
Here is my first HAL component Compiles and runs ok. Yes it is just a base but I believe this is correct way for me to go on with this. Thank you for help.
Tero
component armatc """Arm type ATC component""";
description "This component is for arm type ATC on Cincinnati Milacron 10HC2500";
pin in bit enable "Set this pin high to start movement. Setting it low will stop movement";
pin in bit step_forward;
pin in bit step_reverse;
pin out bit active "indicates that the component is active";
pin out bit ready "This pin goes high when the ATC is in-position";
pin out bit arm_horizontal;
pin out bit arm_retract;
pin out bit arm_advance;
pin out bit arm_vertical;
pin out bit arm_180_deg;
pin out bit arm_to_spindle;
pin out bit arm_to_magazine;
pin in bit arm_is_horizontal;
pin in bit arm_is_retracted;
pin in bit arm_is_advanced;
pin in bit arm_is_vertical;
pin in bit arm_is_at_spindle;
pin in bit arm_is_at_magazine;
pin in bit arm_is_180_deg;
pin out signed step = 1 "Current ATC step";
license "GPL";
author "tero kaarlela";
function _;
;;
FUNCTION(_){
switch (step){
case 1: // waiting at start
ready = 1;
if (enable) {
active = 1;
step = 2;
ready = 0;}
break;
case 2: // rotate arm horizontal to grip tool
if (! enable) return ;
arm_vertical = 0;
arm_horizontal = 1;
step = 3;
case 3: // check arm horizontal & arm_advance
if ((arm_is_horizontal == false) && enable) return;
arm_retract = 0;
arm_advance = 1;
step = 4;
case 4: // check arm advanced & arm vertical
if ((arm_is_advanced == false) && enable) return;
arm_horizontal = 0;
arm_vertical = 1;
step = 5;
break;
case 5: // check arm is vertical & arm retract
if ((arm_is_vertical == false) && enable) return;
arm_advance = 0;
arm_retract = 1;
step = 6;
break;
case 6: // check arm is retracted & arm to spindle
if ((arm_is_retracted == false) && enable) return;
arm_to_magazine = 0;
arm_to_spindle = 1;
step = 7;
break;
case 7: // check arm is at spindle & arm horizontal
if ((arm_is_at_spindle == false) && enable) return;
arm_vertical = 0;
arm_horizontal = 1;
step = 8;
break;
case 8: // check arm is horizontal & arm advance
if ((arm_is_horizontal == false) && enable) return;
arm_retract = 0;
arm_advance = 1;
step = 9;
break;
case 9: // check arm is advance & arm 180 deg
if ((arm_is_advanced == false) && enable) return;
arm_180_deg = 1;
step = 10;
break;
case 10: // check arm is 180 deg & arm retract
if ((arm_is_180_deg == false) && enable) return;
arm_advance = 0;
arm_retract = 1;
step = 11;
break;
case 11: // check arm is retract & arm to magazine
if ((arm_is_retracted == false) && enable) return;
arm_to_spindle = 0;
arm_to_magazine = 1;
step = 12;
break;
case 12: // check arm at magazine & arm advance
if ((arm_is_at_magazine == false) && enable) return;
arm_retract = 0;
arm_advance = 1;
step = 13;
break;
case 13: // check arm advance & arm horizontal
if ((arm_is_advanced == false) && enable) return;
arm_vertical = 0;
arm_horizontal = 1;
step = 14;
break;
case 14: // check arm horizontal & arm retract
if ((arm_is_horizontal == false) && enable) return;
arm_advance = 0;
arm_retract = 1;
step = 15;
break;
case 15: // check arm retract & arm vertical
if ((arm_is_retracted == false) && enable) return;
arm_horizontal = 0;
arm_vertical = 1;
step = 16;
break;
case 16: // check arm vertical & reset atc
if ((arm_is_vertical == false) && enable) return;
step = 17;
active = 0;
if (enable) ready = 1;
break;
case 17: // wait for enable to go out
if (enable) return;
step = 1;
break;
}
}
Here is my first HAL component Compiles and runs ok. Yes it is just a base but I believe this is correct way for me to go on with this. Thank you for help.
Tero
component armatc """Arm type ATC component""";
description "This component is for arm type ATC on Cincinnati Milacron 10HC2500";
pin in bit enable "Set this pin high to start movement. Setting it low will stop movement";
pin in bit step_forward;
pin in bit step_reverse;
pin out bit active "indicates that the component is active";
pin out bit ready "This pin goes high when the ATC is in-position";
pin out bit arm_horizontal;
pin out bit arm_retract;
pin out bit arm_advance;
pin out bit arm_vertical;
pin out bit arm_180_deg;
pin out bit arm_to_spindle;
pin out bit arm_to_magazine;
pin in bit arm_is_horizontal;
pin in bit arm_is_retracted;
pin in bit arm_is_advanced;
pin in bit arm_is_vertical;
pin in bit arm_is_at_spindle;
pin in bit arm_is_at_magazine;
pin in bit arm_is_180_deg;
pin out signed step = 1 "Current ATC step";
license "GPL";
author "tero kaarlela";
function _;
;;
FUNCTION(_){
switch (step){
case 1: // waiting at start
ready = 1;
if (enable) {
active = 1;
step = 2;
ready = 0;}
break;
case 2: // rotate arm horizontal to grip tool
if (! enable) return ;
arm_vertical = 0;
arm_horizontal = 1;
step = 3;
case 3: // check arm horizontal & arm_advance
if ((arm_is_horizontal == false) && enable) return;
arm_retract = 0;
arm_advance = 1;
step = 4;
case 4: // check arm advanced & arm vertical
if ((arm_is_advanced == false) && enable) return;
arm_horizontal = 0;
arm_vertical = 1;
step = 5;
break;
case 5: // check arm is vertical & arm retract
if ((arm_is_vertical == false) && enable) return;
arm_advance = 0;
arm_retract = 1;
step = 6;
break;
case 6: // check arm is retracted & arm to spindle
if ((arm_is_retracted == false) && enable) return;
arm_to_magazine = 0;
arm_to_spindle = 1;
step = 7;
break;
case 7: // check arm is at spindle & arm horizontal
if ((arm_is_at_spindle == false) && enable) return;
arm_vertical = 0;
arm_horizontal = 1;
step = 8;
break;
case 8: // check arm is horizontal & arm advance
if ((arm_is_horizontal == false) && enable) return;
arm_retract = 0;
arm_advance = 1;
step = 9;
break;
case 9: // check arm is advance & arm 180 deg
if ((arm_is_advanced == false) && enable) return;
arm_180_deg = 1;
step = 10;
break;
case 10: // check arm is 180 deg & arm retract
if ((arm_is_180_deg == false) && enable) return;
arm_advance = 0;
arm_retract = 1;
step = 11;
break;
case 11: // check arm is retract & arm to magazine
if ((arm_is_retracted == false) && enable) return;
arm_to_spindle = 0;
arm_to_magazine = 1;
step = 12;
break;
case 12: // check arm at magazine & arm advance
if ((arm_is_at_magazine == false) && enable) return;
arm_retract = 0;
arm_advance = 1;
step = 13;
break;
case 13: // check arm advance & arm horizontal
if ((arm_is_advanced == false) && enable) return;
arm_vertical = 0;
arm_horizontal = 1;
step = 14;
break;
case 14: // check arm horizontal & arm retract
if ((arm_is_horizontal == false) && enable) return;
arm_advance = 0;
arm_retract = 1;
step = 15;
break;
case 15: // check arm retract & arm vertical
if ((arm_is_retracted == false) && enable) return;
arm_horizontal = 0;
arm_vertical = 1;
step = 16;
break;
case 16: // check arm vertical & reset atc
if ((arm_is_vertical == false) && enable) return;
step = 17;
active = 0;
if (enable) ready = 1;
break;
case 17: // wait for enable to go out
if (enable) return;
step = 1;
break;
}
}
Please Log in or Create an account to join the conversation.
19 Apr 2016 18:38 #73608
by andypugh
Replied by andypugh on topic Arm type ATC component?
I think you need a bit more detailed handling of what happens is enable goes false part way through the sequence.
Also, you probably should have a timeout in each state. There is a built-in variable called "fperiod" that you can use for this.
case 2:
if (condition){
step = 3;
timeout = 0;
}
..
case 3:
if (timeout += fperiod) > 5.0 { handle timeout }
....
case 4:
Also, you probably should have a timeout in each state. There is a built-in variable called "fperiod" that you can use for this.
case 2:
if (condition){
step = 3;
timeout = 0;
}
..
case 3:
if (timeout += fperiod) > 5.0 { handle timeout }
....
case 4:
Please Log in or Create an account to join the conversation.
19 Apr 2016 18:48 #73609
by terkaa
Replied by terkaa on topic Arm type ATC component?
Ok,
Yes it was just a quick hack to see how hard it would be. fperiod seems a good way to implement timer between steps. Is it a good practice to add this and carousel to servo-thread?
Tero
Yes it was just a quick hack to see how hard it would be. fperiod seems a good way to implement timer between steps. Is it a good practice to add this and carousel to servo-thread?
Tero
Please Log in or Create an account to join the conversation.
19 Apr 2016 18:57 #73610
by terkaa
Replied by terkaa on topic Arm type ATC component?
Basically if enable goes false parway throug sequence we leave it there. User has to change to manual mode and then he can step back/forward with panel keys. I have to add input for manual mode...
Tero
Tero
Please Log in or Create an account to join the conversation.
Time to create page: 0.147 seconds