Machsupport Forum

Mach Discussion => Mach4 General Discussion => Topic started by: bc17101 on April 08, 2019, 04:36:28 PM

Title: Connecting a VFD to Mach4 through Modbus (RS485)
Post by: bc17101 on April 08, 2019, 04:36:28 PM
Here is a link to a 26 page tutorial that describes in full detail the steps necessary to connect a Modbus compliant VFD to the Mach4 Modbus (RS485).
It supports M3, M4, M5, and S commands in addition to the Mach4 buttons on the control screen.
I am using a Huanyang GT series 3KW VFD which is compliant with the Modbus protocol and Mach4. Other Huanyang VFDs are not, so be careful.
Other Modbus compliant VFDs are supported with a few simple edits.

http://caldwellfam.net/bill/2019/04/connecting-a-vfd-to-mach4-through-the-modbus-rs485/ (http://caldwellfam.net/bill/2019/04/connecting-a-vfd-to-mach4-through-the-modbus-rs485/)



Enjoy :)



Title: Re: Connecting a VFD to Mach4 through Modbus (RS485)
Post by: reuelt on April 11, 2019, 02:18:36 AM
Thanks for sharing.

you said,
"I chose Huanyang GT series 2.2KW for my Spindle since it does support the   Modbus   protocol   and   interfaces   with   Mach4’s   Modbus   correctly"
Very good to know.
Does your model support the use of a "BRAKING RESISTOR" to stop the spindle in less than 1 sec?
I am interested to upgrade.
Title: Re: Connecting a VFD to Mach4 through Modbus (RS485)
Post by: ger21 on April 11, 2019, 07:14:30 AM
Quote
Does your model support the use of a "BRAKING RESISTOR" to stop the spindle in less than 1 sec?

Depending on RPM and tool size, a braking resistor will probably not be able to stop a spindle in 1 second. Maybe at low rpm, but not from 24,000rpm with a big, heavy tool in the spindle.
Title: Re: Connecting a VFD to Mach4 through Modbus (RS485)
Post by: reuelt on April 11, 2019, 08:30:37 AM
Quote
Does your model support the use of a "BRAKING RESISTOR" to stop the spindle in less than 1 sec?

Depending on RPM and tool size, a braking resistor will probably not be able to stop a spindle in 1 second. Maybe at low rpm, but not from 24,000rpm with a big, heavy tool in the spindle.
From youtube:
Regenerative DC Braking on a 2.2kw 3hp Hitachi WJ200 VFD with a 35ohm 400watt wire wound resistor. .5 second starts and .75 second stops.
Isn't 0.75 seconds is less than 1 second?
Title: Re: Connecting a VFD to Mach4 through Modbus (RS485)
Post by: bc17101 on April 11, 2019, 09:02:13 AM


According to the manual it does. I have my accelerate/ decelerate times set to .5 seconds now with no external braking resistor and with a 1/2” 2 flute end mill it starts and stops in that time. The manual indicates in this size inverter (2:2KW) the braking is already done internally but it’s a little unclear in the wording. Here is the text of the GT manual.

4.4.2.2 Braking unit and braking resistor
• GT series inverters below15kW (380V) are equipped with internal braking unit.In order to dissipate the regenerative energy generated by dynamic braking, the braking resistor should be installed at (+) and PR terminals
Title: Re: Connecting a VFD to Mach4 through Modbus (RS485)
Post by: bc17101 on April 11, 2019, 09:09:16 AM
BTW my spindle accelerate and decelerate measurements were done at 12000 RPM which is the sweet spot for most of my work, and they are only done by my eye. No formal measurement was done
Title: Re: Connecting a VFD to Mach4 through Modbus (RS485)
Post by: reuelt on April 11, 2019, 07:35:34 PM
Thank you.
Your VFD has impressive data even without connecting a huge external "Braking Resister" YET.
Title: Re: Connecting a VFD to Mach4 through Modbus (RS485)
Post by: joeaverage on April 12, 2019, 01:01:15 AM
Hi,
try doing it with high rotational inertia three phase motor, a fan say. If you try to decelerate too fast the VFD will
fault 'over voltage', and it will coast to a stop rather than trying to stop in the programmed time and wreck itself trying
to do so.

Craig
Title: Re: Connecting a VFD to Mach4 through Modbus (RS485)
Post by: joeaverage on April 13, 2019, 01:30:43 AM
Hi,
I cant find any specification from any manufacturer about the rotational inertia of the rotor of a 2.2kW asynchronous
spindle.

Rotational inertia is a specified parameter in servos and so I will use the servo data for a 2kW AC servo from Delta.
Its specified rotational inertia is:

0.00149 kg.m2  (more correctly called 'the first moment of inertia', usually given the symbol 'I')

Lets assume that if you had a direct coupled tool holder and smallish endmill that the rotational inertia would be approx:

0.002 kg.m2.

