Stepper Scaling

Defining the Valid 16-bit Position Range

For general scaling information, see the Scaling Overview topic.

Because the RMC uses 16-bit positions, positions must all fit within a range of 65,536 position units. Because position units are user definable, and speed control and indexing applications can get around this limitation, most applications are not limited by this range. See the section below on defining position units.

Stepper axes use the Coordinate Limit parameter to define the valid range of position units. The valid Coordinate Limit values extend from 65535 to 0, and the valid position range then extends from the Coordinate Limit value to the Coordinate Limit plus 65535. Delta recommends using one of the following two values and ranges:

Coordinate Limit

Range

0

0 to 65535

-32768

-32768 to 32767

The first uses unsigned position units and the second uses signed position units. Other position ranges require extra work to use with PLCs.

Translating to and from Position Units

The method of setting up the scale for a stepper axis with quadrature feedback differs significantly from the scaling of other axis types on the RMC. This was done to better fit the needs of stepper applications.

The stepper module has two scales. One scale defines the relationship between incoming quadrature counts and the resultant Actual Position. The second scale defines the relationship between the Target Position and the outgoing steps.

Each scale is defined as a ratio of two numbers. The user can enter both numbers in each of the ratios, although one number is shared by both ratios. Here is the definition of the two scales:

image\ebx_-1456212037.gif

 

image\ebx_297808027.gif

 

The three values the user can enter are Steps/Rev, Pos Units/Rev, and Quad Cnts/Rev. These are parameters for each stepper axis. You will notice that both scales use Pos Uints/Rev.

The RMC allows the user to select the direction of both the stepper and quadrature counts with respect to position units. That is, phase A leading phase B in the quadrature can mean increasing or decreasing actual positions. Similarly, a low direction line can be the result of increasing or decreasing target positions.

The sign of the Quad Counts/Rev parameter controls the quadrature direction per the following chart:

Quad Counts/Rev

The actual position increases when…

+

…phase A leads phase B

-

…phase B leads phase A

 

The Reverse Drive bit of the Configuration Word controls the use of the direction output to the stepper motor per the following chart:

 

When the target positions…

Reverse Drive bit

…increase…

…decrease…

0

…Direction will be low.

…Direction will be high.

1

…Direction will be high.

…Direction will be low.

These scales are used to determine the change in steps from the change in target position and to determine the change in actual position from the change in quadrature counts according to the following formulas:

 image\ebx_-825861006.gif

 

image\ebx_-1524252612.gif

 

Note: The RMC ensures that no fractional position units or steps are lost in these conversions. That is, even though the result of this equation will likely not be a whole number, the remainder is carried from scan to scan.

 

Note: If quadrature feedback is not used, enter a 0 in QUAD CNTS/REV. This eliminates the Following Error from being generated.

There are several of ways that these scales can be set up. The following examples illustrate the potential uses of these scale parameters.

Example 1:

The user has a 100-line encoder, a 1.8°-per-step (200 steps per revolution) motor, and a stepper drive configured to use half steps. The encoder is mounted on the same shaft as the stepper motor, so each will turn one revolution in the same amount of time.

The user chose these devices so that the number of quadrature counts per revolution is equal to the number of half steps per revolution, and wishes to use the raw counts as position units. That is, because the stepper drive uses half steps there are 400 steps per revolution to match the 400 quadrature counts per revolution on the 100-line encoder.

Therefore, the ratio of steps to counts to position units is 1:1:1. The following parameters achieve this:

Parameter

Value

Steps/Rev

400

Position Units/Rev

400

Quad Counts/Rev

400

Example 2:

The user has a 256-line encoder, a 7.5°-per-step (48 steps per revolution) motor, and a full-step stepper drive. Therefore, the encoder generates 1024 quadrature counts per revolution. The encoder is mounted on the same shaft as the stepper motor, so each will turn one revolution in the same amount of time. The user wants positions to be given in degrees, so we will have 360 position units per revolution.

In this example, we simply enter the following values direct from our calculations above:

Parameter

Value

Steps/Rev

48

Position Units/Rev

360

Quad Counts/Rev

1024

Therefore, each quadrature count will affect the actual position by 360/1024 of a position unit. Each target position unit causes 48/360 of a step. Notice that this means that it takes 7.5 position units to get one step output. This would need to be taken into consideration when the Following Error Window parameter is set.

Example 3:

Suppose we have the same motor, drive, and encoder as in the previous example: the stepper has 48 steps per revolution, and the encoder has 256 lines. However, this time the stepper motor is on shaft A and the encoder is on shaft B. Shaft A must turn 15 revolutions in order to turn shaft B one revolution; the gear ratio is 1:15. The user wishes to measure positions in degrees on shaft B.

Therefore, we define a revolution as one turn of shaft B. This means we have 1024 quadrature counts per revolution of our 256-line encoder, and 360 position units per revolution. Calculating the number of steps per revolution of shaft B requires multiplying by the gear ratio between shaft A to shaft B:

image\ebx_2100019912.gif

 

image\ebx_-1939251975.gif

 

 

Therefore, our parameters should be as follows:

Parameter

Value

Steps/Rev

