twincat nc flying saw - siemens · diagonal slave axes 4 twincat example program installing and...

13
® Total Windows Control and Automation Technology Flying Saw Diagonal Slave Axes Version: 1.01 Last change: 19.01.00

Upload: haxuyen

Post on 07-Jul-2018

236 views

Category:

Documents


5 download

TRANSCRIPT

Page 1: TwinCAT NC Flying Saw - Siemens · Diagonal slave axes 4 TWINCAT Example program Installing and running ... Process flow in sequence The Sequence function block controls the sequence

®

Total Windows Control and Automation Technology

Flying SawDiagonal Slave Axes

Version: 1.01Last change: 19.01.00

Page 2: TwinCAT NC Flying Saw - Siemens · Diagonal slave axes 4 TWINCAT Example program Installing and running ... Process flow in sequence The Sequence function block controls the sequence
Page 3: TwinCAT NC Flying Saw - Siemens · Diagonal slave axes 4 TWINCAT Example program Installing and running ... Process flow in sequence The Sequence function block controls the sequence

Eiserstraße 5 / D-33415 Verl / Telephone 05246/963-0 / Fax 05246/963-149

Table of contents 2

TWINCAT

Table of Contents

1. Outline 3Introduction 3Flying Saw 3

2. Example program 4Installing and running 4Program structure 5Global variables 6Program modules 6

3. Flying Saw 8Parallel slave 8Diagonal slave 8Dynamic phases 8Term definitions 9Coupling position and synchronous position 10Reverse motion stop 10

4. Functions 11Axis coupling 11Slave stop 11

5. Appendix 12Literature 12

Page 4: TwinCAT NC Flying Saw - Siemens · Diagonal slave axes 4 TWINCAT Example program Installing and running ... Process flow in sequence The Sequence function block controls the sequence

Eiserstraße 5 / D-33415 Verl / Telephone 05246/963-0 / Fax 05246/963-149

3 Diagonal save axes

TWINCAT

Outline

IntroductionIn many plants workpieces undergo machining operations while beingtransported. This requires synchronisation of tools and workpieces so thatthe tool can be utilised as though the workpiece were stationary.

One example of such an application is a saw that during the transportprocess cuts through the material that is being transported (flying saw). Toimplement this and similar applications, TwinCAT provides Flying Saw.

Slave axes Slave axes are axes, whose set values are generated as functions of theset values of another axis. The simplest type of slave axis is the linearslave axis, that is coupled via a fixed transmission ratio (an electronicgearing system) to another axis (a master axis or another slave axis).

Diagonal slave axis In contrast to a linear slave axis the diagonal slave axis is brought from restinto “flying” synchronisation only as the traverse of the master axis takesplace, and is later decoupled once again without halting the master axis. Inthis procedure the slave axis moves at an angle of between 0° < Φ ≤ 90° tothe master axis.

Parallel slave-axis A special case of the diagonal slave axis is the parallel slave axis, forwhich the angle Φ is always 90°.

The present document describes Flying Saw with the aid of a PLCprogram, which is explained step by step.

Flying SawIf an axis is to be operated as a diagonal slave axis, following steps arenecessary:

• The slave axis is coupled to the master axis using a specification of amaster and slave synchronous position. The slave axis then starts upand synchronises with the master axis.

• The slave axis is halted after the machining operation using a specialstop function.

• The slave axis is decoupled from the master axis.• The slave axis is driven as an independent PTP axis back to its base

position so that a new machining operation can begin.

Page 5: TwinCAT NC Flying Saw - Siemens · Diagonal slave axes 4 TWINCAT Example program Installing and running ... Process flow in sequence The Sequence function block controls the sequence

Eiserstraße 5 / D-33415 Verl / Telephone 05246/963-0 / Fax 05246/963-149

Diagonal slave axes 4

TWINCAT

Example programInstalling and running

Outline The example program firstly starts a master axis. Subsequently a diagonalslave axis is coupled to it cyclically and after an imaginary machiningoperation is decoupled once again.

System Manager The example program uses simulation axes (axes with simulatedencoders), and can thus be run on any Windows NT PC without additionalhardware. The file Fliegende Säge.wsm (Flying saw.wsm) is loaded intothe TwinCAT System Manager, and the system is started with this setting.

TwinCAT Scope View TwinCAT Scope is used in order to be able to examine the result. Thesupplied setting, Fliegende Säge.scp (Flying saw.scp), allows the axismovements to be recorded.

