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 07-08-2008, 09:37 AM
 
Join Date: Jul 2008
Location: US
Age: 49
Posts: 2
John762 is on a distinguished road
Lord I hope this is the right place.......

Ok so before you start with the slaps and the shots or even the (even if I deserve it) can you throw me a bone here?

First post, absolute newby and I have no clue what any of the code jibberish I'm reading means!
I'm getting my first mill in a few weeks and it's a manual machine, so that should tell you I'm pretty much in the dark with everything you guys are talking about.
I have a couple of friends who have CNC machines and it seems pretty interesting to me so I would like to learn a little about the programming and how it works etc etc etc.
What I would like to know is this, is there such a thing as "G-Code for Dummies", and if so is it really helpful?
If you had to start from scratch today, and you knew nothing about code, and I mean absolutely nothing what kind of book would you buy to gain some basic understanding of how it works and what it does?

I would like to take a class but my current work situation prohibits that so a book would be the easiest thing for the time being.
Any suggestions?
TIA
Reply With Quote

  #2   Ban this user!
Old 07-08-2008, 09:42 AM
beege's Avatar  
Join Date: Feb 2008
Location: USA
Posts: 518
beege is on a distinguished road

Check out cncci.com. Lots of books/options there.
Reply With Quote

  #3   Ban this user!
Old 07-08-2008, 10:05 AM
jalessi's Avatar  
Join Date: Feb 2007
Location: U.S.A.
Posts: 3,155
jalessi is on a distinguished road
Smile

Welcome to the Zone

See link below, lots of free information.

http://www.cncinformation.com/
Reply With Quote

  #4  
Old 07-08-2008, 10:06 AM
ger21's Avatar
Community Moderator
 
Join Date: Mar 2003
Location: Shelby Twp, MI....USA
Posts: 20,455
ger21 is on a distinguished road
Buy me a Beer?

http://www.cnczone.com/forums/showthread.php?t=60310
__________________
Gerry

Mach3 2010 Screenset
http://home.comcast.net/~cncwoodworker/2010.html

(Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)
Reply With Quote

  #5   Ban this user!
Old 07-08-2008, 12:43 PM
 
Join Date: May 2007
Location: USA
Posts: 913
g-codeguy is on a distinguished road

I didn't know you could program a manual mill. What make/model is it?

EDIT: Welcome to the forum. Lots of good people here. All willing to give a helping hand.
Reply With Quote

Sponsored Links
  #6  
Old 07-08-2008, 01:09 PM
HuFlungDung's Avatar
Moderator
 
Join Date: Mar 2003
Location: Canada
Posts: 4,825
HuFlungDung is on a distinguished road

Originally Posted by g-codeguy View Post
I didn't know you could program a manual mill.

Yes, yes you can. But it takes ME code and a lot of "I'll DO" macro statements
__________________
First you get good, then you get fast. Then grouchiness sets in.

(Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)
Reply With Quote

  #7   Ban this user!
Old 07-08-2008, 01:16 PM
Crevice Reamer's Avatar  
Join Date: Mar 2008
Location: USA
Posts: 3,454
Crevice Reamer is on a distinguished road

Maybe this will help you to get started:

CNC: Computer Numeric Control. CNC can do things that you couldn't DREAM of doing manually. Properly programmed CNC can cut a sphere or any other geometric shape. All by combining axis moves to position the cutter in 3D space.

CNC Software:

G CODE: Actually there are many other letters involved also. This is the language that tells the Control program how to direct the machine to make the part.

There are three programs involved:

CAD: (Computer Assisted Design) A program to draw plans and maybe 3D objects with.
CAM (Computer Assisted Manufacturing) This program sets up the tool paths for the mill or lathe. It may translate the CAD output to G code.
CONTROL: This software actually runs the mill or lathe or router from the G code.

MACH3 is the hobbiest defacto best computer software for machine control. It can control either Steppers or Servos. Mach operates by sending out pulses to to the drivers that control the motors. The NUMBER of pulses is limited by the speed of the computer and by an upper limit. 35 to 50 thousand pulses is an average amount.

POWER SUPPLY: Device that changes 120 volt AC to smooth DC for CNC motors. Choosing the proper voltage to match drivers/motors is one of most important decisions needed. You NEVER want to install a switch on the DC side of the power supply.


BREAK OUT BOARDS: Mach3 uses the many wires in a parallel port (printer) cable to send control from the computer to the drives. Rather than fastening each tiny wire in the cable to its destination, the breakout board accepts the cable plug and then puts each wire on an accessable screw terminal.

BACKLASH: When reversing direction, any handle movement that does not also move the axis (or table or head/quill) is backlash. It is measurable directly by the dial on the handwheel. For CNC, backlash must be checked and adjusted often. Backlash will turn a circle into a vague blob.

RAPIDS: Non-cutter axis moves to get quickly from one point to another. These are cumulative, so if they are slow it slows down the whole job.

ACME SCREWS are the standard for most manual mills. They are just a relatively close tolerance screw thread and give fairly high precision and backlash while the adjustment lasts.

Acme screws and nuts wear quickly. Usually the screw wears most in the middle and less on the ends. After a while, you can't use the ends because it's too tight. Even relatively cheap ballscrews, which HAVE some backlash, are better because the backlash does not vary so often. Mach3 can compensate for backlash that doesn't keep getting worse

BALLSCREWS have large threads that allow a ball bearing to roll IN them. The ballscrew nut contains many small steel balls that recirculate inside to reduce friction. The ball nuts can be extremely tight to eliminate backlash--yet still have little friction.

Once ballscrews are installed, manual control may not be possible. Because ballscrews turn so easily, the table or head might not hold a position, but be free to move on its own. So while you COULD install hand cranks on double shaft motors, you might have to constantly lock the gibs on the other axes and it just may not be practical.

Ballscrews come in two types: Rolled and ground. Ground ballscrews are best, but can cost thousands of dollars for just one screw. We small-time automators usually can't afford them.

Rolled ballscrews come in several grades. The better they are for accuracy and low backlash per length, the more they cost. We usually use a medium grade.

If you buy say a six foot length of ballscrew, it needs to first be cut to axis lengths. It is hardened material, so this is usually best done with an abrasive cutting disk.

After they are cut, each end is turned down on a lathe. Because they are hardened, this is difficult to do. One end is usually turned to one diameter to fit a bearing. The other end may be turned to several decreasing diameters to accomodate thrust bearings, threaded for clamp nuts, and turned at the end to fit stepper coupling or pulley.

Once you have determined the LENGTH of the screws you need, there are companies who will make your ballscrews to order.

BALL NUTS: These are basically just enclosures that contain and recirculate the small ball bearings.

PRE-LOADED BALL NUTS: These have been re-loaded with larger balls. This takes up all available wiggle space and help eliminate backlash.

DOUBLE BALL NUTS: Two ball nuts with one tightened against the other to counter backlash. These are even better, but more expensive, and because they are longer, cost a loss of axis travel.

PULLEYS are used to increase torque by gearing down the motor RPM. However, stepper motors get weaker as speed increases, (To a limit of 800-1500 RPM depending on PS voltage--up to 20-25 times motor rated voltage if the drivers can handle it.) so most of the gain in torque results in lost speed. That's why most stepper motors are connected direct drive.

IPM: Inch Per Minute is the speed rating for the X, Y & Z axis motion. Cutting in a mill usually happens below 30 IPM. But rapids may need to be as fast as possible, to get from one place to another.

STEPPER MOTORS are designed to move just a tiny bit each time they receive an electrical pulse. Four wire Steppers can only be wired Bipolar Parallel. Five or Six wire steppers can be wired either Unipolar or Bipolar Series. Eight Wire steppers can be wired in any of the three methods.

Unipolar wired steppers are the easiest and cheapest to control, but lack power, because they only use half of the motor's coils at once.

Bipolar Series wired steppers are somewhat more powerful than Unipolar--And actually have the most torque at low speed.

