There are many flavors of variable frequency drives (VFDs).
The Huanyang HY series: /spindle_settings.pdf was a popular VFD. That is what is mainly documented.
This config is to verify the VFD and spindle using the front panel and some sane default config.
|Parameter lock, 0=unlock
|Use the front panel for easier debugging (Set to 2 for RS485 control)
|Use the front potentiometer (Set to 2 for RS485 control)
|Max operating frequency (Note that this is PD005 - it is out of numerical order, this appears to matter, follow the ordering here)
|Base frequency (Note that this is PD004, and is out of order, this is intentional)
|Main frequency (Note that this is PD003, and is out of order, this is intentional)
|Min frequency, for the VF curve
|Max output volt, for a 220V spindle
|Intermediate voltage on the VF curve
|Minimum frequency, the spindle could overheat at lower speed and the spindle does not have torque at low speed
|Acceleration time, can be lower for faster acceleration
|Deceleration time, can be lower for faster braking
|Motor rated voltage, its 220 even in North America, the VFD will convert the 240V at the input in 220V at the output, as required. This is for the 220V spindle
|Motor maximum Amp, its 9A for the 220V spindle
|Number of poles, 2 for the standard 2.2kW spindle
|A value of 3000 = 24k RPM, this is to have the correct RPM on the display of the VFD
|For RS485. Inverter manual: Range 00 - 250, factory setting: 00
LinuxCNC: Set register PD163 (communication address) to 1. This matches the default in the hy_vfd driver, change this if your setup has special needs.
|For RS485. Inverter manual: Range 0 - 3, 0: 4800 b/s, 1: 9600 b/s, 2: 19200 b/s, 3: 34800 b/s; factory setting: 1
LinuxCNC: Set register PD164 (baud rate) to 2 (19200 bps). This matches the default in the hy_vfd driver, change this if your setup has special needs.
Make sure this matches the baudrate specified in LinuxCNC VFD config.
|For RS485. Inverter manual: Range 0 - 5, factory setting: 0
LinuxCNC: 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.
This configuration is to verify the VFD and spindle using the front panel and a sane default configuration.
|Motor controlled by dial on front of VFD
|Locked (after changing settings)
Or if planning on using the RS485 interface:
|Motor controlled by RS485
|19200 (or you can opt to use 9600, which might be a better option)
|Id (defaults to 10)
|8 1 None
|Deal with RS485 communication error (default is option “0” which “decelerate to stop”, but option “3” is “Non-Stop”
|Sets VFD relay to run when the spindle is turning can be used for water pump power to only run while spindle is on
Whatever communication options you select on the VFD, be sure to update/match in the vfd ini file (ex: YL620.ini).
This is the recommended setup due to the lower wire size required. A normal 120V 15A circuit does not have enough power for a 2.2kW spindle/VFD, only 1440W is available on a normal outlet.
A Nema 6-15 is enough to power the VFD and your stepper drivers, this outlet only requires a dual pole 15A breaker and AWG14 wires. This outlet allow access to both 120V phase in your electrical panel, with both of them, you can have a 240V device. Most of modern electronic will use directly 240V without modifications.
Your oven, dryer, water heater are already connected at 240V.
Connect each phase to R and S VFD terminals.
You probably have easy access to single phase 220V or 240V outlet. Connect live and neutral to R and S terminals
As a rule of thumb, Chinese products are always grounded incorrectly, so verify the ground before powering up equipment.
The ground of the input cable needs to be connected to the red screw labeled ground on the VFD. The input cable ground also needs to be connected to your enclosure. Since you probably need that ground connected to multiple devices, you can use some terminals to connected all of them in a star pattern.
The spindle shield and ground will also need to be connected on this red screw on the VFD.
The screws in the plastic case in the lower left and right are not connected to ground. Do not use them for grounding - they are for holding the case together only.
The spindle might not be grounded at the factory. You can verify if this is the case by removing the 4 screws holding the connector to the spindle and pulling on the connector. If the 4th pin is not connected, you will need to open your spindle to add a ground wire to the case.
To open the spindle:
Talking about that stuff here
The spindle speed can be set via an analog 0-5V signal. For this to work the VFD needs to be configured with the correct voltage range as 0-10V is the default.
|Voltage range: 0-5V
A relay can be connected between the DCM and FORward pins on the VFD. The spindle will start when the relay is toggled and a voltage above 0V is applied to the FOR pin. The input of the relay is then connected to the spindle enable output of your controller. Alternatively the connection can be made with a jumper wire between the DCM and FOR port. However, using a relay is safer, as once the spindle is activated and a minimum speed has been configured the spindle won't turn off with 0V.
Changes to be made in GRBL are detailed on the GRBL page.
The HY02D223B (and similar models) VFD has terminal input / outputs to control and monitor various external devices.
Please see below infographic for detail on programming VFD - Text will follow illustration:
The Huanyang and YL VFDs do not use the same communication.
Connect the RS+ and RS- to A and B on a USB dongle.
Connect the B, A, and COM pins on the white 3 pin JST-XH header above the screw terminals to a USB dongle. The docs show the pins as: B+, A-, and COM. One solution is to use VFDMOD
USB dongle seems to work best if it uses the FT232RL chipset for RS485
For this to work, you need to add the user that runs LinuxCNC to the "dialout" group. To do this:
1. run: sudo usermod -a -G dialout $USER
3. log back in and confirm the user is in the group by running: grep dialout /etc/group and verifying your user is in that group.
Note: If you unplug the USB dongle and re-plug it back in quickly, it may create a newly numbered port. For instance, the first time the dongle may create /dev/ttyUSB0. Sometimes, it may create a /dev/ttyUSB1. Be sure to double check which one is being used by running: ls -al /dev/ttyUSB*
I've tested it and it's working, but I don't know if works after a reboot. I think it should though as the system should read the new usb rules and make the system link
this way /dev/rs485_dongle or whatever you call it will stay the same regardless of if it changes ttyUSB number (edited)
Set the VFD up according to your spindle first.
Make a cable for PD-RS485 communication from a spare Ethernet cable, as FR-D700 uses RJ45 connector. Connect pins 3(RDA) & 5(SDA) to A on RS-485 dongle, pins 4(SDB) & 6(RDB) to B on RS-485 dongle, pin 7 is signal ground.
Settings for FR-D700 for control via Modbus RTU:
Pr. 77 Parameter Write selection-2
Pr. 117 PU communication station number - default is 0, set to anything but 0, this will be slave ID for Modbus
Pr. 118 to Pr. 120 set to match with mb2hal
Pr. 549 set to 1 to use Modbus RTU instead of Mitsubishi protocol
Use mb2hal component to control VFD via modbus http://linuxcnc.org/docs/html/drivers/mb2hal.html
Registers on FR-D700:
Stop, forward, reverse command: 8
Spindle speed set: 13
Spindle current output: 201
Spindle frequency output: 200
For CNCDrive AXBB-E board and UCCNC with YL620-A series to setup control via PWM the terminal connections on the VFD are:
|Use 5V0 on 5V Power Out not 5V0 on Port 1
|Use 24V0 common
|Pin 7, Port 1
UCCNC settings are:
Spindle config screen: set "PWM Pin" to Pin 7, Port 1
I/O Setup screen: set "Spindle PWM -> analog ch" to 1
On the VFD:
Parameter 00.01 set to 1
Parameter 07.08 set to 3
When you first turn on the VFD, the VFD display should show “F 00” flashing and the “FOR” light solid. (Note: If you are controlling the speed via the knob, then it will just be a solid “F 00” on the display.)
When you start LinuxCNC, and press the eStop button in LinuxCNC, the VFD display will sill show the same as above.
When you press the “power on” button in LinuxCNC, you should hear a click. (possibly from VFD, not sure)
When you press a “turn spindle” button, you should see the VFD display “F 00” solid, the “FOR” light should be on as well as the “RUN” light should be on.
When you press the “+” to increase speed, the display should change to something like “F 10.0”.
Be sure to press the “power off” and eStop buttons in LinuxCNC before closing LinuxCNC so the VFD behaves like the above. In other words, if you just click the “X” in the top right corner or just quit LinuxCNC, it may not reset the comms with the VFD.
When you hit your eStop button and power is “cut” from the VFD, you will see “ER 10” flashing. That is expected as there is no more power to the VFD. After 20-30 seconds, the VFD will be fully drained and the display will completely turn off.
Use the formula
RPM = 60 * Frequency
to calculate the RPM. For instance, the YL VFD goes up to 400 Hz (shown as “F 400.0” on the display) goes up to 24,000 RPM.
@logan: For wood it probably won't make as big a difference spindle vs router. But for metal being able to change the speed on the fly is a big deal.
You can run the spindle down to 6k rpm but as soon as it bogs down a little it'll lose a lot of torque and stall. I keep mine at 8k minimum so I can hear it starting to load and pause it and adjust some things.
For aluminum I'm running 22k for the endmill and 12k for drilling I think. It pulls out like 2-3" long spirals when drilling the first 3mm, then I just do 1mm pecks with full retracts to clear the chips.
gerrg said: yeah because it gives some sort of feedback from the vfd
@Noot Few things I learned today: A flow indicator for coolant hoses is very important, because it helped me notice that I had a small clog somewhere in my loop. This was probably a piece of sawdust, or piece of plastic from my 5gal pail when I drilled for the bulkhead barbs.
I'm thinking this might be a common issue that I wouldn't have noticed without the flow meter (potentially damaging the spindle). So I put my pond pump in a nylon sock from the wife as a filter. So far is working really well, and nice insurance if I'm not watching for problems
I do have a lid on my pail, but even then there always a chance something will make it in there. Not sure how small the coolant channels are in the spindle