Some more detail about why you are doing this might help.
Is this a school project? Commercial product?
What is the objection to GRBL? Would some other firmware be acceptable or is part of the point of this exercise to write your own G code interpreter?
Does the milling machine have to be capable of sophisticated, general purpose machining or is the acceptance test for it a known trivial bracket (or simpler object).
Does speed matter? Do you need to be able to change tools?
So far it's not at all clear to me what you are doing or why.
So, all the G codes required for that, our device needs to understand.
Sorry not good enough. There are many Gcode commands, you could use all of them or only two. The two would be G00 move in a straight line as quickly as possible on each axis and G01 move in a straight line from you current position to a new position such that all the motors run at a speed that ensures that they start and reach end the line at the same time, in three dimensions.
That is all you need to mill. But there are others like G2 and G3 which involve moving in a circular arc clockwise and anticlockwise. And G4 meaning dwell.
There are other commands which while not strictly G codes require implementing, like M commands that control the motors and F commands that control the feed rate or speed the three axis move.
Is this possible?
One more time YES!
Your repeated asking of this question suggests to me that you are struggling with the English language and can't actually understand what is being said to you, so I wonder how you are going to understand any help you are given.
This is not an impossible project but it is complex and involved and my guess is it is way, way too complex for you with your current skill level.
Prove me wrong and make an intelligent response because we haven't seen one yet. We are on reply #21 and have got nowhere yet.
Grumpy_Mike:
Sorry not good enough. There are many Gcode commands, you could use all of them or only two. The two would be G00 move in a straight line as quickly as possible on each axis and G01 move in a straight line from you current position to a new position such that all the motors run at a speed that ensures that they start and reach end the line at the same time, in three dimensions.
That is all you need to mill. But there are others like G2 and G3 which involve moving in a circular arc clockwise and anticlockwise. And G4 meaning dwell.
There are other commands which while not strictly G codes require implementing, like M commands that control the motors and F commands that control the feed rate or speed the three axis move.
One more time YES!
Your repeated asking of this question suggests to me that you are struggling with the English language and can't actually understand what is being said to you, so I wonder how you are going to understand any help you are given.
This is not an impossible project but it is complex and involved and my guess is it is way, way too complex for you with your current skill level.
Prove me wrong and make an intelligent response because we haven't seen one yet. We are on reply #21 and have got nowhere yet.
My English knowledge is pretty good but my coding/ technical skill is literally zero...
Let me fully explain what me and my friends are doing... My friends are the brains behind the project and it is for my college major project.
We are doing a Cartesian Coordinate Robot for PCB milling. When we proposed the idea that we were going to use GRBL, our panel member asked us not to use such an easy way, but asked us to do the interpretation on our own. My friends are really stuck on that part. I was going through this forum and thought of asking for help here...
I am really sorry about the thread going too long as i understand I haven't been able to answer all your questions clearly.
But another question. Have you EVER operated a milling machine? From your questions and answers, I suspect not. Please get some experience, even a little bit would help clarify the operation. We have not even touched on knowing the radius of your tool so you can stay inside or outside the parameters given by the G codes.
Second observation. And this is serious. If you were starting this project with 3 or 4 more years of school to go to complete it, then I think it would be possible.
Isn't it the responsibility of the G-code producer to handle the diameter of the mill and other details like that?
PCB milling is a dead end, unless you have a soldermask capability too. It is not worth my (free) time to solder on anything that doesn't have soldermask. Cool idea for a robot but it's faster for me to re-design your board and send it out to a professional manufacturer to be made with soldermask and screenprint.
Use the Cartesian robot to do things that are more difficult to get made professionally: a laser cutter or plywood mill. Or a 3D printer.
But another question. Have you EVER operated a milling machine? From your questions and answers, I suspect not. Please get some experience, even a little bit would help clarify the operation. We have not even touched on knowing the radius of your tool so you can stay inside or outside the parameters given by the G codes.
Second observation. And this is serious. If you were starting this project with 3 or 4 more years of school to go to complete it, then I think it would be possible.
Paul
No, I don't have any experience with Milling machine .. and I only have 3-4 weeks to complete it...
Basically the thing is... I need to know how, my code in Arduino can interpret the g code generated by a pre-installed software from a .text file
G codes are generated by means of image processing in a text file.
I basically need to interpret those G codes from those text files such that my driver's understand those and make my motor move in that particular manner... Like moving such a way that the motor present in X position to moves in straight line when G01 is given. Similarly making my X and Y motor move simultaneously for the command to move at an angle like 40°.
Have you looked into how the G-code is sent to the Arduino? The G-code receiver needs to acknowledge each code is received. Get that part working first. Don't bother interpreting the codes or moving motors. Just get the basic communication going.
muthu2103:
G codes are generated by means of image processing in a text file.
I basically need to interpret those G codes from those text files such that my driver's understand those and make my motor move in that particular manner... Like moving such a way that the motor present in X position to moves in straight line when G01 is given. Similarly making my X and Y motor move simultaneously for the command to move at an angle like 40°.
Did you read and think carefully about Reply #17?
You certainly have not provided the information I suggested.
...R
PS ... start by getting your Arduino to interpret 2 or 3 lines of hand-written G Code.
Another thing I found useful for testing was to make a copy of a real G Code file and delete all but the first 10 or 20 lines.
MorganS:
Isn't it the responsibility of the G-code producer to handle the diameter of the mill and other details like that?
No that is done with the tool path software that generates Gcode from a design. The Gcode just defines the absolute path of the tool.
muthu2103:
Basically the thing is... I need to know how, my code in Arduino can interpret the g code generated by a pre-installed software from a .text file
Steady on where is this .txt file living? Normally this would be on a computer and lines would be sent to an Arduino line by line over the serial port.
and I only have 3-4 weeks to complete it.
That is just silly and I think represents the lack of experance by the "Panel Member". The is not a term I have come across but I am assuming some sort of supervising team. I used to be a senior lecturer at a UK university and taught post graduate and undergraduate students, what the U.S. calls a professor ( although that term means something different in the U.K. ). I would expect a project of this type to be at least 6 months for an undergraduate student. I would show this post to your "Panel Member". That project I linked to took me 6 months but I also had to make the machine and I could program.
I would start with the problem of moving two motors at the same time so that they both reach their target at the same time. It is a similar problem to drawing a line between any two points on a graphics display. That alone is probably three weeks work, at your current skill level.
muthu2103:
Yes, we do have a physical machine and the motors move
Then I suggest that your team test its ability to mill, you haven't said how far along you are with proving out that hardware but I expect that there are some kinks to work out. You could use some existing firmware to help with that so you're not debugging code and hardware at the same time. I hear GRBL is good
As a parallel activity, you can have the most software proficient person on the team look at building your own G code interpreter. Good news is that you can find existing examples on line to show you how it's done. I hear GRBL is good
I suspect that you'll get a better grade for having a working machine, even if you had to use existing firmware, than if you have a machine that still has a broken G code interpreter in the few weeks you have to do this.
You may want to demonstrate the machine with GRBL and then show how far you got with your own code. For that purpose, you can tweak the G code to minimize the set that you need to implement.