XHC-WHB04B-6 LinuxCNC not working

More
6 years 1 month ago #184189 by Uthayne
I have not, I will give that a shot.

I was able to get both continuous and step mode to behave as expected by changing the timeoutMs to 0 in the below section of hal.cc and recompiled.
Code:
bool Hal::waitForRequestedMode(volatile hal_bit_t * condition) { if(mIsSimulationMode) { return true; } useconds_t timeoutMs = 0;//mHalRequestProfile.mode.modeCheckLoopTimeoutMs; unsigned int maxTimeouts = mHalRequestProfile.mode.modeCheckLoops; unsigned int timeouts = maxTimeouts; do { if (false == *condition) { usleep(timeoutMs * 1000); } else { return true; } } while ((false == *condition) && (--timeouts) > 0); if (false == *condition) { auto delay = (maxTimeouts - timeouts) * timeoutMs; std::cerr << "hal failed to wait for reqested mode. waited " << delay << "ms\n"; return false; } else { return true; } return false; }

Although this has seemed to fix both issues (jerkiness and missed jog counts), I feel like it is not really a solution? I have been jogging around with it for the last few minutes and haven't seen any errors due to getting rid of the timeout duration. I'll have a look at adjusting the axis.L.jog-accel-fraction pin too.

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

More
6 years 1 month ago #184191 by romeofox
I solved my handwheel problem with a solution from the german cnc-aus-holz.at forum: link

At first I also suspected the USB port and system problems.
But I found the cause after searching the source code and several tests:
In the example configuration for the hand wheel (raw.githubusercontent.com/Linu.../example-configuration.md) the following signal connection is created in the section "#machine mode related signals":
Code:
net pdnt.mode.teleop whb.halui.mode.teleop halui.mode.teleop

But the signal "halui.mode.teleop" is not set by LinuxCNC as expected by the driver and then leads to timeouts/sleeps in the driver, which in turn leads to the delays when transmitting the handwheel movement to LinuxCNC.

After I changed the signal connection to :
Code:
net pdnt.mode.is-manual whb.halui.mode.is-teleop

where the net "net pdnt.mode.is-manual" is defined in the example config as:
Code:
net pdnt.mode.is-manual halui.mode.is-manual whb.halui.mode.is-manual
Did the hand wheel work without any problems.

Thanks to Ghostrider!

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

More
6 years 1 month ago #184193 by Uthayne
Thanks Romeo, I'm trying this fix out. I reverted back on the hal.cc changes I just made.

If I'm following correctly,
Code:
net pdnt.mode.is-manual halui.mode.is-manual whb.halui.mode.is-manual
gets changed to
Code:
net pdnt.mode.is-manual whb.halui.mode.is-teleop
and
Code:
net pdnt.mode.teleop whb.halui.mode.teleop halui.mode.teleop
gets commented out?

If so, I just tried it and it has the same jerkiness.

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

More
6 years 1 month ago #184194 by romeofox
That's what it was meant to be.
I tested my handwheel with LinuxCNC 2.8 and 2.9. Both worked.

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

More
6 years 1 month ago - 6 years 1 month ago #184200 by Uthayne
Would you mind sharing you .hal file? I either keep getting something wrong or it is not working for me.

Edit: changed
Code:
net pdnt.mode.is-manual halui.mode.is-manual whb.halui.mode.is-manual
to add
Code:
whb.halui.mode.is-teleop
(commented this out on
Code:
net pdnt.mode.is-teleop halui.mode.is-teleop #whb.halui.mode.is-teleop
)

and its working now. Strange. I made no other edits.

Full hal file is attached.
Last edit: 6 years 1 month ago by Uthayne.

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

More
6 years 1 month ago - 6 years 1 month ago #184213 by tommylight

romeofox wrote: I solved my handwheel problem with a solution from the german cnc-aus-holz.at forum:

I see some angry Austrians coming your way ! :) :) :)
Last edit: 6 years 1 month ago by tommylight. Reason: typo
The following user(s) said Thank You: rodw

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

Time to create page: 0.504 seconds
Powered by Kunena Forum