Answers and Information
The following answers and information provide some helpful ways to increase your productivity. From sample programs and specific codes to best practices and videos, these ideas will help you get the most from your machine.
Please note, you should not perform machine repairs or service procedures unless you are qualified and knowledgeable about the processes. Many service and repair procedures should be done only by authorized personnel. Hartwig’s Service Technicians have the training, experience, and are certified to do these tasks safely and correctly.
Contact Hartwig if you have a content suggestion to be considered for the Answers and Information page.
Common Variable for Lathe - Example Program
N30 DEF WORK
N40 PS LC,[-30,0],[30,23]
N80 (V2=Length of fin part)
N100 (V4=Counterbore I.D.)
N110 (V5=Counterbore depth)
N120 (V6=Counterbore? 1=yes 0=no)
N130 (V8=Length of chamfer)
N140 (V12=Face SFM)
N150 (V13=Face Feedrate)
N160 (V14=Rough Turn, Drill, and Bore RPM)
N170 (V15=Rough Turn Feedrate)
N180 (V16=Drill Feedrate)
N190 (V18=Bore Feedrate)
N200 (V19=Cutoff SFM)
N210 (V20=Cutoff Feedrate)
N220 G50 S2000
N230 G0 X20 Z20
N240 M42 S=[3.8/V1]*V12 M3 P10
N250 (Face and Turn OD)
N260 T010101 X=V1+.2 Z0 M8
N270 G96 S=V12 G111 P15
N280 G1 X-.032 F=V13
N300 G97 S=V14 P20
N310 G0 X=V1+.03 P30
N320 G1 X=V1-.04 Z0 G42 F.02
N330 X=V1 G76 L-.005 F=V15
N360 G0 X=V1+.2 Z=V2 G40
N370 G0 X20 Z20
N390 T0202 X=V1+.05 Z=-V2-.125
N400 G97 S=[3.8/V1]*V19 P35
N410 G96 S=V19 G111 P37
N420 G1 X=V3-.025 F=V20
N430 G0 X=V1+.1 P40
N440 M5 M9 P50
N450 X20 Z20
N460 (BAR PULLER)
N470 T0404 G0 X0 Z.1
N480 G1 Z-1. F15 G94
N500 G1 Z.020 F15
N520 G1 Z1.00 F60
N530 G0 X20 Z20
N550 G50 S2000
N560 G0 X20 Z20
N570 M42 S=[3.8/V1]*V12 M3 P10
N580 (Drill )
N590 T0101 X5 Z.1 M8
N600 G96 S=V12 G111 P15
N610 G97 S=V14 P20
N620 X0 P30
N630 G1 Z-V2-.11 F=V16
N640 G0 Z.1
N650 G0 X20 Z20
N660 IF[V6 EQ 1]NCBOR
N670 T020202 X=V3+[V8*2]+.08 Z.1
N680 G1 X=V3+[V8*2]+.01 Z0 F.015 G41
N690 X=V3+[V8*2] F=V18
N700 X=V3 Z=-V8
N740 G0 Z.1
N750 GOTO NSKIP
NCBOR T020202 X=V4+.08 Z.1
N760 G1 X=V4+.01 Z0 F.015 G41
N770 X=V4 F=V18
N830 G0 Z.1
NSKIP G97 S=[3.8/V1]*V19 P35
N840 G96 S=V19 G111 P37
N850 X20 Z20
N860 (Parts Catcher)
N870 T0303 X0 Z.1
N880 G1 Z=-V2 F20 G94
N890 G0 Z.1 P40
N900 M5 M9 P50
N910 X12 Z8
N920 (DROP PART IN CHUTE)
N930 G94 F15 Z10 G1
N940 G0 X20 Z20
G88 Threading Cycle for Lathe - Example Program
G71 X2.25 Z.5 B60 U.001 M32 M73 D.03 H.1 F.1 I-.1
G88 NLAP1 D.03 H.1 B60 U.001 M32 M73
G34 X2 Z3.2 F.010
G34 Z.5 X1.8 F.10
G0 X3. F.05
ID Oil Groove on Okuma Lathe - Example Program
G34 Z-3 X1.010 F.25 J1
G34 Z-3 X1.010 F.25 J1 C180
Tool Life Management / Part Transfer (G22) / Sub-Spindle LB15IIMW - Example Program
VTLIN=3 VTLFN=1 VTLL=1.625 VTLA2=5 VTLA1=80
VTLIN=1 VTLFN=1 VTLL=1.625 VTLA2=5 VTLA1=80
VGRIN=9 VGRFN=1 VGRL=1.625 VGRA2=5 VGRA1=55
VGRIN=7 VGRFN=1 VGRL=1.625 VGRA2=5 VGRA1=55
VTLIN=28 VTLFN=1 VTLD=0.25 VTLL=1 VTLA1=118
VTLIN=3 VTLFN=1 VTLL=1.5 VTLA2=5 VTLA1=80
VTLIN=1 VTLFN=1 VTLL=1.5 VTLA2=5 VTLA1=80
VTLIN=9 VTLFN=1 VTLL=1.5 VTLA2=5 VTLA1=55
VTLIN=7 VTLFN=1 VTLL=1.5 VTLA2=5 VTLA1=55
VWKR=393.7007 VCHKL=0.5 VCHKD=0.5 VCHKX=2 VCHKZ=-2
VWKR=393.7007 VCHKL=0.5 VCHKD=0.5 VCHKX=1.75 VCHKZ=-2
N0003 G00 X20 Z20
N0004 G50 S3800
N0006 G50 S4500
N0101 G00 X20 Z20
N0103 G97 S727 M41 M03 M08
N0104 X2.416 Z0.12 T010101
N0106 G96 S460
N0107 G85 N0108 D0.12 F0.014 U0.016 W0.008 M85
N0109 G01 X2 Z0
N0114 G00 X2.096 Z0 G41
N0115 G01 X-0.016 E0.014
N0118 G00 Z0.12
N0120 G97 S727 M09
N0201 G97 S757 M08
N0202 G00 X2.1 T010101
N0205 G96 S460
N0206 G85 N0207 D0.32 F0.014 U0.016 W0.008 M85
N0208 G01 X1.25 Z0
N0212 G00 X1.154 Z0 G42
N0213 G01 X1.25 E0.021
N0214 G03 X1.75 Z-0.25 K-0.25 E0.014
N0215 G01 Z-1.048
N0216 X2.096 E0.021
N0219 G00 X2.1
N0221 G97 S757 M09
N0222 X20 Z20
N0300 G97 S1601 M42 M08
N0301 G00 X1.41 Z0.12 TG=02 OG=1
N0303 G96 S591
N0304 G87 N0305
N0306 G00 Z0
N0307 G01 X1.282 G41 F0.008
N0311 G01 X0.088 Z0.004
N0312 G00 Z0.12
N0313 G97 S3800 M09
N0400 G97 S1783 M08
N0401 G00 X2.1 TG=02 OG=1
N0404 G96 S591
N0405 G87 N0406
N0407 G00 X1.106
N0408 G01 Z0.04 G42 F0.008
N0411 G03 X1.75 Z-0.25 K-0.25
N0412 G01 Z-1.048
N0416 G01 X1.822 Z-1.004
N0417 G00 X2.1
N0418 G97 S1075 M05 M09
N0419 X20 Z20
N0501 G94 M146 M15 M08
N0502 G00 X1 Z0.52 T0303 SB=1070
N0504 G183 X1 Z-0.5 C0 K0.02 F4.28 E0.112 D0.12 L0.5
N0509 G00 Z0.52
N0510 G95 M12 M09
N0512 G00 X20 Z20
N0600 G00 Z5 W20
N0604 G00 W1.2
N0605 G29 PW=65
N0606 G94 G22 W0 D0.05 L0.08 F20 PW=55
N0607 G29 PW=5
N0703 G95 G00 W20
N0801 G00 X20 Z20
N0803 G97 S727 M03 M08
N0804 X2.416 Z0.12 T210121
N0806 G96 S460
N0807 G85 N0808 D0.078 F0.0112 U0.016 W0.008 M85
N0809 G01 X2 Z0.02
N0812 G00 X2.096 Z0.02 G41
N0813 G01 X-0.016 E0.0112
N0816 G00 Z0.12
N0818 G97 S727 M09
N0901 G97 S757 M08
N0902 G00 X2.1 T210121
N0905 G96 S460
N0906 G85 N0907 D0.208 F0.0112 U0.016 W0.008 M85
N0908 G01 X1.25 Z0.02
N0913 G00 X1.154 Z0.02 G42
N0914 G01 X1.25 E0.0168
N0915 G03 X1.75 Z-0.23 K-0.25 E0.0112
N0916 G01 Z-1.028
N0919 G00 X2.1
N0921 G97 S757 M09
N0922 X20 Z20
N1000 G97 S1601 M08
N1001 G00 X1.41 Z0.12 T220222
N1003 G96 S591
N1004 G87 N1005
N1006 G00 Z0.02
N1007 G01 X1.282 G41 F0.008
N1011 G01 X0.088 Z0.024
N1012 G00 Z0.12
N1013 G97 S4500 M09
N1100 G97 S1783 M08
N1101 G00 X2.1 T220222
N1104 G96 S591
N1105 G87 N1106
N1107 G00 X1.106
N1108 G01 Z0.06 G42 F0.008
N1111 G03 X1.75 Z-0.23 K-0.25
N1112 G01 Z-1.012
N1115 G01 X1.758 Z-0.968
N1116 G00 X2.1
N1117 G97 S1075 M05 M09
N1118 X20 Z20
Local Variables and G101 for Lathe - Example Program
SFM=80 (Surface Feet Per Minute)
IPT=.0005 (Inches per Tooth)
DIA=1.265 (Diameter of Cutter)
TETH=13 (Number of Teeth on Cutter)
G00 X2.3269 Z0 T0101 SB=[3.82/DIA]*SFM
C-29.4594 G42 M13
G01 Z-0.19 F15
G101 X2.3269 C29.4594 F=IPT*TETH*[[3.82/DIA]*SFM]
G00 X20 Z20
G-Code List - Okuma Lathes
M-Code List - Okuma Lathes
System Variable List - Okuma Lathes
Okuma P300L Control - How to Set Z-Axis Work Zero
Do You Have Variables In Your Manufacturing Operation
Do You Have Variables In Your Manufacturing Operation
Written by Mike Wolf, Hartwig Applications Engineer
Okuma control, the variables and related functions are part of User Task II. On the Fanuc control, it is part of Macro B. Most of the variable functions are now standard on the newer Okuma controls. Macro B is usually an option on many Fanuc controls. There are basically three types of variables – local variables, common variables, and system variables. Some controls also have a function called IO variables (input /output variables).
A common variable on the Okuma lathe is called out using V, on a machining center it is VC. Common variables can be used to represent coordinate positions, spindle speeds, or a counter.
Most Okuma machines will have common variables ranging from 1 up to 32. New machines will usually have 200. One of the basic uses of common variables is a parts counter. The operator or programmer would put a line of code in the program, each time the program reads that particular line one is added to the parts count. At the end of the shift the operator can check the number of parts by looking in the common variable page in parameter mode.
A parts counter on the lathe might look something like this, V10=V10+1, with this statement in the program the machine would add 1 to common variable 10 each cycle. For a machining center it would read VC10=VC10+1.
On a Fanuc control is would look like this #105 = #105+1.
System variables have a specific meaning to the machine’s operating system. One system variable that is used quite often on an Okuma lathe or mill is VZOFZ. This is used to represent the Z zero offset from the zero set mode. When the machine reads the line containing VZOFZ, the Z zero offset would be set or updated. There are many systems variables ranging from zero offsets to pitch error comp to current machine position. Used in the program, the variable would read like this, VZOFZ=652.9658. The number following the equal sign is the value obtained from the Z zero offset in zero set mode. On a Fanuc control, the Z axis work shift is variable #2601 and the name is [#_WKSFTZ].
Local variable names are chosen by the programmer. The name is usually up to four characters long, with the first two characters being letters from the alphabet. Local variables are cleared upon the completion of the program or when rest is pressed. Up to 127 local variables are available on most controls with this type of function. With this type of variable we create a unique name that has some meaning to us. An example of this might be XDIM1 or ZDIM1. With these names we assign an X program position and Z program position. In the program it would like this:
XDIM1=1.0 (this defines the value for XDIM1)
ZDIM1=1.0 (this defines the value for ZDIM1)
G0 X=XDIM1 (X is positioned to 1-inch at a rapid speed)
G1 Z=-ZDIM1 F.010 (Z is positioned to 1-inch at a feed rate of .010 per rev)
A fourth, but often overlooked, type of variable is what we call an I/O variable. These types of variables are used to check the status of an input or output on the machine. For example, we can check to see if single block is on or if the spindle override is set to 100%. If the proper conditions do not exist, we can generate an alarm to alert the operator to the condition so it can be corrected before running the machine cycle. Here in this example to check if single block is on:
IF [VORDEQ 1] NAL06 (check to see if single block is on; if it is on jump to line NAL06)
NCUT (start of cutting program)
NDONE (end of cutting program)
GOTO NEND (jump to line NEND to read M30 end of program code)
NAL06 VAUCM=’SINGLE BLK ON’ (comment that will appear with alarm if single block is on)
When programmers use check statements like this, they will usually check multiple items on the machine and will put these checks in a sub program.
Most machines with the variable functions will also have the ability to do math within the program. This can range from simple addition and subtraction, trig functions using sine and cosine, or rounding up or down. With this example, we set the speed command S by using local variable and a simple math formula:
SFM=770 (surface speed of 770)
S=3.82/4*SFM (speed is equal to 3.82/4 flutes *SFM of 770)
SERVICE AND MAINTENANCE
Daily Preventive Maintenance Activities
- Check hydraulic pressure and fluids, chuck pressure, lube levels; and, if you have a cooling system, check the cooling unit level.
- Clean out chips, grease parts as needed, clean off windows and doors, and wipe down and lubricate way covers for smooth movement.
Every Three Months or 500 Hours
- Check and grease the chain on chip conveyor.
- Check and clean the filters on the coolant tank.
Every Six Months or 1,000 Hours
Have the following preventive maintenance performed by a certified technician:
- Clean the coolant tank of sludge, chips and oil.
- Clean the chuck and jaws.
- Drain the hydraulic tank and replace the hydraulic oil, and change the line filter and suction filter.
- Clean the radiator and make sure the radiator fins are straight.
- Drain and clean the lubrication unit and add fresh way lube.
- Drain and refill the cooling unit.
- Check the leveling of your machine and adjust if necessary.
- Clean and inspect way wipers and replace any wipers that are damaged.
Once a Year or Every 2,000 Hours
Have your Hartwig Service Technician perform the following inspections:
- Check the headstock for taper.
- Check the spindle for radial and end play.
- Check the chuck cylinder for run out.
- Check the tailstock for taper.
- Check turret parallelism and inclination.
- Run a backlash program to check the backlash in X and Z axis.
- Check the X and Z axis gibs.
Periodic Inspection of the Crossrail Brake
An electromagnetic brake is part of the crossrail elevating countershaft, which is located inside the top beam to prevent the crossrail from dropping when there is an interruption in power. The electromagnetic brake uses a friction board. If its linings are worn, the brake torque is reduced and the unclamp motion cannot perform smoothly, deteriorating the braking performance. This may cause the crossrail to drop abnormally, leading to serious accidents. Periodic inspection of the lining can prevent this situation. Although the brake linings will not wear easily, as they are not applied during crossrail movement, it is still an important maintenance item.
Follow the procedure below:
- Turn off power to the machine.
- Remove the cap screw (Item#18 shown below) and insert the feeler gauge supplied with the machine. Insert the gauge between the pole surfaces.
The clearance should be within 0.5mm (0.020 in.) of 0.15mm (0.0059 in.) to 1mm (0.04 in.) Contact Hartwig or Okuma immediately if the clearance is larger or smaller than this range.
Tools Getting Stuck in Spindle After Long Uninterrupted Cuts
After a long or heavy cutting operation, a tool may become overheated and difficult to remove from the spindle.
If the cutting operation generates significant vibration, fretting corrosion effect can cause rust to gather on the tapered bores between spindle and tool.
Apply a coating of powder lubricant, such as aerosol molybdenum (Molykote® 321 or similar), to the taper section of the tool shank and spindle to ease removal. Care should be taken while handling the tool if it is hot.
Preventing Hydraulic Oil Contamination on Your Lathe
On the back of the actuator, there is a coolant return. This can sometimes get clogged with chips or other debris. When this occurs, coolant can spill over into the hydraulic return thus contaminating the hydraulic system. By simply checking the coolant return daily and cleaning as necessary, this issue can be avoided.
How to Calibrate the Touch Setter
Service Tip: Don’t Confuse Air/Oil Lubrication with Way Oil Lubrication
Avoiding Spooling Problems
Wire tangling or cross-overs on the spool are one of the most common reasons for returned EDM wire, yet the vast majority of these incidents are caused by improper handling and storage of the spool.
Storing a spool by laying it on its flange, when combined with improper fixing of the free end, is an invitation to a spooling problem the next time you use the spool. Relaxed wire tension can propagate from the surface layer into the spool. The slightest impact while the spool is on end can cause the coils to slip past each other creating a tangle.
Wire manufacturers package their wires with the axis of the spool in the horizontal position to prevent this problem. It is a good idea to save the box for properly storing partially used spools.
Give Your Filters a Rest
Did you know that you can increase the life of your filters by giving them a rest? Many shops leave their machines running all the time with the filter pumps on. Not only does this consume substantial unnecessary filter pump and chiller energy, but it also shortens filter life. It is an established fact that depressurizing a filter cartridge will allow some of the dirt cake on the pleats to fall to the bottom of the housing, and re-open some of the pores. The next time your filters need changing, try turning off the filter pump overnight and note how much the overflow from the clean tank improves the following morning.
Sizing An EDM Chiller
It is important to properly size a chiller to the machine’s heat output into the dielectric. While it is often difficult to accurately predict the BTU/hr capacity required to absorb the heat of the machine pumps, and the erosion process based upon the pump HP and the power supply KVA, there is a simple method to assure that you buy the right size.
Starting with a cold machine, measure the dielectric temperature. Turn on the machine and begin cutting a typical thickness block for 1 hour. Then measure the water temperature again. Note the temperature rise. Report this temperature rise, along with the machine dielectric tank capacity and dielectric type (oil or water) to your prospective chiller vendor. This information will allow them to accurately calculate the heat output of your machine system, and accurately size the chiller.