XHC-WHB04B-6 LinuxCNC not working

More
6 years 7 months ago - 6 years 7 months ago #161179 by MovT
Jogwheel function [SOLVED]

Hi.

I solved the not proper working jogwheel with the driver from machinekit, that Talla83 supplied on his homepage and Youtube channel.

If you already use halui.machine.is-on for switching some solenoids etc. you run in the trap. When you start and get the error that halui.machine.is-on is already connected, and comment out the line, you kill the logic:
Code:
net pdnt.machine.is-on halui.machine.is-on whb.halui.machine.is-on

The driver NEED the signal on whb.halui.machine.is-on to run properly its safe to do nothing untile the machine is on. If you see the RESET in the display the machine need to be power on. If you do that, the signal will be set, the "RESET" disappear and you can use all other functions you have set and after homing, jogging works like a charm.

Maybe it's a good idea to komment it in the HAL that this line is mandatory.

Hope it will spread around and we all will have fun in these days.

Take care and keep well!!!

Best,
Udo
Last edit: 6 years 7 months ago by MovT.
The following user(s) said Thank You: sdwyer

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

More
6 years 7 months ago - 6 years 7 months ago #161888 by alkabal
Hi

I have used the last driver from machinekit and try to update for linuxcnc master

All work fine excepted the velocity jog mode, turning the feedrate button from pendant update the feedrate override in GUI (2% to 100%) but the move seems to be allways at same velocity.

I have some trouble understanding the process for velocity jog feed.

Is there a reason for not merging something like this driver ?

Br


Ps : this driver include toggle mode for mist/flood from Fn+ step/continuous (and lube from macro 2), also include a toggle for Absolut/Relative Dro from macro 10, + removed some useless code
Last edit: 6 years 7 months ago by alkabal.

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

More
6 years 7 months ago - 6 years 7 months ago #162300 by alkabal
If this can be usefull for someone, for smoothieboard + smoopi with kivy i have write a driver full featured.
This one add two more feature :
-Spindle override using lead position
-Speedrate override using CON mode

The result is 4 different function using STEP/MPG/CON/LEAD

This driver was written with much difficulty but i hope is not crappy and is easy to read.
github.com/wolfmanjm/kivy-smoothie-host/pull/16


For Linuxcnc i have see other based source code than raoul Rubien, based on the original hb04b, or if i remember also a python version. (i can't found the topic another time)

At the end, what is the most finished version ?
Why nobody try to include one of this to master ?
Last edit: 6 years 7 months ago by alkabal.

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

More
6 years 7 months ago - 6 years 7 months ago #162312 by alkabal
Code:
// ---------------------------------------------------------------------- void Pendant::dispatchFeedValueToHal() { // on feed rotary button change FeedRotaryButton& feedButton = mCurrentButtonsState.feedButton(); if (feedButton.isPermitted()) { float axisJogStepSize = 0; if (feedButton.stepMode() == HandwheelStepmodes::Mode::STEP) { mHal.setFeedOverrideCountEnable(false); mHal.setStepMode(true); mHal.setFeedOverrideScale(0.1); mHal.setFeedOverrideDirectValue(false); axisJogStepSize = feedButton.stepSize(); } else if (feedButton.stepMode() == HandwheelStepmodes::Mode::CONTINUOUS) { mHal.setFeedOverrideCountEnable(false); mHal.setContinuousMode(true); // On velocity mode set feed-override value to absolute percentage value: counts*scale. axisJogStepSize = 2; //axisJogStepSize = feedButton.stepSize(); mHal.setFeedOverrideDirectValue(true); float feedButtonStepSize = feedButton.stepSize(); if (feedButtonStepSize >= 10) { // on velocity >= 10%: set a coarse grained scale, // this also affects the Feed+/- increment mHal.setFeedOverrideScale(0.1); mHal.setFeedOverrideCounts(feedButtonStepSize * 0.1); } else { // on velocity < 10%: set a fine grained scale, // this also affects the Feed+/- increment mHal.setFeedOverrideScale(0.01); mHal.setFeedOverrideCounts(feedButtonStepSize * 1); } } else { } mHal.setStepSize(axisJogStepSize); } else { mHal.setStepSize(0); } } // ----------------------------------------------------------------------


The Step/Mpg mode are managed here but this is not clear for me. (and more trouble with the use of ilowpass and scale from hal)


in my own driver i do
Code:
steplut = {0x0d: 0.001, 0x0e: 0.01, 0x0f: 0.1, 0x10: 1, 0x1a: 1, 0x1b: 1, 0x1c: 0} # combined button for set step mpglut = {0x0d: 2, 0x0e: 5, 0x0f: 10, 0x10: 30, 0x1a: 60, 0x1b: 100, 0x1c: 0} # combined button for set mpg dist = 0.001 * wheel-pulse * self.mpglut[speed_mode] # mode mpg dist = self.steplut[speed_mode] *wheel-pulse # mode step
Last edit: 6 years 7 months ago by alkabal.

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

More
6 years 7 months ago - 6 years 7 months ago #162323 by alkabal
Writing this allow to have something variable but i'm unsure about the real reaction needed for Mpg mode.
I have try to use without success :
halui.feed-override.count-enable (bit, in)
halui.feed-override.counts (s32, in) - counts * scale = FO
halui.feed-override.direct-value (bit, in)
halui.feed-override.scale (float, in)
Code:
void Pendant::dispatchFeedValueToHal() { // on feed rotary button change FeedRotaryButton& feedButton = mCurrentButtonsState.feedButton(); if (feedButton.isPermitted()) { float axisJogStepSize = 0; if (feedButton.stepMode() == HandwheelStepmodes::Mode::STEP) { mHal.setStepMode(true); mHal.setContinuousMode(false); mHal.setFeedOverrideCountEnable(false); mHal.setFeedOverrideDirectValue(false); mHal.setFeedOverrideScale(0); axisJogStepSize = feedButton.stepSize(); } else if (feedButton.stepMode() == HandwheelStepmodes::Mode::CONTINUOUS) { mHal.setStepMode(false); mHal.setContinuousMode(true); mHal.setFeedOverrideCountEnable(false); mHal.setFeedOverrideDirectValue(false); mHal.setFeedOverrideScale(0); axisJogStepSize = feedButton.stepSize() * 0.001; } else { } mHal.setStepSize(axisJogStepSize); } else { mHal.setStepSize(0); } }
Last edit: 6 years 7 months ago by alkabal.

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

More
6 years 7 months ago #162381 by andypugh

alkabal wrote: Why nobody try to include one of this to master ?


I am not aware of anyone asking.

If you want to make a pull-request to LinuxCNC then it might get merged. The problem is that most developers probably don't have the hardware to test it with.

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

Time to create page: 0.111 seconds
Powered by Kunena Forum