Welcome! Log In Create A New Profile

Advanced

G-Code and Arduino (2)confused smiley

G-Code and Arduino (2)confused smiley
October 22, 2014 09:43AM
hello all ,I have another question about G-Code and the Arduino board
while we have a G-Code ,why we are using the Arduino code, is not the G-Code controlling the extruder movement ?
why we have a long Arduino C code if we have the G-Code that makes the 3D object already described by (x,y,z) and more !,
why we need the ArduinoC code while we have the G-Code that controlled the steppers (stepper motors) to create the object on the bed ..
thank you ,
Re: G-Code and Arduino (2)confused smiley
October 22, 2014 10:35AM
The firmware running on the Arduino is needed to translate the movements commanded by the g-code into motor steps, as well as to manage the heaters, monitor the endstops and so on.
Re: G-Code and Arduino (2)confused smiley
October 22, 2014 10:47AM
so the Arduino understands the G-Code ?
Re: G-Code and Arduino (2)confused smiley
October 22, 2014 10:49AM
The program running on the Arduino does, yes.
Re: G-Code and Arduino (2)confused smiley
October 22, 2014 10:55AM
thank you, do you know as a (1,2,3,...) the steps from a G-Code command -> to moving the extruder to the specific (x,y,z) location through the arduino board (G-Code cmmand->Output from the arduino that makes the x,y,z with the specific value)?
Re: G-Code and Arduino (2)confused smiley
October 22, 2014 10:55AM
The arduino runs a program - "the firmware" - that does translate the gcode in actual electrical impulsions needed to move the motors.

Gcode is something like "move 10 mm in that direction", and the firmware running on the arduino turns that into "move that motor 2560 steps in the clockwise direction".


Most of my technical comments should be correct, but is THIS one ?
Anyway, as a rule of thumb, always double check what people write.
Re: G-Code and Arduino (2)confused smiley
October 22, 2014 12:48PM
Quote
waseem salem el-mofty
thank you, do you know as a (1,2,3,...) the steps from a G-Code command -> to moving the extruder to the specific (x,y,z) location through the arduino board (G-Code cmmand->Output from the arduino that makes the x,y,z with the specific value)?
This is not a straight forward thing since the actual positioning depends a lot on the hardware, possible accelerations and many other factors.
There is no simple connection between any G-Code move or extrude command and and the actual action. There is a good deal of math behind it.
What is the reason you are asking? Is there a specific goal you want to achieve? Maybe it is easier to help you if we know what you are after.

Cheers
Björn

PS. Please make it easier for everyone by sticking to a single thread


[www.bonkers.de]
[merlin-hotend.de]
[www.hackerspace-ffm.de]
Re: G-Code and Arduino (2)confused smiley
October 22, 2014 01:33PM
Quote
Srek
Is there a specific goal you want to achieve? Maybe it is easier to help you if we know what you are after

thank you, maybe I can not talking very much cleanly because of my not very good english language ..
I want to learn what is the way (Command story =D ) from the G-Code to the Arduino pins, how the arduino understands the G-Code command and translate it into a movement (motor stepping).....

and I am so sorry for my not clean language because my english language is not very good and I am just a student (18 years old)....
Re: G-Code and Arduino (2)confused smiley
October 22, 2014 02:40PM
How about this for a very simple explanation:

1. Arduino program (firmware) is generalised and when building a printer the builder will define in the code which pins control which stepper motor controller (according to the specific type of electronics board they are using) and store these values on the arduino when they compile the firmware from source code.

2. When receiving G code, firmware decides what to do according to G command given.

3. Decision will involve what motors to move according to the command.

4. Once movements are decided the firmware applies pulses to pins as defined in the firmware to make the stepper controllers move the motors.

5. After all appropriate motor steps have been commanded, retrieve next G code

6. Go to step 2
Re: G-Code and Arduino (2)confused smiley
October 22, 2014 02:59PM
Quote
waseem salem el-mofty
I want to learn what is the way (Command story =D ) from the G-Code to the Arduino pins, how the arduino understands the G-Code command and translate it into a movement (motor stepping).....

It might be best to download Marlin or one of the other reprap firmwares and examine the code directly.
Re: G-Code and Arduino (2)confused smiley
October 22, 2014 03:04PM
From the tone of the questions, I think the OP needs to read up on processors and programming in general. The Arduino is a microcontroller/processor - it is a small computer. The firmware is a program running on the arduino. Reading sensors and outputting voltages is what it does.
VDX
Re: G-Code and Arduino (2)confused smiley
October 22, 2014 04:21PM
... this is your third thread regarding Arduino and G-code ... here are the first two threads combined: [forums.reprap.org]

You got here some good hints, where/how you can find the essential infos -- so follow them and read/learn the basics behind ...


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]
Sorry, only registered users may post in this forum.

Click here to login