720

Position Units/Rev

360

Quad Counts/Rev

1024

Therefore, each quadrature count will affect the actual position by 360/1024 of a position unit. Each target position unit causes 720/360 of a step or 2 steps. Therefore, half of a position unit causes one step.

Suppose that when these parameters are entered, it is found that the stepper moves in the correct direction, but the actual positions go backwards. This means that the count to position unit scale needs to be reversed. As described above, reversing the sign of the Quad Counts/Rev parameter changes the direction of this scale. Therefore, we would use the following parameters:

Parameter

Value

Steps/Rev

720

Position Units/Rev

360

Quad Counts/Rev

-1024

Example 4:

Suppose we have a stepper motor with 1.8° per step or 200 steps per revolution, and its drive is configured to have 25 microsteps per step. Therefore, the RMC will need to give 5000 steps to turn the motor one revolution. A 1000-line encoder is on the same shaft, which generates 4000 quadrature counts per revolution.

The motor moves a belt, and the user wants positions in inches that the belt moves. Therefore, we need to be able to determine the distance the belt moves per motor revolution. This depends on the circumference of the drive wheel. If we assume the radius of this wheel is 2.5 inches, then the circumference is 2 x p x 2.5 inches or 15.70796 inches.

Given this, a first attempt might be to enter the nearest integer in the POS UNITS/REV field, so our parameters would be:

Parameter

Value

Steps/Rev

5000

Position Units/Rev

16

Quad Counts/Rev

4000

There are two problems with this solution. First, the user sees the position only in inches; no fractions of an inch will be displayed. Second, the distance reported will be off by 1.825% or 0.292” per revolution, which is unacceptable in most applications, especially those involving multiple motor turns.

We can improve both of these problems by using hundredths of an inch as our position units. Since we have about 1571 hundredths of an inch per revolution, we could use the following parameters.

Parameter

Value

Steps/Rev

5000

Position Units/Rev

1571

Quad Counts/Rev

4000

This eliminates the first problem if a hundredth of an inch is an adequate resolution. It also reduces the position error to 0.013% or 0.002” per revolution. This is a major improvement and may be adequate for many applications.

We can further improve our scale by maximizing the dynamic range of these three parameters. That is, since these parameters are used as ratios, we can multiply each by a constant without changing the effective scales. Any multiplier—integer or non-integer—is acceptable as long is at lowers the scaling error and doesn’t exceed the parameter limits: Steps/Rev and Position Units/Rev are limited to 65535, and Quad Counts/Rev is limited to ±32767. A good value to multiply by is 5. The Position Units/Rev parameter becomes 15.70796 x 100 x 5, which is 7853.98 and gets rounded to 7854. Our new parameters are:

Parameter

Value

Steps/Rev

25000

Position Units/Rev

7854

Quad Counts/Rev

20000

Because we multiplied these parameters by 5, the Position Units/Rev parameter is equivalent to 7854/(5 x 100) or 15.70800 inches per revolution. This gives a scaling error of 0.0002% or 0.000037” per revolution. This is effectively the best we can do with our scaling precision for this application.

Two questions remain: What is the effect of this remaining scaling error? What are the limitations of the 16-bit positions? Each is discussed in turn below.

What is the effect of the remaining scaling error?

The remaining scaling error must be carefully evaluated for your system. In many cases it may be adequate, or perhaps the mechanical error overshadows the remaining scaling error. For example, the tolerance of the radius of the driving wheel may result in a greater error than the scaling error.

However, in many indexing applications the error for a single cycle is acceptable, but over many cycles, the error accumulates until it becomes significant. If this is the case, then you may need to use the home input or index pulse to reset the positions between—or even during—each cycle or set of cycles. See Quadrature Homing for details on this topic.

If the scaling error still appears too large, contact a Delta Computer Systems Application Specialist to discuss your system. See Technical Support for details on contacting Delta.

What are the limitations of the 16-bit positions?

Because positions are stored in 16-bits, the RMC can neither display positions greater than 65535 position units nor receive commands to move more than 65535 position units. In our application, we have position units equal to a hundredth of an inch, so this limitation is 655.35 inches (over 54 feet). This won’t limit most linear applications, but applications requiring longer distances will need to use a lower position unit resolution. For example, using tenths of an inch gives a range of 6553.5 inches, and using inches gives a range of 65535 inches. However, this usually increases the scaling error.

In indexing applications, the range limitation of 655.35 inches may become a problem in another way. Suppose that one cycle moves only 6 inches and this cycle is repeated 10,000 times per day. Therefore, in one day the total movement will be 60,000 inches, which is beyond our maximum of 655.35 inches. The proper way to deal with this problem is to reset the position at the beginning or end of each cycle, using either quadrature homing or the Zero Position/Set Target or Offset Positions commands. Therefore, the positions would only go as high as 600 (6.00 inches) before being reset back to 0 (0.00 inches).

 

See also:

Stepper Overview

Stepper Wiring

Stepper Configuration

Stepper LED Indicators

Stepper Specifications

Stepper Compensation

Homing

 


Copyright (c) 1997-2015 by Delta Computer Systems, Inc.