Bipolar Parallel wired steppers are the MOST powerful at speed.

EXAMPLE OF BIPOLAR PARALLEL: Hold your hands out in front of you with palms facing you and thumbs up. Now fold down the two middle fingers. Each hand represents one of the four motor coils. Touch the pointer fingers and the little fingers together. This is one half of your motor coils wired in Bipolar Parallel. The current will flow into the pointer fingers and out of the little fingers. Because there are TWO paths for the current, there is LESS resistance and inductance this way, Current flow (Amps) is greater so the voltage must also be less.

EXAMPLE OF BIPOLAR SERIAL: Now rotate your right hand 90 degrees right and your left hand 90 degrees left. The thumbs are pointing right and left. Touch the little fingers together. This is one half of your motor coils wired in Bipolar Series. The current will flow into one pointer finger, through one coil, out of the little finger, into the next little finger and out the other pointer finger. Now there is only ONE path for the current, there is MORE resistance this way, so current flow (Amps) is less and the voltage can be greater.

EXAMPLE OF UNIPOLAR: Just like Bipolar Serial above, but the two coils are center tapped, (Little Fingers) and only one half (Or HAND) at a time is powered. So power would go INTO one Little finger, and then out of that hand's Pointer finger. To run a Unipolar motor in reverse, power is directed from the center tap (Little Fingers) to the OTHER coil. (Or Hand)

MICROSTEPPING: Some drivers are designed to artificially reduce the distance the motor will turn by electronics. A full step is hardwired at 1.8 degrees and with 200 computer pulses it will complete one revolution. With microstepping set at 10 (Or one tenth) The motor will theoretically take 2000 steps (And computer pulses) to complete a revolution. I say theoretically because microsteps get just a little more vague in size as their number increases. Micro stepping operates at the expense of speed, and promises extremely high accuracy by increasing steps per revolution, but practically 8 or 10 microsteps are the limit. The computer and software can only put out just so many pulses, and the higher the step count, the slower the motor will run.

CONTROL DRIVES:

Stepper drives are the electronics that translate the pulses from the computer into useable current for the motors. They are fairly expensive and many are easily damaged. Wiring the drive wrong or disconnecting it during use will destroy most drives. Generally, the more expensive drives (Like the Gecko G203 Vampires) offer the best features like overheat protection, micro stepping and speed morphing. Steppers tend to get hottest standing still. Overheat protection will 1. Cut the current down, and 2. Put the motor in "sleep" mode after a short wait. Both will drastically reduce heat buildup. Morphing changes the speed to micro step at low speed accuracy, but jump to full steps for high speed rapids. You can have a powered driver without a motor connected, But you NEVER want to disconnect a motor while power is applied.

PID: A Proportional–Integral–derivative controller (PID controller) is a generic control loop feedback mechanism widely used in servo control systems.

Servo Drives that WE can afford, use basically the same pulse system as stepper drives. Actual expensive commercial servo drives use a different, more expensive system.

GECKO DRIVES are generally acknowledged as the best. Gecko "Vampire" drives are virtually unkillable. The G203V "Vampire" drive can also morph from high resolution microstep cutting to very fast Full Step Rapids.

The new low-cost Gecko G540 board (Accepts up to 50 volt power supply) will combine four axes of tiny cheap drives with a "Vampire" morphing breakout board so that all you need to connect is the parallel cable, power wires, and motor cables. In a short while, CNC conversion is going to be a LOT easier and less expensive.

SERVO MOTORS, which are more expensive, do not have the starting torque that steppers have, but they maintain what torque they have into high rpms. They are usually geared down 2 or 3 to 1 to gain starting torque. Even geared down, they can still attain thousands of RPM, so speed is not a problem with pulleys. Servo motors are also equipped to tell the computer (through encoder feedback) exactly where the motor is at any given time so there are no missed steps. Stepper motors can stall and miss steps unbenownst to the operator until the finished part is measured. Servo motors will destroy themselves if stalled or if encoder fails.

CPR: Count Per Revolution.

