CNCzone.com-The Largest Machinist Community on the net!



Home Page Mark Forums Read Today's Posts My Replies Classifieds Reviews Photo Gallery Web Links Share Files Advertise With Us Ad List
Go Back   CNCzone.com-The Largest Machinist Community on the net! > Machine Controllers Software and Solutions > LinuxCNC (formerly EMC2)


LinuxCNC (formerly EMC2) Discuss LinuxCNC (formerly EMC2) Controlers here!


This forum is sponsored by:

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Ban this user!
Old 11-28-2007, 11:11 PM
 
Join Date: May 2005
Location: canada
Posts: 1,149
cyclestart is on a distinguished road
g-code generators!

A couple of gcode generators have shown up in the wiki
http://wiki.linuxcnc.org/cgi-bin/emc...ode_Generators

Sounds like there's more to come. Thanks Big John T and Dan Falck.

We already had these;
http://www.pico-systems.com/gcode.html
but having stuff in python is cool. Easy to hack around in if you want something custom.

Dan Falck, if you're out there, what's the purpose of the scale widget? Seems redundant at first glance. Maybe it's part of a template for future code?

O.T. What's the gnome equivalent of KNotes? Having a sticky notepad is handy when posting links. Ubuntu is cool but sometimes I miss the Kde toys.
__________________
Anyone who says "It only goes together one way" has no imagination.
Reply With Quote

  #2   Ban this user!
Old 11-29-2007, 12:01 AM
acondit's Avatar  
Join Date: Apr 2005
Location: USA
Posts: 1,774
acondit is on a distinguished road

Cyclestart,

There is a Ubuntu download configured with Kde instead of Gnome. I don't know how tightly Axis is tied to Gnome. You might want to try it out and let us know.

Alan
__________________
http://www.alansmachineworks.com
Reply With Quote

  #3   Ban this user!
Old 11-29-2007, 09:34 AM
 
Join Date: Mar 2004
Location: Iowa, USA
Posts: 264
rippersoft is on a distinguished road

GCam - http://gcam.js.cx/index.php/Main_Page

See package gcam-2007.09.15.tar.gz below Windows stable package

OpenCam - http://opencam.sourceforge.net/

Written to run with GamBas

Enjoy,
RipperSoftware
Reply With Quote

  #4   Ban this user!
Old 11-29-2007, 11:23 AM
 
Join Date: Oct 2006
Location: usa
Posts: 15
runchman is on a distinguished road

I like the goal of gcam:

Design Goals

Indisputable domination of both free and commercial CAM software markets.
Reply With Quote

  #5   Ban this user!
Old 11-30-2007, 05:44 AM
 
Join Date: May 2005
Location: canada
Posts: 1,149
cyclestart is on a distinguished road

Originally Posted by acondit View Post
There is a Ubuntu download configured with Kde instead of Gnome. I don't know how tightly Axis is tied to Gnome. You might want to try it out and let us know.
Whoa, that seems a little extreme, but probably serves me right for being so lazy! Otoh, if there's an interest in emc/kde, I'm a cheerful testmule. The Gnome applet is 'sticky notes' and can be added by right clicking the top panel.

Rippersoft

I was aware of those two programs. The gcode generators on the wiki are simple helpers for people who hand code. What they are at the moment is less exciting than what they could become with a little more work. The script is written in an easy to edit form . Tied together they could be a suite of sorts. Like cad/cam without the cad. Emc's holecircle.py is an example of how nice the these little apps can turn out.
__________________
Anyone who says "It only goes together one way" has no imagination.

Last edited by cyclestart; 11-30-2007 at 06:05 AM. Reason: clarifiacation
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 12-03-2007, 10:07 PM
 
Join Date: May 2005
Location: canada
Posts: 1,149
cyclestart is on a distinguished road

I've been having some fun with this idea. This is a quick, dirty, possibly error filled, and hopefully highly readable, take on makering.c. Makering.c can be found in the pico systems link in the first post. I'll add an attachment to this post when/if the code improves. Warning, I use program language like a monkey uses a hand grenade.

#!/usr/bin/python
from Tkinter import *
import math

root = Tk() #makes the window, root is just a convention
root.title("DangerCam") #name for title bar

def gcodeme(): #this function is called below, see "Button"
saved = name.get() #collect the "saved as" name for file
f = file(saved, 'w') #open that file for writing
speed = int(rpm.get()) #collect the other entry box values
firstcut = float(rough.get())
tool = float(cutter.get())
permin = float(feed.get())
cx = float(cenx.get())
cy = float(ceny.get())
secondcut = float(final.get())
depth = float(deep.get())

