Tool Changer

More
21 Mar 2011 16:48 #7977 by Robin
Tool Changer was created by Robin
hey all,

I'm new on EMC and it's software.
I am making a toolchange and for that I need a output of my parallel port that goes automated to 1 when M06Txx is
given. Then it send the "high" signal (with a off delay) to a relais wich activates a engine(stepper motor) wich turns the tool.

Then after the signal turned on the engine for X secs it has to activate an
other output wich does the same as the other one,
off delay an sends the engine to the other direction for locking the
selected tool.

Depending of what tool is selected (i have 6)
The time wille be different.
Do i need all different parport outputs or is it possible with just 1.

I have a reed-contact on the toolchange so the tool have 1 basic position.
from there the tool change always starts.

I can turn the motor in 2 direction by a press button. but now i have to automate it.

Please Log in or Create an account to join the conversation.

More
21 Mar 2011 19:09 #7981 by Kirk_Wallace
Replied by Kirk_Wallace on topic Re:Tool Changer
Hello Robin,

It sounds like you have an EMCO tool changer or something similar:


I am not familiar with this changer, but I'll take a guess. I would tend to use EMC2's software step generator to feed the stepper motor the pulses you need to get from the current tool position to the new position. You will need to add a number of extra steps at the end of the move to get past the pawl, then program a number of steps in reverse to move the turret back against the pawl. Usually the number of reverse steps is more than needed and the motors stalls against the pawl. You will need to write a C or Classic Ladder program to handle the logic of these moves. If you write a C program, it needs to be in the form of a HAL component. One issue to note is that the turret will need to be homed or the current tool set when EMC2 is started. Then the current tool number will need to be stored so that you can calculate the number of steps to the new position.

The tool change signals that EMC2 uses are shown below which is a portion of a sample stepper .hal file:
"...
# create signals for tool loading loopback
net tool-prep-loop iocontrol.0.tool-prepare iocontrol.0.tool-prepared
net tool-change-loop iocontrol.0.tool-change iocontrol.0.tool-changed
..."

The iocontrol.0.tool-prepare signal is from EMC2 and is invoked by the Tx word in your g-code file. Using this signal will allow you to move a tool carousel to get ready for a tool change. The machine can still be making a cut. Once the carousel is in position and the new tool is ready for a change, your tool prepare hardware needs to tell EMC2 by setting iocontrol.0.tool-prepared. In the example above the prepare and prepared signals are linked together because there is no tool changer and when Tx is called the process won't stop to wait for a prepared signal. If you need to have a prepare function, the .hal lines above will need to change to something like this:
"...
net tool-prep iocontrol.0.tool-prepare start-my-changer-prepare
net tool-prepd my-prepare-done iocontrol.0.tool-prepared
..."

Many changer systems don't use prepare because the current tool keeps the new tool from being prepared, such as with lathe turrets or if the current tool needs to go back into a pocket before the new tool can be prepared.

The change signals will need to be connected in the same way as the prepare example above. An M6 code invokes the change signal. Currently the spindle and axes are stopped at this point, so the axes cannot be jogged or the spindle run, but stepgen and other non-motion functions will work.

"...
net tool-prep iocontrol.0.tool-change my-changer-comp-start
net tool-prepd my-changer-comp-done iocontrol.0.tool-prepared
..."

In this case my-changer-comp is the component you write that has the logic and handles the signals going to your hardware. my-changer-comp-start is the component input that tells the logic to start the change process. my-changer-comp-done is the signal from the component logic that tells EMC2 that the change process is done, the new tool is ready to use, and restores the motion functions.

You will need to become comfortable with editing your configuration files with a text editor like gedit. There are more details to doing this so research the linuxcnc.org and wiki documentation and ask more questions.
--
Kirk Wallace
www.wallacecompany.com/machine_shop/
www.wallacecompany.com/E45/index.html
California, USA

Please Log in or Create an account to join the conversation.

More
21 Mar 2011 19:19 #7982 by BigJohnT
Replied by BigJohnT on topic Re:Tool Changer
Well, the master version has a subroutine tool change that would fit your needs exactly. My VMC uses a switch on the tool carousel AFAIK to know where home is. Once that is known then turning so many steps CW or CCW gets you to the next pocket. So on boot up the tool carousel turns till it sees the home switch then moves back to the same position so it must store or have each pocket encoded to know where it is. It has 8 pockets so that would be 3 inputs in BCD.

