Machsupport Forum

G-Code, CAD, and CAM => G-Code, CAD, and CAM discussions => Topic started by: Graham Waterworth on April 08, 2007, 07:56:04 PM

Title: G-Code scaling program, mm to Inches and back
Post by: Graham Waterworth on April 08, 2007, 07:56:04 PM
Hi All,

here is a small .exe program for converting G-Code from mm to Inches and Inches to mm, it will also scale to any size you require, with in reason.

The program needs no installing, just double click to run it.

Click 'input file' to select the source file

Click 'output file' and enter a new file name, you can't read and write to the same file name.

Select conversion options.

Click convert.

That's all there is to it.

Try it and see if it works for you.

There is a later version of this program higher within this thread that has no limit to the number of lines of g-code it will convert, this version has a line limit of 32000.


Link to Later version :- http://www.machsupport.com/forum/index.php/topic,2893.msg39920.html#msg39920
Regards

Graham.
Title: Re: G-Code scaling program, mm to Inches and back
Post by: Chaoticone on April 08, 2007, 08:12:58 PM
Hats off to Graham for such a nice contribution. Some of you folks will find this very useful if your code generating is limited to Imperial or metric. Men like Graham are one of the main reasons this forum is so nice.

Thanks Graham

Brett
Title: Re: G-Code scaling program, mm to Inches and back
Post by: ynneb on April 08, 2007, 11:06:28 PM
Thanks Graham, You're more than just a pretty face.
Title: Re: G-Code scaling program, mm to Inches and back
Post by: gabi68 on April 09, 2007, 03:30:46 AM
Hi,

Archive is dead. Winrar don't open it. I me or something else?

TIA
GB
Title: Re: G-Code scaling program, mm to Inches and back
Post by: ynneb on April 09, 2007, 03:55:03 AM
Try downloading it again. Seems to work fine for me.
Title: Re: G-Code scaling program, mm to Inches and back
Post by: gabi68 on April 09, 2007, 04:06:06 PM
Try downloading it again. Seems to work fine for me.

Thank's Benny - the .exe file work now.
GB
Title: Re: G-Code scaling program, mm to Inches and back
Post by: rustamd on September 25, 2007, 09:41:02 PM
why does it try to install TurboTax ItsDecductible 2006 when i go to open this thing?
Title: Re: G-Code scaling program, mm to Inches and back
Post by: Graham Waterworth on September 26, 2007, 04:44:21 AM
No idea, it worked for 450+ other people.

Graham.
Title: Re: G-Code scaling program, mm to Inches and back
Post by: rustamd on September 26, 2007, 10:29:42 AM
hmm, thanks for app anyway, will try to get it working today...
Title: Re: G-Code scaling program, mm to Inches and back
Post by: Graham Waterworth on September 26, 2007, 11:49:53 AM
I have just downloaded both version and they both work fine here.

Graham.
Title: Re: G-Code scaling program, mm to Inches and back
Post by: RobWilson on January 11, 2008, 07:08:56 PM
Thanks Graham
works fine for me
Rob
Title: Re: G-Code scaling program, mm to Inches and back
Post by: gabi68 on March 02, 2008, 09:17:34 AM
Hi Graham,

I try you're little software but I receive a constant error "Run time error '6': Overflow. Here it is what I am doing. I have .dxf a file in inch. I import that file in Rhino then I change units in Rhino from inche's to mm. I import that file in LCam - process. Save. Try to convert back in inche's and dang that error came up. Why? What I am doing wrong? Please help me.

TIA
Gabi
Title: Re: G-Code scaling program, mm to Inches and back
Post by: Graham Waterworth on March 02, 2008, 01:14:05 PM
Hi Gabi,

I have not had that error reported before, post the file you are trying to convert and let me have a look.

Graham.
Title: Re: G-Code scaling program, mm to Inches and back
Post by: gabi68 on March 02, 2008, 01:20:39 PM
Hi Graham,

File it is a little large. I'll will post a archive. Please look at it and advice what do to.

Thank you
Gabi
Title: Re: G-Code scaling program, mm to Inches and back
Post by: Graham Waterworth on March 02, 2008, 02:31:52 PM
Here is the later version of the program, try this and let me know how you get on.

