Search

LOLCODE Programming Language ebook

LOLCODE Programming Language

LOLCODE is an esoteric programming language inspired by the funny things on the Internet. LOLCODE is designed to test the boundaries of programming language design. This tutorial provides a basic level understanding of the LOLCODE programming language.

Click here to order ebook NOW!

Introducing Clojure ebook

Learn Clojure

Want to learn even more about Clojure ?

# Introducing Clojure

This book is written in a friendly, easy-to-understand style that beginners and nontechnical readers will enjoy.


# Who needs this book?

Students with basic math skills (add, subtract, multiply and divide). An inexpensive calculator is all you need!

Learners, young or old, eager to unlock the mysteries of Clojure

# Contents:


Clojure is a high level, dynamic functional programming language. It is designed, based on the LISP programming language, and has compilers that makes it possible to be run on both Java and .Net runtime environment. This tutorial is fairly comprehensive and covers various functions involved in Clojure. All the functions are explained using examples for easy understanding.

Click here to order ebook NOW!


----------------

[ Video ] CNC Programming, G-Code Tutorials

CNC Programming | G-Code






* Best ebooks for CNC programming: 
CNC Programming Basics 
G-Code and M-Code 
CNC programming 
G-Code Reference 
CNC Machine Tutorial 

1. CNC PROGRAMMING G-Code basics




***********************************

CNC Programming Examples - G40 G41 G42

CNC Mill Subprogram Example Joining Multiple Arcs G02 G03 G41

CNC milling program to describe how two or more radii can be joint together in a cnc mill program.


* Best ebooks for CNC programming:

+ CNC Programming Basics
+ G-Code and M-Code
+ CNC programming
+ G-Code Reference
+ CNC Machine Tutorial
+ CNC M-Code Tutoria

CNC Mill Subprogram Example

CNC Part Program

N10 T1 H1 M6 G43 M3
        N20 F150 S250
        N30 G0 X-21 Y50 Z0.5
        N40 G0 Z0
        N50 M98 P040050
        N60 G49
        N70 G0 Z50
        N80 M30

Subprogram

O0050
        N10 F160 S400
        N20 G0 Z-2.5 G91
        N30 G1 G90 X5 Y50 G41      (P1)
        N40 G2 X22 Y85.23 I45 J0   (P2)
        N50 G3 X78 Y85.23 R45      (P3)
        N60 G2 X78 Y14.77 R45      (P4) 
        N70 G3 X22 Y14.77 R45      (P5)
        N80 G2 X5 Y50 R45          (P1)
        N90 G0 G40 X-21
        N100 M99

G M S T Codes Explanation

Code Description
G00 Rapid traverse
G01 Linear interpolation
G02 Circular interpolation CW
G03 Circular interpolation CCW
G40 Cutter compensation cancel
G41 Tool nose radius compensation left
G43 Tool length compensation + direction
G49 Tool length compensation cancel
G90 Absolute command
G91 Increment command
M03 Spindle start forward CW
M06 Tool change
M30 End of program (Reset)
M98 Subprogram call
M99 End of subprogram
T Tool
S Speed
F Feed

CNC Mill Program G91 G41 G43

CNC milling program examples shows the use of G91 G41 G43 G-codes.
Contents

CNC Mill Program G91 G41 G43


CNC Part Program

N05 G54
            N10 M6 T1 G43 H1 M3
            N15 S500 F120
            N20 G0 X-22 Y-22
            N25 Z-3
            N30 G1 X3 Y6 G41 H2   (P1)
            N35 G91 X0 Y24        (P2)
            N40 X12 Y9            (P3)
            N45 X36               (P4)
            N50 Y-24              (P5)
            N55 X-21              (P6) 
            N60 G90 X3 Y6         (P1)
            N65 G0 X-21 G40

G M S T Codes Explanation

Code Description
G00 Rapid traverse
G01 Linear interpolation
G40 Cutter compensation cancel
G41 Tool nose radius compensation left
G43 Tool length compensation + direction
G54 Workpiece coordinate system 1 selection
G90 Absolute command
G91 Incremental command
M06 Tool change
T Tool
S Speed
F Feed

