Page 1 of 5

Video cam based profile probing

PostPosted: Sat Nov 23, 2019 1:05 am
by eabrust
Howdy all,

I've been inspired by the 'Scanything' plugin for Mach3 for a long time, despite that fact I've never gotten it to work right for me or fully tested it on my machines. Add to that fact, I no longer really use Mach3...

But to get back to the point, thanks to Les Newell for generally inspiring me to try and make a copy :)

For fun, I've been slowly learning how to implement all the pieces to make a similar app for UCCNC, and have finally gotten far enough to not give up :) This video should give an idea of what the primary function will be, to trace profile shapes and save data.




In its current state, it's also able to target centroids of shapes and move to centers. I mainly implemented this currently just for tuning PID values for tracking and getting axis control under control.



Obviously, there are plenty of hiccups to fix, but the point was to figure out how to be able to capture a camera image, process image to find edges/shapes/targets, and make UCCNC move to the targets. I'm pretty excited its gotten this far!

Currently, I don't even have a name for the plugin..., but I thought it might be fun to bounce this off the group, and get some input on how many people might find this plugin usefull and actually use it, and what else to try to implement? Not saying every suggestion would be doable, but it may be easier to pre-plan suggestions while in the early stages before the plugin gets too set in its ways, and have a fun discussion.


regards,
Eric Brust

Re: Video cam based profile probing

PostPosted: Sat Nov 23, 2019 8:16 am
by beefy
Congratulation on getting as far as you have. I doggedly learned coding and all sorts of other stuff to eventually built my own working THC that talks to UCCNC. More of an obsession than anything else.

I'd certainly be interested for one. I wish there was Scanything for UCCNC.

Keith

Re: Video cam based profile probing

PostPosted: Sat Nov 23, 2019 12:48 pm
by Tweakie.CNC
Excellent work Eric - I would be interested in one also.
As for a name, how about UCopy.

Tweakie.

Re: Video cam based profile probing

PostPosted: Sun Nov 24, 2019 8:22 am
by Robertspark
Eric, i would buy a copy of your efforts

You can link the plugin to the licence (hardware serial number) if you want to.

Following on tweakie's idea

UCanCopy / UCanScan
UCamCopy / UCamScan / UCamTrace

Re: Video cam based profile probing

PostPosted: Sun Nov 24, 2019 12:16 pm
by eabrust
Thanks for your thoughts and feedback guys. I appreciate the name suggestions as well. Sometimes its the little things like... what to call something that is hard to figure out... UCamCopy or UCamScan sounds good and to the point of what it does!

I'll keep you fellas posted when I think I have it stable enough to test and ask if you're willing to try it out for testing. As of now, I'm testing on an office PC (Win10, x64, using UC100 only to emulate a machine), and on my router PC (Win7, x86, using UC100). I've also got a UC300eth on my mill I'll try (also Win7 x86).

I'm also using two different cheap microscope cameras to test (one does about 15fps at 640x480 on my router, the other does ~30 at 640x480 in the office). So far it seems to work on some lower end PCs (core 2, integrated graphics, etc), but the cameras optical zoom/multiplication may be the thing that has the most influence, and is where input from others may help.

Keith, I quite understand what you mean about a project becoming an 'obsession'... :lol:

regards,
Eric Brust

Re: Video cam based profile probing

PostPosted: Sun Nov 24, 2019 2:34 pm
by Robertspark
I forget what camera i have but its one of those cheap pencil magnifying types....

Works fine with scanything (providing you dont mount it the wrong way around.....).... Has an alignment mark on it now.....

Struggled a bit with big parts on the plasma table as the focus can vary over the bed.... Plus contrast of shiny objects too (hence i use black hair spray temporary dye in a can )

Re: Video cam based profile probing

PostPosted: Sun Nov 24, 2019 9:51 pm
by beefy
Robertspark wrote:Eric, i would buy a copy of your efforts


Like Robert I'd be happy to pay too.

If Scanything had a UCCNC version I'd be paying for that in any case. I believe a guy should be rewarded for his efforts.

Re: Video cam based profile probing

PostPosted: Mon Nov 25, 2019 1:02 am
by ger21
I'd also be willing to support the cause, but it may be a year or two before I could do any testing.
Possibly buying a new house in the spring, so the next year is already accounted for. :evil:

Re: Video cam based profile probing

PostPosted: Mon Nov 25, 2019 2:17 am
by eabrust
ger21 wrote:I'd also be willing to support the cause, but it may be a year or two before I could do any testing.
Possibly buying a new house in the spring, so the next year is already accounted for. :evil:



A year..., Good luck with that Gerry! :) We moved 6 years ago, and house projects still consume most my hobby time... It was fun designing the kitchen and doing the cabinets myself, so thank goodness doing the cabinets on the router sort of fit into the hobby rather than just pure work...

regards,
Eric

Re: Video cam based profile probing

PostPosted: Wed Nov 27, 2019 3:16 am
by eabrust
Figured it may be fun to keep a running update as I work on this plugin, now to be known as UCamCopy (thanks Rob and Tweakie). Feel free to have a dialog and ask questions about how things work or how I did things if you are curious and want to start creating plugins. I'm not a programmer, and definitely not qualified to teach anyone anything about programming, so it could make it fun :)

Over the last few days, and much angry head scratching I finally fixed an error that was preventing the plugin from completing a full lap around parts.... thanks ATAN2.... :roll: After fixxing that, I've since added in some point sampling at regular distance intervals to dump data points to a comma separated text file, and added two more PID loops to try and keep the target on track (total of 4 PID loops running concurrently, who's output drives the X and Y axis velocity).

So here's the first test output: I had a really good comparison part to do a test with, since I had the original geometry in VCarve, and I had previously cut the part on this router. Here's that first part scanned with the plugin, dumped out to a CSV file, and imported back into vcarve (thanks Paul Rountree for the CSV plugin!), and layed back over the part for comparison. I let it make about 3 laps around the outer perimeter while playing with tuning and speed to see how repeatable it was. PS. Bonus points if anyone knows what this part is from, or has made one (hint, search out Derek Hugger for a some fascinating things...).

UCAMcopy1 Test1.JPG


UCAMcopy1 Test2.JPG





I'm pretty happy, considering the comparison includes any errors of both the measurement, and the original cutting, plus deviations from shadows, etc.. I also haven't really spent time making sure the camera is absolutely vertical, etc.

Here's a question for Scanything users, what sort of speed can you scan at? This was run between 5 to 10 inch per minute, which sort of sounds slow except the machine really can't 'see' very far ahead, so I don't think in reality I could go much faster with the current camera setup and stay on track.

regards
Eric