PDA

View Full Version : Homebrew CNC: What about limit switches?



Doc Nickel
03-17-2016, 04:24 AM
We're working on a homebrew CNC setup, which is very much an educational experience for all parties involved. :) We're getting close to a very early testing stage, and it's time to start thinking about mounting some limit switches.

Can I just use some off-the-shelf leaf-type microswitches? I know at some point I'll need more robust and better protected switches- the plan for this machine does include coolant at some point. But for the time being, can I just use some common micros?

I'm still very new at this, so pardon the ignorance. Doesn't the usual stepper-based homebrew setup use a "home" position, marked by the limit switches, as a base/zero? In which case, the ultimate position is at least somewhat determined by the accuracy/repeatability of the switches themselves?

Or are the switches basically just "don't go past this point" indicators?

Doc.

Magicniner
03-17-2016, 06:13 AM
For limits you can use anything that works, for homing you need something with very repeatable break and make points if you intend to reference your machine position from them and use tool offsets.
Most systems have separate inputs for home & limits, limits will stop your machine if you run a job which would otherwise "hit the buffers"
Regards,
Nick

DR
03-17-2016, 06:28 AM
On servo systems the limit switch acts as a stop point. From there the system backs up the servo motor to the marker on the servo's encoder to accurately establish home or "reference" position with high repeatability.

With a stepper usually there aren't encoders so the system would depend on the accuracy of the limit switch which might not be so accurate.

An issue could be when running a part held in a vise that wasn't finished the last time the machine was run. Will your current "homing" position be the exact same spot within the machine's accuracy as previously? You might be able to get around this by using some sort of edge finding device to reestablish position off the part itself or the vise. Then the accuracy of home would be within the accuracy of your edge finding device.

For testing it seems any limit switch would be suitable.

MrFluffy
03-17-2016, 06:56 AM
My bridgeport interact has home and limit switches that are standard ( good quality )industrial microswitches inside a housing so whats good for them...
There's a home switch a little off the limit switch for the axis. And it has limit switches at either end wired in series that the software should never hit once homed so they can be hard limits.
The other thing that everyone knows already probably is to wire them NC, so if a wire goes bad then the cnc detects the switch as depressed all the time, rather than NO and making contact when its engaged, in which case if you have a wiring fault you find out when a axis goes past its limits and all hell breaks loose.

boslab
03-17-2016, 09:08 AM
Most of the machines I've ever worked on used proximity swiched, you know the kind with 3 wires, and a led on back to indicate operation, durable, accurate but require the appropriate power input, available NO, NC, mostly screw barrel, muck water and spit proof
Mark

DICKEYBIRD
03-17-2016, 09:45 AM
Hiya Doc, I think a truly accurate homing system is VERY important. Sure does make it nice when you're setting up the tool table. Just use the homing point as tool #0 and reference all the others (I have 17 now) from that. As mentioned, it's also very nice when you have to restart the system.

I do it on my little CNC lathe by using a micro-switch at one end of the axis travel which switches on an opto switch that's triggered by a slotted disc on the back end of the double-shaft stepper motor. That gives a homing point that is accurate to the same spot on the stepper motor's rotation every time. When you consider that it's a 200 step/rev motor geared 2.5/1, it's pretty darn accurate!

