Hello Guest it is August 20, 2019, 01:59:42 AM

Author Topic: Optical Registration Mark Reading With Mach3  (Read 17610 times)

0 Members and 1 Guest are viewing this topic.

Optical Registration Mark Reading With Mach3
« on: January 06, 2014, 06:38:09 PM »
Hello everyone,

This is only my second post on here but this is something that has been on my mind for over a year now and I've finally decided to see if something can be done about it or not so here goes.

First a little background.

I am in the signage industry and also do the majority of my CNC work as part of that. Having a CNC machine in this work really isn't an option anymore and we can't really imagine doing most of our work without one.

There is a problem though - of course.

A big part of the work that we do is made up of printing a graphic, laminating (applying) it to a hard substrate like foamex (PVC foam board) and then contour cutting it out to a shape, that usually looks something like this -

The problem here is that we usually do the cut with a jigsaw manually because it is much faster and safer (for the workpiece) than trying to do it our CNC.

Obviously doing complex contour cuts on the CNC router would save a lot of time and just be all around much easier than doing it by hand but right now that usually entails that you make some kind of registration mark in the artwork during preparation for print. Then you would have to export the outline of the artwork, as well as the registration mark, DFX/DWG/whatever and use that to generate your g-code for cutting later on. Then you apply the print to the board substrate and put it on the CNC for cutting, and here's the rub. At this point your work piece has to be perfectly aligned with the machine so that when you set your zeros on the registration mark, which serves as a reference to where the artwork is, that it cuts exactly along the contour. Doing this once or twice isn't that challenging but having to do it all day long quickly becomes tedious.


Now if it could be somehow accomplished that a camera reads those registration marks and that then software adjusts the angle of the registration marks in the g-code accordingly to the ones that the camera read then this whole problem would be eliminated. Initially I just assumed that doing this was far too complex to be attempted by a hobbyist but lately I noticed that Mach3 seems to have video capabilities and based on Tweakie's replies on a thread that someone else made to this question it seemed to me that it was implied that this wouldn't be too hard to do.

If all of this was too convoluted to understand I apologise but this video should explain in a few seconds what I tried to explain in 500 words here