PLC-Control The example program FliegendeSaege.pro is loaded into TwinCAT PLCControl, compiled and started.

Page 6: TwinCAT NC Flying Saw - Siemens · Diagonal slave axes 4 TWINCAT Example program Installing and running ... Process flow in sequence The Sequence function block controls the sequence

Eiserstraße 5 / D-33415 Verl / Telephone 05246/963-0 / Fax 05246/963-149

5 Diagonal save axes

TWINCAT

Program structureProgram structure

MAIN The Main module calls the NC and Sequence blocks. The NC block, withits dependent blocks in the NC Modules directory, activates all thenecessary enable signals for the axes, and will not be described in anymore detail at this point.

Sequence The Sequence program module controls the operating sequence of thediagonal slave axis.

Page 7: TwinCAT NC Flying Saw - Siemens · Diagonal slave axes 4 TWINCAT Example program Installing and running ... Process flow in sequence The Sequence function block controls the sequence

Eiserstraße 5 / D-33415 Verl / Telephone 05246/963-0 / Fax 05246/963-149

Diagonal slave axes 6

TWINCAT

Global variables

The axis interfaces between PLC and NC are declared in the globalvariables.

Program modules“Sequence” function block

Process flow in sequence The Sequence function block controls the sequence of events.

• The step StepStartMaster starts up the master axis in an endlessoperation that e.g. simulates a feed chain on a machine line.

• In the next step StepCoupleSlave the slave axis is coupled to themaster axis by specification of the master synchronous position.Coupling occurs shortly before this position is attained, to enablesynchronisation of the NC.

• After an imaginary machining operation the slave axis is halted in thestep StepStopSlave. This occurs using a special stop function, sincethe halting of a coupled slave axis is only allowed in the special case ofthe diagonal slave axis.

• When the slave axis is stationary, it is decoupled from the master axisin the step StepDecoupleSlave.

• In StepReturnSlave the slave axis is now driven back as anindependent PTP axis to its initial position.

• Subsequently the machining operation cycle starts again from thebeginning.

Page 8: TwinCAT NC Flying Saw - Siemens · Diagonal slave axes 4 TWINCAT Example program Installing and running ... Process flow in sequence The Sequence function block controls the sequence

Eiserstraße 5 / D-33415 Verl / Telephone 05246/963-0 / Fax 05246/963-149

7 Diagonal save axes

TWINCAT

Function BlockSequence

Page 9: TwinCAT NC Flying Saw - Siemens · Diagonal slave axes 4 TWINCAT Example program Installing and running ... Process flow in sequence The Sequence function block controls the sequence

Eiserstraße 5 / D-33415 Verl / Telephone 05246/963-0 / Fax 05246/963-149

Diagonal slave axes 8

TWINCAT

Flying SawParallel slaveA parallel slave is an axis that is synchronised from rest with a master axisthat is travelling with a constant velocity vm. In this procedure thesynchronous velocity vs is attained at a previously defined synchronisationpoint (master and slave position).

Diagonal slaveA diagonal slave axis is synchronised, like a parallel slave axis, with atravelling master axis. However the movement of the slave axis is diagonal tothe movement of the master at an angle 0° < Φ ≤ 90°. This means that thediagonal slave is faster than a parallel slave when it attains thesynchronisation point. The velocity can be calculated as a function of anglevs = vm / sin(Φ). In the case of a parallel slave the angle Φ = 90°.

“Flying saw” A simple example is a saw that has to cut diagonally through the workpieceas the material traverses. In this connection the expression “flying saw” hascome into use as a synonym for the diagonal slave.

Dynamic phasesAfter the coupling of a diagonal slave axis to a master axis five dynamicphases are sequenced in the NC:

1. Waiting phase:The slave axis remains at its base position until it is coupled to themaster axis.

2. Acceleration phase:The slave axis is accelerated from rest to the synchronous velocityvs = vm / sin(Φ). The velocity is attained precisely at the definedsynchronisation point.

3. Constant travel phase:The slave travels at the synchronous velocity until it is halted.

4. Braking phase:The slave is dynamically decoupled from the master by means of a stopcommand and brakes until vs = 0.

5. Standing phase:As soon as the slave is stationary, it can also be logically decoupled fromthe master and then driven back as an independent PTP axis to its baseposition.

For the achievement of phases 2 and 4 a 3 phase jerk-restricted algorithm isused. Phases 2 and 3 are configured as linear path control elements.

