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 03-14-2009, 05:12 PM
 
Join Date: Feb 2009
Location: USA
Posts: 31
JeLC is on a distinguished road
Limit/Home Switch Question

I'm just now putting the electronics on my DIY 3 axis router (first system, so I've got a lot to learn). Using a G540 with Keling 370 oz motors and EMC2. But I'm confused about the limit switches. The 540 only has 4 inputs, and I have 5 limit switches (1 on z, 2 on y and 2 on x). I've seen suggestions to use one input for two switches, which is simple enough to wire up. But my question is......doesn't the system need to know which switch it has hit? Let's say I wire the X min limit and the Y min limit together, how does the system know which limit switch was hit. Or am I way off base and the system doesn't care?

I'm using my limit switches to also serve as home switches , so I assume those three should be on separate inputs. So that leaves me one input for my other two limit switches.

I'm still a newbie according to my post count, but I've been reading and trying to learn from this forum for a couple of months. Lot of good info to be found here.
Reply With Quote

  #2   Ban this user!
Old 03-14-2009, 05:26 PM
Bubba's Avatar  
Join Date: Mar 2004
Location: LaGrange, GA USA
Posts: 1,357
Bubba is on a distinguished road

JeLC,
I personally don't use EMC, but I think it would be the same in principle as mine.
I have a similar situation with the number of switches except I only have one switch on the X axis that will trip in EITHER direction (so you might say it is two switches in you case). My switches are wire NC (normally closed) and in series for the axis's with multiple switches. You want the limit circuit to be NC for safety reasons. The main one being that if you have a wire failure, the machine will stop as it will detect a limit trip. If you wire NO (Normal Open), you will not know about a wire failure until you crash something!

Ok, that takes care of the Limit switch problem. Now for using them as home switches. You only have to be careful in this situation that an axis switch is NOT tripped in the wrong position. To explain, if you normally home to the X - position and if the X + switch is tripped, the table will move in the wrong direction! Otherwise, things operate normally. So far in my setup, I have not had this situation occur.
To answer your question on if two axis trip at the same time, the controller doesn't care and usually a visual check of the spindle location will tell which axis is tripped. The only time I have had a problem with this is on occasion I would get a "false" trip for some unknown reason. I think this may be due to noise on the system or a possible "feature" in my control program.

Hope this helps.
__________________
Art
AKA Country Bubba (Older Than Dirt)
Reply With Quote

  #3   Ban this user!
Old 03-14-2009, 06:34 PM
 
Join Date: Nov 2005
Location: Canada
Posts: 465
chester88 is on a distinguished road

The limit/home switches need to be connected to EMC. Does the gecko drive need to have limit switches connected to work?
By connecting multiple limit switches together makes it so EMC can't know what axis/direction tripped - which means it would be up to you to figure it out. Individual switches makes it more obvious whats wrong.
For homing with shared switches EMC gets around this by homing one axis at a time and assuming that any tripped switch is the right switch.
On basic machines the limit/home switches are wired through the parallel port.
Reply With Quote

  #4   Ban this user!
Old 03-14-2009, 06:55 PM
Bubba's Avatar  
Join Date: Mar 2004
Location: LaGrange, GA USA
Posts: 1,357
Bubba is on a distinguished road

Gecko's don't have anything to connect to home or limit switches. They will work without them if everything else is properly wired and setup.

I can usually tell at a quick glance which axis is tripped!
__________________
Art
AKA Country Bubba (Older Than Dirt)
Reply With Quote

  #5   Ban this user!
Old 03-14-2009, 07:36 PM
acondit's Avatar  
Join Date: Apr 2005
Location: USA
Posts: 1,774
acondit is on a distinguished road

Originally Posted by JeLC View Post
I'm just now putting the electronics on my DIY 3 axis router (first system, so I've got a lot to learn). Using a G540 with Keling 370 oz motors and EMC2. But I'm confused about the limit switches. The 540 only has 4 inputs, and I have 5 limit switches (1 on z, 2 on y and 2 on x). I've seen suggestions to use one input for two switches, which is simple enough to wire up. But my question is......doesn't the system need to know which switch it has hit? Let's say I wire the X min limit and the Y min limit together, how does the system know which limit switch was hit. Or am I way off base and the system doesn't care?

I'm using my limit switches to also serve as home switches , so I assume those three should be on separate inputs. So that leaves me one input for my other two limit switches.

I'm still a newbie according to my post count, but I've been reading and trying to learn from this forum for a couple of months. Lot of good info to be found here.

Combine the two on X to one pin, combine the 2 on Y to another pin and then connect the z to another pin. EMC knows which direction it is traveling when homing so it will use the appropriate switch as home. When acting as limits, it is more important to know which axis has hit a limit than which end of 1 of 2 axii.

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

