REMAP M6 FOR GENEVA ATC

More
29 Oct 2018 20:06 #119614 by andypugh
Replied by andypugh on topic REMAP M6 FOR GENEVA ATC
So how does it know when it is at position 1?

(And what is the exact problem that you have?)

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

More
29 Oct 2018 20:10 #119615 by COlger81
Replied by COlger81 on topic REMAP M6 FOR GENEVA ATC
I was able to use "updown" hal component to create tool counter. It seems to be working well. My thought is to export the saved current tool on startup to the "updown" turret value.

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

More
29 Oct 2018 20:16 #119617 by COlger81
Replied by COlger81 on topic REMAP M6 FOR GENEVA ATC
As designed by Fadal, it saves the current "last" tool number and then loads the number on startup. I guess you could say it flies blind other than last stored value, which i never had a problem with on old controls so i don't think it's an issue. My original question was if i can use the carousel component without major modification to code, given my hardware single sensor.

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

More
29 Oct 2018 20:35 #119621 by andypugh
Replied by andypugh on topic REMAP M6 FOR GENEVA ATC
I think that it would be simplest to add a home sensor, then I think that carousel would work. Better still, add several to have gray-code. I assume that the machine was made when IO and sensors were expensive?

Another option might be to configure the carousel as an axis (to a limited extent) then the position could be saved in the position.txt file automatically.

Unfortunately "carousel" is a realtime module so can't access the file system to save the data.

The G-code sequencing file, however, could save the position to one of the persistent numbered parameters.
linuxcnc.org/docs/2.7/html/gcode/overview.html#gcode:parameters

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

More
29 Oct 2018 23:48 #119630 by COlger81
Replied by COlger81 on topic REMAP M6 FOR GENEVA ATC
How can i output the value from an S32 input to a saved "persistent" parameter, then call that saved parameter value back to the S32 at startup?

I used "updown" hal component with my sensor to count pockets.

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

More
30 Oct 2018 00:30 #119631 by andypugh
Replied by andypugh on topic REMAP M6 FOR GENEVA ATC
It seem pretty likely that you will never use #5390.

Also, there isn't really much point using updown _or_ carousel here.

To "home" the carousel you would MDI:
#5390 = current tool

Now you can remap M6 to a tool-change routine. You will need a bunch of other stuff, but the tool cycling seems fairly simple.
Here is an example that uses carousel, but bear with me:
github.com/LinuxCNC/linuxcnc/blob/master...hange/toolchange.ngc

This section of G-code will keep the motor on until it has counted up to the required tool, then stop the motor.
( #<selected_pocket> is set in stdglue.py )
M64 P0 (start the motor)
O100 WHILE #5490 LT #<selected_pocket>
(wait for an index pulse, with a timeout)
    M66 P0 L3 Q60 ; wait for carousel finished
    O107 if [#5399 LT 0]
        (abort, failed to align carousel)
    O107 endif
    #5390 = [#5390 + 1]
O100 ENDWHILE
M65 P0; stop carousel

Now, this won't work, but I wanted to leave it simple for clarity.

You might well want to have two different versions of the loop to move in two different directions.

There is no wrapping. If you go past tool 20 it will carry on to 21. The fix for this is the MOD operator:
#5390 = [[#5390 + 1] MOD 20]

When you exit linuxCNC #5390 will be saved in the .var file for next time.

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

More
01 Nov 2018 16:44 - 01 Nov 2018 17:05 #119772 by COlger81
Replied by COlger81 on topic REMAP M6 FOR GENEVA ATC
Thank you! You got me on the right track. Using Gcode, Mcode, and subs was definitely the way to go. I also have the Carousel component functioning in "Index" mode with a couple of caveats;

---1.
How can i just tell the Carousel that it's homed on startup. I only have the one hall sensor with magnets in between each tool.

---2.
Also, i need to add a small delay between the sensor hit and shutting off the turret motor when the desired tool number is reached.
(Due to the sensor magnets being in between each pocket.)
Last edit: 01 Nov 2018 17:05 by COlger81.

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

More
01 Nov 2018 17:52 #119774 by andypugh
Replied by andypugh on topic REMAP M6 FOR GENEVA ATC

How can i just tell the Carousel that it's homed on startup. I only have the one hall sensor with magnets in between each tool.

I think that it might suffice to connect the index to the same HAL pin as the pulse.
But, really, I don't think that "carousel" does anything useful in this application, you might as well compute the direction and turn the motors on in G-code.


Also, i need to add a small delay between the sensor hit and shutting off the turret motor when the desired tool number is reached.
(Due to the sensor magnets being in between each pocket.)


The G4 command in the routine should be a simple way to do this.

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

More
02 Nov 2018 12:24 #119810 by COlger81
Replied by COlger81 on topic REMAP M6 FOR GENEVA ATC
The carousel is functioning perfectly in bidirectional mode. Is there a way to load the saved tool number to the pocket position number at startup? For example, if i shutdown the machine at tool 5 (anything other than tool 1) the pocket number does not match the actual tool number.

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

More
02 Nov 2018 13:11 #119813 by andypugh
Replied by andypugh on topic REMAP M6 FOR GENEVA ATC
#5490 should be persistent through reboot.

If you exit LinuxCNC and look in the .vars file you should be able to see the stored value. Is that not happening?

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

Time to create page: 0.084 seconds
Powered by Kunena Forum