XHC-HB04 wireless MPG pendant HAL module

More
14 Sep 2015 21:39 #62564 by ArcEye
net pendant:is-idle not.1.in

if that is the name of your signal ( why does it have a colon in it?)

You can only have one writer to a signal, but as many readers as you like

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

More
14 Sep 2015 22:32 #62566 by dgarrett
When using the script xhc-h04.tcl with an ini file specification for:
[XHC_HB04_BUTTON]
start_pause=std_start_pause

The script creates a signal named pendant:is-idle
with these connections:
net pendant:is-idle <= halui.program.is-idle
net pendant:is-idle => pendant_util.is-idle

so in your custom.hal (that must follow xhc-hb04.tcl), you could change:
net prog-running not.1.in <= halui.program.is-idle

to:
net pendant:is-idle  => not.1.in

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

More
14 Sep 2015 23:12 #62569 by tommy
net pendant:is-idle  => not.1.in
solved the problem!
Thank you!

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

More
15 Sep 2015 10:09 #62604 by dgarrett
For reference:

A method to analyze or debug a configuration that uses the xhc-hb04.tcl script
_and_ additional custom hal files is to insert an inifile line to show the signal
connections made by the script:

Example:
[HAL]
HALFILE   = primary_hal_file_1
...
HALFILE   = primary_hal_file_n
HALFILE   = LIB:xhc-hb04.tcl
HALCMD  = show sig pendant:    # <--- add this line
HALFILE   = custom_hal_file_1
...
HALFILE  = custom_hal_file_n


Start linuxcnc in a terminal using the path to the inifile
(if using run-in-place, source the rip-environment script first):
$ linuxcnc path_to_inifile.ini

An example printout for a simulator inifile adapted to use the
modification above (HALCMD = show sig pendant: ) will show all
the connections made by the script:
Signals:
Type          Value  Name     (linked to)
float             0  pendant:feed-override
                         <== halui.feed-override.value
                         ==> xhc-hb04.feed-override
bit            TRUE  pendant:feed-override-enable
                         ==> halui.feed-override.count-enable
                         <== xhc-hb04.jog.enable-feed-override
float             0  pendant:feed-value
                         <== motion.current-vel
                         ==> xhc-hb04.feed-value
bit           FALSE  pendant:goto-zero
                         ==> halui.mdi-command-00
                         <== xhc-hb04.button-goto-zero
bit           FALSE  pendant:half
                         ==> halui.spindle.stop
                         <== xhc-hb04.button-half
bit           FALSE  pendant:home
                         ==> halui.home-all
                         <== xhc-hb04.button-home
bit           FALSE  pendant:is-idle
                         <== halui.program.is-idle
                         ==> pendant_util.is-idle
bit           FALSE  pendant:is-manual
                         <== halui.mode.is-manual
                         ==> pendant_util.is-manual
bit           FALSE  pendant:is-paused
                         <== halui.program.is-paused
                         ==> pendant_util.is-paused
bit           FALSE  pendant:is-running
                         <== halui.program.is-running
                         ==> pendant_util.is-running
bit           FALSE  pendant:jog-c
                         ==> axis.5.jog-enable
                         <== xhc-hb04.jog.enable-a
float             0  pendant:jog-prescale
                         ==> pendant_util.divide-by-k-in
                         <== xhc-hb04.jog.scale
float             0  pendant:jog-scale
                         ==> axis.0.jog-scale
                         ==> axis.1.jog-scale
                         ==> axis.2.jog-scale
                         ==> axis.5.jog-scale
                         <== pendant_util.divide-by-k-out
float             0  pendant:jog-speed
                         <== halui.max-velocity.value
bit           FALSE  pendant:jog-x
                         ==> axis.0.jog-enable
                         <== xhc-hb04.jog.enable-x
bit           FALSE  pendant:jog-y
                         ==> axis.1.jog-enable
                         <== xhc-hb04.jog.enable-y
bit           FALSE  pendant:jog-z
                         ==> axis.2.jog-enable
                         <== xhc-hb04.jog.enable-z
