Archive for September, 2008

Tack generator alarm & Y-axis Excess error on a Fanuc O-M control

Posted in Uncategorized with tags , , on September 11, 2008 by future man

The alarm was on Y-axis. After staying powered on for about 10 minutes, with the machine not even running a Y-axis Excess error and tack generator alarm on a Fanuc O-M control would occur. The drive also showed these LED alarms on them though after testing several times, sometimes only one of the other LEDs would be on.

Checked all connections. Looked for maybe a heat problem. Left the cabinet doors open checked fans and connections.

CNC problem resolution

The  X-axis drive and Y-axis drive were the same so I swapped the encoder feedback cables and motor leads. The problem stayed with the drive. I then swapped just the top board on the two drives and found that the problem went with the board.  Ordered up a top board for about $3000 and replaced. Problems were gone.

Setting spindle orientation on a 15M control after the spindle was replaced on a Mori MH63

Posted in Uncategorized with tags , , on September 11, 2008 by future man

Upon arrival the spindle was back together. When attempting to orient the spindle I found that the spindle would slow down then take off for another revolution and keep attempting to find home. This type of spindle had a magnetic type block shaped device bolted onto the spindle with a stationary sensor on it. Being that it was a 15 M control all orientaton pots were on the spindle drive. The customer had palyed with the pots to try adjusting with no luck. They had tried swapping the magnetic pickup around but still did not work properly.

What I ended up doing is tried rotating the magnet again and played with the pots myself with no luck either. What I did then was turn the sensor 180 degrees and wouldn’t you know it she started working. After that I adjusted the pots for low, medium, and high gears and readjusted the zero offset and adjusted the voltages according to a procedure fanuc provided.  Another note there are two leds on the drive. When it is orientated properly at least one will be on. Some times the other is on as well. My apologies since I did not write down the description but you would figure it out if you had the problem.

U.S Green Manufacturer EVSO Moves to China

Posted in Uncategorized with tags , on September 9, 2008 by future man

A solar power manufacturing company based in Arizona has announced the protectionist policies of China’s government far to tempting too resist.  Evolution Solar (EVSO) cautiously issued an announcement stating their intention. However, their desire to bail out will eliminate American manufacturing jobs.

Vedic Math

Posted in Uncategorized on September 5, 2008 by future man

Were having a little fun this week, and delving into some of the mysteries of the mathematical world, Vedic Math is Based on the ancient Inian Vedas, the most famous of which being the “Rig Veda.”

Vedic mathematics & FastMaths
“FastMaths” is a system of reasoning and mathematical working based on ancient Indian
teachings called Veda. It is fast , efficient and easy to learn and use.
It is being taught in some of the most prestigious institutions in England and Europe. NASA
scientists applied its principles in the area of artificial intelligence.
Vedic mathematics, which simplifies arithmetic and algebraic operations, has increasingly
found acceptance the world over. Experts suggest that it could be a handy tool for those
who need to solve mathematical problems faster by the day.
In what way FastMaths Methods are different from Conventional Methods?
FastMaths provides answer in one line where as conventional method requires several
steps.
What is Vedic Mathematics?
It is an ancient technique, which simplifies multiplication, divisibility, complex numbers,
squaring, cubing, square and cube roots. Even recurring decimals and auxiliary fractions can
be handled by Vedic mathematics. Vedic Mathematics forms part of Jyotish Shastra which is
one of the six parts of Vedangas. The Jyotish Shastra or Astronomy is made up of three
parts called Skandas. A Skanda means the big branch of a tree shooting out of the trunk.
Who Brought Vedic Maths to limelight?
The subject was revived largely due to the efforts of Jagadguru Swami Bharathikrishna
Tirthaji of Govardhan Peeth, Puri Jaganath (1884-1960). Having researched the subject for
years, even his efforts would have gone in vain but for the enterprise of some disciples who
took down notes during his last days.
What is the basis of Vedic Mathematics?
The basis of Vedic mathematics, are the 16 sutras, which attribute a set of qualities to a
number or a group of numbers. The ancient Hindu scientists (Rishis) of Bharat in 16 Sutras
(Phrases) and 120 words laid down simple steps for solving all mathematical problems in
easy to follow 2 or 3 steps.
Vedic Mental or one or two line methods can be used effectively for solving divisions,
reciprocals, factorisation, HCF, squares and square roots, cubes and cube roots, algebraic
equations, multiple simultaneous equations, quadratic equations, cubic equations, biquadratic
equations, higher degree equations, differential calculus, Partial fractions,
Integrations, Pythogorus theoram, Apollonius Theoram, Analytical Conics and so on.
What is the speciality of Vedic Mathematics?
Vedic scholars did not use figures for big numbers in their numerical notation. Instead, they
preferred to use the Sanskrit alphabets, with each alphabet constituting a number. Several
mantras, in fact, denote numbers; that includes the famed Gayatri mantra, which adds to
108 when decoded.
How important is Speed?
How fast your can solve a problem is very important. There is a race against time in all the
competitions. Only those people having fast calculation ability will be able to win the race.
Time saved can be used to solve more problems or used for difficult problems.
Is it useful today?
Given the initial training in modern maths in today’s schools, students will be able to
comprehend the logic of Vedic mathematics after they have reached the 8th standard. It will
be of interest to every one but more so to younger students keen to make their mark in
competitive entrance exams.
India’s past could well help them make it in today’s world.
It is amazing how with the help of 16 Sutras and 16 sub-sutras, the Vedic seers were able
to mentally calculate complex mathematical problems.
Introduction :
Learn to calculate 10-15 times faster.
“FastMaths” is a system of reasoning and mathematical working based on ancient Indian
teachings called Veda. It is fast , efficient and easy to learn and use.
Example 1 : Finding Square of a number ending with 5
To find the square of 75
Do the following
Multiply 5 by 5 and put 25 as your right part of answer.
Multiply 7 with the next higher digit ie (7+1)=8 gives
56 as the left part of the answer, Answer is 5625
Example 2 : Calculate 43 X 47
The answer is 2021 Same theory worked here too.
The above ‘rule’ works when you multiply 2 numbers with units digits add up
to 10 and tenth place same
Example 3 : Find 52 X 58 ? Answer = 3016 How long this take ?
Example 4: Multiply 52 X 11
Answer is 572
Write down the number being multiplied and put the total of the digits between 2 digits
52 X 11 is [ 5 and 5+2=7 and 2 ] , answer is 572
Example 5: Can you find the following within less than a minute?
a) 1001/13 ?
b) 1/19 ?

1. Which Number is 1 more than
a) 19
b) 40
c) 189
d) 23
e) 4589
2.Which number is 1 less than
a) 29
b) 48
c) 2339
d) 5
e) 65320
Assignments Answers
1. Which Number is 1 more than
a) 20 b) 41
c) 190 d) 24
e) 4590
2.Which number is 1 less than
a) 28 b) 47
c) 2338 d) 4
e) 65319
www.fastmaths.com
Chapter 1 : Numbers
1.2 Place Value
Since there are only 9 numbers and a zero we count in
groups of 10.
• Ten Units make a TEN,
• Ten Tens make a HUNDRED .
• Ten Hundreds make a THOUSAND.

1.Find the value of 4 in the following
a) 430
b) 947
c) 14
d) 125004
2. Write the following numbers in Words
a) 57
b) 7002
c) 405
d) 9

