Code Monkey home page Code Monkey logo

sam-freitas / python_to_grbl Goto Github PK

View Code? Open in Web Editor NEW
17.0 1.0 5.0 18.59 MB

A simple open-source python ๐Ÿ to grbl ๐Ÿค– sender || Controlling 3-axis GRBL/CNC/gcode machines with python over a serial/usb connection that waits for completion of movement before sending the next command

License: MIT License

G-code 1.63% Python 65.86% MATLAB 32.51%
python grbl grbl-firmware grbl-control python-3 python-ioc motion-control cnc cnc-controller cnc-programming

python_to_grbl's Introduction

Controlling GRBL/CNC/gcode machines with python or MATLAB

This simple implementation is an example of how to contol CNC machines running GRBL with python

This script converts the supplied .gcode into movement without the use of a dedicated controlling application (e.g. CNCjs, OpenbuildsCONTROL, etc)

I built this becuase a lot of the documentation for sending a stream of gcode to a grbl controller was written in python2 and no longer worked with python3 syntax. Additionally, many of the implementations did not buffer or wait for commands to finish before going onto the next, my script is an attempt to fix these issues

All tweaking and setup of the grbl controller should be done in an outside program (I recommend CNCjs), all this script does is read grbl_test.gcode and feeds each individual line to the grbl controller, waits for completion of said line, and then moves onto the next line of gcode.


How to use:

install python prerequisites

  python -m pip install pyserial

You most likely will have to change the COM port in simple_stream.py (or .m) to the associated port (Correct port can be found in an external CNC control software ex. CNCjs).

Note: Linux/Max COM ports have a different name and path type than windows com ports

run:

  python simple_stream.py

tested on:

MacOs (M1 Monterey arm64)
Python 3.9.5 | packaged by conda-forge | (default, Jun 19 2021, 00:24:55) [Clang 11.1.0 ] on darwin
Vscode 1.62.3
Openbuilds BlackBox GRBL controller
GRBL 1.1

Alt Text

python_to_grbl's People

Contributors

sam-freitas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.