CNCzone.com-The Largest Machinist Community on the net!



Home Page Mark Forums Read Today's Posts My Replies Classifieds Reviews Photo Gallery Web Links Share Files Advertise With Us Ad List
Go Back   CNCzone.com-The Largest Machinist Community on the net! > Electronics > General Electronics Discussion


General Electronics Discussion Discuss basic electronics, power supplies and anything else electronic related here.


This forum is sponsored by:

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Ban this user!
Old 11-09-2004, 12:37 PM
 
Join Date: Oct 2003
Location: Sweden
Age: 34
Posts: 398
arvidb is on a distinguished road
PID loop sample rates and resolution

I'm out on uncharted water (for me at least) here... any comments appreciated.

I'm not sure how to design the servo controller I'm building. It should have nested PID loops with the inner loop controlling speed and the outer controlling position. For this I need to measure speed and position.

Position is easy: just keep track of encoder counts. Speed will also be measured with the help of the encoder, but how long should the sample time be, and at what resolution?

Just as an example: maximum encoder count rate 2 MHz. 12 bit speed data: +/-2047 gives sample time of just over 1 ms (1 kHz) for the speed loop.

The position loop should be run slower than this to allow the speed loop to react to its commands. Question is, how much slower? Let's say 10 times, which gives an update/sample rate of position of 100 Hz.

As an example of time constants for a servo motor, my 200 W motors have 5.4 ms inductive time constant and 0.4 ms inertia time constant (free running so will of course be a lot higher when connected to a machine).

Now since this will be a discrete PID controller it should have a sample rate of >10 times the bandwidth of the system it controls - I think. I have no idea how to relate this to the time constants mentioned above.

Also, will the rates mentioned above be fast enough to react to disturbances (like a tooth biting into material)?

?

Arvid
Reply With Quote

  #2   Ban this user!
Old 11-09-2004, 05:00 PM
bunalmis's Avatar  
Join Date: Jul 2003
Location: Turkey
Posts: 246
bunalmis is on a distinguished road

5.4 ms inductive time constant and 0.4 ms inertia time constant
0.4ms must be 0.4 sec.

1msec speed servo loop time and 100 msec position servo loop time enough for your application.

But if you want to draw circle by 2 pid controller and motors your position servo loop time must decrease (1msec)

At the past I have same question therfore I used 100 micro sec for the position servo loop time.

If I want to design new digital pid controller I select 1msec servo update time for position servo. Because I read following talented article.

http://www.control.com/Papers/mc-ic_html

This is same type question.

http://www.control.com/1026178513/index_html

1msec very long time for 2MHZ encoder pulses this is true but PID need error.

Also this article really good.

http://www.control.com/944512714/index_html

Last edited by bunalmis; 11-09-2004 at 05:14 PM.
Reply With Quote

  #3   Ban this user!
Old 11-09-2004, 05:43 PM
 
Join Date: Jul 2003
Location: north wales,u.k
Posts: 46
mmjpotter is on a distinguished road

I think a 1kHz position loop and a 100kHz speed loop should provide good control for general machining applications, but I'm not sure that the same encoder can feed both loops. Don't you think the speed loop will require a much higher resolution?
__________________
mike potter
Reply With Quote

  #4   Ban this user!
Old 11-10-2004, 05:05 AM
 
Join Date: Oct 2003
Location: Sweden
Age: 34
Posts: 398
arvidb is on a distinguished road

bunalmis: thanks for those links! They were great! They seem to indicate that 100 Hz position servo update rate and 1 kHz speed update rate should be adequate. But you suggest 1 kHz position loop update rate? Is this just to be on the safe side?

Mike: you also suggest 1 kHz position loop update rate. This then would require at least 10 kHz speed loop update rate, I guess? 100 kHz would be even better, of course. It would be great if you could elaborate on this a bit.

It should be possible to measure speed with the encoder - I have seen papers describing it. Look at application notes for TI motor control DSPs for example. There are (at least) two ways to measure speed with an encoder:

1) Count encoder counts in a certain time span, or
2) Measure time between encoder counts.

1) seems easier to implement to me; just count during 1 ms and the number of counts is directly proportional to the speed. If max encoder count rate is 2 MHz this gives 12 bits of resolution (-2 MHz to 2 MHz <=> -2000 to +2000 counts). Here resolution is proportional to sampling time, but longer sampling time means older information.

The resolution here would be 1 kHz, or 60 RPM with a 250 pulse/rev encoder. If top speed is 3000 RPM this is equivalent to less than 7 bits of resolution. Enough? I don't know. With my 2048 pulse/rev encoders and 4500 RPM top speed, I would get >10 bit effective resolution.

2) I guess is a bit more difficult to implement: speed = (counter freq)/(counter counts between encoder counts) * (scale factor). I guess it would also require filtering of some sort. The faster the encoder count rate, the shorter the time required to measure. Resolution? Max resolution should be limited by counter frequency (could easily be 20 MHz).

But what about slow speeds? I guess a new encoder count is not required between each reading of the speed (and update of speed loop). If no new encoder count has been received, we know that the speed cannot have increased (much), so the old slow speed measurement should still be valid (?). If we allow the counter to be, say, 24 bits, a whole second could pass between each encoder count and we would still get a valid reading.