Example 1: Find Factors of 36 ?
Factors of 36
36 can be expressed as 1 X 36 = 36, 2 X 18 =
36, 3 X 12 = 36, 4 X 9 = 36, 6 X 6 = 36
Factors of 36 are 1,2,3,4,6,9,12,18,36.
The number 1 is a factor of every number
1.3.3.1 Factor pairs
Number 18 has 6 factors; 1,2,3,6, 9,18
18 can be expressed as 1 X 18 = 18, 2 X 9 = 18, 3 X 6 =
18
Arrange Pair factors like (1X18),( 2X9), (3X6).?These pair
of numbers is called factor pairs.
Factor pairs of 18 are (1X18),( 2X9), ( 3X6)
If you know one factor of a number, you can get another
using factor pairs.
If you know 44 can be divided by 4, than another factor of
44 must be 11 since 11X4 = 44
Assignments
List all factors and list factor pairs if any.
a) 64
b) 48
c) 128
d) 27
e) 37
Assignments Answers
List all factors and list factor pairs if any.
a) 64
• Factors 1,2,4,8,16,32,64
• Factor Pairs (1,64) (2,32) ( 4,16) (8,8)
b) 48
• Factors 1,2,3,4,6,8,12,16,24,48
• Factor Pairs (1,48) (2,24) (3,16) (4,12) (6,8)
c) 128
• Factors 1,2,4,8,16,32,64,128
• Factor Pairs (1,128) (2,64) (4,32) (8,16)
d) 27
• Factors 1,3,9,27
• Factor Pairs (1,27) (3,9)
e) 37
• Factors 1,37
• Factor Pairs (1,37)
www.fastmaths.com
Chapter 1 : Numbers
1.3.3.2 Highest common factor (HCF)
Suppose we have 2 numbers 70 and 99
70 = 2 X 5 X 7
99 = 3 X 3 X 11
Looking at the factors, there is no common factor except
number 1. There is no factor of one number, which is also a
factor of the other number, except for 1. Such pair of
numbers is called relatively prime; they are prime in
relation to each other.
Example 1: Check 18 and 30
18 = 2 X 3 X 3
30 = 2 X 3 X 5
So 18 and 30 are not relatively prime, they have factors in
common
Both numbers can be divided by 2, 3 and 2 X 3 = 6
Of these three factor numbers the number 6 is the highest
Common Factor (HCF)
Example 2: Check 48 and 72
48 = 2 X 2 X 2 X 2 X 3
72 = 2 X 2 X 2 X 3 X 3 ?
So 48 and 72 are not relatively prime, they have factors in
common. Of these factor numbers the number 2 X 2 X 2 X 3
= 24 is the highest Common Factor (HCF)
Example 3: Check 140 and 27
140 = 2 X 2 X 5 X 7
27 = 3 X 3 X 3
So 140 and 27 are relatively prime. The highest Common
Factor (HCF) = 1
When numbers are close together the HCF will
also be a factor of the sum and of the
difference of the numbers
Example 4: Find HCF of 411 and 417
The above note means the HCF will divide into 411 and 417
also 411 + 417 = 828
417 ? 411= 6
This means that HCF is either 6 or a factor of 6 ( 6 or 3 or 2
or 1).
Since 6 is not a factor of 411 and 417 , test for 3 or 2
HCF(411,417)= 3
Example 5: Find HCF of 90 and 102
This means the HCF will divide into 102 and 90 also
102 + 90 = 192
102 ? 90 = 12
This means that HCF is either 12 or a factor of 12 (12,
6,4,3,2,1)
3 is a common factor of 90 and 102
And 2 also, but not 4 ,Therefore 2X3 = 6, HCF = 6
HCF(90,102)= 6
Assignments
1. Find the following
a) HCF(80,20)=
b) HCF(68,24)=
c) HCF(88,38)=
d) HCF(88,82)=
e) HCF(63,18)=
Assignments Answers
1. Find the following
a) HCF(80,20)=20
80 = 2 X 2 X 2 X 2 X 5
20 = 2 X 2 X 5 ?
So 80 and 20 are not relatively prime, they have factors in
common. Of these factor numbers the number 2 X 2 X 5 =
20 is the highest Common Factor (HCF)
b) HCF(68,24)=4
68 = 2 X 2 X 17
24 = 2 X 2 X 6 ?
So 68 and 24 are not relatively prime, they have factors in
common. Of these factor numbers the number 2 X 2 = 4 is
the highest Common Factor (HCF)
c) HCF(88,38)= 2
88 = 2 X 2 X 2 X 11
38 = 2 X 19
So 88 and 38 are not relatively prime, they have factors in
common. Of these factor numbers the number 2 is the
highest Common Factor (HCF)
d) HCF(88,82)=2
88 = 2 X 2 X 2 X 11
82 = 2 X 41
So 88 and 82 are not relatively prime, they have factors in
common. Of these factor numbers the number 2 is the
highest Common Factor (HCF)
e) HCF(63,18)=9
63 = 3 X 3 X 7
18 = 2 X 3 X 3
So 63 and 18 are not relatively prime, they have factors in
common. Of these factor numbers the number 3 X 3 = 9 is
the highest Common Factor (HCF)

|
Site
| Educational
Material
|
Resources
|
Community
| Other
Material
|
Utilities
Vedic Maths Tutorial
Vedic Maths is based on sixteen sutras or principles. These principles are general in nature and can be applied in many ways. In practice many
applications of the sutras may be learned and combined to solve actual problems. These tutorials will give examples of simple applications of
the sutras, to give a feel for how the Vedic Maths system works. These tutorials do not attempt to teach the systematic use of the sutras.
For more advanced applications and a more complete coverage of the basic uses of the sutras, we recommend you study one of the texts
available.
N.B. The following tutorials are based on examples and exercises given in the book ‘Fun with figures’ by Kenneth Williams, which is a fun
introduction some of the applications of the sutras for children.
If you are having problems using the tutorials then you could always read the instructions.
Tutorial 1
Tutorial 2
Tutorial 3
Tutorial 4
Tutorial 5
Tutorial 6
Tutorial 7
Tutorial 1
Use the formula ALL FROM 9 AND THE LAST FROM 10 to perform instant subtractions.
l For example 1000 – 357 = 643
We simply take each figure in 357 from 9 and the last figure from 10.
So the answer is 1000 – 357 = 643
And thats all there is to it!
This always works for subtractions from numbers consisting of a 1 followed by noughts: 100; 1000; 10,000 etc.
l Similarly 10,000 – 1049 = 8951
l For 1000 – 83, in which we have more zeros than figures in the numbers being subtracted, we simply suppose 83 is 083.
So 1000 – 83 becomes 1000 – 083 = 917
Vedic Maths Tutorial (interactive)
http://www.vedicmaths.org/Group%20Files/tutorial/tutorial.asp (1 of 12)2/10/2004 8:36:53 PM
Vedic Maths Tutorial (interactive)
Try some yourself:
1) 1000 – 777
=
2) 1000 – 283
=
3) 1000 – 505
=
4) 10,000 – 2345
=
5) 10000 – 9876
=
6) 10,000 – 1101
=
7) 100 – 57
=
8) 1000 – 57
=
9) 10,000 – 321
=
10) 10,000 – 38
=
Total Correct =
Return to Index
Tutorial 2
Using VERTICALLY AND CROSSWISE you do not need to the multiplication tables beyond 5 X 5.
l Suppose you need 8 x 7
8 is 2 below 10 and 7 is 3 below 10.
Think of it like this:
The answer is 56.
The diagram below shows how you get it.
You subtract crosswise 8-3 or 7 – 2 to get 5,
the first figure of the answer.
And you multiply vertically: 2 x 3 to get 6,
the last figure of the answer.
That’s all you do:
http://www.vedicmaths.org/Group%20Files/tutorial/tutorial.asp (2 of 12)2/10/2004 8:36:53 PM
Vedic Maths Tutorial (interactive)
See how far the numbers are below 10, subtract one
number’s deficiency from the other number, and
multiply the deficiencies together.
l 7 x 6 = 42
Here there is a carry: the 1 in the 12 goes over to make 3 into 4.
Multply These:
1) 8
8 x
2) 9
7 x
3) 8
9 x
4) 7
7 x
5) 9
9 x
6) 6
6 x
Total Correct =
Here’s how to use VERTICALLY AND CROSSWISE for multiplying numbers close to 100.
l
Suppose you want to multiply 88 by 98.
Not easy,you might think. But with
VERTICALLY AND CROSSWISE you can give
the answer immediately, using the same method
as above.
Both 88 and 98 are close to 100.
88 is 12 below 100 and 98 is 2 below 100.
You can imagine the sum set out like this:
As before the 86 comes from
subtracting crosswise: 88 – 2 = 86
(or 98 – 12 = 86: you can subtract
either way, you will always get
the same answer).
And the 24 in the answer is
just 12 x 2: you multiply vertically.
So 88 x 98 = 8624
This is so easy it is just mental arithmetic.
Try some:
http://www.vedicmaths.org/Group%20Files/tutorial/tutorial.asp (3 of 12)2/10/2004 8:36:53 PM
Vedic Maths Tutorial (interactive)
1) 87
98 x
2) 88
97 x
3) 77
98 x
4) 93
96 x
5) 94
92 x
6) 64
99
7) 98
97 x
Total Correct =
Multiplying numbers just over 100.
l 103 x 104 = 10712
The answer is in two parts: 107 and 12,
107 is just 103 + 4 (or 104 + 3),
and 12 is just 3 x 4.
l Similarly 107 x 106 = 11342
107 + 6 = 113 and 7 x 6 = 42
Again, just for mental arithmetic
Try a few:
1) 102 x 107 =
1) 106 x 103 =
1) 104 x 104 =
4) 109 x 108 =
5) 101 x123 =
6) 103 x102 =
Total Correct =
Return to Index
Tutorial 3
The easy way to add and subtract fractions.
Use VERTICALLY AND CROSSWISE to write the answer straight down!
l
Multiply crosswise and add to get the top of the answer:
2 x 5 = 10 and 1 x 3 = 3. Then 10 + 3 = 13.
The bottom of the fraction is just 3 x 5 = 15.
http://www.vedicmaths.org/Group%20Files/tutorial/tutorial.asp (4 of 12)2/10/2004 8:36:53 PM
Vedic Maths Tutorial (interactive)
You multiply the bottom number together.
So:
l
Subtracting is just as easy: multiply crosswise as before, but the subtract:
l
Try a few:
Total Correct =
Return to Index
Tutorial 4
A quick way to square numbers that end in 5 using the formula BY ONE MORE THAN THE ONE BEFORE.
l 752 = 5625
752 means 75 x 75.
The answer is in two parts: 56 and 25.
The last part is always 25.
The first part is the first number, 7, multiplied by the number “one more”, which is 8:
so 7 x 8 = 56
http://www.vedicmaths.org/Group%20Files/tutorial/tutorial.asp (5 of 12)2/10/2004 8:36:53 PM
Vedic Maths Tutorial (interactive)
l Similarly 852 = 7225 because 8 x 9 = 72.
Try these:
1) 452 =
2) 652 =
3) 952 =
4) 352 =
5) 152 =
Total Correct =
Method for multiplying numbers where the first figures are the same and the last figures add up to 10.
l 32 x 38 = 1216
Both numbers here start with 3 and the last
figures (2 and 8) add up to 10.
So we just multiply 3 by 4 (the next number up)
to get 12 for the first part of the answer.
And we multiply the last figures: 2 x 8 = 16 to
get the last part of the answer.
Diagrammatically:
l And 81 x 89 = 7209
We put 09 since we need two figures as in all the other examples.
Practise some:
1) 43 x 47 =
2) 24 x 26 =
3) 62 x 68 =
http://www.vedicmaths.org/Group%20Files/tutorial/tutorial.asp (6 of 12)2/10/2004 8:36:54 PM
Vedic Maths Tutorial (interactive)
4) 17 x 13 =
5) 59 x 51 =
6) 77 x 73 =
Total Correct =
Return to Index
Tutorial 5
An elegant way of multiplying numbers using a simple pattern.
l 21 x 23 = 483
This is normally called long multiplication but
actually the answer can be written straight down
using the VERTICALLY AND CROSSWISE
formula.
We first put, or imagine, 23 below 21:
There are 3 steps:
a) Multiply vertically on the left: 2 x 2 = 4.
This gives the first figure of the answer.
b) Multiply crosswise and add: 2 x 3 + 1 x 2 = 8
This gives the middle figure.
c) Multiply vertically on the right: 1 x 3 = 3
This gives the last figure of the answer.
And thats all there is to it.
l Similarly 61 x 31 = 1891
l 6 x 3 = 18; 6 x 1 + 1 x 3 = 9; 1 x 1 = 1
Try these, just write down the answer:
http://www.vedicmaths.org/Group%20Files/tutorial/tutorial.asp (7 of 12)2/10/2004 8:36:54 PM
Vedic Maths Tutorial (interactive)
1) 14
21 x
2) 22
31 x
3) 21
31 x
4) 21
22 x
5) 32
21 x
Total Correct =
Multiply any 2-figure numbers together by mere mental arithmetic!
If you want 21 stamps at 26 pence each you can
easily find the total price in your head.
There were no carries in the method given above.
However, there only involve one small extra step.
l 21 x 26 = 546
The method is the same as above
except that we get a 2-figure number, 14, in the
middle step, so the 1 is carried over to the left
(4 becomes 5).
So 21 stamps cost £5.46.
Practise a few:
1) 21
47 x
2) 23
43 x
3) 32
53 x
4) 42
32 x
5) 71
72 x
Total Correct =
l 33 x 44 = 1452
There may be more than one carry in a sum:
Vertically on the left we get 12.
Crosswise gives us 24, so we carry 2 to the left
and mentally get 144.
Then vertically on the right we get 12 and the 1
here is carried over to the 144 to make 1452.
http://www.vedicmaths.org/Group%20Files/tutorial/tutorial.asp (8 of 12)2/10/2004 8:36:54 PM
Vedic Maths Tutorial (interactive)
6) 32
56 x
7) 32
54 x
8) 31
72 x
9) 44
53 x
10) 54
64 x
Total Correct =
Any two numbers, no matter how big, can be
multiplied in one line by this method.
Return to Index
Tutorial 6
Multiplying a number by 11.
To multiply any 2-figure number by 11 we just put
the total of the two figures between the 2 figures.
l 26 x 11 = 286
Notice that the outer figures in 286 are the 26
being multiplied.
And the middle figure is just 2 and 6 added up.
l So 72 x 11 = 792
Multiply by 11:
1) 43 =
2) 81 =
3) 15 =
4) 44 =
5) 11 =
Total Correct =
l 77 x 11 = 847
This involves a carry figure because 7 + 7 = 14
we get 77 x 11 = 7147 = 847.
Multiply by 11:
1) 88 =
http://www.vedicmaths.org/Group%20Files/tutorial/tutorial.asp (9 of 12)2/10/2004 8:36:54 PM
Vedic Maths Tutorial (interactive)
2) 84 =
3) 48 =
4) 73 =
5) 56 =
Total Correct =
l 234 x 11 = 2574
We put the 2 and the 4 at the ends.
We add the first pair 2 + 3 = 5.
and we add the last pair: 3 + 4 = 7.
Multiply by 11:
1) 151 =
2) 527 =
3) 333 =
4) 714 =
5) 909 =
Total Correct =
Return to Index
Tutorial 7
Method for diving by 9.
l 23 / 9 = 2 remainder 5
The first figure of 23 is 2, and this is the answer.
The remainder is just 2 and 3 added up!
l 43 / 9 = 4 remainder 7
The first figure 4 is the answer
and 4 + 3 = 7 is the remainder – could it be easier?
Divide by 9:
1) 61 = remainder
http://www.vedicmaths.org/Group%20Files/tutorial/tutorial.asp (10 of 12)2/10/2004 8:36:54 PM
Vedic Maths Tutorial (interactive)
2) 33 = remainder
3) 44 = remainder
4) 53 = remainder
5) 80 = remainder
Total Correct =
l 134 / 9 = 14 remainder 8
The answer consists of 1,4 and 8.
1 is just the first figure of 134.
4 is the total of the first two figures 1+ 3 = 4,
and 8 is the total of all three figures 1+ 3 + 4 = 8.
Divide by 9:
6) 232 = remainder
7) 151 = remainder
8) 303 = remainder
9) 212 = remainder
10) 2121 = remainder
Total Correct =
l 842 / 9 = 812 remainder 14 = 92 remainder 14
Actually a remainder of 9 or more is not usually
permitted because we are trying to find how
many 9’s there are in 842.
Since the remainder, 14 has one more 9 with 5
left over the final answer will be 93 remainder 5
Divide these by 9:
1) 771 = remainder
2) 942 = remainder
3) 565 = remainder
4) 555 = remainder
5) 777 = remainder
http://www.vedicmaths.org/Group%20Files/tutorial/tutorial.asp (11 of 12)2/10/2004 8:36:54 PM
Vedic Maths Tutorial (interactive)
6) 2382 = remainder
7) 7070 = remainder
Total Correct =
Return to Index
Instructions
for using the tutorials
Each tutorial has test sections comprising of several questions each. Next to each question is a box (field) into which you can enter the answer
to the question. Select the first question in each test with the mouse to start a test. Enter the answer for the question using the numeric keys on
the keyboard. To move to the answer field of the next question in the test, press the ‘TAB’ key. Moving to the next question, will cause the
answer you entered to be checked, the following will be displayed depending on how you answered the question :-
Correct
Wrong
Answer has more than one part (such as fractions and those answers with remainders). Answering remaining parts of the
question, will determine whether you answered the question correctly or not.
Some browsers will update the answer on ‘RETURN’ being pressed, others do not. Any problems stick to the ‘TAB’ key. Pressing ‘SHIFT
TAB’ will move the cursor back to the answer field for the previous question.
The button will clear all answers from the test and set the count of correct answers back to zero.
N.B. JavaScript is used to obtain the interactive nature of these tutorials. If you cannot get this to work then try the text/picture based version of
this tutorial.
Return to Index

