1 Introduction General information Comparison to subprogramming … to computer programming … to...

Post on 21-Jan-2016

227 views 1 download

Tags:

Transcript of 1 Introduction General information Comparison to subprogramming … to computer programming … to...

1 IntroductionGeneral informationComparison to subprogramming … to computer programming … to canned cyclesApplication categoriesLimitationsComputer related featuresCNC related features

Presentation links page for lesson one

For CNC Machining Centers and Turning Centers

Parametric Programming

Copyright 2003

(Custom Macro B)

Welcome to Parametric Programming class!

Parametric ProgrammingEight lessons in this class:

1) Introduction2) Variable techniques3) Arithmetic functions4) Logic and program flow control5) Looping6) System variables7) Other features of parametric programming8) Approaching applications

Here are the lesson titles

CNC’s best kept secret! Fanuc calls it Custom macro BOkuma calls it User task 2Fadal calls it Macro

This class covers Fanuc’s custom macro B

Parametric Programming

There are few in the industry that even know what parametric programming is…

…let alone how to use it!

.

.

.N035 M98 P1000...

Main program

O1000N001 X4.5 Y4.0N002 X3.5 Y3.0N003 X2.5 Y2.0N004 X1.5 Y1.0N005 X0.5 Y0N005 M99

Subprogram

Comparison To Subprogramming

Let’s compare parametric programming to things you already know…

You know M98 calls a subprogramP word specifies program numberControl executes subprogramM99 causes return to calling program

.

.

.N035 M98 P1000...

Main program

O1000N001 X4.5 Y4.0N002 X3.5 Y3.0N003 X2.5 Y2.0N004 X1.5 Y1.0N005 X0.5 Y0N005 M99

Subprogram

Subprogramming can be used

Comparison To SubprogrammingWith subprograms, nothing can change from one time the subprogram is called to the next

Subprogramming cannot be used

Comparison To SubprogrammingAgain, nothing can change from one time to the next

N035 M98 P1000X1. Y1. D.25 W3. H1.

X

Y

H

WD

N035 G65 P1000

Comparison To SubprogrammingG65 is the same as M98, but…

…with G65, you can pass variables

Consider times you’d like to write general purpose subprograms:Bolt hole pattern

Thread milling

Grooving

Comparison To Subprogramming

Parametric programming lets you develop very helpful subprograms, commonly called macros

Comparison To Computer Programming

Parametric programming can also be compared to computer programming languages…

Two popular programming languages…

BASIC C Language

begininput “Enter interest rate %:” ; ainput “Enter starting balance:” ; bc = bfor d = 1 to 12c = c + (a * .01 / 12)next dprint “Total after one year” ; cend

Variables Arithmetic Logic Looping

Parametric programming is

like having a computer

programming language built

right into your CNC control!

Comparison To Computer Programming

A sample computer program

Parametric programming has many computer programming features

Comparison To Canned CyclesAll controls have some form of canned cycles to simplify programming…

N050 G81 X0.5 Y0.5 R0.1 Z-.75 F3.0

X1. Y1. D.25 W3. H1.N35 G65 P1000

Comparison To Canned Cycles

Canned cycle commandG81 invokes drilling cycleVariables that specify how the hole is to be drilledA calling command to a custom macroCall custom macro program O1000Variables (arguments) to be passed to the custom macro

Parametric programming lets you create your own canned cycles!

…machining centers have hole machining canned cycles

Five Application Categories

Part families User created canned cycles Utilities Complex motions and shapes Driving accessories

All applications for parametric programming will fall into one of five categories...

Five Application Categories

Part families User created canned cycles Utilities Complex motions and shapes Driving accessories

Many companies make similar products in varying sizes…

Five Application Categories

Part families User created canned cycles Utilities Complex motions and shapes Driving accessories

O0001N005 T01 M06N010 G54 G90 S700 M03N015 G00 X2.0 Y1.5N020 G43 H01 Z0.1N025 G81 R0.1 Z-.2 F5.0N030 X3.0N035 X4.0N040 X5.0N045 G90N050 G91 G28 Z0 M19N055 M01.

O0002N005 T01 M06N010 G54 G90 S700 M03N015 G00 X2.5 Y1.75N020 G43 H01 Z0.1N025 G81 R0.1 Z-.2 F5.0N030 X3.5N035 X4.5N040 X5.5N045 G90N050 G91 G28 Z0 M19N055 M01.

