View Single Post
  #6  
Old 11-14-2004, 10:48 PM
Mariss Freimanis Mariss Freimanis is offline
Gold Member
 
Join Date: Mar 2003
Location: United States
Posts: 2,717
Mariss Freimanis is on a distinguished road

Tuning refers to adjusting the PID coefficients to cause a critically damped response from the motor / load when adjusting to a disturbance. Sounds complicated but it's not.

PID stands for Proportional, Integral and Differential. The "difference" error (where you should be versus where you are) is seperated into 3 channels (PID), then recombined. You perform this algorithm unconsciously when you drive a car.

Say you take a road trip from LA to San Francisco up I-5. Your task is to stay side-by-side next to the "command position" car on this trip. It can accelerate and stop instantly, you can't. Your gas pedal and brake (torque command) only adjusts acceleration and deceleration like in a real car.

At the start of the trip, both of you are stopped. The "command car" instantly accelerates to 85MPH (average to slow for what you see on I-5).

The first thing you notice is a lot of distance has opened up between you and the "command car". This is the Proportional component. You press on the gas and away we go. Your speed builds up and after a while the distance begins to close.

Your rate of closure is the derivative or Differential component. As long as the distance to the "command car' keeps opening, you press harder on the gas. As it closes, you ease up.

To close the distance, you have to go faster than the "command car". Otherwise you will never catch up.

You are now getting very near the "command car". Both the seperating distance and the rate of closure decreases towards zero so they are no longer of use. You have come off of the gas enough to nearly match its speed.

This is where the Integral component comes in. You are now side by side. You now adjust your speed based on inches of seperation. If you slightly edge into the lead, you ease off. If you slightly fall behind, you make up the difference. Rate of closure (differential) or seperating distance (Proportional) are too small to use.

Using this method (PID), you will arrive at your destination simultaneously even though hundreds of miles and hours of travel have elapsed. You do it naturally and unconsciously.

A mistuned servo (not enough D or too much P) by this analogy would have you overshoot the "command car", hit the brake, fall behind, over-accelerate and overshoot the "command car" again, over and over. Tough on your passengers and car (400 miles, 4 hours) and equally hard on your servo motor.

All sorts of other stuff works with this analogy. Two things come to mind.

1) Feed-forward compensated PID servos. This is where you are told ahead of time what the "command car" will do. You don't have to sit and watch in surprise when it suddenly takes off or changes direction; you are fore-armed with its future intentions. This somewhat makes up for time otherwise lost in catching up.

2) S-shaped accel/decel profiles. This keeps the 2nd derivative of velocity finite, minimizing the "jerk" factor. Again, you do this naturally driving a car.

Imagine you are cruising down a boulevard when the light up ahead changes from green to red. In is simple CNC program, you stand on your brake until you come to a stop. This would be very uncomfortable in real life.

When you decelerate in a car, you tense your muscles to balance against the deceleration G-force until you just counteract that force. When you come to a stop, deceleration abruptly dissapears along with its G-force. Your tensing against it does not though. The result is head and body bobbing back and forth until you find the new balance. Not comfortable.

What you actually do when coming to a stop is to tail-off on the brake pedal. Before coming to a stop you lessen the rate of deceleration (brake pedal pressure) to make it become zero as your speed approaches zero. This is an S-shaped decel curve.

Where it matters on your CNC machine is it eliminates ringing (head bobbing) at the beginning and end of acceleration and deceleration. This decreases wear and error.

Mariss
Reply With Quote

 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361