G41 G40 Cutter Radius Compensation Example CNC Mill Program

Cutter Radius Compensation Example program shows how G41, G40 can be used in a cnc mill program.
Cutter Compensation code used in this program are,
  • G41 Cutter Radius Compensation Left
  • G40 Cutter Radius Compensation Cancel

Cutter Radius Compensation Example


G41 G40 Cutter Radius Compensation Example
N5 G00 G54 G64 G90 G17 X20 Y-20 Z50
                N10 S450 M03 F250 D01 (12.5 MM DIA)
                N15 C0
                N20 Z5
                N25 G01 Z0
                N30 Z-5
                N35 G41 X0 Y0
                N40 X-48
                N45 X-68 Y72
                N50 X-28
                N55 Y44
                N60 X12 Y32
                N65 X0 Y0
                N70 G40 X20 Y-20
                N75 G00 Z50
                N80 Y100
                N85 M30
Finished Part
After machining process completion, component will look like

Cutter Radius Compensation Example Finished Part
Explanation of CNC G-Code
G00 : Rapid traverse.
G54 : Zero Offset no. 1.
G64 : Continuous-path mode.
G90 : Absolute dimensioning system.
G17 : X-Y plan selection.
G41 : Cutter radius compensation activation (left hand side movement)
G40 : Cutter radius compensation de-active
S : Spindle speed
F : Axis motion feed
M : Cutter rotation (3=clockwise, 4=anti-clockwise)
D : Tool offset no

-------------

Siemens Sinumerik Milling Programming Example

A very simple cnc milling program example which will show cnc machinists the use of Siemens Sinumerik milling programming concepts.
This program is written for 4-axis cnc mill, where C is used for rotary table.
But a simple cnc mill can also run this program just remove program block N15
Contents
  • Sinumerik Milling Program
    • Finished Part
    • Explanation of G-Code

Sinumerik Milling Program


Sinumerik Mill Programming Example
N5 G00 G54 G64 G90 G17 X-20 Y-20 Z50
                    N10 S450 M03 F250 D01 (12.5 MM DIA)
                    N15 C0
                    N20 Z5
                    N25 G01 Z0
                    N30 Z-5
                    N35 G42 X0 Y0
                    N40 X30
                    N45 Y30
                    N50 X0
                    N55 Y0
                    N60 G40 X-20 Y-20
                    N65 G00 Z50
                    N70 Y100
                    N75 M30

Finished Part

After the machining is complete, this finished part will look like this


Finished Part

Explanation of G-Code

G00 – Rapid traverse.
G54 – Zero Offset no 1.
G64 – Continuous-path mode.
G90 – Absolute dimensioning system.
G17 – X-Y plan selection.
G42 – Cutter radius compensation activation
G40 – Cutter radius compensation cancel
M03 – Cutter rotation clockwise
S – Spindle speed
F – Axis motion feed
D – Tool no




CNC Lathe Programming Exercise Fanuc G71 Turning Cycle, G74 Peck Drilling Cycle

CNC programming exercise for cnc lathe machinists who work on Fanuc cnc control (or similar cnc control).
This cnc programming exercise use
Fanuc G71 Turning Cycle
Fanuc G74 Peck Drilling Cycle
Contents
  • CNC Lathe Programming Exercise
    • Used Tools & Operations

CNC Lathe Programming Exercise