Are you changing one program to create another?

Values that changeValues for another workpiece

Five Application CategoriesDo you have prints with variables?

Variable dimensionsChart with actual values

Five Application CategoriesO0001N005 T01 M06N010 G54 G90 S700 M03N015 G00 X2.0 Y1.5N020 G43 H01 Z0.1N025 G81 R0.1 Z-.2 F5.0N030 X3.0N035 X4.0N040 X5.0N045 G90N050 G91 G28 Z0 M19N055 M01.

O0002N005 T01 M06N010 G54 G90 S700 M03N015 G00 X2.0 Y1.5N020 G43 H01 Z0.1N025 G81 R0.1 Z-.2 F5.0N030 X3.0N035 X4.0N040 X5.0N045 G90N050 G91 G28 Z0 M19N055 M01.

O0003N005 T01 M06N010 G54 G90 S700 M03N015 G00 X2.0 Y1.5N020 G43 H01 Z0.1N025 G81 R0.1 Z-.2 F5.0N030 X3.0N035 X4.0N040 X5.0N045 G90N050 G91 G28 Z0 M19N055 M01.

O0004N005 T01 M06N010 G54 G90 S700 M03N015 G00 X2.0 Y1.5N020 G43 H01 Z0.1N025 G81 R0.1 Z-.2 F5.0N030 X3.0N035 X4.0N040 X5.0N045 G90N050 G91 G28 Z0 M19N055 M01.

O0005N005 T01 M06N010 G54 G90 S700 M03N015 G00 X2.0 Y1.5N020 G43 H01 Z0.1N025 G81 R0.1 Z-.2 F5.0N030 X3.0N035 X4.0N040 X5.0N045 G90N050 G91 G28 Z0 M19N055 M01.

O0006N005 T01 M06N010 G54 G90 S700 M03N015 G00 X2.0 Y1.5N020 G43 H01 Z0.1N025 G81 R0.1 Z-.2 F5.0N030 X3.0N035 X4.0N040 X5.0N045 G90N050 G91 G28 Z0 M19N055 M01.

O0007N005 T01 M06N010 G54 G90 S700 M03N015 G00 X2.0 Y1.5N020 G43 H01 Z0.1N025 G81 R0.1 Z-.2 F5.0N030 X3.0N035 X4.0N040 X5.0N045 G90N050 G91 G28 Z0 M19N055 M01.

O0008N005 T01 M06N010 G54 G90 S700 M03N015 G00 X2.0 Y1.5N020 G43 H01 Z0.1N025 G81 R0.1 Z-.2 F5.0N030 X3.0N035 X4.0N040 X5.0N045 G90N050 G91 G28 Z0 M19N055 M01.

Currently you have many programs!

If you must make a change, all programs must be changed!

O0001N005 T01 M06N010 G54 G90 S700 M03N015 G00 X#24 Y#25N020 G43 H01 Z#3N025 G81 R0.1 Z-#7 F5.0N030 X[#24+#101*.5]N035 X[#24+#101+1.0]N040 X[#24+#101+1.5]N045 G90N050 G91 G28 Z0 M19N055 M01.

Parametric programming lets you handle all parts in the family with one program!

Five Application Categories

Part families User created canned cycles Utilities Complex motions and shapes Driving accessories

Canned Cycles

All CNC controls have some canned cycles to simplify programming

Five Application Categories

Part families User created canned cycles Utilities Complex motions and shapes Driving accessories

Thread millingPocket millingFace millingCircle milling

GroovingTappingBar feedingCut-off

Dovetail millingHex millingDouble tappingSpecial holes

Consider a special two-surface drill cycle

Example of canned cycles on mills and lathes

Five Application Categories

Part families User created canned cycles Utilities Complex motions and shapes Driving accessories

Thread millingPocket millingFace millingCircle milling

GroovingTappingBar feedingCut-off

Dovetail millingHex millingDouble tappingSpecial holes

Consider a special two-surface drill cycle

Example of canned cycles on mills and lathes

Drill first surface

Five Application Categories

Part families User created canned cycles Utilities Complex motions and shapes Driving accessories

Thread millingPocket millingFace millingCircle milling

GroovingTappingBar feedingCut-off

Dovetail millingHex millingDouble tappingSpecial holes

Consider a special two-surface drill cycle

Example of canned cycles on mills and lathes

Rapid move

Five Application Categories

