ST_CrankData

 

ST_CrankData - General Information

Overview

Type:

Data structure

Available as of:

V1.0.3.0

Inherits from:

-

Versions:

Current version

Description

Data structure which contains all crank data as well as all calculation results from the FB_Crank function block.

The following explains the components of the structure which are of direct importance for the user. The remaining components are POU calculation results which are saved in the structure.

Structure Elements

User specifications

The section "User specifications" contains those values which must be provided by the user before the function block is activated.

Variable

Data type

Description

lrRadius:

LREAL

Crank radius (length R in figure 1). Unit: length units, range: > 0.0)

lrPushRod:

LREAL

Length of the crank push rod (length L in figure 1). Unit: length units, range: > 0.0)

lrOffset

LREAL

Offset between the center of the crank and the movement level of the linear axis (length D in figure 1). Unit: length units, range: - ∞ ... + ∞

lrXStart

LREAL

User-defined zero position of the linear position. Allows for the practice-oriented choice of the zero position for the linear position. It is at the same time the distance from this zero position to the center of the crank. Unit: length units, range: - ∞ ... + ∞

xCrankLeft

BOOL

This variable must be set to TRUE when the crank push rod points to the left. If it points to the right, this variable must be set to FALSE.

xRange

BOOL

There are two possible ranges of motion for some cranks which cannot carry out a complete rotation. If this variable is TRUE, the POU assumes that the crank is moving in range 1, otherwise in range 2. It should be noted that ranges 1 and 2 have no direct geometrical interpretation. In order to determine which range lies where, xRange must be set accordingly. The limits of the angular range are then shown in the variables lrPhiLogMin and lrPhiLogMax.

The extreme position of the linear axis represents a critical point in the transformation, since the velocity of the linear axis must be zero at that point, independent of the velocity of the crank axis. Therefore, it is not possible to set any linear axis motion beyond this point; otherwise, the velocity of the crank axis could have a pole position. To eliminate this problem, the crank transformation is replaced by a polynomial of the fifth degree, whose slope in this range never becomes zero, in a configurable range in the extreme positions of the linear axis. In this range, the linear axis no longer follows the set motion. The velocity of the crank axis, though, remains limited.

The intervals during which the polynomials are active are set in length units of the linear axis. They correspond to the logical position of the linear axis (see section 4). The variables listed below list the widths of the interval parts from extreme position downwards (Low) and upwards (High). The total width of the interval is consequently the sum of both values.

Variable

Data type

Description

lrP5Pole1IntervalLow

LREAL

Width of the lower part of the interval around the minimum position of the linear axis. Unit: length units, range: > 0.0

lrP5Pole1IntervalHigh

LREAL

Width of the upper part of the interval around the minimum position of the linear axis. Unit: length units, range: > 0.0

lrP5Pole2IntervalLow

LREAL

Width of the lower part of the interval around the maximum position of the linear axis. Unit: length units, range: > 0.0

lrP5Pole2IntervalHigh

LREAL

Width of the upper part of the interval around the maximum position of the linear axis. Unit: length units, range: > 0.0

If the crank cannot carry out a complete rotation, there is just one extreme position of the linear axis. The values P5Pole1IntervalLow and P5Pole1IntervalHigh should always be used in this case.

The above intervals may be chosen so large that they overlap. In this case there is a further option available to adapt the crank movement to the requirements of the application in order, e.g. to keep the maximum occurring velocity below a specific value. With overlapping interpolation intervals, the corresponding range is interpolated by a polynomial-straight-polynomial combination. In regard to the maximum occurring values, this normally performs more favorably than the interaction of two polynomials The two variables below are used to define the range in which the polynomials are active. In the remaining ranges, a linear function is used.

Variable

Data type

Description

lrP5RangeLow

LREAL

Determines the length of the lower range which is interpolated with a polynomial. Unit: length units, range: > 0.0

lrP5RangeHigh

LREAL

Determines the length of the upper range which is interpolated with a polynomial. Unit: length units, range: > 0.0

If the sum of these values is equal to the distance between the two extreme positions of the linear axis, the resulting curve contains no straight section.

Important: The parameters P5Pole1IntervalLow, P5Pole1IntervalHigh, P5Pole2Inter­valLow, P5Pole2IntervalHigh, P5RangeLow and P5RangeHigh must always have reasonable values, even when these are not necessary for the relevant application.

Variable

Data type

Description

diXLogEqualXMechRange

DINT

