Welcome to Our Community

Some features disabled for guests. Register Today.

Set Zero Point / find Edge with Webcam ?

Discussion in 'CNC Mills/Routers' started by boskap, Sep 9, 2015.

  1. boskap

    boskap New
    Builder

    Joined:
    Jun 23, 2015
    Messages:
    49
    Likes Received:
    3
    Hello

    is ist possible to set the zero point for x/y per webcam with any software (Grbl Panel, Universal G code Sender, GRBL Commander)
    Or is there any other Software witch ist compatible with cnc xpro v2 where I can set zero point with webcam

    thx
     
  2. Jonny Norris

    Jonny Norris Well-Known
    Builder

    Joined:
    Aug 17, 2014
    Messages:
    495
    Likes Received:
    95
    yes it is possible, you need to write a macro.

    did you see my post by any chance?

    http://www.openbuilds.com/threads/camera-edge-finder.3295/

    here is the uccnc macro i wrote, maybe you can use as inspiration.


    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("Theine 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


    Good Luck
     
  3. boskap

    boskap New
    Builder

    Joined:
    Jun 23, 2015
    Messages:
    49
    Likes Received:
    3
    Thx

    but I cannot start any scripts in the Software I can use
    And Mach 3 is not Supporting the cnc xpro v2 board

    Is there a way with software like the Grbl Panel, Universal G code Sender, GRBL Commander
    work UCCNC with the cnc xpro v2 ?
     
  4. Jonny Norris

    Jonny Norris Well-Known
    Builder

    Joined:
    Aug 17, 2014
    Messages:
    495
    Likes Received:
    95
    You can write macro scripts for grbl apparently. Sound like you need a different version of grbl
     
  5. boskap

    boskap New
    Builder

    Joined:
    Jun 23, 2015
    Messages:
    49
    Likes Received:
    3
    the board has grbl 0.9i
    but how can i start the Macro in grbl Panel or grbl commander
    they have no Buttons for macros
     
  6. Jonny Norris

    Jonny Norris Well-Known
    Builder

    Joined:
    Aug 17, 2014
    Messages:
    495
    Likes Received:
    95
    Can you manually enter gcode? Just type m200 if it's saved as m200.txt if it works the same way that is.
     
  7. boskap

    boskap New
    Builder

    Joined:
    Jun 23, 2015
    Messages:
    49
    Likes Received:
    3
    yes i can
    but m200 says unsupported command

    • Supported G-Codes in v0.9i
      • G38.3, G38.4, G38.5: Probing
      • G40: Cutter Radius Compensation Modes
      • G61: Path Control Modes
      • G91.1: Arc IJK Distance Modes
    • Supported G-Codes in v0.9h
      • G38.2: Probing
      • G43.1, G49: Dynamic Tool Length Offsets
    • Supported G-Codes in v0.8 (and v0.9)
      • G0, G1: Linear Motions
      • G2, G3: Arc and Helical Motions
      • G4: Dwell
      • G10 L2, G10 L20: Set Work Coordinate Offsets
      • G17, G18, G19: Plane Selection
      • G20, G21: Units
      • G28, G30: Go to Pre-Defined Position
      • G28.1, G30.1: Set Pre-Defined Position
      • G53: Move in Absolute Coordinates
      • G54, G55, G56, G57, G58, G59: Work Coordinate Systems
      • G80: Motion Mode Cancel
      • G90, G91: Distance Modes
      • G92: Coordinate Offset
      • G92.1: Clear Coordinate System Offsets
      • G93, G94: Feedrate Modes
      • M0, M2, M30: Program Pause and End
      • M3, M4, M5: Spindle Control
      • M8, M9: Coolant Control
     
  8. Jonny Norris

    Jonny Norris Well-Known
    Builder

    Joined:
    Aug 17, 2014
    Messages:
    495
    Likes Received:
    95
    Urm I can't really advise much here anymore I'm afraid, I have very little experience with grbl, but can you find the files that relate to the supported mcodes ? If so I expect you need to choose one you don't use and overwrite it.

    Try searching in Google "writing grbl macro" see what it comes up with.
     
  9. Jonny Norris

    Jonny Norris Well-Known
    Builder

    Joined:
    Aug 17, 2014
    Messages:
    495
    Likes Received:
    95
    Think this should work for a manual way of doing it.

    G10 P1 L20 X [offset] Y [offset]

    If grbl doesn't support macro then it's most likely you need a gui to do it.
     
    Ernest Sutherland likes this.
  10. boskap

    boskap New
    Builder

    Joined:
    Jun 23, 2015
    Messages:
    49
    Likes Received:
    3
    Thx for your Support
    I try it and give you feedback
     
  11. Jonny Norris

    Jonny Norris Well-Known
    Builder

    Joined:
    Aug 17, 2014
    Messages:
    495
    Likes Received:
    95
    No problem best of luck with it.
     
  12. boskap

    boskap New
    Builder

    Joined:
    Jun 23, 2015
    Messages:
    49
    Likes Received:
    3
    so my test
    first i Zero x and y
    i jog with the cam to the edge
    with G10 P1 L20 X [offset] Y [Offset] i can set the Offset of the cam and then
    i send G00 X0.0000 Y0.0000
    then the spindle move to the Zero

    i think that work
    i only search for a way to have a macro for this
     
  13. Jonny Norris

    Jonny Norris Well-Known
    Builder

    Joined:
    Aug 17, 2014
    Messages:
    495
    Likes Received:
    95
    yup thats the long and short of it
     

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