pathone = (firstcut / 2) - (tool / 2) #followed by a few
pathtwo = ((secondcut - firstcut) / 2) + pathone #calculations
threeoclock = pathone + cx
nineoclock = cx - pathone
twelveoclock = cy + pathtwo
sixoclock = cy - pathtwo
#and then write the gcode to file

f.write("% n")
f.write("S%i M03 n" % (speed))
f.write("G00 X% 8.4f Y% 8.4f n" % (threeoclock, cy))
f.write("Z.1000 n")
f.write("G01 Z% 8.4f F% 8.4f n" % (depth, permin))
f.write("G03 X% 8.4f Y% 8.4f R% 8.4f n" % (nineoclock, cy, pathone))
f.write("X% 8.4f Y% 8.4f R% 8.4f n" % (threeoclock, cy, pathone))
f.write("X% 8.4f Y% 8.4f R% 8.4f n" % (cx, twelveoclock, pathtwo))
f.write("X% 8.4f Y% 8.4f R% 8.4f n" % (cx, sixoclock, pathtwo))
f.write("X% 8.4f Y% 8.4f R% 8.4f n" % (cx, twelveoclock, pathtwo))
f.write("G00 Z2 n")
f.write("M02 n")
f.write("% n")

f.close() #close file This might not be quite right??
root.destroy() #destroys window, end of function gcodeme



rpmlabel = Label(root, text = "Spindle RPM") #a few labels
roughlabel = Label(root, text = "Rough Diameter")
cutterlabel = Label(root, text = "Cutter Diameter")
feedlabel = Label(root, text = "Feed Rate")
cenxlabel = Label(root, text = "X center")
cenylabel = Label(root, text = "Y center")
finallabel = Label(root, text = "Finish Diameter")
deeplabel = Label(root, text = "Depth")
namelabel = Label(root, text = "Save File as")

rpm = Entry(root, width = 30) #a few entry widgets
rough = Entry(root, width = 30)
cutter = Entry(root, width = 30)
feed = Entry(root, width = 30)
cenx = Entry(root, width = 30)
ceny = Entry(root, width = 30)
final = Entry(root, width = 30)
deep = Entry(root, width = 30)
name = Entry(root, width =30)

Label(root, text = "DANGER!", fg = '#006699', font = ('Papyrus', 20)).grid()
# some descriptive text, you've been warned !

rpmlabel.grid() #add stuff to the window
rpm.grid()
roughlabel.grid()
rough.grid()
cutterlabel.grid()
cutter.grid()
feedlabel.grid()
feed.grid()
cenxlabel.grid()
cenx.grid()
cenylabel.grid()
ceny.grid()
finallabel.grid()
final.grid()
deeplabel.grid()
deep.grid()
namelabel.grid()
name.grid()

Button(root, text = "Make it so", command = gcodeme).grid()
# command calls function gcodeme()

root.mainloop() #keeps window open until killed in gcodeme function

###########################################################################
# the gcode program the python program is based on
###########################################################################
# %
# #100= 1000 (RPM)
# #101= 2 (rough diam)
# #102 = .5 (cutter diam)
# #103= 60 (feed)
# #104= 0 (x center)
# #105= 0 (y center)
# #106= -.25 (depth)
#
# #107= [[#101/2]-[#102/2]]
# (circle r - cutter r)
#
# #108= 2.02 (finish diam)
# #109= [[[#108-#101]/2]+#107]
#
# S#100 m03
# g00 x[#107+#104] y#105
# z.1
# g01 z#106 f#103
# g03 x[[-1*#107]+#104] y#105 r#107
# x[#107+#104] y#105 R#107
# x#104 y[#105+#109] r#109
# x#104 y[#105-#109] r#109
# x#104 y[#105+#109] r#109
# g00 z2
# m02
# %
###########################################################################
edit: can't seem to post backslashes inside a quote. Assume all single lowercase "n" are preceded by a backslash .
\n

postscript/ I've made several improvements to the code including some graphics. Unfortunately [code] tags don't work well on this forum. The loss of whitespace being the worst (and fatal) problem. Maybe I'll host the files myself at a later date.
__________________
Anyone who says "It only goes together one way" has no imagination.

Last edited by cyclestart; 12-11-2007 at 10:29 PM. Reason: posting problem
Reply With Quote

  #7   Ban this user!
Old 12-04-2007, 09:15 PM
 
Join Date: Sep 2004
Location: USA
Posts: 147
Dan Falck is on a distinguished road