Mine has relatively low-powered steppers so I passed on the limit switches due to lack of available inputs. If it crashes (so far it hasn't, knock on wood) it will just hit mechanical stops, stall the stepper and skip some steps. A quick re-homing routine, fixing the errant g-code that caused the crash & I'm back in business. Sounds good, huh?:rolleyes:

MTNGUN
03-17-2016, 12:46 PM
Chinese proximity switches are cheap, accurate, and fairly resistant to chips and coolant. But bulky. If a chip shield is needed a thin piece of pexiglass may suffice.

I didn't go with the leaf switches because of the coolant issue, though you can build some sort of housing to shield from coolant & chips.

Optical would work too, but again would probably require a shield.

All have been used successfully, just depends on what you have to work with and how creative you are at mounting them.

elf
03-17-2016, 01:04 PM
Hiya Doc, I think a truly accurate homing system is VERY important. Sure does make it nice when you're setting up the tool table. Just use the homing point as tool #0 and reference all the others (I have 17 now) from that. As mentioned, it's also very nice when you have to restart the system.

I do it on my little CNC lathe by using a micro-switch at one end of the axis travel which switches on an opto switch that's triggered by a slotted disc on the back end of the double-shaft stepper motor. That gives a homing point that is accurate to the same spot on the stepper motor's rotation every time. When you consider that it's a 200 step/rev motor geared 2.5/1, it's pretty darn accurate!


Can you share part numbers and schematic/drawing?

Thanks

ikdor
03-17-2016, 01:18 PM
Note that there are also water proof micro switches. Might be cheaper than the inductive sensors.

Keith_W
03-17-2016, 01:56 PM
Hi Doc Nickel,
A few things to consider in what type of switching method to use.
Micro Switches work on the principal of the contacts changing state when the internal spring is deflected enough to flick the contacts to change of state. If there is pitting of the contacts due to the switching current and amps the repeatability of the switch point will differ. There also can be differences in the switch point due to the tension of the internal spring.
Limit Switches are a better option as the contacts are mounted onto the actuating bar and the NC contacts are forced apart. A snap-action Limit Switch is the better type as they are very repeatable, the better manufacturers of Limit Switches will have a table that shows the amount of travel of the actuator, switch point, over travel and at what point it will change state. They have various heads that bolt on for the different switching applications.
Inductive Proximity Switches are good as well as it works on the eddy current principal so a good repeatable switching point can be obtained. The method of setup is important though, always mount the unit so the switching action is across the sensing face not moving towards the face. A embeddable type unit is better for repeatability and make sure the switching target is to the manufacturers recommendations. Constant switching distance also makes for repeatable switching.
Most Limit and Inductive Switches are IP65 rated so coolant isn’t a problem but swarf can be for Inductive Switches as it can cause unwanted false switching.
Keith_W.

DICKEYBIRD
03-17-2016, 02:06 PM
Can you share part numbers and schematic/drawing?

ThanksI used one of these I got from from ebay a long time ago.
http://i57.photobucket.com/albums/g227/DBAviation/Opto%20Specs_zpszaphmu5f.jpg (http://s57.photobucket.com/user/DBAviation/media/Opto%20Specs_zpszaphmu5f.jpg.html)

That one is NLA but I see others are plentiful now...looks like about the same thing. Pretty cheap; less than $2 if you're willing to wait. http://www.ebay.com/itm/Opto-optical-Endstop-end-stop-Switch-For-3D-Printers-Reprap-Prusa-Mendel-CNC-/231573764931?hash=item35eadf3b43:g:XS0AAOxy5rpSTmF n

As far as a schematic, I'm pretty worthless when it comes to that sort of thing. I just put a little roller tipped micro-switch from my junk box in series with the signal wire from the opto widget, fed that into an open pin on my CNC4PC C-11 B.O.B. then went into the Mach config. screen & checked the appropriate boxes. When you press The "Set Home X (or Z)" button on the lathe screen it makes the axis slowly move until it trips the micro switch/opto sensor & reverses til' it sees the signal again...done.

Sorry I couldn't be more specific...it's been several years ago that I did this. (...and it still works, yay!)

Keith_W
03-17-2016, 02:24 PM
Sunx has a range of Slot Sensors as well http://www.panasonicsensors.com/component/mijosearch/search.html?query=slot%20sensor
There in different mounting arrangements and either NPN or PNP outputs.
I have a few and will be using one to make a speed display for my Lathe.

Keith_W.

George Bulliss
03-17-2016, 02:30 PM
We're working on a homebrew CNC setup, which is very much an educational experience for all parties involved. :) We're getting close to a very early testing stage, and it's time to start thinking about mounting some limit switches.

I'm still very new at this, so pardon the ignorance. Doesn't the usual stepper-based homebrew setup use a "home" position, marked by the limit switches, as a base/zero? In which case, the ultimate position is at least somewhat determined by the accuracy/repeatability of the switches themselves?

Doc.


Doc, if it's just testing you want to do, you may not need the switches. In fact, I don't have any on my CNC and don't plan to add them. The forces aren't great enough to cause any damage if a limit is exceeded; you just hear the sound of missing steps (have to reset things, of course).

Mach3 does have a home feature, but it will run fine without. I always set my work coordinates on G54 (55, 56, etc. if using more than one offset). The G-code you load will be machining based on your work coordinates, not the machine coordinates. On shut down, I simply position to X0, Y0 and it's right there when I fire things back up again.

About the only thing I can see myself using the limits to set the machine coordinates for would be in order to define soft limits. However, the soft limits in Mach don't impress me, so I wouldn't use them anyway. As far as homing to reset or check things prior to machining, I think you can swing an indicator on a known location, or similar, to pick up and verify the numbers just as quick or quicker than running the home sequence. Always more of a sure thing to verify against your actual part, rather than a switch.

Doc Nickel
03-17-2016, 03:00 PM
Thanks guys!

What we've got is we lucked out and found a prebuilt (albeit homebrew) controller that another home-shop type was selling, after converting a machine back to manual. It will run on Mach3, and includes prewired connections for limit switches. This conversion is an early effort for all parties involved, so we expect any number of screw-ups. :D I'd like to put in the limits if nothing else, just to hopefully cut down on the number of potential crashes.

Now, if one doesn't use limit switches on a homebrew setup like this, or doesn't use them to "home", how does one generally go about doing that? Telling the controller where the tool is by touching the workpiece?

Doc.

George Bulliss
03-17-2016, 03:16 PM
Now, if one doesn't use limit switches on a homebrew setup like this, or doesn't use them to "home", how does one generally go about doing that? Telling the controller where the tool is by touching the workpiece?

Doc.


Yes. However, I don't touch the workpiece; too much chance for a crunch. I use a 1" jo block and jog down until I can slide it under the tool with slight resistance. Then, I select the Z readout in Mach (making sure it's set to the work coordinate I'm going to use - G54 99% of the time). Then I type in 1.000 and hit enter. 1.000 will appear in the window and Mach knows that this tool is 1 inch above the work.

Note: I have an R8 spindle without repeatable toolholders, so I set each tool when changing and have nothing set in the tool tables. If you are using the tool tables, be sure that the correct tool is called up when setting.

Evan
03-17-2016, 03:20 PM
Micro switches work just fine but mount them so they don't get sprayed with any sort of cutting lube or other juice and keep the fine swarf away too. It is what I use on my CNC mill and I never bothered to switch to optical interrupters even though I have box full of them. Maybe I should put on the optical switches when I rebuild it in Victoria. Good time to do it.

And yes, you can home it however you like without using a home switch and it works fine. Just watch that you don't overrun the travel unless it will jam without breaking a belt or something. The motors on mine are enough to run it just fine but not powerful enough to break anything.

And I also don't use the tool tables.

Paul Alciatore
03-17-2016, 04:25 PM
Pitting of the contacts has been mentioned as a possible cause of inaccuracy of a homing switch. Switches are made with various styles of contacts for different purposes. Some switches are rated for many Amps of current and these are used when power must be switched. One of the drawbacks of this kind of switch is that they usually have a higher and more variable contact resistance. This can be bad for switching small signals like audio, video, and digital.

But there are other switches that have contacts that are designed for only very small currents, but they have much lower contact resistance and that resistance is much more constant from one activation to the next. If you tried to start or stop a 1/2 HP motor with one of these switches, you would probably destroy it instantly. But they are much better for the low level, low power signals I mentioned above.

So, if you need a limit switch that is going to directly interrupt the motor current, then you probably need one of the switches rated for the higher currents. Some "Micro Switches" are so rated.

But, if you are dealing with low level signals, then you are probably better off with a switch that is designed for that kind of signal. No audio or video involved here, but many, probably most controllers will have logic level signals for all these functions so a low level switch is called for. Again, some "Micro Switches" are so rated.

Both of these types of switches can be either exposed to the elements or well sealed against them. For a high positional accuracy, as needed for a home switch, you are probably limited to low power, low resistance type of switch.

You have to understand your circuit and pick a switch that is suitable. All switches will have a data sheet that explains these properties, perhaps in somewhat difficult to understand language. But if you just buy an unknown one from E-bay or the web, then getting that data sheet may be difficult or impossible. Kind of like buying and using mystery metal.

Doc Nickel
03-17-2016, 09:12 PM
Yes. However, I don't touch the workpiece; too much chance for a crunch. I use a 1" jo block and jog down until I can slide it under the tool with slight resistance.

-Seems to me like crashing into the gage block isn't all that much better than crashing into the workpiece. :D

But I get the idea. :)


