You are viewing a single comment's thread.

view the rest of the comments →

[–] AngelofDeath 0 points 1 point (+1|-0) ago 

I still amazed at your 250 lines of code for CNC. I would love to see it. What language?

I'm old and haven't done any coding for decades, but used to do Assembly Level, Pascal, Fortran, Cobol, a little C and C+. Some of the coding I wrote was many thousands of lines.

[–] screamingrubberband [S] 0 points 1 point (+1|-0) ago 

I should clarify... CNC machines run off of a language called 'G code.' it is a combination of letter/number 'commands' that control the machine... Each letter has a specific meaning... X, Y, Z are axis locations to move a tool to (there are more letters for this, but I'm trying to simplify!) M is generally used for machine-specific functions. M8 turns on a coolant pump to keep the cutter lubricated and cool, M9 turns it off. M3 makes the tool or part spin forward, M4 spins in reverse, M5 makes it stop. G is mostly all about 'how do I move to x/y/z" G0 is rapid (as fast as the machine can move) G1 is 'move in a straight line at a rate determined by another letter' G2 is 'move in a clockwise arc to xyz' G3 is ccw.

Modern-day G-code makes use of variables, if/then/goto statements, subroutines, internal machine condition monitoring... it is a long way from where it was, and the people I work with are all excited to see what comes next... A recent job is currently letting the guy at the machine 'program' his machine with a bar code scanner. It reads in six or eight numbers, saves them in variables that the machine can read, then the program cuts a part that matches the dimensions the operator scanned. That's one of a few programs I've written that is able to make parts I have never imagined!

I'm going to post a few things on /v/machinists later on today, I will post a few code examples.

[–] AngelofDeath ago 

Thanks