16 Pocket tool changer with PB and carousel.comp (Working config for reference)

More
17 Jun 2023 18:39 #273750 by Lcvette
yes, more than what i was expecting in an answer..lol  very interesting for certain!  I was putting a atc together for a smaller machine and was considering using a stepper motor with a dumb step generator but also considered using the carousel component, was just curious if the stepper drive connections were gpio or to axis step gen output.  was fuzzy on that. but you cleared it up! thank you!

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

More
18 Jun 2023 00:33 #273762 by spumco
No problem, you've helped me out so much over the past couple of years.

Side note on steppers with ATC's...  If you're using a geneva drive with a stepper & carousel.comp, no problem.  The encoding scheme required by all the modes will ensure the pockets are aligned or carousel will never output a 'ready' signal to the M68 safety check.

But I'd be very reluctant to use an open-loop stepper + reducer in counts mode.  There's no feedback to carousel that the ATC rotated properly if you are only using the index pin to home (and no other sensors).  Lost steps would be bad here... which is why my closed-loop stepper alarm-out is tied to LCNC's estop.
The following user(s) said Thank You: Lcvette

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

More
19 Jun 2023 09:15 #273831 by GuiHue
Apologies for having missed your post.
Spumco did a great job summarizing things.

I am using a closed loop stepper with a 1:80 reduction. However, I have opted against count mode (Although that likely would have been fine and setup of the ini position would have shifted from mechanical fiddling to software offsets). However, since steppers are mighty convenient (and I had some left over), I opted to use it anyways. In may case carousel.comp is run in index mode and communicates with the stepper using velocity mode. This gives me a good amount of control with different velocities while not having to rely on the stepper being accurate. I  made sure to place the pocket index markers (M6 SHCS) while milling the top carousel plate and hence there is little trouble to be expected from that. 
The following user(s) said Thank You: Lcvette

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

More
24 Jul 2023 15:26 #276156 by spumco
@GuiHue-

I'm starting to port your index-mode carousel config to replace my counts-mode config.  First thing I noticed is that carousel.0.enable appears to be commented out.
From atc.hal:
# Carousel Setup
# Signals
# Enable is required to turn the whole thing on
#net        carenable         carousel.0.enable 
# Index = home
net         DI-ATC-home    carousel.0.sense-0
# Pocket = pocket signal
net         DI-ATC-pocket    carousel.0.sense-1

# Setup Write Signales
net         carousel_enable     carousel.0.enable     
net         carousel_jog-fwd    carousel.0.jog-fwd
net         carousel_jog-rev    carousel.0.jog-rev
net         carousel_force-unhome carousel.0.unhome
net         carousel_motor-vel  carousel.0.motor-vel    [HMOT](CARD0).stepgen.05.velocity-cmd
net         carousel_pocket-number  carousel.0.pocket-number 
#conv-s32-float.atc-pocket.in
# Setup READ Signals
net         carousel_homed      carousel.0.homed
net         carousel_ready      carousel.0.ready
net         carousel_current-position carousel.0.current-position conv-s32-float.atc-pocket.in
# Trigger homing of atc with homing of machine
net         carousel_home-auto halui.mdi-command-17 joint.0.homed

Did I miss an un-commented net connection somewhere in another hal file? How is carousel.0.enable triggered?

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

More
25 Jul 2023 07:22 #276206 by GuiHue
Hi spumco,

yes, you did miss something. Snippet above has a link of carousel.0.enable to a signal (carousel_enable). This signal is used by custom m_codes. See for instance M111: github.com/GuiHue/kondor/blob/main/m_codes/M111

Enable is frequently used to actually trigger the carousel component. Accordingly, I have placed halcmd sets carousel_enable all over the place.
The following user(s) said Thank You: spumco

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

More
25 Jul 2023 13:14 #276222 by spumco
Thank you.  It makes sense now that you've explained it, but it never occurred to me you could trigger hal pins like you've done.

Is there some benefit to the way you've done it vs connecting to motion.digital-out-N?

If you don't mind, I've a related question...
Looks like you've defined all your ATC motion.digital-in-NN pins in your INI file, and are then using the INI file definition as a variable in the appropriate subroutine(s).

Why did you prefer this method vs. linking the hal pin to motion.digital-in-NN in a hal file?  

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

More
26 Jul 2023 14:32 #276307 by GuiHue
Good questions. Originally I just wanted to play with custom mcodes.
It turns out, that thi sis a very readable and clean way of doing things. M11 is much short and easier to use manually than an M65 statement. Furthermore, it allows to combine setting multiple signals at a time. Also, you can use P words etc.

Sidenote: I did have troubles with M65 motion.digitial-in/out in the past, though I could never reliablly reproduce those issues. It usually works just fine.
The following user(s) said Thank You: spumco

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

More
26 Jul 2023 19:41 #276320 by spumco
Gotcha.

I did remember & review the user M-code section of the manual after your reply.

So if you don't mind continuing my education...

As I understand it remap passes the pocket number as float, and carousel needs an S32.  That's why I need to use motion.analog-out through a conv-float-s32 comp to carousel.N.pocket-number in my config.

How does this accomplish the same thing?
pocket=${1/.*}
halcmd sets carousel_pocket-number $pocket

Specifically, the pocket=${1/.*} line.  I get that $pocket is what's passed through as "P" in the parent g-code, but I don't understand the first line.

Do you know where I might find more info about this sort of thing in the user guide?

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

More
26 Jul 2023 20:42 #276322 by GuiHue
Hi spumco,

I have to pass on where to find more information in the user guide. As for the float to s32 thing: I came across this as well and got briefly stopped in my efforts. Then I remembered that custom mcodes are based on bash files on linux. Since bash scripts can do just about anything, going from float to int is possible as well. I id a short search and found this . Basically the ${1/.*} does it all. How? - beats me;).

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

More
27 Jul 2023 03:23 #276346 by spumco
I found a similar link soon after I asked the question, but as you say I can't figure out how this magic stuff works.

I guess I'll press the 'I believe' button and keep bash script capabilities in mind for future use.

Thanks again for the assist.
 

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

Moderators: KCJLcvette
Time to create page: 0.404 seconds
Powered by Kunena Forum