Part families User created canned cycles Utilities Complex motions and shapes Driving accessories

Thread millingPocket millingFace millingCircle milling

GroovingTappingBar feedingCut-off

Dovetail millingHex millingDouble tappingSpecial holes

Consider a special two-surface drill cycle

Example of canned cycles on mills and lathes

Drill second surface

Five Application Categories

Part families User created canned cycles Utilities Complex motions and shapes Driving accessories

Thread millingPocket millingFace millingCircle milling

GroovingTappingBar feedingCut-off

Dovetail millingHex millingDouble tappingSpecial holes

Consider a special two-surface drill cycle

Example of canned cycles on mills and lathes

Full retract

Most controls don’t have this kind of drilling cycle…

…but with parametric programming, you can create one!

Five Application Categories

Part families User created canned cycles Utilities Complex motions and shapes Driving accessories

Thread millingPocket millingFace millingCircle milling

GroovingTappingBar feedingCut-off

Dovetail millingHex millingDouble tappingSpecial holes

What don’t you like about G83?

Example of canned cycles on mills and lathes

Five Application Categories

Part families User created canned cycles Utilities Complex motions and shapes Driving accessories

Thread millingPocket millingFace millingCircle milling

GroovingTappingBar feedingCut-off

Dovetail millingHex millingDouble tappingSpecial holes

What don’t you like about G83?

Example of canned cycles on mills and lathes

Five Application Categories

Part families User created canned cycles Utilities Complex motions and shapes Driving accessories

Thread millingPocket millingFace millingCircle milling

GroovingTappingBar feedingCut-off

Dovetail millingHex millingDouble tappingSpecial holes

What don’t you like about G83?

Example of canned cycles on mills and lathes

Five Application Categories

Part families User created canned cycles Utilities Complex motions and shapes Driving accessories

Thread millingPocket millingFace millingCircle milling

GroovingTappingBar feedingCut-off

Dovetail millingHex millingDouble tappingSpecial holes

What don’t you like about G83?

Example of canned cycles on mills and lathes

Five Application Categories

Part families User created canned cycles Utilities Complex motions and shapes Driving accessories

Thread millingPocket millingFace millingCircle milling

GroovingTappingBar feedingCut-off

Dovetail millingHex millingDouble tappingSpecial holes

What don’t you like about G83?

Example of canned cycles on mills and lathes

Five Application Categories

Part families User created canned cycles Utilities Complex motions and shapes Driving accessories

Thread millingPocket millingFace millingCircle milling

GroovingTappingBar feedingCut-off

Dovetail millingHex millingDouble tappingSpecial holes

What don’t you like about G83?

Example of canned cycles on mills and lathes

Five Application Categories

Part families User created canned cycles Utilities Complex motions and shapes Driving accessories

Thread millingPocket millingFace millingCircle milling

GroovingTappingBar feedingCut-off

Dovetail millingHex millingDouble tappingSpecial holes

What don’t you like about G83?

Example of canned cycles on mills and lathes

Five Application Categories

Part families User created canned cycles Utilities Complex motions and shapes Driving accessories

Thread millingPocket millingFace millingCircle milling

GroovingTappingBar feedingCut-off

Dovetail millingHex millingDouble tappingSpecial holes

What don’t you like about G83?

Example of canned cycles on mills and lathes

Five Application Categories

Part families User created canned cycles Utilities Complex motions and shapes Driving accessories

Thread millingPocket millingFace millingCircle milling

GroovingTappingBar feedingCut-off

Dovetail millingHex millingDouble tappingSpecial holes

The last peck will not be the same

Example of canned cycles on mills and lathes

Five Application Categories

Part families User created canned cycles Utilities Complex motions and shapes Driving accessories

Thread millingPocket millingFace millingCircle milling

GroovingTappingBar feedingCut-off

Dovetail millingHex millingDouble tappingSpecial holes

The last peck will not be the same

Example of canned cycles on mills and lathes

Five Application Categories

Part families User created canned cycles Utilities Complex motions and shapes Driving accessories

Thread millingPocket millingFace millingCircle milling

GroovingTappingBar feedingCut-off

Dovetail millingHex millingDouble tappingSpecial holes

The last peck will not be the same

Example of canned cycles on mills and lathes

Five Application Categories

Part families User created canned cycles Utilities Complex motions and shapes Driving accessories

Thread millingPocket millingFace millingCircle milling

GroovingTappingBar feedingCut-off