Sponsored Links
  #6   Ban this user!
Old 03-14-2009, 10:20 PM
acondit's Avatar  
Join Date: Apr 2005
Location: USA
Posts: 1,774
acondit is on a distinguished road

In response to your pm, I am posting my config files. You can look at them and see if there is anything that is helpful.

I have a 9" Z axis travel, but I set my limits to be roughly -9 and +9. Part of the secret is getting the homing correct. I home to the top of the Z and then I set G54 based on the homed values then I use G55 offsets for my "cutting home". So I set Z=0 to be the top surface of whatever I am cutting, X=0 and Y=0 are offset to the "home corner" of the piece that I am working on.

I use the following code to start virtually every file I create:

For me X is usually offset 1.000" and Y is offset 0.800".
#<_mat_depth>=0.500 ( Thickness of Material )
#<_xorigin>=1.000 ( X axis offset for Coordinate sys 2 )
#<_yorigin>=0.800 ( Y axis offset for Coordinate sys 2 )
#<_zorigin>=[#<_mat_depth>-8.410] ( Z axis offset for Coordinate sys 2 This calculation is based on setting up my tool to zero at this position )

(other variables and subroutines)

G20 G92.1 G61 G17 G40 G80 ( Set Imp. mode, clear offsets, set exact path, set XY plane, turn off tool radius compensation )
G90 ( Set absolute mode for motion )
G64 P.002 ( Set limit for segmemt combining )
(G43 Z1.000 H[#<_toolnum>]) ( Set tool length offset )
G10 L2 P1 X0.0 Y0.0 Z0.0 ( Set G54 origin to 0.0 )
G10 L2 P2 X#<_xorigin> Y#<_yorigin> Z#<_zorigin> ( Set G55 work origin )
G55 ( Set Coordinate system 2 )

Alan
Attached Files
File Type: zip INI_HAL.zip‎ (6.3 KB, 27 views)
__________________
http://www.alansmachineworks.com

Last edited by acondit; 03-15-2009 at 04:54 PM.
Reply With Quote

  #7   Ban this user!
Old 03-15-2009, 04:34 AM
 
Join Date: Feb 2009
Location: USA
Posts: 31
JeLC is on a distinguished road

Just to answer your question from the PM, the sample program was only giving me an error for the z axis when I tried to run it.

I looked over your configs and noticed you were using negative and positive travel limits. Which I assume would cause you to home in the center of X and Y travel. And I wasn't doing that for any of the axis. I was trying to set everything up starting from 0 and going up, except for my z. I was trying to get home set up at the extreme left corner of my machine, with the z moved up as high as possible. And I may not exactly understand what home is yet. Since I'm going to have to change bits manually, it made sense to home it in a corner with the z as high as possible

But, I finally got the sample 'emc2 axis' program to work with my stepconf. My table is approximately 40" (x) by 32" (y) by 6" (z). So in the config, I split those number using -20 and 20 for x, -16 and 16 for y, and then -2 and 4 for z. Homing to 0 for all axis. It seems to like those numbers, or I'll say it will at least run the sample "emc2-axis' code now.

Looking at your ini and hal helped a lot. I'm sure I'll refer to them many more times before this thing is up and running correctly. I'll get there, just going to take a while. Thanks for your assistance.
Reply With Quote

  #8   Ban this user!
Old 03-15-2009, 11:42 AM
guru_florida's Avatar  
Join Date: Nov 2007
Location: United States
Age: 36
Posts: 257
guru_florida is on a distinguished road

Welcome to EMC2. I two switches connected for each axis, so I have three imputs. I use them for homing too.

When you have your homing and limits done you should modify HAL to use a usb joystick (like an xbox controller type) as a jogger. I find it invaluable. I also learned a lot about HAL while setting it up. There is a tutorial on the emc2 website.

Colin
Reply With Quote

  #9   Ban this user!
Old 03-15-2009, 04:38 PM
acondit's Avatar  
Join Date: Apr 2005
Location: USA
Posts: 1,774
acondit is on a distinguished road

Originally Posted by JeLC View Post
Just to answer your question from the PM, the sample program was only giving me an error for the z axis when I tried to run it.

I looked over your configs and noticed you were using negative and positive travel limits. Which I assume would cause you to home in the center of X and Y travel. And I wasn't doing that for any of the axis. I was trying to set everything up starting from 0 and going up, except for my z. I was trying to get home set up at the extreme left corner of my machine, with the z moved up as high as possible. And I may not exactly understand what home is yet. Since I'm going to have to change bits manually, it made sense to home it in a corner with the z as high as possible

But, I finally got the sample 'emc2 axis' program to work with my stepconf. My table is approximately 40" (x) by 32" (y) by 6" (z). So in the config, I split those number using -20 and 20 for x, -16 and 16 for y, and then -2 and 4 for z. Homing to 0 for all axis. It seems to like those numbers, or I'll say it will at least run the sample "emc2-axis' code now.

Looking at your ini and hal helped a lot. I'm sure I'll refer to them many more times before this thing is up and running correctly. I'll get there, just going to take a while. Thanks for your assistance.
Actually I have zero set at the end of travel for X, Y, and Z. My X axis is 38.5", my Y axis is 24" and my Z is 9.195". I was having the same problem as you, getting errors in exceeding limits when I had the soft limits set to the actual size of the travels, so I just set the soft limits to plus and minus the actual travel. Once I had physical limit switches, I never went back to try and figure out how to actually set the soft limits.

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

  #10   Ban this user!
Old 03-15-2009, 04:49 PM
acondit's Avatar  
Join Date: Apr 2005
Location: USA
Posts: 1,774
acondit is on a distinguished road

Originally Posted by guru_florida View Post
Welcome to EMC2. I two switches connected for each axis, so I have three imputs. I use them for homing too.

When you have your homing and limits done you should modify HAL to use a usb joystick (like an xbox controller type) as a jogger. I find it invaluable. I also learned a lot about HAL while setting it up. There is a tutorial on the emc2 website.

Colin
Colin,

I set up a USB joystick on my lathe. I don't use it much but it was fun playing with it.

I am attaching a "custom.hal" that has a working config for a Logitech Attack3 joystick. A couple of the values are shifted around so that the joystick work for X and Z on the lathe rather than X and Y, but that is an easy fix to change back for a router.

It also has the hookup for my spindle encoder plus stuff that is commented out that I was working on for a charge pump.

If anyone finds it useful, great.

Alan
Attached Files
File Type: txt custom.hal.txt‎ (5.5 KB, 59 views)
__________________
http://www.alansmachineworks.com
Reply With Quote

Sponsored Links
  #11   Ban this user!
Old 03-15-2009, 08:12 PM
guru_florida's Avatar  
Join Date: Nov 2007
Location: United States
Age: 36
Posts: 257
guru_florida is on a distinguished road

Originally Posted by acondit View Post
I set up a USB joystick on my lathe. I don't use it much but it was fun playing with it.
hmm. I suppose it might not be as useful on a lathe maybe. I found the keyboard not great for getting my tool over the "mark" accurately. It mostly jumped around, I would have to set the feed rate way down. With my JS I have a fast and super slow setting. I can dial it to the mark pretty well on fast mode and then fine tune on super-slow-mo. I drill PCBs with small vias, so it's handy.

That reminds me, I've found a strange behavior in EMC2 where sometimes I let go of the jog key and it keeps going for another second. Which could be beyond my limits! 8| Once this happens, it stays like this. It's like having sticky keys. I have to restart EMC2 to get the keys to be responsive again. I've done the RT tests and I am well above my RT limits. Also, the machine still cuts properly and my joystick never does it. Have you had it happen?
Reply With Quote

  #12   Ban this user!
Old 03-15-2009, 10:46 PM
acondit's Avatar  
Join Date: Apr 2005
Location: USA
Posts: 1,774
acondit is on a distinguished road

Originally Posted by guru_florida View Post
hmm. I suppose it might not be as useful on a lathe maybe. I found the keyboard not great for getting my tool over the "mark" accurately. It mostly jumped around, I would have to set the feed rate way down. With my JS I have a fast and super slow setting. I can dial it to the mark pretty well on fast mode and then fine tune on super-slow-mo. I drill PCBs with small vias, so it's handy.

That reminds me, I've found a strange behavior in EMC2 where sometimes I let go of the jog key and it keeps going for another second. Which could be beyond my limits! 8| Once this happens, it stays like this. It's like having sticky keys. I have to restart EMC2 to get the keys to be responsive again. I've done the RT tests and I am well above my RT limits. Also, the machine still cuts properly and my joystick never does it. Have you had it happen?
I find that once I home things, I end up typing gcode commands for most of my 1 off type things.

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
limit switch- home switch normd CamSoft Products 1 05-16-2008 06:56 PM
limit switch and home switch setup Runner4404spd General Electronics Discussion 0 12-15-2005 07:58 AM
Is it possible to use the home switch as the limit switch as well? Darc Mach Software (ArtSoft software) 2 10-23-2005 12:50 AM
Limit Switch / Home Switch in Software Sanghera General Electronics Discussion 6 11-01-2004 05:58 PM




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