Machinekit

Machinekit

hy_vfd

NAME

hy_vfd - HAL userspace 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. The Huanyang VFD must be configured via the face plate user interface to accept serial communications. However, to avoid malfunction the following parameter should be configured:

PD001 = 2

Set register PD001 (source of run commands) to 2.

0 …​ operator
1 …​ external terminal
1 …​ external terminal
2 …​ communication port

PD002 = 2

Set register PD002 (source of operating frequency) to 2.

0 …​ operator board
1 …​ board potentiometer
2 …​ communication port

PD005

Set register PD005 (max operating frequency) according to motor specs. This is the maximum frequency of the motor’s power supply, in [Hz].

PD011

Set register PD011 (min frequency) according to motor specs. This is the minimum frequency of the motor’s power supply, in [Hz].

PD141

Set register PD141 (rated motor voltage) according to motor name plate. This is the motor’s maximum voltage, in [V].

PD142

Set register PD142 (rated motor current) according to motor name plate. This is the motor’s maximum current, in [A].

PD143

Set register PD143 (Number of Motor Poles) according to motor name plate.

PD144

Set register PD144 (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)!

PD163 = 1

Set register PD163 (communication address) to 1 (default 0).

range: 0 …​ 240
0 …​ invalid address

PD164 = 2

Set register PD164 (baud rate [b/s]) to 2 (19200). This matches the default in the hy_vfd driver, change this if your setup has special needs.

0 …​ 4800
1 …​ 9600
2 …​ 19200
3 …​ 348400

PD165 = 3

Set register PD165 (communication data method) to 3 (8n1 RTU). This matches the default in the hy_vfd driver, change this if your setup has special needs. Note that the hy_vfd driver only supports RTU communication, not ASCII.

0 …​ 8N1 ASCII
1 …​ 8E1 ASCII
2 …​ 8O1 ASCII
3 …​ 8N1 RTU
4 …​ 8E1 RTU
5 …​ 8O1 RTU

Consult the Huanyang instruction manual for details on using the face plate to program the VFDs registers, and alternative values for the above registers.

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.

-n, --name <string>

(default: hy_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>

(default 8) Set number of data bits to <n>, where n must be from 5 to 8 inclusive. This must match the setting in register PD165 of the Huanyang VFD.

-p, --parity [even,odd,none]

(default: odd) Set serial parity to even, odd, or none. This must match the setting in register PD165 of the Huanyang VFD.

-r, --rate <n>

(default: 38400) 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 register PD164 of the Huanyang VFD.

-s, --stopbits [1,2]

(default: 1) Set serial stop bits to 1 or 2. This must match the setting in register PD165 of the HuanyangVFD.

-t, --target <n>

(default: 1) Set HYCOMM target (slave) number. This must match the device number you set on the Hyanyang VFD in register PD163.

-F, --max-frequency <n>

(default: read from VFD) If specified, program register PD005 of the VFD with the specified max frequency of <n> Hz (and use the same max frequency in the hy_vfd driver). If not specified, read the max frequency to use from register PD005 of the VFD.

-f, --min-frequency <n>

(default: read from VFD) If specified, program register PD011 of the VFD with the specified minimum frequency of <n> Hz (and use the same minimum frequency in the hy_vfd driver). If not specified, read the minimum frequency to use from register PD011 of the VFD.

-U, --motor-voltage <n>

(default: read from VFD) If specified, program register PD141 of the VFD with the specified max motor voltage of <n> Volts. If not specified, read the max motor voltage from register PD141 of the VFD.

-I, --motor-current <n>

(default: read from VFD) If specified, program register PD142 of the VFD with the specified max motor current of <n> Amps. If not specified, read the max motor current from register PD142 of the VFD.

-S, --motor-speed <n>

(default: compute from value read from VFD P144) 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-frequency argument or from P011 if --max-frequency is not specified) and program register PD144 of the VFD. If not specified, read the motor’s speed at 50 Hz from register P144 of the VFD, and use that and the max frequency to compute the motor’s max speed.

-P, --motor-poles <n>

(default: read value from VFD P143) This command-line argument is the number of poles in the motor. If specified, this value is sent to the VFD’s register PD143. If not specified, the value is read from PD143 and reported on the corresponding HAL pin.

PINS

<name>.enable (bit, in)

enables communication to VFD

<name>.SetF (float, out)

commanded frequency [Hz]

<name>.OutF (float, out)

output frequency [Hz]

<name>.OutA (float, out)

actual motor current [A]

<name>.Rott (float, out)

spindle speed [r/m]

<name>.DCV (float, out)

VFD internal voltage [V]

<name>.ACV (float, out)

ouput voltage [V]

<name>.Cont (float, out)

counter value

<name>.Tmp (float, out)

VFD temperature [°C]

<name>.spindle-forward (bit, in)

spindle run forward command

<name>.spindle-reverse (bin, in)

spindle run reverse command

<name>.spindle-on (bin, in)

spindle on command

<name>.CNTR (s32, out)

control request register (flags)

<name>.CNST (s32, out)

control response register (flags)

<name>.CNST-run (bit, out)

run bit

<name>.CNST-running (bit, out)

running bit

<name>.CNST-running-rf (bit, out)

jog reverse / forward bit

<name>.CNST-command-rf (bit, out)

run reverse / forward bit

<name>.CNST-jog (bit, out)

jog bit

<name>.CNST-jogging (bit, out)

jogging bit

<name>.CNST-bracking (bit, out)

braking bit

<name>.CNST-track-start (bit, out)

track start bit

<name>.speed-command (float, in)

speed to command [r/m]

<name>.frequency-command (float, out)

frequency command as sent to VFD [Hz*100]

<name>.spindle-speed-fb (float, out)

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-tolerance of the commanded speed, then the .spindle-at-speed pin will go True. The default .spindle-at-speed-tolerance is 0.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-tolerance of the commanded speed.

<name>.freq-lower-limit (float, out)

frequency lower limit [Hz], see options: --min-frequency

<name>.max-freq (float, out)

frequency upper limit [Hz], see options: --max-frequency

<name>.rated-motor-voltage (float, out)

maximum motor voltage as stored in PD141[V]

<name>.rated-motor-current (float, out)

maximum motor current as stored in PD142 [A]

<name>.rated-motor-rev (float, out)

maximum motor speed: PD144/50*<name>.max-freq [r/m]

<name>.motor-poles (u32, out)

number of motor poles as stored in PD143

<name>.hycomm-ok (bit, out)

True if the communication is online, False otherwise

<name>.error-count (s32, out)

communication error count, in creased on each failed communication attempt

<name>.loop-time (float, out)

current time to wait in between communication loops [s]

<name>.retval (s32, out)

return value of last communicaton

AUTHORS

Sebastian Kuzminsky, Raoul Rubien

LICENSE

GPL