Looking For Ideas: Detection of X=0 and Y=0 for CNC Machine

Hello Everyone
As many of you know, I am currently working on building a new CNC PCB Drilling machine, and as you might have guessed, I want this machine to be as accurate as possible, within the given limits of the hardware being utilized.
One of the key aspects of the machine is being able to zero the machine before any drilling commences. I could go hog wild and attempt to fully automate this process, but I believe that would be a bit of overkill, especially since I am trying to keep the cost and complexity to a minimum. With this in mind, I believe the best approach is a little human intervention to zero the machine. Before I tell you my idea, let me give you the basic idea of operation, which is as follows:
Now that you have the basic theory of operation, let's talk about implementation. I am currently thinking of drilling a hole in the clamping fixture at 0.00, 0.00, and having a laser mounted into the drilling spindle, with a reader positioned underneath the clamping fixture. When the laser light passes through the clamping fixture and is read by the reader, then 0.00, 0.00 will have been found.
Of course this idea of implementation is not carved in stone, and I am seeking other ideas that may be precise and easy to implement. So if you have any ideas, please feel free to provide your input.
Bruce
As many of you know, I am currently working on building a new CNC PCB Drilling machine, and as you might have guessed, I want this machine to be as accurate as possible, within the given limits of the hardware being utilized.
One of the key aspects of the machine is being able to zero the machine before any drilling commences. I could go hog wild and attempt to fully automate this process, but I believe that would be a bit of overkill, especially since I am trying to keep the cost and complexity to a minimum. With this in mind, I believe the best approach is a little human intervention to zero the machine. Before I tell you my idea, let me give you the basic idea of operation, which is as follows:
- The machine is turned on, at which point, the Propeller controller seeks a valid drill file from a SD-micro card reader and it also seeks valid readings from a X_Equals_Zero sensor and a Y_Equals_Zero sensor. If the input is incorrect, the Propeller controller outputs the errors to a LCD display, until the errors have been corrected. If errors exist, a red LED flashes until the errors have been corrected, and prevents further program execution. When all errors have been remedied, the red LED stops flashing and a steady green LED is displayed to indicate that the machine is READY and will allow drill file processing when the START button is pressed.
- When the machine is in a READY state, the PCB material is placed into a clamping fixture, and secured.
- When the START button is pressed, the machine processes the drill file.
Now that you have the basic theory of operation, let's talk about implementation. I am currently thinking of drilling a hole in the clamping fixture at 0.00, 0.00, and having a laser mounted into the drilling spindle, with a reader positioned underneath the clamping fixture. When the laser light passes through the clamping fixture and is read by the reader, then 0.00, 0.00 will have been found.
Of course this idea of implementation is not carved in stone, and I am seeking other ideas that may be precise and easy to implement. So if you have any ideas, please feel free to provide your input.
Bruce
Comments
Mickster
I appreciate the input.
In my opinion, I believe these would be much better for verifying commanded positions, as compared to zeroing. For zeroing, I believe on/off detection (light present/light not present) would be the simplest possible solution.
It appears that we may have similar interests pertaining to machinery and such, so you may want to have a look at this page, because it contains links to a wealth of information pertaining to optical sensing: http://www.optekinc.com/app_notes.aspx
Bruce
The laser idea sounds elegant, but I know on my machine, and with the materials I cut, a hole or spot or any other technique requiring optical reading wouldn't work because of debris.
-- Gordon
On most CNC machines, there are no absolute coordinates. The origin is wherever the operator says it is. On mine, I have manual controls to move it in all directions, both continuously and incrementally. Once I've got it where I want my origin (or some other point), I tell it what the coordinates of that point are. All three axes also have limit switches, but those are only to prevent over-travel; they're not repeatable enough for any kind of position calibration.
For routering PCB panels from the PCB fab, I clamp in a piece of particleboard and locate the lower left-hand corner manually (by eye for X and Y, with a feeler gauge for Z), then set the origin there and drill holes that match those at the edges of the panel. The panel is held in place with brass rivets and masking tape. After changing tools from the drill to the router bit, all I have to reset is the Z origin, again using the feeler gauge.
I think that any attempt to set an absolute origin with sensors would be both quixotic and, ultimately, not very useful. Just make it easy to do it manually.
-Phil
If you always return to 0,0 after a job, finding a registration hole ought to be fairly easy on power up.
From an arbitrary position this isn't going to work - you can seek to the endstops (those limit switches are not optional!) and then go to the registration mark approximately (using EEPROM data?). Then do proper calibration (since end-stop switches are low precision).
Seeking to endstops and back is time-consuming unless the 0,0 point is close to the endstops, note - this is a good reason to have it there (irrespective of where the board-clamp jig is.
Also don't forget to have some way to calibrate the Z-axis.
Jeff T.
I attempted to use momentary switches on my wire bender cnc as homing sensors, but the repeatability just wasn't accurate enough for me, which ended up causing me a lot of grief. I tried both a couple of detent switches as well as a couple of cheap RS switches. I am sure there are much more accurate switches than the ones I tried, but I believe optical would be more dependable than mechanical, however I could be wrong.
As far as the laser issue goes, yes debris would be a problem.
@Phil
Okay, I agree and partially disagree
Please consider that I am creating my own system here, all the way from exposure to drilling. The photo masks and PCBs are cut to size prior to exposure to match Gerber size and drilling, so X and Y on the drilling machine must match Gerber X and Y, so I really don't have the luxury of arbitrarily picking X and Y on the PCB material, like a router setup. But then again, I suppose that would all be dependant upon where the table is located.
To make matters worse, the microstepping drives, always start on a full step, or at least I believe they do. If energized, and if adjusted manually by overcoming the holding torque, I believe this also will only adjust to a full step. So then the option becomes to adjust it electronically through pulses.
However one your comments has some real value, with a slight change:
Changed:
Since the clamping frame will always have a 0,0 location, as established by the overall system, I could use a 0.125" rod to index (microstep) the machine by pushbuttons to a location of X = 0.0625, Y = 0.0625 (outer circumference of the rod barely touching both the left edge and bottom edge of the clamping frame), and programatically offset to establish 0,0.
Thanks for the input guys.
Bruce
I did not see your posts until my last posts. Thanks for the input.
Bruce
Either way.. good luck with the build!
In practice, travel toward limit switch, switch trips, stop, back off switch until switch turns off, you are now at 0. This should work reliably with optical IR and flags, so the mechanics of the switch aren't a variable.
Ideally, travel towards switch, trip, travel away from switch until reset, then continue traveling until you detect the Z index pulse, you are now at 0.
Most CNC machines look for machine zero, then the programmable WCS zeros are an offset from that.
Some very helpful information has been presented and I am sure it will all be useful at some point.
I am now more inclined with the KISS method as Phil suggested with my modification, along with a suggestion of Mark_T's. I believe I will use the knobs on the motor shafts to get the spindle center in close proximity of 0.0625, 0.0625, and then use two buttons, one for X and one for Y, to microstep the spindle with a chucked 1/8 index shaft to the exact point of 0.0625, 0.0625, and then programmatically set this as the current machine location. After use, I will return the spindle center to 0.0625, 0.0625.
I believe this should work well with minimal human intervention.
Bruce
EDIT: And of course recalibration will be necessary for each machine power up procedure.
On some of my tools I use a cheapy camera mounted to the Z axis to reference 0,0 . I have a micro synced to the camera scan lines, and have it overlay an artificial crosspoint target that shows up on the the TV display. This way TV "sizing" errors "fall out". To calibrate the position of the camera relative to your drill center, drill a hole, then move the platen to center the camera on that hole, and the number of x and y steps moved are the camera offsets from the drill.
Works very well, with an accuracy of a single step.
Cheers,
Peter (pjv)
Jim
Both of those methods sound very interesting, and I especially like the idea of the loupe and crosshair, however hooking up a camera and tv is beyond the scope of this particular machine. This is going to be a very small cnc machine, with all axises having a maximum travel of 4-1/16". The primary purpose of this machine will of course be drilling PCBs, so any feedback beyond necessary tool changes, percentage completed, and audible indications of errors or completion, would probably lead to extravagance. However, in the future, I may adapt the machine for small 3D printing and laser direct imaging.
It is noteworthy to mention that I have another nearly complete XYZ machine that may benefit tremendously from the ideas presented here, because it is a much larger machine, with no particular set purpose at this point in time. I am certain that when I get around to finishing that machine, I will return to this thread to read all the suggestions again. Most likely that machine will have a tv.
Bruce
'
I think the board edge is irrelevant.
'
I would look at finding drill hole #1 (X point) and make a zero or calibration point from there from the trace, Not the board edge.
'
Then I would find another drill point for the second zero or cal. point.(Y) from the trace.Not the board edge.
'
This might sound like over-kill but with a lot of traces, Through holes jumpers can short easily if the board is off just a little using the board edge method.
'
I was working on a parser that homed the #1 drill hole at the upper left of the drill table (X). From there I would select a drill hole closest to the lower right of the trace for (y)
'
This forced the trace to be in the right place, Regardless of the board edge,.
I use C in the list, snap acting and it is quite accurate. You need a longer throw on a plunger than a micro switch, this gives a good 3/8" push. For the CNC, I press a button to HOME, one at a time the Z goes up, hits the switch, backs off, sets Z pos to 0. Then Y moves back to hit the switch, same as Z, then X. When all have homed, they are auto set to 0 as the Machine Coordinates. These coordinates are static behind the scenes values. As Phil stated you can move to a position that is your board XY 0 points. You then zero out another set of coordinates that are for the board. The machine coordinates really do not need to be seen any longer unless there is a problem. Keep a set of values in the background called Board Offsets for XYZ in case(machine coords - board xy). For example, you are drilling, something goes wrong or a computer crash. If you had have made note of the OFFSET position which is the machine coords - the board position coords, you could very easily re HOME, move to the offset position and be extremely close to where you were to begin with. I do this all the time routing parts, have a crash or hit a part hold down or whatever, reboot, reposition part hold downs, whatever is needed to fix the problem, then move to the offset points and re-zero the board coords to 0.
Now, with small .031 drills for PCBs back when I put myself through a phase of home brews, I would be sure to set the bottom left of the pcb, then adjust the top right of the board it was tight with the x and y of the machine, regardless of how straight the boards were cut etc. I no longer make the actual PCB but do have a pick and place mod for a CNC including home brew software. I use fiducials on the bottom left of the board, and top right of the board. I always include 6-32 bolt holes on all my boards, the base the pcb sits on is predrilled for each boards' holes. I place the board, add 4 6-32 screws to hold it in place, and now I know the board is very close to in line with the machine XY trajectory since the machine drilled the mounting holes, and base jig mounts very consistently. On the pick and place, I do not do a homing process, only the CNC does homing as extreme ends of movement are required. On the pick and place, only a limited area is required with little chance of crashed the table, and the base is placed in the same spot each time, lined up on tslots with tnuts on the aluminum table. The pick and place gets zeroed out on either of the fiducials, usually lower left, move the needle to the center of a fiducial, press a button for 'set fiducial 1'. Fiducial 1 is stored as a coord just like a other coords, so it is a relative position. It sets the xy to the position of the fiducial, so all other parts are accurate relative to the zero of the fid. At any time you can check the position by pressing 'go to fiducial 1' or 'go to fiducial 2'. There is also a bias for board X, Y, and Z. If for any reason there is a slight offset on the board due to the screws not being centered or whatever reason, I can bias in real time on the fly the x,y and z, so the machine doesn't even stop running, but I can bump the needle over(bias) in .001 increments. This saves restarting or going back to a fiducial to check.
I like the idea of the afforementioned drill hole as a 'zero' position, only you are setting the machine to that holes xy instead of 0, this is the same as my fiducial use, but for a drill hole it may be more accurate to actually be in a hole.
A side note about drilling pcbs, I am not sure if you had discussed this, but it is far easier to drill after etching, the drill tends to locate itself inside the hole of the copper, and makes for much better hole placement than drilling first. I doubt you would do the reverse but just mentioning it.
Regarding homing, you can use just one switch, but set up some Soft Limits (software limits) so the machine is not allowed to move past the behind the scenes machine coords and crash the table.
As far as encoders etc, I have done that on steppers, and found it to be a giant time vortex for no real value. Accelerate and decel nicely and keeping track is not required. However, if your issue is more about trying to get back to a repeatable place, the switches I mentioned will solve that, but I recommend a +-.001 resolution bias feature for real time tweaks adjustments regardless. You may be drilling, and see that the drill seems a little shy on the X, just hit the -> bias button a few times based on a guess, say .002, and the next drill move will add or subtract the bias from the actual position it should move to. That combined with using an actual hole for reference is pretty solid.
I am looking at things from a much different perspective, because this will be a unique setup, but I can relate to the confusion.
Referring to what Phil stated earlier:
And I replied:
This machine will run on absolute coodinates.
Since the boards and masks are cut to size in relation to the board size established within a Gerber file, all coordinates become absolute, therefore establishing 0.00, 0.00 is of the utmost importance, as well as the squareness of the cuts of the masks, PCB material, and clamping framing, in addition to the resolution of the entire system and any backlash associated with that system.
If I do not establish 0.00, 0.00 on the drilling machine to match Gerber file 0.00, 0.00, I am dead in the water. This 0.00, 0.00 location will theoretically never change. Each and every board to be processed will start at this same 0.00, 0.00 machine location, each and everytime.
Bruce
If you are building the machine and I assume the software, why do you limit yourself to absolute coordinates? Makes no sense to me Bruce. If I were drilling on a machine, I would export the xy out of Eagle with a simple ULP included in it but modified to inch. Import the coords, locate a zero point or reference point(drill location) or fiducial or whatever. Sounds like a rigid plan to have no access to offset when the code for such is nothing to add. Never would I base the drill points on the home switches or some linear/rotary encoder referenced to some start point. I am sure you have some reasons in your head for the decisions, but you are the designer! Change it to a more practical concept with offsets and bias and save yourself headaches. IMHO
That zero is translated to the work area with precision stops and or fixture mounts. Most shops standardize all of this to bring tooling portability across their processes for a considerable savings.
All the standard G-Code I've worked with includes an offset and some have a transform too, but all have a basic offset. This is what the operator uses to deal with job specific variances. Said variances may come from a fixture that's not aligned with the machine zero, need to apply machining to an already manufactured part, etc...
General practice is to write the program for machine zero, and or tool center zero. The operator then can adjust the offset, and or transform if the part is rotated, etc... and adjust tool compensation as needed to realize the correct manufacturing result.
For a one off type machine, I think it can make sense to simply origin at the time of manufacture, but it's not really best practice, nor does it scale well at all. That's my experience and .02c
Maybe not theoretically. But an awful lot depends on how accurately you trim the board to begin with. Can you trim it to within a couple mils and make sure the corner is absolutely square? BTW, you can't use a bench sander to refine your cut or square up an edge. FR4 simply chars (and stinks) under those circumstances.
The way I would do the alignment is to print a couple copper donuts in opposite corners of the PCB. Each will give you a little dimple that you can accurately drill on your drill press. Next, drill the same holes in the underlayment on your drilling machine. Then you can use pins to position your board in the machine.
BTW, plan on using fresh underlayment for each new board design. Otherwise you risk breaking those brittle carbide drill bits, should one encounter an old hole that's just slightly offset from the one being drilled.
-Phil
This PCB Drilling Machine is based upon the exposure plate assembly of my Exposure Box/Cylinder. All positions are absolute.
Failure is the worst possible outcome, but it is not a terrible outcome. If the drilling machine fails to perform as I expect, I will simply modify a few things. I will bend it to my will.
Bruce
Yes.
Bruce
-Phil
That is a very good tip
Thanks Phil.
Bruce