Offset home and jog caroussel

More
2 years 9 months ago #291694 by greg23_78
I'm having problems with my tool change/caroussel.

loadrt carousel pockets=30 encoding=index num_sense=2 dir=2

on my caroussel the home is on tool 30 (the last one)
when I ask for a tool change I am shifted by 1 just after the homing, then the carousel works perfectly, I have the right tool shift

I think that the modification should be made on the carrousel.comp but not knowing pyton programming, I prefer not to modify the program too much.
Code:
    case 10: // start of homing         homed = 0;         homing = 1;         motor_fwd = 1;         motor_rev = 0;         motor_vel = fwd_dc;         motor_dir = 1;         index_enable = 1;         counts_target += scale * inst_pockets;         old_index = 1; // ensure 0->1 cycle of home sensor         state = 11;     case 11: ;// waiting for index & pulse         int ind = 0;         if (inst_code == 'C'){             ind = sense(0);         } else {             ind = (sense(0) && sense(1));         }         if  ( ! index_enable || ((! old_index) && ind)){ // index found             current_position = 1;             homed = 1;             homing = 0;             active = 0;             motor_fwd = 0;             motor_rev = 0;             motor_vel = 0;             base_counts = counts - home_offset;             counts_target = base_counts;             if ( align_dc == 0) {                 state = 0;             } else {                 timer = decel_time;                 state = 5;             }         }         old_index = ind;         break; // So that we don't see the tool1 pulse twice     case 20: //jogging fwd/rev         if (current_position != target){             deb = debounce;             return;         } else if (deb-- > 0) {             return;         }         if (align_dc != 0 && ! align_pin) return;         motor_fwd = 0;         motor_rev = 0;         motor_vel = hold_dc;         active = 0;         if (jog_fwd || jog_rev) return; // require button release to jog again         if (align_dc != 0) {             motor_vel = -align_dc;             timer = decel_time;             state = 5;         } else {             state = 0;         }         break;     } }

the second problem comes from the jog of the carousel, the programming I have done does not work, what modification should I make to make it work?
Code:
loadrt debounce cfg=2 net jog-fwd <= hm2_5i25.0.7i77.0.0.input-17 net jog-fwd  => debounce.0.0.in net debounce-fwd-out <= debounce.0.0.out net debounce-fwd-out =>  carousel.0.jog-fwd motion.digital-in-10 net jog-rev <= hm2_5i25.0.7i77.0.0.input-18 net jog-rev  => debounce.0.1.in net debounce-rev-out <= debounce.0.1.out net debounce-rev-out => carousel.0.jog-rev motion.digital-in-11

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

More
2 years 9 months ago #291696 by tommylight
Is this a double post?
I am sure i have read the loadrt line with 30 tools a day or two prior...
-
As a general rule, no double posting.

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

More
2 years 9 months ago #291698 by greg23_78
I don't think I'm making a double post,

www.forum.linuxcnc.org/24-hal-components...s-to-the-same-output

I've tried to apply SPUMCO's recommendations.

"Note - in the future, start a new thread for a new topic. I know it's 'just a little add-on question', but changing the thread title even if it's yours is frowned on and makes it harder for people to search later. I'm guilty of it, too, but I try not to make a habit of it."

if this is considered a double post I'm sorry

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

More
2 years 9 months ago #291715 by spumco
@Tommy - nope, OP is following orders :)

@greg23_78... Regarding the first part, I don't understand why home is pocket 30.  I assume since your'e using 'INDEX' mode you've got a per-pocket sensor and a once-per-rev index sensor, yes?

Is there some reason you can't (or don't want to) define the index sensor as pocket #1?

Regarding jog... um.  I had a problem with it a while ago (months) and reported it to Andy Pugh (author of carousel) on git hub.  I think it's been fixed, but I honestly haven't done much testing.  If I recall, you have to set the jog-fwd/rev signal high and then low for it to work.

To test it out I found it was easier to get all the carousel pins displayed in halshow, and then unlink the various inputs so I could manually diddle the pins.  There's even an 'unhome' pin you can use for testing (Thanks Andy!) your homing process so you don't have to close & restart LCNC.

Have a go in halshow and see if you can figure out (and report back) if toggling the jog pins on/off (after it's homed) works.

And 30 tools?  That's huge.  What is this thing?

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

More
2 years 9 months ago - 2 years 9 months ago #291719 by greg23_78
yes, I have a sensor for the index of my caroussel and I have a sensor for the motor of the caroussel 1rev = 1 pocket

The reason why on the pocket 30, I do not know, it was assembled like that of origin and to modify mechanically and too complicated.

a photo of my milling machine attached

after a lot of reading of the caroussel.comp file i think this parameter should be changed

if  ( ! index_enable || ((! old_index) && ind)){ // index found
            current_position = 1; ============> 30

Code:
case 10: // start of homing         homed = 0;         homing = 1;         motor_fwd = 1;         motor_rev = 0;         motor_vel = fwd_dc;         motor_dir = 1;         index_enable = 1;         counts_target += scale * inst_pockets;         old_index = 1; // ensure 0->1 cycle of home sensor         state = 11;     case 11: ;// waiting for index & pulse         int ind = 0;         if (inst_code == 'C'){             ind = sense(0);         } else {             ind = (sense(0) && sense(1));         }         if  ( ! index_enable || ((! old_index) && ind)){ // index found             current_position = 1; ============> 30             homed = 1;             homing = 0;             active = 0;             motor_fwd = 0;             motor_rev = 0;             motor_vel = 0;             base_counts = counts - home_offset;             counts_target = base_counts;             if ( align_dc == 0) {                 state = 0;             } else {                 timer = decel_time;                 state = 5;             }         }         old_index = ind;         break; // So that we don't see the tool1 pulse twice     case 20: //jogging fwd/rev         if (current_position != target){             deb = debounce;             return;         } else if (deb-- > 0) {             return;         }         if (align_dc != 0 && ! align_pin) return;         motor_fwd = 0;         motor_rev = 0;         motor_vel = hold_dc;         active = 0;         if (jog_fwd || jog_rev) return; // require button release to jog again         if (align_dc != 0) {             motor_vel = -align_dc;             timer = decel_time;             state = 5;         } else {             state = 0;         }         break;     } }


is there a command to edit a coump file or do i have to download it on github modify and install it?

for the jog, i found your post, i will read it more in depth.

the pins carousel.0.jog-fwd and carousel.0.jog-rev are active on halshow before and after homing.
Last edit: 2 years 9 months ago by greg23_78.

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

More
2 years 9 months ago #291723 by tommylight
The following user(s) said Thank You: spumco

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

Time to create page: 0.144 seconds
Powered by Kunena Forum