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 12-13-2008, 11:13 PM
 
Join Date: Mar 2007
Location: USA
Posts: 53
Lexx0001 is on a distinguished road
Spindle RPM control - Do I need an index pulse?

My mill spindle motor is a smaller one. What I want to do is add some feedback to it, so that it would stay at the speed I set, and not bog down the motor by slowing, or having to run it at too fast a speed so I melt whatever I'm machining.

Do I need to use both phase-A and the index pulse to read the rpm and control the motor? Would that give me the best results? I'm just looking for some insight from someone who has done something like this before.

I've seen a few examples that use analog voltage to control the motor. I can control this motor directly with pwm or pdm, right from the printer port. Also I don't recall any of them using PID.

I could very well just be confusing myself. Maybe it would work better to heat up the soldering iron and make something, but that seems rather inelegant.

Regards,
Bill K.
Reply With Quote

  #2   Ban this user!
Old 12-14-2008, 02:33 AM
 
Join Date: Mar 2005
Location: Finland
Posts: 58
Juka is on a distinguished road

Originally Posted by Lexx0001 View Post
My mill spindle motor is a smaller one. What I want to do is add some feedback to it, so that it would stay at the speed I set, and not bog down the motor by slowing, or having to run it at too fast a speed so I melt whatever I'm machining.

Do I need to use both phase-A and the index pulse to read the rpm and control the motor? Would that give me the best results? I'm just looking for some insight from someone who has done something like this before.

I've seen a few examples that use analog voltage to control the motor. I can control this motor directly with pwm or pdm, right from the printer port. Also I don't recall any of them using PID.

I could very well just be confusing myself. Maybe it would work better to heat up the soldering iron and make something, but that seems rather inelegant.

Regards,
Bill K.
Hello Bill,

C3 board will solve your problem... You only need one pulse/revolution, I think.
http://www.cnc4pc.com/Store/osc/prod...roducts_id=129

Juka
Reply With Quote

  #3   Ban this user!
Old 12-14-2008, 05:09 PM
 
Join Date: Nov 2005
Location: Canada
Posts: 465
chester88 is on a distinguished road

I would think an encoder component connected to a PID connected to the pwm component would do what you ask. The encoder component can be set to counter mode and then it only use one input (A) to count with. connect the velocity to the PID....
Reply With Quote

  #4   Ban this user!
Old 12-15-2008, 03:56 AM
 
Join Date: Mar 2007
Location: USA
Posts: 53
Lexx0001 is on a distinguished road

Juka, Thanks, interesting web site. I'm going to bookmark it. Fortunately I've been collecting odds and ends like encoders and such for parts of two centuries. Older printers especially are a good source of that kind of stuff.

Chester88, That's what I'm am thinking. The index pulse and phase A would be used if you want to know the position of the shaft, In this case, I don't care. I just want to know how long it takes to make a rotation. I suppose either the index or phase A would do that. But I'm wondering which work best, one pulse per rev or many, especially for a slightly underpowered motor.

I could just hook it up I suppose, but sometimes I like to know what I'm doing, and why.
Reply With Quote

  #5   Ban this user!
Old 12-15-2008, 05:24 PM
acondit's Avatar  
Join Date: Apr 2005
Location: USA
Posts: 1,774
acondit is on a distinguished road

Originally Posted by Lexx0001 View Post
Juka, Thanks, interesting web site. I'm going to bookmark it. Fortunately I've been collecting odds and ends like encoders and such for parts of two centuries. Older printers especially are a good source of that kind of stuff.

Chester88, That's what I'm am thinking. The index pulse and phase A would be used if you want to know the position of the shaft, In this case, I don't care. I just want to know how long it takes to make a rotation. I suppose either the index or phase A would do that. But I'm wondering which work best, one pulse per rev or many, especially for a slightly underpowered motor.

I could just hook it up I suppose, but sometimes I like to know what I'm doing, and why.
It really depends on what you are trying to do. If you are just doing straight milling and trying to maintain speed, it might be that just the index would work. However, if you are trying to do something like threading that requires axis movement coordinated with the spindle rotation, you are better off with a index plus A channel.

Of course if the spindle is too underpowered, you won't be able to maintain speed anyway.

Alan
__________________
http://www.alansmachineworks.com
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 12-16-2008, 10:54 PM
 
Join Date: Nov 2005
Location: Canada
Posts: 465
chester88 is on a distinguished road

