XHC WH04B-4 Driver issues and improvements
12 Nov 2023 13:52 - 12 Nov 2023 13:53 #285163
by bally123
XHC WH04B-4 Driver issues and improvements was created by bally123
Hi All
I got my XHC-WH04B-4 working recently. I can control all axis and homing, got the MDI macros to set zero and spindle start.
I have a few things that I really need to improve and functions to get working. Hopefully this topic will provide useful development for others going forward.
I see 2 approaches to resolve the issues -
1. modifying HAL configurations
2. modifying the source code behind xhc-whb04b-6
Issues so far:
FEED OVERRIDE - MPG
On start up the pendant is not in Continuous or Step Mode - I note that feed override is changed when using the handwheel
Once homing is complete or Continuous or Step is selected then feed override cannot be affected by the hand wheel
I presume because unlike the 6 axis pendant this 4 axis version does not have a button to select MPG mode, so we cannot return to MPG mode - which i have read is combined with MPG mode for the the feed and spindle override.
Regardless of the above, the operation I really want is simple - Once homed - Select LEAD position and have the hand wheel control feed override - Then I can safely work thorough machine runs using this as a way to quickly halt the machine, or slow feed through areas of programs.
LEAD Position
The rotary position LEAD puts out a different code to the 6 AXIS VERSION - so I cannot select LEAD mode as far as the driver is concerned. This i think requires a change to the source code. I found the offending line in pendant .cc
Line 383 : Needs changing to 0x09 for the 4 axis version (is 0x1C for 6 axis version)
Continuous vs step mode jog.speed :
Continuous operation gives a jog speed far too slow. Step mode gives a step far to large at the higher settings 60% and 100%.
I used halmeter to verify the jog speed scale in the 2 modes and found :
selector Position Jog.scale cont Mode Jog.scale - Step Mode
0.001 0.0008 0.001
0.01 0.002 0.01
0.1 0.004 0.1
1.0 0.012 1.0
60% 0.024 5.0
100% 0.04 10.0
Noting also that: continuous mode - axis.n.jog-vel-mode = 0 In Step Mode - axis.n.jog-vel-mode = 1
In Step its Ok from position 0.001 to 1.0, but step of 5.0 and 10.0 is crazy and will result in smashing tool into something at somepoint - Note removing the option for big step - B from loadusr -W xhc-whb04b-6 -HsfB Does not help the large steps remain active.
As the option B is ineffective , I'd be quite happy if the 60% and 100% settings just gave no output or capped it at 1.0 - so need a way to invoke this.
I see a few possibilities here between a hal solution or a source code change.
Regards my HAL file I have implemented a lowpass filter and also to scale the jog.counts - this improves the continuous mode speeds but then, of course, undesirably scales the step mode distance. I figure I then need develop the HAL code to change the scale applied depending on the mode (cont or step) - first though is to use axis.n.jog-vel-mode with a mux to apply a different scale - but I haven't experimented yet.
But I also wonder why the driver reduces the jog speed scale so much in continuous mode? Perhaps a change to source code giving higher jog.scale in continuous mode is more elegant than complicating the HAL file.
PENDANT LOCKS UP
Not sure how but a couple of times i have the pendant in a state where nothing responds - the usb is fine and the pendant shows activity but no response to hand wheel or buttons. possibly after applying MDI commands in axis then returning to manual mode. - needs further investigation.
Machine: MESA 7i76 + 5i95 - stepper motor axis mill and lathe in mm mode
My gut feel is some source code modification with an extra option for the 4 axis pendant would be great - then the lead mode issue could be fixed. Possibly a change to the cont mode jog.scale values - i'm sure they could be much greater as the machine simply stops when the pulse stop so its much safer scenario than large steps in step mode.
I have some degree of confidence in investigating and modifying the source code - but I have no idea how to go about compiling and implementing changes to xhc-whb04b-6. However I have a spare machine running a sim and i'm wilting to try - any pointers on where to get started are greatly appreciated. (I have some experience with developing software in windows, but I'm a linux newbie)
Otherwise if you think HAL offers a solution please feel free to suggest things. I may have missed a simple method to resolve some of this and happy to consider other ideas.
If your still reading at this point - well done, thanks for taking the time.
Bally
I got my XHC-WH04B-4 working recently. I can control all axis and homing, got the MDI macros to set zero and spindle start.
I have a few things that I really need to improve and functions to get working. Hopefully this topic will provide useful development for others going forward.
I see 2 approaches to resolve the issues -
1. modifying HAL configurations
2. modifying the source code behind xhc-whb04b-6
Issues so far:
FEED OVERRIDE - MPG
On start up the pendant is not in Continuous or Step Mode - I note that feed override is changed when using the handwheel
Once homing is complete or Continuous or Step is selected then feed override cannot be affected by the hand wheel
I presume because unlike the 6 axis pendant this 4 axis version does not have a button to select MPG mode, so we cannot return to MPG mode - which i have read is combined with MPG mode for the the feed and spindle override.
Regardless of the above, the operation I really want is simple - Once homed - Select LEAD position and have the hand wheel control feed override - Then I can safely work thorough machine runs using this as a way to quickly halt the machine, or slow feed through areas of programs.
LEAD Position
The rotary position LEAD puts out a different code to the 6 AXIS VERSION - so I cannot select LEAD mode as far as the driver is concerned. This i think requires a change to the source code. I found the offending line in pendant .cc
Line 383 : Needs changing to 0x09 for the 4 axis version (is 0x1C for 6 axis version)
Continuous vs step mode jog.speed :
Continuous operation gives a jog speed far too slow. Step mode gives a step far to large at the higher settings 60% and 100%.
I used halmeter to verify the jog speed scale in the 2 modes and found :
selector Position Jog.scale cont Mode Jog.scale - Step Mode
0.001 0.0008 0.001
0.01 0.002 0.01
0.1 0.004 0.1
1.0 0.012 1.0
60% 0.024 5.0
100% 0.04 10.0
Noting also that: continuous mode - axis.n.jog-vel-mode = 0 In Step Mode - axis.n.jog-vel-mode = 1
In Step its Ok from position 0.001 to 1.0, but step of 5.0 and 10.0 is crazy and will result in smashing tool into something at somepoint - Note removing the option for big step - B from loadusr -W xhc-whb04b-6 -HsfB Does not help the large steps remain active.
As the option B is ineffective , I'd be quite happy if the 60% and 100% settings just gave no output or capped it at 1.0 - so need a way to invoke this.
I see a few possibilities here between a hal solution or a source code change.
Regards my HAL file I have implemented a lowpass filter and also to scale the jog.counts - this improves the continuous mode speeds but then, of course, undesirably scales the step mode distance. I figure I then need develop the HAL code to change the scale applied depending on the mode (cont or step) - first though is to use axis.n.jog-vel-mode with a mux to apply a different scale - but I haven't experimented yet.
But I also wonder why the driver reduces the jog speed scale so much in continuous mode? Perhaps a change to source code giving higher jog.scale in continuous mode is more elegant than complicating the HAL file.
PENDANT LOCKS UP
Not sure how but a couple of times i have the pendant in a state where nothing responds - the usb is fine and the pendant shows activity but no response to hand wheel or buttons. possibly after applying MDI commands in axis then returning to manual mode. - needs further investigation.
Machine: MESA 7i76 + 5i95 - stepper motor axis mill and lathe in mm mode
My gut feel is some source code modification with an extra option for the 4 axis pendant would be great - then the lead mode issue could be fixed. Possibly a change to the cont mode jog.scale values - i'm sure they could be much greater as the machine simply stops when the pulse stop so its much safer scenario than large steps in step mode.
I have some degree of confidence in investigating and modifying the source code - but I have no idea how to go about compiling and implementing changes to xhc-whb04b-6. However I have a spare machine running a sim and i'm wilting to try - any pointers on where to get started are greatly appreciated. (I have some experience with developing software in windows, but I'm a linux newbie)
Otherwise if you think HAL offers a solution please feel free to suggest things. I may have missed a simple method to resolve some of this and happy to consider other ideas.
If your still reading at this point - well done, thanks for taking the time.
Bally
Last edit: 12 Nov 2023 13:53 by bally123.
The following user(s) said Thank You: tommylight
Please Log in or Create an account to join the conversation.
26 Nov 2023 10:20 #286539
by dpslwk
Replied by dpslwk on topic XHC WH04B-4 Driver issues and improvements
there seems to be some pr in the past around the lead code of 0x1c vs 0x9b
github.com/LinuxCNC/linuxcnc/pull/987
step size of 5 and 10 might be huge on an imperial setup but they are nice sizes on a metric setup (5" vs 5mm)
so changes to this should may want to be unit aware (either machine INI or G20/G21) if its not already
github.com/LinuxCNC/linuxcnc/pull/987
step size of 5 and 10 might be huge on an imperial setup but they are nice sizes on a metric setup (5" vs 5mm)
so changes to this should may want to be unit aware (either machine INI or G20/G21) if its not already
Please Log in or Create an account to join the conversation.
26 Nov 2023 10:41 #286540
by bally123
Replied by bally123 on topic XHC WH04B-4 Driver issues and improvements
Step size of 5 and 10 is still huge on a metric machine. Very easy to crash into things.. step mode often used for position and tool touch so should be
In fact even 2mm on my machine can get you into trouble
For travelling large distance continuous mode is better. / Safer
I now have a version that has fived lead mode. Improved speed of cont mode and I'm working on implementing step options of .01 05 0.1 0.5. And 1mm
Also increased the step size for feed override. Means I can sweep from 0 to 100 % override much faster.
I'm getting closer to the pendant I really need.
In fact even 2mm on my machine can get you into trouble
For travelling large distance continuous mode is better. / Safer
I now have a version that has fived lead mode. Improved speed of cont mode and I'm working on implementing step options of .01 05 0.1 0.5. And 1mm
Also increased the step size for feed override. Means I can sweep from 0 to 100 % override much faster.
I'm getting closer to the pendant I really need.
Please Log in or Create an account to join the conversation.
08 Apr 2024 20:27 #297831
by egemens
Replied by egemens on topic XHC WH04B-4 Driver issues and improvements
any updates on this?
I have the 4 axis model and pendant starts in MPG mode and i have to press either con or step button to get it moving.
also step and cont. modes seem very similar in movement in my machine.
pendant responded differently on mach3
on step mode it stepped with every pulse but i was not able to make consequtive steps as i do in linuxcnc. there was some kind of delay.
on cont. mode motion was more smooth on mach3 as if it was averaging the values. now on linuxcnc its more sensitive to the rotation of the wheel and if i dont turn it at a constant speed, it makes a stuttering motion. it it very similar to step mode.
as i said above i couldn't see the difference between 2 modes.
also i never fully understood the LEAD mode. In mach3 %100 setting meant max feedrate set at the moment for example F3000 and LEAD mode meant max possible feedrate.
I have the 4 axis model and pendant starts in MPG mode and i have to press either con or step button to get it moving.
also step and cont. modes seem very similar in movement in my machine.
pendant responded differently on mach3
on step mode it stepped with every pulse but i was not able to make consequtive steps as i do in linuxcnc. there was some kind of delay.
on cont. mode motion was more smooth on mach3 as if it was averaging the values. now on linuxcnc its more sensitive to the rotation of the wheel and if i dont turn it at a constant speed, it makes a stuttering motion. it it very similar to step mode.
as i said above i couldn't see the difference between 2 modes.
also i never fully understood the LEAD mode. In mach3 %100 setting meant max feedrate set at the moment for example F3000 and LEAD mode meant max possible feedrate.
Please Log in or Create an account to join the conversation.
Time to create page: 0.075 seconds