Input Description¶
CS_CalculateVelocity is necessary to execute some pre-calculations which are needed for the MC_CamSwitchSimple_c. It needs the actual position and the time related to this position to calculate the velocity. In addition, the position and velocity are transferred to the units which are used from MC_CamSwitchSimple_c.
ActEncoderPosition
Data_Type | Default_Value | Range | Unit |
---|---|---|---|
DWORD | - | - | - |
At input ActEncoderPosition, the position value of the encoder has to be given. It mus be a binary value.
ActEncoderTime
Data_Type | Default_Value | Range | Unit |
---|---|---|---|
DWORD | - | - | - |
At input ActEncoderTime, the time value related to the ActEncoderPosition has to be given. The resolution is nanoseconds.
Resolution
Data_Type | Default_Value | Range | Unit |
---|---|---|---|
WORD | - | - | - |
When the position should be used as it is, the value for resolution should be set to 0. Otherwise, resolution gives the value which is used to display 1 revolution.
For example, when to encoder provides 10 bits per revolution, the encoder value (ActEncoderPosition) would run from 0..1023.
- With resolution=360, the value would be converted to a 1° resolution and the positions for MC_CamSwitchSimple_c could run from 0..259.
- With resolution=0, the positions for MC_CamSwitchSimple_c could run from 0..1023.
ZeroShift
Data_Type | Default_Value | Range | Unit |
---|---|---|---|
DWORD | - | - | - |
At input Zero Shift, an offset to adjust the value of ActEncoderPosition, can be specified.
EncoderBitResolution
Data_Type | Default_Value | Range | Unit |
---|---|---|---|
WORD | - | - | - |
Number of bits which hold the relevant position for 1 revolution (8..32)
This parameter allows to adjust the calculation to different encoder resolutions. The encoder might deliver a single turn or multi turn value. The only requirement is to have a binary value which means 1 revolution should match 2:sup:n increments. n is then the value for EncoderBitResolution.
waitTime
Data_Type | Default_Value | Range | Unit |
---|---|---|---|
WORD | - | - | - |
At input waitTime the minimum time to wait between 2 calculations of velocity [µs] has to be specified.
waitInc
Data_Type | Default_Value | Range | Unit |
---|---|---|---|
WORD | - | - | - |
At input waitInc the minimum distance to wait between 2 calculations of velocity has to be specified.
When the velocity is low or the time between 2 measurements is very short, the velocity calculation with velocity = position/time will be imprecise. Therefore it is possible to give a minimum position distance (waitInc) and a minimum time distance (waitTime) which should be exceeded to perform a new calculation. The calculation will be executed when at least 1 of the 2 limits was exceeded. In addition, the velocity will be a average of 4 calculations.