Welcome to Our Community

Some features disabled for guests. Register Today.

Camera edge finder.

Discussion in 'CNC Mills/Routers' started by Jonny Norris, Aug 26, 2015.

  1. Jonny Norris

    Jonny Norris Well-Known
    Builder

    Joined:
    Aug 17, 2014
    Messages:
    495
    Likes Received:
    95
    Hi there, fellow open builders, Heres a video of my camera edge finder arrangement and offset macro.

    This idea has been around a while but thought I'd share as I think it's wicked, makes setup much quicker. You don't have to use a screen, Mach 3 and uccnc have a webcam plugins that have crosshair overlays that are in fact better, only you need a usb video adapter and I find they are slightly resource heavy, and this old laptop wasn't really up to it so the screen in my case works better. The setup cost around £30-40.

     
    #1 Jonny Norris, Aug 26, 2015
    Last edited: Aug 26, 2015
  2. Jonny Norris

    Jonny Norris Well-Known
    Builder

    Joined:
    Aug 17, 2014
    Messages:
    495
    Likes Received:
    95
    Though if you do make one, it's a good idea to check the orientation of the camera before making the mount for it :s lol

    The macro was probably the hardest part to do being that I use uccnc and seems I am the first to share an offset macro for, with a little help from forum users that is. though there is one floating around for Mach 3. So if you use either of these your sorted, both being available on Cnczone. Wouldn't know how to go about it with grbl.

    You can use a laser instead of a camera to the same effect
     
    #2 Jonny Norris, Aug 26, 2015
    Last edited: Aug 30, 2015
  3. Tweakie

    Tweakie OpenBuilds Team
    Moderator

    Joined:
    Jan 18, 2014
    Messages:
    784
    Likes Received:
    326
    Nice work JN, a useful addition. :thumbsup:

    Tweakie.
     
  4. Jonny Norris

    Jonny Norris Well-Known
    Builder

    Joined:
    Aug 17, 2014
    Messages:
    495
    Likes Received:
    95
    The uccnc offset macro i wrote for it:

    if(!exec.GetLED(56)||!exec.GetLED(57)||!exec.GetLED(58)) // If machine was not homed then it is unsafe to move in machine coordinates, stop here...
    {
    MessageBox.Show("The machine has not yet been homed, HOME before executing camera offset M33!");
    exec.Stop();
    return;
    }

    AS3.Setfieldtext("",900);
    if ( (exec.GetXmachpos() == 0.000) & (exec.GetYmachpos() == 0.000) & (exec.GetZmachpos() == 0.000) ) // checks to see if machine is is still at home position
    {
    MessageBox.Show("The machine is still at HOME position! Position camera on edge(s) and restart macro");
    exec.Stop();
    return;
    }
    else
    AS3.Setfieldtext("The Machine is ready to do Function",900);//sets uccnc status to say ready, not a requirement.


    AS3.Setfield(12.34, 226); // x offset value (12.34)
    AS3.Validatefield(226);// applies offset value to x


    AS3.Setfield(12.34, 227); // y offset value (12.34)
    AS3.Validatefield(227);// applies offset value to y


    exec.Wait(1000);


    while(exec.IsMoving()){}


    exec.Code("G900 Y0");// moves to zero


    exec.Wait(1000);


    while(exec.IsMoving()){}


    if(!exec.Ismacrostopped())


    {
    MessageBox.Show("Camera offset finished!");
    }
    else
    {
    exec.StopWithDeccel();
    MessageBox.Show("Camera offset interrupted by user!");
    } // reports if an estop before offset and goto zero was completed


    If you save as m200 in uccnc it is called by p1 button or by calling the macro manually in command line
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice