Wiki source code of 3 Demo

Last modified by Jim on 2023/03/04 16:43

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