Arithmetic & Trig

Do trigonometry in a Haas macro and know that trig is in degrees.

Macro math uses square brackets, and — exactly like Fanuc — trig is in degrees, not radians. COS[30] is 0.866. Your Fanuc habits carry over verbatim here; that's the whole design of the Haas control.

Read firstHaas Programming & MacrosHaas NGC macro programming for Fanuc-fluent machinists: G154 work offsets, M97 local subprograms, Setting 33 coordinate compatibility, G65 macro calls with a complete bolt-circle example, G31 probing, and DPRNT output.

Your turn

The machine hands you a bolt-circle radius in #101 and an angle in degrees in #120. Compute the point on the circle: #121 = the X distance, #122 = the Y distance.

The machine gives you

50 mm radius at 30°:#101 = 50#120 = 30
20 mm radius at 60°:#101 = 20#120 = 60

Your program is run once for each set of conditions. It has to work for all of them.

Loading...

This is a learning simulation — always prove out a program on the actual control before you cut metal.