bit           FALSE  pendant:jogenable-off
                         ==> pendant_util.jogenable-off
                         <== xhc-hb04.jog.enable-off
bit           FALSE  pendant:macro-1
                         ==> halui.mdi-command-01
                         <== xhc-hb04.button-macro-1
bit           FALSE  pendant:macro-2
                         ==> halui.mdi-command-02
                         <== xhc-hb04.button-macro-2
bit           FALSE  pendant:macro-3
                         ==> halui.mdi-command-03
                         <== xhc-hb04.button-macro-3
bit           FALSE  pendant:macro-6
                         ==> halui.mdi-command-06
                         <== xhc-hb04.button-macro-6
bit           FALSE  pendant:macro-7
                         ==> halui.mdi-command-07
                         <== xhc-hb04.button-macro-7
float             0  pendant:muxed-accel-0
                         <== pendant_util.amux0-out
float             0  pendant:muxed-accel-1
                         <== pendant_util.amux1-out
float             0  pendant:muxed-accel-2
                         <== pendant_util.amux2-out
float             0  pendant:muxed-accel-5
                         <== pendant_util.amux3-out
float             0  pendant:pos-c
                         <== halui.axis.5.pos-feedback
                         ==> xhc-hb04.a.pos-absolute
float             0  pendant:pos-rel-c
                         <== halui.axis.5.pos-relative
                         ==> xhc-hb04.a.pos-relative
float             0  pendant:pos-rel-x
                         <== halui.axis.0.pos-relative
                         ==> xhc-hb04.x.pos-relative
float             0  pendant:pos-rel-y
                         <== halui.axis.1.pos-relative
                         ==> xhc-hb04.y.pos-relative
float             0  pendant:pos-rel-z
                         <== halui.axis.2.pos-relative
                         ==> xhc-hb04.z.pos-relative
float             0  pendant:pos-x
                         <== halui.axis.0.pos-feedback
                         ==> xhc-hb04.x.pos-absolute
float             0  pendant:pos-y
                         <== halui.axis.1.pos-feedback
                         ==> xhc-hb04.y.pos-absolute
float             0  pendant:pos-z
                         <== halui.axis.2.pos-feedback
                         ==> xhc-hb04.z.pos-absolute
bit           FALSE  pendant:probe-z
                         ==> motion.probe-input
                         <== xhc-hb04.button-probe-z
bit           FALSE  pendant:program-pause
                         ==> halui.program.pause
                         <== pendant_util.pause
bit           FALSE  pendant:program-resume
                         ==> halui.program.resume
                         <== pendant_util.resume
bit           FALSE  pendant:program-run
                         ==> halui.mode.auto
                         ==> halui.program.run
                         <== pendant_util.run
bit           FALSE  pendant:reset
                         ==> halui.estop.activate
                         <== xhc-hb04.button-reset
bit           FALSE  pendant:rewind
                         ==> halui.program.step
                         <== xhc-hb04.button-rewind
bit           FALSE  pendant:safe-z
                         ==> halui.mdi-command-10
                         <== xhc-hb04.button-safe-z
bit           FALSE  pendant:spindle
                         ==> halui.spindle.start
                         <== xhc-hb04.button-spindle
float             0  pendant:spindle-override
                         <== halui.spindle-override.value
                         ==> xhc-hb04.spindle-override
bit            TRUE  pendant:spindle-override-enable
                         ==> halui.spindle-override.count-enable
                         <== xhc-hb04.jog.enable-spindle-override
float             0  pendant:spindle-rps
                         <== motion.spindle-speed-out-rps-abs
                         ==> xhc-hb04.spindle-rps
bit           FALSE  pendant:start-or-pause
                         ==> pendant_util.start-or-pause
                         <== xhc-hb04.button-start-pause
bit           FALSE  pendant:step
                         <== xhc-hb04.button-step
                         ==> xhc-hb04.stepsize-up
bit           FALSE  pendant:stop
                         ==> halui.program.stop
                         <== xhc-hb04.button-stop
s32               0  pendant:wheel-counts
                         ==> halui.feed-override.counts
                         ==> halui.spindle-override.counts
                         ==> pendant_util.in0
                         ==> pendant_util.in1
                         ==> pendant_util.in2
                         ==> pendant_util.in3
                         <== xhc-hb04.jog.counts