Graham.
Title: Re: G-Code scaling program, mm to Inches and back
Post by: gabi68 on March 02, 2008, 02:38:04 PM
Hi Graham,

That new version do the job nicely.

Thank you
Gabi
Title: Re: G-Code scaling program, mm to Inches and back
Post by: Tyler on March 14, 2008, 08:41:10 PM
Quick question, what does

"Component 'comdlg32.ocx' or one of its dependencies not correctly registered: a file is missing or invalid."

mean?
Title: Re: G-Code scaling program, mm to Inches and back
Post by: Graham Waterworth on March 15, 2008, 06:22:14 AM
You have a missing ActiveX file on your system, is it XP and up to date?

Graham.
Title: Re: G-Code scaling program, mm to Inches and back
Post by: Tyler on March 17, 2008, 03:02:47 PM
I have run the update but still receive the same error. Is there anything that could conflict with this program running?

My PC is installed in "normal PC" mode, and just about everything is changed according to the XP Optimization file on ArtSoft's website. I'm not entirely sure why neither of the versions you've posted don't work on my system.
Title: Re: G-Code scaling program, mm to Inches and back
Post by: Graham Waterworth on March 17, 2008, 03:48:04 PM
Sorry, no idea, have you tried it on another computer, it seems to work for most people.

Graham.
Title: Re: G-Code scaling program, mm to Inches and back
Post by: Tyler on March 17, 2008, 04:22:11 PM
Maybe I can try reformatting the computer used for controlling the CNC machine. It seems to work with my desktop.

Thanks Graham.
Title: Re: G-Code scaling program, mm to Inches and back
Post by: W.Jansen on July 22, 2008, 03:37:35 PM
Hi Graham

Your program works perfect for me, thanks very mutch.
Just out off curiosity, what is the difference between the two versions?

Greetings:
Willem

Title: Re: G-Code scaling program, mm to Inches and back
Post by: Graham Waterworth on July 22, 2008, 07:01:29 PM
Hi Willem,

thank you for your comments, the only difference is the earlier one was limited to 32000 lines of code.

Graham.
Title: Re: G-Code scaling program, mm to Inches and back
Post by: Tweakie.CNC on December 19, 2008, 09:15:36 AM
Thanks Graham, nifty little program. I have used it a couple of times now and it was brilliant.

Regards, Tweakie.
Title: Re: G-Code scaling program, mm to Inches and back
Post by: BClemens on February 24, 2009, 08:34:26 AM
Thank you Graham, very useful program and also even for basic renumbering.

Bill C.
Title: Re: G-Code scaling program, mm to Inches and back
Post by: fever16 on February 10, 2010, 01:03:44 PM
nice program,simple to operate.Thanks

i likes its scaling feature.and it would be much better if we could control the z depth separately.
i used custom scale as 10,so my X-Y values become 10 times larger and also made Z depth to 10 times.
Title: Re: G-Code scaling program, mm to Inches and back
Post by: BobWarfield on April 05, 2010, 04:43:00 PM
Handy utility!

Cheers,

BW
Title: Re: G-Code scaling program, mm to Inches and back
Post by: woodguy7777 on June 20, 2010, 11:12:18 AM
[flash=200,200]I downloaded file and everything work as far as the conversion goes.
the problem i have is when i tried to run the file.
[i tried an aircut   ]  the file size has been reduced to a faction of the original size.
tried on two computers same problem.
enclosed is both files  before and after.
thanks
paul
Title: Re: G-Code scaling program, mm to Inches and back
Post by: woodguy7777 on June 20, 2010, 12:05:08 PM
My above post is a bit misleading  i was sent a dxf that was made in mm   i then took that file into vcarvepro
and made a cut file in mm.
then use the converted to turn it into an inch file.
an easier way to go is if i was able to change the dxf mm file into a dxf inch file.
is that possible?
Title: Re: G-Code scaling program, mm to Inches and back
Post by: Graham Waterworth on June 20, 2010, 04:05:07 PM
The file size has reduced by about 3600 characters this is because when you convert a mm size say 127.000 to inches you get 5. a saving of 5 characters multiply this by hundreds of conversions and the file shrinks by a large amount.

