controlling emco tool changer

More
15 Feb 2012 01:42 #17674 by chuck1024
I need some advice on how to control an EMCO tool changer on a PC turn 55.
The turret uses a DC motor to rotate forward and then rotates backwards and parks against a prawl.
The motor is controled with a simple relay. Close the relay and the turret rotates. Release the relay and power is reversed to the motor and it rotates backwards against the prawl.

THe turret provides a sync and strobe signal from two photo interrupters. The sync pulse indicates tool 1 and the strobe pulses as the turret passes each tool location.

ClassicLadderExamples shows a similar implemetion using a stepper motor to rotate the turret but most of it is greek to me.

I think the sync pulse could be used to preset a counter to 1 and the strobe pulse could be used to increment the counter like the example.

Some where buried in there is an output command to close the motor relay and another output command to release the relay.

Can somebody get me started with the high points?

thanks

chuck

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

More
15 Feb 2012 08:29 #17678 by cncbasher
the denford orac toolchanger does exactly that , the possible only difference is that the position feedback is from 3 photo interruptors
so the coding may be different , the modified iocontrol file reads the tool position directly from the opto's .

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

More
15 Feb 2012 10:28 - 15 Feb 2012 10:29 #17680 by ArcEye
Hi

The component is accessible via this thread
www.linuxcnc.org/index.php/english/compo...ew&catid=47&id=15396

the modified iocontrol file reads the tool position directly from the opto's .

The io binary modification is only on cncbashers machine, I had to hack ioControl.cc to simulate a toolchange for whatever tool was current at start up, so as to update the current tool in Axis when it initialised.

This is not in the contributed version, as it needs to be maintained as the code changes with each version of LinuxCNC.

The component is written in a pretty simple style, have a look through and see if you can follow it.
The main difference as cncbasher says would be replacing the truth table for evaluating tool position, with a mechanism to detect tool 1 sensor and then count off the indexing pulses until reaching the required tool.

If you need more help you can PM me and I will see what I can do to get you going

regards
Last edit: 15 Feb 2012 10:29 by ArcEye.

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

More
15 Feb 2012 21:03 #17689 by chuck1024
Thanks a bunch!
I will study it for a few days and see what I can accomplish.
chuck

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

More
17 Feb 2012 16:25 #17763 by chuck1024
I think I may have made a mess. I was trying to compile my emco.comp file.

I get this error:
$ comp emco.comp
The program 'comp' can be found in the following packages:
* nmh
* mailutils-mh
Try: sudo apt-get install <selected package>
bash: comp: command not found

So I did this:
$ sudo apt-get install nmh
[sudo] password for chuck:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
python-xml python-numarray
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
libdb4.5 liblockfile1
Suggested packages:
exmh mh-e mh-book
Recommended packages:
mail-transport-agent metamail
The following NEW packages will be installed:
libdb4.5 liblockfile1 nmh
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 2653kB of archives.
After this operation, 7041kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 us.archive.ubuntu.com hardy/universe libdb4.5 4.5.20-11 [529kB]
Get:2 us.archive.ubuntu.com hardy/main liblockfile1 1.06.2 [14.8kB]
Get:3 us.archive.ubuntu.com hardy/universe nmh 1.2-3 [2108kB]
Fetched 2653kB in 43s (60.4kB/s)
Selecting previously deselected package libdb4.5.
(Reading database ... 103064 files and directories currently installed.)
Unpacking libdb4.5 (from .../libdb4.5_4.5.20-11_i386.deb) ...
Selecting previously deselected package liblockfile1.
Unpacking liblockfile1 (from .../liblockfile1_1.06.2_i386.deb) ...
Selecting previously deselected package nmh.
Unpacking nmh (from .../archives/nmh_1.2-3_i386.deb) ...
Setting up libdb4.5 (4.5.20-11) ...
Setting up liblockfile1 (1.06.2) ...
Setting up nmh (1.2-3) ...