Determination of the range in which the logical position corresponds to the mechanical position. Thus:

diXLogEqualXMechRange = 1 ->

XLog = XMech in the range lrPhiLogMin ... lrPhiLogSwitch

diXLogEqualXMechRange = 2 ->

XLog = XMech in the range lrPhiLogSwitch ... lrPhiLogMax

lrUserMechPosOffset

LREAL

Offset of output q_lrUserCrankMechPosition relative to output q_lrCrankMechPosition.

lrUserMechPosDirection

LREAL

Direction of rotation of output q_lrUserCrankMechPosition. If this parameter = 1.0, the outputs q_lrUserCrankMechPosition and q_lrCrankMechPosition have the same rotation direction. If = -1.0, the directions of rotation are opposite.

Calculated mechanical data

The section "Calculated mechanical data" contains the calculated mechanical values which result from the specifications made in the previous section (no presetting is possible!)

Variable

Data type

Description

diNumberOfRanges

DINT

Number of possible ranges of motion of the crank (1 or 2)

xEndlessCrank

BOOL

oTRUE: crank can make complete rotations

oFALSE: the crank can only move within a limited range

lrXMechMin

LREAL

Minimum value of the mechanical linear position (depends on xRange and xCrankLeft). Unit: length units

lrXMechMax

LREAL

Maximum value of the mechanical linear position (depends on xRange and xCrankLeft). Unit: length units

lrPhiMin

LREAL

Mechanical angle at which the allowable range of crank motion begins (clockwise rotation assumed, dependent on xRange). Unit: degrees

lrPhiMax

LREAL

Mechanical angle at which the allowable range of crank motion ends (clockwise rotation assumed, dependent on xRange). Unit: degrees

lrPhiXMechMin

LREAL

Mechanical angle at which the linear axis assumes the position lrXMechMin. Unit: Degree

lrPhiXMechMax

LREAL

Mechanical angle at which the linear axis assumes the position lrXMechMax. Unit: Degree

Calculated logical data

The section "Calculated logical data" contains the calculated logical values which result from the specifications made in section "Calculated mechanical data" (no presetting is possible!)

Variable

Data type

Description

lrXLogMin

LREAL

Minimum value of the logical position of the linear axis. Unit: length units

lrXLogSwitch

LREAL

Reflection point of the logical position. Up to this point, the logical and the mechanical positions of the linear axis correspond, but not beyond this point. Unit: length units (cf. diXLogEqualXMechRange)

lrXLogMax

LREAL

Maximum value of the logical position of the linear axis. Unit: length units

lrPhiLogMin

LREAL

Minimum value of the logical crank angle. Unit: Degree

lrPhiLogSwitch

LREAL

Logical crank angle at which the logical linear position assumes the value lrXLogSwitch. Unit: Degree

lrPhiLogMax

LREAL

Maximum value of the logical crank angle. Unit: Degree

xXLogDirPos

BOOL

The logical position is strictly monotonic over the entire range lrPhiLogMin ... lrPhiLogMax and defined such that it corresponds to the mechanical position in the range defined by diXLogEqualXMechRange. The behavior of the mechanical position thus determines if the logical position is always monotonically increasing or decreasing upon the transition of the logical angle from lrPhiLogMin to lrPhiLogMax. In the first case, xXLogDirPos = TRUE, in the second case xXLogDirPos = FALSE.

diP5NumberOfPoles

DINT

Variable for internal use.

alrP5XLimLow

ARRAY[0..5] OF LREAL

Variable for internal use.

alrP5XLimHigh

ARRAY[0..5] OF LREAL

Variable for internal use.

alrP5Coefficients

ARRAY[0..5,0..5] OF LREAL

Variable for internal use.

xValidData

BOOL

Variable for internal use.

xSynchron

BOOL

Variable for internal use.

Mechanical and Logical Quantities

Mechanical and logical quantities were frequently discussed in the previous section. This section will explain the reason for the availability of these two types of quantities:

The mechanical quantities are those quantities which are actually observed:

The mechanical crank angle is the angle φ. Its range is [0°, 360°]. The mechanical linear position is the user-defined position of the slide, e.g. its distance from the defined zero point lrXStart measured in a positive X direction.

The logical quantities are quantities that were established in order to simplify calculations and sequences in the POU.

