Wiki source code of 6.2 Speed Control

Last modified by Wecon on 2025/09/03 21:03

Hide last authors
Wecon 1.1 1 Speed control refers to control the speed of the machine through the speed reference. Through internal digital setting, analog voltage or communication, the servo drive could achieve fast and precise control of the mechanical speed. Therefore, the speed control mode is mainly used to control the rotation speed, or use the host controller to realize the position control, and the host controller output is used as the speed reference, such as analog engraving and milling machine.
2
3 The speed control block diagram is **as follows:**
4
5 [[image:1617847349362-165.png||height="229" width="717"]]
6
7 Figure1 speed control diagram
8
9 Set the parameter P0-1 to 2 through the panel or debugging tool on PC to make the servo drive work in speed control mode.
10
11 **Relevant function code**:
12
13 |=**Code**|=**Parameter Name**|=**Property**|=(((
14 **Effective**
15
16 **Time**
17 )))|=**Range**|=**Function**|=**Unit**|=**Default**
18 |P0-1|Control mode (default setting)|At stop|Power-on again|1~~10|(((
19 1: Position control mode
20
21 2: Speed control mode
22
23 3: Torque control mode
24 )))|-|1
25
26 = **Speed Reference Input Setting** =
27
28
29
30 [[image:6.2 Speed Control Mode_html_a8629780ec434b3f.jpg||height="298" width="456"]]
31
32 Speed Reference Source
33
34 There are two sources of speed reference in speed control mode, which could be set by [P1-1].
35
36 **Relevant function code:**
37
38 |=**Code**|=**Parameter Name**|=**Property**|=(% colspan="2" %)(((
39 **Effective**
40
41 **Time**
42 )))|=**Range**|=**Function**|=**Unit**|=**Default**
43 |P1-1|Speed command source|(% colspan="2" %)At stop|Immediate|0~~1|(((
44 0: Internal speed command (set in P1-3).
45
46 1: AI_1 analog input.
47 )))|-|0
48
49 Internal speed reference
50
51 Set the speed value through the function code [P1-2] as the speed reference.
52
53 **Relevant function codes**:
54
55 |=**Code**|=**Parameter Name**|=**Property**|=(((
56 **Effective**
57
58 **Time**
59 )))|=**Range**|=**Function**|=**Unit**|=**Default**
60 |P1-2|Internal speed command|During running|Immediate|-3000~~3000|Internal speed command|rpm|100
61
62 Analog voltage input as a reference
63
64 Take the analog voltage signal output by the host controller or other equipments, processed as a speed reference.
65
66 **Analog voltage setting method**:
67
68 [[image:6.2 Speed Control Mode_html_d0878df502c2834c.jpg||height="812" width="237"]]
69
70 Figure 2 flowchart of setting speed reference by analog voltage
71
72 **Glossary**:
73
74 **Zero drift: **Value of the servo drive sampling voltage relative to GND when the input
75
76 voltage of the analog channel is zero.
77
78 **Offset: **Input voltage value of the analog channel when the sampling voltage is zero after
79
80 zero drift correction.
81
82 **Dead zone: **Input voltage range of the analog channel when the sampling voltage is zero.
83
84 [[image:6.2 Speed Control Mode_html_8240b9b6679fce55.jpg||height="402" width="679"]]
85
86 Figure 3 Analog signal after-offset
87
88 After completing the correct settings, you could view the input voltage values of AI_1 and AI_2 through U0-21 and U0-22
89
90 |=**Code**|=**Function**|=**Unit**|=**Format**
91 |U0-21|AI1 input voltage value|V|decimal(3 decimal digits)
92 |U0-22|AI2 input voltage value|V|decimal(3 decimal digits)
93
94 **Relevant function codes**:
95
96 |=**Code**|=**Parameter Name**|=**Property**|=(((
97 **Effective**
98
99 **Time**
100 )))|=**Range**|=**Function**|=**Unit**|=**Default**
101 |P5-1|AI_1 input bias|During running|Immediate|-5000~~5000|Set AI_1 channel analog offset value|mv|0
102 |P5-2|AI_1 Input filter constant|During running|Immediate|0~~65535|AI_1 channel input first-order low-pass filtering time constant|ms|200
103 |P5-3|AI_1 dead zone|During running|Immediate|0~~1000|Set AI_1 channel analog dead zone value|mv|20
104 |P5-4|AI_1 zero drift|During running|Immediate|-500~~500|Automatic calibration zero drift inside the driver.|mv|0
105 |P5-5|AI_2 input bias|During running|Immediate|-5000~~5000|Set AI_2 channel analog offset value|mv|0
106 |P5-6|AI_2 Input filter constant|During running|Immediate|0~~60000|AI_2 channel input first-order low-pass filtering time constant|ms|200
107 |P5-7|AI_2 dead zone|During running|Immediate|0~~1000|Set AI_1 channel analog dead zone value|mv|20
108 |P5-8|AI_2 zero drift|During running|Immediate|-500~~500|Automatic calibration zero drift value inside the driver|mv|0
109 |P5-9|Analog 10V for speed value|At stop|Immediate|1000~~4500|Set the speed value corresponding to analog 10V|rpm|3000
110 |P5-10|Analog 10V for torque value|At stop|Immediate|0~~3000|Set the torque value corresponding to analog 10V|0.1%|1000
111
112 = **Acceleration and deceleration time setting** =
113
114 The acceleration/deceleration time setting refers to convert a speed command with a relatively high acceleration into a speed command with a relatively gentle acceleration, so as to achieve the purpose of controlling the acceleration.
115
116 In the speed control mode, excessive acceleration of the speed command would cause the vibration. At this time, increase the acceleration or deceleration time to achieve a smooth speed change of the motor and avoid mechanical damage caused by the above situation.
117
118 [[image:6.2 Speed Control Mode_html_c48a78e9d3b0a51c.jpg||height="344" width="534"]]
119
120 Figure 4 diagram of acc. and dec. time
121
122 Actual acceleration time T1 = speed reference / 1000 * acceleration time
123
124 Actual deceleration time T2 = speed reference / 1000 * deceleration time
125
126 **Relevant function codes**:
127
128 |=**Code**|=**Parameter Name**|=**Property**|=(((
129 **Effective**
130
131 **Time**
132 )))|=**Range**|=**Function**|=**Unit**|=**Default**
133 |P1-3|Acc. time|During running|Immediate|0~~65535|Acceleration time from 0 to 1000rpm in speed command mode|ms|50
134 |P1-4|Dec. time|During running|Immediate|0~~65535|Deceleration time from 1000 to 0 rpm in speed command mode|ms|50
135
136 = **Speed Reference Limitation** =
137
138 The servo drive could display the value of the speed reference in speed mode.
139
140 Sources of speed instruction limits include:
141
142 **[P1-10]: **Set the maximum speed limit value
143
144 **[P1-12]:** Set forward speed limit value
145
146 **[P1-13]: **Set the reverse speed limit value
147
148 **Maximum motor speed:** determined according to the model of the motor
149
150 ~| The amplitude of the forward speed reference | ≤ min {Max. motor speed, P1-10, P1-12}
151
152 ~| The amplitude of the negative speed reference | ≤ min {Max. speed of the motor, P1-10, P1-13}
153
154 **Relevant function codes:**
155
156 |=**Code**|=(% style="width:202px" %)**Parameter Name**|=(% style="width:131px" %)**Property**|=(% style="width:151px" %)(((
157 **Effective  Time**
158 )))|=(% style="width:87px" %)**Range**|=(% style="width:295px" %)**Function**|=**Unit**|=**Default**
159 |P1-10|(% style="width:202px" %)Max speed threshold|(% style="width:131px" %)During running|(% style="width:151px" %)Immediate|(% style="width:87px" %)0~~5000|(% style="width:295px" %)Set the maximum speed limit value.|rpm|3600
160 |P1-12|(% style="width:202px" %)Forward speed threshold|(% style="width:131px" %)During running|(% style="width:151px" %)Immediate|(% style="width:87px" %)0~~3000|(% style="width:295px" %)Set forward speed limit|rpm|3000
161 |P1-13|(% style="width:202px" %)Reverse speed threshold|(% style="width:131px" %)During running|(% style="width:151px" %)Immediate|(% style="width:87px" %)0~~3000|(% style="width:295px" %)Set reverse speed limit|rpm|3000
162
163 **6.3.4 Zero Speed Clamp Function**
164
165 Zero speed clamping function means that when the zero speed clamping signal (ZCLAMP) is valid, when the absolute value of the speed reference is lower than the zero speed clamping speed value, the servo motor is in the locked state. At this time, the servo drive is in position lock mode, and the speed reference is invalid.
166
167 **Relevant function codes:**
168
169 |=(% style="width:63px" %)**Code**|=(% style="width:178px" %)**Parameter Name**|=**Property**|=(% style="width:136px" %)(((
170 **Effective Time**
171 )))|=(% style="width:84px" %)**Range**|=(% style="width:404px" %)**Function**|=**Unit**|=**Default**
172 |(% style="width:63px" %)P1-21|(% style="width:178px" %)Zero speed clamp function selection|During running|(% style="width:136px" %)Immediate|(% style="width:84px" %)0~~3|(% style="width:404px" %)(((
173 Set the zero speed clamp function. In speed mode:
174
175 0: Force speed to 0.
176
177 1: Force the speed to 0, and keep the position locked when the actual speed is less than [P1.22].
178
179 2: When the speed reference is less than [P1-22], force the speed to 0 and keep the position locked.
180
181 3: Invalid, ignore the zero speed clamp input.
182 )))|-|0
183 |(% style="width:63px" %)P1-22|(% style="width:178px" %)Speed threshold for zero|During running|(% style="width:136px" %)Immediate|(% style="width:84px" %)0~~1000|(% style="width:404px" %)Set the speed threshold of the zero speed clamp function|rpm|20
184
185 [[image:6.2 Speed Control Mode_html_61e92ce6c2ee6f6d.jpg||height="467" width="722"]]
186
187 Figure 5 Zero Speed Clamp waveform
188
189 = **Speed-relevant DO Signals** =
190
191 Different DO signals are output to the host controller based on comparison between the speed feedback after filter and different thresholds. We need to assign different function for the DO terminals and set the valid logic.
192
193 Motor Rotation DO Signal
194
195 After the speed reference is filtered, the absolute value of the actual speed of the servo motor reaches [P5-16] (rotation detection speed threshold), then the motor is considered to be rotating. At this time, the DO terminal of the servo drive could output a rotation detection signal. Conversely, when the actual rotation speed of the servo motor does not reach [P5-16], it is considered that the motor is not rotating.
196
197
198
199 [[image:6.2 Speed Control Mode_html_8705095c118de5ed.jpg]]
200
201 Figure 6-14 motor rotation DO signal
202
203 **Relevant function codes**:
204
205 |=**Code**|=**Parameter Name**|=**Property**|=(((
206 **Effective**
207
208 **Time**
209 )))|=**Range**|=**Function**|=**Unit**|=**Default**
210 |P5-16|Rotation detection speed threshold|During running|Immediate|0~~1000|Set motor rotation signal judgment threshold|rpm|20
211 |P6-26|DO_1 function selection|During running|Immediate|128~~142|132-TGON rotation detection|-|131
212
213 Zero speed signal
214
215 The absolute value of the actual speed of the servo motor is less than a certain threshold [P5-19], it is considered that the servo motor stops rotating, and the DO terminal of the servo drive could output a zero speed signal at this time. Conversely, if the absolute value of the actual speed of the servo motor is not less than this value, it is considered that the motor is not at a standstill and the zero speed signal is invalid.
216
217 [[image:6.2 Speed Control Mode_html_3ac63328ba7bf6a9.jpg||height="385" width="618"]]
218
219 Figure 6 zero speed signal waveform
220
221 **Relevant function codes:**
222
223 |=**Code**|=**Parameter Name**|=**Property**|=(((
224 **Effective**
225
226 **Time**
227 )))|=**Range**|=**Function**|=**Unit**|=**Default**
228 |P5-19|Zero speed output signal threshold|During running|Immediate|0~~6000|Zero speed output signal threshold|rpm|10
229 |P7-18|DO_1 function selection|During running|Power on again|128~~142|133-ZSP zero speed signal|-|132
230
231 Speed Consistent DO Signal
232
233 In speed control, when the absolute value of the difference between the motor speed after filter and the speed reference satisfies the setting of [P5-17], the actual motor speed is considered to reach the speed reference. At this moment, the servo drive outputs the speed consistent signal. When the absolute value of the difference between the motor speed after filter and the speed reference exceeds the setting of [P5-17], the speed consistent signal is inactive.
234
235 [[image:6.2 Speed Control Mode_html_3e24dd8a30cb7a80.jpg||height="279" width="458"]]
236
237 Figure 7 Speed Consistent Waveform
238
239 **Relevant function codes:**
240
241 |=**Code**|=**Parameter Name**|=**Property**|=(((
242 **Effective**
243
244 **Time**
245 )))|=**Range**|=**Function**|=**Unit**|=**Default**
246 |P5-17|Speed consistent signal threshold|During running|Immediate|0~~100|Set the speed consistent signal threshold|rpm|10
247 |P7-18|DO_1 function selection |During running|Immediate|128~~142|135-V-COIN speed consistent|-|135
248
249 Speed Reached DO Signal
250
251 When the absolute value of the motor speed after filter exceeds the setting of[P4-16],the motor speed is considered to reach the desired value. At this moment, the servo drive outputs the speed reached signal. When the absolute value of the motor speed after filter is smaller than or equal to the setting of[P4-16], the speed reached signal is inactive.
252
253 [[image:6.2 Speed Control Mode_html_cb697a599b98a07.jpg||height="246" width="456"]]
254
255 Figure 6-17 Speed reached signal waveform
256
257 **Relevant function codes:**
258
259 |=**Code**|=**Parameter Name**|=**Property**|=(((
260 **Effective**
261
262 **Time**
263 )))|=**Range**|=**Function**|=**Unit**|=**Default**
264 |P5-18|Speed approaching signal threshold|During running|Immediate|10~~6000|Speed reached signal threshhold|rpm|100
265 |P7-18|DO_1 function selection |During running|Power on again|128~~142|136-V-NEAR speed near |-|136