12
Application Note Time-based Position Capture Algorithm Purpose This Application Note applies to Kinetix 2000, 6000, and 7000 Multi-axis Servo Drives. This document explains the operation and limitations of the Time-Based Position Capture (TBPC) algorithm used to register the command and actual position of an axis at a specific Coordinated System Time (CST) in which an event occurred. This registration event can be an event of another axis or any other system event. The TBPC algorithm can capture the position of a virtual and a consumed axis as well as a real axis that does not have registration sensor through soft registration. A soft registration is a typical application for the TBPC algorithm. Soft registration is used when a registration event of a single axis or multiple axes, which does not have a registration sensor, is based on the registration event of an axis with a registration sensor. The experimental results presented in this Application Note describe the operation and limitations of the TBPC algorithm for soft registration. Two types of position registration techniques may be implemented: a hard registration and a soft registration. The soft registration is an algorithm implemented in the program of the controller. The hard registration uses a registration sensor that yields better position registration accuracy than the soft registration. The operation of each registration technique is described next in order to compare the performance, operation, and limitations of both techniques. Description of Operation of the Hard Registration The operation of a hard registration is: 1. A Motion Arm Registration (MAR) instruction is executed and the drive begins to monitor the registration input specified in this instruction. At this moment, a dedicated hardware in the drive automatically monitors the state of the selected registration input (input 1 or input 2), which is illustrated as follows. Figure 1 - Hard Registration Encoder Registration Sensor Encoder Counter Registration Latch Registration Position

2094-AT004A-EN-P, Time-based Position Capture Algorithm · 2 Time-based Position Capture Algorithm 2. When a transition of the edge (positive or negative) specified in the MAR instruction

  • Upload
    others

  • View
    9

  • Download
    0

Embed Size (px)

Citation preview

Page 1: 2094-AT004A-EN-P, Time-based Position Capture Algorithm · 2 Time-based Position Capture Algorithm 2. When a transition of the edge (positive or negative) specified in the MAR instruction

Application Note

Time-based Position Capture Algorithm

Purpose This Application Note applies to Kinetix 2000, 6000, and 7000 Multi-axis Servo Drives. This document explains the operation and limitations of the Time-Based Position Capture (TBPC) algorithm used to register the command and actual position of an axis at a specific Coordinated System Time (CST) in which an event occurred. This registration event can be an event of another axis or any other system event. The TBPC algorithm can capture the position of a virtual and a consumed axis as well as a real axis that does not have registration sensor through soft registration.

A soft registration is a typical application for the TBPC algorithm. Soft registration is used when a registration event of a single axis or multiple axes, which does not have a registration sensor, is based on the registration event of an axis with a registration sensor. The experimental results presented in this Application Note describe the operation and limitations of the TBPC algorithm for soft registration.

Two types of position registration techniques may be implemented: a hard registration and a soft registration. The soft registration is an algorithm implemented in the program of the controller. The hard registration uses a registration sensor that yields better position registration accuracy than the soft registration. The operation of each registration technique is described next in order to compare the performance, operation, and limitations of both techniques.

Description of Operation of the Hard Registration

The operation of a hard registration is:

1. A Motion Arm Registration (MAR) instruction is executed and the drive begins to monitor the registration input specified in this instruction. At this moment, a dedicated hardware in the drive automatically monitors the state of the selected registration input (input 1 or input 2), which is illustrated as follows.

Figure 1 - Hard Registration

Encoder

Registration Sensor

Encoder Counter

Registration Latch

Registration Position

Page 2: 2094-AT004A-EN-P, Time-based Position Capture Algorithm · 2 Time-based Position Capture Algorithm 2. When a transition of the edge (positive or negative) specified in the MAR instruction

2 Time-based Position Capture Algorithm

2. When a transition of the edge (positive or negative) specified in the MAR instruction occurs on the registration sensor, the actual position is latched by the registration latch.

3. This registration position is transferred to the SERCOS module on the next cycle time and axis to the controller on the next coarse update period. This registration position is stored in the Registration1Position attribute if registration input 1 is used or in the Registration2Position attribute if registration input 2 is used. This position is stored in position units.

4. The lower 32 bits of the CST (64 bits total) time at which this registration event occurred is saved in the Registration1Time attribute if registration input 1 is used or Registration2Time attribute if registration input 2 is used. This time is given in microseconds. The resolution of the Registration1Time attribute and Registration2Time attribute is the cycle time. For example, the shortest step in time that is stored in these attributes is given by the cycle time of the SERCOS ring. This is a key point for the soft registration.