In regard to the calculations which must be made, it is disadvantageous when, upon a complete crank rotation, the unavoidable 360° jump always occurs at the transition point 360°-> 0°. Instead, experience shows it to be more favorable to move this jump to the boundary points of the allowable angle range. The logical crank angle is thus an angle which simply moves in another range (e.g. - 70° to 290° or 50° to 410°). Its range begins at the lower boundary of the allowable crank angle range (assuming clockwise rotation). The mechanical crank angle can thus be extracted from it as follows:

Mechanical crank angle = (logical crank angle + 360°) MOD 360°

When the linear motion is specified, a principal problem occurs. The inverse transformation linear position -> crank angle is ambiguous since there are always linear positions which correspond to two crank angles. In order to solve this problem of ambiguity, the logical linear position is introduced so that unambiguous movements of the linear axis can be specified.

The logical linear position is obtained from the mechanical linear position through a reflection operation. Here, the mechanical linear position is reflected on one of its extreme points. The logical position always corresponds with the mechanical in one range. This is defined by the parameter diXLogEqualXMechRange.

If diXLogEqualXMechRange = 1, the following holds:

If one starts at lrPhiLogMin and moves in the direction of increasing Phi's, then the logical linear position initially corresponds to the mechanical linear position up to this extreme point. Thereafter, the logical and mechanical positions separate: the mechanical position is changed in the opposite direction, while the logical position continues to change in the same direction. The behavior of the mechanical position when starting at lrPhiLogMin thus determines the behavior of the logical position in the entire range lrPhiLogMin ... lrPhiLogMax. If the logical position continuously increases, the variable xXLogDirPos = TRUE; if it continuously decreases, xXLogDirPos = FALSE applies.

If diXLogEqualXMechRange = 2, the following holds:

If one starts at lrPhiLogMax and moves in the direction of decreasing Phi's, then the logical linear position initially corresponds to the mechanical linear position up to the extreme point. Thereafter, the logical and mechanical positions separate: the mechanical position is changed in the opposite direction, while the logical position continues to change in the same direction. The behavior of the mechanical position when starting at lrPhiLogMin thus determines the behavior of the logical position in the entire range lrPhiLogMin ... lrPhiLogMax. If the logical position continuously increases, the variable xXLogDirPos = TRUE; if it continuously decreases, xXLogDirPos = FALSE applies.

The following explanations serve as examples for the case diXLogEqualXMechRange = 1. The corresponding applies for the case of diXLogEqualXMechRange = 2

If the crank can carry out complete rotations (xEndlessCrank = TRUE), the relationships are relatively simple. At lrPhiLogMin, the minimum mechanical linear position is assumed. This also equals the minimum logical position lrXLogMin. The maximum mechanical linear position lrXMechMax is assumed at the angle lrPhiLogSwitch. The following holds: lrXLogSwitch = lrXMechMax. Up to this point, the mechanical and the logical positions correspond. In the range lrPhiLogSwitch ... lrPhiLogMax (in this case, lrPhiLogMax = lrPhiLogMin + 360°), the mechanical position decreases again, while the logical position continues to increase, reaching its maximum value lrXLogMax = 2.0 * lrXMechMax - lrXMechMin at lrPhiLogMax. In this case, xXLogDirPos is always TRUE.

If the crank cannot carry out complete rotations (xEndlessCrank = FALSE), things are somewhat more complicated. If one starts at the lower boundary lrPhiLogMin of the allowable angle range, the mechanical position may either increase or decrease, depending on the data of the crank and the chosen angle range (xRange). One can prove in this case that each angle range contains at the most one extreme value of the mechanical linear position. This is assumed for the angle lrPhiLogSwitch. In the range lrPhiLogMin ... lrPhiLogSwitch the logical position again corresponds to the mechanical position as described above, in the range lrPhiLogSwitch ... lrPhiLogMax, the values separate again. If the mechanical position increases in the range lrPhiLogMin ... lrPhiLogSwitch, xXLogDirPos = TRUE applies and the logical position increases over the entire range lrPhiLogMin ... lrPhiLogMax. If the mechanical position decreases in the range lrPhiLogMin ... lrPhiLogSwitch, xXLogDirPos = FALSE applies and the logical position decreases over the entire range lrPhiLogMin ... lrPhiLogMax. If xXLogDirPos = TRUE, position (lrPhiLogMin) = lrXLogMin, position (lrPhiLogMax) = lrXLogMax applies, if xXLogDirPos = FALSE position (lrPhiLogMin) = lrXLogMax, position (lrPhiLogMax) = lrXLogMin applies.