If you are using the tool tables, be sure that the correct tool is called up when setting.

-We have a while to go before we get to things like tool tables. I haven't even mounted the steppers yet.


Micro switches work just fine but mount them so they don't get sprayed with any sort of cutting lube or other juice and keep the fine swarf away too.

-That's basically what I said in my original post. The plan at the moment is to mount some basic microswitches- the kind with the roller tip, and, as noted by another poster, set so that the moving part rolls over it, not crashes into it. The controller/power supply I have is already wired for them, and it should be easy enough to slap some on if I'm not too worried about protecting them.

It's very much a starter project, and I fully expect to make changes, redo mods and otherwise alter the plans. Eventually I want a small coolant enclosure, and if/when I do that, I'll likely have to also do things like shielding the ballscrews better, enclosing/protecting the steppers and belt drives, etc.

But I figure I'd best get it functional first, before I waste a bunch of time on the foofraws. :)


So, if you need a limit switch that is going to directly interrupt the motor current, then you probably need one of the switches rated for the higher currents. Some "Micro Switches" are so rated.

-Nope, these are signal-only connections wired to a MicroKinetics "motion control card", connected to dedicated limit switch terminals.

Meaning, if I understand it correctly, I should have no trouble using simple microswitches, and use them only for basic travel stops. And then use alternate methods for "home" and tool location. ... right? :)

