01Programming_SZGH-CNC1000GDb(V2.3)
01Programming_SZGH-CNC1000GDb(V2.3)
SZGH-CNC1000GDb(series)
Grinding Control System
-PROGRAMMING-
V2.3
BOOK1
Warning
Warning notices are used in this publication to emphasize that hazardous voltages, currents,
temperatures, or other conditions that could cause personal injury exist in this equipment or may be
associated with its use.
In situations where inattention could cause either personal injury or damage to equipment, a
Warning notice is used.
Caution
Caution notices are used where equipment might be damaged if care is not taken.
Note
Notes merely call attention to information that is especially significant to understanding and
operating the equipment.
This document is based on information available at the time of its publication. While efforts
have been made to be accurate, the information contained herein does not purport to cover all
details or variations in hardware or software, nor to provide for every possible contingency in
connection with installation, operation, or maintenance. Features may be described herein which
are not present in all hardware and software systems. GE Fanuc Automation assumes no obligation
of notice to holders of this document with respect to changes subsequently made.
Shenzhen Guanhong Automation makes no representation or warranty, expressed, implied, or
statutory with respect to, and assumes no responsibility for the accuracy, completeness, sufficiency,
or usefulness of the information contained herein. No warranties of merchantability or fitness for
purpose shall apply.
I
-Shenzhen Guanhong Automation Co.,Ltd.- SZGH-CNC1000GDb Series [Book1]
SAFETY PRECAUTIONS
This section describes the safety precautions related to the use of CNC units. It is essential that
these precautions be observed by users to ensure the safe operation of machines equipped with a
CNC unit (all descriptions in this section assume this configuration). Note that some precautions
are related only to specific functions, and thus may not be applicable to certain CNC units.
Users must also observe the safety precautions related to the machine, as described in the
relevant manual supplied by the machine tool builder. Before attempting to operate the machine or
create a program to control the operation of the machine, the operator must become fully familiar
with the contents of this manual and relevant manual supplied by the machine tool builder.
WARNING
Applied when there is a danger of the user being injured or when there is a danger of both the user
being injured and the equipment being damaged if the approved procedure is not observed.
CAUTION
Applied when there is a danger of the equipment being damaged, if the approved procedure is not
observed.
NOTE
The Note is used to indicate supplementary information other than Warning and Caution.
II
2 GENERAL WARNINGS AND CAUTIONS
Warning
1. Never attempt to machine a workpiece without first checking the operation of the machine.
Before starting a production run, ensure that the machine is operating correctly by performing a trial run using,
for example, the single block, feedrate override, or machine lock function or by operating the machine with
neither a tool nor workpiece mounted. Failure to confirm the correct operation of the machine may result in the
machine behaving unexpectedly, possibly causing damage to the workpiece and/or machine itself, or injury to the
user.
2. Before operating the machine, thoroughly check the entered data. Operating the machine with incorrectly
specified data may result in the machine behaving unexpectedly, possibly causing damage to the workpiece
and/or machine itself, or injury to the user.
3. Ensure that the specified feedrate is appropriate for the intended operation. Generally, for each
machine, there is a maximum allowable feedrate. The appropriate feedrate varies with the intended operation.
Refer to the manual provided with the machine to determine the maximum
allowable feedrate. If a machine is run at other than the correct speed, it may behave unexpectedly, possibly
causing damage to the workpiece and/or machine itself, or injury to the
user.
4. When using a tool compensation function, thoroughly check the direction and amount of
Compensation. Operating the machine with incorrectly specified data may result in the machine behaving
unexpectedly, possibly causing damage to the workpiece and/or machine itself, or injury to the user.
5. The parameters for the CNC and PMC are factory-set. Usually, there is not need to change them. When,
however, there is not alternative other than to change a parameter, ensure that you fully understand the function
of the parameter before making any change. Failure to set a parameter correctly may result in the machine
behaving unexpectedly, possibly causing damage to the workpiece and/or machine itself, or injury to the user.
6. Immediately after switching on the power, do not touch any of the keys on the MDI panel until the position
display or alarm screen appears on the CNC unit. Some of the keys on the MDI panel are dedicated to
maintenance or other special operations. Pressing any of these keys may place the CNC unit in other than its
normal state. Starting the machine in this state may cause it to behave unexpectedly.
7. The operator’s manual and programming manual supplied with a CNC unit provide an overall
description of the machine’s functions, including any optional functions. Note that the optional
functions will vary from one machine model to another. Therefore, some functions described
in the manuals may not actually be available for a particular model. Check the specification of
the machine if in doubt.
8. Some functions may have been implemented at the request of the machine–tool builder. When using such
functions, refer to the manual supplied by the machine–tool builder for details of their use and any related
cautions.
NOTE: Programs,parameters, and macro variables are stored in nonvolatile memory in the CNC unit.
Usually, they are retained even if the power is turned off. Such data may be deleted inadvertently, however, or
it may prove necessary to delete all data from nonvolatile memory as part of error recovery.To guard against
the occurrence of the above, and assure quick restoration of deleted data, backup all vital data, and keep the
backup copy in a safe place.
III
-Shenzhen Guanhong Automation Co.,Ltd.- SZGH-CNC1000GDb Series [Book1]
Warning
1.Coordinate system setting
If a coordinate system is established incorrectly, the machine may behave unexpectedly as a result of the program
issuing an otherwise valid move command.
Such an unexpected operation may damage the tool, the machine itself, the workpiece, or cause injury to the user.
2. Positioning by nonlinear interpolation
When performing positioning by nonlinear interpolation (positioning by nonlinear movement between the start
and end points), the tool path must be carefully confirmed before performing programming. Positioning involves
rapid traverse. If the tool collides with the workpiece, it may damage the tool, the machine itself, the workpiece,
or cause injury to the user.
3. Function involving a rotation axis
When programming polar coordinate interpolation or normal–direction (perpendicular) control, pay careful
attention to the speed of the rotation axis. Incorrect programming may result in the rotation axis speed becoming
excessively high, such that centrifugal force causes the chuck to lose its grip on the workpiece if the latter is not
mounted securely. Such mishap is likely to damage the tool, the machine itself, the workpiece, or cause injury to
the user.
4. Inch/metric conversion
Switching between inch and metric inputs does not convert the measurement units of data such as the workpiece
origin offset, parameter, and current position. Before starting the machine, therefore, determine which
measurement units are being used. Attempting to perform an operation with invalid data specified may damage
the tool, the machine itself, the workpiece, or cause injury to the user.
5. Constant surface speed control
When an axis subject to constant surface speed control approaches the origin of the workpiece coordinate system,
the spindle speed may become excessively high. Therefore, it is necessary to specify a maximum allowable speed.
Specifying the maximum allowable speed incorrectly may damage the tool, the machine itself, the workpiece, or
cause injury to the user.
6. Stroke check
After switching on the power, perform a manual reference position return as required. Stroke check is not
possible before manual reference position return is performed. Note that when stroke check is disabled, an alarm
is not issued even if a stroke limit is exceeded, possibly damaging the tool, the machine itself, the workpiece, or
causing injury to the user.
7. Absolute/incremental mode
If a program created with absolute values is run in incremental mode, or vice versa, the machine may behave
unexpectedly.
8. Plane selection
If an incorrect plane is specified for circular interpolation, helical interpolation, or a canned cycle, the machine
may behave unexpectedly. Refer to the descriptions of the respective functions for details.
9. Compensation function
IV
If a command based on the machine coordinate system or a reference position return command is issued in
compensation function mode, compensation is temporarily canceled, resulting in the unexpected behavior of the
machine. Before issuing any of the above commands, therefore, always cancel compensation function mode.
Warning
1. Manual operation
When operating the machine manually, determine the current position of the tool and workpiece,
and ensure that the movement axis, direction, and feedrate have been specified correctly.
Incorrect operation of the machine may damage the tool, the machine itself, the workpiece, or
cause injury to the operator.
2. Manual reference position return
After switching on the power, perform manual reference position return as required. If the machine is operated
without first performing manual reference position return, it may behave
unexpectedly. Stroke check is not possible before manual reference position return is performed.
An unexpected operation of the machine may damage the tool, the machine itself, the workpiece,
or cause injury to the user.
3. Manual handle feed
In manual handle feed, rotating the handle with a large scale factor, such as 100, applied causes
the tool and table to move rapidly. Careless handling may damage the tool and/or machine, or
cause injury to the user.
4. Disabled override
If override is disabled (according to the specification in a macro variable) during threading or
other tapping, the speed cannot be predicted, possibly damaging the tool, the machine itself, the
workpiece, or causing injury to the operator.
5. Origin/preset operation
Basically, never attempt an origin/preset operation when the machine is operating under the
control of a program. Otherwise, the machine may behave unexpectedly, possibly damaging the
tool, the machine itself, the tool, or causing injury to the user.
6. Workpiece coordinate system shift
Manual intervention, machine lock, or mirror imaging may shift the workpiece coordinate
system. Before attempting to operate the machine under the control of a program, confirm the
coordinate system carefully. If the machine is operated under the control of a program without making allowances
for any shift in the workpiece coordinate system, the machine may behave unexpectedly, possibly damaging the
tool, the machine itself, the workpiece, or causing injury to the operator.
7. Software operator’s panel and menu switches
Using the software operator’s panel and menu switches, in combination with the MDI panel, it
is possible to specify operations not supported by the machine operator’s panel, such as mode
change, override value change, and jog feed commands.
Note, however, that if the MDI panel keys are operated inadvertently, the machine may behave
V
-Shenzhen Guanhong Automation Co.,Ltd.- SZGH-CNC1000GDb Series [Book1]
unexpectedly, possibly damaging the tool, the machine itself, the workpiece, or causing injury
to the user.
8. Manual intervention
If manual intervention is performed during programmed operation of the machine, the tool path
may vary when the machine is restarted. Before restarting the machine after manual intervention,
therefore, confirm the settings of the manual absolute switches, parameters, and
absolute/incremental command mode.
9. Feed hold, override, and single block
The feed hold, feedrate override, and single block functions can be disabled using custom macro
system variable #3004. Be careful when operating the machine in this case.
10. Dry run
Usually, a dry run is used to confirm the operation of the machine. During a dry run, the machine
operates at dry run speed, which differs from the corresponding programmed feedrate. Note that
the dry run speed may sometimes be higher than the programmed feed rate.
11. Cutter and tool nose radius compensation in MDI mode
Pay careful attention to a tool path specified by a command in MDI mode, because tool nose
radius compensation is not applied. When a command is entered from the MDI to interrupt in
automatic operation in tool nose radius compensation mode, pay particular attention to the tool
path when automatic operation is subsequently resumed. Refer to the descriptions of the
corresponding functions for details.
12. Program editing
If the machine is stopped, after which the machining program is edited (modification, insertion,
or deletion), the machine may behave unexpectedly if machining is resumed under the control
of that program. Basically, do not modify, insert, or delete commands from a machining program
while it is in use.
WARNING
1. Memory backup battery replacement
When replacing the memory backup batteries, keep the power to the machine (CNC) turned on,
and apply an emergency stop to the machine. Because this work is performed with the power
on and the cabinet open, only those personnel who have received approved safety and
maintenance training may perform this work.
When replacing the batteries, be careful not to touch the high–voltage circuits (marked and
fitted with an insulating cover).Touching the uncovered high–voltage circuits presents an extremely dangerous
electric shock hazard.
NOTE:The CNC uses batteries to preserve the contents of its memory, because it must retain data such as
programs, offsets, and parameters even while external power is not applied. If the battery voltage drops, a low
battery voltage alarm is displayed on the machine operator’s panel or screen. When a low battery voltage
alarm is displayed, replace the batteries within a week. Otherwise, the contents of the CNC’s memory will be
lost. Refer to the maintenance section of the operator’s manual for details of the battery replacement
procedure.
VI
2. Absolute pulse coder battery replacement
When replacing the memory backup batteries, keep the power to the machine (CNC) turned on,
and apply an emergency stop to the machine. Because this work is performed with the power
on and the cabinet open, only those personnel who have received approved safety and
maintenance training may perform this work. When replacing the batteries, be careful not to touch the high–
voltage circuits (marked and fitted with an insulating cover). Touching the uncovered high–voltage circuits
presents an extremely dangerous electric shock hazard.
NOTE:The absolute pulse coder uses batteries to preserve its absolute position. If the battery voltage drops, a
low battery voltage alarm is displayed on the machine operator’s panel or screen. When a low battery voltage
alarm is displayed, replace the batteries within a week. Otherwise, the absolute position data held by the pulse
coder will be lost.
3. Fuse replacement
For some units, the chapter covering daily maintenance in the operator’s manual or programming manual
describes the fuse replacement procedure.
Before replacing a blown fuse, however, it is necessary to locate and remove the cause of the
blown fuse. For this reason, only those personnel who have received approved safety and maintenance
training may perform this work.
When replacing a fuse with the cabinet open, be careful not to touch the high–voltage circuits
(marked and fitted with an insulating cover).
Touching an uncovered high–voltage circuit presents an extremely dangerous electric shock
hazard.
VII
-Shenzhen Guanhong Automation Co.,Ltd.- SZGH-CNC1000GDb Series [Book1]
CONTENTS
SAFETY PRECAUTIONS.......................................................................................................................................II
Chapter 1 Preface................................................................................................................................................... 1
1.1 Characteristics................................................................................................................................................3
Chapter 2 Programming........................................................................................................................................ 7
2.1.5 Interpolation......................................................................................................................................11
Chapter 3 G INSTRCUTIONS........................................................................................................................... 19
3.1 INTRODUCTION....................................................................................................................................... 19
VIII
-Shenzhen Guanhong Automation Co.,Ltd.- SZGH-CNC1000GDb Series[Book1]
Chapter 4 M INSTRCUTIONS..............................................................................................................................64
4.3.1.3 Coolant(M08/M09)................................................................................................................68
4.3.1.4 Lubricate(M32/M33).............................................................................................................69
4.3.1.5 Chuck(M10/M11).................................................................................................................. 69
4.3.1.6 Tailstock(M79/M78)..............................................................................................................69
XI
-Shenzhen Guanhong Automation Co.,Ltd.- SZGH-CNC1000GDb Series[Book1]
Chapter 1 Preface
SZGH-CNC1000GDb series surface/cylindrical grinding CNC system is developed by
Shenzhen Guanhong Automation Co.,Ltd(SZGH). It is a product of new type that with embedded
ARM+DSP control ,FPGA technology, LCD and complete keyboard panel.
SZGH-CNC1000GDb adopt 8.4 inch real color LCD displayer, real-time & high-speed
control, 5MHz pulses output frequency,128MB flash memory, configured with A/B/C type
operational panel. Programming codes accord with international standard CNC language - ISO
code part program that includes standard G codes and M codes. It is embedded with PLC software,
and matches with the various servo drive units. The precision control and prompt reaches the level.
Display in μ m precision and control, with full screen program, simple operation, openness,
compact structure, convenient maintenance, high precision, reliability and expansibility, which
can be used as the multi-functional CNC system of grinding machine.
There is a more economical solution that configured with dual servo driver,SZGH-302.
Special hint:
This system has function to backup parameters. After debugging machine, it can backup all parameters
of machine & system and PLC documents to computer. It is convenient not only for mass debugging, but also
1. When use this system for the first time, please read carefully all the details of each chapter so as to
2. The functions which are related with 3rd ,4th,5th axis of system only exist in the controller that
3. The “Run” button on the panel of system can be used when debugging (No.9 parameter in other
parameter to set “Effective” “Invalid”), must plus an external “Run” button when fitting system, otherwise
may cause accident because of the life of button!!!So the system prohibits using the button for many times,
5. Before purchase, please confirm the type of grinding machine(Surface grinding machine or
Cylindrical grinding machine), different type grinding machine have different software version. There are
1
-Shenzhen Guanhong Automation Co.,Ltd.- SZGH-CNC1000GDb Series [Book1]
+C
+X
+Z
Note: according to coordinate system of surface grinding machine,and our cnc system only support X-axis
1.1 Characteristics
1) 800*600 8.4 inch real color LCD Display
2) Support Macro function , PLC function and ATC function
3) 128MB Memory , 100Mb user store room(Updated!)
4) 5MHz Pulse Output Frequency, Max speed is 300m/min(Updated!)
5) PLC On-line Display,Monitor & Design(Updated!)
6) High anti-jamming switch power(220VAC -> 24VDC & 5VDC)
7) Built-in plc programs, which can be edited freely.
8) With USB interface, for upgrade & copy programs
9) Display in English, which can be selected by parameter.
10) Analog voltage output of 0~10V in two channels, support double spindles
11) Adapted servo spindle can realize position,rigid tapping,threading of spindle
12) Basic I/Os : 56*32
13) Built-in screw compensation
14) English menu, program and interface, full screen edition
15) Support macro variable dialog box & Running program by input point (Updated!)
1.2 Technical Specifications
Max Number of control axes
• Number of control axes: 5 axes (X Z Y(C) A B)
• Number of linkage axes: 5 axes
• Number of PLC control axes: 5 axes
Feeding axes function
• Minimum command unit: 0.001mm
• Position command range: +/- 99999.999
• Max speed: 300m/minFeeding speed:0.001-15m/min
• G00 rapid override: Total 8 levels: 0~150%,real-time adjusting
• Feeding override: Total 16 levels: 0~150%,real-time adjusting
• Spindle override: Total 16 levels: 5%~150%,real-time adjusting
• Interpolation mode: Interpolation of linear ,arc ,thread and rigid tapping
• Auto chamfering
Thread
• Acceleration and deceleration funciton
• Common thread(follow the spindle) / Rigid thread
• Single-headed/Multi thread of straight ,taper and therminal suface in metric system/inch
system,wqual and variable pitch thread
• Thread retractin length ,angle and speed characteristics can be set
• Thread pitch:0.1~1000.000mm or 0.1~99 tooth/inch
• Rapid traverse: linear type or S type
• The starting speed,finishing speed and time of acceleration and deceleration are set by parameter
Spindle function
• Analog voltage 0~10V output in two channels ,support speed control for two spindles
• Spindle encoder feedback in one channel,resolution of spindle encoder can be set
3
-Shenzhen Guanhong Automation Co.,Ltd.- SZGH-CNC1000GDb Series [Book1]
• Spindle speed: It is set by speed parameter,max spindle speed also coressponding to 10V
• Spindle override: Total 16 levels: 5%~150%,real-time adjusting
• Spindle constant surface speed control
• Ragid tapping
Tool Function
•Tool length compensation
• tool nose radius compensation (C type)
• Tool wearing compensation
• Method of setting tools: Tool-setting in fixed position ,trial cutting tool -setting,auto tool setting
• Tool offset exexuting mode: Rewriting coordinate mode,tool traverse mode
Precision compensation
• Backlash compensation/Pitch error compensation in memory type
• Built-in Thread Compensation
PLC function
• Refresh cycle: 8ms
• PLC program can be altered on PC , download by USB interface
• I/Os : 56*32 I/Os
• Support On-line display,monitor & alter ladder
Man-machine interface
• 8.4'' large screen real-color LCD , the resolution is 480 000
• Display in Chinese or English
• Display in two-dimensional tool path
• Real-time clock
• Operation management
• Operate mode:Auto, Manual, MDI, mechanical zero return, MPG/single step
• Operation authority of multiple-level management
• Alarm record
Edit program
• Program capacity: 128M
• Editing function: program/block/characters research ,rewriting and deleting
• Program format: ISO code,support Macro command programming, programming of relative
coordinate ,absolute coordinate and hybrid coordinate
• Calling program: Support macro program ,subprogram
Community function
• RS232: Files of part program can be transmitted
• USB: File operationand file directly processing in flash disk,support PLC programs,flash disk of
software upgrade.
Safety function
• Emergency stop
• Hardware travel limit
• Software travel limit
• Data restoring and recovering
• User-defined alarm hint
4
-Shenzhen Guanhong Automation Co.,Ltd.- SZGH-CNC1000GDb Series[Book1]
6
-Shenzhen Guanhong Automation Co.,Ltd.- SZGH-CNC1000GDb Series[Book1]
Chapter 2 Programming
CNC machine tool is an electro-mechanical integrated product, composed of Numerical
Control Systems of Machine Tools, machines, electric control components, hydraulic components,
pneumatic components, lubricant, coolant and other subsystems (components), and CNC systems
of machine tools are control cores of CNC machine tools. CNC systems of machine tools are made
up of computerized numerical control(CNC), servo (stepper) motor drive devices, servo (or stepper)
motor and etc.
Software used for controlling SZGH-CNC1000GDb Turning Machine CNC system is divided
into system software (NC for short) and PLC software (PLC for short). NC system is used for
controlling display, communication, edit, decoding, interpolation and acceleration/deceleration, and
PLC system for controlling explanations, executions, inputs and outputs of ladder diagrams.
Programming is a course of workpiece contours, machining technologies, technology
parameters and tool parameters being edit into part programs according to special CNC
programming instructions.CNC machining is a course of CNC controlling a machine tool to
complete machining of workpiece according requirements of part programs. Technology flow of
CNC machining is as following:
7
-Shenzhen Guanhong Automation Co.,Ltd.- SZGH-CNC1000GDb Series [Book1]
8
-Shenzhen Guanhong Automation Co.,Ltd.- SZGH-CNC1000GDb Series[Book1]
The system considers the current coordinates of machine tool as zeroes and sets the machine
tool coordinate system according to the current position as the coordinate origin after having
executed return of machine reference point.
Note: Do not execute the machine reference point return without the reference point switch installed on the
machine tool , otherwise movement over limitation of stroke , and broke machine.
9
-Shenzhen Guanhong Automation Co.,Ltd.- SZGH-CNC1000GDb Series [Book1]
programming the distance from the current position of the tool to the zero point of the coordinate
system to be set.
10
-Shenzhen Guanhong Automation Co.,Ltd.- SZGH-CNC1000GDb Series[Book1]
2.1.5 Interpolation
The tool moves along straight lines and arcs constituting the workpiece parts figure.
Interpolation is defined as a planar or three dimensional contour formed by path of 2 or
multiple axes moving at the same time, also called Contour control. The controlled moving axis is
called link axis when the interpolation is executed. The moving distance, direction and speed of it
are controlled synchronously in the course of running to form the required complex motion path.
Fixed point control is defined that the motion path in the course of running are not controlled but
end point of one axis or multiple axes moving.
Linear Interpolation: Tool movement alone a straight line
Fig2.12 Tool movement along the straight line which is parallel to Z–axis
11
-Shenzhen Guanhong Automation Co.,Ltd.- SZGH-CNC1000GDb Series [Book1]
Feed Rates can be specified by using actual numerics. Eg.: F2.0 , which can be used to feed
the tool 2 mm while the workpiece makes one turn.
The function of deciding the feed rate is called the feed function.
2.1.6 Absolute Programming & Incremental Programming
Methods of command for moving the tool can be indicated by absolute or incremental
designation
Absolute command: The tool moves to a point at “the distance from zero point of the coordinate
system” that is to the position of the coordinate values.
12
-Shenzhen Guanhong Automation Co.,Ltd.- SZGH-CNC1000GDb Series[Book1]
13
-Shenzhen Guanhong Automation Co.,Ltd.- SZGH-CNC1000GDb Series [Book1]
When using diameter programming, note the conditions listed in the table in the following,
Item Notes
X axis command Specified with a diameter value
Incremental command Specified with a diameter value
In the above figure, specifies D2 minus D1 for tool
path B to A of Fig2.14.
Coordinate system setting (G50) Specifies a coordinate value with a diameter value
Component of tool offset value P16 in User Parameter determines either diameter
or radius value
Parameters in canned cycle, such Specifies a radius value
as cutting depth along X axis. (R)
Radius designation in circular interpolation Specifies a radius value
(R, I, K, and etc.)
Feedrate along axis Specifies change of radius/rev. or change
of radius/min.
Display of axis position Displayed as diameter value
2.1.8 Cutting Speed & Spindle Speed
The speed of the tool with respect to the workpiece when the workpiece is cut is called the
cutting speed.
As for the CNC Machine, the cutting speed can be specified by the spindle speed in min – 1
unit.
14
-Shenzhen Guanhong Automation Co.,Ltd.- SZGH-CNC1000GDb Series[Book1]
15
-Shenzhen Guanhong Automation Co.,Ltd.- SZGH-CNC1000GDb Series [Book1]
the program, and a program end code (M02 or M30) is specified at the end of the program.
See the general structure of program as follows:
Explanation of
Program Name program
Word is the basic instruction unit to command CNC system to complete the control
function,composed of an English letter (called instruction address) and the following number
(operation instruction with/without sign). The instruction address describes the meaning of its
following operation instruction and there may be different meaning in the same instruction address
when the different words are combined together. Table 2-1 is Word List of SZGH-CNC1000GDb
system.
Table 2-1 Word List
Address Data range Functions
N 00000~9999 Block number
G 00~99 Preparatory function
100~150 User-defined G macro function
M 00~99 Auxiliary function output
T 01-99 Tool function
S 0-99999(rpm) Specify Speed of 1st Spindle
SS 0-99999(rpm) Specify Speed of 2nd Spindle
0.01-15000mm/min Feedrate per minute
F 0.001-500mm/r Feedrate per rev
0.1~1000mm Thread Lead in Metric
X ±99999.999mm Coordinates in X directtion
0~9999.999(s) Dwell time
±99999.999mm Increment in X directtion
U Finish allowance in X direction in G71,G72,G73
Cutting depth in G71
Moving distance of tool retraction in X direction in G73
Z ±99999.999mm Coordinates in Z directtion
±99999.999mm Increment in Z directtion
W Finish allowance in Z direction in G71,G72,G73
16
-Shenzhen Guanhong Automation Co.,Ltd.- SZGH-CNC1000GDb Series[Book1]
17
-Shenzhen Guanhong Automation Co.,Ltd.- SZGH-CNC1000GDb Series [Book1]
18
-Shenzhen Guanhong Automation Co.,Ltd.- SZGH-CNC1000GDb Series[Book1]
Chapter 3 G INSTRCUTIONS
3.1 INTRODUCTION
G instruction consists of instruction address G and its following 1~2 bits instruction value,
used for defining the motion mode of tool relative to the workpiece, defining the coordinates and so
on. Refer to G instructions as Table 3.
G
Instruction value(00~99,the leading zero can be omitted)
Instruction address G
A number of following address G determines the meaning of the comand for the concerned
block.
G codes are divided into the following two types
Type Meaning
One-shot G code The G code is effective only in the block in which it is specified
Modal G code The G code is effective unti another G code of the same group
is specified.
Eg.: G01 and G00 are modal G codes.
21
-Shenzhen Guanhong Automation Co.,Ltd.- SZGH-CNC1000GDb Series [Book1]
Either of the following tool paths can be selected according to P9_D6 (Bit 6 of No.9 parameter)
in Other parameter.
Nonlinear interpolation positioning
The tool is positioned with the rapid traverse rate for each axis separately. The tool path is
normally straight.
Linear interpolation positioning
The tool path is the same as in linear interpolation (G01). The tool is positioned within the
shortest possible time at a speed that is not more than the rapid traverse rate for each axis. However,
the tool path is not the same as in linear interpolation (G01).
Example:
<Diameter Programming>
G00 X40.0 Z56.0 ; (Absolute command)
G00 U-60.0 W-30.5 ; (Incremental command)
G00 U-60.0 Z56.0 ; (Compound programming)
G00 X40.0 W-30.5 ; (Compound programming)
22
-Shenzhen Guanhong Automation Co.,Ltd.- SZGH-CNC1000GDb Series[Book1]
23
-Shenzhen Guanhong Automation Co.,Ltd.- SZGH-CNC1000GDb Series [Book1]
Code Description
G17 Specification of arc on XpYp plane
G18 Specification of arc on ZpXp plane(Default)
G19 Specification of arc on YpZp plane
G02 Circular Interpolation Clockwise direction (CW)
G03 Circular Interpolation Counterclockwise direction (CCW)
X/Z/Y Position of end point in workpiece coordinate
U/W/V Distance from start point to end point
I X axis distance from start point to center of an arc with sign(radius value)
K Z axis distance from start point to center of an arc with sign(radius value)
J Y axis distance from start point to center of an arc with sign(radius value)
R Arc radius without sign (always with radius value)
F Feedrate along the arc
Note: G18 is default set , which can be omitted.
Direction of circular interpolation: When turret in different position of grinding machine,
Front toolpost system & Rear toolpost system , the direction of G02&G03 is opposite in these two
system.
25
-Shenzhen Guanhong Automation Co.,Ltd.- SZGH-CNC1000GDb Series [Book1]
<Diameter Programming>
G02 X50.0 Z30.0 I25.0 F0.3
G02 U20.0 W-20.0 I25.0 F0.3
G02 X50.0 Z30.0 R25.0 F0.3
G02 U20.0 W-20.0 R25.0 F0.3
26
-Shenzhen Guanhong Automation Co.,Ltd.- SZGH-CNC1000GDb Series[Book1]
27
-Shenzhen Guanhong Automation Co.,Ltd.- SZGH-CNC1000GDb Series [Book1]
28
-Shenzhen Guanhong Automation Co.,Ltd.- SZGH-CNC1000GDb Series[Book1]
29
-Shenzhen Guanhong Automation Co.,Ltd.- SZGH-CNC1000GDb Series [Book1]
30
-Shenzhen Guanhong Automation Co.,Ltd.- SZGH-CNC1000GDb Series[Book1]
31
-Shenzhen Guanhong Automation Co.,Ltd.- SZGH-CNC1000GDb Series [Book1]
By specifying a G code from G54 to G59, one of the workpiece coordinate systems 1 to 6 can
be selected.
G54 Workpiece coordinate system 1
G55 Workpiece coordinate system 2
G56 Workpiece coordinate system 3
G57 Workpiece coordinate system 4
G58 Workpiece coordinate system 5
G59 Workpiece coordinate system 6
Workpiece coordinate system 1 to 6 are established after reference position return after the
power is turned on.
33
-Shenzhen Guanhong Automation Co.,Ltd.- SZGH-CNC1000GDb Series [Book1]
34
-Shenzhen Guanhong Automation Co.,Ltd.- SZGH-CNC1000GDb Series[Book1]
35
-Shenzhen Guanhong Automation Co.,Ltd.- SZGH-CNC1000GDb Series [Book1]
Fig3.17.1 Relation between workpiece radius, spindle speed and surface speed
To execute the constant surface speed control, it is necessary to set a workpiece coordinate
system , Z axis, (axis to which the constant surface speed control applies) becomes zero.
Fig3.17.2 Example of the workpiece coordinate system for constant surface speed control
The constant surface speed control is also effective during threading. Accordingly, it is
recommended that the constant surface speed control be invalidated with G97 command before
starting the scroll threading and taper threading, because the response problem in the servo system
may not be considered when the spindle speed changes.
In a rapid traverse block specified by G00, the constant surface speed control is not made by
calculating the surface speed to a transient change of the tool position, but is made by calculating
36
-Shenzhen Guanhong Automation Co.,Ltd.- SZGH-CNC1000GDb Series[Book1]
the surface speed based on the position at the end point of the rapid traverse block, on the condition
that cutting is not executed at rapid traverse.
Example1:
N8 G00 X1000.0Z1400.0 ;
N9 T33;
N11 X400.0Z1050.0;
N12 G50S3000 ; (Designation
of max. spindle speed)
N13 G96S200 ; (Surface speed
200m/min)
N14 G01 Z 700.0F1000 ;
N15 X600.0Z 400.0;
N16 Z … ;
N1 T0102 X40 Z5
Example2:
N2 M03 S400
N3 G96 S80
N4 G00 X0
N5 G01 Z0 F60
N6 G03 U24 W-24 R15
N7 G02 X26 Z-31 R5
N8 G01 Z-40
N9 X40 Z5
N10 G97 S300
N11 M30
Fig3.17.4 Example2
37
-Shenzhen Guanhong Automation Co.,Ltd.- SZGH-CNC1000GDb Series [Book1]
38
-Shenzhen Guanhong Automation Co.,Ltd.- SZGH-CNC1000GDb Series[Book1]
39
-Shenzhen Guanhong Automation Co.,Ltd.- SZGH-CNC1000GDb Series [Book1]
40
-Shenzhen Guanhong Automation Co.,Ltd.- SZGH-CNC1000GDb Series[Book1]
41
-Shenzhen Guanhong Automation Co.,Ltd.- SZGH-CNC1000GDb Series [Book1]
42
-Shenzhen Guanhong Automation Co.,Ltd.- SZGH-CNC1000GDb Series[Book1]
Fig3.24.3 Tool movement when the workpiece position does not change
43
-Shenzhen Guanhong Automation Co.,Ltd.- SZGH-CNC1000GDb Series [Book1]
The workpiece position against the toll changes at the corner of the programmed path as shown
in the following figure.
Fig3.24.5 Start-Up
The block in which the mode changes to G40 from G41 or G42 is called the offset cancel
block.
G41 _ ;
G40 _ ; (Offset cancel block)
The tool nose center moves to a position vertical to the programmed path in the block before
the cancel block. The tool is positioned at the end position in the offset cancel block (G40) as
shown below.
44
-Shenzhen Guanhong Automation Co.,Ltd.- SZGH-CNC1000GDb Series[Book1]
When is specified again in G41/G42 mode , the tool nose center is positioned vertical to the
programmed path of the preceding block at the end position of the preceding block.
Fig3.24.8 Tool movement when the moving direction of the tool in a block
The workpiece position specified by addresses I and K is the same as that in the preceding
block. If I and/or K is specified with G40 in the cancel mode, the I and/or K is ignored.
G40 X_ Z_ I_ K_; Tool nose radius compensation
G40 G02 X_ Z_ I_ K_; Circular interpolation
G40 G01 X_ Z_ ;
G40 G01 X_ Z_ I_ K_ ; Offset cancel mode (I and k are ineffective.)
The numeral s followed I and K should always be specified as radius values.
Example
(G40 mode)
1.G42 G00 X60.0 ;
2.G01 X120.0 W–150.0 F10 ;
3.G40 G00 X300.0 W150.0
I40.0 K–30.0 ;
45
-Shenzhen Guanhong Automation Co.,Ltd.- SZGH-CNC1000GDb Series [Book1]
Tool nose radius compensation with G90 (outer diameter/internal diameter cutting cycle) or
G94 (end face turning cycle) is as follows, :
1. Motion for imaginary tool nose numbers
For each path in the cycle, the tool nose center path is generally parallel to the programmed
path.
46
-Shenzhen Guanhong Automation Co.,Ltd.- SZGH-CNC1000GDb Series[Book1]
47
-Shenzhen Guanhong Automation Co.,Ltd.- SZGH-CNC1000GDb Series [Book1]
(b) Tool movement around the outside of a corner at obtuse angle (90≤α<180)
Linear Linear (B type) Linear Circular (B type)
48
-Shenzhen Guanhong Automation Co.,Ltd.- SZGH-CNC1000GDb Series[Book1]
d)Tool movement around the outside linear→linear at an acute angle less than 1 degree ( α
<1º)
(b)Tool movement around the inside (α<1º) with an abnormally long vector, linear →
linear
49
-Shenzhen Guanhong Automation Co.,Ltd.- SZGH-CNC1000GDb Series [Book1]
50
-Shenzhen Guanhong Automation Co.,Ltd.- SZGH-CNC1000GDb Series[Book1]
(d) Tool movement around the outside linear→linear at an acute angle less
than 1 degree(α<1º)
51
-Shenzhen Guanhong Automation Co.,Ltd.- SZGH-CNC1000GDb Series [Book1]
P41 in Speed is set for A type , B type and other type for Tool Nose Radius Compensation of
Offset C.
52
-Shenzhen Guanhong Automation Co.,Ltd.- SZGH-CNC1000GDb Series[Book1]
Automatical Smoothing
G01(G00) X(U)_ R_ ;
G01(G00) Z(W)_ Automatical Smoothing
G01(G00) Z(W)_ R_;
G01(G00) X(U)_ Automatical Smoothing
Note:
1.The address of I and R are specified with radius model. The running distance of this line and the next
line must be greater than the length of beveling or radius of smoothing, otherwise the system will decrease the
length of beveling or radius of smoothing to minimal running distance of this line and the next line
automatically.
2. The two adjacent lines must be 90 degrees.
For example:
0 G54 G0 X-50 Y-50 Z20
N1 M03 S500
N2 G01 G42 D01 X0 Y0 F200
N3 G01 Z-5
N4 X100 I4 ;Beveling4x4
N5 Y40 R6 ;SmoothingR6
N6 X47 R5 ;SmoothingR5
N7 Y70 I3 ;Beveling3x3
N8 X15
N9 X0 Y40
N10 Y0
N11 G0 X-50 Y-50 G40
N12 Z50
N13 M30
53
-Shenzhen Guanhong Automation Co.,Ltd.- SZGH-CNC1000GDb Series [Book1]
Example:
G0 X10 Y28 Z10
G06 X30 Y98 Z10 I5 J-6 K-5 F100
X130 Y198 Z120 I55 J-86 K-65
G0 X0 Z0
M02
54
-Shenzhen Guanhong Automation Co.,Ltd.- SZGH-CNC1000GDb Series[Book1]
G00 X0 Z0
G66 P6000 L2 A5 B6
A8 B1
A9 B10
G67
M30
Macro Program: 6000
N1 #2=#0+#1
N2 IF (#2 EQ 10) GOTO 4
N3 G00 X#2
N4 G00 Z#1
N5 M99 ; Return
3.25.3 Macro Program Instruction
3.25.3.1 Input Instruction: WAT
Waiting for the input port X valid or invalid instruction
Format: WAT+ (-) X
Attention: "+" to means the input is effective;
"-" means the input is invalid;
"X" means the input port X00-X55; see the I/O diagnosis;
3.25.3.2 Output Instruction: OUT
Set the output port Y is valid or invalid instruction
Format: OUT +(-)Y
Attention: "+" means the output is effective;
"-" means the output is invalid;
"Y" means the output port Y00-Y31; see the I/O diagnosis;
3.25.3.3 Assignment Instruction: =
Explanation: used for assignment of a variable
Eg.: #251=890.34 #450=#123
And also it could be mathematical expression , eg.: #440=#234+#470
3.25.3.4 Unconditional Jump: GOTO n
“GOTO n” is the command that for jump to the program line that is specified by sequence
number (N**) unconditionally. n is the sequence number.
E.g.: GOTO 5 ; // Jump to N5 program line.
Note: when specified program line , n , is beyond sequence number of N1-N99999, cnc system will hint
error.
n , program line,could be macro variable (#**)
E.g.: GOTO #100
3.25.3.5 Conditional Jump
1) IF (Conditional express) GOTO n
If condition is met, execute GOTO n ,jump to N** program line; if the condition isnot met,
execute the next segment.
Example: N1 IF(#200 EQ 1) GOTO 20
N10 G00 X0
N20 G00 Z0
56
-Shenzhen Guanhong Automation Co.,Ltd.- SZGH-CNC1000GDb Series[Book1]
Explanation: If #200 is equal to 1, system will execute GOTO 20 , jump to N20 , and execute
“G00 Z0”, if #200 isn’t equal to 1, system don’t execute operation of “GOTO 20” ,and will
execute next segments , “G00 X0”,and then execute “G00 Z0”.
2) IF (Conditional express) THEN <A Expression>
<B opertional segment>
If condition is met, system execute A expression , and then execute B operational segment ; if
condition is not meet, execute the next segment , B operation.
Example: #101=0
N1 IF(#100 EQ 1) THEN #101=1
N2 IF(#101 EQ 1) GOTO 4
N3 G00 X100
N4 G00 Z100
Explanation: If #100 is equal to 1, system will execute “#100=1”, and then judge #101 is equal
to 1 , jump to N4 & “execute G00 Z100” ; if #100 isn’t equal to 1, system will judge #101 also isn’t
equal to 1 directly , and execute “G00 X100” & “G00 Z100”.
NOTE: 1.<A expression> normally is assignment statement.
2. <A expression> after THEN must exist, otherwise system will hint grammatical errors.
Prolongation:
3) IF(conditional express)
<A operational command>
ELSE
<B operational command>
ENDIF
4) IF(conditional express)
<A operational command>
ELIF
<B operational command>
ENDIF
3.25.3.6 Loop Command
Format: (Conditions Initialization)
WHILE (conditional expression) DO n
<A operational segments>
[Alter condition of loop]
END n
<B operational segments>
When conditions are met during WHILE cycle command, execute the operational segments
between DO n and END n . Otherwise,when condition isnot met, jump to the program line after
END n ,also execute B operational segments.
We can nest for loops by placing one loop within another.
Note: 1.There must have operational codes that are for change condition at operational segments ,which is
between Do n & END n. Otherwise system will enter endless loop.
2.Nesting of macro program loop statements of SZGH CNC system is 3 pcs of loops at most . Also n
only could be 1 , 2 , 3 .
57
-Shenzhen Guanhong Automation Co.,Ltd.- SZGH-CNC1000GDb Series [Book1]
58
-Shenzhen Guanhong Automation Co.,Ltd.- SZGH-CNC1000GDb Series[Book1]
operation, when power is off, the local variables are initialized to the empty. The argument
assignment to the local variable when calling the macro program.
3.25.7 Global Variable
#21--#600 : Their meanings are the same in different macro program.
When power is off, the variable #21--#100 is initialized to zero, the variable #101--#600 data is
saved not to loss even if the power is off.
3.25.8 System Variable
#1000-- : the system variables are used to change various data when reading the running CNC.
For example, the current position and the compensation of tool.
Special Attention: macro variables #100--#155 and #190--#202 have been used by the system, users can not
use.
3.25.9 System Parameter Variable
#1001--#1099 : Value of X-axis length compensation for T1--T99(Unit: um)
#1101--#1199 : Value of D1 radius compensation for T1--T99(Unit: um)
#1201--#1299 : Value of Y(C)-axis length compensation for T1--T99(Unit: um)
#1301--#1399 : Value of D2 radius compensation for T1--T99(Unit: um)
#1401--#1499 : Value of Z-axis length compensation for T1--T99(Unit: um)
#1501--#1599 : Value of D3 radius compensation for T1--T99(Unit: um)
#1601--#1699 : Value of A-axis length compensation for T1--T99(Unit: um)
#1701--#1799 : Value of D4 radius compensation for T1--T99(Unit: um)
3.25.10 I/O variable
#1800: X00-X07 (D0-D7) ; input resistor
#1801: X08-X15 (D0-D7) ; input resistor
#1802: X16-X23 (D0-D7) ; input resistor
#1802: X16-X23 (D0-D7) ; input resistor
#1803: X24-X31 (D0-D70 ; input resistor
#1804: X32-X39 (D0-D7) ; input resistor
#1805: X40-X47 (D0-D7) ; input resistor
#1806: X60-X67 (D0-D7) ; input resistor
#1807: X74-X81 (D0-D7) ; Alarm of driver/Spindle
#1808: Y00-Y15 (D0-D15) ; output resistor
#1809: Y16-Y31 (D0-D15) ; output resistor
#1810: Y32-Y47 (D0-D15) ; output resistor
Waraning:
1. Macro variables #100-#155¾-#201 was occupied by system, user cannot use.
2. User cannot use G70,G71,G72,G73,G92,G76 etc loop command on Macro program.
Note: the address G, L, N, Q, P can’t be used as user-defined variables.
3.25.11 Message Hint Dialog Box
Format: MSG(hint words) or MSG[hint words] ;
Hint words is that user want to hint message on cnc system.
Note: 1. This code can be used on normal NC programs.
2. After hint message, cnc system will pause program automatically.
Format: STAF(hint words) or STAF[hint words];
Hints words is that user want to hint message on cnc system. And CNC system don’t pause
59
-Shenzhen Guanhong Automation Co.,Ltd.- SZGH-CNC1000GDb Series [Book1]
program automatically.
3.25.12 Build Processing Program Automatically
3.25.12.1 New/Open a program
Format: FILEON(Program) or FILEON[Program]
Example: FILEON(AABBCC) or FILEON[AABBCC]
It means that new or open a program “AABBCC”
3.25.12.2 Close program
Format: FILECE
It means that close current opening program, if without this code, system will close current
program after program is finished.
3.25.12.3 Write codes into program
Format: FILEWD(Blocks) or FILEWD[Blocks]
Exmaple: FILEWD(G54G0X0Z0) or FILEWD[G54G0X0Z0]
It means that write a blocks of “G54G0X0Z0” into current openning program.
3.25.12.4 Write current absolute coordiante into program
Format: FILEWC
It means that wirte current abolute coordiante value into program.
Example:
G0X0Z0
After finished this program, system will new a
FILEON[AABBCC]
program of “AABBCC” under directory of
FILEWD [G54G0X0Z0]
program, its blocks is :
G1X45Z89
G54G0X0Z0
FILEWC
X45Z89
G1X99Z76
X99Z76
FILEWC
FILECE
3.26 Complex function for Turning & Milling
CNC lahte system can finish milling processing, solutions is as follow:
1.Parameter sets: Name of 3rd axis should be set to “Y” axis, which is set by P101 in Axis
parameter; programming mode is radius programming.
2.Related commands: The Others are same except following commands:
Code Same functions in milling system Code Same functions in milling system
G990 G90 in milling system G981 G81 in milling system
G991 G91 in milling system G982 G82 in milling system
G994 G94 in milling system G983 G83 in milling system
G995 G95 in milling system G984 G84 in milling system
G998 G98 in milling system G985 G85 in milling system
G999 G99 in milling system G986 G86 in milling system
G973 G73 in milling system G987 G87 in milling system
G974 G74 in milling system G989 G89 in milling system
G976 G76 in milling system
Note: CNC grinding system have these functions when CNC system is confiured with 3rd axis.
60
-Shenzhen Guanhong Automation Co.,Ltd.- SZGH-CNC1000GDb Series[Book1]
Note: 1.When the power is turned on or the system is reset, polar coordinate interpolation is canceled (G13.1).
G12.1 & G13.1 are mode codes.
2.G codes which can be specified in the polar coordinate interpolation mode
G01: linear interpolation
G02,G03 : Circular interpolation
G04: Dwell
61
-Shenzhen Guanhong Automation Co.,Ltd.- SZGH-CNC1000GDb Series [Book1]
62
-Shenzhen Guanhong Automation Co.,Ltd.- SZGH-CNC1000GDb Series[Book1]
Example: Polar Coordinate Interpolation Program Based on X Axis (Linear Axis) and C Axis
(Rotary Axis)
N10 T0202
...
N100 G00 X150 C0 Z0 ; Positioning to start position
N200 G12.1 ; Start of polar coordiante interpolation
N201 G42 G01 X40.0 F20 ;
N202 C10 ;
N203 G03 X-20.0 C20.0 R10.0;
N204 G01 X-40.0;
Geometry program
N205 C-10.0;
(Program based on cartesian
N206 G03 X-40 C-20 R20 ;
coordiantes on X-C’ plane)
N207 G01 X40 ;
N208 G03 X80 C-20 R20 ;
N209 G01 C0 ;
N210 X150.0 ;
N300 G13.1; Cancellation of polar coordinate interpolation
N400 Z100.0 C0 ;
...
N500 M30 ;
63
-Shenzhen Guanhong Automation Co.,Ltd.- SZGH-CNC1000GDb Series [Book1]
Chapter 4 M INSTRCUTIONS
according to the main program. However, when a command calling a subprogram is encountered in
the main program, control is passed to the subprogram. When a command specifying a return to the
main program is encountered in a subprogram, control is returned to the main program.
65
-Shenzhen Guanhong Automation Co.,Ltd.- SZGH-CNC1000GDb Series [Book1]
Eg.:Execution sequence of subprograms called from a main program.A subprogram can call
another subprogram in the same way as a main program calls a subprogram.
66
-Shenzhen Guanhong Automation Co.,Ltd.- SZGH-CNC1000GDb Series[Book1]
check.
P10: To set feedback pulse numbers of spindle encoder turn a round, the value: Line number of
encoder * 4.
P11: Whether turn on the spindle or not when shifting [1 means on, 0 means off]
P51: The speed of motor when spindle shifting (unit: 1/100rpm)
P52: The direction when spindle shifting (0 means positive, 1means negative)
P53: The stopping time when spindle shifting (unit: 10ms)
P54: Turning time of low speed when spindle shifting (unit:10ms)
P55: Stopping delay time of spindle (Unit:10ms)
In Speed parameter:
P8: To set the speed of spindle at manual condition. Unit: rpm.
P36: To set the max speed of spindle, also the speed of corresponding 10V.
Attention: when spindle system is with gears,this is the speed of first gear.
P37: To set the max speed of spindle(second gear), that’s the turning speed of corresponding
10V instruction voltage.Unit: rpm.
P38: To set the max speed of spindle (Third gear), that’s the turning speed of corresponding
10V instruction voltage. Unit: rpm.
P39: To set the max speed of spindle (Fourth gear), that’s the turning speed of corresponding
10V instruction voltage. Unit: rpm.
P40: To set the highest speed of second spindle, also the speed of corresponding 10V. Unit:
r/min
In Other parameter:
P13: To set whether spindle and chuck is interlocking or not: 0 means they are separately; 1
means the spindle only start turning when chuck on. The thumbstall can’t be use when the spindle
is turning.
Setting parameter is related with the configuration of grinding and user’s service condition, but
consider for safe, suggest setting 1,also interlocking.
4.3.1.2 Spindle Gear Shifting(M41/M42/M43/M44)
Remark PIN Function Command
S01 PIN10_CN3 Plug Output 1st gear of spindle M41
S02 PIN23_CN3 Plug Output 2nd gear of spindle M42
S03 PIN11_CN3 Plug Output 3rd gear of spindle M43
S04 PIN24_CN3 Plug Output 4th gear of spindle M44
M41/M42/M43/M44 output S01/S02/S03/S04 for shifting gear of spindle , and adjust analog
voltage to adjust speed of spindle.
P36 in Speed parameter is set for max speed of 1st class spindle;
P37 in Speed parameter is set for max speed of 2nd class spindle;
P38 in Speed parameter is set for max speed of 3rd class spindle;
P39 in Speed parameter is set for max speed of 4th class spindle;
Note:Functions interlocked and states reserved
4.3.1.3 Coolant(M08/M09)
M08:Turn on coolant
M09: Turn off coolant
Remark PIN Function
M08 PIN8_CN3 Plug Turn On/Off coolant
68
-Shenzhen Guanhong Automation Co.,Ltd.- SZGH-CNC1000GDb Series[Book1]
4.3.1.4 Lubricate(M32/M33)
M32: Turn on lubrication
M33: Turn off lubrication
Remark PIN Function
M32 PIN9_CN3 Plug Turn On/Off Lubrication
In Other parameter,
P4 controls the function of lubricate automatically.
P6 is set the interval time of lubrication (Unit: s);
P5 set the time of lubrication ,also holding time of output M32(Unit: 10ms).
4.3.1.5 Chuck(M10/M11)
M10/M11 are for control clamping/unclamping of chuck.
Remark PIN Function
M10 PIN21_CN3 Plug Control Chuck clamping
M71 PIN9_CN10 Plug Control chuck unclamping(Spare)
M12 PIN11_CN10 Plug Detect position of clamping_chuck(spare)
M14 PIN24_CN10 Plug Detect position of unclamping_chuck(Loose)(spare)
M16 PIN12_CN10 Plug Input point for switch to control chuck(spare)
Chuck of this system control is related with parameter as follows:
In Other parameter:
P2: Type of chuck, (Inner: Chuck to center when M10; Outer: Chuck opening outward when
M10). 1 means outer, 0 means inner.
P13: Interlock between Chuck & Rotation_Spindle.0: No interlock, 1: yes.
P15: Detect position of clamping/unclamping of chuck,0:No detect, 1: yes.
M12: input point for detecting position of clamping of chuck;
M14: input point for detecting position of unclamping of chuck.
P20: Type of controlling singal for chuck,0: one output controlling signal for chuck; 1: two
output controlling signals for chuck.
M10:output point for controlling clamping of chuck , controlling code is M10;
M71:output point for controlling unclamping of chuck,controlling code is M11.
P22: External Switch(Foot switch) for chuck, reciprocating mode, price one time clamping
chuck; press twice time, unclamping chuck. 0: without switch ; 1: with external switch for control
chuck; input signal is M16.
P24: Holding time of output M10/M71 of chuck, unit: s. 0: mode type*.
4.3.1.6 Tailstock(M79/M78)
M79: Tailstock forward
M78: Tailstock backward
Remark PIN Function
M79 PIN22_CN3 Plug Tailstock Forward/Backward
M73 PIN22_CN10 Plug Control chuck unclamping(Spare)
M18 PIN11_CN10 Plug Detect position of forward_Tailstock(spare)
M28 PIN24_CN10 Plug Detect position of backward_Tailstock(spare)
M14 PIN24_CN10 Plug Input point for switch to control Tailstock(spare)
Parameters set for tailstock,in Other parameter:
P16: Detect Position of Forward/Backward of Tailstock; 0: no detect,1:Yes;
M18: input point for detecting position of forward of tailstock;
69
-Shenzhen Guanhong Automation Co.,Ltd.- SZGH-CNC1000GDb Series [Book1]
Example: M12
When Input point M12 is valid, program goes on run following blocks, if M12 is invalid,
system will wait if M12 is valid.
b) Conditional Jump
Example: M14 P0120
When the program running to this block and the system detecting if M14 input signal is valid.
When M14 is valid, program will jump to 120th line of program (also N0120 block), otherwise ,
system will execute the next block.
4.4 Analog Speed of Spindle(S , SS)
SZGH CNC system support dual analog outputs for SP_speed.
Speed of 1st spindle is set by “S**”; Speed of 2nd spindle is set by “SS**”.
P36 in Speed parameter is set for max speed of 1st spindle; P40 in Speed parameter is set for
max speed of 2nd spindle.
Note: D11_P9=1 in Other parameter is set for output 1st analog voltage to dual analog output(+10V of
CN3&CN10) at same time, without function of “SS**”.
There are two gears control ways for 1st spindle as following,
(1) Four gears spindle speed electrical control, output four bits code of step speed change,
M41-M44 control instructions correspondly output S01-S04 code, with fixed speed.
P50/P51/P52/P53/P54 in Axis parameter are set for mode of shifting.
(2) Four gears+Variable speed, M41-M44 instruction control, correspond the output S01-S04
code. P42/P43/P44/P45 in Speed parameter are set for maximum speed of corresponding gear,
P50/P51/P52/P53/P54 in Axis parameter are set for mode of shifting.
Variable speed,range is 0-99999, output 0-10V variable-frequency voltage.
Note: Output 10V is corresponding to max speed of spindle.
71
-Shenzhen Guanhong Automation Co.,Ltd.- SZGH-CNC1000GDb Series [Book1]
72
-Shenzhen Guanhong Automation Co.,Ltd.- SZGH-CNC1000GDb Series[Book1]
#98=#5001+#98
#99=#5002+#99
N1 WHILE[#86 GT 0] DO 1
#35=#98+#87*COS[#80]
#36=#99+#87*SIN[#80]
G81X#35Y#36Z#100R#92F#85
#80=#80+#81
#86=#86-1
END 1
G#30 G#31 G80
M99
Example: User-Defined Macro Program: M881 (ProgramUser1), which is used for spindle
orientation. And Position of spindle is controlled by C-axis.
M61,PIN19_CN10 plug, output for control spindle orientation
X27, Detection of spindle orientation finished
STATUSINFO(Orientation of SP_Servo(C)!);
OUT-M53-M54
PAUS100
OUT+M59+M58
WAT+X27
OUT-M59
SETMH(C0)
RETURN;
73
-Shenzhen Guanhong Automation Co.,Ltd.- SZGH-CNC1000GDb Series [Book1]
74
-Shenzhen Guanhong Automation Co.,Ltd.- SZGH-CNC1000GDb Series[Book1]
76