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

More
3 years 4 months ago #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
3 years 3 months ago #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:
Code:
# 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
3 years 3 months ago #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
3 years 3 months ago #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
3 years 3 months ago #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
3 years 3 months ago #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?
Code:
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.

Moderators: KCJ, Lcvette
Time to create page: 0.344 seconds
Powered by Kunena Forum