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 07-04-2010, 02:53 AM
 
Join Date: Mar 2007
Location: USA
Posts: 31
EFI-Unlimited is on a distinguished road
Fundamental problem with scale feedback

Hello,

I have a milling machine with stepper motors and linear scales. I have everything talking and working, and I have run into a problem with using the scale feedback. Axis doesn't provide for a pin to feed actual joint position into. I tried feeding it into the motor position pin, but because I am using screw comp, this causes issues, especially with homing. The screw comp also causes problems using the method outlined in the EMC wiki.

Axis does provide a pin called actual joint position, but it is an output. What I need is a pin in axis that is actual joint position input. A actual and commanded delta output would be nice too.

Thoughts?

Brian
Reply With Quote

  #2   Ban this user!
Old 07-04-2010, 02:22 PM
 
Join Date: Mar 2004
Location: St. Louis, MO
Posts: 309
jmelson is on a distinguished road

Originally Posted by EFI-Unlimited View Post
Hello,

I have a milling machine with stepper motors and linear scales. I have everything talking and working, and I have run into a problem with using the scale feedback. Axis doesn't provide for a pin to feed actual joint position into. I tried feeding it into the motor position pin, but because I am using screw comp, this causes issues, especially with homing. The screw comp also causes problems using the method outlined in the EMC wiki.

Axis does provide a pin called actual joint position, but it is an output. What I need is a pin in axis that is actual joint position input. A actual and commanded delta output would be nice too.

Thoughts?

Brian
First, Axis has nothing to do with this, it is only the on-screen GUI. You are probably using the stepgen component of EMC, which is not a servo system. You need to use a step generator that can work in the servo mode of operation. Second, you need a method to read the encoder inputs into the computer. While you can do this with an extra parallel port and the HAL encoder component, there is an upper limit to the rate at which the software can read the encoder without losing counts. You can calculate the upper limit from the BASE_THREAD rate. You never want the encoder to be sending counts in at a rate faster than every couple BASE_THREAD ticks.
So, if the BASE_THREAD is 50000, or 50 microseconds, that is 20 KHz. So, you don't want more than 10000 encoder counts per second. If the encoder has a resolution of .0004" (metric scale of ,01mm) or 2540 counts/inch, and you are moving at 60 IPM or one inch per second, then that is only 2540 counts/second, so that should work.

But, it eats up most of a whole parallel port doing this. So, you might look at some of the hardware "accelerators" available for EMC.

Anyway, I know how to do this using my Universal PWM Controller, I'm not sure of the exact details of doing this using all EMC-Hal components, but you definitely need to add in the PID component, which is the central part of closing a servo loop. You can look at the univstep configs files that are on your EMC system to see how all this is hooked up.
ppmc.0.encoder.00.position is the scaled position out of the encoder counter. ppmc.0.stepgen.00.velocity is the step rate output to the hardware step generator.

Jon
Reply With Quote

  #3   Ban this user!
Old 07-04-2010, 04:46 PM
 
Join Date: Mar 2007
Location: USA
Posts: 31
EFI-Unlimited is on a distinguished road

Originally Posted by jmelson View Post
First, Axis has nothing to do with this, it is only the on-screen GUI. You are probably using the stepgen component of EMC, which is not a servo system. You need to use a step generator that can work in the servo mode of operation. Second, you need a method to read the encoder inputs into the computer. While you can do this with an extra parallel port and the HAL encoder component, there is an upper limit to the rate at which the software can read the encoder without losing counts. You can calculate the upper limit from the BASE_THREAD rate. You never want the encoder to be sending counts in at a rate faster than every couple BASE_THREAD ticks.
So, if the BASE_THREAD is 50000, or 50 microseconds, that is 20 KHz. So, you don't want more than 10000 encoder counts per second. If the encoder has a resolution of .0004" (metric scale of ,01mm) or 2540 counts/inch, and you are moving at 60 IPM or one inch per second, then that is only 2540 counts/second, so that should work.

But, it eats up most of a whole parallel port doing this. So, you might look at some of the hardware "accelerators" available for EMC.

Anyway, I know how to do this using my Universal PWM Controller, I'm not sure of the exact details of doing this using all EMC-Hal components, but you definitely need to add in the PID component, which is the central part of closing a servo loop. You can look at the univstep configs files that are on your EMC system to see how all this is hooked up.
ppmc.0.encoder.00.position is the scaled position out of the encoder counter. ppmc.0.stepgen.00.velocity is the step rate output to the hardware step generator.

Jon
Jon,

I think I am a few steps ahead of you. I already have HAL reading both scales correctly. I have already done the math for the input frequency. When I say axis has no provision for joint feedback, I am referring to the HAL component 'axis'. specifically, axis.0.joint-pos-fb being an OUT. I need that pin to be an IN. Once I get that, I can take the difference of axis.0.joint-pos-cmd and axis.0.joint-pos-fb and add that to the stepgen input. This likely wouldn't even need a PID loop.

Again, I am way past the rudimentary connection and setup problems. What I am up against is a missing 'feature' of the HAL component 'axis'.

Brian
Reply With Quote

  #4   Ban this user!
Old 07-04-2010, 09:41 PM
 
Join Date: Feb 2008
Location: USA
Posts: 106
PCW_MESA is on a distinguished road

Originally Posted by EFI-Unlimited View Post
Jon,

