Adept SmartMotion Developer's Guide


Encoder Specifications Menu

The encoder specifications define the relationship between the encoder, the mechanism, and the control system. This menu is used to set the parameters such as the number of counts per zero-index and the zero-index configuration which ensures proper encoder operation and calibration accuracy. The encoder sign must be set properly to get stable motion in the directions specified by the device module documentation. You can also establish encoder filtering to reduce errors due to noise in your system.

When you select a menu option, the following information is provided on screen:

For details on a menu option, click the desired link in the following list to view the description:

Change encoder number

Edit encoder scale factors

Encoder counts per zero index

Encoder configuration (zero index)

Encoder Zero-Index Checking

Encoder Quadrature Checking

Broken Wire Detection

Easy Encoder Filter configuration

Advanced Encoder Filter configuration

Encoder sign

Max accumulated encoder noise counts

Max encoder noise counts per rev

Perform hardware diagnostics

Menu Option Descriptions

Change Encoder Number

Use this menu option to select the encoder you want to configure. The current encoder selection is displayed at the top of the menu page.

Edit Encoder Scale Factors

The Adept SmartMotion system supports coordinate systems which are calibrated in real units (millimeters or degrees). To accomplish this, scale factors which relate encoder counts to physical movements must be defined to the system. If a joint is rotary, the units for this parameter are encoder counts per degree. If the joint is linear, then the units for this parameter are encoder counts per millimeter. This parameter must take into account all gearing which exists between the encoder and the joint.

Most mechanism kinematics modules contain only one motor for each joint. In these cases, there is a single scale factor for each motor/joint, and SPEC will allow only a single value to be entered for each motor.

Mechanisms that allow multiple motor-to-joint coupling require the specification of a scale factor for each joint affected by the selected motor's motion. In these cases, SPEC will prompt for as many scale factors as necessary to characterize the coupling. Each scale factor may be calculated by determining how much the selected motor moves when only the indicated joint is allowed to move.

If a kinematics module allows motor-to-joint coupling, but none is desired, then set all the scale factors to zero except those for which the motor number and joint number are the same.

When multiple motor-to-joint coupling is present, the scale factors entered for each motor form a row in a coupling matrix used internally by V+. This matrix must be invertible so that V+ can determine how the joints move for a given motor motion, and also how the motors should move given a desired joint motion. If the matrix cannot be inverted, SPEC will warn the user of an inconsistency in the motor-to-joint coupling. If SPEC reports this error, be sure to correct the inconsistency by entering the proper scale factors BEFORE any attempt is made to control the affected joints from V+. V+ will not be able to move the joints correctly without the proper scale factors.

Encoder specifications often state the number of lines per revolution. Because the Adept SmartMotion hardware uses quadrature decode circuitry, it is necessary to multiply the number of lines per revolution by four to calculate the number of counts per revolution.

When calculating and entering this parameter, it is very important to use as much accuracy as possible. The value should be entered as an expression or the decimal portion of the number should be entered to eight significant digits. This scale factor is critical to achieve motions which are accurate.

Sample scale factor calculations are shown below.

Example 1:

Linear motion achieved via the use of a lead-screw drive. The lead screw requires 2 revolutions per inch of travel. The encoder (800 lines per revolution) is mounted directly to the back of the motor shaft and the lead screw is directly coupled (no gearing) to the joint.

Example 2:

A jointed arm robot has a joint that rotates. The joint is driven through a harmonic drive with a gear reduction ratio of 45 to 1. The encoder is mounted directly to the back of the motor shaft and has 1000 lines per revolution.

Example 3:

A gantry mechanism contains five joints, and the last two contain multiple motor-to-joint coupling. It is known that if joint 5 is held stationary and joint 4 is moved 1 degree, then both motors 4 and 5 will move 400 counts. Also, if joint 4 is held stationary and joint 5 is moved 1 degree, then motor 4 will not move, and motor 5 will move -1200 counts. The scale factors are therefore as follows:

Joint 4 to motor 4 scale factor (counts/degree) = 400

Joint 5 to motor 4 scale factor (counts/degree) = 0

Joint 4 to motor 5 scale factor (counts/degree) = 400

Joint 5 to motor 5 scale factor (counts/degree) = -1200

 

Encoder Counts Per Zero Index

Specifies the number of encoder counts between each zero-index on the encoder. Because an encoder normally has only one index per rotation of an encoder, the value is usually the same as the number of counts per revolution (or four times the number of lines per revolution).

Some linear encoders have only one zero-index in the entire range of motion. In such a case, the number of encoder counts per zero-index should be set to any value greater than the number of counts in the encoder from end to end. Zero-index checking will still function: any stray index pulse will cause an *Unexpected zero index* error and failure to detect the single index at the correct encoder count will cause a *No zero index* error.

Other encoders have no zero-index at all. In that case, set the number of encoder counts per zero index to 0.

Encoder (Zero Index) Configuration

The zero-index configuration defines the manner in which the encoder circuitry reads the zero-index pulse from the encoder, and is set to match the specific type of encoder in use. The zero-index is often used as a calibration reference. (The zero-index pulse is also sometimes known as the Index Pulse, the Marker Pulse or the C-channel.) It may also be used, in conjunction with the Encoder Counts per Zero Index parameter, to help detect certain encoder faults. Zero-index pulses may be active low or active high, and an active pulse transition may occur in conjunction with the rising or falling edge of either the A or B channel. Most encoder manufacturers provide timing diagrams that describe the relationship of the zero index pulse to the A and B channels. The timing diagram indicates the most reliable point at which to set the zero-index configuration. By gating the zero-index pulse near its center, you can be confident of its stability even at high speeds.

Example Zero-Index Configuration shows an example encoder timing diagram. The example encoder has an active high zero-index. From the chart in Zero-Index Configuration Table, this encoder would require a zero-index configuration of either 4 (A phase low, B phase low, zero-index high) or 6 (A phase low, B phase high, zero-index high.) Set the zero-index configuration to one of these values. If you receive an *Unexpected zero index* or *No zero index* error message, then change to the other zero-index configuration. Diagnostic Tests details a procedure for setting the correct zero-index configuration.

Example Zero-Index Configuration

Zero-Index Configuration Table

Configuration Value (bits 1 to 3)
0
1
2
3
4
5
6
7
A Phase
Low
High
Low
High
Low
High
Low
High
B Phase
Low
Low
High
High
Low
Low
High
High
Index
Low
Low
Low
Low
High
High
High
High

 

Encoder Zero-Index Checking

This parameter is used to enable or disable the encoder zero-indexing reporting safeguard. 

Encoder zero-index error checking is used to detect incorrect encoder zero-index configuration. If the encoder configuration is incorrect and the robot is moved, the robot will power down with an *Unexpected zero index* or *No zero-index* error.

This parameter can be disabled if you are using an encoder that doesn't have a zero-index or one that is not registered (not recommended). 

Excessive noise may cause encoder zero-index errors. If the noise is repeatable, use the Max accumulated encoder noise counts and Max encoder noise counts per rev parameters to establish a noise tolerance that will allow some index errors to occur before generating an index error.  For non-repeatable noise, temporarily disable the encoder zero-index checking parameter. However, even if zero-index error-reporting is disabled, the correct zero-index configuration will still be required if the zero-index is used for calibration. (See Encoder (Zero Index) Configuration for details on configuring the encoder.)

NOTE: The Encoder Zero-Index Checking is the best tool for checking the quality of an incremental encoder. If index errors are occurring with a correct configuration, then the controller is gaining or losing counts and the axis will not be in the correct mechanical position. The Quadrature check is a much less sensitive measure of electrical noise problems.

Encoder Quadrature Checking

This parameter is used to enable or disable the quadrature error reporting safeguard.

Quadrature error checking is used to detect an illegal state change in the A and B phases which occurs if both A and B change state during the same clock cycle. Because the A and B phases should be 90 electrical degrees apart, this should not normally happen. If this condition is detected, the system generates an *Encoder quadrature error*. 

