How to use programming language to generate Acorn-flavored G-code?

All things related to the Centroid Acorn CNC Controller

Moderator: cnckeith

kyd2020
Posts: 1
Joined: Wed Mar 04, 2020 12:54 pm
Acorn CNC Controller: Yes
Plasma CNC Controller: No
AcornSix CNC Controller: No
Allin1DC CNC Controller: No
Hickory CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: 7804732CE178-0930192511
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No

How to use programming language to generate Acorn-flavored G-code?

Post by kyd2020 »

Hello everyone,

I was wondering if anyone has ever tried to use programming language (Python, C/C++, etc.) to generate Acorn-flavored G-code? I am doing 3D printing project using the Acorn CNC board, so I would like to automate the G-code generation and connect with the Acorn board. I know that Cura has the ability to connect with Mach3 and LinuxCNC, but not Acorn, so I want to try writing a slicing program connecting with Acorn board.

If anyone has ever tried this approach, please let me know. Any favorable response will be appreciated!


cncsnw
Community Expert
Posts: 4619
Joined: Wed Mar 24, 2010 5:48 pm
Acorn CNC Controller: No
Plasma CNC Controller: No
AcornSix CNC Controller: No
Allin1DC CNC Controller: No
Hickory CNC Controller: No
Oak CNC controller: No

Re: How to use programming language to generate Acorn-flavored G-code?

Post by cncsnw »

Yes, I do that sort of thing all the time. You just have to know how to open and write to a text file. And of course have a handle on the math and geometry for the task at hand....


GBCues
Posts: 132
Joined: Tue Aug 14, 2018 10:49 am
Acorn CNC Controller: Yes
Plasma CNC Controller: No
AcornSix CNC Controller: No
Allin1DC CNC Controller: No
Hickory CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: noneC120192
DC3IOB: No
CNC11: No
CPU10 or CPU7: No
Location: Denver, CO

Re: How to use programming language to generate Acorn-flavored G-code?

Post by GBCues »

cncsnw wrote: Mon Mar 09, 2020 1:13 pm . . . . You just have to know how to open and write to a text file. And of course have a handle on the math and geometry for the task at hand....
That's a pretty big handle!!


tblough
Community Expert
Posts: 3549
Joined: Tue Mar 22, 2016 10:03 am
Acorn CNC Controller: Yes
Plasma CNC Controller: No
AcornSix CNC Controller: No
Allin1DC CNC Controller: Yes
Hickory CNC Controller: No
Oak CNC controller: Yes
CNC Control System Serial Number: 100505
100327
102696
103432
7804732B977B-0624192192
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No
Location: Boston, MA
Contact:

Re: How to use programming language to generate Acorn-flavored G-code?

Post by tblough »

Here's everything you need to know.
geometry.jpg
Cheers,

Tom
Confidence is the feeling you have before you fully understand the situation.
I have CDO. It's like OCD, but the letters are where they should be.


Muzzer
Posts: 815
Joined: Mon Feb 19, 2018 2:52 pm
Acorn CNC Controller: Yes
Plasma CNC Controller: No
AcornSix CNC Controller: No
Allin1DC CNC Controller: No
Hickory CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: 38D269594F9C-0110180512
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No
Location: UK
Contact:

Re: How to use programming language to generate Acorn-flavored G-code?

Post by Muzzer »

The Fusion 360 post processor is written in Javascript and....generates Acorn flavour g code. Presumably the idea of using a higher level language to generate g code is intended to make the process easier - some form of GUI comes to mind. That may be called a CAM program, which Fusion 360 has too.

Loads of videos and tutorials on how to create / edit Fusion 360 post processors using Visual Studio Code etc. Speaking as a non-softie, it's actually fairly easy to pick up (Googling that might be a good place to start). If you really are intent on creating your own (browser-based?) front end, Javascript might be a good starting point and you could reuse a lot of existing work if you look into the Fusion body of work.


cncsnw
Community Expert
Posts: 4619
Joined: Wed Mar 24, 2010 5:48 pm
Acorn CNC Controller: No
Plasma CNC Controller: No
AcornSix CNC Controller: No
Allin1DC CNC Controller: No
Hickory CNC Controller: No
Oak CNC controller: No

