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 02-08-2011, 10:19 AM
 
Join Date: Feb 2011
Location: USA
Posts: 5
tbitt1 is on a distinguished road
Help with a Square

I am very new to G-code! I have circles down, but need to do a square now. What I have is:

The stock is a square tube 5x3x37" and I need three square holes in the 3" side. One half inch in from the end, 11” long and 2.5" wide. This is what I came up with. Oh yea the mill is only 2d so all I have is X and Y.

My ref will be set to X 0 Y 0 at the outside left corner.

g0 x .5 y .25
g42 g0 x 0.09375 y 0.09375 Off set for 3/16” bit
g1 y 2.5
g1 x 11
g1 y -2.5
g1 x -11
g40

Will this work or am I missing something?

Last edited by tbitt1; 02-08-2011 at 11:53 AM. Reason: Updated measurements
Reply With Quote

  #2   Ban this user!
Old 02-09-2011, 01:19 AM
 
Join Date: Feb 2006
Location: india
Posts: 1,187
sinha_nsit is on a distinguished road

Post your drawing.

Need to insert G91 after first positioning.
Z movement to be included.
In the G42 G00 block, the coordinates of one corner of the square should be specified.
Reply With Quote

  #3   Ban this user!
Old 02-09-2011, 01:52 AM
neilw20's Avatar  
Join Date: Jun 2007
Location: Australia
Age: 63
Posts: 2,338
neilw20 is on a distinguished road

Just my opinion, but for simple things it easier to do without cutter offset.
Then you don't have to worry about some hard to control approach mystery.
Not knocking G41 stuff, but KISS. Keep It Simple Stupid.
Are you trying to plunge a hole.
How is it going to start? You control the Z? Then you need to pause to do it with M0.
__________________
Super X3. 3600rpm. Three ways to fix things: The right way, the other way, and maybe your way, which is possibly a faster wrong way.
Reply With Quote

  #4   Ban this user!
Old 02-09-2011, 05:42 AM
 
Join Date: Feb 2011
Location: USA
Posts: 5
tbitt1 is on a distinguished road

Originally Posted by neilw20 View Post
Just my opinion, but for simple things it easier to do without cutter offset.
Then you don't have to worry about some hard to control approach mystery.
Not knocking G41 stuff, but KISS. Keep It Simple Stupid.
Are you trying to plunge a hole.
How is it going to start? You control the Z? Then you need to pause to do it with M0.
If I do not do the G41 offset, will the hole be the correct size? Or do I account for the bit size in my measurements? I do not have powered Z so I step thru the program and plunge the Z. I got a chance to step thru it last night, it look good, but like I said I have only been it this for about a week. If their is a better way, I am all ears.
Reply With Quote

  #5   Ban this user!
Old 02-09-2011, 05:48 AM
neilw20's Avatar  
Join Date: Jun 2007
Location: Australia
Age: 63
Posts: 2,338
neilw20 is on a distinguished road

Just put the offset in in your toolpath, off by the radius.
Put a M0 whenever you need it to pause to move the Z manually.
Hit cycle start to continue until next M0, or just single step, and never walk away. Problem with G41 is thew is a preparatory move, which is no problem on the outside of something, but inside, To overcome this, I do the weird moves above the job, then ramp down after the dirty bit.
When there is nowhere to go but cut, you really don't want those weird moves.
Or you can use liberal M1s and turn optional stop on and off as required to stop. I use F4 key as a hot key to toggle optional stop. That is emergency pause, for my wife.
__________________
Super X3. 3600rpm. Three ways to fix things: The right way, the other way, and maybe your way, which is possibly a faster wrong way.

Last edited by neilw20; 02-09-2011 at 05:52 AM. Reason: typos and dumb grammar
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 02-09-2011, 06:15 AM
headsmess's Avatar  
Join Date: Oct 2010
Location: australia
Age: 29
Posts: 66
headsmess is on a distinguished road
Buy me a Beer?

Originally Posted by neilw20 View Post
Just put the offset in in your toolpath, off by the radius.
Put a M0 whenever you need it to pause to move the Z manually.
Hit cycle start to continue until next M0, or just single step, and never walk away. Problem with G41 is thew is a preparatory move, which is no problem on the outside of something, but inside, To overcome this, I do the weird moves above the job, then ramp down after the dirty bit.
When there is nowhere to go but cut, you really don't want those weird moves.
Or you can use liberal M1s and turn optional stop on and off as required to stop. I use F4 key as a hot key to toggle optional stop. That is emergency pause, for my wife.
ima listening....


its quite easy what neil is saying. reduce your hole dimensions by the tool diameter. thats a radius to each side. then a simple code along the lines of

go1 x0 y0
x10y0
x10y10
x0y10
x0y0.

a very basic square.

its rough. it has no feed controls, no offsets... nothing to confuse you...

chuck in f100 say... and the m0 every second line...

but its kiss and as long as your setup is right... rethink your reference... it works.
Reply With Quote

  #7   Ban this user!
Old 02-09-2011, 08:20 AM
 
