Recall Position on Power Up

This article applies to incremental rotary applications where a quadrature or multi turn SSI encoder is used. Normally, each time the RMC is powered up, the controller must go through a homing routine to find the current position. This can be done by moving the axis in open loop until a prox or limit switch is reached. Refer to the Homing topic in the RMCTools help file

In some cases, however, you may want to store the last read position before power was lost to the controller and simply resume from that location on power up. Care must be taken when using this approach because there are several things that can make the position deviate, and this error will build over time each time the power is cycled if a homing routine is never run. Error is caused by the position changing when the RMC is powered down. If the axis is in motion when the controller loses power, the axis might move some distance before it comes to a stop. The axis could also drift if hydraulic power is still present.

If you understand the drawbacks but still want to use this technique to try avoid homing an axis, you can use the following procedure:

[size=150]Create a Retained Variable[/size]

  1. In the variable table, create a Tag to show the last measured position
  2. Check the Retain option so that the value of this variable is retained through a power cycle.
    retain-variable.png

[size=150]Make the User Program[/size]
3. When the program is first run, set the Actual Position equal to the value from the variable table using the Set Actual Position (49) command
4. Add another step to assign the Actual Position to the retained variable.
5. Using the Jump to Repeat link type, constantly repeat the second step.
6. The program should look like this:

[size=150]Run the Program Automatically[/size]
Make the program run automatically on power up (or when the controller enters Run Mode)
7. Create a Program Trigger with the special condition _FirstScan
8. Select the user program to run on one of the tasks. No other programs should be run on the same task.
retain-trigger.png

[size=150]Prevent the Task from Halting[/size]
Make sure the program does not stop when the axis faults,
9. Right click on Programming and click Properties.
10. On the Halts tab, select Stop the Following Tasks
11. Deselect the task you are running the User Program on. This will ensure that an axis fault does not stop the program.
retain-nohalt.png

[size=150]Download and Update Flash[/size]
As always,
12. Save your project file
13. From the controller menu, Download All to Controller
14. From the controller menu, Update Flash
SavePosition.rmcprog (1.4 KB)

Delta Computer Systems Website