I put in the scale widget as a cheap and dirty way of converting between inch and metric. I was using an earlier version to dump points into vectorcam using it's plc (point, line, circle) format. It assumes everything coming into it in that format is in metric. So, I was entering the scale as 25.4 and Vector seemed happy. But, yes, it is kind of redundent. It's easy enough to take it out.

Thanks for looking at it.
Dan
Reply With Quote

  #8   Ban this user!
Old 12-16-2007, 11:45 PM
 
Join Date: May 2005
Location: canada
Posts: 1,149
cyclestart is on a distinguished road

Originally Posted by acondit View Post
There is a Ubuntu download configured with Kde instead of Gnome. I don't know how tightly Axis is tied to Gnome. You might want to try it out and let us know.
Emc2 simulator and Axis seem to be running nicely on Mepis/kde. Combine cabin fever with curiosity and strange things happen

Dan
Living in a (sort of) metric country I should have figured that out.

edit/ added a screenshot. An idea is brewing.

A couple of people have been complaining about the heaviness of Ubuntu (it's fast enough for me by the way). Is the issue really Ubuntu or is it Gnome? The screenshot shows a 3d desktop I use occasionally. This is accessed by logging into a new session. Window makers like fluxbox can also be created in a new session. Wonder if emc2 will work properly in this type of environment?

Wow this is going OT Off to experiment.
Attached Thumbnails
Click image for larger version

Name:	3demc.png‎
Views:	190
Size:	338.4 KB
ID:	48745  
__________________
Anyone who says "It only goes together one way" has no imagination.

Last edited by cyclestart; 12-17-2007 at 09:26 PM. Reason: trying to add image
Reply With Quote

  #9   Ban this user!
Old 01-17-2008, 08:34 AM
 
Join Date: May 2005
Location: canada
Posts: 1,149
cyclestart is on a distinguished road

The holecutting code is improving somewhat. Attached is the current .py file. This program will cut a ring, leaving a center slug. Some caution needed when the slug lets go. Why make chips if you don't need to.

This script can be run stand-alone or placed in /usr/share/emc/ncfiles/ to take advantage of the write to Axis function. Ability to use fractions removed at this point.

Any feed back welcome. Features or scripts you would like see. Problems with resolution or features. Even "Quit dragging up this thread you moron !!!". I'm thick skinned. Positively obtuse some would say.

Thanks John T for the vast majority of the script.
Attached Files
File Type: zip pygcode.zip‎ (4.9 KB, 102 views)
__________________
Anyone who says "It only goes together one way" has no imagination.
Reply With Quote

  #10   Ban this user!
Old 01-17-2008, 09:53 AM
 
Join Date: Aug 2005
Location: USA
Age: 78
Posts: 197
ErnieD is on a distinguished road
G-code generators

Hi,

Being a complete tyro when it comes to g-code,I have a question. If you use this method to generate the code and save it as a .txt file and then load it into your machine will it work?

Thanks,

Ernied
Reply With Quote

Sponsored Links
  #11   Ban this user!
Old 01-17-2008, 11:29 PM
 
Join Date: May 2005
Location: canada
Posts: 1,149
cyclestart is on a distinguished road

Ernied

Good question. I had only run it in simulation up until you asked! But yeah, I'll give it a qualified passing grade. Qualified because I'm using the program to cut the z axis parts for my mini-mill. Made a 1.735 hole in a 1" block of aluminum while approximating the plunges with hand feed.

If you do run the program use the usual cautions. The endmill must be capable of plunging. Make sure the spindle is in a safe position for the first rapid move. Backplot in Axis in sim mode and think through what the program is doing. Read the included "Help info" file before running. The same cautions really apply to any code generating software, but doubly so in this case. Single stepping with one hand on the "OH S**T" button highly recommended for the first run.
__________________
Anyone who says "It only goes together one way" has no imagination.
Reply With Quote

Reply




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
learning g code or cad-cam code output? slow_rider G-Code Programing 3 02-27-2010 08:48 PM
G-code for beginners - want to learn G-code FPV_GTp G-Code Programing 7 11-17-2008 11:25 PM
simple python g-code generators Dan Falck OpenSource Software 0 11-26-2007 04:37 PM
looking for g code 3d from bobcadcam or simmilar for indexer lpt v5 with g code soft troyswood Ability Systems - LPT Indexer and G-Code 2 12-24-2006 09:21 PM
Manual Pulse Generators Michael M General Electronics Discussion 0 09-28-2004 05:19 PM




All times are GMT -5. The time now is 02:56 PM.





Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Content Relevant URLs by vBSEO
Template-Modifications by TMS

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361