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! > Machine Controllers Software and Solutions > LinuxCNC (formerly EMC2)


LinuxCNC (formerly EMC2) Discuss LinuxCNC (formerly EMC2) Controlers here!


This forum is sponsored by:

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Ban this user!
Old 08-02-2009, 02:17 PM
 
Join Date: Apr 2004
Location: Martinez, CA
Posts: 40
Ryobiguy is on a distinguished road
Awful g33 spindle synchronization

Hello,
I've setup EMC with a manual lathe that I've fitted with a stepper motor and simple gear tooth sensor as an encoder. I'm getting awful spindle synchronization, I think it is bad trajectory planning since stepgen is keeping up with what it is told to do. For the first half an inch or so, the stepper does jerky accel/decel cycles and eventually converges on the approximate spindle-synched feed rate.
Here's a HAL scope screengrab, it is very dramatic. Green straight line is spindle-revs (showing it's relatively stable,) and curved lines are both the commanded position and the stepgen's feedback position. It's almost like the motion generation has a PID that needs tuning. What I'd expect is an initial acceleration to get up to speed, and then a decel to match the synchronized speed. Instead, it alternates between too fast and too slow, each time a little less off of the ideal synchronized speed, until it eventually sounds like it's converging (awful noisy stepper.)


I had to hack the encoder HAL module to generate the index pulse, which it's possible is the cause of the problem, but as far as I can tell it works correctly: spindle-revs increases steadily, spindle-index-enable gets set high by controller on g33, and encoder sinks it at the appropriate time. Also spindle-velocity seems correct

I've tried looking around at all the tunable parameters in the .ini and hal files, but I couldn't find anything that makes much difference. I'm truly stuck.

Any suggestions?

-Matt

P.S. A few numerical ballparks: encoder 66 pulse/rev (plus synthetic index pulse,) 4000 steps/inch, RPM was probably 100-200, thread pitch (K in g33) was 0.0625, step accel set to about 9, max velocity 1. I think base thread was 40us, servo thread maybe 800 us or so.
Reply With Quote

  #2   Ban this user!
Old 08-02-2009, 07:44 PM
 
Join Date: Jan 2009
Location: USA
Posts: 234
CalG is on a distinguished road

Try it at 5-10 rpm and see if the processor can keep up, or it may be the quality of the encoder signals.

The emc user form is a great place to ask this question!
emc-users@lists.sourceforge.net

CalG
Reply With Quote

  #3   Ban this user!
Old 08-02-2009, 10:45 PM
 
Join Date: Nov 2005
Location: Canada
Posts: 465
chester88 is on a distinguished road

Why did you hack the encoder module?
What did you want/need that it didn't support?
Just off hand I would look at the acceleration and max velocity settings.
As CalG said try really slow rpm and see if the tracking improves.
Reply With Quote

  #4   Ban this user!
Old 08-02-2009, 11:42 PM
Zig Zig is offline
 
Join Date: Mar 2008
Location: Australia
Posts: 237
Zig is on a distinguished road

If that were a classic PID controller i would have said cut back on integral coefficient... the loop is almost unstable
Reply With Quote

  #5   Ban this user!
Old 08-02-2009, 11:47 PM
 
Join Date: Apr 2004
Location: Martinez, CA
Posts: 40
Ryobiguy is on a distinguished road

I had to hack the encoder HAL module to generate the index pulse
To expand from my original post: There is just a single channel spindle sensor with no index, feeding a "phase A" signal into the encoder which is in counter mode. So I hacked the encoder module to create a synthetic index each time it counts the number of pulses/rev (the number of teeth on the sensed gear.)
This was required because g33 waits for spindle index so each pass is synchronized.

Sensor setup is fine - I've used it for quite awhile with my own lathe module I wrote for the HAL system. So I'm new to using the actual machine controller in EMC.

I tried at lower and lower spindle speeds - it doesn't seem to be a matter of the processor keeping up, and it doesn't seem to be a matter of step accel/velocity limits. It seems to be that EMC is trying to reach a moving target and isn't planning ahead correctly.
I did try playing around with accel/velocity in both axis and global config, but that didn't seem to make any difference. I was hoping there was some setting that can simply be tweaked to fix it, but I couldn't find anything that made any difference.

-Matt
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 08-03-2009, 12:01 AM
Zig Zig is offline
 
Join Date: Mar 2008
Location: Australia
Posts: 237
Zig is on a distinguished road

Mat,

So the spindle encoder outputs a pulse per revolution.

Is there a way of synchronising speed of spindle to the individual tooth pulses and then using the synthetic index for final positional locking?

In other words increase the update rate to the velocity control of the spindle with regards to the other axis ( ie keep the spindle slaved to the other axis ) and on top of that velocity feedback loop implement positional loop using the synthetic index.
Reply With Quote

  #7   Ban this user!
Old 08-03-2009, 12:03 AM
 
Join Date: Mar 2004
Location: St. Louis, MO
Posts: 309
jmelson is on a distinguished road