I recall that in at least one of the application notes mentioned above they switched between the different methods depending on the current speed.

Now that I write this, I can really see the benefits of method 2), so I guess that's the way to go. Unless I have missed something? Hmm...

Arvid
Reply With Quote

  #5   Ban this user!
Old 11-10-2004, 05:41 AM
bunalmis's Avatar  
Join Date: Jul 2003
Location: Turkey
Posts: 246
bunalmis is on a distinguished road

Yes you can use incremental shaft encoder instead of tachometer.

But encoder dont give good results for precision servo. Therefore we must use
tacho + shaft encoder. (My idea)

Did you see any professional servo systems without tacho? (Big cnc controller)

I think Texas Instr. suggest shaft encoder but this suggestion for not precision motor drivers. (for speed control of 3 pahese asynchron motor and brushless motors) Our application need more precision.

If you don't need more precise servo you can use single position loop.
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 11-10-2004, 02:16 PM
 
Join Date: Oct 2003
Location: Sweden
Age: 34
Posts: 398
arvidb is on a distinguished road

Motorola Application Note AN1931 describes speed regulation of a 3-ph PM motor with only encoder feedback.

My Yaskawa servos (SIGMA series) claims speed regulation range of 1:5000 with load regulation of 0.01 % at rated speed, over 0-100 % load. This is also with encoder only (2048 pulses/rev = 8192 counts/rev). They don't mention regulation at lower speeds though. They also don't say anything about how fast it reacts to load changes.

The Gecko drives use position loop only, don't they? And if they work for many people, then at least I'm gonna think more about the possibilities to implement a speed loop with encoder as feedback device. It should give even better results than the Geckos, and it would be interesting!

Arvid
Reply With Quote

  #7   Ban this user!
Old 11-10-2004, 02:58 PM
bunalmis's Avatar  
Join Date: Jul 2003
Location: Turkey
Posts: 246
bunalmis is on a distinguished road

Steady state error importand but transient responce more importand.
We can use position encoder if we interest by only steady state responce of speed application. (This application may be video and voice recorders, CD/ RW, hard disks)

But cnc servo positions system need very low tracking error.

Therefore i think fast and precision servo systems use tacho generator for inner loop. (?)

I dont know the error of Gecko while system fly. I remember Gecko has 128 bit overflow counter. Therefore error may max 127 count on the fly.

Who can say ? Does axis motors of industrial big CNC machine use tacho? Else are there only shaft encoder ?
Reply With Quote

  #8  
Old 11-10-2004, 04:41 PM
*Registered*
 
Join Date: Apr 2004
Location: Norway
Posts: 678
ESjaavik is on a distinguished road

My drives use resolvers. Which means the motor position is measured using an analog method. But of course it is digitized in the drive. It depends on the drive how high resolution it uses. It seems this is a widely used method. But it's not cheap.
Reply With Quote

  #9   Ban this user!
Old 11-10-2004, 05:44 PM
 
Join Date: Jul 2003
Location: north wales,u.k
Posts: 46
mmjpotter is on a distinguished road

I prefer tacho feedback and this is the method I use with my control.
Usdigital make an encoder/tacho called ETACH2 this has a sample rate of 10kHz and they claim no cogging or ripple at low speed. Have a look at this link www.usdigital.com/products/etach2 it might provide some ideas.
__________________
mike potter
Reply With Quote

  #10   Ban this user!
Old 11-12-2004, 09:18 AM
 
Join Date: Oct 2003
Location: Sweden
Age: 34
Posts: 398
arvidb is on a distinguished road

Mike, thanks for the link. It shows it should be possible to get by with only encoder feedback (deriving speed data from it). I guess I just have to try it!

Einar, arent resolvers a kind of analogue absolute encoders? I believe their useful resolution is relatively low (also kind of like a quad digital encoder).

I believe modern (expensive!) servo systems use sin-cos quadrature encoders. These are not resolvers, but have perhaps 2000 sin+cos cycles per revolution. With interpolation their useful resolution can be up around 1,000,000 counts per rev! So these can be used without problems to get both speed and position.

Arvid
Reply With Quote

Sponsored Links
  #11  
Old 11-12-2004, 05:09 PM
*Registered*
 
Join Date: Apr 2004
Location: Norway
Posts: 678
ESjaavik is on a distinguished road

The resolver is a rotating transformer fed by a sinewave signal on the input (rotor). Then it has 2 output windings that are 90 degrees out of phase with each other (sin-cos). Then the drive measure these voltages and can thus find the position of the rotor. Thus the resolution depends on the resolution of the conversion from the analog voltage to the digital part of the drive. The accuracy can be quite high, but the electronic parts needed are not simple, neither are they cheap. The resolver mounted on the motor contains no electronic parts. It's just a rotating transformer. So the only ways to destroy it are mechanically breaking it, or applying high enough voltage to break down the insulation or burn the windings. It is both mechanically and electronically tough. And it's low impedance.

But for making a DIY drive, it's probably not a good choice.
Reply With Quote

Reply




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





All times are GMT -5. The time now is 04:34 PM.





Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Content Relevant URLs by vBSEO
Template-Modifications by TMS

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