The kinetic energy of the rotor/toolholder/ tool combination  at 3000 rpm is:
E(joules)=0.5 x I (kg.m2). w2 (rad/sec) (note w is  the rotational speed in radians/second)
E=0.5 x 0.002 x (2 xPI x3000/60)2
E=98.7 joules

If the spindle were required to decelerate very quickly this kinetic energy would be fed back into the drive. In absence
of any braking resistance that energy would be added to the DC link capacitors. The voltage rise that would cause is:

E(Joules)= 0.5 X C (Farads, the capacitance of the link capacitors) x Vrise2

Rearranging and evaluating:

Vrise= (2 X 98.7/ 10000uF )1/2
Vrise=140.5V
Note for the purposes of this calculation I have assumed 10,000uF DC link capacitors, as is common in single phase
servo drives and VFDs.

Thus your DC links capacitors (on a 230V single phase driver) are normally charged to 320VDC, and because of the sudden
deceleration of the rotating component cause a voltage rise of 140.5V to a total of 460VDC. Note that the vast majority of
DC link capacitors, all aluminum electrolytic types, are rated to 450V. Thus your DC link capacitors are on the verge of blowing
up. This is exactly why braking resistors are required, to dissipate the kinetic energy WITHOUT the DC link capacitors
going over voltage.

My servo drive has a  braking resistor threshold of 340VDC and a safety threshold of 380VDC. Thus if the voltage increased to
340VDC the braking resistor MOSFET is switched on and the braking resistor is now directly across the DC link. If the
voltage further increases, ie the braking resistor does not 'hold the voltage  down' to 380VDC the servo drive faults
'over voltage' and switches off allowing the servo to coast to a stop.

If the deceleration is a matter of safety, ie the operator of the machine hit the Estop, we want the spindle to slow as quickly
as possible. If however you program a 'crash' stop the servo drive and braking resistor combination may not handle it and
shut down, allowing the servo to coast. This would be very bad design. In trying to decelerate we have caused the drive
to fault and therefore achieve a much lower deceleration than might have been possible had we allowed for the limited ability
of the driver/ resistor to absorb the energy.

Craig
Title: Re: Connecting a VFD to Mach4 through Modbus (RS485)
Post by: TTalma on April 15, 2019, 09:16:04 AM
I agree with what Craig is saying, my spindle is larger (4.4Kw) and has an ATC so there is more inertia (with extra parts and tool holder). But my Delta VFD is able to stop it with a 1/2" bit loaded it will stop it in about 4 seconds but the voltage jumps to 360 to 370. I put on a breaking resistor and changed the time to 5 sec for accel and decel, and the voltage stays at 280 to 281 when in decel. I have put some large heavy bits in it and it still stays at the 280V mark.
Title: Re: Connecting a VFD to Mach4 through Modbus (RS485)
Post by: jonas60526 on April 20, 2019, 12:26:21 PM
Does this address all the issues discussed in topic=34023.0 i.e. Estop, speed overide, ...? If Mach4 supports modbus, I think it should be documented and the software setup to handle typical spindle functions as a minimum. Browsing the forum and piecing together various experiments (great stuff there and thanks for that) to get something working seems like a poor way to support a significant capability.
Title: Re: Connecting a VFD to Mach4 through Modbus (RS485)
Post by: joeaverage on April 20, 2019, 03:35:37 PM
Hi,
there are a couple of ways that an Estop event can be handled.

The traditional manner and still is the norm in industrial machines is that an Estop (or limit switch event) depowers
the entire machine by causing the main supply contactor to drop out.

Another way more common on hobbyists machines is that when an Estop occurs then Mach will turn the spindle off.

The objection to this later method is that it relies on Mach (a computer program) to do its thing, should the program
prove to be buggy the machine might not shut down. In many countries that would (legally) be considered unsafe.

I participated quite heavily in:
https://www.machsupport.com/forum/index.php?topic=34023 (https://www.machsupport.com/forum/index.php?topic=34023)
Zuxtah had relay to depower the VFD in the manner common in industrial practice. He could also have chosen to add
a line or two of code to cause Mach to command the VFD off in response to an Estop.

Speed override is a Mach function. Thus if you override the speed then Mach will increase the commanded frequency
of the VFD and the spindle would speed up. The code to do that was discussed quite extensively.

Quote
If Mach4 supports modbus, I think it should be documented and the software setup to handle typical spindle functions as a minimum. Browsing the forum and piecing together various experiments (great stuff there and thanks for that) to get something working seems like a poor way to support a significant capability.

One of the perennial complaints about Mach4, and to a certain extent Mach3 which preceded it, is that the documentation
is not up to it. The reality is that NFS is a very small company and does not have the resources to employ technical document
writers. Any documentation has to be written by the person who has just developed the 'new' feature and simply put their time
and energy is best devoted to development.....rather than prosaic documentation.

This is why the forum is so important to Mach....we the users sort of document it as we go.

Craig