carousel.comp - jog-FWD still an issue

More
21 Oct 2022 13:45 #254685 by tommylight

What do i use for sensors on each tool.
No index or home,

How does the system know that it is at tool 1?

Tool 1 = sensor 1 active
tool 2 = sensor 2 active
etc.

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

More
21 Oct 2022 14:23 #254686 by andypugh
I misunderstood. I thought that you were sating that the sequence was:

101
011
101
011
101
...

All the way round.

An individual sensor for each position is mode "single" (possibly I could have chosen a more descriptive term)
The following user(s) said Thank You: tommylight

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

More
21 Oct 2022 17:44 #254701 by spumco

B.T.W. is it recomended to stop the spindle when changing tools on a lathe?
Never seen it stop. So how do i stop that.

 


It is if you switch from an M3 tool to an M4 tool

But no, normally it isn't stopped for same-direction tools.  I have to edit my lathe programs because my F360 post calls an M5 at every tool change regardless of next-tool direction - and I haven't taken the time to try to edit the post.

-R
The following user(s) said Thank You: tommylight

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

More
21 Oct 2022 18:49 #254716 by tommylight
Thank you all,
took a look at other stuff on the link provided by Andy, added also the line to send Z to machine 0 on tool change, as far as i can tell that is safer than changing them near the spindle/part.
Just finished soldering a lot of resistors and found 2 of TD62083 so made things a bit easier and quicker, still took 4 hours with wiring! Ouch! :)

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

More
20 Jan 2023 05:11 #262457 by spumco
Andy,

If you're not sick of this yet, the same problem is back.  [Fresh install of MX21 & LCNC 2.10]

After a long hiatus and a new operator console, I'm at the point where I can finish up my ATC.  Using the same ATC settings as last summer I attempted to do some testing.

Discovered that the carousel only moves in one direction.  Jog-FWD & jog-REV both cause REV movement, and commanding a pocket change by setting carousel.0.pocket-number to a value which should result in FWD movement results in REV rotation.

As I mentioned last July all the pocket pins have been removed - just a home pin and a single sensor.  Carousel still set to counts.
loadrt carousel                     pockets=18 encoding=counts num_sense=2 dir=2
setp carousel.0.scale       [ATC]ATC_SCALE      #stepgen pulses per pocket
setp carousel.0.width       5 #[ATC]ATC_WIDTH      #width is tolerance 'window'; set higher for faster speeds
setp carousel.0.fwd-dc      50 #[ATC]ATC_VEL_FWD    #degrees/second if stepgen position-scale set to degrees
setp carousel.0.rev-dc      -50 #[ATC]ATC_VEL_REV    #degrees/second if stepgen position-scale set to degrees
setp carousel.0.decel-time  0.05 #[ATC]ATC_DECEL      #time to wait for carousel to stop before final alignment
setp carousel.0.align-dc    10 #[ATC]ATC_ALIGN_DC   #slow speed for alignment to sense-0 or sense-1

After homing and unhoming, and trying to jog fwd/rev and setting the pocket number then 'enable' a few times, it gets stuck at state = 20 and won't respond at all. 

I tried setting num_sense=1 but got an RTAPI_MP_ARRAY_INT error.

I see you made some edits to carousel.comp around September based on an issue reported on github - that would have been after I had my last configuration sort-of working.  Anything obviously wrong you see in my above settings? 

I was under the impression that in counts mode only an index pin is required.  Is this not the case?

Thx,
R

 

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

More
20 Jan 2023 11:49 #262472 by andypugh
I don't think that align-dc can be used with only an index pin.
Try setting that to zero and see what happens.

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

More
20 Jan 2023 11:54 #262473 by andypugh

andypugh post=262472 userid=723I don't think that align-dc can be used with only an index pin.
Try setting that to zero and see what happens.


No, that isn't true:
    case 'C': // encoder or stepgen counts.
        new_pos = current_position;
        if (homed){
            int c;
            int t;
            int w = width / 2;
            c = (counts - base_counts);
            t = floor(((float)c + w) / scale);
            if (c >= (t * scale - w)  && c <= (t * scale + w)) {
                new_pos = 1 + t - inst_pockets * floor((float)t / inst_pockets);
            }
            align_pin = (c % scale <= 2 && c % scale >= -2); // don't try to align to an exact count.
        }
    }

If it is stuck in state 20 then it is waiting for exact alignment to the stepgen counts.
case 20: //jogging fwd/rev
        if (current_position != target) 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;
    }

Can you grab a snapshot of the pin states when it is stuck?
Open a terminal and "halcmd show pin carousel*" and paste the result here.

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

More
20 Jan 2023 11:56 - 20 Jan 2023 11:57 #262474 by andypugh
Is it possible that the stepgen "dir" wire  has come loose?
Last edit: 20 Jan 2023 11:57 by andypugh.

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

More
20 Jan 2023 12:40 #262478 by spumco
Forgot to mention: I'd already tried it with align-dc set to 0, and decel set to 0 or 0.05.  the jogs look fine (right number of steps), just everything is one direction.

I guess it's possible the DIR pin came loose...  I can test this by connecting directly to drive with usb and seeing if it'll move in both directions.

halcmd attached.
Attachments:

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

More
20 Jan 2023 13:01 #262483 by andypugh

I guess it's possible the DIR pin came loose...  I can test this by connecting directly to drive with usb and seeing if it'll move in both directions.


Another way (the stepgen pin name will need to be changed to suit your actual system)
With LinuxCNC loaded.

halcmd unlinkp stepgen.0.velocity-cmd
halcmd setp stepgen.0.velocity-cmd 20
halcmd setp stepgen.0.velocity-cmd -20
halcmd setp stepgen.0.velocity-cmd 0

halcmd attached.


And that was with it stuck in state 20? That's wierd...

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

Time to create page: 0.124 seconds
Powered by Kunena Forum