Spindle Tool

More
30 Dec 2012 23:11 - 31 Dec 2012 16:01 #28183 by ArcEye
Replied by ArcEye on topic Spindle Tool
Hi Again,

I have found a simpler way to alter ioControl.cc, that does not require doing anything to the message queue directly.

I have created 2 new pins in the iocontrol module.
current_tool is a s32 input pin which connects to your toolchange component and is used to pass the correct current tool number.
tool_altered is a bit flag which the toolchanger component uses to signal that current_tool now has a new number in it.

When the toolchanger component is first initialised it needs to pass the current tool detected via the current_tool pin.
This will cause an immediate updating from No Tool to whatever tool is current.

Thereafter, when the toolchanger component detects that the tool number has changed
( it can do this by saving the last tool number it read, or was passed by iocontrol as part of a normal tool change, and comparing it to the current tool number)
it updates current_tool first and THEN sets the tool_altered flag

In iocontrol the setting of the tool_altered flag, causes the setting of several iocontrol_data variables to reflect the new tool number and initiate a tool change.

In the next loop, the change in tool number will trigger an emcioStatus update and iocontrol will initiate a toolchange sequence.

Because the tool number passed to your toolchange component is the same as it currently holds, no action should be taken and a tool_changed signal passed back to iocontrol

This will update the emcioStatus and the tool number displayed in Axis will change to match.

Attached is a zip of binary io to replace the one in /usr/bin (save the old one under another name first) and the ioControl.cc source
It was compiled under 10.04 (2.6.32-132-rtai) for Linuxcnc 2.5.1

Hopefully it will do all you wanted

regards

(CAVEAT: Use only with caution and full understanding of operating logic as outlined above.
Not warranted fit for any use or to do anything, if your toolchanger behaviour is not as outlined could cause un-commanded machine motion resulting in damage, injury or death)


(see subsequent post for new attachment)
Last edit: 31 Dec 2012 16:01 by ArcEye.
The following user(s) said Thank You: tld70

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

More
31 Dec 2012 01:49 #28194 by tld70
Replied by tld70 on topic Spindle Tool
Hello,

thanks a lot,
I will try it after my vacation.
You will here from me soon

Best regards


Thomas

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

More
31 Dec 2012 15:58 #28216 by ArcEye
Replied by ArcEye on topic Spindle Tool
I realised whilst lying in bed this morning, that I had left in the tool number verifying code for an 8 station ATC.

It then occurred that iocontrol does not need to check tool number at all, the toolchanger will do that within its own logic and emc will reject a tool number which is not in the tool table.

I have amended the code accordingly, replace the .zip you downloaded with this one

regards


File Attachment:

File Name: iocontrol.zip
File Size:76 KB
Attachments:

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

More
02 Jan 2013 19:57 #28299 by tld70
Replied by tld70 on topic Spindle Tool
Hello,

happy new year.

Thanks for your help.
I replaced the io in the folder /usr/bin
set the permissions and changen deh file to executible.
But Linuxcnc doesnt start.
Its quit with attachen errors.
I loaded back the old io than runs without errors.
Dir I do somethin wrong or did I forget something?
I run Linuxcnc 2.5.1 on ubuntu 10.04 LTS

Best regards
Thomas

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

More
02 Jan 2013 20:32 #28301 by ArcEye
Replied by ArcEye on topic Spindle Tool
Happy New Year to you

Nothing attached, try saving it as .txt and attaching again

regards

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

More
02 Jan 2013 20:54 #28302 by tld70
Replied by tld70 on topic Spindle Tool
Hope it will atached now
Attachments:

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

More
02 Jan 2013 21:15 #28304 by ArcEye
Replied by ArcEye on topic Spindle Tool
Starting LinuxCNC IO program: io
libnml/cms/cms_cfg.cc 622: cms_config: can't open '/usr/src/build/configs/common/linuxcnc.nml'. Error = 2 -- No such file or directory
libnml/nml/nml.cc 368: NML: cms_config returned -1.

Yuk, there is a hard coded linkage to a file location in cms_cfg.cc
How portable is that!

This arose because I built it inside a RIP install of 2.5.1 to prevent messing up my existing install.

A quick way to test if that is all that is wrong, is to create a directory called /usr/src/build/configs/common/ and copy /home/chironfz16/linuxcnc/configs/hm2-servo/linuxcnc.nml into it and run again.

If that works I will look at compiling an install version with the standard paths.

regards

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

More
02 Jan 2013 22:06 #28306 by tld70
Replied by tld70 on topic Spindle Tool
Hello,

there is no file like linuxcnc.nml in the path you wrote. I copied the file linuxcnc.nml from /usr/share/linuxcnc/ to /usr/src/build/configs/common/
and linuxcnc now start up.
I found a new pin tool_altered, but I didn't testet it.
there are some tool..... pins with tool-....
and only one pin with tool_.... is that correct?

Best regards

Thomas

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

More
02 Jan 2013 22:21 #28308 by ArcEye
Replied by ArcEye on topic Spindle Tool
Hi

Yes there is a new pin called tool_altered and one called current_tool (both with underscore not dash separator)

I have compiled a new version of io in the attached .zip, using the standard prefixes.

It runs fine on my standard build and you can see the pins and the result of changing values to get a toolchange to tool 1 in the screenshot.



Install that one and you should be able to start connecting up in HAL to your toolchanger

regards

File Attachment:

File Name: io_3.zip
File Size:65 KB
Attachments:

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

More
02 Jan 2013 23:00 #28311 by tld70
Replied by tld70 on topic Spindle Tool
OK i installed the file and tested a bit.

But it dont do what i want.
I changed the tool once OK
Then i changed by hand and nothing goes on.
attached you find a picture.
What did I wrong?
I set the tool in post-gui.hal net Spindelwerkzeug => iocontrol.0.current_tool
Attachments:

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

Time to create page: 0.118 seconds
Powered by Kunena Forum