Hi all - I had a reasonably easy time setting this up to work with my CNCRP machine, but I want to share a few of the more annoying parameters to understand when setting up this machine.
To control this spindle from mach3, it seems that there were two basic ways to do it.
1. RS485 adaptor to the com port on the VFD + Custom Mach plugin to make up for the lack of true MODBUS compliance in the Huangyang VFD.
2. Use a relay to set the forward pin, and use PWM to deliver a 0-10v signal to control the variable frequency.
I went with option 2, since I figured it was easier to understand and troubleshoot. (this may or may not have been true).
First things:
1. I wired up the spindle and VFD with a standard external potentiometer using the reference 10v and concluded that it was working as expected. This included modifying the setting for external control instead of the control panel on the front of the VFD. In doing this I also wired in a simple toggle switch to connect the FWD pin to the ACM pin.
2. The VFD expects the following pieces of information to run the spindle and control the speed - to put the spindle in FWD mode by shorting FWD to ACM, and to supply an ANALOG voltage between VI and ACM. From the factory, the VFD expects 0-10v, but if you have PWM set up for 5v, you can reconfigure that voltage using "PD070" according to the manual.
Next, I replaced the switch that I had wired in with a wire connected to my relay. The CNCRP box had a spare which I used, but any relay could be configured in Mach. Once I had this working I verified that I could set the speed with the potentiometer once the relay was closed.
Next I attached the the VI and ACM pins to the 10v PWM on my CNCRP board. The CNCRP has both 10v and 5v PWM circuits, but the 10v was easier to setup in my case, and didn't require reconfiguring the VFD.
Unfortunately, the VFD cannot accept PWM signal, and really requires an analog voltage which means you need to go to radio shack and buy: (1) 1 ohm resistor (1) 15 ohm resistor (1) 100uF capacitor. You assemble these into a small RC filter and put this inside the case with your CNC control. PWM signal comes in, and line voltage comes out. In order to get a nice smooth output signal without too much fluctuation I found that in Mach i got the best result setting the PWM base frequency to 25hz. (Note, if you use a smooth stepper, set this PWM frequency there as well). Set the output lines from your RC filter (+) to the VI terminal, and (-) to the ACM terminal.
IMPORTANT: You need to set the safe min frequency on PD007 to 200hz for 12000rpm minimum. And the Max frequency PD005 to 400hz. However, if you want to use PWM control you also need to set your "Lower Analog Frequency" PD073 to 200hz as well. If you do not set the lower analog frequency here, you will find that the VFD tries to map your PWM signal all the way from 0hz to 400hz, but will not operate until you reach your safe frequency (PD007), and you will spend many many hours chasing voodoo explanations and reading the manual.
Configure your spindle pulley for 12000 to 24000 with a scale of 1. You can now use your S commands to set the actual spindle speed in RPM. Mine came out within ~100rpm of what I set, which for my purposes is good enough. You can go through some tuning processes if it is not.
finally, on Ports and Pins > Spindle settings in Mach, configure your spin up time for your spindle. To max RPM I calculated that this spindle takes 12 seconds for a nice gentle spin to full RPM. Make sure this is set correctly or mach can start cutting before your spindle is up to speed. I decided not to try to get the spindle to spin up to quickly because it keeps the amperage load on the spindle and the VFD lower, and I figured this was an easy way to add a margin of safety to the machine.
Good Luck!