Another "what do I need" thread. Vmc retrofit

More
20 Apr 2015 04:01 #57912 by thewho
I know that Linuxcnc have all the capabilities that a Arduino have. It's just that it would be a lot easier for me to get it going.

I think it's all these different files that confuses me but I will give the "intro" document another go.

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

More
20 Apr 2015 14:37 #57925 by tkamsker
hi i love see your machine run i know the feeling when the bridgeport did it the first time
I might be able to help you with the ATC because i think get it controlling from Linuxcnc is much easier than from arduino (which i know even better than the linuxcnc )
if you have on your atc 1 mark for tool 1 and 1 mark for every tool and an relays for left and one for right
you can right out of the box use my script

btw how did you finally control your servos ?

thomas

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

More
20 Apr 2015 22:40 #57940 by thewho
Normal operation (tool in spindle and free slot in the carousel) of the tool changer is:

1. Move Z up to desired height
2. Check if tool in spindle
3. Verify that carousel is in the right slot
4. Verify that slot is empty
5. Move ATC arm out to spindle
6. Verify that it's in position
7. Release drawbar
8. Verify that it moved
9. Move Z up
10. Lift carousel lock pin
11. Verify that lock pin is up
12. Rotate carousel to selected tool slot
13. Verify that it's in the correct position
14. Release carousel lock pin
15. Verify that lock pin is in correct position
16. Verify that there is a tool in that slot
17. Move Z down
18. Pull drawbar
19. Verify it's locked
20. Return ATC arm
21. Verify that ATC arm is out of the way

I didn't even realize how complicated a tool change is until I wrote that list :blink:

I'd love to see your code tkamsker :)
I'm using the 5i25+7i77 combo with original servo amplifiers. Had to replace the encoders already on the machine tho..
Took some pictures along the way but I don't think it's interesting enough to deserve its own thread.

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

More
20 Apr 2015 23:07 - 20 Apr 2015 23:08 #57942 by andypugh

Normal operation (tool in spindle and free slot in the carousel) of the tool changer is:

1. Move Z up to desired height
2. Check if tool in spindle
3. Verify that carousel is in the right slot
4. Verify that slot is empty
5. Move ATC arm out to spindle
6. Verify that it's in position
7. Release drawbar
8. Verify that it moved
9. Move Z up.


As the sequence requires Z movements at various points in the cycle it might be best to do this as a G-code subroutine. It isn't easy to move the machine Axes from HAL or ladder. (There are ways, but I would not call them elegant).

So your sequence above would look a bit like:
G53 G0 Z-100 (move to tool change position)
M66 P0 (read the tool presence pin)
O100 IF #5399 GT 0.5 (There is a tool)
    {Need carousel feedback details here}
    M64 P0 (operate the arm relay)
    M66 P1 L1 Q2 (wait 2 seconds for arm-in-position signal)
    O101 IF #5399 LT 0 (timeout error)
         (abort, ,ATC arm errorl)
    O101 ENDIF
    M64 P1 (operate the tool release)
    M66 P2 L1 Q2 (wait for tool released)
    O102 IF #5399 LT 0 (timeout error)
         (abort, Tool release errorl)
    O102 ENDIF

And so on.

Eventually you could re-map this G-code subroutine to operate when the M6 command is given. This Actually might be good to do from the start, as the sample remaps have code to pass the tool number into a G-code parameter #<tool>. In fact I don't think that (abort, ...) works unless you have set up the subroutine as a re-map.

Remapping docs: (A lot to read, but you would only use a sub-set) www.linuxcnc.org/docs/html/remap/structure.html
Last edit: 20 Apr 2015 23:08 by andypugh.

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

More
21 Apr 2015 23:15 #57975 by thewho
That seems A LOT easier than the whole hal thing :whistle:
I still don't know how it works but that seems like something I might be able to learn :laugh:

Adding some kind of control/overview tab for the ATC is a lot harder I guess?
(getting kind of serious plans to do this with help of a Arduino as I could add a lcd to debug/show status on what it's doing)

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

More
21 Apr 2015 23:36 #57977 by andypugh

That seems A LOT easier than the whole hal thing :whistle:
I still don't know how it works but that seems like something I might be able to learn


I have been thinking about this a bit more, and it might actually be easier in Python than in G-code.

(Just because G-code is a rather poor programming language, and interacting with HAL signals is easier in Python).

I was talking with Chris M on IRC last night and he showed me an example of a Python script that creates HAL pins that signals from ATC switches etc can be connected to, and that can be called as a remap.

The default tool-changer is HAL_manualtoolchange. That is just a Python script that sits there waiting for the tool-change pins to change state, then pops up a dialog box.
I need to test if a toolchanger can operate in the same mode. I suspect that actually it can't, because the motion queue is halted during a normal tool change. The remapping function gets round this using cleverness.

This is hal_manualtoolchange:

git.linuxcnc.org/gitweb?p=linuxcnc.git;a...7bb203f3260d12eb016c

Which looks complicated at first glance, but a lot of that is the overhead of the two dialog boxes. Basically lines 53-58 create the HAL pins that connect the tool number, pocket number and change request to LinuxCNC.
Then the loop 80-89 waits for the tool-change pin to go high, and then calls the do_change function.

Do you know what it takes to move your carousel, and how the system knows which tool is presented to the changer arm?

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

More
22 Apr 2015 00:50 #57981 by thewho
There is a BCD encoder/sensor on the carousel. There is only 15 tool slots (or 14 because one is broken :whistle: ) but it still uses 5 input pins (2^5=32). And I don't know why because in my mind 4 would be enough (2^4=16)

Then there is a asynchronous motor that rotates (only clockwise) the carousel close to the correct position and then the lock pin moves it to the correct position and locks it in place.
That's how I think it works at least :whistle:

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

More
22 Apr 2015 05:03 #57984 by andypugh

That's how I think it works at least :whistle:


OK, there are ways to handle BCD. One way is to feed the pins in to
www.linuxcnc.org/docs/html/man/man9/weighted_sum.9.html
to get a 32-bit number (not binary coded) and then convert to normal binary with
www.linuxcnc.org/docs/html/man/man9/gray2bin.9.html

However, it is equally likely that the decoding will be done in whatever code runs the changer.

I had forgotten that the most common way to control a tool-changer is with the Classic Ladder soft-PLC.
Intro: www.linuxcnc.org/docs/html/ladder/ladder_intro.html
details: www.linuxcnc.org/docs/html/ladder/classic_ladder.html
examples: www.linuxcnc.org/docs/html/ladder/ladder_examples.html

(The problem is that all tool changers are different, and there are lots of ways to do them)

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

More
22 Apr 2015 16:59 #57997 by andypugh
I had a play around inside a cut-down hal_manualtoolchange last night, and unfortunately that idea isn't going to work.

The problem is that it is not possible to MDI G-code movements when the machine is in Auto mode (ie, when runing a G-code program)
So, it works with M6 in the MDI window, but causes an error with M6 in a G-code programme. (this isn't a surprise, but I wanted to check).

I don't think, therefore, that everything can be done in one place.

Moving the carousel and checking the gray-code is something that needs to be done in real-time. That means either in classic-ladder or a custom HAL component.
As I think that the custom HAL component will be generically useful I am happy to write that, if you are happy to test it :-)

There are already various components along the same lines: wiki.linuxcnc.org/cgi-bin/wiki.pl?Contri...oolchanger_component

But none of them support a 5-pin Gray-scale _and_ don't require recompiling parts of LinuxCNC.

I think that it should be possible to use a G-code routine as already suggested in conjunction with the proposed component to do our complete sequence.

Something like:
M68 T0 Q~<tool> ;set carousel target
M64 P3 ; start the carousel component
M66 P2 L1 Q30 ; wait for carousel to reach position, or timeout after 30 secs
O100 IF [#5399 LT 0]
     PANIC!
O100 ENDIF

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

More
22 Apr 2015 18:48 #58003 by tkamsker
Hi,
if you like to go the component router i made a solution which uses Gcode rewrite and for time critical stuff an component maybe it fits you needs
wiki.linuxcnc.org/cgi-bin/wiki.pl?Contri...er_and_configuration

of course instead of Gcode i could have used python but it was not necessary and it helped for on site changes.
the component should be self explainable.
in about 4 Weeks i work on my ATC on the VMC mill i build which will use an geneva cross mechanic and 12 place tool changer
then i will be open to test some of your components if you like to write a new one probably we can together
build an kind of standard carousel component i intend to use a component as well for my Lathe tool changer as well
thomas

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

Moderators: PCWjmelson
Time to create page: 0.414 seconds
Powered by Kunena Forum