Presentation links page for lesson three
Download
1 / 37

3 Arithmetic functions - PowerPoint PPT Presentation


  • 111 Views
  • Uploaded on

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.

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

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

Presentation links page for lesson three

3 Arithmetic functions

Introduction to arithmetic

Basic functions (+, -, *, /)

Combining operations

Trigonometry functions

Square root Absolute value

ROUNDFIXFUP(rounding functions)

Priority of arithmetic operators

Example


Introduction to arithmetic
Introduction To Arithmetic

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

Add

Subtract

Multiply

Divide

Square root

Logarithms

Sine

Cosine

Tangent

Arc tangent

Rounding


Introduction to arithmetic1

23

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


Basic arithmetic operations
Basic arithmetic operations

Equality

Add

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

10

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


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


Trigonometry functions
Trigonometry Functions

Sine

#101 = SIN[30]

Result:

#101 is set equal to 0.5


Trigonometry functions1

#101

45 deg

2.5R

Trigonometry Functions

Y component of hole location

Sine

#101 = SIN[45] * 2.5


Trigonometry functions2
Trigonometry Functions

Cosine

#101 = COS[30]

Result:

#101 is set equal to 0.86602


Trigonometry functions3

#101

45 deg

2.5R

Trigonometry Functions

X component of hole location

Cosine

#101 = COS[45] * 2.5


Trigonometry functions4
Trigonometry Functions

Arc cosine

#101 = ACOS[.86602]

Result:

#101 is set equal to 30


Trigonometry functions5

#101

?

#102

Trigonometry Functions

Angle needed

Side adjacent and hypotenuse known

Arc cosine

#103 = ACOS[#102/#101]


Trigonometry functions6
Trigonometry Functions

Tangent

#101 = TAN[30]

Result:

#101 is set equal to 0.5773


Trigonometry functions7

?

10

1.5

Trigonometry Functions

Side opposite needed

Angle and side adjacent known

Tangent

#101 = TAN[10] * 1.5


Trigonometry functions8
Trigonometry Functions

Arc tangent

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

Result:

#101 is set equal to 33.6874


Trigonometry functions9

#101

?

#102

Trigonometry Functions

Angle needed

Arc tangent

Side adjacent and side opposite known

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


Square root
Square Root

#101 = SQRT[9]

Result:

#101 is set equal to 3.0


Square root1

c

a

b

2

2

2

c

=

a

+

b

Square Root

Pythagorean theorem

#101

#102

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


Absolute value
Absolute Value

Absolute value renders unsigned (positive) value

#101 = ABS[2-5]

Result:

#101 is set equal to 3.0


Absolute value1

Z

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


Rounding
Rounding

Result is next closest integer

#101 = ROUND[3.2]

#101 is set to 3

#101 = ROUND[3.8]

#101 is set to 4


Rounding1

#19

#7

Rounding

Rounding is helpful when determining the number of passes

#101=ROUND[#19/#7]

#7=#19/#101


Rounding2

0.25

0.85

Rounding


Rounding3

0.25

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)


Rounding4

0.125

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)


Rounding5

#17

#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


Round down fix
Round Down (FIX)

FIX rounds down to next lower integer

#101 = FIX[3.8]

#101 is set to 3


Round down fix1

0.125

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)


Round up fup
Round Up (FUP)

FUP rounds up to next higher integer

#101 = FUP[3.2]

#101 is set to 4


Round up fup1

0.125

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)


Priority of arithmetic operations

1)

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


Priority of arithmetic operations1

3

1

2

Priority Of Arithmetic Operations

Example

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


Example

Fixed jaw

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


Example1

Fixed jaw

moving jaw

Example

…small workpiece…

Center Y position changes based upon diameter

Workpiece


Example2

Fixed jaw

moving jaw

Example

…large workpiece

Center Y position changes based upon diameter

Workpiece


Example3

X0 Y0

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


Example4

Fixed jaw

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


ad