Advanced Search

Search Results (Searched for: XHC)

  • marcelovx23
  • marcelovx23
10 Oct 2025 16:57
Replied by marcelovx23 on topic XHC-WHB04B-04 Got it working

XHC-WHB04B-04 Got it working

Category: Advanced Configuration

We have very similar goals. In the future, I also want an ATC and a fiber laser machine for metal cutting. I’ll be keeping an eye on BidSpotter as you mentioned, but I think I’ll end up buying the resonator and all the necessary parts for the fiber laser from some affordable Chinese supplier. Thank you so much for your support with the MPG, you’re a legend!
  • DEVILHUNTER
  • DEVILHUNTER
10 Oct 2025 11:42
Replied by DEVILHUNTER on topic XHC-WH04b USB not detected in front port

XHC-WH04b USB not detected in front port

Category: General LinuxCNC Questions

FOUND IT!

After 3 years since I bought the MPG, finally found the cause and solution of the issue of not being recognized on some (or all in my case) USB ports. It probably also solve if somebody got connection problems.

The main issue is that the XHC WHB04b receptor needs quite a lot of power (comparing to other USBs) to maintain a stable connection, and not all USB ports does provide such high current. So if the connection is not stable because the power issure, the kernel does not detect it. This can also happen on windows, but the windows specific drivers solve it on some cases. My computer is an industrial mini PC with external 12V PSU, so all USBs get their 5V from the main board. On desktop computers, front forts have usually lower power than rear ones, causing the issue.

There are a couple of really easy and cheap solutions:
-Use an USB HUB with external 5V power supply
-Use a Y cable (2 male, 1 female USB) either with both male USB connectors to the computer or the power only connector to a 5V PSU.
  • Hendrixx
  • Hendrixx
09 Oct 2025 20:21
Replied by Hendrixx on topic XHC-WHB04B-04 Got it working

XHC-WHB04B-04 Got it working

Category: Advanced Configuration

You're welcome, I'm glad you got it worked out. On the topic of separate machines, the logic is there and holds water; it's almost like multiprocess welders, unless you drop some serious money, you're compromising. And I, for one reason or another in the past, needed both couldn't afford both, or didnt have the space, I know I'm basically handicapping the machine, whichever gui is loaded but not ot the point, parts are out spec, or customers bringing stuff back. The plan is to build another machine for a 3 to 5k fiber laser, ditch the plasma altogether, and mount an ATC spindle and vacuum holding to this current one. I've been really good this year, hopefully a smoking deal comes through on BidSpotter for a laser source. This is the 5th iteration of a CNC gantry-style machine I've built. I went HAM on it just because I'm tired of being tired of not being satisfied with it.  The .5" flat bar on top has a reference shoulder machined in and a skimmed on both sides im gonna use jack screws every 12" or so in pairs to get this thing as coplanar, square and level as pyhics will allow, me to and then use a metalized epoxy to bed the bar to the frame and finaly a few stitch welds to lock it in.  ce la vie i gues. Your set up is pretty gangster 

 
  • marcelovx23
  • marcelovx23
09 Oct 2025 17:31
Replied by marcelovx23 on topic XHC-WHB04B-04 Got it working

XHC-WHB04B-04 Got it working

Category: Advanced Configuration

First of all, thank you so much for your effort and for sharing your files—without them I never would have gotten mine working.
I learned the hard way that it’s not practical to have one machine serve as both a router and a plasma cutter, so I developed a very affordable “plasma router” that works perfectly, and now I keep the two machines separate.
I’m leaving a video so you can see it running in case it helps, and a link where you can download the 3D model and wiring diagrams. I’m sharing it as open-hardware to give back a little of the much that the community—and generous acts like yours—have given me.


3D model and wiring files here
opencnc.mx/wordpress/index.php/elementor-420/
  • Hendrixx
  • Hendrixx
09 Oct 2025 16:20
Replied by Hendrixx on topic XHC-WHB04B-04 Got it working

XHC-WHB04B-04 Got it working

Category: Advanced Configuration

I don't use the pendant anymore and rely on a touch screen and wireless keyboard because my machine is a dual-use plasma /router, and I couldn't get plasmac.comp to play nice with the pendant. But once I get the table put back together, I will revisit and see if the berry is worth the squeeze.
  • marcelovx23
  • marcelovx23
09 Oct 2025 03:02
Replied by marcelovx23 on topic XHC-WHB04B-04 Got it working

XHC-WHB04B-04 Got it working

Category: Advanced Configuration

[SOLVED] XHC-WHB04B-6 on LinuxCNC 2.9.6 (QtDragonHD + 7i96S) — Beginner notes
(I am sharing the exact steps I followed, written simply. Many threads assume advanced users; I am a beginner.)My machine / system
  • Gantry router XYYZ (dual Y motors), work area approx. 1300 x 1210 mm
  • Controller: Mesa 7i96S (Ethernet, step/dir)
  • Spindle: 2.2 kW, 24,000 RPM
  • UI: QtVCP / QtDragon_HD
  • OS: Raspberry Pi 5, Debian 12 (Bookworm)
  • LinuxCNC 2.9.6
What actually fixed it (short version)
  1. Load the pendant HAL file as a HALFILE (before the post-GUI), same as the donor machine.
  2. Add MDI_COMMAND lines under [HALUI] so pins halui.mdi-command-XX exist.
  3. Keep qtvcp_postgui.hal clean (only GUI signals, no pendant driver).
  4. In my case, moving the WHB USB dongle to another port made the wheel/jog and DRO updates work.