The uncertainty of this hard registration is:

Uncertainty = AxisSpeed × Delay

The axis speed in given in position units per second, and the delay is given in seconds. The Delay is the period of time necessary to identify the specific transition on the registration input of the servo drive. This delay is typically 1 µs for hardware registration.

Publication 2094-AT004A-EN-P - September 2007

Page 3: 2094-AT004A-EN-P, Time-based Position Capture Algorithm · 2 Time-based Position Capture Algorithm 2. When a transition of the edge (positive or negative) specified in the MAR instruction

Time-based Position Capture Algorithm 3

Description of Operation of the Soft Registration

This section describes the operation of the TBPC algorithm for soft registration, which is illustrated below.

Figure 2 - Time-based Position Capture Algorithm

The operation of the TBPC algorithm described in this application note is based on the system configuration shown in Figure 3. In this system, the first axis (Axis 01) is connected to a registration sensor to watch for hard registration events. When a hard registration event occurs on the first axis, the actual position and command position of the second axis (Axis 02) will be computed by the TBPC algorithm. Thus, the TBPC algorithm is being used for software registration of the second axis.

Figure 3 - System Configuration for a Soft Registration on Axis 02

RegistrationTime

OtherSystem Time

InterpolationTime

ActualPositionHistory

CommandPositionHistory

InterpolatedActual

Position

InterpolatedCommandPosition

Axis with hard registration sensor

SSV

Controlled by Controller

with hard

Axis to calculate registration position

Axis

sensorregistration

Axis 01

Controller

SERCOSmodule

Axis 02

RegistrationSensor

Motion Planner(Coarse Update Period)

SERCOS ring(Cycle Time)

Publication 2094-AT004A-EN-P - September 2007

Page 4: 2094-AT004A-EN-P, Time-based Position Capture Algorithm · 2 Time-based Position Capture Algorithm 2. When a transition of the edge (positive or negative) specified in the MAR instruction

4 Time-based Position Capture Algorithm

The operation of the TBPC algorithm is:

1. A MAR instruction is executed and the drive of the first axis (Axis 01) begins to monitor the registration events.

2. When a transition on the registration sensor of the first axis (Axis 01) occurs, the actual position and the registration time of Axis 01 are saved. See Description of Operation of the Hard Registration.

3. The Registration1Time attribute saves the registration time if the registration input 1 is being used. Otherwise, the Registration2Time attribute saves the registration time if registration input 2 is being used. The resolution of the Registration1Time attribute and Registration2Time attribute is the cycle time as shown in Figure 4. Thus, the registration time is a multiple of the cycle time. Although the registration event occurred between 5000 and 6000 µs, in the example illustrated below, the registration time will not be able to save the exact time in which the registration event occurred. Thus, the registration time will be saved as 6000 µs, which represents a resolution of 1millisecond (1000 µs) because the cycle time is 1millisecond for this example.

Figure 4 - Example of the Registration Time

4. A Set System Value (SSV) instruction is executed to set the interpolation time attribute (InterpolationTime) of Axis 02 with the registration time attribute of Axis 01. See Figure 2 - Time-based Position Capture Algorithm. The interpolated actual position (InterpolatedActualPosition) and the interpolated command position (InterpolatedCommandPosition) axis attributes are automatically calculated when the InterpolationTime axis attribute is updated. The procedure to obtain the InterpolationTime for Axis 02 is given as follows:

Example:Coarse Update Period: 4msCycle Time: 1ms

0 4000

1 coarse update

1 cycle time

8000 1200 CST(μs)

Registrationevent

Registrationtime = 6000

Publication 2094-AT004A-EN-P - September 2007

Page 5: 2094-AT004A-EN-P, Time-based Position Capture Algorithm · 2 Time-based Position Capture Algorithm 2. When a transition of the edge (positive or negative) specified in the MAR instruction

Time-based Position Capture Algorithm 5

The controller stores the actual position and the command position at each coarse update period in a history buffer with capacity for 100 samples. The controller can track the trajectory of the last 100 positions (actual and command) of each axis. As the following table shows, each sample in this history buffer is associated with a time stamp.

The time stamp is essentially the Coordinated System Time (CST) of the controller when the motion planner is executed.

The actual position is the value read from the drive during input updates of the coarse update period.

The command position is the last value in the motion planner.

A first order interpolation is used to compute the interpolated actual position. A second order interpolation is used to compute the interpolated command position based on the history of positions and the InterpolationTime axis attribute.

5. The value of the interpolated actual position and the interpolated command position of Axis 02 are directly read on the InterpolatedActualPosition and the InterpolatedCommandPosition attributes.

The main core of TBPC algorithm code is:

Figure 5 - Portion of Code in Ladder for a Time-Based Position Capture Algorithm

Table 1 - Example of Data Saved in History Buffer for 100 Coarse Update Periods

Time stamp ActualPosition CommandPositiont1 xa1 xc1

t2 xa2 xc2

t3 xa3 xc3

t4 xa4 xc4

Publication 2094-AT004A-EN-P - September 2007

Page 6: 2094-AT004A-EN-P, Time-based Position Capture Algorithm · 2 Time-based Position Capture Algorithm 2. When a transition of the edge (positive or negative) specified in the MAR instruction

6 Time-based Position Capture Algorithm

Limitations of the Time-Based Position Capture Algorithm

This section discusses the limitations and the accuracy of the TBPC algorithm. Results may vary according to the configuration of the motion planner.

The system configuration for a soft registration was implemented with Kinetix 6000 drives and ControlLogix system to obtain experimental results that show the limitations of the TBPC algorithm. Both axes, Axis 01 and Axis 02, were running independently (not geared) at constant speed. The results shown in Table 2 and Table 3 show the effect of cycle time and coarse update period on the TBPC algorithm (referred in the tables as Soft Registration) in comparison with a hard registration. The results for both hard registration and soft registration were generated for Axis 02 in such a manner that a soft and a hard registration were running at the same time in the controller for comparison purposes. This was accomplished with the registration switch connected in parallel to both drives (Axis 01 and Axis 02). The results were obtained from about 10 registrations per second (3500 deg/s) to about one registration per second (350 deg/s). Each result shown in this table is a result of 100 registration events.

Observe that a larger cycle time results in a larger mean error and a larger standard deviation. See Table 2 - Hard Registration Compared to Soft Registration (Cycle Time of the SERCOS Ring). A faster registration rate also yields a larger error in both the mean value and standard deviation. A soft registration returns an interpolated actual position with a larger difference to the exact actual position than the actual position obtained from a hard registration in addition to a larger variability (lower repeatability).

A hard registration presents an expected standard deviation different than zero as shown in Table 2 because the registration sensor is not ideal. Thus, a registration sensor which does not have the ability to activate the registration input at the exact same point each time during a hard registration render the position registration errors represented by the standard deviation.

Publication 2094-AT004A-EN-P - September 2007

Page 7: 2094-AT004A-EN-P, Time-based Position Capture Algorithm · 2 Time-based Position Capture Algorithm 2. When a transition of the edge (positive or negative) specified in the MAR instruction

Time-based Position Capture Algorithm 7

The behavior of a hard registration and a soft registration can be observed when Axis 01 and Axis 02 were running at 3500 degrees/s, cycle time of 2 milliseconds and coarse update of 8 milliseconds. Each step on the waveform for the soft registration represents one registration event. As this example shows, there are about 10 registrations per second.

Figure 6 - Soft and Hard Registration for Axis 02 at 3500 deg/s, Cycle Time of 2 milliseconds and Coarse Update of 8 milliseconds

Table 2 - Hard Registration Compared to Soft Registration (Cycle Time of the SERCOS Ring)

Speed Cycle Time

Coarse Update Period

Hard Registration Soft Registration Mean Errormean ±std mean ±std

Degree/s ms ms degrees degrees degrees degrees HRm-SRm (1)(2)

3500 0.512

444

333.27 17.20 152.82

0.0822 0.0851 0.0771

332.07 14.12 147.63

0.8440 1.0179 2.0081

1.20 3.08 5.19

1700 0.512

444

319.83 7.68 143.93

0.0661 0.0619 0.0689

319.23 6.13 141.63

0.3533 0.5044 0.9794

0.60 1.55 2.30

350 0.512

444

313.29 55.73 141.96

0.0460 0.0476 0.0464

313.17 55.41 141.47

0.0835 0.1144 0.2132

0.11 0.32 0.49

(1) HRm= Mean value of the hard registration

(2) SRm= Mean value of the soft registration

20

22

24

26

28

30

32

34

36

0 2000 4000 6000 8000 10000 12000

Time (ms)

Pos

ition

(deg

r ee)

Hard Registration

Soft Registration

Publication 2094-AT004A-EN-P - September 2007

