[hackpgh-discuss] Re: Awesome article on how to read G-code

  • From: "Andrew C." <soshumasamune@xxxxxxxxx>
  • To: "hackpgh-discuss@xxxxxxxxxxxxx" <hackpgh-discuss@xxxxxxxxxxxxx>
  • Date: Tue, 25 Oct 2016 18:07:43 -0400

Ryan-

Depends on how much complexity you want. I havent done much of this type of
gcode- as this is often Mcodes (condition codes). they're basically the
same types of things as codes, but it's a letter m instead of g. they
change the way parts of the machine operate, and some are conditional
triggers as you mentioned though these are often not used in general
machining.

There is a 3rd type of machine code that hasnt been mentioned that is used
for what you want to do: macro code.

I can read some of it, but it's not normally ever used in machining. it is
the C code behind subroutines, basic if then nor not type programming. all
conditional statements. I see it scroll by in the hundreds of lines running
my tool probe subroutines. I cannot code with it, as it is totally linked
to variable output and input parameters of the machines themselves in
binary.

My guess is that many of you could fluently read and write this type of
code as I call it something different, but it looks like simple C to me. I
just cant code in C yet, but I get the logic of how the statements are read
by the machine, I just cant follow what its doing as there are hundreds of
statements all interrelated calling upon each other.

example code I can get you, or look on Haas website for omp-40 spindle
probe routine code.

This is the kind of code that looks for binary state of switches in the
machine, if they are 0 or 1, on or off, and does things with that info
based on referencing those parameters. a lot of square brackets!

if you want to do something complex like these conditional triggers with
machine readable code in a normal cnc machine, youd probably do them with a
lot of lines of these codes, or interlinked these with the few M codes that
do some of this too.

Don't know if that helps or confuses.

-Andrew


On Tuesday, October 25, 2016, Andrew C. <soshumasamune@xxxxxxxxx> wrote:



On Tuesday, October 25, 2016, Andrew C. <soshumasamune@xxxxxxxxx
<javascript:_e(%7B%7D,'cvml','soshumasamune@xxxxxxxxx');>> wrote:


Its honestly not difficult guys, what's difficult is selecting safe tools
to cut with, and spinning them at correct speed and moving them at correct
rate (feed) at a safe depth through material. That's the knowledge part
behind machining, and that is what takes more time to learn.


Wow. Ok, sorry. rereading that made me finally realize how I feel when the
coders of C and pc code make me feel when they say the same thing to me-
"it's not hard". A bit stupid, as I don't have an understanding of the
framework yet.

What I did mean was genuinely, machine code for basic parts really doesn't
take long to learn. Even with no experience at all, I could teach someone
to write a working simple program in an afternoon. not long to show codes,
a little time to show how to combine them to make a working program you
could make a simple part with.

For simple parts made of just linear moves at different depths, you could
learn to program it in an afternoon.

After a week, if you're paying attention, programming to do threadmilling
even isn't difficult to pick up.

I'm happy to show people how to do it if anyone's ever interested. Maybe
this is another class though?

-Andrew

Other related posts: