Most VFDs have a simple interface for controlling it. They usually have one or two inputs for switching the spindle on and a second input for controlling its direction. For the speed, often, an analog 0-10V input is used.


Below is an example of the interface of a VFD. Depending on the VFD, it might be necessary to configure the digital inputs for external control. Please refer to the manual of your VFD.




Often we see that the first two digital inputs are assigned for switching ON the spindle and controlling its DIRECTION. In this example we assume that DI1 is configured as ON/OFF and DI2 is configured for DIRECTION. 


To control these inputs you can use two relays that switches the input to the COM (common) pin.  On the controller side the ON/OFF is default the standard TOOL output. This output is an 'open collector' output, making it easier to connect a relay to it. The DIRECTION output can be assigned to one of the digital AUX outputs. As an example, we will use AUX6. The AUX outputs are also 'open collector' outputs.


The first step is to connect the relays to the outputs, below is a schematic showing how this is wired in general. The external diode is only necessary if one is not integrated in the relay. As diode can be used a 1N4007. Please note that the diode should be mounted to the relays as close as possible. 



If you use the breakout board it would look like this:



For more detail info about the hardware please refer to:


CNC760 Hardware Manual


If DIRECTION is not used this will already be enough for switching the spindle ON/OFF. If you however need to use the direction output you need to change this in the file CNC.INI (unless you use version 5 software). In the file you need to set the value 'directionOutputPortID' under the label '[SPINDLE_0]'.


[SPINDLE_0]

;Main spindle M90

onOffOutputPortID = 0 ;0: Standard tool output, 1-10: AUX1-AUX10

directionOutputPortID = 6 ;0: Standard tool dir output, 1-10: AUX1-AUX10, -2: MIST COOLANT Output

pwmOutputPortID = 1 ;0: Standard PWM output, 1-8: PWM1-PWM8 Output

spindleReadyPortID = 0 ;0: not used 1-10  AUX Input 1 - 10

spindleReadyPortMode = 0 ;0: ready wit m3/m5, 1 ready with m3 not ready with m5

rightOnLeftOnMNode = 0 ;0: default TOOL ON/OFF and TOOL_DIR output, 1: TOOL => LEFT-ON, TOOL-DIR=>RIGHT-ON

spindleRampUpTime = 1.00

spindleRampDownTime = 0.00

spindleNmax = 24000.00

spindleNmin = 100.00

spindleUseRPMSensor = 0

stepperMotorMode = 0

countPerRev = 1

smoothCountMode = 0

pwmCompensationOn = 0

pwmCompensationFileName = "Spindle-0-pwmCompTable.txt"

maxAvgSpeedFilterTimeMillisecs = 3000

sensorSpeedControlOn = 0

sensorSpeedControlCycleTime = 10.000


Next step is the 0-10V control. In the original schematic a potentiometer is used to get a 0-10V signal, in our case we generate it ourself. Below it shows how the 0-10V input is connected the CNC760 Breakout Board: