FC_RestoreAxisPosition - General Information
Type: |
Function |
Available as of: |
V1.0.3.0 |
Versions: |
Current version |
Restoring the axis position after switching the PacDrive controller on/off
With this function, the axis position can be maintained after a PacDrive controller on/off switching procedure. It is not necessary to take the encoder period or ratio of the feed constant, the gear factor (GearIn, GearOut) and the machine period into consideration.
The use of a gear with the resolution 2n is not necessary. It is a condition for using this function that the encoder has not been turned by more than half of its maximum value range (encoder period) while the PacDrive controller was turned off. The function is unable to recognize when the encoder is moved out of this range and so therefore cannot generate an error. In this case, a FALSE position is restored.
The axis position and the encoder position are saved in remanent variables in the NVRam using the FC_SaveAxisPosition() function. The function must be called cyclically.
By means of the function FC_RestoreAxisPosition(), the remanent variables are re-read and the axis position is calculated and set. The function should only be called up once.
By means of the PacDrive LMC Pro, the remanent memory area is buffered using batteries.
Input |
Data type |
Description |
---|---|---|
i_ifDrive |
IF_Drive |
Input for the axis that shall be controlled. |
i_lrUserPeriod |
LREAL |
Machine period |
i_lrRestoreWindow |
LREAL |
Maximum permissible deviation between the saved and the restored axis positions. |
iq_stRestorePosition |
Remanent data |
Output |
Data type |
Description |
---|---|---|
q_etDiag |
General library-independent statement on the diagnostic. A value not equal to ET_Diag.Ok corresponds to an diagnostic message. |
|
q_etDiagExt |
POU-specific output on the diagnostic. q_etDiag = ET_Diag.Ok -> Status message q_etDiag <> ET_Diag.Ok -> Diagnostic message |
|
q_sMsg |
STRING[80] |
Event-triggered message which gives more detailed information on the diagnostic state. |
q_etDiag |
q_etDiagExt |
Enumeration value |
Description |
---|---|---|---|
OK |
0 |
Ok |
|
DriveConditionInvalid |
175 |
The drive encoder is invalid. |
|
DriveConditionInvalid |
195 |
The position is outside the restore window. |
|
DriveConditionInvalid |
196 |
Restoring was interrupted. |
|
InputParameterInvalid |
193 |
The checksum is invalid. |
|
InputParameterInvalid |
194 |
The non-volatile memory (NVRam) does not contain any more valid data. |
|
InputParameterInvalid |
3 |
The connected drive is invalid. |
|
SercosConditionInvalid |
19 |
The Sercos bus is not in phase 4. |
|
UnexpectedProgramBehavior |
1 |
An unintended detected error occurred during execution. |
Enumeration name: |
CheckSumInvalid |
Enumeration value: |
193 |
Description: |
The checksum is invalid. |
Issue |
Cause |
Solution |
---|---|---|
- |
The data stored in i_stRestorePosition are inconsistent. The position cannot be restored. |
New homing of the drive required. |
Enumeration name: |
DataNVRamInvalid |
Enumeration value: |
194 |
Description: |
The non-volatile memory (NVRam) does not contain any more valid data. |
Issue |
Cause |
Solution |
---|---|---|
- |
The data stored in the NVRam are invalid. Therefor, the position cannot be restored from i_stRestorePosition. |
Verify the NVRam, verify the buffer battery and replace if necessary. New homing of the drive required. |
Enumeration name: |
DriveEncoderInvalid |
Enumeration value: |
175 |
Description: |
The drive encoder is invalid. |
Issue |
Cause |
Solution |
---|---|---|
- |
The axis encoder is not supported. |
Use an axis with a different encoder. |
Enumeration name: |
DriveInvalid |
Enumeration value: |
3 |
Description: |
The connected drive is invalid. |
Issue |
Cause |
Solution |
---|---|---|
- |
At the input i_ifDrive, no drive was applied. |
At the input i_ifDrive, a valid drive must be transferred. |
- |
The connected drive does not support all required functionalities. |
Establish which functionalities are not supported by the drive by means of output q_sMsg. Use a drive which supports all required functionalities. |
Enumeration name: |
Ok |
Enumeration value: |
0 |
Description: |
Ok |
The axis position has been restored successfully.
Enumeration name: |
OutOfRestoreWindow |
Enumeration value: |
195 |
Description: |
The position is outside the restore window. |
Issue |
Cause |
Solution |
---|---|---|
- |
The axis has been moved too far since the last time the position has been saved. |
Set the axis position back into the window. Extend the limits of the window i_lrRestoreWindow. |
Enumeration name: |
RestoreInterrupted |
Enumeration value: |
196 |
Description: |
Restoring was interrupted. |
Issue |
Cause |
Solution |
---|---|---|
- |
Reading the encoder has been interrupted repeatedly by the SERCOS. |
Ensure that the execution of the function is not interrupted for too long by other tasks, so that it can be interrupted by the SERCOS task only once. |
Enumeration name: |
SercosNotInPhaseFour |
Enumeration value: |
19 |
Description: |
The Sercos bus is not in phase 4. |
Issue |
Cause |
Solution |
---|---|---|
- |
The parameter State of the SERCOS bus is not 4. |
Set the SERCOS bus parameter PhaseSet to 4. Verify the SERCOS bus for errors. |
Enumeration name: |
UnexpectedFeedback |
Enumeration value: |
1 |
Description: |
An unintended detected error occurred during execution. |
Issue |
Cause |
Solution |
---|---|---|
- |
An error occurred in the internal execution. |
Please inform the support team about this error. |