s32               0  pendant:wheel-counts-c-filtered
                         ==> axis.5.jog-counts
                         <== pendant_util.out3
s32               0  pendant:wheel-counts-neg
                         <== xhc-hb04.jog.counts-neg
s32               0  pendant:wheel-counts-x-filtered
                         ==> axis.0.jog-counts
                         <== pendant_util.out0
s32               0  pendant:wheel-counts-y-filtered
                         ==> axis.1.jog-counts
                         <== pendant_util.out1
s32               0  pendant:wheel-counts-z-filtered
                         ==> axis.2.jog-counts
                         <== pendant_util.out2
bit           FALSE  pendant:zero-a
                         ==> halui.mdi-command-15
                         <== xhc-hb04.button-zero-a
bit           FALSE  pendant:zero-x
                         ==> halui.mdi-command-12
                         <== xhc-hb04.button-zero-x
bit           FALSE  pendant:zero-y
                         ==> halui.mdi-command-13
                         <== xhc-hb04.button-zero-y
bit           FALSE  pendant:zero-z
                         ==> halui.mdi-command-14
                         <== xhc-hb04.button-zero-z

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

More
15 Sep 2015 18:53 - 15 Sep 2015 23:30 #62612 by FiliP
LinuxCNC 2.7 with MPG HB04 and i have a problem (or it is how it should be?).

# mpg_accels: provision for reduced acceleration for mpg jogging
mpg_accels = 50 50 500 600

This values have influence on my all settings.
Cant go to home, just crash my machine. Cant fast jog on keyboard, it is slow like should by but only when i use my mpg pendant...

Edit: Ok. I get it. MPG must be turned off before keyboard jog.
Last edit: 15 Sep 2015 23:30 by FiliP.

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

More
16 Sep 2015 01:20 #62623 by dgarrett
Not sure I understand any of your posting -- probably because of language
translation, nonetheless, the following investigation may be relevant
as it shows unexpected behavior when the pendant goes to sleep.

Current 2.7 (at commit 760a7f2) behavior for pendant:

When using LIB:xhc-hb04.tcl (with the axis gui) and using:

[XHC_HB04_CONFIG]mpg_accels = val1 val2 val3 val4
the jogging accelerations are set to the altered values (val1,val2,...)
when using the pendant jog wheel _AND_ when using the keyboard arrow keys in
manual mode.

When the pendant rotary switch is in the Off position, unaltered accelerations
are used for keyboard jogging. (So the jogging accels will be higher with the
pendant rotary in the off position).

However, the pendant goes to sleep if no buttons are touched for some number of
seconds (xhc.hb04.sleeping is set to 1). (It is unclear to me what conditions
are prerequisites for the pendant to go to sleep but it is detected by the
driver). When a pendant sleep occurs, the xhc-hb04.jog.enable-off is also set
to 1 and keyboard jogging reverts to unaltered accelerations independent of
any pendant rotary switch position.


So the pendant going to sleep causes unexpected behavior of the
accelerations used for keyboard jogging.

I have made a patch so that keyboard jogging (axis gui) honors the mpg_accels
whenever halui.is_manual is true. With this patch, the pendant going to sleep
will not change keyboard jogging acceleration -- the altered accel values
will be used whenever halui.is_manual is true.

The patch is in a test branch:
git.linuxcnc.org/gitweb?p=linuxcnc.git;a...45a5dd745e4e69c134cd


For interest, you can observe the behavior of the relevant hal pins
using halshow from a terminal while making tests with the pendant:
$ halshow px.halshow
where the file px.halshow is (example for x axis only):
$ cat px.halshow
pin+ini.0.max_acceleration pin+halui.mode.is-manual pin+xhc-hb04.jog.enable-off pin+xhc-hb04.jog.enable-x pin+xhc-hb04.sleeping
The following user(s) said Thank You: FiliP

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

