Mostly untested Brother / Speedio C00 post processor written mostly from scratch
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
This post is LARGELY UNTESTED! It's been tested by precisely one person so far: me. Please use with extreme caution!
I'm an amateur machinist and I'm not a programmer, but I went and wrote a post processor for my Speedio anyway. I started with a blank document and wrote everything that I could and copied everything that was either too complicated for me to decipher or already worked fine as it was. I also removed some things that are probably very important to some people so I'd like to reiterate that this post has only been tested by me, and I'm not really a qualified post tester.
OK, so what did I do? This isn't everything, but here's a list of things that I'm calling "improvements"...
It never outputs G49 (this is the first thing I did to any post processor for my Brother and I think it's important to stress its importance)
High Accuracy Mode B word selected and inserted based on machining strategy (3D adaptive = M285, 2D contour = M282, etc.)
HAMB turned off before helical moves and turned back on after (I don't believe High Accuracy Mode B is capable of doing helixes, but I've heard that I might be wrong about that, please weigh in on this) -- perhaps a better option for helixes is to use a High Accuracy Mode A command, but which one?)
Oh, turning off HAMB is only done for circular moves that use IJK addresses, circular moves that use radiuses are not modified so may fail I guess.
Automatically reduces feed rates higher than the user parameter "highFeedrate" to equal the "highFeedrate" value when HAMB is M289
It makes a fancy tool table (optional)
It adds fancy section headers (optional)
Tool changes are not called if the tool should already be in the spindle, but spindle speed and direction is always called
Turns on chip shower at final tool change (optional)
Rejiggered canned cycles some (I don't really remember the changes I made)
Decimal places added after most (all?) coordinates
Cleaned up what I'm calling "modal defaults" (G90, G17, G54, etc.)
Created option so that modal defaults aren't output before the sections/operations
Added stuff to make running the code as a subroutine "better" (well, it's better for me, probably useless for most people) (optional)
Added option to put % at start and end of file
Removed restriction from using anything other than numbers for the program name (so it can be called something like "o1001" in the setup and it will output as o1001.NC without error)
Added option of what kind of spaces to put between words (so the space can either be removed or additional spaces can be added)
Digits after the decimal for coordinates controlled by a single option (I couldn't change it from within Fusion 360 for some reason, but it seems to work correctly if modified within the post file)
Rewrote 'writeBlock' function to make sure blocks are less than 127 characters long and also trims off leading and trailing spaces
Rewrote 'writeComment' function to take advantage of the following two changes...
Greatly expanded character set (every character in my list will display on my screen (YMMV)) (underscores are in the "valid characters" list, so remove it if it's going to cause you problems, or add it to the list of replacements below)
Added special find-and-replace for some characters (º is replaced with * ; % is replaced with '/. ; parentheses are replaced with squiggily parentheses)
Created 'writeHeader' function to write comments that will be easier to spot while scrolling through the code (with optional length and optional filler character) (length currently set to 85 characters, but I keep forgetting to check if that is the perfect number when I'm at the machine)
Reordered the program metadata (program name, program comment) output
Date and time output using ordinary month to number conversion (January = "1", not "0"), leading zeros added to time elements
Coolant outputs made to be complete (I think) and correct (I think) (eg. TSC = M494/M495 instead of M88/M89)
Renamed most of the default address variables ("xOutput" is now "xAdd", "feedFormat" is now "fAdd" (I used "Add" because it's only three characters and works for both "address" and "addition"))
Tried to make the default functions (onSection, onClose, etc.) relatively clutter-free to facilitate easier editing
Tried to follow a more strict indentation format, also to facilitate easier editing
************************************
** Not included and/or removed **
************************************
All 5-axis motion code (that I saw) was removed - this could be real bad, but I can't test it so I just removed it
The post has no way to output A, B, or C words
************************************
** Not included and/or removed **
************************************
No functionality to insert sequence numbers other than before tool changes
************************************
** Not included and/or removed **
************************************
All "optional block" and "optional section" stuff was removed, I imagine these are important to some people, sorry!
************************************
** Not included and/or removed **
************************************
All dwell functionality has been removed and/or broken (adding dwells seems to turn some cycles (maybe all of them) into non-canned gcode and that scared me so I made it worse by removing the dwell code too)
************************************
** Not included and/or removed **
************************************
Sections of code that seemed to only be used if "useParametricFeed" was set to true. This includes the "activeMovements" section of the "getFeed" function
************************************
** Not included and/or removed **
************************************
It doesn't do any in-controller tool diameter compensation (it has no way to write a "D" address, so that kind of compensation probably isn't possible with this post processor, at the moment)
Attached is the post. Be gentle, "es mi dia primero". I've added the version number (2.07b) to both the file name and to the inside of the document. If you make changes and upload the file, please reference what version you started with.
A couple ideas I've had, but not attempted yet...
Make the post check the operation name for "HAMB" modes and apply them if they're found (in other words, check the name for "M289" and override the machining-strategy-based mode with the mode parsed from the name (I hope that makes sense)
Put the A, B, and C axis outputs (aAdd, bAdd, and cAdd) into the post and also put the strategies that use them back into the post too. I can't test these so I didn't want to try to make code that works with them.