Doc.

Evan
03-17-2016, 09:40 PM
To home it you install the cutter and then move it wherever you want home to be, then push the key on the keyboard and that is now home. It is dead simple and home can be anywhere the cutter can reach. Generally though "home" is always in the same place, determined by a home switch or in fact three home switches for X, Y and Z. Home and limit can be the same switches and usually are since the switches run through the software and do not directly interrupt any power. Some systems do have direct power limit switches which would be for large machines where the motors are powerful enough to do real damage in a crash. They will be just beyond the "home" switches by a few millimetres.

DR
03-17-2016, 10:31 PM
Commercial CNC's have a home position, usually at the extent of axis travels. Home usually would be MACHINE coordinates of X0, Y0, Z0. You also have PART coordinates represented by G54, G55, G56, and so on. These are known as WCS (work coordinate system).

G54 might represent a location on the table of X-5.0, Y2.0, Z-3.0 with respect to home. In the WCS table G54 would have those MACHINE coordinates.

When you program a part using the G54 it's PART coordinates would typically be X0, Y0, Z0 somewhere on the part.

This way you can have multiple jobs, fixtures, vises, etc and all can be programmed in PART coordinates using some feature of the part as the X0,Y0, Z0 location.

This makes life easier than having to indicate or edge find each part when machining multiple separate parts on the table. But, it does require accurate and repeatable determination of MACHINE home.

MaxHeadRoom
03-17-2016, 11:06 PM
Commercial CNC's have a home position, usually at the extent of axis travels. Home usually would be MACHINE coordinates of X0, Y0, Z0. You also have PART coordinates represented by G54, G55, G56, and so on. These are known as WCS (work coordinate system).

.

Although commercial systems typically use the home limit switch to initiate the home position, after which the encoder one pulse/rev Z pulse is searched for and then register a Home posn. it is a more accurate registration of Home.
I use the Galil motion cards which are also capable of Z pulse homing.
Max.

skunkworks
03-18-2016, 09:03 AM
As others have said - if the machine is small enough that it cannot hurt itself when it runs into the endstops - you could get by without any home/limit switches..

If you want to be able to easily re-setup known positions on the table or fixturing or tool tables - I would atleast put home switches on it. This would also allow you to easily run soft limits. The soft limits in linuxcnc are rock solid (we have a 25000lb machine that has never hit the over travel limit switches except when I forgot to home and jogged it into them) (nothing broken, as the over travel limits kills the power to the 7kw drives... :))

(and yes - this machine homes to the encoder index pulse after hitting the physical home switch.)

sam

Doc Nickel
03-18-2016, 10:56 AM
As others have said - if the machine is small enough that it cannot hurt itself when it runs into the endstops [...]

-That's the tricky part. While I have a good seat-of-the-pants feel for how powerful 2HP, for example, might be, I really have no idea how strong a 500-oz-in motor might be. Online calculators for figuring out how to properly size steppers for an application seems to be all over the place, and involve a great deal of guessing.

At the moment, I have access to a wide variety of steppers, ranging from 300 oz-in (about the size of a can of V8 juice) to 1,000 oz-in (about 2/3rds the size of a mason jar.) We're actually working on two machines, a lathe and a little Grizzly mill. The Grizzly showed up as already-converted by a previous owner, who had used 570-oz-in steppers, probably in part to get one strong enough to raise and lower the head.

But on the other hand, I've seen guys use 400-oz-in steppers on full-size mill-drills, and in one case, on a full size knee mill. I considered- by almost blind guess- that the 570s were a bit oversized for the little mill, and we're planning to replace them with some 270s.

Honestly, I have no idea how powerful they are. I'm quite new to steppers and their abilities. If I had, say, a 400-oz-in stepper on a 16mm ballscrew, driven by a 3:1 belt reduction, would that have enough power on a large mill-drill table, to break a screw/stepper mount made of 3/4" aluminum plate, fastened by a couple of 3/8" bolts? How about 500 oz-in? 1,000?

Doc.

skunkworks
03-18-2016, 12:07 PM
Well - what is your lead and efficency of the screw?

Simplest form F=((2pi*Torque)/lead)*ScrewEfficency

Screw efficency rules of thumb.. ball screw around 90%, acme around 30% (ball park - lots of variances..)

So (remember your units) a 300in-oz motor direct driving a 5 TPI ball screw.

((2pi*300in-oz)/.2in) *.9%efficency = 8482oz = 530 lbs. will 500lbs turn the ball screw or end bearings inside out? probably not.. But gives you an idea

http://www.cncroutersource.com/linear-force-from-torque-calculator.html

sam

skunkworks
03-18-2016, 12:15 PM
So - I forgot you had an example - we would need to know the pitch of the 16mm ball screw.

greystone
03-18-2016, 12:49 PM
And, as Sam well calculated, at 1:3, you are getting approx 1590 lbs of force.
And yes, its enough to break stuff, especially the ballscrew mounts/bearings and the small 16 mm ballscrews.

A 16 screw is likely to be approx 1200 kgf max static load, circa 600 kgf dynamic.

Doc Nickel
03-18-2016, 03:10 PM
And, as Sam well calculated, at 1:3, you are getting approx 1590 lbs of force.

-Wow, that is considerable. So a 570 oz-in would be even more overkill for a small desktop mill.

I'd already planned on the smaller motors for the mill (the aforementioned 270 oz in) and that one's getting 12mm 4 pitch ballscrews, but also with a 3:1 reduction, primarily to increase resolution without having to go down so far into the fractional microsteps.