Quadrature errors may be a result of electrical noise, or an incorrect digital filter setting as illustrated in the figure below. Electrical noise may cause an illegal state change on B during the filter clock period in which A is transitioning legally. An incorrect digital filter setting may cause the error if the encoder has very short periods between transitions when the axis is moving at a high speed, and the digital filter is set to the slowest clock rate and minimum number of stages. Under these conditions, the system may detect a legal A transition followed by a B transition within a single clock cycle.

 

Illegal State Changes in A and B Phases

If you are getting the *Encoder quadrature error* message during hardware diagnostic testing, you can temporarily disable this parameter to proceed with testing. However, the conditions causing the error should be addressed.

Encoder Broken-Wire Detection

Use this option to temporarily disable the broken-wire detection safeguard during hardware diagnostic testing. When broken-wire detection is enabled, the system generates an *Encoder Failure* error if the hardware detects loss of signal from either one or both of the differential signals from channels A or B of the encoder. This safety check is only available on systems wired for differential encoders. This feature must always be disabled on systems wired for single-ended (non-differential) encoders.

If the encoders are wired for differential operation, but your encoders are not providing true RS-422 signals, you must disable broken-wire detection. Adept strongly recommends the use of RS-422 differential encoders, so that you can use the broken-wire detection feature.)

CAUTION: When using broken-wire detection, be careful when wiring encoder signals. Noisy signals may report *Encoder failure* errors when detection is turned on. It is important to configure the encoder digital filter to a proper setting to avoid noise interference and miscounts.

 

Details

For a differential encoder using RS-422 type outputs, the two signals, (A+ and A-, B+ and B-) must be in opposite states except during a transition. If one of the +/- pair is not in opposition of the other, e.g. A+ must be 5V when A- is 0V and vice versa , the hardware will detect an apparent fault condition and generate the *Encoder Failure*error. The broken-detection test will detect when one or both of a pair (e.g. A+ and A-) are open (i.e. broken), when one or both are connected to 5V or ground, or when the two are shorted together. The test may sometimes detect when one signal is crossed with a different pair (e.g. A+ and B- are paired to A).

 

By definition, the Broken-Wire detection check cannot be performed for single-ended (non-differential) encoders. If you have installed a single-ended encoder, you must disable the "broken-wire"/encoder fault detection to avoid a continuous error condition. For more information on encoders, see Encoder Input Configuration in the Adept SmartMotion Installation Guide.

 

WARNING: It is important to enable the zero-index, quadrature, and broken-wire detection during normal execution; otherwise, selected errors will not be reported even if the encoder is malfunctioning. It may result in the servo's encoder position counter gaining or losing counts so that the axis will not move to the correct mechanical position.

 

Easy Encoder Filtering

The encoder inputs are digitally sampled and filtered.  If the encoders are excessively noisy, or electrical interference is affecting the encoder power supply or wiring, you can add additional filtering to the encoder signal to reject errors due to noise.  Additional filtering will reduce the maximum encoder rate. 

For high-speed encoder counting applications, you may need to change the default setting to less filtering, that is, higher clock rates. However, with less digital filtering, you need to take more care in your wiring to avoid electrical interference. (See the Adept SmartMotion Installation Guide for details on wiring the Adept SmartMotion system.)

The Easy Encoder Filtering option provides a subset of encoder filter values which can be applied. For more detailed information on applying the encoder filter or for a wider selection of filter values, see the Advanced Encoder Filtering menu option.

Using the Easy Encoder filter option, enter one of the following values to change the maximum encoder rate:

Encoder Filter Value Maximum Encoder Rate (MHz)

0

 65.536

1

 39.321

2

32.768

3

10.923

4

2.731

5

.171

 

Advanced Encoder Filtering

You can add additional filtering to the encoder signal to reduce errors due to noise. If you do so, however, it will reduce the maximum encoder rate.