Join Date: Feb 2011
Location: USA
Posts: 5
tbitt1 is on a distinguished road

Originally Posted by headsmess View Post
ima listening....


its quite easy what neil is saying. reduce your hole dimensions by the tool diameter. thats a radius to each side. then a simple code along the lines of

go1 x0 y0
x10y0
x10y10
x0y10
x0y0.

a very basic square.

its rough. it has no feed controls, no offsets... nothing to confuse you...

chuck in f100 say... and the m0 every second line...

but its kiss and as long as your setup is right... rethink your reference... it works.
I would like to start with, thanks for all the great replies!

How does this look?

Reference being X 0 Y 0

g0 x 0 y 0
g1 y 2.40625
m0
g1 x 10.90625
m0
g1 y -2.40625
m0
g1 x -10.90625
m0

Thanks again
Reply With Quote

  #8   Ban this user!
Old 02-09-2011, 02:09 PM
neilw20's Avatar  
Join Date: Jun 2007
Location: Australia
Age: 63
Posts: 2,338
neilw20 is on a distinguished road

You can round those to 4 decimal places.
Do you really think your machine can resolve 0.00001 ??
Add some comments so that the prompt line makes sense (next week)
You must select a feed for G1 to work

Code:
G0 X0 Y0
G1 y2.4063 F10 (You must have a FEED or G1 will complain)
m0 (Turn ON spindle, and MOVE Z DOWN)
X10.9063 
M0 
Y-2.4062
M0
X-10.9062
M0 (RETRACT Z NOW)
G0 (maybe not a good idea in your case)
M30 (End of program)
This will work OK.
Spaces for clarity, but keep the numbers with their respective letters for readability.
G0 and G1 are modal, so don't keep repeating yourself.
Less stuff means improved readability
__________________
Super X3. 3600rpm. Three ways to fix things: The right way, the other way, and maybe your way, which is possibly a faster wrong way.

Last edited by neilw20; 02-09-2011 at 02:14 PM. Reason: Extra thoughts
Reply With Quote

  #9   Ban this user!
Old 02-09-2011, 08:39 PM
 
Join Date: Feb 2011
Location: USA
Posts: 5
tbitt1 is on a distinguished road

Neil,
Great, Thank you very much!
Reply With Quote

  #10   Ban this user!
Old 02-10-2011, 01:48 AM
headsmess's Avatar  
Join Date: Oct 2010
Location: australia
Age: 29
Posts: 66
headsmess is on a distinguished road
Buy me a Beer?

is that code absolute or incremental?

not to be picky but i see a square of 5 by 20 inches here... 0,0 being the centre.

at least the way i use my machine...

Click image for larger version

Name:	square.JPG
Views:	21
Size:	10.3 KB
ID:	126087

a quick pic.

white square. your material.

grey square, hole. the corners shall be radius, of course.

red square is the tool path.

green circle is cutter at 0,0 (already subtracting tool radius)

opposite corner would be X5 Y2.5 minus, again, tool radius. two radii make a diameter

the way i work, (aasuming this to be a 5" by something hole...)the purple circle is at approx X2.5 Y2.41967283 whatever it was ( ), with the tool heading TOWARDS X0 Ywhatever it was...

OR,, the cutter is moving AWAY FROM X0 Y whatever it is... (in the X axis only!)

get the idea?

then you must consider...to hold X at 0, and move Y first? or to hold Y at 0, and move X?

(ie;

X0 Y0
X0 Y10
X10 Y10
versus

X0 Y0
X10 Y0
X10 Y10...)


which way you go depends on machine capabilities. cutter turns clockwise from above. to travel X first results in CLIMB MILLING, Y first is conventional milling. when doing an inside cut.

move Y first if you have backlash, so the hole is cut in a CLOCKWISE direction... yes, it is important!

confusing?

this is basic!
Reply With Quote

Sponsored Links
  #11   Ban this user!
Old 02-10-2011, 09:41 AM
 
Join Date: Feb 2011
Location: USA
Posts: 5
tbitt1 is on a distinguished road

the G-Code is in incremental or Relative.
Reply With Quote

  #12   Ban this user!
Old 02-10-2011, 05:26 PM
neilw20's Avatar  
Join Date: Jun 2007
Location: Australia
Age: 63
Posts: 2,338
neilw20 is on a distinguished road

Not incremental.
This code described here is absolute.
__________________
Super X3. 3600rpm. Three ways to fix things: The right way, the other way, and maybe your way, which is possibly a faster wrong way.
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
How square is enough? zeeway DIY-CNC Router Table Machines 7 12-03-2009 05:22 AM
3mm square 16 pin QFN powerr PCB milling 3 11-06-2009 01:09 PM
Newbie- Square hole in square tube bubblybill General Metalwork Discussion 6 09-20-2009 10:18 PM
Square hydrogen DIY-CNC Router Table Machines 8 05-27-2008 11:39 PM
WOn't cut square! Ed_R DIY-CNC Router Table Machines 51 03-23-2006 05:19 AM




All times are GMT -5. The time now is 07:54 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