Basics of G Code

Posted in Uncategorized on September 3, 2008 by future man

Visit our CNC Shop

NC Programming FAQ for students, computer programmers, prospective CNC programmers, liberal arts majors, systems administrators working with CNC applications, and managers.
“I am in much dismay at having got into so amazing a quagmire & botheration with these Numbers” – Augusta Ada Byron, later Countess of Lovelace, arguably the world’s first technical writer.

1. What is CNC, anyway?
2. What is a G-code?
3. Can I get a bit more on G-codes?
4. What is DNC?
5. What is/are “Serial Communications”? Don’t bore me.
6. What is/are “Serial Communications”? I need details.
7. What is XModem?
8. How are CNC machines programmed?
9. What is APT?
10. What is a CL file?
11. What is a postprocessor?
12. What is “Dumb APT”?
13. Why am I confused by the letters I, J, and K?
14. What is an inverse-time feedrate?

CNC stands for Computer Numerical Control and refers to the operation of a machine tool via motors, switches, and so on, with a computer controlling the whole shebang. The tool itself may be as small as a benchtop lathe or as large as the gantry mills used to machine airplane wing spars. If you really needed an answer to this question, then you probably won’t be very interested in the rest of this.

CNC programs are usually made up of word addresses. These start with a letter and are usually followed by a numeric value. A word is usually referred to by its letter, hence the word X3.5 (specifying an X axis position) would be called an “X-word” and the word F15.0 (specifying a feedrate) would be called an “F-word” (really!). “G-words” specify things called Preparatory Function Codes and have come to be called “G-codes”. (Do not refer to “G-words” in earshot of a CNC programmer. “F-words” are generally ok to use.) G-codes often trigger machine movement – actually to be technically proper, they often trigger slide or axis movement. However, improperly used they sometimes cause machine movement.)

Think of these as 26 counters labeled A through Z inside the CNC controller.

G0 is generally used to denote a rapid traverse. For example, the command G0 X5.0 Z3.5 would cause the tool to move to an X position on 5.0 and a Z position of 3.5 as quickly as possible.

G1 is used to move the tool in a straight line at a feedrate you specify. This is a bit more complicated than it might first appear since moving from point A to point B at a specific rate often involves moving 3 machine axes at three different rates. G1 is usually called linear interpolation. The command G1 X4.5 Y3.0 Z-2.5 F20.0 would cause the tool to move to the specified XYZ position at a rate of 20 inches or millimeters per minute.

G2 is where things can start to get more complicated. It’s always used to make an arc, moving clockwise at a rate you specify. The G2 format you’ll see most creates an arc in the XY plane and specifies the arc center incrementally – for example G2 X-0.26 Y1.14 I0.5 J0.0 means “Starting from where the tool is now, move clockwise in an arc. The center of the arc has an X value 0.5 greater than the current position (from I0.5) and the same Y value as the current position (J0.0). Stop when you get to X-0.26 and Y1.14. Travel at whatever feedrate I last specified.”

Things get more complex if you need an arc that’s not parallel to the XY plane. Some machines allow G2 commands in the YZ and ZX planes, in which case Z axis center references are handled by the K-word. Some machines will create a helix with a G2. Some will create a circle with one G2, others may be limited to less than 90 degrees.

You can usually assume that a controller’s G2 command makes a clockwise arc, but not that it will be specified as described above. Some controllers require absolute center coordinates rather than relative, and some require an arc radius rather than a center, and some use all of these methods in various combinations. The EIA standards specify incremental centers but early lobbying by some folks (the Postprocessor Writer’s Guild?) appears to have created a situation whereby there are actually several ways to define a circle center.

G3 is like a G2, just think counterclockwise.

G4 is like some folks we’ve all worked with. It does nothing for a specified time. It just dwells – you’ll have to check your controller manual to see what follows the G4. Some use X, F, or P words in milliseconds, some allow an S word to specify spindle revolutions, and some allow nothing at all and default to about a half second.

G5 thru G89 will be dealt with as time permits. For now, the important ones to look up somewhere else are G17, G18, and G19. These have a dramatic effect on G2 and G3. Also, G53 thru G59 can transform your whole program (pun intended) and those in the G80 range can make a “hole” lot of difference.

G90 indicates that programmed values are to be treated as absolute, or actual coordinate values. If the programs issues a G1 X5.0 Z 2.0 , then the tool moves to that position. A venerable German tool maker once told us how he remembers that G90 means absolute – he said that the German word for absolute is obsolute and that the “o” looks like the “0″ in G90. Actually, the German word for absolute starts with an “a”, so either he couldn’t spell (possible) or we misunderstood (likely). Either way, it’s a good way to remember.

G91 indicates that programmed values are to be treated as incremental, or relative coordinate values. If the programs issues a G1 X5.0 Z 2.0 , then the tool moves five units in the positive X direction and two in the positive Z direction. The same tool maker (see G90) said that the “i” in the German inkrement looked like the “1″ in G91.

As usual, there’s more than one answer – even for the abbreviation. Some say it’s Direct Numerical Control (the original wording) and some say Distributed Numerical Control. All definitions include computer to machine tool communication, or what could be termed “tape elimination”. Then they differ based on including or excluding some or all of the following capabilities:

* Drip feeding a controller
* Accepting data from a controller
* Storing and organizing libraries of CNC programs
* Operating as a network

Originally, “DNC” defined an ambitious approach that involved controlling multiple machine tools directly from a central computer. This was during the “NC” days prior to CNC and was really a kind of hybrid CNC/DNC approach. The central computer was connected directly to machine servos. Eventually, as more and more tape elimination systems were developed, “DNC” was adopted to describe them instead, especially since the central computer approach was not very successful.

