1 / 37

# 3 Arithmetic functions - PowerPoint PPT Presentation

Presentation links page for lesson three. 3 Arithmetic functions. Introduction to arithmetic. Basic functions (+, -, *, /). Combining operations. Trigonometry functions. Square root Absolute value. ROUND FIX FUP (rounding functions). Priority of arithmetic operators. Example.

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.

## PowerPoint Slideshow about ' 3 Arithmetic functions' - rhea-dodson

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

3 Arithmetic functions

Introduction to arithmetic

Basic functions (+, -, *, /)

Combining operations

Trigonometry functions

Square root Absolute value

ROUNDFIXFUP(rounding functions)

Priority of arithmetic operators

Example

Just about anything that can be done on a scientific calculator can be done in a custom macro program

Subtract

Multiply

Divide

Square root

Logarithms

Sine

Cosine

Tangent

Arc tangent

Rounding

23

2

3

Introduction To Arithmetic

For those functions that are not included in custom macro:

Square:

23 times 23

Cube:

23 times 23 times 23

You can usually come up with a way to calculate longhand

Equality

Subtract

Multiply

Divide

=

+

-

/

*

#100 = 4.

#101 = 2+2

#102 = 5-1

#103 = 2*2

#104 = 8/2

Variable #100 equals 4 in all expressions

Combining operations

You can combine operations into an expression

Multiplication has a higher priority than addition

6

#101 = 4 + 3 * 2

14

Again, multiplication is done first – otherwise the result would be 14

Combining operations

If you want to force the addition to be done first, use brackets to surround the addition operation

#101 = [4 + 3] * 2

7

More on brackets later

Sine

#101 = SIN[30]

Result:

#101 is set equal to 0.5

45 deg

2.5R

Trigonometry Functions

Y component of hole location

Sine

#101 = SIN[45] * 2.5

Cosine

#101 = COS[30]

Result:

#101 is set equal to 0.86602

45 deg

2.5R

Trigonometry Functions

X component of hole location

Cosine

#101 = COS[45] * 2.5

Arc cosine

#101 = ACOS[.86602]

Result:

#101 is set equal to 30

?

#102

Trigonometry Functions

Angle needed

Side adjacent and hypotenuse known

Arc cosine

#103 = ACOS[#102/#101]

Tangent

#101 = TAN[30]

Result:

#101 is set equal to 0.5773

10

1.5

Trigonometry Functions

Side opposite needed

Angle and side adjacent known

Tangent

#101 = TAN[10] * 1.5

Arc tangent

#101 = ATAN[.5] / [.75]

Result:

#101 is set equal to 33.6874

?

#102

Trigonometry Functions

Angle needed

Arc tangent

Side adjacent and side opposite known

#103 = ATAN[#101] / [#102]

#101 = SQRT[9]

Result:

#101 is set equal to 3.0

a

b

2

2

2

c

=

a

+

b

Square Root

Pythagorean theorem

#101

#102

#103=SQRT[#101*#101 + #102*#102]

Absolute value renders unsigned (positive) value

#101 = ABS[2-5]

Result:

#101 is set equal to 3.0

Absolute Value

User could enter positive or negative value

Result is Z-1.0, regardless of entry polarity

?

Z-1.0

G65 P1000 … Z1.0 ...

O1000

.

.

.

G01 Z-[ABS[#26]] F4.5

Result is next closest integer

#101 = ROUND[3.2]

#101 is set to 3

#101 = ROUND[3.8]

#101 is set to 4

#7

Rounding

Rounding is helpful when determining the number of passes

#101=ROUND[#19/#7]

#7=#19/#101

0.85

Rounding

0.85

Rounding

Recalculated depth per peck ensures consistent depth per peck

#17

This renders three even passes of 0.2833 each

#7

#101 = ROUND[#7/#17]

(3 passes)

#17 = #7/#101

(0.2833)

0.69

Rounding

#17

This renders six even passes of 0.115 each

#7

#101 = ROUND[#7/#17]

(6 passes)

#17 = #7/#101

(0.115)

#26

Rounding

#101= ROUND[#26/#17]

Use ROUND when you don’t care if the recalculated depth of cut is greater or less than the initial specification

#17= #26 / #101

FIX rounds down to next lower integer

#101 = FIX[3.8]

#101 is set to 3

0.69

=> original doc

Round Down (FIX)

#17

Use FIX when you want to specify a MINIMUM depth of cut. The recalculated depth will always be GREATER than the specified value.

#7

#101 = FIX[#7/#17]

(5)

#17 = #7/#101

(0.138)

FUP rounds up to next higher integer

#101 = FUP[3.2]

#101 is set to 4

0.69

=< original doc

Round Up (FUP)

#17

Use FUP when you want to specify a MAXIMUM depth of cut. The recalculated depth will always be LESS than the specified value.

#7

#101 = FUP[#7/#17]

(6)

#17 = #7/#101

(0.115)

2)

3)

4)

[ ]

Functions

* then /

+ then -

Priority Of Arithmetic Operations

Here is the full priority of arithmetic operations

Anything in brackets will be done first

Higher level functions (sine, cosine, etc) done second

Multiplication and division done third

Addition, then subtraction are done last

1

2

Priority Of Arithmetic Operations

Example

#102 = COS[#1] * [#18 + #20]

Workpiece

moving jaw

Example

A vise has a fixed jaw and moving jaw

Workpiece Y center position varies based upon diameter…

Center Y position changes based upon diameter

moving jaw

Example

…small workpiece…

Center Y position changes based upon diameter

Workpiece

moving jaw

Example

…large workpiece

Center Y position changes based upon diameter

Workpiece

Fixed jaw

dia

moving jaw

Example

Formula to determine Y center position

Center Y position changes based upon diameter

[dia/d] / COS[45]

45

dia/2

Workpiece

dia

moving jaw

Example

Related custom macro commands

Center Y position changes based upon diameter

O0001 (Custom macro B)

#101=3.25 (diameter)

.

.

G00 X0 Y-[#101/2 / COS[45]]

.

.

.

.

.

X0 Y0

[dia/d] / COS[45]

45

dia/2

Workpiece