FC_CalcProfileExtremeValues

 

FC_CalcProfileExtremeValues - General Information

Overview

Type:

Function

Available as of:

V1.0.3.0

Versions:

Current version

Task

The function calculates the minimum and maximum values (velocity, acceleration, position) of a cam profile defined in a ST_MultiCam structure.

Description

Using this, it is possible e.g. to determine if there is sufficient time left to run a certain cam profile within the machine cycle.

The function calls the FC_ProfileCompute function up several times (i_uiNumberOfSteps) and calculates the values.

The extreme values for m and k are calculated by numerical differentiation of the functional values.

The results are much more accurate when more steps are used for the calculation. However, the time requirement also increases with the number of calculating steps.

The cycle time monitoring will not be modified by the function.

The result must be multiplied with the master velocity for calculating the maximum axis velocity of the slave axis.

lrMaxAxisVel:= q_stProfileExtremeValues.lrMaxM * lrMasterVel

The result must be multiplied with the square of the master velocity for calculating the maximum axis acceleration of the slave axis.

lrMaxAxisAcc:= q_stProfileExtremeValues.lrMaxK * lrMasterVel * lrMasterVel

Interface

Input

Data type

Description

i_uiNumberOfSteps

UINT

Number of iteration steps

i_lrXStart

LREAL

Start of the interval in which the extreme values are to be calculated

i_lrXEnd

LREAL

End of the interval in which the extreme values are to be calculated

Output

Data type

Description

q_etDiag

GD.ET_Diag

General library-independent statement on the diagnostic.

A value not equal to ET_Diag.Ok corresponds to an diagnostic message.

q_etDiagExt

ET_DiagExt

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_stProfileExtremeValues

ST_ProfileExtremeValues

Output of the calculated extreme values

Input/Output

Data type

Description

iq_stMultiCam

ST_MultiCam

Definition of the cam for which the extreme values are to be determined

Diagnostic Messages

q_etDiag

q_etDiagExt

Enumeration value

Description

OK

Ok

0

Ok

InputParameterInvalid

BoundaryConditionInvalid

125

The boundary conditions are invalid.

InputParameterInvalid

NumberOfCamPointsRange

121

NumberOfCamPoints is outside the valid range.

InputParameterInvalid

NumberOfStepsRange

191

NumberOfSteps is outside the valid range.

InputParameterInvalid

RangeK

129

K is outside the valid range.

InputParameterInvalid

RangeM

130

M is outside the valid range.

InputParameterInvalid

UnknownCamType

126

The cam type is indeterminable.

InputParameterInvalid

XEndRange

192

XEnd is outside the valid range.

InputParameterInvalid

XFactorTooSmall

122

XFactor is too small.

InputParameterInvalid

XStartRange

119

XStart is outside the valid range.

InputParameterInvalid

YFactorTooSmall

124

YFactor is too small.

UnexpectedProgramBehavior

ProfileAlreadyInUse

116

The profile is already in use.

UnexpectedProgramBehavior

ProfileMemoryFull

127

The memory for tables from system profiles is full.

UnexpectedProgramBehavior

UnexpectedFeedback

1

An unintended detected error occurred during execution.

BoundaryConditionInvalid

Enumeration name:

BoundaryConditionInvalid

Enumeration value:

125

Description:

The boundary conditions are invalid.

Issue

Cause

Solution

-

When defining the motion profile in iq_stMultiCamData, the set boundary conditions cannot be complied with.

Verify the definition of the motion profile and particularly the boundary conditions of the sub-segments.

As an alternative, select different profiles for the sub-segments to be able to comply with all desired boundary conditions.

NumberOfCamPointsRange

Enumeration name:

NumberOfCamPointsRange

Enumeration value:

121

Description:

NumberOfCamPoints is outside the valid range.

Issue

Cause

Solution

-

At the input iq_stMultiCam.diNumberOfCamPoints, an invalid value has been transferred.

At the input iq_stMultiCam.diNumberOfCamPoints, a value greater than 0 and smaller than or equal to SystemInterface.MAX_NO_OF_SEG + 1 must be transferred.

NumberOfStepsRange

Enumeration name:

NumberOfStepsRange

Enumeration value:

191

Description:

NumberOfSteps is outside the valid range.

Issue

Cause

Solution

-

At the input i_uiNumberOfSteps, an invalid value has been applied.

At the input i_uiNumberOfSteps, a value greater than or equal to 3 and smaller than or equal to 360 must be transferred.

Ok

Enumeration name:

Ok

Enumeration value:

0

Description:

Ok

The extreme values have been calculated successfully.