Have you found a fault in the converted file?

You can convert a DXF file in mm to inches by scaling it by 1:25.4th (0.03937) the metric cam system will think its a very small part but scale the tools too and the output will be inches, you will just need to change the G21 to G20.

Graham
Title: Re: G-Code scaling program, mm to Inches and back
Post by: cue on January 08, 2013, 09:14:37 AM
I have problem using the wizards cannot find the code after making it in the wizard?
Thanks
Title: Re: G-Code scaling program, mm to Inches and back
Post by: jstanthr on January 29, 2013, 05:45:03 AM
Any way to get it to do .nc Mach3 files?
Title: Re: G-Code scaling program, mm to Inches and back
Post by: Graham Waterworth on January 29, 2013, 06:49:40 AM
Change the extension from .NC to .TAP

Graham
Title: Re: G-Code scaling program, mm to Inches and back
Post by: EL34 on February 21, 2013, 10:08:05 AM
Thanks for this great utility Graham

Question:
After converting from mm to inches, the G code no longer has a space between each command
It makes it difficult to read the code in a text editor

before
G1 X86.747 Y101.111 Z0.2 F1500.0 A0.081

and after
G1X3.4152Y3.9807F59.0551A.0032

Is there a way to have the space between code in the output file?

Thanks,
Doug
Title: Re: G-Code scaling program, mm to Inches and back
Post by: Graham Waterworth on February 21, 2013, 02:10:50 PM
Hi Doug,

this version of the program is now fixed and will not change, there are new G-Code utilities on there way that are compatible with Mach3 and 4 and these have many enhancements including code spacing.

Regards
Graham
 
Title: Re: G-Code scaling program, mm to Inches and back
Post by: mrprecise44 on February 21, 2013, 04:41:20 PM
In the example above, posted by EL34, the "A" axis degree value gets scaled as if it were a linear dimension. This is wrong, as you know angular degrees are still just "Degrees" in Metric.

Hopefully, in the upcoming scaling program this will be fixed, without having to go into the Mach3 program, and re-scale the "A" axis  back into the original degrees when converting a program. In my opinion, this messing with Angular values does not work.

I recently tried using the converter program on a Metric program which was a 4-axis sculpture, and initially failed to notice the angular error, partly because all the letters and numbers are posted without spaces, making it very hard to see.

The screen view was just a crazy squished mess. I finally realized the "A" dimensions were the problem.

My second attempt was to re-scale the "A" degrees back to the original value, using the Mach3 scale option window.

I ultimately ended up scaling the X and Z axis in the Mach3 scale window,  (the original program Y was on centerline and remained 0.00), and leaving the "A" axis as originally posted.

When the "A" axis was re-scaled in Mach3, and the X and Z were converted from Metric to Inch by the conversion program, the values for the A axis on the G-code window were still showing a goofy value, which made it difficult seeing where the A axis really was.  It also seemed to not run correctly, i.e. A rapid moves etc.

When I scaled the Metric program in the Mach3 window adjacent to the DRO, and left the original A axis values alone, the program ran like a clock.
Title: Re: G-Code scaling program, mm to Inches and back
Post by: EL34 on February 21, 2013, 06:26:15 PM
I write in vb.net and so I was just gonna do my own conversion program until I saw this post

It just a simple parsing routine on all the code and then replace G21 with G20
Looks like I still have to write my own

It's very simple to add a space after Gcode command and I am surprised no one commented on it before me.

As it is, the converted Gcode is totally unreadable to me
Sortoflikeabunchofwordsonapagewithnospacebetweenthem



Quote
this version of the program is now fixed and will not change, there are new G-Code utilities on there way that are compatible with Mach3 and 4 and these have many enhancements including code spacing.
Graham,
Do you have a link to one?
I searched but did not come up with anything
Title: Re: G-Code scaling program, mm to Inches and back
Post by: Graham Waterworth on February 22, 2013, 09:16:18 AM
Good luck with your program.

Graham
Title: Re: G-Code scaling program, mm to Inches and back
Post by: zoheirlabibes on April 10, 2013, 09:49:49 AM
hi evryone