The short answer, which you probably don’t really care to know, is that serial communications is a bit by bit data transfer method. In a computer, each character is made up of a group of “bits”, an abbreviation for binary digits. In most computers, each character contains 8 bits. When communicating via a serial link, a couple of additional bits are tacked on for various reasons. If a computer is transferring data to a CNC controller at a speed of 9600bps (bits per second) and each character requires 10 bits to transfer, then 960 characters per second can be sent down the wire. Seven bit character codes are also widely used, so the “divide by 10″ method is slightly pessimistic for these. This is different from parallel communications, where each bit in a character has its own data path and the whole character gets sent in one shot. On PC’s, printer ports use parallel methods and comm ports use serial methods.

The long answer, which you may well need to know, is complicated enough that we gave it it’s own page – see the table of contents.
Back to Top

XModems are used to transfer “X Files”. (See serial communications)

CNC Controller – Note the high-tech operator instructionsSeveral methods are used. The most basic method is to simply do the necessary geometric calculations with a calculator and write the program directly using G-codes, M-codes, and so on. The program is then keyed directly into the controller (usually called MDI, for Manual Data Input) or keyed into a computer and transferred to the controller via punched tape or some other medium.

Some controllers can be programmed using a “conversational” method offered by the controller vendor. This may involve a more advanced language or hitting buttons with symbols on them. (Screaming at the control is not “conversational programming”).

APT ProgramSpecialized languages such as APT and COMPACT II have been available since the sixties and continue to be used. These create a controller-neutral tool path, usually called a CL File (Cutter Location or Center Line – take your choice), which is then converted to a CNC program acceptable to a given CNC control. A separate postprocessor is generally used for each CNC control or control family. Actually, COMPACT II uses different terminology but the concept is similar. APT will perform complex geometric calculations and has provided “modern” features like tool path associativity since its inception.

CAD/CAM system showing 2 views of a partGraphically oriented CAD/CAM systems for design and NC programming became generally available in the late seventies. Like APT, they usually create a neutral file usually called a CL File although their CL File format is generally far different from traditional APT CL File formats.

Parametric programs are used for family of parts programming and these can be written in any programming language. APT, Fortran, BASIC, C, whatever…

< Unbounded Enthusiasm Mode >

It stands for Automatically Programmed Tool, it’s a programming language, and to some extent it’s an architecture. An Association of Computing Machinery document states that it is the oldest programming language of any kind still in use. (It resulted from a study done at the MIT Servomechanism Laboratory in 1952 under the sponsorship of the Air Materiel Command. A prototype ran on the Whirlwind computer in 1955. We believe that the first commercially available version was released by IBM in 1958 for the IBM 704 computer.) It has been listed in most dictionaries for decades. It offered tool path associativity, macros, transformations, pocketing, five axis tool control, complex surface definition and machining, complex tool shapes, and many other modern features before any CAD/CAM system (as defined today) even existed. The shelf life of an APT program far exceeds that of any other archival storage method. It defined an API back in the sixties. It’s still hard to beat for point to point programming and production machining. A knowledge of APT capabilities and architecture helps you evaluate other CNC programming methods and some basics can be found under APT Language and APT Architecture.

< / Unbounded Enthusiasm Mode >

APT methods did not adapt well to a graphics world and most people consider it obsolete, but APT remains a very powerful, and in some cases the best, tool for repetitive programming tasks.

A CL file is a CNC program in a neutral format that is created by a CAD/CAM system, APT, or some other type of NC programming system. It is considered neutral because it is not formatted for any particular machine tool. There is no single standard CL file format, and there is no single standard even for CL file contents. Two common formats of “ASCII” CL files are shown here – each describes the same tool path. A traditional APT CL file is discussed after the table.
PARTNO ABIRD
CUTTER/.0$$S14
GOTO/.0,.0,5.0$$S15
RAPID
GOTO/-1.50,1.250,5.0$$S17
FEDRAT/15.0$$S18
GOTO/-1.50,1.250,-.20$$S19
GOTO/-1.251350,1.250,.0$$S20
MOVARC/CENTER,-.750,1.250,.0,AXIS,.0,.0,1.0,RADIUS,.50090$$S21
GOTO/-.256223,1.163192,.0
GOTO/-.488339,.107357,.0$$S22
MOVARC/CENTER,.0,.0,.0,AXIS,.0,.0,-1.0,RADIUS,.50$$S23
GOTO/.446479,-.225070,.0
GOTO/1.303521,1.475070,.0$$S24
MOVARC/CENTER,1.750,1.250,.0,AXIS,.0,.0,1.0,RADIUS,.50$$S25
GOTO/2.171831,.981562,.0
GOTO/.421831,-1.768438,.0$$S26
MOVARC/CENTER,.0,-1.50,.0,AXIS,.0,.0,-1.0,RADIUS,.50$$S27
GOTO/-.482340,-1.631711,.0
GOTO/-1.233209,1.118052,.0$$S28
GOTO/-1.50,1.250,-.20$$S29
RAPID
GOTO/-1.50,1.250,.30$$S31
RAPID
GOTO/.0,.0,5.0$$S33
END
FINI PARTNO ABIRD
CUTTER/ .0
LOADTL/ 1.0
SPINDL/ 2000.0,CLW
COOLNT/ ON
FROM/ .0,.0,5.0
RAPID
GOTO/ -1.50,1.250,5.0
FEDRAT/ 15.0
GOTO/ -1.50,1.250,-.20
GOTO/ -1.25180,1.250,-.20
INDIRV/ .027273,.999628,.0
TLON,GOFWD/ (CIRCLE/ -.750,1.250,.0,.50090),ON,(LINE/ -.750,$
1.250,.0,-.254332,1.171790,-.20)
GOTO/ -.488339,.107357,-.20
INDIRV/ -.183921,-.982941,.0
TLON,GOFWD/ (CIRCLE/ .0,.0,.0,.50),ON,(LINE/ .0,.0,.0,.446479,$
-.225070,-.20)
GOTO/ 1.303521,1.475070,-.20
INDIRV/ .477749,.878497,.0
TLON,GOFWD/ (CIRCLE/ 1.750,1.250,.0,.50),ON,(LINE/ 1.750,1.250,$
.0,2.171831,.981562,-.20)
GOTO/ .421831,-1.768438,-.20
INDIRV/ -.562248,-.826969,.0
TLON,GOFWD/ (CIRCLE/ .0,-1.50,.0,.50),ON,(LINE/ .0,-1.50,.0,$
-.482340,-1.631711,-.20)
GOTO/ -1.233209,1.118052,-.20
GOTO/ -1.50,1.250,-.20
COOLNT/ OFF
RAPID
GOTO/ -1.50,1.250,.30
SPINDL/ OFF
RAPID
GOTO/ .0,.0,5.0
END
FINI

CL File viewer showing contentsA traditional APT CL file is not human readable without translating from an internal integer and floating point format into numbers and letters. The data itself is similar, but an APT CL file contains more information, especially regarding circles. If the files above are used with a machine tool that does not support circular interpolation (that is, has no G2 or G3 command) then the postprocessor must generate the short linear moves made to form the arcs. With an APT CL file, this would not be necessary. For each arc, the APT CL file would contain a type 3000 record containing the coordinates of the center and the tool axis vector (angle), the radius, as well as the linear moves needed to make the arc if they are needed. For each actual move generated by a motion statement, a type 5000 record would be present containing all points necessary to complete the motion.

For the statement reading GOTO/ -1.50, 1.250, 5.0 in the CL files above (which would probably result in G0X-1.5Y1.25) the type 5000 record would contain the following:

5 5000 5 bb 0 -1.5 1.25 5.0

broken down as:

5 = Record number

5000 = Record type

5 = Code for ‘First or only record in this move’

bb = Geometry name used to create motion – blank in this case

0 = Subscript applied to name, if any

-1.5 = X

1.25 = Y

5.0 = Z

A postprocessor is a program that reads a CL file and produces a CNC program for a specific machine tool. Some “posts” are custom written for a specific tool/controller combination and others are generated via systems provided by postprocessor vendors. There are also generic posts that support, for example, 3 axis machining centers with many specific features customized using tables.

