Welcome to Our Community

Some features disabled for guests. Register Today.

G-code to xyz positons

Discussion in 'DrawBot' started by SamFlynn, Dec 1, 2019.

  1. SamFlynn

    SamFlynn New
    Builder

    Joined:
    Nov 22, 2019
    Messages:
    3
    Likes Received:
    0
    Hey guys,
    Hope you all are doing well.

    Firstly forgive me if this is not he place to post this.I am a somewhat new to this cnc thing and probably answers already posted elsewhere ,but i feel so lost.

    So I built a 5 bar linkage mechanism using arduino and python.It uses 2 servos, an arduino mega, a 12v power supply,a dc-dc step down converter to power everything.
    The arduino's job is to to take two angle input in a csv format via usb serial input and rotate the servos to that specific angle.
    The python script's job is to take a xy input in csv format via terminal and calculate the two angles using inverse kinematics so that the end-effector reaches the desired xy position and send them to the arduino via serial.

    I have been seeing a lot of pen plotter videos recently and saw almost all of them use grbl and universal g code sender.
    What i want to do -
    So is there any scripts or something related which takes G-codes as input and outputs XYZ position of the toolpath in correect sequences so that
    I can just input those sequences in my python code to get the plots hopefully?
     
  2. Peter Van Der Walt

    Peter Van Der Walt OpenBuilds Team
    Staff Member Moderator Project Maker Builder Resident Builder

    Joined:
    Mar 1, 2017
    Messages:
    4,683
    Likes Received:
    1,623
    There should be existing "gcode parsers" for python. Check the usual repositories. I am not sure what those are for Python, if you were using nodejs i'd point you to the NPM repo keywords:gcode - npm search (Surely you python guys have a similar home to call home? Pip wasnt it?)
     
  3. SamFlynn

    SamFlynn New
    Builder

    Joined:
    Nov 22, 2019
    Messages:
    3
    Likes Received:
    0
    Thank You for your response,looking into pygcode module and the NPM repo
    -it is pypi :D
     
  4. Peter Van Der Walt

    Peter Van Der Walt OpenBuilds Team
    Staff Member Moderator Project Maker Builder Resident Builder

    Joined:
    Mar 1, 2017
    Messages:
    4,683
    Likes Received:
    1,623
    Sweeet! :)
    ahh yes: Python Package Index (PyPI) vs Python Package Manager (pip) lol!
     

Share This Page

  • About Us

    The OpenBuilds Team is dedicated helping you to Dream it - Build it - Share it! Collaborate on our forums and be sure to visit the Part Store for all your Maker needs.


    [email protected]

  • Follow us on Instagram

  • Like us on Facebook

  • Support Open Source FairShare Program!

    OpenBuilds FairShare Give Back Program provides resources to Open Source projects, developers and schools around the world. Invest in your future by helping others develop their future.

    Donate to Open Source
  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