Re: How to use programming language to generate Acorn-flavored G-code?

Post by cncsnw »

Sometimes an external code generator, written with whatever programming tool is familiar and expedient, can be a helpful solution even for situations where the the geometry is trivial.

One of the first ones I wrote for a customer was a plasma deposition cycle: very much like the Intercon facing cycle, but without the unwanted header / end-of-program overhead; with better pass-width equalization; and with rounded corners for continuous movement. Trivial geometry, but it made the customer's life easier and made his machine run better.


briuz
Posts: 127
Joined: Wed Jul 10, 2019 9:24 am
Acorn CNC Controller: Yes
Plasma CNC Controller: No
AcornSix CNC Controller: No
Allin1DC CNC Controller: No
Hickory CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No

Re: How to use programming language to generate Acorn-flavored G-code?

Post by briuz »

If you do any math, don't use floating point variables. You'll need to use integers and keep track of the decimal place. Otherwise, floating point errors will add up and your part will be way off.


eng199
Posts: 447
Joined: Fri Jan 10, 2014 11:29 am
Acorn CNC Controller: Yes
Plasma CNC Controller: No
AcornSix CNC Controller: Yes
Allin1DC CNC Controller: Yes
Hickory CNC Controller: Yes
Oak CNC controller: Yes
CNC Control System Serial Number: none
DC3IOB: Yes
CNC12: Yes
CNC11: Yes
CPU10 or CPU7: Yes
Location: Howard, PA

Re: How to use programming language to generate Acorn-flavored G-code?

Post by eng199 »

briuz wrote: Mon Mar 09, 2020 9:32 pm If you do any math, don't use floating point variables. You'll need to use integers and keep track of the decimal place. Otherwise, floating point errors will add up and your part will be way off.
That humor is a little too dry even for my taste. I'm going with tblough's post for the win.


briuz
Posts: 127
Joined: Wed Jul 10, 2019 9:24 am
Acorn CNC Controller: Yes
Plasma CNC Controller: No
AcornSix CNC Controller: No
Allin1DC CNC Controller: No
Hickory CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No

Re: How to use programming language to generate Acorn-flavored G-code?

Post by briuz »

Sorry but I didn't mean to be humorous. I've done this and ran into the dimensions drifting due to an attempt to use floating point variables. So I had to do all the math with integers and make my own math functions.
eng199 wrote: Tue Mar 10, 2020 8:32 am
briuz wrote: Mon Mar 09, 2020 9:32 pm If you do any math, don't use floating point variables. You'll need to use integers and keep track of the decimal place. Otherwise, floating point errors will add up and your part will be way off.
That humor is a little too dry even for my taste. I'm going with tblough's post for the win.


DannyB
Posts: 109
Joined: Mon Jan 15, 2018 1:11 am
Acorn CNC Controller: Yes
Plasma CNC Controller: No
AcornSix CNC Controller: No
Allin1DC CNC Controller: No
Hickory CNC Controller: No
Oak CNC controller: Yes
CNC Control System Serial Number: A900712
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No

Re: How to use programming language to generate Acorn-flavored G-code?

Post by DannyB »

briuz wrote: Tue Mar 10, 2020 9:24 am Sorry but I didn't mean to be humorous. I've done this and ran into the dimensions drifting due to an attempt to use floating point variables. So I had to do all the math with integers and make my own math functions.
eng199 wrote: Tue Mar 10, 2020 8:32 am
briuz wrote: Mon Mar 09, 2020 9:32 pm If you do any math, don't use floating point variables. You'll need to use integers and keep track of the decimal place. Otherwise, floating point errors will add up and your part will be way off.
That humor is a little too dry even for my taste. I'm going with tblough's post for the win.
You can just use a proper multiprecision floating point library, like MPFR, and tell it the exact precision you need out of what calculations.

Alternatively, i suspect fixed precision decimal float suffices for almost all things we are talking about here.


Post Reply