A postprocessor should be able to produce correct output for automatic tool changers, cycles, tool offsets, origins, circular and other interpolation, and other features specific to a tool/controller combination. The output from a postprocessor should be usable in the controller without further modification.

Creating a postprocessor using specialized packages is a fairly simple task. Writing custom posts has always been somewhat of a black art practiced by folks with a bizarre love of terms like “tool axis vector”, “linearization”, “zero-suppression”, and “modality”.
Back to Top

This is a term often used to describe a CL file that actually consists of APT statements. Typically, they contain no geometry definitions, but consist mainly of postprocessor commands, linear moves ( GOTO/ X,Y,Z ) and possibly some arcs. Since they’re in APT format, they can be processed by APT (creating yet another CL file) or in may cases, directly by a postprocessor.

Dumb APT programs are created by CAD/CAM systems (and even some APT processors), not by dumb APT programmers. They are called “dumb” simply because they describe the tool path directly and contain no part geometry. An APT program written by a human would almost always describe at least some of the part geometry.
Back to Top

Possibly because they commonly apply to two different aspects of CNC programming.

In a CNC program (the one with the G and M codes) I, J, and K are used to specify the center of an arc or circle and refer to positions on the X, Y, and Z axes – as in G2 X3.0 Y4.5I0.5 J0.3125.

In a CL file or in APT, they are used to position the tool axis vector – as in GOTO/X,Y,Z,I,J,K .You can think of the tool axis vector as a tool centerline (think mill here, not lathe or punch press) that is exactly one unit long – say, one inch. That makes it a “unit vector”. I, J, and K are used here to describe how the tool is tilted with respect to the Z axis. I, J, and K simply define the other end of the unit vector along X, Y, and Z. On a three axis machine, the tool doesn’t tip, so the tool centerline stays parallel with Z – therefore I, J, and K will always be 0, 0, 1 because (using the tool tip as a reference) you can find the other end of the vector by moving 0 in X, 0 in Y, and 1 in Z.

If you are programming a five axis machine in a CAD/CAM system, position the tool at X=2, Y=3, and Z=4 and tip the tool five degrees around the Y axis you’ll probably see the CL file output as GOTO/ 2.0, 3.0, 4.0, 0.0872, 0.0, 0.9962 . Here, we moved the top of the unit vector a bit in X and, of course the Z component got a bit smaller as a result. A postprocessor would read this and probably output G1 X2.0 Y3.0 Z4.0 A90.0 B5.0 – not an I, J, or K in the whole block!.

Enough already. The short answer is that you see I, J, and K in CNC programs as circle centers and in CL files and APT programs (and math texts) as unit vector components.

Feedrate refers to the various was of specifying the rate at which the tool moves through the material. It’s usually specified in a CNC program via an “F-word”, as in F30.0. For simple milling, the rate is usually expressed in millimeters or inches per minute. Although this is conceptually simple, it gets complicated if you think about it. For a machine tool to drive the cutter from one point in space to another at the rate you specify, each axis probably needs to move at a different speed. In a curve, the edge of the cutter will be feeding at a different rate than the center.

A CNC program listing with inverse time feedrates. Click to view.Part of an old postprocessor source listing showing part of the inverse time routine. Great fun to write these! Click to see it.If you have a rotary axis on your machine, you may get to enjoy using the exciting inverse time feedrate method. Here, you need to know what “units per minute” feedrate you need and the distance the cutter will traverse in the move you’re working on. (This can get complicated for rotary moves and programmers often ignore that detail – usually ok to do). Once you have the distance, multiply it by 60 and divide it into the desired UPM feedrate. Put that number in the F-word. Do this for each move involving linear and rotary motion. Now you know why almost all multi-axis (more than 3) programs are written using APT or a CAD/CAM system, and you have an interesting question to ask your postprocessor vendor – “How does it handle inverse time feedrates?”

APT and many CAD/CAM systems create a FEDRAT/ statement in the CL file (e.g. FEDRAT/30.0,IPM ) which is usually translated by the postprocessor to an F-word.

Supported G and M Codes

 

This
command summary serves as a guide for both new and experienced EIA-274D (G
Codes) users. The following table lists the supported G and M codes for VisualCNC
controller interface.
Parameters within brackets ([ ]) are optional, the fields represented by
“d.d” may be any decimal number and fields represented by
“d” may be any positive integer number.

G00 [Xd.d]
[Yd.d] [Zd.d]

High speed move (slew or rapid), modal

G01 [Xd.d] [Yd.d] [Zd.d] [Fd.d]

Linear move (feed or machine), modal

G02 [Xd.d] [Yd.d] [Zd.d] [Id.d] [Jd.d] [Kd.d] [Fd.d]

CW 2D circular move, modal

G03 [Xd.d] [Yd.d] [Zd.d] [Id.d] [Jd.d] [Kd.d] [Fd.d]

CCW 2D circular move, modal

G04 Pd.d

Dwell (seconds)

G17

Specify XY plane for helical & circular

G18

Specify XZ plane for helical & circular

G19

Specify YZ plane for helical & circular

G30

Cancel Mirror Image

G31

X Mirror

G32

Y Mirror

G37

Find home

G40

Cancel cutter compensation

G41

Cutter compensation left

G42

Cutter compensation right

G43 Hd

Sets tool length offset

G49

Cancel tool length offset

G54

Work Coordinate (Home or Fixture Offset) #1

G55

Work Coordinate (Home or Fixture Offset) #2

G56

Work Coordinate (Home or Fixture Offset) #3

G57

Work Coordinate (Home or Fixture Offset) #4

G58

Work Coordinate (Home or Fixture Offset) #5

G59

Work Coordinate (Home or Fixture Offset) #6

G62

Clear soft home

G70

Enter Inch Mode

G71

Enter Metric Mode

G80

Cancel Drilling Cycle

G81 Rd.d Zd.d [Fd.d]

Drill Cycle

G82 Rd.d Zd.d Pd [Fd.d]

Counter Bore Cycle

G83 Rd.d Zd.d Qd.d [Fd.d]

Peck drill

G85 Rd.d Zd.d [Fd.d]

Boring Cycle

G89 Rd.d Zd.d Pd [Fd.d]

Boring with pause

G90

Absolute coordinate mode

G91

Incremental coordinate mode

G92 [Xd.d] [Yd.d] [Zd.d]

Set soft home

Sd

Set spindle speed (rpm)

M00

Program pause

M01

Optional pause

M02 or M30

Program end

M03

Spindle on

M05

Spindle off

M06

Tool Change (example: T02 M06)

M08

Mist Coolant Device On

M09

Mist Coolant Device Off

The
following table lists the letters used to denote various arguments.

(
)
– Comments or Tool change operator message ex: (Text to
be displayed)

Q – Peck drill delta (used in G83)

F – Feed rate (used in G00, G01, G02, G03, G81, G82, G83, G85, G89) Units
per Minute

P – Dwell (used in G04)

I – Circular interpolation value in X dimension (used in G02, G03)

J - Circular interpolation value in Y dimension (used in G02, G03)

K – Circular interpolation value in Z dimension (used in G02, G03)

M – Miscellaneous function (control function)

N – Sequence number

R – Beginning Z motion dimension (used in G81, G82, G83, G85, G89)

S – Spindle rpm

T – Tool change (used in G00)

X – X motion dimension

Y – Y motion dimension

Z – Z motion dimension

Sample
File 1 (Standard)

 

The
following is a 10″ square. Rapid level .5 inches above material, feed down
45 ipm, cut feed 150 ipm, rapid down to .1 above material, depth .25 inches.
Surface or Z=0 is set at the surface of the material to be cut. This is for a
single head system with no tool change.

G90

Absolute Coordinate Mode

G00 S18000 M03

Spindle Speed Set to 18,000 RPM’s

G00 X0. Y0.