Originally Posted by Ryobiguy View Post
Hello,
I've setup EMC with a manual lathe that I've fitted with a stepper motor and simple gear tooth sensor as an encoder. I'm getting awful spindle synchronization, I think it is bad trajectory planning since stepgen is keeping up with what it is told to do.
I think your problem is the trajectory planner needs to run at the servo rate.

In your .HAL file, ther is probably a long line that looks like this :
loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD traj_period_nsec=[EMCMOT]SERVO_PERIOD key=[EMCMOT]SHMEM_KEY

Note that in my file, traj_period_nsec is set to SERVO_PERIOD, you likely have it set to TRAJ_PERIOD, which is slower, typically 5:1 slower.

If you are using an old version of EMC2, you should update, as some substantial improvements were put in sometime early this year, and a big improvement went in in the summer of 2007 at the CNC Workshop/EMC Fest.

Jon
Reply With Quote

  #8   Ban this user!
Old 08-03-2009, 02:04 AM
 
Join Date: Apr 2004
Location: Martinez, CA
Posts: 40
Ryobiguy is on a distinguished road

Originally Posted by Zig View Post
Mat,

So the spindle encoder outputs a pulse per revolution.

Is there a way of synchronising speed of spindle to the individual tooth pulses and then using the synthetic index for final positional locking?

In other words increase the update rate to the velocity control of the spindle with regards to the other axis ( ie keep the spindle slaved to the other axis ) and on top of that velocity feedback loop implement positional loop using the synthetic index.
Hi Zig,
I previously implemented a HAL module with just the goal of having a stepper driven leadscrew for manual lathe work, to get around not having a set of change gears and threading dial:
http://www.fricktion.net/~mfrick/lat...lsDoc_v0_1.pdf
The stepper output is a strict interpolation of the spindle encoder, assuming encoder pulse intervals are constant. Emphasis is on locking position rather than trying to match the right proportional speed.

-Matt
Reply With Quote

  #9   Ban this user!
Old 08-03-2009, 02:17 AM
 
Join Date: Apr 2004
Location: Martinez, CA
Posts: 40
Ryobiguy is on a distinguished road

Originally Posted by jmelson View Post
I think your problem is the trajectory planner needs to run at the servo rate.
That's exactly what it sounds like!
I don't have a traj_period_nsec setting - I'm running latest 2.3.4~pre built from source code I fetched a few days ago. I searched through the code and it looks like it defaults to the servo period if left unspecified.

Good avenue to investigate though, it sure seems like somethings not happening frequently enough.

-Matt
Reply With Quote

  #10   Ban this user!
Old 08-03-2009, 03:08 AM
Zig Zig is offline
 
Join Date: Mar 2008
Location: Australia
Posts: 237
Zig is on a distinguished road

Matt,

I am not qualified to comment on your electronic screw algorithm.

I just want to highlight the fact that if You are interested in zero positional error ( type 0 system ) You need to provide velocity feedback.

Similarly if You wish to see zero velocity error ( type 1 system) you need to provide acceleration feedback.

In other words for the loop to track a parameter it needs an estimation of the first derivative of the parameter.

Hence my comment provide velocity feed back as well in order to have zero positional error.

For type number.. http://books.google.com.au/books?id=...20loop&f=false
Reply With Quote

Sponsored Links
  #11   Ban this user!
Old 08-03-2009, 11:22 AM
 
Join Date: Apr 2004
Location: Martinez, CA
Posts: 40
Ryobiguy is on a distinguished road

Hi Zig,
Fascinating book there, I'll have to read through it. Ouch, I guess the $186 price tag reflects that it's for a limited audience. Lets see how much Google books lets me read.

The controller has the encoder spindle-revs, and could figure out the velocity from that. I'm not sure at all how the guts of the machine controller work.

I did see some info that suggested the spindle-velocity signal (fed from encoder) is used only on rough work like feed per rev rather than spindle synchronized operations.

-Matt
Reply With Quote

  #12   Ban this user!
Old 08-03-2009, 05:59 PM
Zig Zig is offline
 
Join Date: Mar 2008
Location: Australia
Posts: 237
Zig is on a distinguished road

Hello Matt,

It has been over 30 years since I last looked at these issues seriously.

My refferences back then were a book by D'azzo and Houpis in the area of ananlog controls and Smith in the the digital and hybrid process control.

My controls systems lecturer used to work at the Government Aircraft factories and was involved in some interesting remote control work back then ( when Australia had a world class rocket program ).
Reply With Quote

Reply

Tags
emc threading g33




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 On
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need Help!- Spindle Synchronization M480??? Ecmdrw5 G-Code Programing 1 07-02-2009 12:29 PM
My awful story Dale Heart CNC Plasma and Waterjet Machines 12 01-01-2009 11:27 AM
Need Help!- synchronization of 3 servo motor using interpolation eureka Servo Motors and Drives 0 11-11-2008 09:05 AM
phase synchronization? maximusek CNC Swiss Screw Machines 0 12-18-2007 06:39 AM
Evil, Awful, Hateful Crap! jim_stoll Benchtop Machines 33 11-15-2007 04:15 PM




All times are GMT -5. The time now is 05:10 AM.





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