CNC Lathe Programming Exercise Fanuc G71, G74 Cycles
N10 G40 G00
                        N20 G99
                        N60 T0101
                        N70 G50 S3500
                        N80 G96 S0240 M4
                        N90 G00 X72. Z0.1
                        N100 G01 X-1.6 F0.12 M7
                        N110 G00 X150. Z150.
                        N120 M5
                        N130 M9
                        N140 T0303
                        N150 G97 S2500 M3
                        N160 G00 X0. Z3.
                        N170 G01 Z-6. F0.1 M7
                        N180 G00 Z2.
                        N190 G00 X150. Z150.
                        N210 T0707 M7
                        N220 G97 S0884 M3
                        N230 G00 Z3.
                        N240 G00 X0.
                        N250 G74 R1.0
                        N260 G74 X0.0 Z-68.326 Q18000 F0.22
                        N380 G00 X200.
                        N400 G00 Z100.
                        N500 T0404 M7
                        N510 G50 S3500
                        N520 G96 S0240 M4
                        N530 G00 Z1.
                        N540 G00 X70.
                        N550 G71 U4. R1
                        N560 G71 P570 Q650 U0.6 W0.2 F0.35
                        N570 G42 G00 X24.
                        N580 G01 Z0.
                        N590 G01 X28. Z-2.
                        N600 G01 Z-72.
                        N610 G02 X32. Z-74. I2. K0.
                        N620 G01 X62.
                        N630 G01 X68. Z-77.
                        N640 G01 Z-90.
                        N650 G40
                        N660 G00 X150.
                        N680 G00 Z70.
                        N690 T0202 M7
                        N700 G50 S4500
                        N710 G96 S0380 M4
                        N720 G00 X16. Z3.
                        N730 G42 G01 Z0. F0.1
                        N740 G01 X24.
                        N750 G01 X28. Z-2.
                        N760 G01 Z-72.
                        N770 G02 X32. Z-74. I2. K0.
                        N780 G01 X62.
                        N790 G01 X68. Z-77.
                        N800 G01 Z-90.
                        N810 G40
                        N820 G00 X150. Z150.
                        N830 M5
                        N840 M9
                        N850 M30

Used Tools & Operations

  • T0101 Turning Tool – Rough Facing
  • T0303 Center Drill – Center Drilling
  • T0707 Twist Drill – Drilling
  • T0404 Turning Tool – Rough Turning
  • T0202 Turning Tool – Finish Contour Cutting

------------------


Fanuc G73 Pattern Repeating Cycle CNC Program Example Code

CNC programming example for Fanuc G73 pattern repeating cycle.
Fanuc G73 Pattern Repeating Cycle has already been described here
CNC Fanuc G73 Pattern Repeating Cycle
You might like other Fanuc G73 pattern repeating cycle examples
CNC Fanuc G73 Pattern Repeating Cycle CNC Program Example
Fanuc G73 Pattern Repeating Canned Cycle Basic CNC Sample Program

Fanuc G73 Pattern Repeating Cycle Programming Example

This cnc program example also shows how cnc machinists can use ‘W’ instead of ‘Z’ for z-axis movements.
Fanuc G73 Pattern Repeating Cycle Program Example
N010 G00 X260.0 Z80.0
                            N011 G00 X220.0 Z40.0
                            N012 G73 U14.0 W14.0 R3
                            N013 G73 P014 Q020 U4.0 W2.0 F0.3 S0180
                            N014 G00 G42 X80.0 Z2.0
                            N015 G01 W-20.0 F0.15 S0600
                            N016 X120.0 W-10.0
                            N017 W-20.0 S0400
                            N018 G02 X160.0 W-20.0 R20.0
                            N019 G01 X180.0 W-10.0 S0280
                            N020 G40
                            N021 G70 P014 Q020
                            N022 G00 X260.0 Z80.0
                            N023 M30

CNC programming methods

Based on the degree of automation of programming tasks, one distinguishes two programming methods:

Manual Programming (Manual Programming)


* Best ebooks for CNC programming: 
CNC Programming Basics 
G-Code and M-Code 
CNC programming 
G-Code Reference 
CNC Machine Tutorial 








When programming by hand the programmer bases on the drawing to enter the data according to the commands from the keyboard into the machine's memory. This programming is time-consuming, confusing when the details are complex. Due to the disadvantages above, this method only applies to simple details or to edit existing programs. The means of support are mainly search tables or machine catalogs, personal computers to calculate programming parameters. Manual programming requires that the programmer, in addition to mastering the programming method, must have knowledge of math and technology knowledge.

Machine Programming (Automatic Programming).

When programming (computer assisted), the programmer describes (geometrically) the geometry of the workpiece, the trajectory of the cutting tool and the machine's function in the machine language. understandable.