Position X=0.0 and Y=0.0

G00 Z0.1

Position the Z axis 0.1 inches above Z=0.0 or above the
Material.

G01 Z-0.25 F45 M08

Position the Z axis 0.25 inches below Z=0.0 or into the
Material at the feed rate of 45 inches/minute). The Auxiliary output for the selected tool is turned on.
(This output can be wired to operate a tool misting or cooling unit.)


G01 X10. F150

Position the X=10.0 inches at the feed rate of 150
inches/minute

G01 Y10.

Position the Y=10.0 inches (feed rate will continue at last
set speed)

G01 X0.

Position the X=0.0 inches

G01 Y0.

Position the Y=0.0 inches

G00 Z0.5 M09

Position the Z axis 0.5 inches above Z=0.0 or above the
Material. The Auxiliary output for the selected tool is turned off. (This
output can be wired to operate a tool misting or cooling unit.)

G00 X0. Y0.

Position X=0.0 and Y=0.0

M02

End of Program

Spindle is turned off.

Sample
File 2 (Automatic Tool Change)

 

The
following is a 10″ square. Rapid level .5 inches above material, feed down
45 ipm, cut feed 150 ipm, rapid down to .1 above material, depth .25 inches.
Surface or Z=0 is set at the surface of the material to be cut. Additionally it
calls a second tool to perform another cut of the same size elsewhere on the raw
material. This is for a single head system with auto tool change.

G90

Absolute Coordinate Mode

G00 S18000 M03

Spindle Speed Set to 18,000 RPM’s

G00 T1 M06 (E-MILL .250 2FLUTE)

Tool 1 call. Following moves will use tool one.”E-MILL
.250 2FLUTE” will displayed on the keypad.

G00 X0. Y0.

Position X=0.0 and Y=0.0

G00 Z0.1

Position the Z axis 0.1 inches above Z=0.0 or above the
Material.

G01 Z-0.25 F45 M08

Position the Z axis 0.25 inches below Z=0.0 or into the
Material at the feed rate of 45 inches/minute). The Auxiliary output for the selected tool is turned on.
(This output can be wired to operate a tool misting or cooling unit.)


G01 X10. F150

Position the X=10.0 inches at the feed rate of 150
inches/minute

G01 Y10.

Position the Y=10.0 inches (feed rate will continue at last
set speed)

G01 X0.

Position the X=0.0 inches

G01 Y0.

Position the Y=0.0 inches

G00 Z0.5 M09

Position the Z axis 0.5 inches above Z=0.0 or above the
Material. The Auxiliary output for the selected tool is turned off. (This
output can be wired to operate a tool misting or cooling unit.)

G00 T2 M06 (E-MILL .125 3FLUTE)

Tool 2 call. Following moves will use tool one.”E-MILL
.125 3FLUTE” will displayed on the keypad.

G00 X12. Y0.

Position X=12.0 and Y=0.0

G00 Z0.1

Position the Z axis 0.1 inches above Z=0.0 or above the
Material.

G01 Z-0.25 F45 M08

Position the Z axis 0.25 inches below Z=0.0 or into the
Material at the feed rate of 45 inches/minute). The Auxiliary output for the selected tool is turned on.
(This output can be wired to operate a tool misting or cooling unit.)


G01 X22. F150

Position the X=22.0 inches at the feed rate of 150
inches/minute

G01 Y10.

Position the Y=10.0 inches (feed rate will continue at last
set speed)

G01 X12.

Position the X=12.0 inches

G01 Y0.

Position the Y=0.0 inches

G00 Z0.5 M09

Position the Z axis 0.5 inches above Z=0.0 or above the
Material. The Auxiliary output for the selected tool is turned off. (This
output can be wired to operate a tool misting or cooling unit.)

G00 T0 M06

Optional command to put current away tool

G00 X0. Y0.

Position X=0.0 and Y=0.0

M02

End of Program

Spindle is turned off.

Cutter Compensation G40\G41\G42

Note
that all G41\G42 contours MUST start with a lead in and end with a lead out.

G90 G70

Absolute coordinate system, Inch Mode

S18000

Set spindle speed to 18000 RPM

G00 T1 M06 (.250 End Mill)

Select Tool #1 and display “.250 End Mill”

G00 Z-0.5

Rapid move to safe rapid level

G00 X0. Y-0.25

Rapid move

Z.1

Compensation entry move

G41 D01

Turn on left tool compensation for table entry #1

Y0

G01 Z-.250 F30 M08

Feed Z to -.25 at 30ipm and turn on tool mist

Y10 F200

Feed to Y=10 at 200 ipm

X10

Feed move

Y0

Feed move

X0

Feed move

G40

Turn tool compensation off

G0 Z.5 M09

Rapid Z=.5 and turn mist off

X -.2

Exit tool compensation move

M02

End of file

G81
/ G83 Drilling, Peck Drilling

 

G90 G70

absolute coordinate system, inch mode

S12000

set spindle speed to 12000 RPM

G00 X0Y0

Rapid move

G00 Z.1 M08

rapid Z move (note Z positive is UP), turn misting unit on

G81 Z-.2 F50

Drill cycle next coordinates to Z=-.2 at 50 ipm

X1Y1

Drill

X2

Drill

X3

Drill

G80

Drill cycle off

G00 Z1.

Rapid Move

X0Y2

Rapid Move

G83 R.1 Z-.5 Q.1 F30

Peck drill cycle next coordinates to Z=-.5 at .1 lift, .1
peck, 30 ipm

X1

Peck drill

X2

Peck Drill

X3

Peck Drill

M09

Mist Unit Off

G80

Cancel Drill Cycle

G00 Z-0.5

Rapid Z move

G00 X0. Y0.

rapid XY move

M02

End of Job

MISCELLANEOUS

  • Line
    numbers are optional, they have no effect on program execution.

  • Decimal
    points for whole numbers are optional, they are only necessary for fractional
    numbers

  • Drilling
    with an electric/pneumatic feed drill is accomplished by calling Tool 31…40
    (T31 M06) with standard G00 rapid moves immediately after the tool call to
    position the drill. At the end of the rapid move the drill will be fed into the
    material. The next rapid will produce the same results. To stop drilling call
    another tool (T01 M06)

  • Peck
    drilling and standard drilling cycles (G80,81,83) are not supported on
    electric/pneumatic feed drills.

  • Depending on features purchased with any particular machine,
    all or a portion of the G&M codes are supported.

Liberty Basic, A natural Choice for a G Code Foundation

Posted in Uncategorized on September 3, 2008 by future man

This is a great language to learn the basics of programming, sticking to the foundation, rather then going

into complicated higher level subjects too soon such as object oriented or memory allocation.   Because G

code is very similar to BASIC, and does not require to much higher level newer progrmaming techniques,

learning Liberty is a great way to get some inexpensive at home expierience.

             The best way to learn anything is to start practicing it. If you want to

learn  computer programming, you should start writing programs on your computer

as soon as possible.

You can learn to program by starting out with one of hundreds of programming

languages designed for novices, such as Pascal, LOGO, and SmallTalk.

But the most popular beginner’s programming language is still BASIC. BASIC

is simple enough to help you understand the concepts behind programming

yet powerful enough to enable you to create commercial-quality programs.

To help you in your quest to learn programming, this book comes with a

shareware copy of Liberty BASIC. As long as you’re running Windows 95/98/

Me/NT/2000/XP, you can run and use Liberty BASIC on your computer. Most

of this book provides examples in Liberty BASIC that you can type yourself.

If you have a Macintosh, you can’t run Liberty BASIC unless you buy a

special Windows emulation program such as VirtualPC from Microsoft

(at www.microsoft.com). As an alternative, you can use either True Basic

(www.truebasic.com) or Future Basic (www.stazsoftware.com). True

Basic, Future Basic, and Liberty BASIC all use BASIC language, so the sample

programs in this book designed for Liberty BASIC should run under both

