# Using Excel to Generate Repettive blocks of G-Code

="N"&F1&" G01 X"&B1&" Y"&C1&" Z"&D1&" F"&E1
Columns (example) A ="N"&F1&" G01 X"&B1&" Y"&C1&" Z"&D1&" F"&E1 (Creates line of code) B .25 (X coordinate) C -.025 (Y coordinate) D .050 (Z coordinate) E 20 (F Speed) F 05 (Line Number)
Resulting code. Just copy and paste to text editor N5 G01 X0.25 Y-0.25 Z0.05 F20
Now for an example. Cut back and forth on the x axis from depth zero to a particular depth at depth increments of 0.001.
2nd line of data A Forumula B .25 C-.25 D 0.00 E 20 F +A1+5
3rd line of data A Forumula B +B2*(-1) C-.25 D +D2+0.001 E 20 F +A2+5
Copy and paste 3rd line into successive lines until desired depth is reached.
This is quick and dirty, but the resulting code should run. You will need to dress up the beginning and ending to match your control software and machine, and of course add comments as necessary, but I think it's a good quick dirty way to generate repetitive incremental g-code.
I didn't exactly figure it out myself. There was a hint on a forum I ran across, but their formula didn't work properly or have all of the little details.
I did find a bug when I tried it with Excel 97. For no apparent reason it added some extra digits out around the trillions place for a block of about 30 lines for the Z dimension resulting in a line of code that looks like this N370 G01 X0.25 Y-0.25 Z-0.0720000000000001 F20 from N370 to N505. I think it must be a bug in my installation of Excel. Most controller software would simply ignore differences beyond its resolution, but you should be aware of it if you use it on machines with controllers that look at those kinds of tolerances.
The resulting code looks like this: N5 G01 X0.25 Y-0.25 Z0.05 F20 N10 G01 X0.25 Y-0.25 Z0 F20 N15 G01 X-0.25 Y-0.25 Z-0.001 F20 N20 G01 X0.25 Y-0.25 Z-0.002 F20 N25 G01 X-0.25 Y-0.25 Z-0.003 F20 N30 G01 X0.25 Y-0.25 Z-0.004 F20 N35 G01 X-0.25 Y-0.25 Z-0.005 F20 N40 G01 X0.25 Y-0.25 Z-0.006 F20 N45 G01 X-0.25 Y-0.25 Z-0.007 F20 N50 G01 X0.25 Y-0.25 Z-0.008 F20 N55 G01 X-0.25 Y-0.25 Z-0.009 F20 N60 G01 X0.25 Y-0.25 Z-0.01 F20 N65 G01 X-0.25 Y-0.25 Z-0.011 F20
This is obviously a very simple task, and there may be a better way to do it for many controllers, but for quick one off jobs of an incremented repetitive nature (like making a simple cut off or cutting a circle) it's a very quick tool. With a little creativity you could modify this to generate code for any repetitive task.
="N"&F1&" G01 X"&B1&" Y"&C1&" Z"&D1&" F"&E1 I did try this line in Quattro Pro and Open Office Calc and it did not work. There may be a way to get the same results with another spreadsheet program, but this particular example only works properly in Excel.
Just put your necessary G0 and M Codes in and you are good to go. Modify and format to fit your style and controller software.
Bob La Londe www.YumaBassMan.com
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
I can take the output from an excel spreadsheet that generates a curve or shape I need into my Cad program and export out G-code. spirals are easier.
Martin
Yeah And... wrote:

<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>

Obviously I should have incremented Z on one line and then on the next line set the new XY coordinates, but I was in a hurry to get the example tested.
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
On Wednesday, September 16, 2009 at 1:47:00 PM UTC-4, Yeah And... wrote:

Hi, Can I use the repetier software to upload this g-code to my 3d printer?