Few months ago I purchased Huanyang HY01D523B VFD and 1.5 KW water cooled spindle motor from eBay for my CNC router. Recently I completed mechanical part and started final part, electrical. First of all I googled on the how to control spindle from software. Luckily there is a way not only to turn spindle on/off from Mach3, but control RPM and read actual PRM count back. This part a bit tricky as Huanyang VFDs aren’t implementing standard ModBus protocol, but uses their own, so is not directly supported by Mach3. But I found special plug-in which solves this issue, and I’ll back to software part later.
Connecting power linesHY01D523B VFD could be powered from single on three-phase 220V/50Hz. I use single-phase power line, so I connected phase wire to R terminal of VFD, and null line to T; PE goes to E terminal.
Spindle is three-phase, and is connected to U, V, W terminals. If your spindle runs in wrong direction, just swap any two wires of the motor. For details please refer to VFD manual.
Hardware interfaceTo connect VFD to PC, you will need RS-485 adapter. There is few approaches, you may connect it via your RS-232 port with special adapter or purchase FT232RL based USB adapter on eBay. I decided to make my own adapter
as boards from eBay tends to be bulky, which is not suitable for me as I wanted to embed it inside VFD. I designed adapter in EAGLE CAD and ordered manufacturing of 3 blank boards. You may find EAGLE files in my BitBucket repo here. I have 2 boards left and they are for sale ($15 each + shipping), assembled and tested. If you need one, let me know.
Next step was to select proper differential bus transceiver chip. As I found on forums, not all line drivers works well with VFD. There was recommendations on Maxim chips, but nearby electronic parts dealer does have Maxim chips in their catalogue. I decided to try ST ST485CDR and National DS36F95. As it turned out, warnings on forums were true, and only ST485CDR from two above is compatible with VFD.
Connecting RS-485 bus to VFDRS-485 is differential bus, and twisted pair wire is recommended as carrier media. I use pair of solid-core wires from UTP (Ethernet) cable plus one wire for ground. Connector pin closest to termination solder jumper SJ1 on my board is line A, next is B and third contact if connected to the ground via 27 Ohm resistor. A line should be connected to RS+ contact on VFD, B line to RS- accordingly. On one forum I found recommendation to wrap ground wire from adapter around signal lines, far end should be NOT connected to anywhere inside VFD. I did it exactly this way but not sure this is really required. For connection with VFD termination is not required, so SJ1 should be unconnected.
I strongly recommend to use good quality USB cable with ferrite beads as setup will be used in high currents environment and could be influenced by EMI.
VFD setupSeller from whom I purchased my VFD advised first of all reset to factory settings and then define running frequencies. For my water cooled setup I have used following settings, in exactly same order:
- PD013 = 8 (reset to factory settings)
- PD005 = 400 (max frequency 400Hz)
- PD004 = 400 (base frequency 400Hz)
- PD003 = 400 (main frequency 400Hz)
- PD001 = 2 (set communication port as source of run commands)
- PD002 = 2 (set communication port as source of operating frequency)
- PD163 = 1 (slave address 1)
- PD164 = 1 (baud rate 9600 bps)
- PD165 = 3 (8N1 for RTU mode)
- PD006 = 2.5 (intermediate frequency 2.5Hz // from here and on settings are specific to my 1.5 KW spindle; refer to documentation of your motor and VFD for correct setup; incorrect settings could damage your VFD and motor)
- PD008 = 220 (max voltage 220V)
- PD009 = 15 (intermediate voltage 15V)
- PD010 = 8 (min voltage 8V)
- PD011 = 120 (frequency lower limit 120Hz, to limit lower RPM settings)
- PD014 = 5.0 (acceleration time, 5 seconds)
- PD015 = 0.8 (deceleration time; any more trips the VFD)
- PD025 = 1 (starting mode: frequency track)
- PD142 = 7 (max current 7 A)
- PD143 = 2 (specific to my 1.5 KW spindle: number of poles - 2)
- PD144 = 3000 (specific to my 1.5 KW spindle: multiplied by PD010 = 3000 * 8 = 24,000 RPM))
SoftwareBefore running Mach3, I used “spindle talker” software to test setup (backup copy here). You may need VB6 runtime to execute program. In application you should go to Configuration and configure your COM port, port speed (9600) and parity (n,8,1). Then save and in Basic section you should be able to run/stop/control speed of spindle.
For Mach3 you will need separate plug-in (backup copy here). There is manual inside archive, please refer to it for settings should be done. Remember to restart Mach3 after changing port settings.
For linux software and settings you may refer to here.
Water cooling control
VFD has build-in relay to control auxiliary devices. By default relay triggers when motor is powered up. FA & FC terminals are normally closed and FA & FB are normally open. I connected 12V water pump for through FA-FB pair and cooling fluid is going through spindle when it is running.
To allow VFD brake spindle to stop it faster in case of emergency stop, I added 300W, 100Ohm resistor between P and Pr terminals of the VFD. For details please refer to VFD manual, section XI for details.