If you uses the plugin, do not hesitate to donate! it will help me to pay web server and domain name to keep it free…many thanks.
Mach3 software has been selected to control milling machine. Going further, I also chose to control the spindle with a Huanyang VFD. The problem is that those VFD ar not fully compliant with the modbus protocol. So As a specific driver was needed, i first looked over the net.
The ‘famous’ Huanyang VFD controller plugin
Anyone who wanted to control this chinese VFD began to use this plugin
So after buying the RS485 adapter on ebay, after tests, tests and other tests, I found that the plugin worked, but not as I wanted. I discovered several problems:
- Does not support the pulley system (RF45 has a 6 speed gearbox!)
- Designed specifically for spindles at 3000rpm at 50Hz
- User DRO required to monitor the rpm
To summarize the problems, this driver is pretty good for people who have a spindle that looks like this:
on my side, the need is different. The spindle is not running by default at 3000rrm @ 50hz. My mill also have a gearbox. So despite hours and hours trying to configure the plugin, i failed. I was unable to have the right RPM. Then I checked the internal structure of the plugin and that’s how i discovered that this plugin was designed only for chinese spindle or whatever motor running à 3000rpm@50hz.
That’s why i decided to build my own driver.
My own driver
- Start/stop of the spindle
- CW (clockWise ) and CCW ( counter ClockWise) management
- RPM monitoring through system DRO(39), no need to modify screen set
- Takes into account the rated frequency (pd004) and rated speed declared in the drive (PD144). Thus, the driver will be able to handle any kind of motor, not just those that run at 3000rpm @ 50hz .. You just need to configure your VFD on the right way.
- Can Manage the pulley system. If we set the option, the calculation of the RPM will be done using ratio declared in Mach3. Indeed, the first driver is specific to chinese spindle, the pulley system was useless. But on my RF45 or other machine whith a gearbox, spindle speed depends on the gear … But it is the speed of tool that interests us, not the motor …
- If the spindle stops (eg you press the stop button on the VFD), it causes an emergency stop in Mach3 disabled because of many noise problem
- Monitor one or more Vfd status variable (out frequency,current,speed,ac or dc voltage) by mapping them to user DRO.
- Define some limits fot those status variable.A Estop will be triggered as soon as the limit has been reached. For example, you could define a limit to 10A for the current. If the plugin detects that current is 10.1A then an Estop will occur. it’s an easy way to protect your VFD
Depending of the interest for this plugin, i’ll maybe add some extra features.
You will need:
- Mach3 in version 3.0 or greater (working with 2.62 but without rpm monitoring)
- VC++ 2008 redistribuables (to download and install)
- a Huanyang VFD with the RS485 cheap
- a RS485 adpater. I found mine on ebay, for less than 5 euros. Here a photo of mine:
For people having problems with the adapter driver, here a link to download the ones i used.
PL2303 Prolific Driver v1417
The Rs485 adapter wiring
Warning: this plugin is provided as it without any kind of warranty…use it at your own risk…
You can download the plugin here:Download vfdPlugin-1.7.1
The plugin installation is simple. Copy dll file in the folder ‘Plugins’ for your installation Mach3. For example, for installation in ‘C:\Mach3’, just copy the file in ‘C:\Mach3\PlugIns’.
Here, I do not go into details, I just give the values to enter in the VFD
|PD001||02||Enable commands on port rs485|
|PD002||02||Enable speed control on port rs485||PD004||depending on motor (mainly 50hz or 60hz)||The rate frequency of your motor (see motor plate)||PD023||01||Enable reverse rotation (only if you want to run CCW)|
|PD144||depending on motor||Rated speed of the motor at rated frequency (see motor plate)|
|PD163||1||Vfd address (here 1)|
|PD164||1||Line Speed(1 for 9600 bauds)|
|PD165||3||Transfert mode (here 8N1 RTU)|
Open popup plugins (Setup Menu and Config plugins).
You should have a screen like this.
Activate the plugin, then press the Setup button. the popup appears:
In principle, you should only have to change the COM port number in communication group box.
The monitoring group allows you map some internal vfd status variable with custom DRO.
the combobox contains variables you can monitor. Choose one in the list then fill the dro you want to use. For example, if you want the current to be in user DRO 1002, simply choose the variable ‘current’ in drop list and fill the edit user dro with 1002. If you leave this field blank or with value zero, then the variable will not be extracted from vfd.
The ‘Estop threshold’ input allows you to specify an upper limit to this variable. A mach3 Estop will be triggered as soon as the variable overs the limit. For example, if you want the current not to over 8.3A, then type 8.3 in the edit box. When milling, if for some reason the current raise to 9A, then an Estop will be triggered…It’s a simple way to protect your vfd. If you leave the field blank or fill it with zero, then this functionnality will not be enabled.
The « pulley management » allows to take into account the Mach3 pulley system.
Warning: There is a small limitation in this feature. The idea here is to work with the tool speed , not the motor speed. Indeed, it is what interests us and not the motor speed. For example, on my machine, the first gear have a ratio of 0.0359. So I configured the first Mach3 pulley with that ratio. Specifying min and max in addition, it keeps me from doing stupid things ..
Finally the « Rated Frequency » allows to disable the automatic rated frequency detection by overiding it.
Thus, for people working with chineese spindle, you need to enter 50 in the editbox
Once the configuration is complete, click OK. The plugin will then try to contact the VFD to extract the rated speed (pd144) of your spindle. This feature is the most significant difference bteween mattyzee plugin and this one. By reading this parameter, the plugin computes the ratio frequency / rotation for your engine. Within the plugin MattyZee, this ratio is fixed. That’s why it works with Chinese spindle, but not with other motors
If you get the following error:
The problem comes from your RS485 adapter. Is it a good port number? is active? ..
Either the wire is not properly connected (inversion?) Or the VFD is misconfigured, or your adapter does not work.
then it means that the plugin succesfully communicates with Mach3 and VFD. the popup gives you the speed of your engine as configured in the VFD. You can now try to run your spindle.
I didn’t manage to load pulley ratios other than at application startup. So if you need to change the pulley ratios, then think to restart Mach3
Checks at startup
Once the plugin is activated, it will be activated the next time Mach3. It is possible in case of problem you see the following message appear. Also, a common reason is that the VFD is not started or the adapter is not connected. This window offers go to the plugin configuration to fix everything.
A small demo
If you uses the plugin, do not hesitate to donate! it will help me to pay web server and domain name t…to keep it free! many thanks.