After a Reset Controller:
Command Postion = 0
Actual Postion = 0
Origin Postion = 0
Physical Motor Position = 0
User commands an absolute move of 2000 counts:
Command Position = 2000
Actual Position = 2000
Origin Position = 0
Physical Motor Position = 2000
NOTE: Origin position will always equal 0 unless you click "Zero Position" in RapidSetup or call PositionSet() in RapidCode
User executes PositionSet(0) in RapidCode or clicks the button "Zero Position" in RapidSetup:
Command Position = 0
Actual Position = 0
Origin Position = 2000
Physical Motor Position = 2000
NOTE: The function PositionSet(x) sets the positions accordingly:
Origin Position = (actualPos + originPos - x)
Actual Position = x
Command Position = x
User commands another absolute move of 2000 counts:
Command Position = 2000
Actual Position = 2000
Origin Position = 2000
Physical Motor Position = 4000
User executes OriginPositionSet(1000) from RapidCode:
Command Position = 3000
Actual Position = 3000
Origin Position = 1000
Physical Motor Position = 4000
NOTE: The function OriginPositionSet(x) sets the positions accordingly:
Actual Position = (Origin Position - x) + Actual Position>
Command Position = (Origin Position - x) + Command Position</font>
Origin Position = x
HomeState = false
Using the Origin Variable
If you use one of our pre-defined homing routines you do not want to call this function after your system is "homed" because it will clear your home position. You can use OriginPositionSet() if you need to write your own custom homing routine, just remember to set the HomeState to true using HomeStateSet() because OriginPositionSet() clears HomeState to false
If it is important to set the Command or Actual Position to an exact value, you should use the OriginPositionSet() function. Calling OriginPositionSet() will modify both Command and Actual Positions by the same amount. For example, assume the Command and Actual Positions are 5,000 and 5,018 counts respectively and that the axis is not moving.
If Command Position = | If Actual Position | And you set Origin Variable | Then Command Position = | And Actual Position = |
| 5,000 | 5,018 | 5,000 | 0 | 18 |
| 5,000 | 5,018 | 5,018 | -18 | 0 |
During motion, you should never call ActualPositionSet() or CommandPositionSet() functions.
Setting a new Command Position using ActualPositionSet() should be done with caution, because the controller will immediately try to servo to the new position. If the new and old command positions differ by a large amount the axis may fault (limit error) or jump to the new position at very high speed.
Calling OriginPositionSet() while an axis is in motion will change the final target position's value. This will not change the trajectory however. If the axis was to originally move 5000 counts, then the axis will still move a total of five thousand counts. See the table below.
Start
Position | Origin
Position | Actual
Position | End
Position | Comment |
0 | 0 | 0 | 5000 | The beginning of a 5000 count move, origin currently 0. |
| 0 | 0 | 2500 | 5000 | Origin is about to be set to 2000. |
| -2000 | 2000 | 500 | 3000 | Origin has been changed to 2000. |
| -2000 | 2000 | 3000 | 3000 | Motion is complete. Distance traveled still 5000 counts. |