Before configuring the filter, calculate the maximum encoder edge rate frequency. The encoder rate is determined by the values selected for Encoder Filter Stage and Filter Clock Frequency rating.  The following sections describes the configuration process and provides a list of available filter configurations to achieve the desired maximum encoder rate.

 

Usage Considerations

Configuring the Encoder Filter

NOTE: You can also use the Easy Encoder Filter to specify the filter value. This option lets you specify a filter value from a subset of the available settings listed in the table below. See Easy encoder filter for details.

  1. For efficient noise rejection, choose a configuration rate that has a maximum theoretical rate 2 to 5 times higher than your actual maximum rate, in order to get efficient noise rejection.

  2. Look at the Filter Configuration table and find the desired encoder rate. Note the values for the Encoder Filter Stage and Filter Clock Frequency Setting that generate the desired encoder rate.

    For example, if you have an encoder that runs at 10 mHz, you would need an Encoder Filter Stage value somewhere between 20 mHz (10 x 2) and 50 mHz (10x5). You can experiment with the Filter Stage settings that result in a frequency within that range to determine what setting works best.

Filter Clock

Frequency Setting

Encoder Filter

Stage

     
  0 1 2 3

0

65.536 mHz

49.152 mHz

39.321 mHz

32.768 mHz

1

21.845 mHz

16.384 mHz

13.107 mHz

10.923 mHz

2

10.923 mHz  

8.192 mHz

6.553 mHz

5.461 mHz

3

5.461 mHz

4.096 mHz

3.276 mHz

2.731 mHz

4

2.731 mHz

2.048 mHz

1.638 mHz

1.365 mHz

5

1.365 mHz

1.024 mHz

0.819 mHz

0.683 mHz

6

0.683 mHz

0.512 mHz

0.409 mHz

0.341 mHz

7

0.341 mHz

0.256 mHz

0.204 mHz

0.171 mHz

Encoder Sign

Defines the relationship between the direction of the encoder and the direction of the motor. Use this parameter if you want to have the option to mount the encoder on either end of the motor shaft (which results in a reversal of the encoder rotation). A non-zero value for the encoder sign causes the control system to invert the sign of the encoder position. When set properly, the encoder count should increase when the axis is moved in a positive direction. Refer to your device module documentation for a description of positive direction for each axis of the robot.

An improperly connected encoder (A and B phases reversed) will cause a reversal in the encoder count direction. Ensure that all encoders are properly connected before changing the encoder sign.

WARNING: Improperly defining the encoder and motor signs can result in an unstable (runaway) system. Exercise great caution when setting this parameter.

Perform the test described in Test and Troubleshooting to confirm the correct encoder sign setting.

 

Max accumulated encoder noise counts

This parameter defines the noise tolerance for the index position during the encoder A and B phases (for an illustration of these phases, see the figure Example Zero-Index Configuration). Specify the maximum number of encoder counts of error allowed relative to the zero index marker, assuming each index mark is a constant number of encoder counts. This tolerance does not get reset every index mark. This parameter controls the acceptable noise). If encoder zero-index checking is disabled, this parameter is ignored.

Example:

If you have a noisy encoder that misses an average of one count every 10 revolutions and set this parameter value to 7, an index error will be created after an average of 70 rotations in the same direction.

Max encoder noise counts per rev

This parameter defines a noise tolerance for the index position on the zero-index line (for an illustration of the index line, see the Example Zero-Index configuration figure). Using this parameter prevents the system from drifting in position while tolerating a small amount of noise on the encoder lines. If encoder zero-index checking is disabled, this parameter is ignored.

This parameter should be set to 0 until the settings for Counts per zero index and Encoder Configuration parameters are correctly specified.

Example:

If you have 3 spikes other than the actual index on the zero-index line per revolution, try setting this parameter to 3.

Perform hardware diagnostics

Displays the Perform hardware diagnostics menu to test the new parameters specified using the Encoder Specifications menu. See Perform hardware diagnostics for details.


Submit comments to: techpubs@adept.com
Last modified on: 9/29/2010
Copyright © 1994 - 2010. Adept Technology, Inc.