I'll just have to try and remember not to let it crash into the end of the screw. :)

Doc.

elf
03-18-2016, 06:44 PM
While getting used to your machine, you can also lower the current in the stepper drivers so the motors don't have as much torque and won't do any damage when you hit the endstops.

skunkworks
03-19-2016, 03:14 PM
Remember though that the stepper torque rating is at rest. The second you start spinning the stepper - the torque goes down.

sam

MaxHeadRoom
03-19-2016, 03:21 PM
Remember though that the stepper torque rating is at rest. The second you start spinning the stepper - the torque goes down.

sam

Modern drives use Higher than rated voltage and PWM to maintain current as the rpm increases, the old way used to be with higher voltage and a series resistor, the idea is is to maintain the rated current, which drops significantly as rpm increases if only the rated voltage alone were used.
Max.

Doc Nickel
03-19-2016, 04:04 PM
Remember though that the stepper torque rating is at rest. The second you start spinning the stepper - the torque goes down.

-See, that's one of the things that was confusing me, as the rating of the stepper is given in "holding power", or some similar term.

And I understand the concept- it's essentially a "brake" to hold the screw and workpiece in place during whatever process you're doing. The stronger the stepper, the more it can resist cutting forces- the endmill doesn't displace the table or "gear walk" the part down the screw.

But as I said, I have a hard time translating that into "seat of the pants" data- essentially how powerful is the motor. Can the output of a stepper be accurately described, for example, in terms of horsepower? I know the holding power is at rest and HP would be at speed, so it's kind of an apples and oranges thing, but it kind of is the "while at speed" thing that interests me at the moment.

I believe the 270s I have are rated for a top speed of 2,000 RPM. What would that be in HP?

Doc.

Ridgerunner
03-19-2016, 06:08 PM
George, I use the same method on a lathe or horizontal machining center. For flat surfaces on a mill I use a Mitutoyo zero setter (http://www.amazon.com/Mitutoyo-950-111-Setter-0005-Height/dp/B002SG7R1O#customerReviews) to set the Z. The cheaper models are probably just as good.

http://i1122.photobucket.com/albums/l539/ridgerunner1212/Mitutoyo%20Z.jpg (http://s1122.photobucket.com/user/ridgerunner1212/media/Mitutoyo%20Z.jpg.html)


Yes. However, I don't touch the workpiece; too much chance for a crunch. I use a 1" jo block and jog down until I can slide it under the tool with slight resistance. Then, I select the Z readout in Mach (making sure it's set to the work coordinate I'm going to use - G54 99% of the time). Then I type in 1.000 and hit enter. 1.000 will appear in the window and Mach knows that this tool is 1 inch above the work.

Note: I have an R8 spindle without repeatable toolholders, so I set each tool when changing and have nothing set in the tool tables. If you are using the tool tables, be sure that the correct tool is called up when setting.

Evan
03-19-2016, 06:10 PM
While in theory it could be described in horsepower at various RPMs in the real world it won't make much sense. It very much depends on just what the motor is being called on to do and that varies moment by moment as moves occur. The speed of the motor changes when the system must navigate a change in direction and the amount of change matters. Even when it must simply make a 90 degree corner it will not do a true 90 but make a tiny circular corner when the CAD shows it as a true corner. It can be set so that it does true corners but that isn't usually used because the cutter must then make a full stop before it changes direction.

(note: a 90 degree corner is not necessarily aligned with the axes)

Steppers do not really do "steps" in real life. They are moving continuously and do not stop for every step they take. They accelerate when they start moving, then move at full programmed velocity and then decelerate as they come to a stop. The acceleration and deceleration happen very quickly, usually just milliseconds.



When the motor is overloaded it will then either skip steps or "slip" when it shouldn't move. With belt drive it is most often the belt that will skip/slip rather than the motor. Belt skipping usually doesn't cause damage but it immediately screws the job because the "home" position is lost as it is when any part does not exactly follow the steps it must take.