im trying to show you a screenshot of my question bat when i insert image  i get this (http://) ??? img /img

please help
Title: Re: G-Code scaling program, mm to Inches and back
Post by: EL34 on April 10, 2013, 09:51:55 AM
So do lots of other people
It's a problem with IE

Firefox and Chrome do not have this issue
I cannot see the forum images in IE10 but they show up fine in Firefox and Chrome
Title: Re: G-Code scaling program, mm to Inches and back
Post by: zoheirlabibes on April 10, 2013, 10:01:09 AM
thanks EL34

i write a simple G-code to cut a square but the toolpath follow a curve when reach the square corner not a 90°


Title: Re: G-Code scaling program, mm to Inches and back
Post by: Graham Waterworth on April 10, 2013, 02:03:51 PM
you need to slow the feed or change the setting to exact stop mode this will produce square corners.

Title: Re: G-Code scaling program, mm to Inches and back
Post by: zoheirlabibes on April 11, 2013, 10:03:27 AM
thanks graham

i'll try it soon.
Title: Re: G-Code scaling program, mm to Inches and back
Post by: aussieexpat on June 16, 2014, 11:00:25 AM
Hi All,
This is my first post!! I really need some assistance, would be very much appreciated. I am engraving using Mach3 licensed version. Its a simple 2 d engraving on brass. I am using the nice Deskengrave program. Now this is where i need the assistance. The machine is engraving normally but what i need it to do is to engrave in a mirror fashion or reversed so then when i make a molding, the image will be reversed in the normal way. Please all of you pro's out there HELP HELP HELP!!!!
Best Regards
Greg
Title: Re: G-Code scaling program, mm to Inches and back
Post by: Tweakie.CNC on June 16, 2014, 11:49:05 AM
Hi Greg,

If you change your X axis Scale DRO from +1.0000 to -1.0000 that will produce the reverse image.

Tweakie.
Title: Re: G-Code scaling program, mm to Inches and back
Post by: aussieexpat on June 17, 2014, 09:35:24 AM
Hi Tweakie!
Many thanks for your reply. Just one question cause i'm a dummy, how does one change this setting in Mach3? Do you go to Config to general config?
Cheers
Greg
Title: Re: G-Code scaling program, mm to Inches and back
Post by: Tweakie.CNC on June 17, 2014, 11:39:09 AM
Hi Greg,

Just click the scale DRO box, enter the new value (-0.0000) then press (keyboard) return. The associated LED will flash to indicate the change.  ;)

Tweakie.
Title: Re: G-Code scaling program, mm to Inches and back
Post by: aussieexpat on June 17, 2014, 11:55:05 AM
Hi Tweakie,
Many thanks for your reply! The dummy continues, I;m sorry but where is the scale DRO box in Mach3? I tried looking so much my vision is blurred. Is it in the "OFFESETS" window or the "CONFIG" dropdown window?
Cheers
Greg
Title: Re: G-Code scaling program, mm to Inches and back
Post by: Tweakie.CNC on June 17, 2014, 12:14:04 PM
No worries Greg - I have been using Mach for the last 10 Years and I still don't know the half of it.  ;D

Tweakie.
Title: Re: G-Code scaling program, mm to Inches and back
Post by: Tweakie.CNC on June 17, 2014, 12:22:26 PM
Hi Greg,

Just one point of note - if your part origin (X0,Y0) is centre of the work then it's OK but if your part origin is bottom left then by changing the scale DRO to a negative value the origin will become bottom right (the GCode for the work has been flipped horizontally so has the starting point X0,Y0).
Not sure if this makes sense but you will see what I mean when you do it. ;)

Tweakie.
Title: Re: G-Code scaling program, mm to Inches and back
Post by: aussieexpat on June 18, 2014, 10:45:26 AM
Hi Tweakie,
Many thankyou's, without people like your good self helping us less in the know lot i think the world would stop spinning. I tried what you suggested and whalla its like magic!!!
Best regards
Greg
Title: Re: G-Code scaling program, mm to Inches and back
Post by: Tweakie.CNC on June 18, 2014, 11:52:11 AM
I am pleased that you got it sorted Greg.  ;)

