Git Product home page Git Product logo

nraynaud / webgcode Goto Github PK

View Code? Open in Web Editor NEW
369.0 48.0 162.0 40.37 MB

Online G-Code simulator, controller code for STM32F4-Discovery and google chrome extension to send the code to it.

Home Page: http://nraynaud.github.io/webgcode/webapp/visucamTest.html#/

License: Other

HTML 0.96% C 0.53% JavaScript 98.00% Shell 0.01% CSS 0.07% Makefile 0.01% GLSL 0.12% Handlebars 0.31%
toolpath control-board gcode-generation gcode-interpreter

webgcode's Introduction

Webgcode

The beginning of a browser integrated CNC milling machine.

A bit of History

I have a Mac, and there are no real software to control a milling machine from that kind of computer. I decided to hack some random pieces of technology together. Other people might be interested so I did everything in web technologies for easy trial.

I am trying to remove the dependency on g-code, because I don't like it, but I might retain some compatibility, so that users can tip toe into the system.

I started by creating a g-code parser with a viewer, and generated the steps from that and was able to send them to the embedded system. That's when I decided on the name of the project.

Today, there is no explicit way to send some g-code into the system. The parser is there, it's plugged etc. I just don't have an UI to put it into the system. I'm really into creating my own toolpath now, so it's an incentive to develop the code when I need something. It's also a trap, because anything new (say a drag knife, a laser head or an extruder) needs few weeks of development before being able to use it.

Web Stuff

visucam screen capture visucam screen capture

A preliminary CAM system for toolpath generation is present here: http://nraynaud.github.io/webgcode/webapp/visucamTest.html#/

The application can import (drop the file on the window) STL, SVG, gerber and excellon file formats.

There is a g-code simulator here: http://nraynaud.github.io/webgcode/ (that's where the name of the project comes from).

Controller Board

Controller board schematics

The controller is a STM32F4-DISCOVERY board directly connected to the stepper drivers isolators (open drain configuration). There is a USB cable between the board and the laptop, where a Chrome application controls the machine. The controller is quite dumb, it gets a list of steps, direction and their timing from the computer and executes them. The interpolation is entirely done offline on the computer.

Pushing the user button (blue) enter the manual control mode, receiving a program on USB automatically exits the manual mode. The orange LED is on when manual is on. The manual control is made through joysticks.

The controller is also connected to the VFD through an SPI isolated breakout board.

The wiring is described in the main.c and manual.c files.

Yes, I called the directory "interpolator" and no, there is no interpolation code in it.

IO Board

IO board schematics

There is an IO board to connect the MCU to various things, mainly the Huanyang VFD. On this last one, the output optoisolators (UPF and DRV) were not populated, so I just bought some on eBay and soldered them on (ok, I admit, I might have shorted the pins while the chips were in the mail, please don't tell my mom, yes she knows what 300VDC is, she taught me when I was a kid). The board consists of one 74HC595 and one 74HC165, behind a digital isolator; the MCU communicates over SPI to get isolated IOs.

Chrome Application

controller screen capture

On the computer, you can send the program to the machine. The application's main part is simply an iframe with the normal CAM html page in it (they talk with messages).

The USB protocol is custom since I couldn't find any standard, tell me if you know of any USB protocol to send sequences of steps to a machine (there is no g-code interpolator in the embedded system).

This is all Chrome technology in the hope to remove OS re-compilation/deployment efforts.

License

This code is licensed under MIT and Affero GPL double licensing.

Contact

To contact me about anything, you can use the issues system, there is no traffic on it.

webgcode's People

Contributors

cyril-sf avatar kmichel avatar nraynaud avatar

Stargazers

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

Watchers

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

webgcode's Issues

using webgcode

Hi
You did wrote that this is the contact space when someone needed to contact you.
I use your code on my CNC website, its it freaking awesome programming you did there.
As I interpret it, this software is free to use. (?)
Did some beating on it, but the major deal it's your code.
I'v putted it on http://www.tomasw.com/gcodesim.
and again, really good job :)

/tomas

Getting Data from G Code

Wonderful web application! Is there a way to get the data used for plotting the graph from your app? Thanks

VisualCam manual ?

Visualcam on Firefox works nice. The UI is pretty intuitive. I've seen the gcode generated by VisualCam on webgcode viewer correctly.
Is there any online manual of VisualCam ?

WebGcode simulator

Hi,
I have tried out webgcode simulator. But I can't paste my gcode onto the left window since there is no left window to put the gcode.

