Wiki source code of 3 Demo

Version 13.1 by Theodore Xu on 2025/01/21 11:49

Show last authors
1 == **1. **Application ==
2
3 |**Name**|**Explanation**|**Download **
4 |1. communication with  wecon HMI|This demo shows most parameter of servo,user could debug servo parameter in HMI directly|[[Download>>https://ftp.we-con.com.cn/Download/WIKI/Servo/Demo/VD2-HMI%20Modbus%20Communication%20v2.0.zip]]
5 |2. Position control with wecon PLC|This demo shows how to control servo position by WECON PLC|[[Download>>url:https://drive.google.com/drive/folders/1E4MbCoTnX_KFatgARqIIQ2ikswCYUDZv?usp=sharing]]
6 |3. Position control with wecon HMI&PLC| |[[Download>>https://drive.google.com/file/d/1vAE8nP_RhEVnjd5pAfJELs19dBmjXs3D/view?usp=sharing]]
7 |4. Single Position mode control with wecon HMI | |[[Download>>https://ftp.we-con.com.cn/Download/WIKI/Servo/Demo/VD2-HMI%20Single%20Position%20mode.zip]]
8
9 = **1 Servo communicates with WECON HMI** =
10
11 This demo shows most parameter of servo,user could debug servo parameter in HMI directly
12
13 [[Download link>>https://ftp.we-con.com.cn/Download/WIKI/Servo/Demo/VD2-HMI%20Modbus%20Communication%20v2.0.zip]]
14
15 = **2 Servo position control with WECON PLC** =
16
17 This demo shows how to control servo position by WECON PLC
18
19 [[Download link>>url:https://drive.google.com/drive/folders/1E4MbCoTnX_KFatgARqIIQ2ikswCYUDZv?usp=sharing]]
20
21 = **3 Servo position control with WECON PLC&WECON HMI** =
22
23 [[Download>>https://drive.google.com/file/d/1vAE8nP_RhEVnjd5pAfJELs19dBmjXs3D/view?usp=sharing]]
24
25 = 4 VD1/VD2 Servo Position control =
26
27 This case uses three commonly used PLC positioning instructions to implement the servo position control mode actions.
28
29 == VD1 I/O wiring ==
30
31 (% class="wikigeneratedid" id="H" %)
32 [[image:image-20220729134512-1.png]]
33
34 == VD2 I/O wiring ==
35
36 [[image:image-20220729134540-2.png]]
37
38 == Parameter setting ==
39
40 **Step 1**: Power on the servo, set the M key on the panel of the servo drive, set the value of function code P0-1 to 1, and 1 is the position control mode;
41
42 |=**Code**|=**Parameter Name**|=**Property**|=(((
43 **Effective**
44
45 **Time**
46 )))|=**Range**|=**Function**|=**Unit**|=**Default**
47 |P0-1|Control mode (default setting)|At stop|Power-on again|1~~10|(((
48 1: Position control mode
49
50 2: Speed control mode
51
52 3: Torque control mode
53 )))|-|1
54
55 **Step 2**: Set the value of function code P0-4, 0 is forward rotation, 1 is reverse rotation
56
57 |=**Code**|=**Parameter Name**|=**Property**|=(((
58 **Effective**
59
60 **Time**
61 )))|=**Range**|=**Function**|=**Unit**|=**Default**
62 |P0-4|(((
63 Rotating direction
64
65 selection
66 )))|At stop|(((
67 Power-on
68
69 again
70 )))|0~~1|(((
71 Forward direction:viewed from the motor shaft.
72
73 0: CW direction as the forward direction
74
75 1: CCW direction as the
76
77 forward direction
78 )))|-|0
79
80 **Step 3**: Set the value of function code P6-04 to 1. 0 is the hardware DI_1 channel, which requires wiring; 1 is the virtual DI_1 channel,no wiring is required.
81
82 |=**Code**|=**Function**|=**Effective time**|=**Default**|=**Range**|=**Description**
83 |P13-1|Virtual VDI_1 input value|▲|0|0-1|(((
84 VDI1 input level:
85
86 0: low level. 1: high level.
87 )))
88
89 **Step 4**: Set the value of the function code P13-1 to choose whether VDI1 is valid at high or low levels.
90
91 (% class="box infomessage" %)
92 (((
93 **✎Note:** the value of function code P6-02 should be set to 1. Only in this way can the motor rotate.
94 )))
95
96 |=**Code**|=**Function**|=**Effective time**|=**Default**|=**Range**|=**Description**|=**Unit**
97 |P6-02|DI_1 function selection|△|1|0-16|(((
98 1: SON, Servo ON
99
100 2: A-CLR, Fault and warning clear
101
102 3: POT, Forward limit switch
103
104 4: NOT, Reverse limit switch
105
106 5: ZCLAMP, Zero speed clamp
107
108 6: CL, Clear the position deviation
109
110 7: C-SIGN, Instruction negation
111
112 8: E-STOP, Emergency stop
113
114 9: GEAR-SEL, Electronic gear switching 1
115
116 10: GAIN-SEL, Gain switch
117
118 11: INH, Position reference inhibited
119
120 12: VSSEL, Damer control switch(not implemented yet)
121
122 13: INSPD1, Internal speed command selection 1(not implemented yet)
123
124 14: INSPD2, Internal speed command selection 2(not implemented yet)
125
126 15: INSPD3, Internal speed command selection 3(not implemented yet)
127
128 16: J-SEL, Inertia ratio switch(not implemented yet)
129 )))|
130
131 == PLC Project ==
132
133 [[image:image-20220729134604-3.png]]
134
135 == Explanation ==
136
137 The program uses M0,M1,M2 as the switch button of three modes of actions.
138
139 When M0 is turned on, the Y0 servo motor rotates 5000 pulses in the direction of Y3.
140
141 When M1 is turned on, the Y0 servo motor rotates 20,000 pulses at the speed of 4,000 pulses, and Y3 represents the direction of the motor.
142
143 When M2 is turned on, the Y0 servo motor moves to the absolute position of 2000 at the speed of 4000 pulses, and Y3 represents the direction of the motor.
144
145 ----
146
147 == PLC demos download ==
148
149 [[Position control mode>>url:http://backup.we-con.site/wiki/servo/download/3.%20Demos/01%20VD1%2FVD2%20Servo%20Position%20control/WebHome/Position%20control%20mode.wcp?rev=1.1]]
150
151 = 5 VD2 Multi-position mode =
152
153 == Version ==
154
155 (% class="wikigeneratedid" %)
156 Only SA(absolute servo) series servo can support multi-position mode.
157
158 Only firmware version U2-4 is 1.10 or more can support multi-position mode.
159
160 (% style="text-align:center" %)
161 [[image:1639116818619-611.png||height="355" width="800" class="img-thumbnail"]]
162
163 == Demo: control 2 internal position ==
164
165 **Parameter**
166
167 * P0-1=1 position mode
168 * P0-16=10000 one circle pulse of motor
169 * P1-6=1 Position source: Internal position mode
170 * P6-2=20 enabe signle of intenal position mode
171 * P6-3, P6-4 depend on your requirement
172 * P6-5=21
173 * P6-6,P6-7 depend on your reuqirement
174 * P6-8=22
175 * P6-9,P6-10 depend on your reuqirement
176
177 If you select P6-4=VDI1,P6-7= VDI2,P6-10= VDI3,please control trigger virtual port with P13 group parameter
178
179 Please check detail information about 21 22 23 24 command in the [[6.2.1 Position instruction input setting>>url:http://docs.we-con.com.cn/wiki/servo/view/2.%20User%20Manual/VD2%20SA%20Series%20User%20Manual/06%20Operation/#H6.2.1Positioninstructioninputsetting]]
180
181 As below:
182
183 In this operation mode, the next operation position number can be set when operating the current position number. There is no waiting time between each position, and the interval time is determined by the instruction delay of the host computer. The operationg position number is determined by the DI terminal logic, and the related function codes are shown in Table 6-16.Table 6-16.
184
185 |=**DI function code**|=**Function name**|=**Function**
186 |21|Internal multi-position selection 1|To form a multi-position operation position number
187 |22|Internal multi-position selection 2|To form a multi-position operation position number
188 |23|Internal multi-position selection 3|To form a multi-position operation position number
189 |24|Internal multi-position selection 4|To form a multi-position operation position number
190
191 Table 6-16 DI function code
192
193 The multi-position position number is a 4-digit binary number, and the DI terminal logic is level valid. When the input level is valid, the position selection bit value is 1, otherwise it is 0. Table6-17 shows the correspondence between the position bits 1~~4 of the internal multi-position and the position number.
194
195 |=**Internal multi-position position selection 4**|=**Internal multi-position position selection 3**|=(((
196 **Internal multi-position position selection 3**
197 )))|=(((
198 **Internal multi-position position selection 3**
199 )))|=**Operating position number**
200 |0|0|0|0|1
201 |0|0|0|1|2
202 |0|0|1|0|3
203 |(% colspan="5" %)…………
204 |1|1|1|1|16
205
206 Table 6-17 Correspondence between position selection and position number in internal multi-position