Tweakie.
Title: Re: G-Code scaling program, mm to Inches and back
Post by: paula on December 19, 2014, 05:48:38 AM
Hi all, i am new to mach 3 & am trying to work out how to size in the program. i am wanting to cut out freestanding names in 18mm thick mdf the name is Justine & i am wanting the J to measure 20cm high any help would be greatly appreciated.
Regards Paula
Title: Re: G-Code scaling program, mm to Inches and back
Post by: Tweakie.CNC on December 19, 2014, 07:26:15 AM
Hi Paula,

Welcome to the forum.

Design your text (Justine) in CAD/CAM to your chosen dimension (200mm high for the J) then create the Gcode, using an outside toolpath (using the CAD/CAM’s Mach3 post processor). Load the created Gcode into Mach3 then check the dimension is correct (program limits in Toolpath screen).
If the dimension not correct, then adjust the Mach3 Scale DRO’s to correct the situation.

Just as an example the attached Gcode (created from Vectric) is of a 200mm high letter ‘J’which would be cut 18mm deep in 6 passes using a ¼ inch diameter cutter. If we wanted to cut it approx. double the size then within Mach3 change both the X and Y axis Scale DRO’s from +1.0000 to +2.0000. If we wanted to cut it approx. half the size, then change both the X and Y axis Scale DRO’s to +0.5000. Basically the letter ‘J’ can be scaled to almost any size (or aspect ratio) using this technique.
Please note that above I have used the term ‘approx.’ because although Mach scales the toolpath exactly - if we are still using the same ¼ inch diameter cutter (which is obviously not scaled) then with an outline toolpath this will make a difference to the actual finished size.

(There are other methods of doing this within Mach3 but this is the method I use).

Hope this helps.

Tweakie.
Title: Re: G-Code scaling program, mm to Inches and back
Post by: paula on December 19, 2014, 06:03:57 PM
Hi Tweakie, Thanks for the reply, i am creating &  editing my names in publisher, then i save them on a usb, then choose it as a gcode.
would i still have to get cad or cam software? i am only wanting to create children's  freestanding names & to my knowledge cad/cam is a very technical program. i am no rocket scientist & have very basic computer skills. Needing J in (Justin) as 200mm then (ustin) in lower keys in 100mm.   
Regards Paula.
Title: Re: G-Code scaling program, mm to Inches and back
Post by: Tweakie.CNC on December 20, 2014, 01:22:54 AM
Hi Paula,

If you have alternatives (such as Publisher) to create your text then that is just fine but creating the Gcode requires some sort of CAM software. The free version of LazyCam (supplied with Mach3) works quite well and this should suffice for creating your Gcode. (see Members Documents for LazyCam manual).

Once you have mastered the technique, trust me, it will all seem just so simple but initially there is quite a lot for you to learn – it’s not rocket science but it may seem a bit tough at first.

Tweakie.
Title: Re: G-Code scaling program, mm to Inches and back
Post by: Echejoe on September 25, 2016, 12:41:50 AM
Hi, I have created my PCB board with EagleCad software but I can not get it to upload onto the LazyCam that came with the March3 Rev2. The Cam processor in the EagleCad  generate files that are not seen by LazyCam.
Title: Re: G-Code scaling program, mm to Inches and back
Post by: Tweakie.CNC on September 25, 2016, 01:27:49 AM
You need to do a web search but there are a number of utilities (many are free) which will convert the Eagle CAD files to Mach3 compatible Gcode.
These are just a couple off the top of the pile…

http://pcbgcode.org/
http://rapid-pcb.com/

Tweakie.
Title: Re: G-Code scaling program, mm to Inches and back
Post by: jokojeje segun on January 26, 2017, 08:27:08 AM
hello everyone pls i need everybody's help. i want to build my own CNC machine (industrial one) pls i need the list of the mechanical, electronic and the software(best one) to use.
Title: Re: G-Code scaling program, mm to Inches and back
Post by: Tweakie.CNC on January 26, 2017, 08:48:41 AM
hello everyone pls i need everybody's help. i want to build my own CNC machine (industrial one) pls i need the list of the mechanical, electronic and the software(best one) to use.

How about Joe's Evo  http://joescnc.com/  all the work has been done you just follow the plans.

Tweakie.