GithubHelp home page GithubHelp logo

netduino-gcode's Introduction

Netduino-GCode

A GCode parser written in C# for the netduino platform. G-code (http://en.wikipedia.org/wiki/G-code) is a standard language used in automation (CNC, numerical control) to instruct machines the movements they need to perform in other to build a shape designed in a CAD program. That CAD model is then converted to GCode by some CAM software and that GCode is parsed by this software to generate machine movements.

Components

The software is divided in several components:

  • The netduino application: this is the GCode parser that runs in the netduino and translates GCode to pulses suitable for stepper motor drivers. Currently it receives the GCode through the network connection of the netduino plus (through a socket listening server).
  • A viewer application on the PC side feeds the GCode file to the netduino and visualizes progress of the operation. This is a 3D viewer of the GCode toolpaths in the file. It was used to debug the parser and visualize the GCode paths while in development. Here is a screenshot:

Screenshot of the viewer in action

It is also possible to connect to the netduino directly via telnet and paste the gcode over that connection. By default, it is listening on port 82.

Building

The project is a VS2010 express solution, that requires the netduino SDK to be present.

There are several build configurations available. They build the netduino application or the PC software. Both applications share the same gcode parser code so that the viewer draws what the netduino will do (at least what refers to GCode, mechanically that's a different story).

To build the netduino app, select the configuration "Netduino debug" and build. The app is the project StepperBasic/NetduinoDevice2.

To build the Windows app, select the configuration "Debug" and build. The app is the project "gcodeviewer".

Configuring

Output pins and other parameters of the device are configured in the StepperBasic/CncDevice.cs class. Changing those parameters requires recompiling and redeploying for now.

It is possible to calibrate the number of steps per mm without recompiling using a D92 command like this:

D92 X320 Y320 Z160

This means that the X axis needs 320 pulses to advance one mm, same for Y and Z needs half (160).

Compatibility

So far the parser is able to handle successfuly all the toolpaths generated by VCarve Pro v6.

Viewer usage

Create a configuration file named "gcodeviewer.ini" that will hold some configuration parameters. It has the format on a .INI file. At least, you need to add an entry with the address of netduino:

cnc.address=ip address of netduino.

you can also specify the port:

cnc.port=82

To open a GCode file, click on the top yellow bar. An open file dialog will pop up letting you choose the GCode file. No error checking is performed, if you feed any other type of file, the app may crash.

Review the toolpaths in the 3D viewer:

  • Left mouse click and drag to rotate the 3D view.
  • Shift + left click and drag to translate. (alternatively, click and drag with the mouse wheel or middle button)
  • Mouse wheel to zoom in and out. (alternatively, Ctrl + left click and drag does the same)

If happy, connect to the netduino with the "Connect" button.

The "Offline" label should become "Online".

Now click "Begin" to start machining. Note that clicking "Cancel" may not stop inmediately and may complete the current Gcode line.

License

This code is licensed under the MIT license.

netduino-gcode's People

Contributors

dsuarezv avatar

Watchers

 avatar  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.