Page 8: 2094-AT004A-EN-P, Time-based Position Capture Algorithm · 2 Time-based Position Capture Algorithm 2. When a transition of the edge (positive or negative) specified in the MAR instruction

8 Time-based Position Capture Algorithm

A similar analysis can be made to evaluate the effect of the coarse update time on the soft registration accuracy. Observe in the table below that the coarse update period of the motion planner does not interfere with the accuracy of the soft registration. The different coarse update periods from 2 milliseconds through 8 milliseconds yield approximately the same mean error and standard deviation for each speed. However, a faster registration rate yields a larger error in both mean value and standard deviation. Thus, the accuracy of the soft registration decreases with a greater speed.

Note that the standard deviation of the soft registration drastically decreases when the period of time between each registration event is a multiple of the cycle time. For instance, 3600 degrees/s and 3000 degrees/s result in lower standard deviations while any other frequency between these two results in larger standard deviations for a cycle time of 1 millisecond. Assuming one registration event per revolution, 3600 degrees/s yields a period of 100 milliseconds between each registration event, which is a multiple of a cycle time of 1 millisecond. However, 3000 degrees/s yield a period of 120 milliseconds between each registration event, which is also a multiple of a cycle time of 1 millisecond. Any other speed between 3000 and 3600 degrees/s yields a period between each registration event that is not a multiple of the cycle time.

As the experimental results show, the hard registration should be used in applications that require greater accuracy in measuring the registration events instead of the TBPC algorithm technique. See Limitations of the Time-Based Position Capture Algorithm.

Table 3 - Hard Registration Compared to Soft Registration (Coarse Update Period of the Motion Planner)

Speed Cycle Time

Coarse Update Period

Hard Registration Soft Registration Mean Errormean ±std mean ±std

Degree/s ms ms degrees degrees degrees degrees HRm-SRm (1)(2)

3500 111

248

16.50 17.20 272.21

0.0726 0.0851 0.0708

13.19 14.12 269.00

1.0903 1.0179 1.0534

3.31 3.08 3.20

1700 111

248

8.05 7.68 271.64

0.0673 0.0619 0.0598

6.53 6.13 270.13

0.5015 0.5044 0.5046

1.51 1.55 1.51

350 111

248

2.62 55.73 266.76

0.0422 0.0476 0.0509

2.32 55.41 266.44

0.1116 0.1144 0.1200

0.30 0.32 0.32

(1) HRm: Mean value of the Hard Registration

(2) SRm: Mean value of the Soft Registration

Publication 2094-AT004A-EN-P - September 2007

Page 9: 2094-AT004A-EN-P, Time-based Position Capture Algorithm · 2 Time-based Position Capture Algorithm 2. When a transition of the edge (positive or negative) specified in the MAR instruction

Time-based Position Capture Algorithm 9

Cause of Limitations of the Time-Based Position Capture Algorithm

Lower accuracy of the TBPC algorithm is primarily associated with the precision of the registration time. As mentioned in the Description of Operation of the Hard Registration, the resolution of the registration time is the SERCOS cycle time. A shorter cycle time yields a better resolution for the registration time, which in turn results in a better accuracy for the interpolated positions obtained through the TBPC algorithm. Thus, when a registration event occurs between two cycle times in the SERCOS ring, an error in the interpolated actual position and interpolated command position will result. See Figure 4 - Example of the Registration Time.

The ability to interpolate positions is proportional to the precision in which the registration time is captured as shown in Figure 7. As this figure shows, a registration event at 2.2 milliseconds can result in different interpolated actual positions due to the resolution of the registration time. For example, the interpolated actual position with a cycle time of 2 milliseconds was found to be 200 when it should be calculated as 155. Meanwhile, an interpolated actual position of 162.5 was obtained with a faster cycle time of 0.5 milliseconds, which resulted in better accuracy for the TBPC algorithm.

Figure 7 - Mathematical Representation of the Cycle Time Effect on TBPC Algorithm Accuracy

0 4ms

Cycle time = 2msRegistration time = 4ms

Registrationevent at 2.2ms

Interpolation

Interpolated ActualPosition = 200

Registration Position = 155

100 200

Time

Position

0 4ms

Cycle time = 1msRegistration time = 3ms

Registrationevent at 2.2ms

Interpolation

Interpolated ActualPosition = 175

100 200

0 4ms

Cycle time = 0.5msRegistration time = 2.5ms

Registrationevent at 2.2ms

Interpolation

Interpolated ActualPosition = 162.5

