carousel.comp - jog-FWD still an issue

More
20 Jan 2023 18:39 #262514 by spumco
Thanks.  I'll do some proper diagnostics when I get home this evening.

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

More
21 Jan 2023 01:01 #262535 by smc.collins
log the pocket number in the carousel component, I'd be willing to bet that you have some kind of error with position encoding happening.

if not a issue with decoding, the statements here might be conflicting in nature at line 294, not sure why you'd subtract the jog rev from the jog fwd.

switch (state){
case 0: // waiting at start
motor_dir = 0;
if (jog_fwd || (jog_rev && inst_dir == 2)) {
if ((inst_code == 'I' || inst_code == 'E' || inst_code == 'C') && ! homed){
state = 10;
break;
}
target = current_position + jog_fwd - jog_rev;
if (target > inst_pockets ) target = 1;
if (target < 1) target = inst_pockets;
if (jog_fwd){
motor_fwd = 1;
motor_rev = 0;
motor_vel = fwd_dc;
motor_dir = 1;
}
if (jog_rev){
motor_fwd = 0;
motor_rev = 1;
motor_vel = rev_dc;
motor_dir = -1;
}
active = 1;
state = 20;
break;
}
motor_vel = hold_dc;
if (! enable) return ;
active = 1;
if ((inst_code == 'I' || inst_code == 'E' || inst_code == 'C') && ! homed){
state = 10;
break;
}
state = 1;
ready = 0;


here is how I have it written in my Hal toolchanger component project. and I have not fully tested this snippet of code yet.

if (increment_button) { // input from hal to increment pocekt
pocket_request += 1;
}
if (decrement_button) { // input from hal to decerment pocket
pocket_request -= 1;
}


if ((pocket > pocket_request) && (caoursel_down == true) && (carousel_out == true)) {
// Move tool changer backwards
motor_fwd = false;
motor_rev = true;
} else if ((pocket < pocket_request) && (caoursel_down == true) && (carousel_out == true)) {
// Move tool changer forwards
motor_fwd = true;
motor_rev = false;
} else
if (pocket == pocket_request){ // Tool changer is already at the correct pocket
motor_fwd = false;
motor_rev = false;
}

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

More
21 Jan 2023 04:42 #262551 by spumco
Holy brainfarts...it was a loose pin.

The pluggable terminals on the drive are the screw type, and if you don't open them up far enough before inserting the conductor you can tighten them and get a 'false' clamp.

After making sure the drive wasn't toast (via RS232 commands), I switched to a different stepgen on the 7i76e and it was doing the same thing.  Checked the board end terminals... then pulled the terminal block out of the drive and one of the DIR differential pair was a little wiggly... false clamp.

It's likely been that way for months and was casuing intermittent issues this whole time.

After setting align_dc and decel_time to 0 (no pocket pins to search for), it's responding to jogs and pocket destination commands.

I feel rather foolish, but at least I can get on with testing the ATC now.

Thanks Andy, and sorry for bugging you before doing remedial troubleshooting.

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

More
23 Jan 2023 17:28 #262750 by andypugh

not sure why you'd subtract the jog rev from the jog fwd.

target = current_position + jog_fwd - jog_rev;


It's just a slightly (pointlessly) quicker way to do:
if (jog_fwd){
    target = current_pos + 1;
} else if (jog_rev){
    target = current_pos -1;
}
The following user(s) said Thank You: tommylight

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

More
07 May 2023 16:12 - 07 May 2023 16:14 #270868 by andypugh
@spumco:

I just pushed some tweaks to carousel: github.com/LinuxCNC/linuxcnc/commit/2d6b...8aec9f77e175ce269369

Can you remind me what the current status is of carousel operation with your system?
Last edit: 07 May 2023 16:14 by andypugh.

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

More
07 May 2023 19:39 #270889 by spumco
Andy,

Current status is the same as from the last github post:
  • Normal pocket commands work fine.
  • Increasing the accel and velocity result in misalignment
    • Not lost steps in motor/drive (I'm using closed-loop stepper with tight following error settings)
    • Not related to steplen or stepspace
    • 'feels' like a velocity-mode stepgen commanded by a coarse-resolution timer, but I'm inexpert and not able to precisely define the issue.
  • Homing works
  • Home offset isn't fool-proof
    • If home offset is >0, homing malfunctions if the carousel is already at pocket #1
    • In this case, carousel will just move the offset amount and doesn't take the decel time in to account
    • I think homing sequence should ignore the home pocket sensor if already triggered and start rotating until the sensor triggers again, then apply the offset
  • Unhome doesn't work, no change from github description
  • jog-fwd/rev don't do anything except get stuck at state=20
Carousel is working for me now, at the speed/accel settings which don't result in misalignment.  I have physically moved my home/pocket sensors to get alignment sorted out, but that may not be possible for everyone else using carousel.

Would be nice to have jog working.

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

More
14 May 2023 12:23 #271340 by andypugh
I have just pushed the direct position control mode to v2.9. It would be useful if you could try it. 

raw.githubusercontent.com/LinuxCNC/linux...onents/carousel.comp

Homing will (or should) now move off the home pin and perform a full revolution if it is on the pin when set to home. It should also now do this after being unhomed. 

I think that we need to investigate further why you get stuck in mode 20 when jogging. 
    case 20: //jogging fwd/rev
        if (current_position != target){
            deb = debounce;
            return;
        } else if (deb-- > 0) {
            return;
        }
Do you see "current_position" change? does it match the expected "target"? It may be necessary to convert "target" to a HAL parameter to check this. 
        if (align_dc != 0 && ! align_pin) return;
It could also be getting stuck here if align_dc is nonzero. align_pin is an internal variable which is calculated from the counts. If align_dc = 0 it can't be getting stuck here. 
        motor_fwd = 0;
        motor_rev = 0;
        motor_vel = hold_dc;
        active = 0;
        if (jog_fwd || jog_rev) return; // require button release to jog again
It will, by design, get stuck here if the job button is not released. 
        if (align_dc != 0) {
            motor_vel = -align_dc;
            timer = decel_time;
            state = 5;
        } else {
            state = 0;
        }
        break;
    }
If it gets this far, it will move away from state 20. 
 
The following user(s) said Thank You: spumco

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

More
14 May 2023 21:07 #271370 by spumco
Thanks for the updates Andy.

I'll get the latest comp and start playing with it this evening.  Might take me a day or two to get back with results, but I'll get right on it.

-R

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

More
17 May 2023 02:10 #271495 by spumco
I've loaded the latest comp and am fiddling with it now.  Preliminary report:
  • Homing/unhoming
    • Works perfectly, even if it starts at pocket #1.  Nice.
  • Home offset
    • Works perfectly!  Very satisfying to use LCNC to adjust the alignment instead of nudging sensors or flags.
    • Can start homing from any position - even in-between pockets - and the offset works well in both directions.
    • Note that I haven't changed my rotational speed or accel during the above testing.  I'll try 'stress-testing' soon.
  • Jogging - still no joy
    • #1 Starting from a homed carousel, with enable/jog pins unlinked from other hal connections
      • align-dc = 0
      • current-position = 1
      • pocket-number = 1
      • counts = counts-target
      • Set enable low (state = 0)
      • Set either jog-fwd/rev high through halshow (state 0 > 20)
        • current-position = 1
        • pocket-number = 1
        • counts = counts-target
        • Carousel does not move, and no way to get out of state = 20...must restart LCNC
    • #2 Starting as above
      • Set enable high (state 0 > 9)
      • Set jog-fwd high (state = 9, no movement or response)
      • Set jog-fwd low (state = 9)
      • Set enable low (state 9 > 0)
    • #3 Starting from #2
      • Set enable high (state 0 > 9)
      • Set jog-fwd high (state = 9)
      • Set enable low (state 9 > 20)
      • Now stuck at 20.
Once it's stuck, there's no combination or sequence of inputs/commands I can think of can get it out of 20.
The following user(s) said Thank You: tommylight

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

More
24 Jul 2023 15:10 - 25 Jul 2023 13:21 #276155 by spumco
UPDATE

I've just had an ATC crash with the counts mode config.  Crash was due to the pocket not being aligned with the tool holder before the head came down on the misaligned tool.  Thankfully I have plastic tool forks and a (intentionally) fairly flexible platter.

No major damage I can see, but I still need to check everything closely.  No alarms or error messages until the crash happened.

No changes to my config or sequencing macros since the last program I ran.  The head should not have come down until carousel reported being in position via carousel.0.ready pin going high.

Assuming carousel reported being in position, this means the counts were off from intended.

Once I've determined there is no serious damage I'm going to try switching to carousel's index mode and start testing again.

EDIT
Just discovered that I've failed to connect my ATC stepper drive alarm to some LCNC estop or other alarm signal in HAL.  So it's plausible that the stepper drive faulted, failed to rotate per command, and wound up misaligned once carousel.0.ready went high.  I don't know if this is the case as there won't be any records or data trail in LCNC for me to investigate the crash.

So despite preaching the value & reliability of a closed-loop stepper for ATC use, I've managed to shoot myself in the foot again.  I may still switch to carousel-index mode, but I think I'll do some testing while still in counts mode once I've hooked up the alarm signal.
Last edit: 25 Jul 2023 13:21 by spumco. Reason: DOH!

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

Time to create page: 0.131 seconds
Powered by Kunena Forum