Brother TC-225 / TC-229 adventure!

More
9 years 2 months ago #97614 by andypugh
Replied by andypugh on topic Brother TC-225 / TC-229 adventure!

ihavenofish wrote: so my next step is to read them in the gcode, store them in a variable, convert that to a number, and then create something that will go to a specific tool, choosing the shortest direction. I suspect this shall be fairly easy. objective is then to put in in a subroutine, and be able to type M6 T(whatever) into mdi and have it go to that tool - no axis motion yet.


Or:

linuxcnc.org/docs/2.7/html/man/man9/carousel.9.html

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

More
9 years 2 months ago #97642 by ihavenofish
Replied by ihavenofish on topic Brother TC-225 / TC-229 adventure!
you showed me that one before but it had me a little confused on how id use it. i wasn't ignoring it :)

thanks

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

More
9 years 2 months ago - 9 years 2 months ago #97646 by andypugh
Replied by andypugh on topic Brother TC-225 / TC-229 adventure!
Just hook it up in HAL and have it activated either by the tool-change-request pin or by a digital output from a G-code routine.

I set up a lathe toolchanger recently and it all worked with standard LinuxCNC, no remaps and no routines.

You probably need a prepare phase, and I don't know if you need to put a tool away before selecting the new one?

If it's a random changer then you probably just need

loadrt carousel parameters......
addf carousel.0 servo-thread
net tool-prepare iocontrol.0.tool-prepare => carousel.N.enable
net pocket-num iocontrol.0.tool-prep-pocket => carousel.N.pocket-number
net changer-in-position iocontrol.0.tool-prepared <= carousel.N.ready

For a non-random changer the carousel target pocket might well want to come from A g-code sub that first starts by outputting tool-in-spindle, puts that tool away, then outputs the new pocket and continues the routine on carousel.N.ready

There is a complete example here:
github.com/LinuxCNC/linuxcnc/tree/master...smach/VMC_toolchange
This is the G-code sub:
github.com/LinuxCNC/linuxcnc/blob/master...hange/toolchange.ngc

It is _very_ close to what you need. Have you even run the Vismach sim?
Last edit: 9 years 2 months ago by andypugh.

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

More
9 years 2 months ago #97655 by ihavenofish
Replied by ihavenofish on topic Brother TC-225 / TC-229 adventure!
oh, ill look at it again.

my tool changer is complicated simplicity :P

z moves up to atc home, carousel spins where it needs to, z moves down to work piece.

so when the z has moved up, the tool has already been removed mechanically from the spindle by its fixed "pocket"


so if i were doing what I'm doing now (ignoring carousel for the moment):

// axis has moved to ATC HOME
M66 P19 L0 Q1 // we confirm we are at atc home - if not, fail
M66 P20 L0 Q1 // we do a weighted sum in hal to get the tool number from the binary pins and call it with m66 - if invalid, fail.
// place this number into a variable. subtract it from the requested tool. this new number is the number of positions to move, - or +
M64 P04 M64 P03 // move the atc in the chosen direction
M66 P12 L1 Q1 // monitor the encoder decel track for a rising edge, counting them.
G1 X Y F590 // move the x and y to their next positions while the atc rotates.
M65 P03 // brake the tool changer after weve counted the right number of tools
M66 P20 L0 Q1 // we do a weighted sum in hal to get the tool number from the binary pins and call it with m66 - if it does not match the desired tool, fail,
// continue on with z motion etc

obviously we need all the if/else/while routines in there

this is why I'm a bit lost on your carousel, only because i am doing things DURING the tool change and your carousel component seems like a do everything in one box, and overkill just to get an encoder number returned? i assume I'm totally wrong there, but I'm slowly figuring all this out :)

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

More
9 years 2 months ago #97656 by ihavenofish
Replied by ihavenofish on topic Brother TC-225 / TC-229 adventure!
thinking about it maybe you could see my atc identically to a lathe turret. atc home is turret unlock, and, then cw or ccw.

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

More
9 years 2 months ago #97672 by andypugh
Replied by andypugh on topic Brother TC-225 / TC-229 adventure!

ihavenofish wrote: this is why I'm a bit lost on your carousel, only because i am doing things DURING the tool change and your carousel component seems like a do everything in one box, and overkill just to get an encoder number returned? i assume I'm totally wrong there, but I'm slowly figuring all this out :)


Carousel works out the gray-code or binary current position, works out the shortest direction, outputs a motor command then turns off the motors when in-position and returns a HAL pin reporting success.

You can quite readily do other things like move axes while this is going on.

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

Time to create page: 2.059 seconds
Powered by Kunena Forum