Offset home and jog caroussel

More
26 Jan 2024 23:21 #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.
    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?
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
26 Jan 2024 23:25 #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
26 Jan 2024 23:42 #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
27 Jan 2024 03:41 #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
27 Jan 2024 07:48 - 27 Jan 2024 07:52 #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

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.
Attachments:
Last edit: 27 Jan 2024 07:52 by greg23_78.

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

More
27 Jan 2024 08:39 #291723 by tommylight

@Tommy - nope, OP is following orders :)

OK, thank you.
The following user(s) said Thank You: spumco

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

More
27 Jan 2024 17:18 #291752 by spumco


the pins carousel.0.jog-fwd and carousel.0.jog-rev are active on halshow before and after homing.

 


Those shouldn't be active.  Try connecting the input-17-not and -18-not signals to the jog pins and restart LCNC.  The you should see them low in halshow before/after homing.

Likely they'll work at that point.

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

More
28 Jan 2024 13:23 - 28 Jan 2024 14:04 #291799 by greg23_78
I think I misspoke, I meant to say that the operation of carousel.0.jog-fwd and carousel.0.jog-rev is correct.
When I press my jog-fwd and jog-rev buttons the inputs hm2_5i25.0.7i77.0.0.input-17 and hm2_5i25.0.7i77.0.0.input-18 go from low to high and when I release it it goes back to low.
carousel.0.jog-fwd and carousel.0.jog-rev work identically to hm2_5i25.0.7i77.0.0.input-17 and hm2_5i25.0.7i77.0.0.input-18.

correct functioning before and after homing

I've installed the latest version of carousel comp but the jog still doesn't respond.
Last edit: 28 Jan 2024 14:04 by greg23_78.

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

More
28 Jan 2024 21:45 #291838 by spumco
Ok, the next step is to add carousel.0.state to halshow.

"State" is the status of the carousel component, and the value shown in halshow corresponds to the 'state' described in the component.  Open the component:

github.com/LinuxCNC/linuxcnc/blob/master...onents/carousel.comp

And scroll down to see the "case = n" statement.

Watch the state pin and see how the value changes before/after homing and while it's moving.  See if the state changes when you turn on/off the jog pins.

I think it should be state = 20 if carousel is getting the jog signal in.  If you trigger the jog signal and it doesn't go to 20, there may be a problem and we need to get Andy involved.

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

More
29 Jan 2024 16:40 - 29 Jan 2024 16:49 #291906 by greg23_78
I did the test to see the change in caroussel.0.state and here is the result.

before home = 0
during home = 11
after home = 0
when i press jog = 20 and still 20 even if i release jog.
Last edit: 29 Jan 2024 16:49 by greg23_78.

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

Time to create page: 0.167 seconds
Powered by Kunena Forum