PPS: Pulse Per Second.

Encoders: These send position and speed feedback to the controller and are rated in CPR. They are quadrature devices that require 4 times the PPS per revolution. For example: An encoder rated at 250 CPR, will require 1000 drive Pulses Per Second.

Each system has its pros and cons. Steppers used with proper power supplies are reliable, consistent and cost effective--That's why most hobby applications use steppers.

POWER SUPPLY: Both types of motors run on DC Voltage. The power supply simply converts ordinary alternating current into this direct current. Stepper motors need around 20 times their rated voltage to perform at their best. For example, a motor rated at 2 volts will perform best, without stalling or losing steps, with a 40 volt power supply.

NEMA= National Electrical Manufacturers Association. They set the USA electrical standards.

NEMA SIZES: Both steppers and servos may come in different Nema flange sizes.
Nema 23= 2.3 inch flange. Nema 34= 3.4 inch flange etc. We usually use either the smaller Nema 23 or the somewhat larger Nema 34. The torque may overlap between the sizes, but generally the larger motor has an easier time.

For example, a 500 oz Nema 23 stepper motor will be working hard (and getting hotter) to attain the torque at which a 500 oz Nema 34 will be easily cruising. Generally, power is added by extending the length (stack) of the motor.

RESOLUTION: The measured (In mm. or inch) amount of accuracy possible in an axis move. This is a combination of number of steps per motor revolution and number of turns per inch of the lead screw. For example: A direct-drive Stepper motor with driver set for full step will take 200 steps for one full revolution. If that revolution turns a ballscrew with 5 turns per inch, then there will be 1000 steps per inch or a resolution of one thousanth of an inch. (.001) If that same motor was turning a 20 turn per inch Acme screw, the resolution would be 4000 steps per inch, or 4 thousanths of an inch. (.0004) Pulley or gear ratios add to the resolution.

LIMIT SWITCHES: These are usually Normally Closed switches that tell mach when an axis has exceeded its limit of travel. On a servo system they will prevent the servo from stalling and burning itself up. On a high speed stepper system they may prevent impact damage to the motor. On a low speed stepper system they are probably not needed as the stepper motor will stall harmlessly. It is almost impossible to limit switch the lower end of Z travel because of varying tool lengths. Mach3 will also allow you to set up "soft limits" that operate independent of any switch.

HOME SWITCHES are usually Normally Open, and set at one of the limits of travel. When Mach orders a home operation, the axes go to the home switch location, close the switch, and then move slightly back and stop. This gives a reference position for mach to start from and position the tool.

It is possible to combine the upper N.C. limit switch with a N.O. home switch in the same switch. (double throw)

MGP: Manual Pulse Generator. This allows easy manual CNC axis control without programming. Can be either a hand-wheel or joystick control.

CR.
Reply With Quote

  #8   Ban this user!
Old 07-08-2008, 01:23 PM
 
Join Date: Oct 2006
Location: USA
Posts: 143
Sowen is on a distinguished road
Here is the list of general standards

These are a short list of the "standard" if there is such a thing we can call these fanuc style.


These few should be put to memory.

Standard ISO Style Gcode

GCode Function Example Notes

G00 Linear interpolation Rapid G00 X1.0 Y0.0 Z0.1 Straight Lines Rapid (Rapid Movement)

G01 Linear interpolation Feed G01 X1.0 Y0.0 Straight Lines Cutting (Feed Movement)

G02 Circular Interpolation(Clockwise) G02 X0.0 Y0.0 I1.0 J1.0 I and J (arc center) or R (radius)

G03 Circular Interpolation (Counter-Clockwise) G02 X0.0 Y0.0 R0.5 I and J (arc center) or R (radius)



G20 Program in Inches G20 Set the controls Units to inch

G21 Program in Millimeters G21 Set the controls Units to Millimeters

G21 Program in Millimeters G21 Set the controls Units to Millimeters

G28 Home Position G28 X0.0 Y0.0 Z0.0 Returns he Machine to the Home Position