I think I am a few steps ahead of you. I already have HAL reading both scales correctly. I have already done the math for the input frequency. When I say axis has no provision for joint feedback, I am referring to the HAL component 'axis'. specifically, axis.0.joint-pos-fb being an OUT. I need that pin to be an IN. Once I get that, I can take the difference of axis.0.joint-pos-cmd and axis.0.joint-pos-fb and add that to the stepgen input. This likely wouldn't even need a PID loop.

Again, I am way past the rudimentary connection and setup problems. What I am up against is a missing 'feature' of the HAL component 'axis'.

Brian
axis.xxxx in not needed for actual control, just a way to pass parameters to the AXIS GUI...

As Jon said, The normal way a closed loop stepgen driven servo is done in EMC is by feeding the commanded position and the encoder position feedback into a PID component than drives a stepgen running in velocity mode. The PID loop needs to have feedforward set to one and maybe a small amount of P and or I to compensate for clock differences (Hardware stepgens only) or delays in changing direction (Both hardware and software stepgens)
Reply With Quote

  #5   Ban this user!
Old 07-04-2010, 10:21 PM
 
Join Date: Mar 2007
Location: USA
Posts: 31
EFI-Unlimited is on a distinguished road

I must not be explaining the issue clearly.

I am not concerned with how to close the loop with a PID controller.

The only place I can connect the encoder data to in EMC has the screw comp added to it later (axis.x.motor-pos-fb) I need a pin that is after the screw comp, but before the gui.

The reason I need this is so when I disable the motors and manually wheel the table around, EMC can keep track of whats going on.

Brian
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 07-04-2010, 10:45 PM
 
Join Date: Mar 2004
Location: St. Louis, MO
Posts: 309
jmelson is on a distinguished road

Originally Posted by EFI-Unlimited View Post
I must not be explaining the issue clearly.

I am not concerned with how to close the loop with a PID controller.

The only place I can connect the encoder data to in EMC has the screw comp added to it later (axis.x.motor-pos-fb) I need a pin that is after the screw comp, but before the gui.

The reason I need this is so when I disable the motors and manually wheel the table around, EMC can keep track of whats going on.

Brian
OK, so what you seem to be wanting is to run open-loop stepper drives, but have the position feedback going to the Axis display. This seems to be how the lost position sensing works on Mach3, but is very counter to how EMC is set up. I seriously doubt you can do this without major code changes.

All I know is how it is done in a servo system where EMC is part of the servo loop. I don't use screw error compensation on my system, but the kinematics IS handling it, if I were to provide a comp table. And, on both of my machines, it definitely is able to follow machine position when I hit E-stop and manually move the machine. If I generated and entered the comp tables, it would automatically be conpensating for screw errors, too. I THINK that the on-screen display would show the corrected position, but as I have not used this function, I can't absolutely verify that.
Maybe you had better run this question by the EMC developers to check that it works that way.

Jon
Reply With Quote

  #7   Ban this user!
Old 07-04-2010, 10:55 PM
 
Join Date: Mar 2007
Location: USA
Posts: 31
EFI-Unlimited is on a distinguished road

Jon,

I have tested it, and it does work the way you propose. I connected the scales to the motor position feedback, and with motors disabled, axis would follow the table around. Because of the backlash (acme screws) and the wear in the center of the x screw, I really need to use the screw comp, and this is at odds with the fore mentioned method.

I am sure it will take a code change, but I don't think it would be a major one. I was kinda hoping to catch the eye of one of the developers, and maybe see if it could get worked in. I would dig into the code, and contribute the change myself, but I don't have time to familiarize myself with the source and make the patch. Especially when I know there are guys that are already familiar with it, and I suspect could implement it fairly easily. The way the axis component is already structured, I am kinda surprised this hasn't already been done.

Is there a better way to bring this to a developers attention?

Brian
Reply With Quote

  #8   Ban this user!
Old 07-04-2010, 11:32 PM
 
Join Date: Mar 2004
Location: St. Louis, MO
Posts: 309
jmelson is on a distinguished road

Originally Posted by EFI-Unlimited View Post
Jon,


Is there a better way to bring this to a developers attention?

Brian
Yes, of course. There is the EMC Developer's list on SourceForge
emc-developers@lists.sourceforge.net


The info on joining is in the linuxcnc.org home page, but here's the subscribe page
for the developer's list :
https://lists.sourceforge.net/lists/...emc-developers

The other problem is that backlash compensation doesn't actually work. For commanding positioning-only control
from G-code, it can be done. For sensing position from shaft angle measurement, it kinda-sorta works, but is far
from ideal. For actual machining with interpolation, it just is awful, because the leadscrew is not in control of the table
position. If the leadscrew cannot hold the table in position, the cutting tool can take control, causing the workpiece
to JUMP toward the tool, with often spectacular results. So, if there is any way at all to reduce the backlash, such
as cutting the Acme nuts and pushing them together, you really ought to do it.

Jon

Last edited by jmelson; 07-04-2010 at 11:38 PM. Reason: typo
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
DRO Scale Problem ranchak Benchtop Machines 4 09-15-2008 02:54 PM
Need to make scale tire mold for 1/6 scale car thuffner3 Moldmaking 2 04-29-2008 12:57 AM
scale feedback camtd Mach Software (ArtSoft software) 6 09-03-2007 05:51 PM
G320 receiving feedback from linear scale Paraprop Gecko Drives 3 04-13-2007 11:54 PM
scale craig Mastercam 4 03-09-2007 08:10 AM




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