http://www.youtube.com/watch?v=s3MeHLluzC0
(tried embedding this but didn't work)


Systems like this certainly exist but they cost thousands to tens of thousands of dollars which is not viable for me.


I do hope that someone with deeper understanding of these things can shed some light if doing this is possible or not.


In any case I'm looking forward to the replies.

Offline Tweakie.CNC

*
  • *
  •  7,884 7,884
  • Super Kitty
    • View Profile
    • Tweakie.CNC
Re: Optical Registration Mark Reading With Mach3
« Reply #1 on: January 07, 2014, 02:49:07 AM »
The angle of rotation and linear scale aspects are no problem for Mach3 to resolve (as I think I demonstrated in my short video) but, as yet, there is no software to make the camera recognition of the registration marks automatic, it has to be done manually.

As I always say; everything is possible it just requires time and effort.

Tweakie.
Success consists of going from failure to failure without loss of enthusiasm.  Winston Churchill.

Offline RICH

*
  • *
  •  7,351 7,351
    • View Profile
Re: Optical Registration Mark Reading With Mach3
« Reply #2 on: January 07, 2014, 06:11:39 AM »
FWIW,
Maybe consider changing the sequence or manor in which your do your work.

IE. Mount the board with print attached anyway you wish on the router table. Then use CopyCat  along with a cheap camera to trace out the outline and generate the gcode pathing
for the cutting. Using an Xbox 360 controller to poistion the camera cross hairs will make tracing out the outline quicker and easier. After a little practice you will find that you can do this quite easily and rapidly, certainly not as fast as what you show in the video. Just depends on how accurately you want the cutting to be ( it can be very accurate).

I would say to trace out the top of one panel you show in the pic wouldn't take more than 15 minutes. For the other duplicate panels, you already have the gcode, so use CopyCat to
find the work offset required or even rotation, minor gcode change to the first program. No DXF, etc!

For a business may not not be the cat's meow, but it is economical, only you can do the math for what makes sense.

May be worth investigating. You will find a manual for CopyCat in Member's Doc's.
http://www.machsupport.com/forum/index.php?action=dlattach;topic=10498.0;attach=13710

RICH
« Last Edit: January 07, 2014, 06:21:52 AM by RICH »
Re: Optical Registration Mark Reading With Mach3
« Reply #3 on: January 07, 2014, 07:13:19 AM »
First of all thank you both for your replies.

I think that the simplest and fastest solution may be to add a certain amount of bleed to the print so that you have some more wiggle room but even then you don't want to go too deep into the bleed cause you want as little excess color around the print itself.

Anyway I think that having a pair of laser crosshairs on the CNC head would be the fastest solution. In that case I would just export the registration marker and an outline of the work piece to g-code and then when adding the workpiece to the CNC table I could use the laser crosshairs to position the workpiece at an perfect angle then I could just place the bit onto the middle of the registration marker, set that as the zeros and start routing.

Still having a camera system would be easier and faster.


I don't have a programing background but how hard would it be to make a piece of software that would take a video, look for the registration markers based on the g-code (or dxf or whatever) and then compare their angle to the g-code and align to the g-code to what it saw ?

Offline Tweakie.CNC

*
  • *
  •  7,884 7,884
  • Super Kitty
    • View Profile
    • Tweakie.CNC
Re: Optical Registration Mark Reading With Mach3
« Reply #4 on: January 07, 2014, 07:52:03 AM »
Quote
I don't have a programing background but how hard would it be to make a piece of software that would take a video, look for the registration markers based on the g-code (or dxf or whatever) and then compare their angle to the g-code and align to the g-code to what it saw ?

Because the machine’s camera is unlikely to be able to view the whole job in one frame and it would be a waste of machine hours scanning the total work area just looking for the markers my suggestion would be…

A software program (plugin) to view an on-screen display of the original artwork where pixel size versus steps per unit is known – using the mouse, the registration marker positions are located and stored, their position is then translated to the necessary X-Y co-ordinates for the machine to move the camera / machine head to each selected marker. The camera then centres each registration mark in turn or is used to determine the difference in the pixels position (not sure just how to do this yet but there must be a solution) and the difference between actual position and original image position of each marker is calculated. This data is then used to set the Mach3  X and Y scale factors (if necessary) and ‘local system rotate’.

It would be challenging project to do but, in my opinion, it is entirely possible.

Tweakie.
Success consists of going from failure to failure without loss of enthusiasm.  Winston Churchill.
Re: Optical Registration Mark Reading With Mach3
« Reply #5 on: January 07, 2014, 08:54:36 AM »
I wrote a plugin years ago, (among other things) I use for alignment calculation. Gives me lots of data.
Setting the first location to 0,0 and then going to the second location I can see the angle to set rotation axis G68 to.
I first did it with a macro pump then went on to make it a plugin to add all 6 axis.
So yes anything (for the most part) is possible with Mach. Its just what are you willing to live with.

Crude but might be effective for you;
You could use the camera find the first reg mark, take a small pin to pivot on that reg mark, set axis's to 0,0  and then rotate the whole image manually. Moving in only one axis use the camera to align the second reg mark. Would work good with Vacuum tables.

Offline Vogavt

*
  •  258 258
    • View Profile
Re: Optical Registration Mark Reading With Mach3
« Reply #6 on: January 11, 2014, 09:37:40 AM »
Did you post the plugin somewhere?

me wants, me wants!! ;D

I look for it on your website.

Dude,
That's some serious wood carving you been doing!

Sent you an email.
« Last Edit: January 11, 2014, 09:51:38 AM by Vogavt »
Re: Optical Registration Mark Reading With Mach3
« Reply #7 on: January 12, 2014, 07:03:27 AM »
Quote
I don't have a programing background but how hard would it be to make a piece of software that would take a video, look for the registration markers based on the g-code (or dxf or whatever) and then compare their angle to the g-code and align to the g-code to what it saw ?

Because the machine’s camera is unlikely to be able to view the whole job in one frame and it would be a waste of machine hours scanning the total work area just looking for the markers my suggestion would be…

A software program (plugin) to view an on-screen display of the original artwork where pixel size versus steps per unit is known – using the mouse, the registration marker positions are located and stored, their position is then translated to the necessary X-Y co-ordinates for the machine to move the camera / machine head to each selected marker. The camera then centres each registration mark in turn or is used to determine the difference in the pixels position (not sure just how to do this yet but there must be a solution) and the difference between actual position and original image position of each marker is calculated. This data is then used to set the Mach3  X and Y scale factors (if necessary) and ‘local system rotate’.

It would be challenging project to do but, in my opinion, it is entirely possible.

Tweakie.


I'll do some research to see if there is anything similar in the "open" out there but I don't code so the chances of pulling this off at this point are slim.

Besides this isn't something that needs doing right now, we plan on using it on a new machine which we don't even have yet but I thought if I could figure it all out by the time we get the new machine I could have it implemented shortly afterwards and we could start using the system relatively quickly.

At this point I think it would be easier to just create the design with a + shaped reg mark, a decent amount of bleed, do the print and export that reg mark and an outline of the print to a dxf, handle it in the cam software, set the machine zero of the work in the middle of the + mark and then, possibly, use a pair of lasers to perfectly align the substrate so that the X and Y are straight. Then simply set the zeros in Mach3 to the middle of the + mark and that should be precise enough to get it to cut out properly.

The camera setup is certainly something to keep thinking about though, not giving up on it just yet but this is more realistic for now.
Re: Optical Registration Mark Reading With Mach3
« Reply #8 on: January 15, 2014, 12:51:42 AM »
Not trying to discourage your efforts to find a programming solution, but if I were doing mass production of something like this, here is what I do:
Mount a spoil board onto the table, and use a drill to locate your registration marks on the substrate. Install alignment pins into this first piece of substrate, and into the spoil board. Run your gcode to cut out your profile of this first piece. Remove the piece, and mount the second (and each subsequent piece) onto the alignment pins of your spoil board (after drilling the holes at your registration marks of the piece), and run the gcode again. Sometimes, the simplest solution to overcoming technical limitations can be achieved by just looking at the actual task at hand. (NOTE: locate these registration marks in an area of the substrate that is to be removed, when cutting the profile- this will eliminate the drilled holes from the finished product!) Hope this helps.
Re: Optical Registration Mark Reading With Mach3
« Reply #9 on: January 22, 2014, 06:00:49 PM »
This is how I would contour cut something. You place the print on cnc table anyway you want. Then you jog to first registration mark (bottom left on computer) and set X0Y0. Then jog to next registration mark and write down XY coordinates. After that you calculate the angle (arctan(X/Y)) and use g code G68 for coordinate system rotation.

I hope you can understand, I'm not good in English :)