After reading the man page on nmp, I'm pretty sure that is not what I need.
How do I uninstall it and how to I make comp work?

cs

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

More
17 Feb 2012 16:36 - 17 Feb 2012 16:38 #17764 by BigJohnT
The program comp is installed with emc2-dev. You can just add that to the synaptic package manager or iirc from a terminal say

sudo apt-get build-dep emc2

The other stuff you can find it in the synaptic package manager and remove it there.

Crap, the documents say nothing about where comp is...

John
Last edit: 17 Feb 2012 16:38 by BigJohnT.

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

More
17 Feb 2012 16:44 - 17 Feb 2012 16:44 #17765 by ArcEye
Hi

comp is provided by the emc package and cannot be downloaded in isolation

As far as I can work out, the comp you installed is to do with compressing images in mail headers!

$ apt-get remove nmh should take care of it plus $ apt-get autoremove to remove any orphans.

It should be present in /usr/bin but I seem to recall that this has been reported missing before.

In case for some reason it is actually missing, try putting the extracted attached in /usr/bin and running
$ sudo comp --install emco.comp from the directory where you have emco.comp

regards

File Attachment:

File Name: comp.zip
File Size:10 KB
Attachments:
Last edit: 17 Feb 2012 16:44 by ArcEye.

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

More
17 Feb 2012 20:07 #17770 by chuck1024
I managed to remove the wrong stuff and install emc2-dev using the synaptic package manager.
comp now generates a .c file when I run it without the --install. Now I need to get the hardware setup, install my code and see what happens.

Thanks for the help, you guys are great.
chuck

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

More
18 Feb 2012 00:36 #17773 by chuck1024
getting closer... but I am obviously missing an include file. I looked at the hal manual couldn't find any hints.

Suggestions??
thanks
chuck

$ comp --install emco.comp
make -C /usr/src/linux-headers-2.6.24-16-rtai SUBDIRS=`pwd` CC=gcc V=0 -o /Module.symvers modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.24-16-rtai'
CC [M] /tmp/tmpZtBuma/emco.o
Building modules, stage 2.
MODPOST 1 modules
WARNING: "hal_ready" [/tmp/tmpZtBuma/emco.ko] undefined!
WARNING: "hal_export_funct" [/tmp/tmpZtBuma/emco.ko] undefined!
WARNING: "rtapi_snprintf" [/tmp/tmpZtBuma/emco.ko] undefined!
WARNING: "hal_param_float_newf" [/tmp/tmpZtBuma/emco.ko] undefined!
WARNING: "hal_pin_s32_newf" [/tmp/tmpZtBuma/emco.ko] undefined!
WARNING: "hal_pin_bit_newf" [/tmp/tmpZtBuma/emco.ko] undefined!
WARNING: "hal_malloc" [/tmp/tmpZtBuma/emco.ko] undefined!
WARNING: "hal_init" [/tmp/tmpZtBuma/emco.ko] undefined!
WARNING: "hal_exit" [/tmp/tmpZtBuma/emco.ko] undefined!
CC /tmp/tmpZtBuma/emco.mod.o
LD [M] /tmp/tmpZtBuma/emco.ko
make[1]: Leaving directory `/usr/src/linux-headers-2.6.24-16-rtai'
cp emco.ko /usr/realtime-2.6.24-16-rtai/modules/emc2/
cp: cannot create regular file `/usr/realtime-2.6.24-16-rtai/modules/emc2/emco.ko': Permission denied
make: *** [install] Error 1

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

More
18 Feb 2012 01:06 - 18 Feb 2012 01:07 #17776 by BigJohnT
sudo comp --install emco.comp

and I bet that ain't in the manual either... remind me to fix that in the morning.

John
Last edit: 18 Feb 2012 01:07 by BigJohnT.

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

Time to create page: 0.112 seconds
Powered by Kunena Forum