More
19 Sep 2015 21:38 #62782 by vgraves
I recently migrated from Ubuntu 10.04/Linuxcnc2.7pre to Wheezy/Linuxcnc2.7.0 using the LiveCD. While my machine operation works as before, I'm having trouble with my xhc pendant. I am trying to follow the guidance given in the README file in the xhc-hb04 sim folder. When I run Linuxcnc, I get the following Debug info:



Is the monitor script not included in the LiveCD distribution? If not, how do I get it?
Attachments:

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

More
19 Sep 2015 22:28 #62785 by dgarrett
The error message posted seems to indicate that you
specified monitor-xhc-hb04.tcl as a [HAL]HALFILE= but it
is not a HALFILE, it is specified using APPLICATIONS]APP=

README excerpt:
A application named monitor-xhc-hb04 is included to monitor disconnects and
reconnects of the pendant.  This script runs in the background and will pop up
a message when the pendant is disconnected or reconnected.  Usage is optional;
if used it is specified with ini file entry:

  [APPLICATIONS]APP = monitor-xhc-hb04

The file is named monitor-xhc-hb04 (not monitor-xhc-hb04.tcl though
it is a tcl script) and it is located in /usr/bin and hence
in the standard PATH

Example query of a package install (uspace in this caae):
$ dpkg -L linuxcnc-uspace | grep monitor
/usr/bin/monitor-xhc-hb04

$ ls -l /usr/bin/monitor-xhc-hb04
-rwxr-xr-x 1 root root 4396 Sep 10 21:29 /usr/bin/monitor-xhc-hb04

Running one of the supplied simulator configs and studying
the ini file may be helpful

Ref: README for 2.7
git.linuxcnc.org/gitweb?p=linuxcnc.git;a...675ba593695c;hb=HEAD
The following user(s) said Thank You: vgraves

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

More
24 Sep 2015 15:26 - 24 Sep 2015 15:31 #62938 by FiliP
Hi.
Pedant acc. jogg is a great feature (2.7.0) but i have some comments after testing it, Some of them were already mentioned.

1) After turning on my CNC machine i must always turn HB04, and switch rotary button (XYZ../Off). If i don't do this machine will crash on homing sequence ( acceleration values). There is a problem with default PIN state. It looks like that there is no procedure to verify the status right after you turn the machine (LinuxCNC).
2) Jog ON (rotary switch to X or Y...) should have not any impact (ACC) on running program. So in my opinion HB04 acceleration should work only when wheel is turning (count impulses). Now i must always remember to turn off JOG when i have to put away my HB04.
3) HB04 ACC configuration shouldn't impact on keyboard Jog (add.2)
4) And last, Go to ZERO still don't work on HB04 like manual and sample configuration says (2.6.X and 2.7.0). I saw in this thread what modifications must be carried out, but maybe I did something wrong.

Anyway,...
GREAT WORK and Thank you :)
Last edit: 24 Sep 2015 15:31 by FiliP.

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

More
24 Sep 2015 22:42 #62946 by dgarrett

Pedant acc. jogg is a great feature (2.7.0) but i have some comments after
testing it, Some of them were already mentioned.


A commit based on a patch mentioned earlier in this thread
addresses unexpected keyboard jogging behavior (unaltered accels)
when the pendant goes to sleep (typically after about 40 seconds).

git.linuxcnc.org/gitweb?p=linuxcnc.git;a...945e6a36374197281ea2

If you are using a rip (run-in-place) build you must update git and rebuild.
If you are using a deb install, you must wget a deb from the buildbot
that includes this patch. You can wget a deb from:
buildbot.linuxcnc.org/dists/

I cannot reproduce any of the anomalies you describe using any of the
sim configs provided.

So please update your linuxcnc install, then test using one of
the provided sim configs and provide details on the steps required
to reproduce unexpected behavior.

The sim configs are available through the standard linuxcnc config picker:
Sample Configurations/sim/axis/xhc-hb04/xhc-hb4-layout1.ini
Sample Configurations/sim/axis/xhc-hb04/xhc-hb4-layout2.ini
Sample Configurations/sim/axis/xhc-hb04/xhc-hb4-layout2_mm.ini

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

Time to create page: 0.114 seconds
Powered by Kunena Forum