More pulses are always better. depends what you want and how you are trying to get it.
If you read many pulses using a parallel port, it may limit your rpm (can't read the signals fast enough) then use one pulse per rev. If using a hardware card to read then use all the pulses-it is better, later you may want to ridge tap etc. The encoder component was modified to improve the one pulse per rev output- but that may just be in the TRUNK version.
Reply With Quote

  #7   Ban this user!
Old 12-18-2008, 09:34 AM
 
Join Date: Mar 2007
Location: USA
Posts: 53
Lexx0001 is on a distinguished road

Of course if the spindle is too underpowered, you won't be able to maintain speed anyway.

Alan
Understood. I just want better regulation of the speed so it doesn't bog down when I mill something that should be milled slower. If I take deep cuts now, all it does is plug up the end mill. I haven't even thought about tapping.

I've got a a couple different sensors I can try. I am going to take the rpm right from the spindle, not the motor. Hopefully this weekend I'll get a chance to get it done.

chester, I think I'll start with two pulses per rev and see what kind of results I get. If I don't get the low speed response I want, I'll add more. I suppose its important to get them spaced equally, so I'll be watching for that.

Bill K.
Reply With Quote

  #8   Ban this user!
Old 03-13-2009, 12:33 PM
draemr's Avatar  
Join Date: Feb 2007
Location: USA
Posts: 20
draemr is on a distinguished road

Hi,
I think I am going to do something similar, using an encoder and the pwm output of emc2.

I have a brushless servo motor, and I'm driving it with a BLDC type of drive from advanced motion controls. The drive takes +-10vdc signals.

The encoder is a renco, 1024 line encoder, with outputs for the hall effect commutation also. The commutation goes to the drive, and also single ended encoder input.

I'm also going to connect the encoder to the paraport and read that using emc2.

I may need to reduce the encoder count, so I am getting an encoder divider board from www.banebots.com. This will let me reduce the encoder count either by dividing by 2,4,8, or 16x. It also has provision to power the encoder.

I want to use emc2 to control spindle speed, as well as doing things like hard tapping or using the spindle as a position controlled rotary axis. (that's why the big servo motor)

So, what I'm thinking is having several setups:

1) velocity control of the spindle, using PWM out and filtering it to analog =-10vdc (more on this later) and reading either the index pulse or one of the encoder channels for velocity information. Would also allow use of spindle like a vertical lathe with tools mounted to the XY table.

2) hard tapping control of the spindle, using PWM out, PID and reading full quadrature input and index input from the encoder to give fine angular control of spindle position.

3) (might be same as 2) using the spindle nose to mount an auxilary spindle like die grinder at 90 degrees and using again PID and PWM out to give accurate axis position control for 4 or 5 axis machining.

What I want to try to do is take the PWM type 2 up signal and feed them into the base of a small signal transistor that is connected between the +10vdc on-board supply of the BLDC servo driver and the reference input of the drive. Thus the PWM switches the +10vdc supply, which is the velocity command to the drive. I would filter the PWM on the 10vdc using the 2 pole filter shown at: http://www.digital-diy.net/18F%20Exa...via%20PWM.aspx before I feed it into the +reference input of the drive.

Using the other PWM type 2 down output, I'd feed that into the same setup, except using the -10vdc onboard supply switched using the transistor, the output filtered and fed into the -reference input of the drive.

If my thinking is correct, this will allow emc2 to read the encoder, figure out the velocity command needed via the PID and output the PWM up/down signals which then command the drive to turn cw or ccw as needed.

So, I guess I would like some feedback as to if this scheme would work or not and why or why not.

I envision having several hal modules I can call through axis if I want either speed control from emc2 or hard tapping. And another complete config for using it as a rotary axis. The hal modules or routines or .ini files would contain the setup for the PID and which pins to read for the encoder and how to use the info. Ideally, I would like speed control for the milling, then be able to unload the speed control and switch in the hard tapping setup without shutting down and restarting emc2 (and possibly loosing position)

Thanks for your help. Let me know if this is useful to you.

Michael
Reply With Quote

  #9   Ban this user!
Old 03-27-2009, 01:42 AM
 
Join Date: Mar 2007
Location: USA
Posts: 53
Lexx0001 is on a distinguished road
My story so far...

My weekends never seem to go as planned. Sometimes for months at a time.

I was running into difficulties controlling the motor. I made an encoder with 5 slots and attached it to the spindle. When I started the motor, I had control, but the speed wasn't staying constant. At some speeds it would ramp up slow, then a faster ramp down. At others, fast ramp up, slow ramp down. With halscope I could see the pulses to the motor were varying, which is what I expected. So I make another encoder, this time with 50 slots. Same thing. Then I add an index pulse. That didn't help either. I'm very confused at this point. Everything seemed to be working the way it should. It didn't matter if I was using PWM or PDM mode.

So, I bring my o-scope across the shop, and hook it up. It didn't take long to see what the problem was. I had made an assumption that was wrong. The voltage was DC when measured with a meter, but rectified DC when looked at with a scope. The motor is in series with a triac, which was going to turn on when ever it got a pulse, regardless of the phase. It did work better when I had the frequency at 120 Hz.

I think that solves the mystery. I suppose I could bring in a pulse for zero crossing, but I don't want to take the time. I've got a couple capacitors and a IGBT on order. I'll make a DC power supply. It won't be fancy, but I think it will work.

But I've been wrong before.

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need Help!- Config for using single pulse for index and speed rfrenzl LinuxCNC (formerly EMC2) 11 09-08-2008 05:49 PM
Problem- How to use index pulse for homing purpose Zig LinuxCNC (formerly EMC2) 2 03-28-2008 02:16 AM
rw14 - Spindle will not index on toolchange 66 AC COBRA Milltronics 2 04-16-2007 10:51 AM
Taig / Digispeed XL spindle index sensor Dfennell Taig Mills & Lathes 1 01-01-2007 11:23 PM
Phototransistor + Index Pulse = Z Axis THC? sunmix Mach Software (ArtSoft software) 0 10-26-2006 09:30 AM




All times are GMT -5. The time now is 05:29 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