Machine programming has the advantage that hand calculations do not need to be performed, just access some data but can generate large amounts of data for the necessary calculations while limiting the errors made. submit. When programming by computer, the computer must have the following special computation programs:


  • Pre-treatment program.
  • Processor.
  • Postprocessor program.


A processor is a software program that performs geometric and technological calculations. Cutter Location Data (CLD) data is called the data, which provides a general solution that is independent of any CNC machine tool. The CLD has the cutting tool location data. The CLD contains the most concise commands and the codes that do not match the CNC system.

In the geometric description of details such as points, segments, arcs, etc., the description of the machining process such as drilling, milling, cutting mode, cutting tools, Here create a source program. From this source program, the computer creates an NC program suitable for CNC machines thanks to the post-processing unit.

To use the CLD for a particular CNC system, a special program called a postprocessor is required, which translates the NC program into a CLD so that the CNC can understand. and performs the machining process.

***********************************

Python Tutorial

A Step-by-Step guide to Python.

Python is a general-purpose interpreted, interactive, object-oriented, and high-level programming language. It was created by Guido van Rossum during 1985- 1990. Like Perl, Python source code is also available under the GNU General Public License (GPL). This tutorial gives enough understanding on Python programming language.

Table of contents:

1. Python - Home

2. Python - Overview

3. Python - Environment Setup

4. Python - Basic Syntax

5. Python - Variable Types

6. Python - Basic Operators

7. Python - Decision Making

8. Python - Loops

9. Python - Numbers

10. Python - Strings

11. Python - Lists

12. Python - Tuples

13. Python - Dictionary

14. Python - Date & Time

15. Python - Functions

16. Python - Modules

17. Python - Files I/O

18. Python - Exceptions

19. Python - Classes/Objects

20. Python - Reg Expressions

21. Python - CGI Programming

22. Python - Database Access

23. Python - Networking

24. Python - Sending Email

25. Python - Multithreading

26. Python - XML Processing

27. Python - GUI Programming

28. Python - Further Extensions


- tutorialspoint.com

----------------

CNC Programming Tutorials

CNC Programming Tutorials






* Best ebooks for CNC programming: 
CNC Programming Basics 
G-Code and M-Code 
CNC programming 
G-Code Reference 
CNC Machine Tutorial 


Table of contents:



[1] What is CNC?
[2] How to Make CNC Program?
[3] Make Your First CNC Program
[4] G Code Introduction
[5] Modal G-Code- Learn G Code Programming
[6] One Shot G-Codes- Learn G Code Programming
[7] Mill/Lathe G/M-Codes- Learn G Code Programming
[8] Popular CNC G-Code Lists- Learn G Code Programming
[9] Din 66025 Programming- Learn G Code Programming
[10] M Code Introduction
[11] CNC Program Block
[12] Why to use Canned Cycles?
[13] Subprograms Basics
[14] CNC Machine Modes
[15] Speed and Feed Override
[16] Block Delete
[17] Dry Run
[18] Reference Point Return
[19] CNC Operating Modes
[20] CNC Reference Point Return[21] CNC Speed and Feed Override
[22] CNC Optional Block Skip
[23] CNC Dry Run[24] How to Set Up CNC Milling?
[25] Tool Presetter
[26] Who is CNC Machine Setter?
[27] Tool Selection (CNC Lathe)
[28] Main Parts
[29] Quiz Lathe Parts?
[30] Chuck Jaws
[31] Tool Turret

CNC Programming Examples - Threading

Fanuc G71 Turning Cycle

G71 turning cycle is used for rough-material removal from a cnc lathe component. G71 turning cycle makes large diameter cutting easy. Cutting can be done in simple straight line or a complex contour can also be machined very easily.





* Best ebooks for CNC programming: 
CNC Programming Basics 
G-Code and M-Code 
CNC programming 
G-Code Reference 
CNC Machine Tutorial 

Through G71 turning cycle parameters cnc machinists can control
  • Depth of cut.
  • Retract height.
  • Finishing allowance in x-axis and z-axis.
  • Cycle cutting-feed, spindle speed.

Programming

G71 U... R...
        G71 P... Q... U... W... F... S...

Parameters

