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 > G-Code Programing


G-Code Programing Discuss G-code programing and problems here!


This forum is sponsored by:

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Ban this user!
Old 06-01-2009, 06:07 AM
 
Join Date: Jun 2009
Location: Slovenia
Posts: 5
ToiletDiver is on a distinguished road
First time with G code :(

Hi
Few days ago I started with learning some G code - but really basic one.
I tried to programmed it for the letter ''P'' and I came to this:

N10 #120=500
N20 G0 X75 Y0
N25 G1 X75 Y35 F#120
N30 G1 X89.639
N35 G1 X95.844 Y30.642
N40 G1 X95.844 Y19.356
N45 G1 X90.011 Y16.0
N50 G1 X74.994

So far I belive this is ok. Now I have the task to do something similar but for the letter "N". The problem is because I have several requirements given:
- the code has to be given (?) on the following sketch: HERE
I have absolutelly no idea what is this and how to use this sketch
- commands that can be used are G0, G1 and M30
- depth of process is 0,2mm
- starting point is at the bottom left corner
- area of material Z=0
- process is towards -X (negative) where X is almost whichever number (and not towards +X positive)
- speed of process is 100 mm/min
- dimension of the square aare 50x50 mm

I think I could do the program code for ''N'' letter without any requirements but those requirements (already the first one) confused me a lot.
So if anyone is willing to help to create this G code, I would appreciate it.

Thank you.
Reply With Quote

  #2   Ban this user!
Old 06-01-2009, 09:25 AM
 
Join Date: May 2007
Location: US
Posts: 779
Andre' B is on a distinguished road

Looked at your sketch, I cannot find a letter N in there anyplace. Got no idea what you are asking for.

Your code for the letter P.
Just a word of warning for many controls using (X75) when you really want (X75.0) will result in a less then desirable outcome.

They read X75 to be 75 steps at the machines smallest step size.


You can get by with just (X75.) but I do not like to have a decimal point hanging off the beginning or end of a number.
I had some collage chem and physics instructors who would scrap your entire paper if they seen too many hanging decimal points, too easily confused with a sentance ending period.
Attached Thumbnails
Click image for larger version

Name:	Char P 1.PNG‎
Views:	53
Size:	24.1 KB
ID:	82280   Click image for larger version

Name:	Char P 2.PNG‎
Views:	89
Size:	20.9 KB
ID:	82281  
Reply With Quote

  #3   Ban this user!
Old 06-01-2009, 09:33 AM
 
Join Date: Jun 2009
Location: Slovenia
Posts: 5
ToiletDiver is on a distinguished road

There is no ''N'' inside the sketch. I just need to create a G code that will make a letter ''N'' (inside the square with starting point at the bottom left corner). I was able to do it for ''P'' because there was no requirements. All those requirements that are for the letter ''N'' confuse me. I have no idea how to use the data, for example, depth of process is 0,2mm (and others that I typed in my first post), in the programming code.
Reply With Quote

  #4   Ban this user!
Old 06-01-2009, 09:58 AM
 
Join Date: Oct 2005
Location: US
Posts: 1,220
MrWild is on a distinguished road

If it wasn't for the sketch, Id think you wanted us to do your school assignment.

With a starting point of bottom left, and a need for the "N" to be in -X, the "N" won't even be on the part.

Depth of process merely refers to depth of cut. So your cutter would cut at -Z.2 (I'm assuming the "," is really a decimal point sign.)

Area of Z material means your Z surface height is at 0.0 on the Z plane.

What exactly ae you doing. Could we have more info?
Reply With Quote

  #5   Ban this user!
Old 06-01-2009, 10:15 AM
 
Join Date: Jun 2009
Location: Slovenia
Posts: 5
ToiletDiver is on a distinguished road

With -X I meant that ''N'' needs to be INSIDE surface of the material which is in a shape of square. Depth (how ''far'' inside the material should be) is 0,2mm. If you meant how big ''N'' should be, it can be on the whole surface of this square.
Here is another sketch that I make, just for example: CLICK
With it, I hope I will be better understandable. As you can see on this second sketch starting point of ''N'' on purpose isn't really at the bottom left corner otherwise half of the square wouldn't be visible.
I have never programmed any G code. The ''P'' letter was the first time ever. So don't know how to use parameters as 100 mm/min.
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 06-01-2009, 11:06 AM
 
Join Date: Oct 2005
Location: US
Posts: 1,220
MrWild is on a distinguished road

If the corner of your material is "0,0" (0.0 in X and 0.0 in Y, plus 0.0 in Z) you would need to step over enough for the tool diameter so you are cutting the block when you start.

One thing you NEED to stop doing is using a comma "," instead of a decimal point when talking depth. It is NOT 0,2. This will give you errors. It is and can only be 0.2

Lets assume some things for ease of understanding

Your cutter diameter is 2mm.

Your feed is 100mm per minute

Your rapids are whatever the machine will do. Means G0 will go as fast as the machine can go.

N10 G0 X20 Y20 (puts your cutter over part and gives a 10mm edge)
N15 Z10 (rapidly lowers Z to 10mm over part)
N20 G1 Z-.2 F100 (feeds Z to "process depth)
N25 Y200 (moves cutter in Y for first leg of "N")
N30 X150 Y20 (moves cutter on the diagonal line)
N35 Y200 (moves cutter for last vertical line)
N40 G0 Z200 (raises Z at rapid speed)

This code will make an "N" but will not fit in your block dimensions. You can play around with the numbers to do that.

G0 and G1 are model and do not get repeated one set to rapid or feed. Only to change model state so you don't need G before every feed move or G0 for every rapid if the control is already in that model state.
Reply With Quote

  #7   Ban this user!
Old 06-01-2009, 11:40 AM
 
Join Date: Jun 2009
Location: Slovenia
Posts: 5
ToiletDiver is on a distinguished road

Thank you. So if I understand correctly, the lines where there is NO ''G'' (2., 4., 5. and 6.) means that the tool will move and won't cut any piece of material? but just replace one position (end point of current step) to another position (starting point of next step)? You forgot about M30 command.
Reply With Quote

  #8   Ban this user!
Old 06-01-2009, 02:54 PM
 
Join Date: Oct 2005
Location: US
Posts: 1,220
MrWild is on a distinguished road

No, it means the tool will move at the LAST modal change (sorry, I spelled it wrong.) A MODAL change, changes how the machine (tool) moves. If you have G0, then ALL moves after the G0 will be in rapid. You DO NOT need to write "G0" before every line.

HOWEVER, when you want to slow down and machine, you change the "G0" to "G1". All your moves will be machine feed rate AFTER the G1 at the feed rate you set. This is the same as writing G1 before every move.

Think of modal moves as family groups. If you specify a G0 family, then all moves after the G0 will be rapid moves UNTIL you change the family to G1. Then all moves will be in the G1 family and move at the feed rate you set.

A special note on feed rates. If you do not give a "F" at the end of your G1 line at the beginning of the G1 moves, your control may just sit there and tell you it has no feed rate set. In this case it just sits there leaving you scratch your head wondering what is wrong.

Line "N20" gives G1, lists a position, and then says, "F100". This means the cutter will move at 100mm per minute. From this point on all G1 moves will travel at 100m per minute until you change the feed rate speed with another "F" command at the end of your line of code.
Reply With Quote

  #9   Ban this user!
Old 06-02-2009, 02:40 PM
 
Join Date: Jun 2009
Location: Slovenia
Posts: 5
ToiletDiver is on a distinguished road

Hmmm sounds complicated. Thank you for your time for me MrWild. Hope I will be able to do this task now.
Reply With Quote

  #10   Ban this user!
Old 06-02-2009, 05:19 PM
 
Join Date: Oct 2005
Location: US
Posts: 1,220
MrWild is on a distinguished road

Your welcome. It isn't real complicated, but rather involved. I went to the local tech college bookstore and got one of the text books for G-code programing. It wasn't cheap, but it did a good job explaining every step.
Reply With Quote

Sponsored Links
  #11   Ban this user!
Old 06-04-2009, 10:43 PM
 
Join Date: Feb 2006
Location: United States
Posts: 273
dpuch is on a distinguished road

To clarify/simplify what MrWild was saying
Colored text is not required because they are modal. Once set the control assumes that is what you mean, so they can be omitted.
Sorry for the ugly colors.

N10 G0 X20 Y20 (puts your cutter over part and gives a 10mm edge)
N15 G0 Z10 (rapidly lowers Z to 10mm over part)
N20 G1 Z-.2 F100 (feeds Z to "process depth)
N25 G1 Y200 F100 (moves cutter in Y for first leg of "N")
N30 G1 X150 Y20 F100 (moves cutter on the diagonal line)
N35 G1 Y200 F100 (moves cutter for last vertical line)
N40 G0 Z200 (raises Z at rapid speed)

This will do the same as MrWild posted, but as programs get more complex it makes it harder to read and edit. The best programming is usually using only what you need.
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 Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Newbie- Takeout Unused G Code commands in Mastercams Generated G Code shneek Mastercam 8 12-15-2010 02:32 PM
Need Help!- calculate machining time from G-Code smar G-Code Programing 15 02-23-2009 04:06 PM
milling time (not to be confused with hammer time) barefoot0 G-Code Programing 4 05-02-2007 06:18 PM
X2 Conversion Time (shopping time) Micro Rotors Benchtop Machines 2 03-04-2007 11:11 AM
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




All times are GMT -5. The time now is 12:17 AM.





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