True Basic and Future Basic with only minor modifications.

If for some odd reason you’re both technically knowledgeable enough to use

Linux, yet still want to learn how to program, you can download a free BASIC

interpreter, YABASIC (which stands for Yet Another BASIC), by visiting www.

yabasic.de.

Why Learn Liberty BASIC?

If you’re interested in learning to program, you may wonder, “Why not jump

right in and start learning C++ or Java?” (Then again, if you want to learn how

to swim, why not jump right into the ocean and start swimming with the

sharks?) Although you can start learning to program by using any language,

Liberty BASIC offers several advantages that you won’t find in other language

compilers.

Liberty BASIC is (almost) free

Liberty BASIC is a shareware program that you can evaluate for free until you

decide whether it’s worth paying for. That way, you can experiment with computer

programming without spending any money buying programs, such as

Visual C++ or JBuilder only to realize they may be too complicated and confusing

for you.

Liberty BASIC is easy

Liberty BASIC can teach you the fundamentals of programming so that you

can get real-life experience programming your own computer. Other programming

languages, such as C++ or Java, can force you to master needlessly complicated

topics, such as pointers, object-orientation, and memory allocation.

Rather than let these other programming languages bury you under an additional

layer of complexity that only gets in your way, learn Liberty BASIC.

Best of all, the BASIC programming language was specially designed to teach

novices how to program, so learning BASIC can teach you how programming

works. Once you learn the fundamentals of programming with Liberty BASIC,

you can apply your programming knowledge to help you better learn another

programming language, such as C++ or Java.

Liberty BASIC runs on Windows

When computers used to run the ancient operating system of MS-DOS,

Microsoft tossed in a free BASIC interpreter called QBASIC. Although you can

62 Part II: Learning Programming with Liberty BASIC

still run QBASIC in most versions of Windows (such as Windows 98 but not

Windows 2000), people have been screaming for a Windows-based version of

BASIC that they can use to teach themselves programming.

Because Microsoft has no intention of creating a Windows-based version

of QBASIC, the next alternative is to use Liberty BASIC. You can not only

write BASIC programs in Liberty BASIC on any computer that runs Microsoft

Windows, but you can also create real, honest-to-goodness Windows applications

using Liberty BASIC that you can sell or give away as well.

If you pay for the full version of Liberty BASIC, you can create real Windows

programs that you can sell to others. The shareware version of Liberty BASIC

(which comes with this book) allows you to write programs, but won’t allow

you to compile and distribute them to others.

You can start using Liberty BASIC today

Liberty BASIC comes with this book, so everyone reading this book can start

using it right away (unless, of course, you’re not using Windows). That makes

Liberty BASIC a natural learning tool to complement this book.

If trying to understand certain programming concepts confuses you, you can

quickly type a sample Liberty BASIC program and see for yourself exactly

how certain programming features work. By combining theory with hands-on

experience, this book and Liberty BASIC can help you pick up computer programming

in no time.

Installing Liberty BASIC

To install Liberty BASIC by using the CD that comes with this book, refer to

the installation instructions in the Appendix.

Because software changes so rapidly, a newer version of Liberty BASIC may

be available by the time you read this book. If you download a newer version

from the Liberty BASIC Web site (at www.libertybasic.com), you may need

to go through some extra steps to install Liberty BASIC on your computer.

If you download Liberty BASIC from the Liberty BASIC Web site, the file is

compressed in a self-extracting EXE file. To decompress this file, you need to

download and save this file somewhere on your hard disk, and then doubleclick

on the Liberty Basic EXE file (which has a cryptic name such as lb400win.

exe). When you double-click on the Liberty Basic EXE file, the Liberty Basic

installation program guides you, step-by-step, into installing Liberty Basic on

your computer.

Chapter 5: Getting Your Hands on a Real Language: Liberty BASIC 63

Loading Liberty BASIC

As you install Liberty BASIC, the program creates its own directory and adds

Liberty BASIC to your Program menu. To load Liberty BASIC, follow these

steps:

1. Click the Start button on the Windows taskbar.

The Start menu opens.

2. Choose Programs➪Liberty BASIC➪Liberty BASIC.

The Liberty BASIC program appears.

To make loading Liberty BASIC easier and faster, you can place a Liberty

BASIC icon on the Windows desktop.

To place a Liberty BASIC icon on your Windows desktop, follow these steps:

1. Right-click the Windows desktop.

A pop-up menu appears.

2. Choose New➪Shortcut.

A Create Shortcut dialog box appears.

3. Click Browse.

A Browse dialog box appears.

4. Find and click the Liberty BASIC program and then click Open.

You may need to change directories or drives to find the Liberty BASIC

program if it isn’t stored in the C:\Program Files\Liberty Basic directory.

After you click Open, the Create Shortcut dialog box appears again.

5. Click Next.

The Select a Title for the Program dialog box appears.

6. Type a name, such as Liberty BASIC, in the Select a Name for the

Shortcut text box and click Finish.

The Liberty BASIC icon appears on your desktop. The next time that you

want to load Liberty BASIC, just double-click this icon.

Your First Liberty BASIC Program

The Liberty BASIC editor is where you write, edit, and run your BASIC program.

To see the power of Liberty BASIC, type the following into the Liberty

BASIC editor:

64 Part II: Learning Programming with Liberty BASIC

PRINT “This BASIC program mimics a really bad boss.”

PRINT

PRINT “What is your name?”

INPUT Name$

PRINT “Hello “ + Name$ + “. You’re fired! Have a nice day.”

END

Liberty BASIC, like most versions of BASIC, doesn’t care whether you type

commands in uppercase, lowercase, or a mixture of both. Most programmers,

however, like to use all uppercase to identify all the BASIC commands that

they use in a program.

Unlike a word processor, the Liberty BASIC editor doesn’t wrap words from

one line to the other, which means that you can keep typing all the way to the

far right until your text scrolls out of view.

This program tells the computer to perform the following tasks:

1. The first line prints the message This BASIC program mimics a

really bad boss. on-screen.

2. The second line prints (adds) a blank line directly underneath the

message.

3. The third line prints What is your name? on-screen.

4. The fourth line displays a question mark (?) as a prompt and waits for

the user to type a name. As soon as the user presses the Enter key, the

BASIC program stores whatever the user types into a temporary

memory location that it identifies as Name$.

5. The fifth line prints the message “Hello (following it by the name that

the user types in the fourth line). You’re fired! Have a nice

day.” The plus sign (+) tells Liberty BASIC to add the word “Hello”

with the words that it stores in Name$.

6. The sixth line tells the computer that this is the end of the program.

Running a Liberty BASIC program

After you finish typing a BASIC program, press Shift+F5 or choose Run➪Run

from the Liberty BASIC menu bar to run the program. Figure 5-1 shows what

the BASIC program from the preceding section looks like when run on Liberty

BASIC.

As you run this program, Liberty BASIC displays the text in a window that it

calls the main window. You can use the menu bar in the main window to print

or save any text that appears in the main window.

Chapter 5: Getting Your Hands on a Real Language: Liberty BASIC 65

Saving a Liberty BASIC program

Although you can type your Liberty BASIC programs over and over whenever

you want to run them, saving your program to a hard drive or floppy disk is

much easier. Then you can load and edit the program later.

To save a program, follow these steps:

1. Choose File➪Save from the Liberty BASIC menu bar, or click the Save

File icon on the Liberty Basic toolbar as shown in Figure 5-2.

The Save As dialog box appears.

2. Type a name for your file in the Filename text box.

You may want to change folders or drives to store your Liberty BASIC file.

3. Click OK.

Liberty BASIC automatically adds a BAS file extension to Liberty BASIC programs

that you save. Unless you have a good reason to change this file extension,

use the BAS extension to help you identify your Liberty BASIC programs

from any other files stored on your computer.

Main window

Figure 5-1:

Running

your first

Liberty

BASIC

program.