How to copy codes from a arduino of an cnc machine

Hello ,

i have bought a cnc machine that has a arduino uno , i plan to produce this kind of machins using arduino uno , my problem and question is : how can i copy that cnc mashin arduino codes . is there a way to copy them or not ?

iam looking forward to hearing an answer from you .

best regards

Have you checked if the software on your CNC machine is free to duplicate?

If the code (firmware) runs on an Uno it may be Grbl. If it is, you can download Grbl. The linked page has links to instructions for configuring Grbl for a new machine. There are commands that you can send to Grbl to get the settings from the source machine.

thanks for your replies .

how can i check whether it is free to duplicate or not ?

and yes its GRBL , how can i find these command and how to send them ?

because i want to see the code that is written with arduino IDE and send it to my own arduino .

Just Google "GRBL" and you will get all the information you need straight from the sources.

Paul

Thanks a lot for you answers , but i could find nothing about how to copy codes from an arduino boarded on a machine ,

gharaei:
Thanks a lot for you answers , but i could find nothing about how to copy codes from an arduino boarded on a machine ,

You don't. The code in the Arduino driving the CNC machine is the GRBL interpreter code which you can download to your pc from the web site. Then download it to the new Arduino on the CNC machine.

Your PC GRBL program reads the data file and creates the "G" and "M" codes to send to the Arduino/interpreter program running on the CNC machine.

Paul

After you have downloaded and installed Grbl to the new Uno, you can get the setup of the original machine by connecting to Grbl on the original machine with a terminal program (Serial monitor will do) and sending the $$ command to Grbl. Grbl will respond with the current settings of the machine. You can then copy the settings to the new machine. See the Grbl configuration page for more information.

hello thanks for you replies . i did what you said i entered $$ command but i received below code , I need to get the code that the coder used to make that cnc machine and uploaded to it's arduino .
any advice ?
iam looking forward to hearing an answer
best regards .

????/??/?? ??:??:?? - Grbl 1.0b ['$' for help]
????/??/?? ??:??:?? - $0=50 (step pulse, usec)
????/??/?? ??:??:?? - $$
Response:$0=50 (step pulse, usec)

????/??/?? ??:??:?? - $1=2 (step idle delay, msec)
????/??/?? ??:??:?? - $2=1 (step port invert mask:00000001)
????/??/?? ??:??:?? - $3=1 (dir port invert mask:00000001)
????/??/?? ??:??:?? - $4=0 (step enable invert, bool)
????/??/?? ??:??:?? - $5=0 (limit pins invert, bool)
????/??/?? ??:??:?? - $6=0 (probe pin invert, bool)
????/??/?? ??:??:?? - $10=3 (status report mask:00000011)
????/??/?? ??:??:?? - $11=0.010 (junction deviation, mm)
????/??/?? ??:??:?? - $12=0.002 (arc tolerance, mm)
????/??/?? ??:??:?? - $13=0 (report inches, bool)
????/??/?? ??:??:?? - $20=0 (soft limits, bool)
????/??/?? ??:??:?? - $21=0 (hard limits, bool)
????/??/?? ??:??:?? - $22=0 (homing cycle, bool)
????/??/?? ??:??:?? - $23=0 (homing dir invert mask:00000000)
????/??/?? ??:??:?? - $24=25.000 (homing feed, mm/min)
????/??/?? ??:??:?? - $25=500.000 (homing seek, mm/min)
????/??/?? ??:??:?? - $26=250 (homing debounce, msec)
????/??/?? ??:??:?? - $27=1.000 (homing pull-off, mm)
????/??/?? ??:??:?? - $30=1000. (rpm max)
????/??/?? ??:??:?? - $31=0. (rpm min)
????/??/?? ??:??:?? - $32=0 (motor lock bool)
????/??/?? ??:??:?? - $33=7 (motor mode mask:00000111)
????/??/?? ??:??:?? - $100=400.000 (x, step/mm)
????/??/?? ??:??:?? - $101=400.000 (y, step/mm)
????/??/?? ??:??:?? - $102=400.000 (z, step/mm)
????/??/?? ??:??:?? - $110=1000.000 (x max rate, mm/min)
????/??/?? ??:??:?? - $111=1000.000 (y max rate, mm/min)
????/??/?? ??:??:?? - $112=1000.000 (z max rate, mm/min)
????/??/?? ??:??:?? - $120=150.000 (x accel, mm/sec^2)
????/??/?? ??:??:?? - $121=150.000 (y accel, mm/sec^2)
????/??/?? ??:??:?? - $122=150.000 (z accel, mm/sec^2)
????/??/?? ??:??:?? - $130=60.000 (x max travel, mm)
????/??/?? ??:??:?? - $131=60.000 (y max travel, mm)
????/??/?? ??:??:?? - $132=60.000 (z max travel, mm)