Dovetail millingHex millingDouble tappingSpecial holes

The last peck will not be the same

Example of canned cycles on mills and lathes

With parametric programming, you can modify the way G83 works!

User Created Canned Cycles

Part families User created canned cycles Utilities Complex motions and shapes Driving accessories

MV 4VA

CYCLESTART

FEEDHOLD

EDIT

AUTOMDI JOG

HANDLEZERORETURNMODE

0%

100%

200%FEEDRATEOVERRIDE

10%25%50%

100%

RAPIDOVERRIDE

1

12

TURRET INDEX2345678 91011

SLOW FAST

EMERGENCYSTOP

FANUC 10MPOWERON

OFF

ONGPAXYZQBI JKRCFDHL #MST /EOB

U V W

Sp

E ? @ @ ,[ ] ( ) *

PAGE CURSOR

SHIFT

7 8 94 5 61 2 3- 0+=CAN

RESET

START

CALC

INPUT

NC/PC

AUX

X00.0000Y00.0000Z00.0000

X ZX1X10X100

0

ONOFFDRY

RUNSINGLEBLOCK

MACHINELOCK

OPTIONALSTOP

X+

X-Z-

JOYSTICK

Z+

ON OFFSPINDLE

ORIGINX Z

0%100%

130%

SPINDLE LOAD

0%100%

130%

AXIS LOADX Z

OD ID

CLAMPDIRECTION

OFF ON

MEMORYPROTECT

CYCLESTART

FEEDHOLD

EDITAUTO

MDI JOGHANDLE

ZERORETURNMODE

0%

100%

200%FEEDRATEOVERRIDE

10%25%50%

100%

RAPIDOVERRIDE

1

12

TURRET INDEX234567891011

SLOW FASTEMERGENCY

STOP

FANUC 10TPOWERON

OFF

ONGPAXYZQBI JKRCFDHL#MST /EOB

U V W

SpE ? @ @ ,[ ] ( ) *

PAGECURSORSHIFT

789456123- 0+=CAN

RESET

START

CALC

INPUT

NC/PC

AUX

X00.0000Z00.0000

X ZX1X10X100

0

ONOFFDRY

RUNSINGLEBLOCK

MACHINELOCK

OPTIONALSTOP

BLOCKDELETE

X+

X-Z-

JOYSTICK

Z+

ON OFFSPINDLE

ORIGINX Z

0% 100%130%

SPINDLE LOAD

0% 100%130%

AXIS LOADX Z

OD ID

CLAMPDIRECTION

OFF ONMEMORYPROTECT

CHUCKTAILSTOCK

Think of all the times you’ve

wished you had more

canned cycles!

Part families User created canned cycles Utilities Complex motions and shapes Driving accessories

Five Application CategoriesUtilities enhance the way your CNC machine behaves

Five Application Categories

Part families User created canned cycles Utilities Complex motions and shapes Driving accessories

Reduce setup timeReduce tool maintenance timeMake programs easier to verifyMake programs easier to runMake machines safer to run

Utilities can…

Examples…

Five Application Categories

Part families User created canned cycles Utilities Complex motions and shapes Driving accessories

2.0234+0.0004-0.0002

2.02352.0239

Reduce offset by 0.0004

Consider how operators change offsets

Print dimension

Target value

Operator must calculate deviation

Measured value

It would be easier if the operator didn’t have to calculate the target value…

…or the deviation..…and could simply enter the measured value

Parametric programming allows you to modify the way offsets are used!

Five Application Categories

Part families User created canned cycles Utilities Complex motions and shapes Driving accessories

Do you have setups so tall that they interfere with tool changing?

Tool change okay

Five Application Categories

Part families User created canned cycles Utilities Complex motions and shapes Driving accessories

Do you have setups so tall that they interfere with tool changing?

Tool change okay

Five Application Categories

Part families User created canned cycles Utilities Complex motions and shapes Driving accessories

Do you have setups so tall that they interfere with tool changing?

Tool change not okay

Wouldn’t it be nice if you could error

trap your tool changer so that it would

never try to make a tool change if th

e

spindle is over the fixture?

Part families User created canned cycles Utilities Complex motions and shapes Driving accessories

Five Application CategoriesParametric programming allows you to create motion types!

Five Application Categories

Part families User created canned cycles Utilities Complex motions and shapes Driving accessories

Consider how linear and circular interpolation work

Movement is divided into tiny single axis