ProfileAlreadyInUse

Enumeration name:

ProfileAlreadyInUse

Enumeration value:

116

Description:

The profile is already in use.

Issue

Cause

Solution

-

The motion profile is already in use.

Verify the motion data.

ProfileMemoryFull

Enumeration name:

ProfileMemoryFull

Enumeration value:

127

Description:

The memory for tables from system profiles is full.

Issue

Cause

Solution

-

The system profile memory is full.

Delete any profiles that are no longer needed using the SystemInterface.FC_ProfileDelete function

RangeK

Enumeration name:

RangeK

Enumeration value:

129

Description:

K is outside the valid range.

Issue

Cause

Solution

-

At the input iq_stMultiCamData.astCamPoint[ ].lrK, an invalid value has been applied.

Verify the values for iq_stMultiCamData.astCamPoint[ ].lrK

RangeM

Enumeration name:

RangeM

Enumeration value:

130

Description:

M is outside the valid range.

Issue

Cause

Solution

-

At the input Am Eingang iq_stMultiCam.astCamPoint[ ].lrM, an invalid value has been applied.

Verify the values for iq_stMultiCamData.astCamPoint[ ].lrM

UnexpectedFeedback

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.

UnknownCamType

Enumeration name:

UnknownCamType

Enumeration value:

126

Description:

The cam type is indeterminable.

Issue

Cause

Solution

-

The cam type of a point iq_stMultiCamData.astCamPoint is assigned with an invalid cam profile.

The cam types etCamType of all used cam points at the input iq_stMultiCamData.astCamPoint must be assigned with an element of the enumeration ET_CamType.

XEndRange

Enumeration name:

XEndRange

Enumeration value:

192

Description:

XEnd is outside the valid range.

Issue

Cause

Solution

-

At the input i_lrXEnd, a value that lies outside of the cam has been applied.

i_lrXEnd must lie within the cam defined at iq_stMultiCam.

XFactorTooSmall

Enumeration name:

XFactorTooSmall

Enumeration value:

122

Description:

XFactor is too small.

Issue

Cause

Solution

-

Two successive cam points iq_stMultiCam.astCamPoint[ ].lrX have a distance of less than 0.1 units.

Verify the definition of the cam and, if necessary, remove cam profiles that are too short.

XStartRange

Enumeration name:

XStartRange

Enumeration value:

119

Description:

XStart is outside the valid range.

Issue

Cause

Solution

-

At the input i_lrXStart, a number >= that at the input i_lrXEnd has been transferred.

Verify i_lrXStart and set it to a value not exceeding i_lrXEnd.

Verify i_lrXEnd and set it to a value exceeding i_lrXStart.

-

At the input i_lrXStart, a number which is smaller than the start of the cam has been transferred.

Verify i_lrXStart and transfer it into the range of the cam.

Verify the applied cam and define it such that i_lrXStart lies within the cam.

YFactorTooSmall

Enumeration name:

YFactorTooSmall

Enumeration value:

124

Description:

YFactor is too small.

Issue

Cause

Solution

-

A cam profile requiring a motion of the slave axis is to be used with identical start and end points.

At the input iq_stMultiCam.astCamPoint[i-1].etCamType, a cam profile of type ModSinCom has been applied. The value of the difference between its start point iq_stMultiCam.astCamPoint[i-1].lrY and its end point iq_stMultiCam.astCamPoint[i].lrY is smaller than Gc_lrZeroTolerance. This type of profile requires a motion of the slave cam.

At the input iq_stMultiCam.astCamPoint[i-1].etCamType, a cam profile of type ModAccTrCom has been applied. The value of the difference between its start point iq_stMultiCam.astCamPoint[i-1].lrY and its end point iq_stMultiCam.astCamPoint[i].lrY is smaller than Gc_lrZeroTolerance. This type of profile requires a motion of the slave cam.

At the input iq_stMultiCam.astCamPoint[i-1].etCamType, a cam profile of type HarmoComb has been applied. The value of the difference between its start point iq_stMultiCam.astCamPoint[i-1].lrY and its end point iq_stMultiCam.astCamPoint[i].lrY is smaller than Gc_lrZeroTolerance. This type of profile requires a motion of the slave cam.

At the input iq_stMultiCam.astCamPoint[i-1].etCamType, a cam profile of type SinStraightComb has been applied. The value of the difference between its start point iq_stMultiCam.astCamPoint[i-1].lrY and its end point iq_stMultiCam.astCamPoint[i].lrY is smaller than Gc_lrZeroTolerance. This type of profile requires a motion of the slave cam.