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-07-2008, 12:45 PM
 
Join Date: Jul 2008
Location: USA
Posts: 49
rfrenzl is on a distinguished road
Config for using single pulse for index and speed

I've done my reading here and I don't know if there is a reasonable answer or not. My question/issue is:

I want to do threading on my lathe (so what's new).
I have an index already set up on the spindle and it works fine.
I have used the Sherline sample configuration that is packaged with EMC2 and modified it to work with my steppers and other equipment.
I was successful in getting things to work with EMC2 2.2.2 but not with 2.2.5, but neither using a single pulse for speed and index.

What I am after is the correct HAL configuration to use a single input line for a spindle index AND spindle speed for synchronize motion (i.e. threading).

If someone out there has done such a thing, a copy of their HAL and INI files will be greatly appreciated. I can read through them and determine what I need to change so the supplier does not need to do anything other than supply the files.

I do have a couple of used encoders available but they seem to have issues in dropping pulses now and then. The result is that the spindle and slide movement are erratic and not necessary correct. A single pulse per revolution would simplify things greatly, both in construction of the mechanics to read the spindle and in software settings. MACH3 does this just fine but I have been using EMC2 for a number of years and like it very much (plus it still runs my mill). The encoders have 2000ppr and 1250ppr which means a pretty high throughput for 300+ rpm on the spindle. I can make a index wheel and add optical sensors but that requires designing and and adding it to the lathe. I'm trying not to do too much redesign/rebuild of the lathe so simple is good.

Thank you in advance for any help you can provide.
Ron
Reply With Quote

  #2   Ban this user!
Old 08-07-2008, 02:25 PM
 
Join Date: Jul 2003
Location: Holmen, WI
Posts: 1,081
samco is on a distinguished road

1ppr is very new to emc. You would have to get the latest developement version (trunk).

instructions here for getting trunk
http://wiki.linuxcnc.org/cgi-bin/emc...o_compile_emc2

after that you could 'man encoder' from the trunk environment

You would be in effect beta testing it (we can always use testers).

if you want to - I would get on irc tonight and ask your question. The guy who added the functionallity might be there. (jmkasunich) although others may be able to help.

http://www.linuxcnc.org/component/op...emid,8/lang,en

otherwise - asking on the email list would be a good idea also.

https://lists.sourceforge.net/lists/listinfo/emc-users

sam
Reply With Quote

  #3   Ban this user!
Old 08-07-2008, 02:59 PM
acondit's Avatar  
Join Date: Apr 2005
Location: USA
Posts: 1,774
acondit is on a distinguished road

Sam,

I hadn't even seen anything about this. Where was it discussed?

I think it is about time, but I may still finish my encoder setup.

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

  #4   Ban this user!
Old 08-07-2008, 03:47 PM
 
Join Date: Jul 2008
Location: USA
Posts: 49
rfrenzl is on a distinguished road

Originally Posted by samco View Post
1ppr is very new to emc. You would have to get the latest development version (trunk).
...

You would be in effect beta testing it (we can always use testers).

...
sam
Thank you for the information, Sam. I had thought I'd seen a few emails from the EMC Users group, but did'n take notice as I did not need it until now. I'll take a look at the new code and see what's changed. I have lots of new optical sensors sitting around so will also look at milling a timing wheel and putting it on the lathe. I had one of the encoders mounted but it was just too inconsistent to do much. It did work nice when I manually turned the spindle as it did not need to try and look ahead very far. At 300 rpm, the encoder just was not stable.

I'll continue to play with this and if I get anywhere, I'll try to post back to the Users Group.

Ron
Reply With Quote

  #5   Ban this user!
Old 08-07-2008, 08:07 PM
 
Join Date: Feb 2007
Location: usa
Posts: 34
jmkasunich is on a distinguished road
sample 1ppr configs

Some sample config files for 1ppr threading can be found here.

http://jmkasunich.com/pics/tormach/

These were used during testing of the one-ppr encoder software, so they have both a real encoder and a 1ppr encoder (using the index pulse of the real one). I wanted to be able to compare the results from the two different ways of measuring spindle speed.

One PPR threading will always be less accurate than multi-ppr threading, because if the spindle slows down under the load of the cut, the control won't know about it until a full revolution later. With a regular encoder, the control can react much sooner, before any significant error builds up.

That said, the actual amount of error will depend on the spindle and the cut. If you take light cuts on a spindle that has some guts, you will be fine with 1ppr.
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 08-07-2008, 09:41 PM
 
Join Date: Jul 2008
Location: USA
Posts: 49
rfrenzl is on a distinguished road

Originally Posted by jmkasunich View Post
Some sample config files for 1ppr threading can be found here.

http://jmkasunich.com/pics/tormach/

These were used during testing of the one-ppr encoder software, so they have both a real encoder and a 1ppr encoder (using the index pulse of the real one). I wanted to be able to compare the results from the two different ways of measuring spindle speed.

One PPR threading will always be less accurate than multi-ppr threading, because if the spindle slows down under the load of the cut, the control won't know about it until a full revolution later. With a regular encoder, the control can react much sooner, before any significant error builds up.

That said, the actual amount of error will depend on the spindle and the cut. If you take light cuts on a spindle that has some guts, you will be fine with 1ppr.

Thank you very much for the information. I am very much aware of the disadvantages of the 1ppr signal but I want to see if it will work like I want before going through the cost, time, and effort of adding the extra pulses. If I can find the right stock in my metal bin, I can cut an encoder wheel and use it with what I already have. I just finished putting the step motor on my rotary table so can make the wheel much easier than before.

Like many on this forum, I like to experiment and this was something I want to learn a bit more about.

Again, thanks for the help and files. I'll let folks know how it works out. I also have a 2hp DC motor to add to the lathe and the controller I use has very good torque control for constant rpm. I modified EMC2 to use a frequency to voltage circuit to drive the spindle motor so expect to have a good CNC capable machine. If I get a wild hair, I'll use feedback so that I can dynamically manage the motor. Since the test config looks to be for a Tormach, I will assume it already has a similar config for this feedback. Just more stuff to learn and play with.

Thank you,
Ron
Reply With Quote

  #7   Ban this user!
Old 09-05-2008, 11:25 AM
acondit's Avatar  
Join Date: Apr 2005
Location: USA
Posts: 1,774
acondit is on a distinguished road

Originally Posted by jmkasunich View Post
Some sample config files for 1ppr threading can be found here.

http://jmkasunich.com/pics/tormach/

These were used during testing of the one-ppr encoder software, so they have both a real encoder and a 1ppr encoder (using the index pulse of the real one). I wanted to be able to compare the results from the two different ways of measuring spindle speed.

One PPR threading will always be less accurate than multi-ppr threading, because if the spindle slows down under the load of the cut, the control won't know about it until a full revolution later. With a regular encoder, the control can react much sooner, before any significant error builds up.

That said, the actual amount of error will depend on the spindle and the cut. If you take light cuts on a spindle that has some guts, you will be fine with 1ppr.
John,

Is 1ppr capability in 2.2.6? Or does it still have to be compiled from cvs?

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

  #8   Ban this user!
Old 09-05-2008, 11:34 AM
 
Join Date: Feb 2007
Location: usa
Posts: 34
jmkasunich is on a distinguished road

Is 1ppr capability in 2.2.6? Or does it still have to be compiled from cvs?
It is in CVS only. The policy is that bugfixes go into the current release, but not new features. The #1 rule with a release series (like 2.2.x) is to not break existing working configurations.

We sometimes add a new feature if the implementation is such that it can't break anything. For example, a completely new HAL module - if nobody was using that module before, adding it won't break things for people who still aren't using it.

But in this case, the new feature is part of the existing encoder counter module, so we didn't put it in the 2.2.x series.

Regards,

John Kasunich
Reply With Quote

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

I've used EMC just for it's HAL system and UI - I wrote a lathe feed/threading program as a HAL module to simply replace the need for change-gears (ie, not exactly "CNC" since no G-code.) So, I've never used or explored EMC as an actual machine controller, I've just used some of it's supporting software.

If I recall, the encoder module takes the A/B and index signal and generates a float(ing point number) for EMC to use for both position and velocity. Is this all that EMC needs as an output from the encoder module?
That would explain why 1 PPR is a special case, because it's no longer an "encoder" (as we know them: quadrature w/ index), it's just a non-quadrature encoder with n pulse(s) per rev.

Why not add a new non-quadrature encoder module? If debouncing does not need to be integrated (ie, don't need it, or just run through the standard debounce HAL module,) then it would be trivial to write a non-quadrature pulse encoder module. And, it wouldn't affect existing users of the encoder module, it terms of both bugs, and overhead from making it a flexible do-all module.

-Matt
Reply With Quote

  #10   Ban this user!
Old 09-08-2008, 08:16 AM
 
Join Date: Feb 2007
Location: usa
Posts: 34
jmkasunich is on a distinguished road

That would explain why 1 PPR is a special case, because it's no longer an "encoder" (as we know them: quadrature w/ index), it's just a non-quadrature encoder with n pulse(s) per rev.
EMC's encoder module already has "counter mode" in which it counts edges on the phase A input and ignores the phase B input. What is new is the "interpolated position output" that can estimate where the shaft is between pulses.

Why not add a new non-quadrature encoder module?
Because then we wind up with two modules which have a lot of duplicated code. Sooner or later, a bugfix will be applied to one and not the other, or something like that.

If there is a lot of interest in this feature for the 2.2.x branch, then maybe after a careful review we might put it into 2.2.7. I think the code is written in such a way that if you don't use the interpolated position output nothing else changes.

Regards,

John Kasunich
Reply With Quote

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

I see, it's the interpolation that's the special thing, that makes perfect sense now. It doesn't tell you where it's last position is, it tells you where it thinks it is, which is fundamentally different and why it's a newer feature.

My first attempt at the manual lathe HAL module used the encoder and stepgen modules, and didn't have good results since there was no interpolation and not enough resolution on the encoder. I saw the encoder position jumping, and the stepgen with it's discrete moves (based on encoder jumping) was lagging. So then I rewrote it to integrate debouncing, encoder interpolation, and a token-bucket step output. Now it's accurate and much more smooth.

BTW, is it weird that I saw stepgen overshooting? It happened because the control of stepgen is all in the servo thread; the high speed thread generating the step signal didn't shut off the frequency when it reached the proper number of steps because the step count info wasn't passed down to it, just the Hz. It reached the position and passed it before the next run of the servo thread, and had to reverse back to the commanded position.

-Matt
Reply With Quote

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

Originally Posted by jmkasunich View Post
If there is a lot of interest in this feature for the 2.2.x branch, then maybe after a careful review we might put it into 2.2.7. I think the code is written in such a way that if you don't use the interpolated position output nothing else changes.

Regards,

John Kasunich
John,

That sounds good to me, but I may have my ABZ encoder working by that time.

Alan
__________________
http://www.alansmachineworks.com
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
Problem- How to use index pulse for homing purpose Zig LinuxCNC (formerly EMC2) 2 03-28-2008 02:16 AM
Turret index speed DocHod Servo Motors and Drives 0 03-06-2008 09:24 PM
Phototransistor + Index Pulse = Z Axis THC? sunmix Mach Software (ArtSoft software) 0 10-26-2006 09:30 AM
need speed control for single ph motor FLUTE HEAD General Electronics Discussion 4 10-06-2004 10:35 AM
Single speed Dremel campaX DIY-CNC Router Table Machines 4 08-07-2003 09:20 PM




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