How can I make it show the left window to put my g code ?

I am making my own CNC board. My firmware is in between GRBL and Smoothie also something like a mashup of them. Though I have a g code viewer on Windows OS, I need to make a some G code community site where popular milling operations G code are exchanged like Thingiverse.

Regards,

Paul J

Offline version of g-code simulator

There is a g-code simulator here: http://nraynaud.github.io/webgcode/

Is there a way to have the g-code simulator run from disk (offline)?

Simply downloading it and starting it does not work:

  • it looses all the interactions in the "black" areas (canvas, svg, ...)
  • it stores the pasted g-code
  • but cannot paste anything else

Any hints?

Downloaded (offline)
image

Online
image

Timeout loading js libraries

Sometimes when I open "https://nraynaud.github.io/webgcode/" I get a page with only some text. This is the error I get in the console (Firefox):

Error: Load timeout for modules: Ember,templates,libs/threejs/OrbitControls,libs/threejs/CSS3DRenderer
http://requirejs.org/docs/errors.html#timeout

Arc in wrong direction

The following g-code has a 90 degree arc from Z to X. It looks like the arcs are going in the wrong direction:

%
(1001)
(T1 D=0.375 CR=0 - ZMIN=-0.075 - flat end mill)
G90 G94
G17
G20

(365 face)
M9
T1 M6
S2000 M3
G54
M9
G0 X0.5228 Y-0.1828
Z0.2
Z0.05
G1 Z-0.0375 F8
G18 G3 X0.4853 Z-0.075 I-0.0375
G1 X0.3125
X0.1625 F12
G17 G2 Y0.0852 J0.134
G1 X0.3125
G2 Y-0.1828 J-0.134
G1 X-0.1625
X-0.3125
G2 Y0.0852 J0.134
G1 X-0.1625
G18 G2 X-0.125 Z-0.0375 K0.0375 F8
G0 Z0.2
G17
M9
M30
%

Improved mobile Interface for webgcode

Currently I'm using the webgcode web app on a phone and the interface could be slightly improved for it with possibly minimal work.

The enhancements I'd like you to consider are:

  • button to clear the gcode (delete all text)
  • button to download gcode as a text file
  • making the previews show bellow the code editor in small screen size devices (or maybe a tab?) and allow the code editor to adapt to the width of the screen

These are not the only only improvements that can be made but possibly the easiest/fastest to do that would provide the greatest usability benefits.

CAM dev resources

Cool Project. I was wondering what resources (research papers, books, blogs etc...) you used to start developing your own CAM software. I am interested in creating my own toolpath and any insight to your learning process would be much appreciated. Thanks.

Add toolchange options

First of all .. great tool especially for a smal lab that has many processes on minimal amount of flexible machines.

As a feature request i would suggest adding the tool-chance as an option on each of the processing steps. If not selected default tool prevails.

Is this gcode GRBL compatible? We standarddized all machines to that for simplicity.
How is the STM compared to Arduino boards?

Thank you!
Theo

Add loading feedback to webgcode app

Depending on device webgcode app can take a considerable time show a UI all while showing no visual indication that it's actually still loading.

It would be a welcomed enhancement if it would be possible to show some kind of progress indicator while while the app is loading up it's UI.

This is a low priority enhancement request.

Contact...?

Hi there,

Is there an email address to contact you with?

DAVE

Does not understand G53

Here's a sample snippet

O00060
N1 (G71 TYPE I O.D. ROUGHING)
G53 G00 X0. Z0. T0
T101 (O.D. TOOL . x .031 TNR)
G50 S3200
G97 S500 M03
G54 G00 X3.2 Z0.1 M08
G96 S420
Z0.005
G01 X-0.063 F.008
G00 X3.2 Z0.1
G71 P10 Q20 U0.01 W0.005 D0.12 F0.01
N10 G00 G42 X1.4
G01 Z0. F0.006
X1.5
G03 X1.75 Z-0.125 R0.125
G01 Z-2.5
G02 X2.25 Z-2.75 R0.25
G01 X2.5
G03 X3.0 Z-3.0 R0.25
G01 Z-4.125 F.004
N20 G40 X3.2 F.02
G97 S500 M09
G53 G00 X0. Z0. T0
M01

G28

G28 (homing) is not recognized as a command. If there is a reason, maybe you can enlighten a beginner in GCode why?

Circular interpolation arcs end early

