1. Example

This example shows the connections needed to use an Automation Direct GS2 VFD to drive a spindle. The spindle speed and direction is controlled by LinuxCNC.

Using the GS2 component involves very little to set up. We start with a StepConf Wizard generated config. Make sure the pins with "Spindle CW" and "Spindle PWM" are set to unused in the parallel port setup screen.

In the custom.hal file we place the following to connect LinuxCNC to the GS2 and have LinuxCNC control the drive.

GS2 Example
# load the non-realtime component for the Automation Direct GS2 VFDs
loadusr -Wn spindle-vfd gs2_vfd -r 9600 -p none -s 2 -n spindle-vfd

# connect the spindle direction pin to the GS2
net gs2-fwd spindle-vfd.spindle-fwd <= spindle.N.forward

# connect the spindle on pin to the GS2
net gs2-run spindle-vfd.spindle-on <= spindle.N.on

# connect the GS2 at speed to the motion at speed
net gs2-at-speed spindle.N.at-speed <= spindle-vfd.at-speed

# connect the spindle RPM to the GS2
net gs2-RPM spindle-vfd.speed-command <= spindle.N.speed-out
Nota
The transmission speed might be able to be faster depending on the exact environment. Both the drive and the command line options must match. To check for transmission errors add the -v command line option and run from a terminal.

On the GS2 drive itself you need to set a couple of things before the modbus communications will work. Other parameters might need to be set based on your physical requirements but these are beyond the scope of this manual. Refer to the GS2 manual that came with the drive for more information on the drive parameters.

  • Los interruptores de comunicación deben configurarse en RS-232C.

  • Los parámetros del motor deben configurarse para que coincidan con el motor.

  • P3.00 (Fuente del comando de operación) debe establecerse en Operación determinada por la interfaz RS-485, 03 o 04.

  • P4.00 (Fuente del comando de frecuencia) debe establecerse en Frecuencia determinada por la interfaz de comunicación RS232C/RS485, 05.

  • P9.01 (Velocidad de transmisión) debe establecerse en 9600 baudios, 01.

  • P9.02 (Protocolo de comunicación) debe establecerse en "Modo Modbus RTU, 8 bits de datos, sin paridad, 2 bits de parada ", 03.

A PyVCP panel based on this example is here.