Welcome! Log In Create A New Profile

Advanced

Arduino and G-Codeconfused smiley

Arduino and G-Codeconfused smiley
October 19, 2014 12:05PM
Hello all,
I am a student in mechanical engineering (mechanical design and production engineering),
I can not understand how the Arduino board understands the G-Code when we use it for a RepRap, how it can be able to output (HIGH) and (LOW) to a specific pin that we need to send the command (HIGH\LOW) to ,,
note: I am a beginner in RepRap and 3D printing and I don't know much things about this technology, also I am just in 1st year in my college.
Thanks, and sorry for my not very good English language smiling smiley
Re: Arduino and G-Codeconfused smiley
October 19, 2014 12:55PM
You should take a look at some arduino stepper motor control examples before diving into Gcode and 3d printers. Basicaly it is a combination of processing /interpreting a stream of textual information, doing some pretty complex calculations based on the information and then using the result of that computation to control motors and other outputs.
You shoul really start with some basic Arduino examples.


[www.bonkers.de]
[merlin-hotend.de]
[www.hackerspace-ffm.de]
Re: Arduino and G-Codeconfused smiley
October 19, 2014 01:42PM
Download arduino IDE
Download marlin.

Read the marlin code.
Its all about code. If you speak code, it will be all easy to understand.

As i dont speak code. I dont understand.

I know objects are sliced into layers. These layers are given a X.Y.Z coordinate.
The arduino tell the ramps to move the stepper motor until they reach these coordinates.
Then the electronics comands plastic to extrude.

This happens layer by layer until you have an object.

It uses the processor of the arduino.
The shoots commands out of the many pins from the processor.

All these electronics amd pinouts are open-source.
Google them and look at the specs.
Re: Arduino and G-Codeconfused smiley
October 20, 2014 02:30PM
I've used an online viewer a few times and I quite like it, should work regardless of platform:
[gcode.ws]

/Andreas
Re: Arduino and G-Codeconfused smiley
October 22, 2014 07:37AM
thank you all,
I have a question, in all of a G-Code lines, I can not found any command that tells the Arduino that the x axis is for the pin (...), y for pin (..), z for (...),
so .... how the arduino know that it must move the stepper motor (or send a specific pulse) to a specific pin to move the extruder to the specific (x,y,z) location ....
this is the point that I can not understand it, and I can not know about any searching word I have to google it to get information about my question ...
and for a second time, I am sorry for my not good English language !
Re: Arduino and G-Codeconfused smiley
October 22, 2014 07:41AM
so what is the link between a G-Code and an Arduino ?
Re: Arduino and G-Codeconfused smiley
October 22, 2014 07:50AM
The firmware handles the translation. Download Marlin, look in configuration.h, you can tell it which set of electronics you have. If you have custom electronics, you can alter pins.h to define the pins for those electronics.

G-code is higher level, it deals with moving the machine in milimeters rather than flipping pins and counting steps.
Arduino and G-Codeconfused smiley
October 19, 2014 12:02PM
Hello all,
I am a student in mechanical engineering (mechanical design and production engineering),
I can not understand how the Arduino board understands the G-Code when we use it for a RepRap, how it can be able to output (HIGH) and (LOW) to a specific pin that we need to send the command (HIGH\LOW) to ,,
note: I am a beginner in RepRap and 3D printing and I don't know much things about this technology, also I am just in 1st year in my college.
Thanks, and sorry for my not very good English language smiling smiley

Edited 1 time(s). Last edit at 10/19/2014 12:02PM by waseem salem el-mofty.
VDX
Re: Arduino and G-Codeconfused smiley
October 20, 2014 03:18AM
... the G-code is 'parsed' (or interpreted) by the software, so the specific code-parts are separated, identified and executed by separate routines for each code-type.

This HIGH/LOW-functionality is the core function of any controller - it's simply setting an output pin (selected by numbers) to the specified voltage level ... for higher currents, than the controller pins can drive, transistors or MOSFET's are used as subsequent current drivers ...


Viktor
--------
Aufruf zum Projekt "Müll-freie Meere" - [reprap.org] -- Deutsche Facebook-Gruppe - [www.facebook.com]

Call for the project "garbage-free seas" - [reprap.org]
Re: Arduino and G-Codeconfused smiley
October 20, 2014 08:20AM
For a very simple example of switching a pin, see the "Blink" example coming with Arduino IDE. RepRap firmwares are quite a bit more sophisticated, though, usually the result of at least a full man-year of coding.


Generation 7 Electronics Teacup Firmware RepRap DIY
     
VDX
Re: Arduino and G-Codeconfused smiley
October 22, 2014 09:33AM
... and please post only one thread for a specific question ... I've merged the two threads here in electronics ...


Viktor
--------
Aufruf zum Projekt "Müll-freie Meere" - [reprap.org] -- Deutsche Facebook-Gruppe - [www.facebook.com]

Call for the project "garbage-free seas" - [reprap.org]
Re: Arduino and G-Codeconfused smiley
October 22, 2014 11:16AM
Disregard my reply above, it`s for a completely different thread. (weird, I'm positive I didn't post it to this one...)
Sorry, only registered users may post in this forum.

Click here to login