Page 10: TwinCAT NC Flying Saw - Siemens · Diagonal slave axes 4 TWINCAT Example program Installing and running ... Process flow in sequence The Sequence function block controls the sequence

Eiserstraße 5 / D-33415 Verl / Telephone 05246/963-0 / Fax 05246/963-149

9 Diagonal save axes

TWINCAT

Jerk-restricted 3 phasealgorithm

Term definitionspMsync, pSsync The master synchronous position pMsync is the required position from which

the slave travels synchronously with the master (the beginning of theconstant travel phase). At the synchronisation point the slave has attainedthe required position pSsync.

pMcl, pSscl The PLC program couples the slave at the logical coupling position pMcl tothe master. During this process the slave remains at the position pSscl that isthe same as its base position.

pMcd, pSscd The dynamic coupling position is attained after the logical coupling positionand is calculated by the NC from the prescribed synchronisation position.Since the slave does not move until the dynamic coupling position is attainedpSscl = pSscd.

Page 11: TwinCAT NC Flying Saw - Siemens · Diagonal slave axes 4 TWINCAT Example program Installing and running ... Process flow in sequence The Sequence function block controls the sequence

Eiserstraße 5 / D-33415 Verl / Telephone 05246/963-0 / Fax 05246/963-149

Diagonal slave axes 10

TWINCAT

Coupling position and synchronous positionSo that the slave axis can attain its synchronous velocity precisely at thesynchronisation point pMsync, it must be coupled to the master axis ahead ofthe synchronisation point. Timewise the acceleration phase for the slave liesbetween the master coupling position pMcd and the master synchronisationposition pMsync. In the algorithm used there is a simple relationship betweenthe slave acceleration distance and the “master acceleration distance”, inother words, the distance that the master covers while the slave isaccelerating.

pSsync – pScd = 0.5 * pMsync – pMcd / sin(Φ)

In a PLC program the slave axis is usually coupled to the master axis bymeans of a coupling command. In order to avoid inaccuracies caused by thePLC cycle time, the slave is actually coupled logically ahead of the dynamiccoupling position pMcd. The PLC couples the slave axis at the position pMclusing a specification of the synchronisation point and angle Φ. The dynamiccoupling point is calculated in the NC from the master and slavesynchronisation point. If the above condition cannot be fulfilled, the couplingprocess is interrupted with an error message.

Reverse motion stopAfter coupling a slave axis is synchronised with the master axis. This alsomeans that if the master axis reverses the direction of the slave reverses aswell. Normally the travel path of the slave axis is mechanically constrained. Areverse motion stop is therefore always active, to ensure that the slave axisis not reversed backward beyond its base position.

Page 12: TwinCAT NC Flying Saw - Siemens · Diagonal slave axes 4 TWINCAT Example program Installing and running ... Process flow in sequence The Sequence function block controls the sequence

Eiserstraße 5 / D-33415 Verl / Telephone 05246/963-0 / Fax 05246/963-149

11 Diagonal save axes

TWINCAT

FunctionsAxis couplingIn the PLC an axis is coupled to a master axis at the logical couplingposition using the coupling block AXCPL.

Via the input CPLMODE=3 axis 2 is coupled as a diagonal slave axis to themaster axis 1. The master synchronisation position, the slavesynchronisation position and the angle Φ in degrees are defined ascoupling parameters 1 to 3.

Slave stopWhen the slave axis has been synchronised with the master axis it remainscoupled during the constant travel phase, in a fixed relationship with themovement of the master, until it is halted. In this instance the halting of adependent slave axis is a special case that is otherwise not possible forslave axes. For this reason the normal command to stop an axis cannot beused. Similarly it is not possible to use the AXACT block for stopping, sinceit uses the same command.

The special axis function “Stop of Diagonal Slave” can be accessed viaADS by defining an index group (420016+Axis-ID) and an index offset 4416.

Page 13: TwinCAT NC Flying Saw - Siemens · Diagonal slave axes 4 TWINCAT Example program Installing and running ... Process flow in sequence The Sequence function block controls the sequence

Eiserstraße 5 / D-33415 Verl / Telephone 05246/963-0 / Fax 05246/963-149

Diagonal slave axes 12

TWINCAT

AppendixLiteratureTwinCAT ScopeView_e.doc

TwinCAT NC ErrorDoc_e.doc

TwinCAT ADS Error-description_e.doc

TwinCAT ADS-NC_e.doc