Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Generate the G-code

Status
Not open for further replies.

jackjell

New Member
Hello everyone !

I hope you can help me :)

I would like to control my digital milling machine with a Rasperry Pi.

I search on the internet how to interpret the g-code in python and I found "pygcode" (if you know other interpreter, I'm interested)

Now what I would like to do is to have a program in C that allows driver 3 stepper motors (Nema17) with A4988 driver. Check with an 8051.

If you know how to help me? :)

thank you !

cordially
 
Now what I would like to do is to have a program in C that allows driver 3 stepper motors (Nema17) with A4988 driver. Check with an 8051.
Been there, not a good plan.. An Arduino and shield only costs £16 The heartache of building a 8051 to do the job will be more that £16...

Arduino is widely used and the program is well tested... do yourself a favour!!
 
but I already have a 8051 haha I do not want to use arduino because I do not want to buy all simply and since at home I have a 8051, I do what I have with me :)
 
but I already have a 8051 haha I do not want to use arduino because I do not want to buy all simply and since at home I have a 8051, I do what I have with me :)

Haven't you already asked this same question? (surely there can't be two people wanting to use antique 8051's?).

The answer is the same as before, convert the Arduino C++ code to C, and rewrite it to work on the 8051 - if it has enough memory and capabilities.
 
but I already have a 8051 haha I do not want to use arduino because I do not want to buy all simply and since at home I have a 8051, I do what I have with me :)
But you are going to need MANY peripheral components... The stepper drivers just have digital input, so no problem.. But the 8051 has a miserable memory capacity... You will need SRAM and extra program memory... Maybe you can find a derivative with 2k RAM and 32K ROM but good luck with that... BTW which 8051 do you have... Older style parallel memory is getting dearer to get hold of.. I know that the CNC program in the Arduino only just fits... AND it runs at 16Mhz.... There is a reason people don't use the 8051.... HOWEVER!! If you are a die hard... GitHub has a 8051CNC project.

https://github.com/zecruel/cnc_8051 Just let us know when you become bald after pulling your hair out!!
 
Hello,

I apologize for waiting for my answer, I was busy.

Haven't you already asked this same question? (surely there can't be two people wanting to use antique 8051's?).

The answer is the same as before, convert the Arduino C++ code to C, and rewrite it to work on the 8051 - if it has enough memory and capabilities.


no no, this is the first time i'm on this forum haha i was seeing and actually we have more or less the same problem but i just want to drive my engines with an 8051, i think i have no need for external devices because the other person wants to create a library GRBL and I just want to drive my 3 stepper motors (https://www.adafruit.com/product/324)
 
You will need a transistor at least. Python is not good for Microcontrollers, when you see programmed in Python, that means its for hobbyists.
 
Why are they incorrect and misleading? How is he gong to drive the engines without an external devce = transistor? It might be better to program it in assembler.

As for converting from Arduino to C, that is function dependant, different compilers do things in a different way. The same functions may not apply for a different compiler. You need to select and post the compiler first.
 
Hello,

here is doing a little research, I see that I will not use the 8051 and raspberry pi because it is too complicated

so what I would like to do is to control my CNC with an Arduino without the library GRBL that already exists .. it is to simply write in C language on arduino to control my CNC with atmel studio.

I would like not to rely on the GRBL library.
 
Hello,

here is doing a little research, I see that I will not use the 8051 and raspberry pi because it is too complicated

so what I would like to do is to control my CNC with an Arduino without the library GRBL that already exists .. it is to simply write in C language on arduino to control my CNC with atmel studio.

I would like not to rely on the GRBL library.

Create your own then, but it seems incredibly pointless when there's fully tried and tested solutions readily available for free.
 
If your intention is to make a working CNC machine, just use something like MACH3 running on an old XP based PC and you are good to go.

If you want the intellectual exercise of writing a CNC program from scratch, good luck.

I suppose it could be summed up in G Code as G00 X0 Y0 Z0

JimB
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top