departures

Circular motion works the same

Five Application Categories

Part families User created canned cycles Utilities Complex motions and shapes Driving accessories

Consider how helical interpolation works

Again, tiny single axis departures are created

Five Application Categories

Part families User created canned cycles Utilities Complex motions and shapes Driving accessories

What if you have a tapered thread to mill?

Normal helical interpolation cannot be used!

Radius is different from start point to end point

Wouldn’t it be nice if you could

create spiral interpolation to

mill taper threads?

With parametric

programming, you can!

Five Application Categories

Part families User created canned cycles Utilities Complex motions and shapes Driving accessories

Just about any shape that can be defined with an arithmetic

formula can be machined with a parametric program!

Spherical shape can be milled

G65 P1002 A1.75 B-.6 C1. I12. J1.75 I35. J1.625I175. J1.1 I25. J1.25 I113. J1.75

Circular cam can be milled

Part families User created canned cycles Utilities Complex motions and shapes Driving accessories

Five Application Categories

Five Application Categories

Part families User created canned cycles Utilities Complex motions and shapes Driving accessories

Some machines have probes and post process gauges

These devices are interfaced with parametric programming

Driving Accessories

Door open/close Automatic clamping Indexer activation Pallet changer activation

You can even add M codes with parametric programming!

Limitations

Option Skill & time for preparation Memory capacity Compatibility Execution time

There are some limitations to parametric programming…

Limitations

Option Skill & time for preparation Memory capacity Compatibility Execution time

There are some limitations to parametric programming…

Parametric programming is an option that must be purchased at an extra price (for most controls)

Limitations

Option Skill & time for preparation Memory capacity Compatibility Execution time

There are some limitations to parametric programming…

Parametric programs take time to prepare (more than for standard programs)

Limitations

Option Skill & time for preparation Memory capacity Compatibility Execution time

There are some limitations to parametric programming…

Parametric programs reside in memory (and take up memory space)

Limitations

Option Skill & time for preparation Memory capacity Compatibility Execution time

There are some limitations to parametric programming…

There are different versions of parametric programming from different control manufacturers

Limitations

Option Skill & time for preparation Memory capacity Compatibility Execution time

There are some limitations to parametric programming…

Calculation and logic commands take time to execute (this can be a problem when quantities are high)

Computer Related Features

Variables Arithmetic Logic & program flow control Looping

Computer Related Features

Variables Arithmetic Logic & program flow control Looping

Again, you can write general purpose programs

Computer Related Features

Variables Arithmetic Logic & program flow control Looping

Just about anything you can do with a scientific calculator can be done within a parametric program!

Computer Related Features

Variables Arithmetic Logic & program flow control LoopingThis feature gives parametric programming a decision-making capability

Computer Related Features

Variables Arithmetic Logic & program flow control LoopingThis feature allows a parametric program to repeat commands

If you are familiar with any computer programming language (like C language), you’re well on your way to understanding parametric programming!

CNC Related Features

Offsets Axis position Current modal states Alarm generation Certain control panel functions Timers

Parametric programming gives you access to certain CNC functions

CNC Related Features

Offsets Axis position Current modal states Alarm generation Certain control panel functions Timers

Parametric programming gives you access to certain CNC functions

You can write and read values to and from the offset registers

CNC Related Features

Offsets Axis position Current modal states Alarm generation Certain control panel functions Timers

Parametric programming gives you access to certain CNC functions

You can access current position in several ways

CNC Related Features

Offsets Axis position Current modal states Alarm generation Certain control panel functions Timers

Parametric programming gives you access to certain CNC functions

You can determine current modes (like absolute versus incremental) from within a program

CNC Related Features

Offsets Axis position Current modal states Alarm generation Certain control panel functions Timers

Parametric programming gives you access to certain CNC functions

You can make the control generate an alarm if you’re parametric program determines that something is wrong

CNC Related Features

Offsets Axis position Current modal states Alarm generation Certain control panel functions Timers

Parametric programming gives you access to certain CNC functions

You can turn on and off certain functions (like feed hold, feedrate override, and single block

CNC Related Features

Offsets Axis position Current modal states Alarm generation Certain control panel functions Timers

Parametric programming gives you access to certain CNC functions

You can time events from within a program

CNC Related Features

Protection for needed programs Creation of new G & M codes Communication of data

Additionally:

The computer and CNC related

features blend parametric

programming into a very

powerful programming tool!