xhc-whb04b-(4/6) issues

More
03 Jun 2021 05:31 #211060 by MRx
xhc-whb04b-(4/6) issues was created by MRx
Hi,

I'm using the XHC-WHB04B-4 pendant almost on a daily basis but I'm facing some reliability issues it seems:
1. after a job has stopped I need to push stop on the pendant and afterwards start again (sometimes pushing start is not recognized)
2. if the code contains multiple M0 (pause) commands I can only un-pause the first one with the pendant.
Are those issues known?
I have had a look at the xhc driver it seems that it's polling out all the data, but the pendant is supposed to support usb interrupt transfers; could that be the issue about lost pendant inputs? Not recognizing un-pause (multiple M0) for sure is a problem on configuration or linuxcnc level.

a small sidenote, it is possible to modify the XHC-WHB04B-4 to a XHC-WHB04B-6, it's easy to disassemble the rotary switch and there's only a stopper in the switch which stops the switch to go to the 5th and 6th axis. The electronic is all there.
The stopper can be removed with a cutter. I did not plan to use 5 axis when I built my system but now I do (A + C axis), I removed the stopper and it works well.

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

More
05 Jun 2021 09:31 #211204 by itsme
Replied by itsme on topic xhc-whb04b-(4/6) issues
I have the same issues like you, had no time to figure it out yet...

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

More
13 Jun 2021 12:51 #211931 by MRx
Replied by MRx on topic xhc-whb04b-(4/6) issues
That's good please if anyone else has the same issue or is able to confirm that just reply here.

I just want to be sure that it's a driver issue (I think I should be able to find some time to have a closer look at it).

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

More
13 Jun 2021 21:42 #211973 by alkabal
Replied by alkabal on topic xhc-whb04b-(4/6) issues
Hi

I appologize, i'm the person who have made the driver change from machinekit to linuxcnc but i can't confirm you if the problem is for all person.

Recently i have pushed a update to master about mode is teleop, this one is waiting for merge to 2.8, maybe you can try to use master for check if the problem is the same. (or try 2.8 if you already use master)

Br

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

More
14 Jun 2021 10:34 #212019 by MRx
Replied by MRx on topic xhc-whb04b-(4/6) issues
I'm using the latest git (but I don't know if my installed version includes your "recent" changes, I will try to update again within the next days).

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

More
14 Jun 2021 15:41 - 14 Jun 2021 15:51 #212032 by MRx
Replied by MRx on topic xhc-whb04b-(4/6) issues
I have just updated linuxcnc here.

My test for is-paused:
M0 <- this one I can acknowledge with the pendant
(debug, first stop)
M0 <- this one not, I'm stuck with having to use the keyboard again
(debug, second stop)
M0
(debug, third stop)
M0
(debug, fourth stop)


Also the start / stop behaviour is not good.
Stop always works, but sometimes start does not act.

I ran the xhc binary on the console with -ue and all the keys show up properly - there is no button push missing. I checked the button push in Axis, seems like there's no notification coming back to Linuxcnc sometimes when the start button is pushed.
Last edit: 14 Jun 2021 15:51 by MRx.

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

More
14 Jun 2021 17:49 - 14 Jun 2021 17:50 #212040 by alkabal
Replied by alkabal on topic xhc-whb04b-(4/6) issues
My knowledge about internal driver is limited, your welcome for check if you see something wrong.

In case of you are able to understand the code they are one optional feature that need to be patched « B » option for big step is not functional with or without B do the same result.

Br
Last edit: 14 Jun 2021 17:50 by alkabal.

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

More
14 Jun 2021 18:10 #212044 by MRx
Replied by MRx on topic xhc-whb04b-(4/6) issues
I'll check tomorrow, seems to be easy to understand.
Something's possibly wrong with those flags:
if (*memory->in.isProgramPaused)
if (*memory->in.isProgramRunning)
if (*memory->in.isProgramIdle)

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

More
15 Jun 2021 04:04 - 15 Jun 2021 07:23 #212091 by MRx
Replied by MRx on topic xhc-whb04b-(4/6) issues
ok there's a bug in the driver, the pins are not reset.

Once a program starts doResumeProgram is probably set to false the very first time, but after the first run it might get messy.

This pin needs to see a toggle from true to false, however if it's true the user needs to push stop to reset the flag manually - that's why it's so inconsistent with stop/start.

following fixes the issue with multiple M0 in the program:
----
void Hal::checkState(bool state, hal_bit_t *pin) {
        // 500 milliseconds timeout
        unsigned int timeouts=500;
        unsigned int timeoutMs=1;
        do
        {
                if (state == *pin)
                {
                        usleep(timeoutMs * 1000);
                }
                else
                {
                        break;
                }
        } while ((state == *pin) && (--timeouts) > 0);
}


// ----------------------------------------------------------------------
void Hal::toggleStartResumeProgram()
{
    *mHalCout << "isProgramPaused" << *memory->in.isProgramPaused << endl;
    *mHalCout << "isProgramRunning" << *memory->in.isProgramRunning << endl;
    *mHalCout << "isProgramIdle" << *memory->in.isProgramIdle << endl;

    if (*memory->in.isProgramPaused)
    {
        *memory->out.doPauseProgram  = false;
        *memory->out.doRunProgram    = false;
        *memory->out.doResumeProgram = true;
        checkState(true, memory->in.isProgramPaused);
        *memory->out.doResumeProgram = false;
    } else if (*memory->in.isProgramRunning)
    {
        *memory->out.doPauseProgram  = true;
        checkState(false, memory->in.isProgramPaused);
        *memory->out.doPauseProgram  = false;
        *memory->out.doRunProgram    = false;
        *memory->out.doResumeProgram = false;
    } else if (*memory->in.isProgramIdle)
    {
        *memory->out.doPauseProgram  = false;
        *memory->out.doRunProgram    = true;
        checkState(false, memory->in.isProgramRunning);
        *memory->out.doRunProgram    = false;
        *memory->out.doResumeProgram = false;
    }
}

There's still some issue with halui.mode.is-auto which prevents the NC program from starting sometimes.

Another Update:
it seems like mHalRequestProfile.mode.holdMs * 1000 might be too short sometimes, the error output shows:
hal failed to wait for requested mode. waited 300ms.
bool Hal::requestMode(bool isRisingEdge, hal_bit_t *requestPin, hal_bit_t * modeFeedbackPin)
{
    if (isRisingEdge)
    {
        bool rv;
        if (true == *modeFeedbackPin)
        {
            // shortcut for mode request which is already active
            return true;
        }
        // request mode
        *requestPin = true;
        usleep(mHalRequestProfile.mode.holdMs * 1000);
        rv = waitForRequestedMode(modeFeedbackPin);
        *requestPin = false;
        usleep(mHalRequestProfile.mode.spaceMs * 1000);
        return rv;
    }
    else
    {
      // on button released always clear request
      *requestPin = false;
      return false;
    }
    return false;
}

After those updates the issues from the first post are gone.
Last edit: 15 Jun 2021 07:23 by MRx.

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

More
15 Jun 2021 08:51 #212103 by alkabal

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

Time to create page: 0.198 seconds
Powered by Kunena Forum