STEP 1 — Copy the pendant HAL file
Place xhc-whb04b-6.hal in your config folder (the same folder that has your .ini and main .hal), e.g.:
~/linuxcnc/configs/YOUR-MACHINE/xhc-whb04b-6.hal
STEP 2 — Load the pendant before the post-GUI
Open your .ini and in the [HAL] section add this line and keep this exact order:
[HAL]
HALUI = halui
HALFILE = CNC-CARPINTERA.hal
HALFILE = custom.hal
HALFILE = xhc-whb04b-6.hal ; <<< NEW: load the pendant here
POSTGUI_HALFILE = qtvcp_postgui.hal ; keep this AFTER
SHUTDOWN = shutdown.hal
Important: do not load the WHB driver inside qtvcp_postgui.hal.STEP 3 — Create MDI pins under [HALUI]
In the same .ini, find (or create) the [HALUI] section and paste this block right under it:
[HALUI]
MDI_COMMAND = (DEBUG,<1>) ; <<< NEW (good for testing macros)
MDI_COMMAND = G10 L20 P0 X[#<_x>/2.0] ; <<< NEW (zero X at part center)
MDI_COMMAND = G10 L20 P0 Y[#<_y>/2.0] ; <<< NEW (zero Y at part center)
MDI_COMMAND = (DEBUG,<4>) ; <<< NEW
MDI_COMMAND = (DEBUG,<5>) ; <<< NEW
MDI_COMMAND = G10 L20 P0 X0 ; <<< NEW (Zero X)
MDI_COMMAND = G10 L20 P0 Y0 ; <<< NEW (Zero Y)
MDI_COMMAND = G10 L20 P0 Z0 ; <<< NEW (Zero Z)
This creates halui.mdi-command-00..07 (indexes follow the order above).
Add more MDI_COMMAND lines if your xhc-whb04b-6.hal uses higher indices.Notes so jogging actually works
  • E-STOP released, Machine ON
  • Manual mode
  • Fully homed (for XYYZ: X, Y1, Y2, Z)
  • On the pendant, use Continuous, or Step + Step size
  • If the wheel does nothing or DRO does not update: try a different USB port/dongle (this was the final fix for me)
Thanks and request
Many thanks to the original thread’s author for sharing files and guidance.
If possible, could you post a short summary of the final button mapping (what each macro-N does, Continuous/Step, ABS/REL, etc.)? That would help beginners keep their configs consistent.If anyone needs it, I can share my final .ini, xhc-whb04b-6.hal, and a minimal qtvcp_postgui.hal exactly as they ended up.
  • Aciera
  • Aciera's Avatar
04 Oct 2025 17:50

Axis configuration not fully working on 2.9.6

Category: AXIS

So I don't have to worry about the pins not being created?


No. Hal connections are created on startup when the hal files are read. If a hal pin used in any of your hal files was missing the config would not start at all. So your problem is not because of 'signals not being connected correctly'.
One thing to do is start your config from the terminal and check the output in the terminal. Another is to check the XHC WHB04B hal component using the halshow tool to confirm button press events are actually reaching your hal connections.
  • Fabse
  • Fabse
04 Oct 2025 16:49

Axis configuration not fully working on 2.9.6

Category: AXIS

Hey guys,
my config works as i want it on linuxcnc 2.9.4. After updating to 2.9.5 (or 2.9.6) it does not anymore. It mainly is the pendant that is not working as before. I use a china pendant (XHC WHB04B). Most buttons don't work anymore. For example when staring my machine, I hit the "reset" button. With version 2.9.4 I can home my machine after that. With 2.9.6 nothing happens. Control via GUI seems to work just fine.
I think the problem must be related to one of these, or maybe both points in the changelog:
  • halui: on startup, set the first configured axis as ‘is-selected’ instead of X
  • halui: Don’t create ‘halui.axis.’- pins for unconfigured axes
I looked at all created HAL pins under 2.9.4 and 2.9.6. I compared the output and found some missing pins under 2.9.6. I don't see why i would need these pins, but I figured it maybe where my error is? See the atteched pic for the missing pins.
I hope someone of the pros on this forum can help me. I don't know how to solve this on my own.
 
  • st2s
  • st2s
04 Oct 2025 09:16

XHC-WHB04B-6 установка для LINUXCNC

Category: Russian

Добрый день.
Подключил пульт, в виртуальном станке axis все работает, но реальный постоянно отваливается при попытке передвигать маховиком с ошибкой joint 0 following error при движении осью Х и остальными соответственно.
Управление клавишами при этом происходит штатно.
В чем может быть проблема?
  • Gautham
  • Gautham
23 Sep 2025 04:53 - 23 Sep 2025 09:21

Setting up kinematics for my Ballscrew articulated B-axis

Category: Basic Configuration

Ok, sorry for the images. Anyway, I performed all the math on Google Sheets, so you can enter the B-axis position on the ball screw, and it will provide you with the spindle angle, the tooltip x-offset, and the tooltip z-offset. The range of travel for the B-axis is 0 to 305mm. You can enter this in cell Y11, and it will spit out the results. I have also illustrated the drawings better here so that hopefully you can understand. Here is the link . I have looked at the Kinematics tutorial on the website, but I just learn better if I can see someone do a working example. After hours of reading that with Gemini helping with some of the explanations, I don't know how to start writing the code. Anyway, from the tutorial I posted earlier, there is an image of this person's kinematicsInverse function, which I will insert below.

File Attachment:


From what I've understood, the job of this function is to understand the required tool tip movement and spit out the number of steps each axis motor needs to make, correct? If that is correct, I should be able to modify the trigonometry here to accommodate my ballscrew articulated B-axis and get this going, hopefully. Because his setup also has an XYZAB setup similar to mine.
  • juergen-home
  • juergen-home
11 Aug 2025 12:05 - 11 Aug 2025 12:18
"pwm/dir" (Out1) switches for spindle CCW was created by juergen-home

"pwm/dir" (Out1) switches for spindle CCW

Category: Basic Configuration

Hi there
A question about my configuration:
1. I have a HF milling spindle which needs only to turns clockwise. The PWM canal (Out0) works fine. My config for "pwm/dir" (Out1) is set to a relay output (P17/"GPIO7"). The relay should be on when CW is commanded but here it is on when CCW is commanded. How config it so that the relay switch on when CW is commanded? 


Mesa 6i25 with homemade pin file
China BOB Mach3
Linuxcnc 2.8.4-1gb7824717b


# Erstellt von PNCconf am Mon May  1 19:24:03 2023
# Verwendete LinuxCNC version:  Master (2.9)
# Änderungen an dieser Datei werden beim nächsten
# wird überschrieben sobald Sie PNCconf erneut ausführen

#2.8.4

loadrt [KINS]KINEMATICS
loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS
loadrt hostmot2
loadrt hm2_pci config="num_encoders=5 num_pwmgens=1 num_stepgens=4 sserial_port_0=0xxxxxxx" 
#loadrt hm2_pci config="num_encoders=5 num_pwmgens=1 num_stepgens=3 sserial_port_0=0xxxxxxx" 

# firmware=hm2/Discovered:6i25/~/mesa0_discovered.xml.BIT 
setp    hm2_6i25.0.pwmgen.pwm_frequency 1000
setp    hm2_6i25.0.pwmgen.pdm_frequency 6000000
setp    hm2_6i25.0.watchdog.timeout_ns 5000000
loadrt pid names=pid.x,pid.y,pid.z,pid.a,pid.s

# lut5: look up table für all-limit-home (because of problem with linit stop detection by other axes when homing)
loadrt lut5 names=lut_homing
addf lut_homing servo-thread
setp lut_homing.function 0x10000
net all-limit-home => lut_homing.in-4
net all-limit <= lut_homing.out
net homing-x <= joint.0.homing => lut_homing.in-0
net homing-y <= joint.1.homing => lut_homing.in-1
net homing-z <= joint.2.homing => lut_homing.in-2
##setp lut_homing.in-3  0
##net homing-a <= joint.2.homing => lut_homing.in-3





addf hm2_6i25.0.read          servo-thread
addf motion-command-handler   servo-thread
addf motion-controller        servo-thread
addf pid.x.do-pid-calcs       servo-thread
addf pid.y.do-pid-calcs       servo-thread
addf pid.z.do-pid-calcs       servo-thread
addf pid.a.do-pid-calcs       servo-thread
addf pid.s.do-pid-calcs       servo-thread
addf hm2_6i25.0.write         servo-thread
setp hm2_6i25.0.dpll.01.timer-us -50
setp hm2_6i25.0.stepgen.timer-number 1

# extern signal input

# --- MACHINE-IS-ENABLED ---
#gpio.001 MESA DB25 PIN PIN 14
setp hm2_6i25.0.gpio.001.is_output true
net machine-is-enabled  =>     hm2_6i25.0.gpio.001.out

# --- COOLANT-MIST ---
#gpio.005 MESA DB25 PIN PIN 16
setp hm2_6i25.0.gpio.005.is_output true
#net coolant-mist  =>     hm2_6i25.0.gpio.005.out

# externe signal output

# --- ESTOP-EXT ---
#gpio.013 MESA DB25 PIN PIN 10
# .in_not for NC / .in for NO Limit Switch
net estop-ext     <=  hm2_6i25.0.gpio.013.in_not
#net estop-ext     <=  hm2_6i25.0.gpio.013.in

# --- PROBE-IN ---
# -wird in Probe_postgui.hal verwendet / definiert -
#gpio.014 MESA DB25 PIN PIN 11
#net probe-in     <=  hm2_6i25.0.gpio.014.in

# --- ALL-LIMIT-HOME ---
# gpio.015 MESA DB25 PIN PIN 12
# .in_not for NO / .in for NC Limit Switch
net all-limit-home     <=  hm2_6i25.0.gpio.015.in_not
#net all-limit-home     <=  hm2_6i25.0.gpio.015.in

# --- CYCLE-START ---
#gpio.016 MESA DB25 PIN PIN 13
#net cycle-start     <=  hm2_6i25.0.gpio.016.in

#*******************
#  AXIS X JOINT 0
#*******************

setp   pid.x.Pgain     [JOINT_0]P
setp   pid.x.Igain     [JOINT_0]I
setp   pid.x.Dgain     [JOINT_0]D
setp   pid.x.bias      [JOINT_0]BIAS
setp   pid.x.FF0       [JOINT_0]FF0
setp   pid.x.FF1       [JOINT_0]FF1
setp   pid.x.FF2       [JOINT_0]FF2
setp   pid.x.deadband  [JOINT_0]DEADBAND
setp   pid.x.maxoutput [JOINT_0]MAX_OUTPUT
setp   pid.x.error-previous-target true
# This setting is to limit bogus stepgen
# velocity corrections caused by position
# feedback sample time jitter.
setp   pid.x.maxerror 0.012700

#net x-index-enable  =>  pid.x.index-enable
#net x-enable        =>  pid.x.enable
#net x-pos-cmd       =>  pid.x.command
#net x-pos-fb        =>  pid.x.feedback
#net x-output        <=  pid.x.output

# Step-Gen Signal/Setup

setp   hm2_6i25.0.stepgen.00.dirsetup        [JOINT_0]DIRSETUP
setp   hm2_6i25.0.stepgen.00.dirhold         [JOINT_0]DIRHOLD
setp   hm2_6i25.0.stepgen.00.steplen         [JOINT_0]STEPLEN
setp   hm2_6i25.0.stepgen.00.stepspace       [JOINT_0]STEPSPACE
setp   hm2_6i25.0.stepgen.00.position-scale  [JOINT_0]STEP_SCALE
setp   hm2_6i25.0.stepgen.00.step_type        0
#setp   hm2_6i25.0.stepgen.00.control-type     1
setp   hm2_6i25.0.stepgen.00.control-type     0
setp   hm2_6i25.0.stepgen.00.maxaccel         [JOINT_0]STEPGEN_MAXACCEL
setp   hm2_6i25.0.stepgen.00.maxvel           [JOINT_0]STEPGEN_MAXVEL

#-closed loop umgehen (von sim-maschine)
net x-pos-fb     joint.0.motor-pos-fb   <=  hm2_6i25.0.stepgen.00.position-fb
net x-pos-cmd    joint.0.motor-pos-cmd  =>  hm2_6i25.0.stepgen.00.position-cmd
net x-enable     joint.0.amp-enable-out =>  hm2_6i25.0.stepgen.00.enable


# ---Closed-Loop Schrittmotor-Signale---

#net x-pos-cmd    <= joint.0.motor-pos-cmd
#net x-vel-cmd    <= joint.0.vel-cmd
#net x-output     => hm2_6i25.0.stepgen.00.velocity-cmd
#net x-pos-fb     <= hm2_6i25.0.stepgen.00.position-fb
#net x-pos-fb     => joint.0.motor-pos-fb
#net x-enable     <= joint.0.amp-enable-out
#net x-enable     => hm2_6i25.0.stepgen.00.enable

# ---Einrichtung Referenzfahrt / Signale der Endschalter---

net all-limit-home     =>  joint.0.home-sw-in
net all-limit    =>  joint.0.neg-lim-sw-in
net all-limit     =>  joint.0.pos-lim-sw-in



#*******************
#  AXIS Y JOINT 1
#*******************

setp   pid.y.Pgain     [JOINT_1]P
setp   pid.y.Igain     [JOINT_1]I
setp   pid.y.Dgain     [JOINT_1]D
setp   pid.y.bias      [JOINT_1]BIAS
setp   pid.y.FF0       [JOINT_1]FF0
setp   pid.y.FF1       [JOINT_1]FF1
setp   pid.y.FF2       [JOINT_1]FF2
setp   pid.y.deadband  [JOINT_1]DEADBAND
setp   pid.y.maxoutput [JOINT_1]MAX_OUTPUT
setp   pid.y.error-previous-target true
# This setting is to limit bogus stepgen
# velocity corrections caused by position
# feedback sample time jitter.
setp   pid.y.maxerror 0.012700

#net y-index-enable  =>  pid.y.index-enable
#net y-enable        =>  pid.y.enable
#net y-pos-cmd       =>  pid.y.command
#net y-pos-fb        =>  pid.y.feedback
#net y-output        <=  pid.y.output

# Schritt-Gen Signale/Setup
#setp hm2_6i25.0.gpio.003.invert_output true

setp   hm2_6i25.0.stepgen.01.dirsetup        [JOINT_1]DIRSETUP
setp   hm2_6i25.0.stepgen.01.dirhold         [JOINT_1]DIRHOLD
setp   hm2_6i25.0.stepgen.01.steplen         [JOINT_1]STEPLEN
setp   hm2_6i25.0.stepgen.01.stepspace       [JOINT_1]STEPSPACE
setp   hm2_6i25.0.stepgen.01.position-scale  [JOINT_1]STEP_SCALE
setp   hm2_6i25.0.stepgen.01.step_type        0
#setp   hm2_6i25.0.stepgen.01.control-type     1
setp   hm2_6i25.0.stepgen.01.control-type     0
setp   hm2_6i25.0.stepgen.01.maxaccel         [JOINT_1]STEPGEN_MAXACCEL
setp   hm2_6i25.0.stepgen.01.maxvel           [JOINT_1]STEPGEN_MAXVEL

#-closed loop umgehen (von sim-maschine)
net y-pos-fb     joint.1.motor-pos-fb   <=  hm2_6i25.0.stepgen.01.position-fb
net y-pos-cmd    joint.1.motor-pos-cmd  =>  hm2_6i25.0.stepgen.01.position-cmd
net y-enable     joint.1.amp-enable-out =>  hm2_6i25.0.stepgen.01.enable


# ---Closed-Loop Schrittmotor-Signale---

#net y-pos-cmd    <= joint.1.motor-pos-cmd
#net y-vel-cmd    <= joint.1.vel-cmd
#net y-output     => hm2_6i25.0.stepgen.01.velocity-cmd
#net y-pos-fb     <= hm2_6i25.0.stepgen.01.position-fb
#net y-pos-fb     => joint.1.motor-pos-fb
#net y-enable     <= joint.1.amp-enable-out
#net y-enable     => hm2_6i25.0.stepgen.01.enable

# ---Einrichtung Referenzfahrt / Signale der Endschalter---

net all-limit-home     =>  joint.1.home-sw-in
net all-limit     =>  joint.1.neg-lim-sw-in
net all-limit     =>  joint.1.pos-lim-sw-in

#*******************
#  AXIS Z JOINT 2
#*******************

setp   pid.z.Pgain     [JOINT_2]P
setp   pid.z.Igain     [JOINT_2]I
setp   pid.z.Dgain     [JOINT_2]D
setp   pid.z.bias      [JOINT_2]BIAS
setp   pid.z.FF0       [JOINT_2]FF0
setp   pid.z.FF1       [JOINT_2]FF1
setp   pid.z.FF2       [JOINT_2]FF2
setp   pid.z.deadband  [JOINT_2]DEADBAND
setp   pid.z.maxoutput [JOINT_2]MAX_OUTPUT
setp   pid.z.error-previous-target true
# This setting is to limit bogus stepgen
# velocity corrections caused by position
# feedback sample time jitter.
setp   pid.z.maxerror 0.012700

#net z-index-enable  =>  pid.z.index-enable
#net z-enable        =>  pid.z.enable
#net z-pos-cmd       =>  pid.z.command
#net z-pos-fb        =>  pid.z.feedback
#net z-output        <=  pid.z.output

# Schritt-Gen Signale/Setup
setp hm2_6i25.0.gpio.003.invert_output true

setp   hm2_6i25.0.stepgen.02.dirsetup        [JOINT_2]DIRSETUP
setp   hm2_6i25.0.stepgen.02.dirhold         [JOINT_2]DIRHOLD
setp   hm2_6i25.0.stepgen.02.steplen         [JOINT_2]STEPLEN
setp   hm2_6i25.0.stepgen.02.stepspace       [JOINT_2]STEPSPACE
setp   hm2_6i25.0.stepgen.02.position-scale  [JOINT_2]STEP_SCALE
setp   hm2_6i25.0.stepgen.02.step_type        0
#setp   hm2_6i25.0.stepgen.02.control-type     1
setp   hm2_6i25.0.stepgen.02.control-type     0
setp   hm2_6i25.0.stepgen.02.maxaccel         [JOINT_2]STEPGEN_MAXACCEL
setp   hm2_6i25.0.stepgen.02.maxvel           [JOINT_2]STEPGEN_MAXVEL

#-closed loop umgehen (von sim-maschine)
net z-pos-fb     joint.2.motor-pos-fb   <=  hm2_6i25.0.stepgen.02.position-fb
net z-pos-cmd    joint.2.motor-pos-cmd  =>  hm2_6i25.0.stepgen.02.position-cmd
net z-enable     joint.2.amp-enable-out =>  hm2_6i25.0.stepgen.02.enable


# ---Closed-Loop Schrittmotor-Signale---

#net z-pos-cmd    <= joint.2.motor-pos-cmd
#net z-vel-cmd    <= joint.2.vel-cmd
#net z-output     => hm2_6i25.0.stepgen.02.velocity-cmd
#net z-pos-fb     <= hm2_6i25.0.stepgen.02.position-fb
#net z-pos-fb     => joint.2.motor-pos-fb
#net z-enable     <= joint.2.amp-enable-out
#net z-enable     => hm2_6i25.0.stepgen.02.enable

# ---Einrichtung Referenzfahrt / Signale der Endschalter---

net all-limit-home     =>  joint.2.home-sw-in
net all-limit     =>  joint.2.neg-lim-sw-in
net all-limit     =>  joint.2.pos-lim-sw-in


#*******************
#  AXIS A JOINT 3
#*******************

#*******************
#  SPINDEL
#*******************
setp   pid.s.Pgain     [SPINDLE_0]P
setp   pid.s.Igain     [SPINDLE_0]I
setp   pid.s.Dgain     [SPINDLE_0]D
setp   pid.s.bias      [SPINDLE_0]BIAS
setp   pid.s.FF0       [SPINDLE_0]FF0
setp   pid.s.FF1       [SPINDLE_0]FF1
setp   pid.s.FF2       [SPINDLE_0]FF2
setp   pid.s.deadband  [SPINDLE_0]DEADBAND
setp   pid.s.maxoutput [SPINDLE_0]MAX_OUTPUT
setp   pid.s.error-previous-target true

#net spindle-index-enable  =>  pid.s.index-enable
#net spindle-enable        =>  pid.s.enable
#net spindle-vel-cmd-rpm-abs     => pid.s.command
#net spindle-vel-fb-rpm-abs      => pid.s.feedback
#net spindle-output        <=  pid.s.output

# ---PWM Generator Signale/Setup---
setp   hm2_6i25.0.pwmgen.00.output-type 1
setp   hm2_6i25.0.pwmgen.00.scale  [SPINDLE_0]OUTPUT_SCALE

# Invert the DIR signal
#setp   hm2_6i25.0.gpio.007.invert_output true


# invert the PWM signal
setp   hm2_6i25.0.gpio.000.invert_output true

#--- SPINDLE-ENABLE ---

net spindle-vel-cmd-rpm     => hm2_6i25.0.pwmgen.00.value
net spindle-enable      => hm2_6i25.0.pwmgen.00.enable

net spindle-enable      => hm2_6i25.0.gpio.005.out



# ---Setup Spindel Steuerungs-Signale---

net spindle-vel-cmd-rps        <=  spindle.0.speed-out-rps
net spindle-vel-cmd-rps-abs    <=  spindle.0.speed-out-rps-abs
net spindle-vel-cmd-rpm        <=  spindle.0.speed-out
net spindle-vel-cmd-rpm-abs    <=  spindle.0.speed-out-abs
net spindle-enable             <=  spindle.0.on
net spindle-cw                 <=  spindle.0.forward
net spindle-ccw                <=  spindle.0.reverse
net spindle-brake              <=  spindle.0.brake
net spindle-revs               =>  spindle.0.revs
net spindle-at-speed           =>  spindle.0.at-speed
net spindle-vel-fb-rps         =>  spindle.0.speed-in
net spindle-index-enable      <=>  spindle.0.index-enable

# ---Einrichtung der Signale zur Spindel-Geschwindigkeits-Steuerung---

sets spindle-at-speed true


#******************************
# Verbinden verschiedener Signale
#******************************

#  ---HALUI Signale---

# xhc: net axis-select-x  halui.axis.x.select
# net jog-x-pos      halui.axis.x.plus
# net jog-x-neg      halui.axis.x.minus
net jog-x-analog   halui.axis.x.analog
# xhc: net x-is-homed     halui.joint.0.is-homed
# xhc: net axis-select-y  halui.axis.y.select
# net jog-y-pos      halui.axis.y.plus
# net jog-y-neg      halui.axis.y.minus
net jog-y-analog   halui.axis.y.analog
#net y-is-homed     halui.joint.1.is-homed
# xhc: net axis-select-z  halui.axis.z.select
# net jog-z-pos      halui.axis.z.plus
# net jog-z-neg      halui.axis.z.minus
net jog-z-analog   halui.axis.z.analog
#net z-is-homed     halui.joint.2.is-homed
net axis-select-a  halui.axis.a.select
net jog-a-pos      halui.axis.a.plus
net jog-a-neg      halui.axis.a.minus
net jog-a-analog   halui.axis.a.analog
#net a-is-homed     halui.joint.3.is-homed
net jog-selected-pos      halui.axis.selected.plus
net jog-selected-neg      halui.axis.selected.minus
net spindle-manual-cw     halui.spindle.0.forward
net spindle-manual-ccw    halui.spindle.0.reverse
net spindle-manual-stop   halui.spindle.0.stop
# xhc: net machine-is-on         halui.machine.is-on
# net jog-speed             halui.axis.jog-speed
# xhc: net MDI-mode              halui.mode.is-mdi
# xhc: net cycle-start           halui.program.run
# net abort                 halui.abort

#  ---Kühlmittel-Signale---

net coolant-mist      <=  iocontrol.0.coolant-mist
net coolant-flood     <=  iocontrol.0.coolant-flood

#  ---Sonde/Taster Signal (probe signal)---

# easyprobe net probe-in     =>  motion.probe-input

#  ---Signale zur Bewegungs-Steuerung---

net in-position               <=  motion.in-position
net machine-is-enabled        <=  motion.motion-enabled

#  ---Digitale ein-/ausgehende-Signale---

#  ---E-Stop--

net estop-out     <=  iocontrol.0.user-enable-out
net estop-ext     =>  iocontrol.0.emc-enable-in


#  ---signal  manual toolchange---

net tool-change-request    <= iocontrol.0.tool-change
net tool-change-confirmed  => iocontrol.0.tool-changed
net tool-number            <= iocontrol.0.tool-prep-number

#  ---use extern dialog for toolchange---

loadusr -W hal_manualtoolchange
net tool-change-request    =>  hal_manualtoolchange.change
net tool-change-confirmed  <=  hal_manualtoolchange.changed
net tool-number            =>  hal_manualtoolchange.number

#  ---ignoriere Anfragen zu Werkzeug-Vorbereitungen---
net tool-prepare-loopback   iocontrol.0.tool-prepare      =>  iocontrol.0.tool-prepared

# Erstellt von PNCconf am Mon May  1 19:24:03 2023
# Verwendete LinuxCNC version:  Master (2.9)
#2.8.4
# reduced to bare minimum 2025-08-10 #aa

[EMC]
MACHINE = ttm_a
DEBUG = 0
VERSION = 1.1

[DISPLAY]
DISPLAY = axis
POSITION_OFFSET = RELATIVE
POSITION_FEEDBACK = ACTUAL
MAX_FEED_OVERRIDE = 3.000000
MAX_SPINDLE_OVERRIDE = 1.500000
MIN_SPINDLE_OVERRIDE = 0.500000
INTRO_GRAPHIC = linuxcnc.gif
INTRO_TIME = 5
PROGRAM_PREFIX = /home/cnc/linuxcnc/nc_files/ngc
OPEN_FILE=""
INCREMENTS = .1mm .05mm .01mm .005mm
#POSITION_FEEDBACK = ACTUAL
DEFAULT_LINEAR_VELOCITY = 8.3333
MAX_LINEAR_VELOCITY = 90
MIN_LINEAR_VELOCITY = 0.100000
DEFAULT_ANGULAR_VELOCITY = 12.000000
MAX_ANGULAR_VELOCITY = 180.000000
MIN_ANGULAR_VELOCITY = 1.666667
EDITOR = geany
#GEOMETRY = xyza
GEOMETRY = xyz
PYVCP = custompanel.xml

[FILTER]
PROGRAM_EXTENSION = .png,.gif,.jpg Greyscale Depth Image
PROGRAM_EXTENSION = .py Python Script
png = image-to-gcode
gif = image-to-gcode
jpg = image-to-gcode
py = python

[TASK]
TASK = milltask
CYCLE_TIME = 0.010

[RS274NGC]
PARAMETER_FILE = linuxcnc.var
RS274NGC_STARTUP_CODE = G21 G40 G90 G94 G97 G64 P0.025
#SUBROUTINE_PATH = /home/cnc/linuxcnc/nc_files/ngc/sub
SUBROUTINE_PATH = ./sub


[EMCMOT]
EMCMOT = motmod
COMM_TIMEOUT = 1.0
SERVO_PERIOD = 1000000

[HMOT]
# **** Nur zur Information ****
CARD0=hm2_6i25.0

[HAL]
HALUI = halui
HALFILE = ttm_a.hal
HALFILE = custom.hal
POSTGUI_HALFILE = custom_postgui.hal
SHUTDOWN = shutdown.hal
[HALUI]
# midi 0-->26 (27)
#custom_postgui.hal
# midi 0-->26
MDI_COMMAND = m3 s2000
MDI_COMMAND = m3 s3000
MDI_COMMAND = m3 s4000
MDI_COMMAND = m3 s5000
MDI_COMMAND = m3 s6000
MDI_COMMAND = m3 s7000
MDI_COMMAND = m3 s8000
MDI_COMMAND = m3 s9000
MDI_COMMAND = m3 s10000
MDI_COMMAND = m3 s11000
MDI_COMMAND = m3 s12000
MDI_COMMAND = m3 s13000
MDI_COMMAND = m3 s14000
MDI_COMMAND = m3 s16000
MDI_COMMAND = m3 s18000
MDI_COMMAND = m3 s20000
MDI_COMMAND = m3 s22000
MDI_COMMAND = m3 s24000
# midi 18-28
MDI_COMMAND = g0 x0 y0
MDI_COMMAND = O<midi_com1> CALL
MDI_COMMAND = O<midi_com2> CALL
MDI_COMMAND = O<midi_com3> CALL
MDI_COMMAND = O<midi_com4> CALL
MDI_COMMAND = O<midi_com5> CALL
MDI_COMMAND = O<midi_go_tool_probe> CALL
MDI_COMMAND = O<midi_go_tool_change_pos> CALL
MDI_COMMAND = O<midi_set_tool_length> CALL
MDI_COMMAND = O<midi_load_tool> CALL
MDI_COMMAND = M5 M9
#29
#/custom_postgui.hal

[KINS]
#JOINTS = 4
JOINTS = 3
#KINEMATICS = trivkins coordinates=XYZA
KINEMATICS = trivkins coordinates=XYZ


[TRAJ]
#COORDINATES =  XYZA
COORDINATES =  XYZ

MAX_ANGULAR_VELOCITY = 360.00
DEFAULT_ANGULAR_VELOCITY = 36.00
LINEAR_UNITS = mm
ANGULAR_UNITS = degree
DEFAULT_LINEAR_VELOCITY = 2.50
MAX_LINEAR_VELOCITY = 90
[EMCIO]
EMCIO = io
CYCLE_TIME = 0.100
TOOL_TABLE = tool.tbl

#******************************************
[AXIS_X]
MAX_VELOCITY = 50
MAX_ACCELERATION = 1500
#MIN_LIMIT =-255
MIN_LIMIT =-190
MAX_LIMIT =0

[JOINT_0]
TYPE = LINEAR
HOME = -1
FERROR = 0.01
MIN_FERROR = 10
MAX_VELOCITY =50
MAX_ACCELERATION = 1500
# Die folgenden Werte sollten 25% größer sein als MAX_VELOCITY und MAX_ACCELERATION
# Bei Verwendung der UMKEHRSPIEL-Kompensation sollte STEPGEN_MAXACCEL um 100% größer sein.
#STEPGEN_MAXVEL = 62.5
#STEPGEN_MAXACCEL = 187.5
STEPGEN_MAXVEL = 200
STEPGEN_MAXACCEL = 1875

P = 1000
I = 0
D = 0
FF0 = 0
FF1 = 1
FF2 = 0
BIAS = 0
DEADBAND = 0
MAX_OUTPUT = 0
# diese sind in Nanosekunden
DIRSETUP   = 3000
DIRHOLD    = 3000
STEPLEN    = 2000
STEPSPACE  = 1000
#STEP_SCALE = 160
STEP_SCALE = 250
MIN_LIMIT = -190
MAX_LIMIT = 0
#HOME_OFFSET = 3
#HOME_SEARCH_VEL =30
#HOME_LATCH_VEL = 5
HOME_FINAL_VEL = 0
#HOME_USE_INDEX = NO
HOME_IGNORE_LIMITS = YES
HOME_IS_SHARED = 1
#HOME_SEQUENCE = 2



#4.5.6.14 Immediate Homing
HOME_SEARCH_VEL = 0
HOME_LATCH_VEL = 0
HOME_USE_INDEX = NO
HOME_OFFSET = 0 
HOME_SEQUENCE = 0 

#******************************************
[AXIS_Y]
MAX_VELOCITY = 50
MAX_ACCELERATION = 1500
MIN_LIMIT =0
MAX_LIMIT =120

[JOINT_1]
TYPE = LINEAR
HOME = 1
FERROR = 0.01
MIN_FERROR = 10
MAX_VELOCITY =50
MAX_ACCELERATION = 1500
# Die folgenden Werte sollten 25% größer sein als MAX_VELOCITY und MAX_ACCELERATION
# Bei Verwendung der UMKEHRSPIEL-Kompensation sollte STEPGEN_MAXACCEL um 100% größer sein.
STEPGEN_MAXVEL = 200
STEPGEN_MAXACCEL = 1875
P = 1000.0
I = 0.0
D = 0.0
FF0 = 0.0
FF1 = 1.0
FF2 = 0.0
BIAS = 0.0
DEADBAND = 0.0
MAX_OUTPUT = 0.0
# diese sind in Nanosekunden
DIRSETUP   = 3000
DIRHOLD    = 3000
STEPLEN    = 2000
STEPSPACE  = 1000
# original: STEP_SCALE = -160
STEP_SCALE = -160

MIN_LIMIT = 0
MAX_LIMIT = 120
# HOME_OFFSET = -3
#HOME_OFFSET = -1
# HOME_SEARCH_VEL = -5
#HOME_SEARCH_VEL = -20
#HOME_LATCH_VEL = -5
HOME_FINAL_VEL = 0
#HOME_USE_INDEX = NO
HOME_IGNORE_LIMITS = YES
HOME_IS_SHARED = 1
#HOME_SEQUENCE = 3

#4.5.6.14 Immediate Homing
HOME_SEARCH_VEL = 0
HOME_LATCH_VEL = 0
HOME_USE_INDEX = NO
HOME_OFFSET = 0 
HOME_SEQUENCE = 0 

#******************************************
[AXIS_Z]
MAX_VELOCITY = 50
MAX_ACCELERATION = 1500
MIN_LIMIT =-210
MAX_LIMIT =0

[JOINT_2]
TYPE = LINEAR
HOME = -2
FERROR = 0.01
MIN_FERROR = 10
MAX_VELOCITY =50
MAX_ACCELERATION = 1500
# Die folgenden Werte sollten 25% größer sein als MAX_VELOCITY und MAX_ACCELERATION
# Bei Verwendung der UMKEHRSPIEL-Kompensation sollte STEPGEN_MAXACCEL um 100% größer sein.
STEPGEN_MAXVEL = 100
STEPGEN_MAXACCEL = 1875
P = 1000.0
I = 0.0
D = 0.0
FF0 = 0.0
FF1 = 1.0
FF2 = 0.0
BIAS = 0.0
DEADBAND = 0.0
MAX_OUTPUT = 0.0
# diese sind in Nanosekunden
DIRSETUP   = 3000
DIRHOLD    = 3000
STEPLEN    = 2000
STEPSPACE  = 1000
STEP_SCALE = 160
MIN_LIMIT = -210
#HOME_OFFSET = 2
#HOME_SEARCH_VEL =40
#HOME_LATCH_VEL = 5
HOME_FINAL_VEL = 0
#HOME_USE_INDEX = NO
HOME_IGNORE_LIMITS = YES
HOME_IS_SHARED = 1
#HOME_SEQUENCE = 1

#4.5.6.14 Immediate Homing
HOME_SEARCH_VEL = 0
HOME_LATCH_VEL = 0
HOME_USE_INDEX = NO
HOME_OFFSET = 0 
HOME_SEQUENCE = 0 

#******************************************
[SPINDLE_0]
P = 0.0
I = 0.0
D = 0.0
FF0 = 1.0
FF1 = 0.0
FF2 = 0.0
BIAS = 0.0
DEADBAND = 0.0
MAX_OUTPUT = 24000
OUTPUT_SCALE = 24000
OUTPUT_MIN_LIMIT = 0
OUTPUT_MAX_LIMIT = 24000
MAX_VELOCITY = 24000
MIN_VELOCITY = 0
INCREMENT = 1000
DEFAULT_SPINDLE_0_SPEED = 1000
#MAX_REVERSE_VELOCITY = 2400
#MIN_REVERSE_VELOCITY = 100
#******************************************

Configuration Name: HOSTMOT2

General configuration information:

  BoardName : MESA6I25
  FPGA Size: 9 KGates
  FPGA Pins: 144
  Number of IO Ports: 2
  Width of one I/O port: 17
  Clock Low frequency: 66.6667 MHz
  Clock High frequency: 200.0000 MHz
  IDROM Type: 3
  Instance Stride 0: 4
  Instance Stride 1: 64
  Register Stride 0: 256
  Register Stride 1: 256

Modules in configuration:

  Module: DPLL
  There are 1 of DPLL in configuration
  Version: 0
  Registers: 7
  BaseAddress: 7000
  ClockFrequency: 66.667 MHz
  Register Stride: 256 bytes
  Instance Stride: 4 bytes

  Module: WatchDog
  There are 1 of WatchDog in configuration
  Version: 0
  Registers: 3
  BaseAddress: 0C00
  ClockFrequency: 66.667 MHz
  Register Stride: 256 bytes
  Instance Stride: 4 bytes

  Module: IOPort
  There are 2 of IOPort in configuration
  Version: 0
  Registers: 5
  BaseAddress: 1000
  ClockFrequency: 66.667 MHz
  Register Stride: 256 bytes
  Instance Stride: 4 bytes

  Module: PWM
  There are 1 of PWM in configuration
  Version: 0
  Registers: 5
  BaseAddress: 4100
  ClockFrequency: 200.000 MHz
  Register Stride: 256 bytes
  Instance Stride: 4 bytes

  Module: QCount
  There are 5 of QCount in configuration
  Version: 2
  Registers: 5
  BaseAddress: 3000
  ClockFrequency: 66.667 MHz
  Register Stride: 256 bytes
  Instance Stride: 4 bytes

  Module: SSerial
  There are 1 of SSerial in configuration
  Version: 0
  Registers: 6
  BaseAddress: 5B00
  ClockFrequency: 66.667 MHz
  Register Stride: 256 bytes
  Instance Stride: 64 bytes

  Module: StepGen
  There are 4 of StepGen in configuration
  Version: 2
  Registers: 10
  BaseAddress: 2000
  ClockFrequency: 66.667 MHz
  Register Stride: 256 bytes
  Instance Stride: 4 bytes

  Module: LED
  There are 1 of LED in configuration
  Version: 0
  Registers: 1
  BaseAddress: 0200
  ClockFrequency: 66.667 MHz
  Register Stride: 256 bytes
  Instance Stride: 4 bytes

Configuration pin-out:

IO Connections for P3
Pin#                  I/O   Pri. func    Sec. func       Chan      Pin func        Pin Dir

 1                      0   IOPort       PWM              0        PWM             (Out)
14                      1   IOPort       None           
 2                      2   IOPort       StepGen          0        Step/Table1     (Out)
15                      3   IOPort       None           
 3                      4   IOPort       StepGen          0        Dir/Table2      (Out)
16                      5   IOPort       None           
 4                      6   IOPort       StepGen          1        Step/Table1     (Out)
17                      7   IOPort       PWM              0        Dir             (Out)
 5                      8   IOPort       StepGen          1        Dir/Table2      (Out)
 6                      9   IOPort       StepGen          2        Step/Table1     (Out)
 7                     10   IOPort       StepGen          2        Dir/Table2      (Out)
 8                     11   IOPort       StepGen          3        Step/Table1     (Out)
 9                     12   IOPort       StepGen          3        Dir/Table2      (Out)
10                     13   IOPort       None           
11                     14   IOPort       None           
12                     15   IOPort       None           
13                     16   IOPort       None           

IO Connections for P2
Pin#                  I/O   Pri. func    Sec. func       Chan      Pin func        Pin Dir

 1                     17   IOPort       QCount           0        Quad-A          (In)
14                     18   IOPort       QCount           4        Quad-B          (In)
 2                     19   IOPort       QCount           0        Quad-B          (In)
15                     20   IOPort       QCount           4        Quad-IDX        (In)
 3                     21   IOPort       QCount           0        Quad-IDX        (In)
16                     22   IOPort       SSerial          0        TXData0         (Out)
 4                     23   IOPort       QCount           1        Quad-A          (In)
17                     24   IOPort       SSerial          0        RXData0         (In)
 5                     25   IOPort       QCount           1        Quad-B          (In)
 6                     26   IOPort       QCount           1        Quad-IDX        (In)
 7                     27   IOPort       QCount           2        Quad-A          (In)
 8                     28   IOPort       QCount           2        Quad-B          (In)
 9                     29   IOPort       QCount           2        Quad-IDX        (In)
10                     30   IOPort       QCount           3        Quad-A          (In)
11                     31   IOPort       QCount           3        Quad-B          (In)
12                     32   IOPort       QCount           3        Quad-IDX        (In)
13                     33   IOPort       QCount           4        Quad-A          (In)
  • tsaG
  • tsaG
06 Aug 2025 09:49

Enable / Disable Output when Spindle is ON /OFF

Category: Advanced Configuration

Thanks for the tips! 

I applied it to my setup and realized that the 
xhc-whb04b-6 Hal code already used the spindle valve signal.
"
net pdnt.spindle.is-on whb.halui.spindle.is-on spindle.0.on"
After fiddling for some time, I came up with 
"net pdnt.spindle.is-on => hm2_7i76e.0.7i76.0.0.output-11" 

In my Hal file. Everything is working now. Thanks! :)
  • andypugh
  • andypugh's Avatar
25 Jul 2025 18:08
Replied by andypugh on topic Problem mit xhc-whb04b-6

Problem mit xhc-whb04b-6

Category: Deutsch

scale: already exists
...
./whb04b.hal:20: insmod for scale failed, returned -1

You are probably trying to "loadrt scale" in two different places.
You need to combine them into one "loadrt" that loads as many as needed.

(Or you can use HAL_TWOPASS, but that may be more work)
  • ChironFZ16
  • ChironFZ16's Avatar
25 Jul 2025 13:05 - 25 Jul 2025 13:08
Problem mit xhc-whb04b-6 was created by ChironFZ16

Problem mit xhc-whb04b-6

Category: Deutsch

Hallo zusammen
Ich habe einige Probleme mit dem Teil. in Simulations modus startet das Ding nicht und in normalen Modus habe ich keinen Kontakt. Der Treiber startet , hatt aber einen Konflikt mit GLADE-Dateien

Starting HAL User Interface program: halui
linuxcnc TPMOD=tpmod HOMEMOD=homemod EMCMOT=motmod
Found file(REL): ./core_sim.hal
Found file(REL): ./spindle_sim.hal
Found file(REL): ./simulated_home.hal
Found file(REL): ./whb04b.hal
Shutting down and cleaning up LinuxCNC...
Removing HAL_LIB, RTAPI, and Real Time OS modules
Removing NML shared memory segments

Debug file information:
Note: Using POSIX realtime

failed to claim interface
scale: already exists
./whb04b.hal:20: waitpid failed /usr/bin/rtapi_app scale
./whb04b.hal:20: /usr/bin/rtapi_app exited without becoming ready
./whb04b.hal:20: insmod for scale failed, returned -1
13130
Stopping realtime threads
Unloading hal components
Note: Using POSIX realtime


 
 

Das whb.pendant.is-connected sollte doch gelb aufleuchten, oder ?
  • beefy
  • beefy
19 Jul 2025 22:15
Replied by beefy on topic XHC-WHB04B-6 not increasing MPG counts

XHC-WHB04B-6 not increasing MPG counts

Category: HAL

Thanks very much Finnengineering.

That's good to hear. I'll have another play with it in Halshow and see if I can set that pin.
Displaying 31 - 45 out of 83 results.
Time to create page: 0.873 seconds
Powered by Kunena Forum