Sounds like you have the ratchet type of tool changer where you move past the dog and back up till you touch. I would think that sending out the correct number of pulses or seeing the correct number of stations going by might be a way to do it. On my Lathe I use the current version and use the included Classicladder to control my tool change. It has an absolute encoder so to speak so I lift and spin till the correct number comes by and then drop and lock.

Anyway some ideas to think about.

John

Please Log in or Create an account to join the conversation.

More
21 Mar 2011 21:28 - 21 Mar 2011 21:28 #7985 by andypugh
Replied by andypugh on topic Re:Tool Changer
Here is a HAL component which might do what you want (assuming a stepper motor). It could probably be modified to suit a DC motor.
You would need to compile and install it with Comp (the instructions are here)
linuxcnc.org/docs/html/hal_comp.html
component toolchanger "For Emco style changers";

pin in bit toolchange-req "Request from Motion";
pin out bit toolchange-ack "Finished signal back to Motion";
pin in signed tool-number "from Motion";
pin out float motor-cmd "net this to a stepgen in HAL";
pin in bit index "input from the index pin";
pin out signed tc_state = 0 "tracks the state machine";

param rw float speed = 1 "Speed scale, in units per second";
param rw float scale = 10 "motor movement per tool station";
param rw float windback = 2 "how far to reverse the indexer";
param rw signed num_stations = 6 "Number of tool stations";

variable signed homed_flag = 0;
variable float position;
variable signed current_tool;

license "GPL";

function _ ;

;;

FUNCTION(_) {

    switch (tc_state){
        case 0: // idle
            if (toolchange_req){
                if (homed_flag){
                    position = motor_cmd + scale * (tool_number - current_tool) + windback/2;
                    if (position < motor_cmd){
                        position += num_stations * scale;
                    }
                    tc_state = 1;
                }
                else // need to home
                {
                    tc_state = 10;
                }
            }
            break;
        case 1: // moving
            while (motor_cmd < position){
                motor_cmd += speed;
                break;
            }
            motor_cmd = position;
            position -= windback;
            tc_state = 2;
            break;
        case 2:
            while (motor_cmd > position){
                motor_cmd -= speed;
                break;
            }
            toolchange_ack = 1; // signal "done"
            current_tool = tool_number;
            tc_state = 0;
            break;
        case 10: // look for index
            while (! index){
                motor_cmd += speed;
                break;
            }
            current_tool = 1;
            position = motor_cmd + scale * (tool_number - current_tool) + windback/2;
            tc_state = 1;
            break;
        case 20: // fault state
            break;
        default: // That's not good!
            rtapi_print_msg(RTAPI_MSG_ERR, "Unsupported state in toolchanger");
            tc_state = 20;
    }
}
Last edit: 21 Mar 2011 21:28 by andypugh.

Please Log in or Create an account to join the conversation.

More
22 Mar 2011 09:04 #7995 by Robin
Replied by Robin on topic Re:Tool Changer
Thank you all for the fast respondse!

I'm going to test several ways paying attetion with what u guys told me.

Hope i get it working

Thanks!

Please Log in or Create an account to join the conversation.

More
28 Mar 2011 12:57 #8201 by Robin
Replied by Robin on topic Re:Tool Changer
heya,

I have an issue with installing the component.

when i install it it gives me an valueerror. Need more than 1 value to unpack.

Someone know how it can be solved ?

Kind regards Robin

Please Log in or Create an account to join the conversation.

More
04 Apr 2011 06:45 #8443 by Robin
Replied by Robin on topic Re:Tool Changer
Really nobody any clue bout the Value error: Need more then 1 package to unpack.?

Please Log in or Create an account to join the conversation.

More
04 Apr 2011 07:02 #8444 by cncbasher
Replied by cncbasher on topic Re:Tool Changer
which comp are you trying to install ?
and is this with emc 2.4.6 ?

Dave

Please Log in or Create an account to join the conversation.

More
04 Apr 2011 09:05 #8448 by cncbasher
Replied by cncbasher on topic Re:Tool Changer
just in case command line for installing is

comp --install filename.comp

where in the install are you getting the error ? , for example i have compiled the above toolchanger , installed fine in both installed and source versions

Dave

Please Log in or Create an account to join the conversation.

More
04 Apr 2011 10:56 #8458 by Robin
Replied by Robin on topic Re:Tool Changer
it's the above comp,

i got it when i use the comp --instal toolchange.comp line

Its version 2.4.6

robin

Please Log in or Create an account to join the conversation.

Time to create page: 0.233 seconds
Powered by Kunena Forum