Are you actually looking for the "G code" interpreter that is running in the Arduino?

Paul

iam looking for a way to make that cnc machine myself and because of that iam gonna need the codes ( for example the code below ) and upload it to my own arduino and make a duplication .

/*
LiquidCrystal Library - Hello World

Demonstrates the use a 16x2 LCD display. The LiquidCrystal
library works with all LCD displays that are compatible with the
Hitachi HD44780 driver. There are many of them out there, and you
can usually tell them by the 16-pin interface.

This sketch prints "Hello World!" to the LCD
and shows the time.

The circuit:

  • LCD RS pin to digital pin 12
  • LCD Enable pin to digital pin 11
  • LCD D4 pin to digital pin 5
  • LCD D5 pin to digital pin 4
  • LCD D6 pin to digital pin 3
  • LCD D7 pin to digital pin 2
  • LCD R/W pin to ground
  • LCD VSS pin to ground
  • LCD VCC pin to 5V
  • 10K resistor:
  • ends to +5V and ground
  • wiper to LCD VO pin (pin 3)

Library originally added 18 Apr 2008
by David A. Mellis
library modified 5 Jul 2009
by Limor Fried (http://www.ladyada.net)
example added 9 Jul 2009
by Tom Igoe
modified 22 Nov 2010
by Tom Igoe

This example code is in the public domain.

*/

// include the library code:
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(8,9,4,5,6,7);

void setup() {
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.print("Salam");
}

void loop() {
// set the cursor to column 0, line 1
// (note: line 1 is the second row, since counting begins with 0):
lcd.setCursor(0, 1);
lcd.print("00000000003 (^_^)");
}

Is that code not available from the maker of the machine? Who makes the machine?

Paul

You can download the compiled code from an Arduino using AVRDUDE. So long as the originator hasn't locked it, which is pretty rare.

If you have identical hardware then you can upload this binary to as many copies as you want. You can even keep this as a backup of the original firmware while you try uploading other programs to the original Arduino.

However you cannot recover the original C++ code from the Arduino. If the original programmer won't sell or give it to you then you have no way to make modifications.

no the codes is not available from the maker , and it's not locked i know that , then how can i get them ? there is no way to recover ?

You can copy but you can never go back to the original C++ code.

It's like trying to un-scramble an egg.

gharaei:
hello thanks for you replies . i did what you said i entered $$ command but i received below code , I need to get the code that the coder used to make that cnc machine and uploaded to it's arduino .

If you got that output from GRBL on the machine that you wish to replicate then it seems to me all you need to do is to load a new copy of GRBL onto your new machine and enter the same values into it.

...R

I was under the impression that the original machine (the one that you want to copy) was running Grbl firmware. Is that not correct?

Robin, that is what I have been trying to say all along (poorly, I guess). See reply #7.

groundFungus:
Robin, that is what I have been trying to say all along

Indeed.

But it seemed to me the OP had only taken half of your advice.

...R

ok , because i'am amateur now and i can not write c++ codes myself , if i could get them from another cnc machine that would be great :slight_smile:
when i write command $$ i get some codes yes but they are not the c++ codes that i need to upload to my arduino and make a duplication of that machine .

No, you need to download GRBL from somewhere else and load that onto the new machine. Then copy the configuration values to the new one.

If you can't write C++ then this project may be beyond you. You may need to employ a professional programmer.