HAL Edits for RS485 / VFD Spindle Control

More
25 Jan 2026 10:31 - 25 Jan 2026 10:33 #341891 by Mr1576
Bear with me:
I feel like I have read every article known to man on this subject and watched all the videos on YouTube that I can find but after several weeks cannot start my spindle via software.I am using Linuxcnc v 2.9.8, with QtDragon_hd as my GUI.

I have a 2.2kw water cooled spindle hooked up to a Huanyang HY02D223B inverter. I have a Waveshare RS485 USB connector, wired D+ to RS+ , and D- to RS- on the VFD. The shielded ground is connected to ground on the PC and COM on the VFD. The adapter shows up as ACM0.

VFD jumper has been switched to VI, and programmed as follows:-
PD001: Set to 2 (Source of run command = RS-485 communication port).
PD002: Set to 2 (Source of operating frequency = RS-485 communication port).
PD163: Set to 1 (Communication address of the VFD).
PD164: Set to 1 for 9600 baud 
PD165: Set to 3 (Communication method: 8 data bits, no parity, 1 stop bit - 8N1 RTU). 

While linuxcnc loads, if, after homing, I select MDI and type M3 S1000 (or any other value), nothing happens.
For a while I was questioning the wiring to the spindle/mains and had the awful thought that either the spindle or VFD were duff.
Last night I found this thread forum.linuxcnc.org/24-hal-components/310...anyang-speed-control and when I followed these steps in Terminal, voila! my spindle runs.

I have attached my HAL file and a screenshot of my procedure in Terminal in the hope that someone can explain why I can't operate the spindle from within my GUI. 

Thanks in advance.

File Attachment:

File Name: XYYZA2PPTHAL.txt
File Size:5 KB
Attachments:
Last edit: 25 Jan 2026 10:33 by Mr1576. Reason: missed some symbols

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

Time to create page: 2.743 seconds
Powered by Kunena Forum