G40 Tool Compensation Off G01 X1.0 Y0.0 G40 Cancels G41 and G42
G41 Offset Tool Left G01 X1.0 Y0.0 G41 Moves the tool to the left side of given Coordinates
G42 Offset Tool Right G01 X1.0 Y0.0 G42 Moves the tool to the Right side of given Coordinates


G43 Tool offset positive G43 Move Tool away from work piece

G54-G59 Work-offsets G54 X0.0 Y0.0 Z0.0 Move to workoffset



G73 High speed drilling G73(Gode Varies) Canned Cycle
G74 Left hand tapping G74(Gode Varies) Canned Cycle
G76 Fine boring G76 (Gode Varies) Canned Cycle
G80 Cancel Canned Cycle G80 Canned Cycle Cancel
G81 Spot Drill G81(Gode Varies) Canned Cycle
G82 Spot Drill Dwell G82(Gode Varies) Canned Cycle
G83 Peck Drill G82(Gode Varies) Canned Cycle
G84 Tapping cycle G84 (Gode Varies) Canned Cycle


G90 Absolute Coordinates G90 Use absolute postioning
G91 Use Incremental Coordinates G91 Use incremental postioning
G92 Set Absolute Zero Position G92 X1.0 Y1.0 Z0.0 Sets a new zero position
Reply With Quote

  #9  
Old 07-08-2008, 02:24 PM
High Seas's Avatar
Gold Member
 
Join Date: Sep 2003
Location: Malaysia/Australia/NZ/USA
Age: 62
Posts: 1,124
High Seas is on a distinguished road

Some of these cry out "STICKY"
Newbie Intro/Guide. Nice Posts guys!
__________________
Experience is the BEST Teacher. Is that why it usually arrives in a shower of sparks, flash of light, loud bang, a cloud of smoke, AND -- a BILL to pay? You usually get it -- just after you need it.
Reply With Quote

  #10  
Old 07-08-2008, 03:14 PM
*Registered*
 
Join Date: Jan 2006
Location: Seattle
Age: 52
Posts: 883
Mike Stevenson is on a distinguished road

Crevice Reamer,

That post is a Sticky.
Reply With Quote

Sponsored Links
  #11  
Old 07-08-2008, 03:21 PM
Al_The_Man's Avatar
Community Moderator
 
Join Date: Dec 2003
Location: Canada
Posts: 16,540
Al_The_Man is on a distinguished road
Buy me a Beer?

Here is a link I posted some time back that explains feedback devices.
http://claymore.engineer.gvsu.edu/~j.../cont_sens.pdf
It also shows the difference between low resolution quadrature encoders that read a slot/bar directly, and the higher resolution (above ~50-100pprev) that have to use the Moiré effect.
BTW quadrature encoders can be used in the native resolution (1 of 2 quadrature pulse) or x2 or x4.
This is not a function of the encoder but how the receiving electronics interpret it, i.e, x1 x2 x4, read one single edge, two edges or all four.
This is done to increase the resolution of the encoder.
Al.
__________________
CNC, Mechatronics Integration and Machine Design.
“Logic will get you from A to B. Imagination will take you everywhere.”
Albert E.
Reply With Quote

  #12   Ban this user!
Old 07-09-2008, 03:39 PM
 
Join Date: Jul 2008
Location: US
Age: 49
Posts: 2
John762 is on a distinguished road

Gentlemen,
Thank you for your time and the information, I appreciate everything and it looks like I have a bit of reading to do!
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
Chuck’s X2 conversion – I Hope – chukkie Benchtop Machines 56 06-21-2010 12:43 PM
The start of something new ...I Hope... bgolash CNC Wood Router Project Log 74 01-31-2010 07:50 PM
converting jet jdm-18 to cnc i hope highwayman General Metal Working Machines 6 11-16-2006 08:32 PM
Router But hope to avoid surprises watzmann CNCzone Club House 0 04-19-2006 08:10 AM
hope my investment pays off! ausman12 DIY-CNC Router Table Machines 1 06-27-2005 09:30 AM




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