Thanks for the awesome tool, I'm using it to proof my G-code before trying it on a real CNC. I don't know if I'm missing something, but it appears that circular interpolation endpoints aren't completed properly when followed by a G0 or a G1. I think it's easiest to just show you an example. Pasting that code into the simulator, you can see that arcs in the XY plane terminate early, and the G0 to the clearance plane (Z0.25) is diagonal instead of vertical. This happens on the bottom of the eyes as well, when a G2 is followed by a G1.

webgcode "Load bigger sample" takes too long to process

The button "Load bigger sample" on the webgcode application loads a massive gcode sample and immediately simulates it which on low powered devices makes it look like the app stopped responding or just hanged.

The proximity to the regular Simulate button also means there could be accidental presses specially when using mobile touch devices.

I would suggest that the button be removed and replaced by a menu that allows loading the sample (and maybe other examples) of gcode into the editor so that users can see the code and only simulate it when the user presses the Simulate button thus avoiding accidental "lockups".

This is a low priority enhancement request.

Great job on G2

Your simulator is the only one I've found that correctly simulates G2 with an X, Y and Z value as the endpoint.

Your simulation matches exactly my 3D printer connected to a Duet controller.

Dual-license: how does it work?

I appologize for such a question, but this is the first time I see an AGPL/MIT dual-license. I wonder what does it actually mean and under which license the derrivative code should be licensed?

Fails with '%' in comment

Fails with '%' in comment.

Example:
G1 Y14 S1000 F60 ; Move 04,14 laser 100%, speed 1mm/sec

Looks like it terminates the program?

Very useful tool!

M. Raynaud,

I have recently been using your online G-code simulator and would like to request your permission to use screenshots from it in a book I am writing for MakerMedia (Make:). The book is about using digital fabrication tools like 3D Printers, CNC, laser engravers, vinyl cutters, etc. for leatherwork. I would like to reference your site in the book as a tool for users. The book is coming out in Sept. of 2017.

I have previously published 'Make:Fire, The Art and Science of Working with Propane' for MakerMedia (https://www.amazon.com/Make-Fire-Science-Working-Propane/dp/1680450875) and am a regular contributor to Make: magazine (http://makezine.com/author/tim-deagan/).

Please let me know if you have any interests or concerns. I will only use screenshots from the site with your permission.

Yours,
--Tim

Feature to upload files?

Great software! Unless I'm missing something I can only view my output if I paste my code into the text box on the website. Would it be possible to have an 'Upload' or 'Open File' button so that I can select my file on my PC and have it uploaded and rendered?

Thanks!

Cannot zoom with mouse wheel

Using the mouse wheel to zoom in/out on the gcode rendering doesn't work well because it only scrolls by ~1 pixel for each step of the wheel.

Fork for Vanity (:

Hey.

You have quite an interesting project, and VisualCam in particular is interesting.

Would you be willing to give me an open source fork to work from?
I am in particular interested in extending your dragknife support, and more 3D milling.

We also use a threejs+clipperjs backend on Laserweb

Laserweb has quite a bit of traffic - which could help bring some fame. (We even have a sponsors WIKI page that has managed to nett some of the contributors machines, boards and paypal donations - i'd be happy to put your details on there if we use some of your code. )

webgcode app doesn't seem to recognise valid G41, G42 gcode

When using the instruction G42 D1 the webgcode app seems to not recognize the command. This however should be valid gcode (at least it seems to function as expected in the CNC machine I'm learning with).

Note however that everything still seems to function well so it's just a "minor" bug.

Chrome blocks Workers

I decided to try webgcode locally using Chrome but there was an error in index.html saying

Uncaught DOMException: Failed to construct 'Worker': Script at 'file:///home/jalovisko/dev/webgcode/webapp/worker.js#3DView' cannot be accessed from origin 'null'.

Searching revealed that Workers don't work locally in Chrome, and indeed the page loads nice and clean in Firefox. However, I see here on Stack Overfloww a workaround for Chrome which I think sounds easy to implement. I can fork and fix this one if it's ok.

Load Gcode

I am trying to add gcode loading to the system. Please, help. It is difficult for me.

Add "Upload file" button

Suggest replacing the "Load a bigger sample" button with "Load a new file" and a file upload prompt. I do most of my model development and conversion in Linux, from the command line. Therefore drag and drop isn't a good option for me.

If the "Load a bigger sample" function is still needed then this should be replaced with a link to a downloadable file.

See also #17.

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.