First block
Parameter Description
U Depth of cut.
R Retract height.
Second block
Parameter Description
P Contour start block number.
Q Contour end block number.
U Finishing allowance in x-axis.
W Finishing allowance in z-axis.
F Feedrate during G71 cycle.
S Spindle speed during G71 cycle.

G71 Turning Cycle Overview

  • G71 turning cycle cuts the whole contour repeatedly which is given in P Q blocks.
  • Depth of every cut can be controlled by first-block U value.
  • Second-block U W are the finishing allowances which can be given if you want to make a finish cut with G70 finishing cycle.
  • F is cutting feed and S is spindle speed (given in second-block) which are used during G71 turning cycle.
Note – The F and S given inside P Q block will not be used during G71 turning cycle, they are used with G70 finishing cycle if later called.

G71 Turning Cycle Working

N60 G71 U10 R10
        N70 G71 P80 Q90 U3 W0 F0.25
        N80 G00 X60
        N90 G01 Z-75
When G71 turning cycle is run the whole operation will be done in following sequence,
First-cut
1 – Tool will move in x-axis U (depth of cut) deep with programmed feed from starting-point.
2 – Tool will travel with feed in z-axis (destination point in z-axis is given in P Q blocks )
3 – Tool rapidly retracts R amount in both x-axis and z-axis (at 45 degrees).
4 – Tool rapidly travel in z-axis to start-point
Later-cuts
5 – Tool rapidly moves to last cut depth.
6 – Tool moves with feed in x-axis U deep (first-block U depth of cut).
7 – Tool with feed moves in z-axis (destination point given in P Q blocks).
8 – Tool rapidly retracts in x-axis and z-axis R amount (45 degrees).
9 – Tool rapidly moves to start-point only in z-axis.
This whole sequence of operation keep on going, until the destination point in x-axis is met.
If finishing allowance is given tool will not make the exact diameter and length given in P Q blocks but will leave that much allowance, This finishing allowance can be later machined by calling G70 finishing cycle.

Fanuc G71 Turning Cycle

Fanuc G71 Example

Here is a cnc part-program which shows how G71 turning cycle can be used, this is the program for the drawing given above
N50 G00 X106 Z5 M3 S800
        N60 G71 U10 R10
        N70 G71 P80 Q90 U3 W0 F0.25
        N80 G00 X60
        N90 G01 Z-75
In this program G71 turning cycle will keep repeating the contour given inside P Q blocks shown below
N80 G00 X60
        N90 G01 Z-75
These two cnc program blocks tell us that we want to remove material till X60 deep and in Z-75 in length.
The depth of cut is given in first-block U10 retract amount is also given R10.
Finishing allowance in x-axis is U3 but there is no finishing allowance given in z-axis W0.

G70 Finishing Cycle

If you programmed G71 turning cycle with finishing allowances then that finish allowances can be removed with G70 finishing cycle.
G70 finishing cycle repeats the whole contour the G71 way, but in just one-cut removing the finishing allowances.

Why Use G70 Finishing Cycle

As material can be removed with G71 turning cycle, but if you want a different cutting-feed and spindle speed for the last cut, then it is recommended that you use G70 finishing cycle.
G70 finishing cycle use F and S values which are given inside P Q programmed blocks. (G71 use F S values which are given inside G71 second block.)

Fanuc G70 Example

N50 G00 X106 Z5 M3 S800
        N60 G71 U10 R10
        N70 G71 P80 Q90 U3 W0 F0.25
        N80 G00 X60
        N90 G01 Z-75 F0.15
        N100 G00 X200 Z100
        N110 G92 S1200
        N120 T3 G96 S150 M03
        N130 G00 X106 Z5
        N140 G70 P80 Q90
        N150 G00 X200 Z100
        N160 M30

G70 G71 Example


G71 Rough Turning Cycle Example
O0004
        G00 X200 Z10 M3 S800
        G71 U2 R1 F200
        G71 P80 Q120 U0.5 W0.2
        N80 G00 X40 S1200
        G01 Z-30 F100
        X60 W-30
        W-20
        N120 X100 W-10
        G70 P80 Q120
        M30