/ docs / src / examples / gs2-example.txt
gs2-example.txt
 1  [[cha:gs2-spindle]]
 2  
 3  = GS2 Spindle
 4  
 5  This example shows the connections needed to use an Automation Direct
 6  GS2 VFD to drive a spindle. The spindle speed and direction is
 7  controlled by LinuxCNC.
 8  
 9  Using the GS2 component involves very little to set up. We start with
10  a Stepconf Wizard generated config. Make sure the pins with "Spindle
11  CW" and "Spindle PWM" are set to unused in the parallel port setup
12  screen.
13  
14  In the custom.hal file we place the following to connect LinuxCNC to the
15  GS2 and have LinuxCNC control the drive.
16  
17  .GS2 Example
18  ----
19  # load the user space component for the Automation Direct GS2 VFD's 
20  loadusr -Wn spindle-vfd gs2_vfd -r 9600 -p none -s 2 -n spindle-vfd
21  
22  # connect the spindle direction pin to the GS2 
23  net gs2-fwd spindle-vfd.spindle-fwd <= spindle.N.forward
24  
25  # connect the spindle on pin to the GS2 
26  net gs2-run spindle-vfd.spindle-on <= spindle.N.on
27  
28  # connect the GS2 at speed to the motion at speed 
29  net gs2-at-speed spindle.N.at-speed <= spindle-vfd.at-speed
30  
31  # connect the spindle RPM to the GS2 
32  net gs2-RPM spindle-vfd.speed-command <= spindle.N.speed-out
33  ----
34  
35  [NOTE]
36  The transmission speed might be able to be faster depending on the exact
37  envirnment. Both the drive and the command line options must match. To check
38  for transmission errors add the '-v' command line option and run from a
39  terminal.
40  
41  On the GS2 drive itself you need to set a couple of things before the
42  modbus communications will work. Other parameters might need to be set
43  based on your physical requirements but these are beyond the scope of this
44  manual. Refer to the GS2 manual that came with the drive for more
45  information on the drive parameters.
46  
47  * The communications switches must be set to RS-232C
48  * The motor parameters must be set to match the motor
49  * P3.00 (Source of Operation Command) must be set to Operation
50     determined by RS-485 interface, 03 or 04
51  * P4.00 (Source of Frequency Command) must be set to Frequency
52     determined by RS232C/RS485 communication interface, 05
53  * P9.01 (Transmission Speed) must be set to 9600 baud, 01
54  * P9.02 (Communication Protocol) must be set to "Modbus RTU mode,
55     8 data bits, no parity, 2 stop bits", 03
56  
57  A PyVCP panel based on this example is <<gs2-rpm-meter,here>>.
58  
59