- Posts: 187
- Thank you received: 6
REMAP M6 FOR GENEVA ATC
- COlger81
- Offline
- Elite Member
-
Less
More
8 years 2 days ago #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.
- andypugh
- Offline
- Moderator
-
Less
More
- Posts: 19899
- Thank you received: 4655
8 years 2 days ago #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
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.
- COlger81
- Offline
- Elite Member
-
Less
More
- Posts: 187
- Thank you received: 6
8 years 2 days ago #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.
I used "updown" hal component with my sensor to count pockets.
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
-
Less
More
- Posts: 19899
- Thank you received: 4655
8 years 2 days ago #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:
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.
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:
When you exit linuxCNC #5390 will be saved in the .var file for next time.
Also, there isn't really much point using updown _or_ carousel here.
To "home" the carousel you would MDI:
Code:
#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.
Code:
( #<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:
Code:
#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.
- COlger81
- Offline
- Elite Member
-
Less
More
- Posts: 187
- Thank you received: 6
8 years 1 hour ago - 8 years 1 hour ago #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.)
---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: 8 years 1 hour ago by COlger81.
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
-
Less
More
- Posts: 19899
- Thank you received: 4655
8 years 29 minutes ago #119774
by andypugh
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.
The G4 command in the routine should be a simple way to do this.
Replied by andypugh on topic REMAP M6 FOR GENEVA ATC
I think that it might suffice to connect the index to the same HAL pin as the pulse.COlger81 wrote: 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.
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.
Time to create page: 0.291 seconds