hy_vfd(1)
π hy_vfd β the LinuxCNC manual page for the Huanyang VFD hookup π
okay so welcome to hy_vfd(1), bestie πΈ this is the LinuxCNC Documentation page for it, and it's literally the thing that makes your Huanyang VFD talk to LinuxCNC. buckle up, it's giving β¨serialβ¨.
β¨ NAME β¨
hy_vfd β a HAL non-realtime component for Huanyang VFDs π¦
β¨ SYNOPSIS β¨
hy_vfd [OPTIONS]
β¨ DESCRIPTION β¨
This component connects the Huanyang VFD to the LinuxCNC HAL via a serial (RS-485) connection. that's the whole vibe, fr fr π
The Huanyang VFD must be configured via the face plate user interface to accept serial communications. yes, with your actual hands, on the actual face plate. no cap. here's the whole checklist π
PD001 = 2β Set registerPD001(source of run commands) to2(communication port).PD002 = 2β Set registerPD002(source of operating frequency) to2(communication port).PD004β Set registerPD004(Base Frequency) according to motor specs. This is the rated frequency of the motor from the motor's name plate, in Hz.PD005β Set registerPD005(max frequency) according to motor specs. This is the maximum frequency of the motor's power supply, in Hz.PD011β Set registerPD011(min frequency) according to motor specs. This is the minimum frequency of the motor's power supply, in Hz.PD141β Set registerPD141(rated motor voltage) according to motor name plate. This is the motor's maximum voltage, in Volts.PD142β Set registerPD142(rated motor current) according to motor name plate. This is the motor's maximum current, in Ampere.PD143β Set registerPD143(Number of Motor Poles) according to motor name plate.PD144β Set registerPD144(rated motor revolutions) according to motor name plate. This is the motor's speed in RPM at 50 Hz. Note: This is not the motor's max speed (unless the max motor frequency happens to be 50 Hz)! π read that twice bestie.PD163 = 1β Set registerPD163(communication address) to1. This matches the default in thehy_vfddriver, change this if your setup has special needs.PD164 = 2β Set registerPD164(baud rate) to2(19200 bps). This matches the default in thehy_vfddriver, change this if your setup has special needs.PD165 = 3β Set registerPD165(communication data method) to3(8n1 RTU). This matches the default in thehy_vfddriver, change this if your setup has special needs. Note that thehy_vfddriver only supports RTU communication, not ASCII. π«Ά
Consult the Huanyang instruction manual for details on using the face plate to program the VFDs registers, and alternative values for the above registers. it's giving "read the other manual too" but that's just how it is π
π the "permission denied" saga (iykyk)
Access to devices such as /dev/ttyUSB0 is restricted to members of the "dialout" group. If you see error messages such as:
open: Permission denied
ERROR Can't open the device /dev/ttyUSB0 (errno 13)
Check your groups membership with the command:
groups
Then add your user to the dialout group with:
sudo addgroup your-username dialout
You will need to log out and back in again for this to take effect. yes, actually log out. not "close the terminal", log out. π
β¨ OPTIONS β¨
-d,--device<path> β (default/dev/ttyS0) Set the name of the serial device node to use.-g,--debugβ Turn on debug messages. Note that if there are serial errors, this may become annoying. Debug mode will cause all serial communication messages to be printed in hex on the terminal.-y,--regdumpβ Print the current value of all registers as soon as the VFD is enabled.-n,--name<string> β (defaulthy_vfd) Set the name of the HAL module. The HAL comp name will be set to <string>, and all pin and parameter names will begin with <string>.-b,--bits<n> β (default8) Set number of data bits to <n>, where n must be from5to8inclusive. This must match the setting in registerPD165of the Huanyang VFD.-p,--parity[even,odd,none]β (defaultodd) Set serial parity toeven,odd, ornone. This must match the setting in registerPD165of the Huanyang VFD.-r,--rate<n> β (default38400) Set baud rate to <n>. It is an error if the rate is not one of the following:110,300,600,1200,2400,4800,9600,19200,38400,57600,115200. This must match the setting in registerPD164of the Huanyang VFD.-s,--stopbits[1,2]β (default1) Set serial stop bits to1or2. This must match the setting in registerPD165of the HuanyangVFD.-t,--target<n> β (default1) Set HYCOMM target (slave) number. This must match the device number you set on the Hyanyang VFD in registerPD163.-F,--max-frequency<n> β (default: read from VFD) If specified, program registerPD005of the VFD with the specified max frequency of <n> Hz (and use the same max frequency in thehy_vfddriver). If not specified, read the max frequency to use from registerPD005of the VFD.-f,--min-frequency<n> β (default: read from VFD) If specified, program registerPD011of the VFD with the specified minimum frequency of <n> Hz (and use the same minimum frequency in thehy_vfddriver). If not specified, read the minimum frequency to use from registerPD011of the VFD.-V,--motor-voltage<n> β (default: read from VFD) If specified, program registerPD141of the VFD with the specified max motor voltage of <n> Volts. If not specified, read the max motor voltage from registerPD141of the VFD.-I,--motor-current<n> β (default: read from VFD) If specified, program registerPD142of the VFD with the specified max motor current of <n> Amps. If not specified, read the max motor current from registerPD142of the VFD.-S,--motor-speed<n> β (default: compute from value read from VFDP144) This command-line argument is the motor's max speed. If specified, compute the motor's speed at 50 Hz from this argument and from the motor's max frequency (from the--max-frequencyargument or fromP011if--max-frequencyis not specified) and program registerPD144of the VFD. If not specified, read the motor's speed at 50 Hz from registerP144of the VFD, and use that and the max frequency to compute the motor's max speed.-P,--motor-poles<n> β (default: read value from VFDP143) This command-line argument is the number of poles in the motor. If specified, this value is sent to the VFD's registerPD143. If not specified, the value is read fromPD143and reported on the corresponding HAL pin.-x,--registerPDnnn=mmm<n> β Set a specific register to a new value. Can be used to set up to10registers. Parameters will "stick" (but only afterhy_vfd.enablehas been set true) so to set more than ten parameters it is possible to repeatedly load the driver with a set of registers to set then enable (setphy_vfd.enable 1) and unload (unloadhy_vfd) the driver at ahalrun(1)prompt. For example:
loadusr -W hy_vfd -d /ttyUSB0 --register PD014=30 --register PD015=30
Will set both ramp1 times to 3 seconds. The values should be scaled according to the manual data. The example above uses values with a resolution of 0.1 seconds, so the numbers are 10x larger than the required value.
β¨ PINS β¨
<name>.enableβ (bit, in) Enable communication from thehy_vfddriver to the VFD.<name>.SetFβ (float, out)<name>.OutFβ (float, out)<name>.OutAβ (float, out)<name>.Rottβ (float, out)<name>.DCVβ (float, out)<name>.ACVβ (float, out)<name>.Contβ (float, out)<name>.Tmpβ (float, out)<name>.spindle-forwardβ (bit, in)<name>.spindle-reverseβ (bin, in)<name>.spindle-onβ (bin, in)<name>.CNTRβ (float, out)<name>.CNSTβ (float, out)<name>.CNST-runβ (bit, out)<name>.CNST-jogβ (bit, out)<name>.CNST-command-rfβ (bit, out)<name>.CNST-runningβ (bit, out)<name>.CNST-joggingβ (bit, out)<name>.CNST-running-rfβ (bit, out)<name>.CNST-brackingβ (bit, out)<name>.CNST-track-startβ (bit, out)<name>.speed-commandβ (float, in)<name>.spindle-speed-fbβ (float, out) Current spindle speed as reported by Huanyang VFD.<name>.spindle-at-speed-toleranceβ (float, in) Spindle speed error tolerance. If the actual spindle speed is within.spindle-at-speed-toleranceof the commanded speed, then the.spindle-at-speedpin will go True. The default.spindle-at-speed-toleranceis0.02, which means the actual speed must be within 2% of the commanded spindle speed.<name>.spindle-at-speedβ (bit, out) True when the current spindle speed is within.spindle-at-speed-toleranceof the commanded speed.<name>.frequency-commandβ (float, out)<name>.max-freqβ (float, out)<name>.base-freqβ (float, out)<name>.freq-lower-limitβ (float, out)<name>.rated-motor-voltageβ (float, out)<name>.rated-motor-currentβ (float, out)<name>.rated-motor-revβ (float, out)<name>.motor-polesβ (u32, out)<name>.hycomm-okβ (bit, out)
β¨ PARAMETERS β¨
<name>.error-countβ (s32, RW)<name>.retvalβ (float, RW)
β¨ AUTHOR β¨
Sebastian Kuzminsky π«Ά
β¨ LICENSE β¨
GPL π
and that's the whole page bestie!! this one came from the Huanyang VFD folks and it's dated April 25, 2015 β so like, a classic, an icon, a legend π β¨ go forth and talk to your VFD fr fr π
π¦ where this page comes from
- debian trixie: linuxcnc-uspace 1:2.9.4-2+deb13u1 Β· GFDL-1.1-or-later
- ubuntu questing: linuxcnc-uspace 1:2.9.4-2ubuntu2
- ubuntu resolute: linuxcnc-uspace 1:2.9.4-2ubuntu4 Β· GFDL-1.1-or-later
- ubuntu stonking: linuxcnc-uspace 1:2.9.4-2ubuntu4 Β· GFDL-1.1-or-later
- Copyright (c) 2015 Sebastian Kuzminsky <seb@highlab.com>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms