© 2013 spiiplus training class peg and mark 1. © 2013 what is peg? peg (position event generator)...

27
© 2013 SPiiPlus Training Class PEG and MARK 1

Upload: darrion-jolls

Post on 31-Mar-2015

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: © 2013 SPiiPlus Training Class PEG and MARK 1. © 2013 What is PEG? PEG (Position Event Generator) creates pulses based on exact feedback position. These

© 2013

SPiiPlus Training Class

PEG and MARK

1

Page 2: © 2013 SPiiPlus Training Class PEG and MARK 1. © 2013 What is PEG? PEG (Position Event Generator) creates pulses based on exact feedback position. These

© 2013

What is PEG?• PEG (Position Event Generator) creates pulses based on exact feedback

position. These events can be used as a trigger for external devices, such as a camera, laser, etc.

• A PEG pulse is generated in hardware (delay < 0.1 microsecond) by comparing actual encoder position with a set of predefined values

• Two different PEG modes:• Incremental PEG:

Pulse at fixed position increments• Random PEG:

Pulse at user-defined positions Update a 4-bit state vector at each position

2

Page 3: © 2013 SPiiPlus Training Class PEG and MARK 1. © 2013 What is PEG? PEG (Position Event Generator) creates pulses based on exact feedback position. These

© 2013

What is PEG?

• PEG accuracy: ±1 count up to 10M counts/sec (using a digital encoder)

• Three PEG engines per SPii

• PEG engine outputs can be assigned to 10 physical RS422 interface outputs

• PEG pulses can be sent in parallel through opto-isolated general purpose digital outputs, along with physical PEG outputs

• PEG pulse width and polarity are programmable

• Physical PEG outputs can be configured as RS422 general purpose outputs

3

Page 4: © 2013 SPiiPlus Training Class PEG and MARK 1. © 2013 What is PEG? PEG (Position Event Generator) creates pulses based on exact feedback position. These

© 2013

Incremental PEG Mode

• A pulse is generated at a predetermined start position followed by a stream of pulses a fixed distance apart until a predetermined end position is reached

4

3500

1000

6200

0.01

Start PEG position

Interval between PEG pulses

End PEG position

Pulse width PEG pulse fired atpositions:

3500, 4500, 5500

Stored data

MPU

Current encoderposition

Position compare output

SPii

Compare register

Incremental PEG

positioncalculation

Page 5: © 2013 SPiiPlus Training Class PEG and MARK 1. © 2013 What is PEG? PEG (Position Event Generator) creates pulses based on exact feedback position. These

© 2013

Incremental PEG Mode

o Maximum Incremental PEG pulse output frequency is 18 MHz.

o Maximum Incremental PEG edge separation is (1/18MHz) = 55.56 nSec.

o Pulse width range is 26.67 nSec to 1.745 mSec.

o Direction of motion should correspond to sign of Interval.

5

Page 6: © 2013 SPiiPlus Training Class PEG and MARK 1. © 2013 What is PEG? PEG (Position Event Generator) creates pulses based on exact feedback position. These

© 2013

How to use Incremental PEG

1. Use ASSIGNPEG to define which encoder PEG will use

2. Use ASSIGNPOUTS to define physical output pins PEG will use

3. Use PEG_I to set Incremental PEG

4. Wait for PEGREADY

5. Command motion to fire PEG pulses

6. (Optional) use STOPPEG to end PEG process before completion

6

Page 7: © 2013 SPiiPlus Training Class PEG and MARK 1. © 2013 What is PEG? PEG (Position Event Generator) creates pulses based on exact feedback position. These

© 2013

ASSIGNPEG• The ASSIGNPEG command is used for:

1. Defining which encoders PEG will use2. Configuration of digital outputs (for optional use as PEG signals)

• A single ASSIGNPEG command effects all three PEG engines and all four general purpose outputs on a servo processor

• ASSIGNPEG axis, engines_to_encoders_code, gp_out_assign_code

• axis: Used to identify the relevant servo processor• engines_to_encoders_code: Bit code for engines-to-encoders mapping• gp_out_assign_code: General purpose outputs assignment to use as PEG state and

PEG pulse outputs

• For relevant bit codes, refer to SPiiPlus NT PEG and MARK User Guide

7

Page 8: © 2013 SPiiPlus Training Class PEG and MARK 1. © 2013 What is PEG? PEG (Position Event Generator) creates pulses based on exact feedback position. These

© 2013

ASSIGNPEG Example 1• ASSIGNPEG 0, 0b000, 0b0000

• 0: Assign all three PEG engines on servo processor 0

• 0b000: The following assignments are all made: PEG engine 0 assigned to encoder 0 PEG engine 1 assigned to encoder 1 PEG engine 2 assigned to encoder 2

• 0b0000: The following assignments are all made: General purpose output 0 configured as general purpose output 0 General purpose output 1 configured as general purpose output 1 General purpose output 2 configured as general purpose output 2 General purpose output 3 configured as general purpose output 3

8

Page 9: © 2013 SPiiPlus Training Class PEG and MARK 1. © 2013 What is PEG? PEG (Position Event Generator) creates pulses based on exact feedback position. These

© 2013

ASSIGNPEG Example 2• ASSIGNPEG 5, 0b010, 0b0110

• 5: Assign all PEG engines on servo processor 1

• 0b010: The following assignments are all made: PEG engine 4 assigned to encoder 4 PEG engine 6 assigned to encoder 4 PEG engine 5 assigned to encoder 5

• 0b0110: The following assignments are all made: General purpose output 4 configured as PEG_Pulse(4) General purpose output 5 configured as general purpose output 5 General purpose output 6 configured as PEG_Pulse(5) General purpose output 7 configured as general purpose output 7

9

Page 10: © 2013 SPiiPlus Training Class PEG and MARK 1. © 2013 What is PEG? PEG (Position Event Generator) creates pulses based on exact feedback position. These

© 2013

ASSIGNPOUTS

• Physical PEG pins can be used for either PEG (default) or as additional general purpose outputs. The ASSIGNPOUTS command is used to configure these pins accordingly.

• ASSIGNPOUTS axis, output_index, bit_codeo axis: Used to identify the relevant servo processoro output_index: 0 for X_PEG pins, 1 for Y_PEG pins, etc.o bit_code: Bit code for pin designation as PEG or as general purpose

• For relevant bit codes, refer to SPiiPlus NT PEG and MARK User Guide

10

Page 11: © 2013 SPiiPlus Training Class PEG and MARK 1. © 2013 What is PEG? PEG (Position Event Generator) creates pulses based on exact feedback position. These

© 2013

ASSIGNPOUTS Examples• ASSIGNPOUTS 3, 1, 0b000

• 3: Pins corresponding to servo processor 0• 1: Y_PEG pins to be assigned• 0b000: Send PEG1_Pulse through Y_PEG pins

• ASSIGNPOUTS 4, 5, 0b111• 4: Pins corresponding to servo processor 1• 5: X_STATE0 pins to be assigned• 0b111: X_STATE0 set as general purpose out (OUT(1).20)

• ASSIGNPOUTS 4, 5, 0b010• 4: Pins corresponding to servo processor 1 • 5: X_STATE0 pins to be assigned• 0b010: PEG4_Pulse sent through X_STATE0 output

11

Page 12: © 2013 SPiiPlus Training Class PEG and MARK 1. © 2013 What is PEG? PEG (Position Event Generator) creates pulses based on exact feedback position. These

© 2013

Incremental PEGPEG_I Axis, Width, First Point, Interval, Last Point

12

Axis Encoder PEG is based on

Width Pulse width (ms). Range is 26.67ns to 1.745ms

First Point Position of first pulse in user units

Interval Distance between pulse points in user units

Last Point Position for last pulse in user units

Page 13: © 2013 SPiiPlus Training Class PEG and MARK 1. © 2013 What is PEG? PEG (Position Event Generator) creates pulses based on exact feedback position. These

© 2013

PEG_I X, 0.003, 1000, 1000, 3000

Encoder counts / User units1000 2000

0.003

First Pulse 1000 1000

3000

Last Pulse

Incremental PEG

Page 14: © 2013 SPiiPlus Training Class PEG and MARK 1. © 2013 What is PEG? PEG (Position Event Generator) creates pulses based on exact feedback position. These

© 2013

AST.#PEGREADY

• AST is an integer array containing a set of bits used for displaying the current axis state

• Bit 4 (#PEGREADY) indicates the readiness of a PEG engine

• Syntax: AST(axis).#PEGREADY

• Make sure this bit = 1 before commanding motion of the PEG axis

14

Page 15: © 2013 SPiiPlus Training Class PEG and MARK 1. © 2013 What is PEG? PEG (Position Event Generator) creates pulses based on exact feedback position. These

© 2013

STOPPEG and STARTPEG

• STOPPEG axis terminates PEG on the specified axis. The command is used in both Incremental and Random PEG.

• Useful for safety purposes to stop PEG pulses while axis is in motion

• If STOPPEG has been executed before the last PEG point has been reached, STARTPEG can be used to continue PEG from the current position.

• STARTPEG axis command initiates the PEG process on the specified axis. The command is used in both the Incremental and Random PEG modes.

15

Page 16: © 2013 SPiiPlus Training Class PEG and MARK 1. © 2013 What is PEG? PEG (Position Event Generator) creates pulses based on exact feedback position. These

© 201316

MARK

Current encoderposition

MARK register

MARK Input trigger from application

MARK variable

MPU

• MARK (position registration) provides ability to latch current axis position when digital input signal is received

• In many applications such as packing, it is desired to move an axis to a target that is relative to a registration mark

• Once an axis is moving and a MARK is detected, motion profile can be modified on-the-fly to reach new target position

Page 17: © 2013 SPiiPlus Training Class PEG and MARK 1. © 2013 What is PEG? PEG (Position Event Generator) creates pulses based on exact feedback position. These

© 201317

MARK• ACSPL+ variable MARK(axis) stores last MARK position

• MARK inputs can be assigned as fast general purpose inputs using the ASSIGNFINS command

• Maximum MARK input frequency depends on CTIME and other factors, and ranges between 50Hz for CTIME = 1ms, and 100Hz for CTIME = 0.5ms

• MARK inputs are routed according to ACSPL+ variables SLPROUT, SLVROUT, SLCROUT. Routing two axes to a single input will cause undefined MARK behavior and should be avoided

Page 18: © 2013 SPiiPlus Training Class PEG and MARK 1. © 2013 What is PEG? PEG (Position Event Generator) creates pulses based on exact feedback position. These

© 201318

Feedback Routing• SLPROUT is used for routing feedback position for the specified axis

• SLVROUT is used for routing feedback velocity for the specified axis

• SLCROUT is used for setting the feedback routing of the commutation velocity for the specified axis

• Syntax: SLPROUT(AXIS#) = value, SLVROUT(AXIS#) = value, SLCROUT(AXIS#) = value

• Where value corresponds to feedback source (see tables 34, 35, and 36 of the SPiiPlus ACSPL+ Command & Variable Reference Guide for definition)

Page 19: © 2013 SPiiPlus Training Class PEG and MARK 1. © 2013 What is PEG? PEG (Position Event Generator) creates pulses based on exact feedback position. These

© 2013

• ASSIGNFINS can be used to set MARK inputs as fast general purpose inputs

• ASSIGNFINS axis, output_index, bit_code• axis: Used to identify the relevant servo processor the axis is

controlled by• input_index: 0 for IN_0, 1 for IN_1, ..., 9 for IN_9• bit_code: Bit code for mapping MARK inputs to physical inputs

• For relevant bit codes, refer to SPiiPlus NT PEG and MARK Operations tables 11 and 12

ASSIGNFINS

19

Page 20: © 2013 SPiiPlus Training Class PEG and MARK 1. © 2013 What is PEG? PEG (Position Event Generator) creates pulses based on exact feedback position. These

© 201320

• ASSIGNFINS 1, 1, 0b111o 1: Servo processor 0 is being usedo 1: MARK Y inputo 0b111: MARK Y set to FGP_IN1o FGP_IN1 associated ACSPL+ variable: IN(0).17

• ASSIGNFINS 4, 5, 0b111o 4: Servo processor 1 is being usedo 5: MARK T inputo 0b111: MARK T set to FGP_IN3o FGP_IN3 associated ACSPL+ variable: IN(1).19

ASSIGNFINS Examples

Page 21: © 2013 SPiiPlus Training Class PEG and MARK 1. © 2013 What is PEG? PEG (Position Event Generator) creates pulses based on exact feedback position. These

© 201321

MARK Example• Assume the following motion should be built:

• Move axis at a constant velocity with no defined end point• Latch exact MARK position while moving• Redefine the end point on the fly and stop motion smoothly at

position equal to mark position plus 15000 units

IST(0).#MARK = 0 ! Enable MARK latchingJOG 0 ! Jog in positive directionTILL IST(0).#MARK ! Wait for MARK signalPTP 0, MARK(0) + 15000 ! Move to MARK(0)

Page 22: © 2013 SPiiPlus Training Class PEG and MARK 1. © 2013 What is PEG? PEG (Position Event Generator) creates pulses based on exact feedback position. These

© 2013

COS

SIN

PEG and MARK can only occur at a zero crossings of the SIN-

COS waves

Interpolated position

Using PEG and MARK with SIN-COS Encoder• When SIN-COS encoder is used PEG and MARK can only be fired/captured

at zero-crossings of the sine/cosine waves (not at the exact interpolated position)

22

Page 23: © 2013 SPiiPlus Training Class PEG and MARK 1. © 2013 What is PEG? PEG (Position Event Generator) creates pulses based on exact feedback position. These

© 2013

• GETCONF retrieves system configuration data

• GETCONF(71, index): Use to view the actual assignment of digital outputs to PEG states and PEG pulses outputs. Index argument contains the axis index.

• GETCONF(72, index): Use to view the actual encoder PEG engine assignment. Index argument contains the axis index.

• GETCONF(73, index): Use to view the actual output pins assignment. Index argument: 0-7 is axis index, 8-16 is OUT_0 through OUT_9

23

GETCONF

Page 24: © 2013 SPiiPlus Training Class PEG and MARK 1. © 2013 What is PEG? PEG (Position Event Generator) creates pulses based on exact feedback position. These

© 2013

Further Information

24

• The following guides are part of the SPiiPlus NT Suite installation:

• PEG and MARK Application Notes

• ACSPL+ Command and Variable Reference Guide

• SPiiPlus ACSPL+ Programmer’s Guide

Page 25: © 2013 SPiiPlus Training Class PEG and MARK 1. © 2013 What is PEG? PEG (Position Event Generator) creates pulses based on exact feedback position. These

© 2013

Example 1

• A non-destructive testing machine requires RS422 PEG pulses be sent to its ellipsometry system for triggering purposes during stage travel.

• Triggering needs to occur at fixed intervals along the stage’s length of travel

• The application is using a CMnt

Method:• Load and review example code

25

Page 26: © 2013 SPiiPlus Training Class PEG and MARK 1. © 2013 What is PEG? PEG (Position Event Generator) creates pulses based on exact feedback position. These

© 2013

Example 2

• The inspection machine just had a HW revision, and now requires two metrology systems to be triggered in parallel.

• Being a cost sensitive application it is desired to do this without adding/designing/purchasing/testing external circuitry.

Method:• Modify code in previous example so two RS422 PEG pulses are sent out in

parallel instead of one

26

Page 27: © 2013 SPiiPlus Training Class PEG and MARK 1. © 2013 What is PEG? PEG (Position Event Generator) creates pulses based on exact feedback position. These

© 2013

Example 3

• For qualification purposes it needs to be verified that pulses are being fired at correct positions.

Method:• Physically connect PEG pins to MARK pins

• Modify the previous example to display MARK positions in the Communication Terminal

• Hint – use an autoroutine to• Detect MARK latching (IST(axis).#MARK = 1)• Display the latched position (MARK(axis))• Reset latch (IST(axis).#MARK = 0) so next PEG pulse can be detected

27