This example shows the connections needed to use an Automation Direct GS2 VFD to drive a spindle. The spindle speed and direction is controlled by EMC.
Using the GS2 component involves very little to set up. We start with a Stepconf Wizard generated config. Make sure the pins with "Spindle CW" and "Spindle PWM" are set to unused in the parallel port setup screen.
In the custom.hal file we place the following to connect EMC to the GS2 and have EMC control the drive.
# load the user space component for the Automation Direct GS2 VFD's + loadusr -Wn spindle-vfd gs2_vfd -n spindle-vfd
# connect the spindle direction pin to the GS2 + net gs2-fwd spindle-vfd.spindle-fwd <= motion.spindle-forward
# connect the spindle on pin to the GS2 + net gs2-run spindle-vfd.spindle-on <= motion.spindle-on
# connect the GS2 at speed to the motion at speed + net gs2-at-speed motion.spindle-at-speed <= spindle-vfd.at-speed
# connect the spindle RPM to the GS2 + net gs2-RPM spindle-vfd.speed-command <= motion.spindle-speed-out
On the GS2 drive itself you need to set a couple of things before the modbus communications will work. Other parameters might need to be set based on your physical requirements but is beyond the scope of this manual. Refer to the GS2 manual that came with the drive for more information on parameters.
-
The communications switches must be set to RS-232C
-
The motor parameters must be set
-
P3.00 (Source of Operation Command) must be set to Operation determined by RS-485 interface 03 or 04
-
P4.00 (Source of Frequency Command) must be set to Frequency determined by RS232C/RS485 communication interface 05
-
P9.02 (Communication Protocol) must be set to Modbus RTU mode 8 data bits, no parity, 2 stop bits 03
A pyVCP panel based on this example is in the pyVCP Examples section of this manual.