Hello Guest it is August 02, 2021, 02:43:52 PM

Author Topic: Ellipse macro for Mach users  (Read 8175 times)

0 Members and 1 Guest are viewing this topic.

Ellipse macro for Mach users
« on: July 30, 2007, 06:56:28 PM »
Here is a macro I wrote for cutting an ellipse(oval).  I already tested this out on my Mach3 controlled CNC router and it works great.  I wrote this macro about 10 years ago
when I was playing around with Fanuc macro B programming.  I use it at work for quick cuts.  It normally uses IF and WHILE commands so I replaced this with a sub call.  Just fill in your lenth, width, board thickness, center position etc.  If you make the width and depth the same you will make a circle.

#1=12.   ( BOARD WIDTH X )
#2=6.   ( BOARD DEPTH Y )
#4=10.   ( WIDTH X ELLIPSE )
#5=6.  ( DEPTH Y ELLIPSE )
#6=.5    ( ANGLE INCREMENT )
#7=[#4/2]  ( CENTER POSITION X )
#8=[#5/2]  ( CENTER POSITION Y )
#10=.125   ( DEPTH OF CUT )
G40 G80 G69 G20
G52 X0. Y0. Z0.
G0 G90 G54 X[#4/2. + #7] Y#8 S16200 M3
G43 Z[#3+2.] H3
G1 Z[#3-#10] F30.
M98 P2 L#11
G0 Z2.
G90 G0 X0. Y10.
G52 X0. Y0. Z0.

G1 X[#4 * COS[#9] / 2. + #7] Y[#5 * SIN[#9] / 2. + #8]

Alek K

Offline poppabear

  • *
  •  2,233 2,233
  • Briceville, TN, USA
    • View Profile
    • S S Systems, LLC
Re: Ellipse macro for Mach users
« Reply #1 on: July 31, 2007, 07:19:23 AM »

And other Mach Users, here is a Wizard based on Aleks wonderful script, to make life easier for us lazy people......
Unzip the folder: Ellipse Wizard.zip and copy and paste the "Ellipse Wizard folder" into machs "Addons", then from in Mach under Wizards you can open and use it.

Commercial Mach3 & Mach 4, Design/Build/Retrofit CNC and Industrial machines.
Re: Ellipse macro for Mach users
« Reply #2 on: July 31, 2007, 06:00:17 PM »
Just to inform those of you who are interested in the true power of this program.  First make your ellipse length and width value the same for this example.  Then follow the steps below.  Also If you make the length and width of the ellipse different you will get even more shapes, just use your imagination.  All of this has already been tested on my router.

Enter 45 in #6 and you will get a Octagon.

Enter 60 in #6 and you will get a Pentagon.

Enter 90 in #6 and you will get a Rectangle.

Enter 120 in #6 and you will get a Triangle.
#6=120.    ( ANGLE INCREMENT )