100 200

Publication 2094-AT004A-EN-P - September 2007

Page 10: 2094-AT004A-EN-P, Time-based Position Capture Algorithm · 2 Time-based Position Capture Algorithm 2. When a transition of the edge (positive or negative) specified in the MAR instruction

10 Time-based Position Capture Algorithm

This also explains why the coarse update period does not interfere in the TBPC algorithm accuracy. This is because the coarse update period does not change the resolution of the registration time as the cycle time does. Thus, additional error in the registration time and consequently in the interpolated positions is not generated when different coarse update periods are used.

The uncertainty of the TBPC technique is:

Uncertainty ≈ AxisSpeed × CycleTime

The axis speed is given in position units per second and the cycle time is given in seconds. This uncertainty equation can be tested in Table 2 and Table 3. The results obtained for the uncertainty through this equation are close to the values in the error columns of these tables.

CIP Motion versus SERCOS for Time-Based Position Capture Algorithm

The Common Industrial Protocol (CIP) motion can provide high performance, multi-axis, and synchronized motion. The CIP motion also provides a clock synchronization of 100 nanoseconds between the controller and the servo drives. As a result, the clock in the servo drives is synchronized with the clock of the controller.

When a hard registration event occurs, the registration position will be time-stamped. This will result in a registration time independent of the cycle time. Thus, the TBPC algorithm accuracy that is associated with the resolution of the registration time in SERCOS is supposed to be greatly increased in CIP motion.

Equipment The pieces of equipment used in this Application Note to generate the results presented here are:

• Integrated Axis Module: 2094-AC09-M02 - FW 1.89.02

• Axis Module: 2094-AM01 - FW 1.89.08

• Controller: 1756-L63/A - FW 15.3

• SERCOS module: 1756-M08SE - FW 15.37

• RSLogix5000 V15.00.00

Publication 2094-AT004A-EN-P - September 2007

Page 11: 2094-AT004A-EN-P, Time-based Position Capture Algorithm · 2 Time-based Position Capture Algorithm 2. When a transition of the edge (positive or negative) specified in the MAR instruction

Time-based Position Capture Algorithm 11

Additional Resources These documents contain additional information concerning related Rockwell Automation products.

You can view or download publications at http://literature.rockwellautomation.com. To order paper copies of technical documentation, contact your local Rockwell Automation distributor or sales representative.

Resource Description

Motion Modules in Logix5000 Control Systems, publication LOGIX-UM002

Provides details about how to setup and program motion control using Logix motion modules.

ODVA Common Industrail Protocol Motion Brochure, publication 0012-BR001

Provides details about multi-axis synchronized motion over EtherNet/IP.

Publication 2094-AT004A-EN-P - September 2007

Page 12: 2094-AT004A-EN-P, Time-based Position Capture Algorithm · 2 Time-based Position Capture Algorithm 2. When a transition of the edge (positive or negative) specified in the MAR instruction

Publication 2094-AT004A-EN-P - September 2007 12

Rockwell Automation Support

Rockwell Automation provides technical information on the Web to assist you in using its products. At http://support.rockwellautomation.com, you can find technical manuals, a knowledge base of FAQs, technical and application notes, sample code and links to software service packs, and a MySupport feature that you can customize to make the best use of these tools.

For an additional level of technical phone support for installation, configuration, and troubleshooting, we offer TechConnect support programs. For more information, contact your local distributor or Rockwell Automation representative, or visit http://support.rockwellautomation.com.

Installation Assistance

If you experience a problem within the first 24 hours of installation, please review the information that's contained in this manual. You can also contact a special Customer Support number for initial help in getting your product up and running.

New Product Satisfaction Return

Rockwell Automation tests all of its products to ensure that they are fully operational when shipped from the manufacturing facility. However, if your product is not functioning and needs to be returned, follow these procedures.

Allen-Bradley, Rockwell Automation, and TechConnect are trademarks of Rockwell Automation, Inc.

Trademarks not belonging to Rockwell Automation are property of their respective companies.

United States 1.440.646.3434 Monday – Friday, 8 a.m. – 5 p.m. EST

Outside United States Please contact your local Rockwell Automation representative for any technical support issues.

United States Contact your distributor. You must provide a Customer Support case number (see phone number above to obtain one) to your distributor in order to complete the return process.

Outside United States Please contact your local Rockwell Automation representative for the return procedure.

Copyright © 2007 Rockwell Automation, Inc. All rights reserved. Printed in the U.S.A.