Product specifications

R01AN0168ED0101 Rev. 01.01 33
Application Note
Chapter 6 Performing Movements
6.1.3 Variable Description
(1) Actual Algorithm Values VAXn, VASn, VAPn
These values are representing the current Movement Calculator results for the
physical channel
n. Acceleration, speed and position values have to be
interpreted like their associated parameter values.
Checking the values is possible anytime to monitor the movements by
software.
(2) Temporary Storages VPSn, VPTn
These are internal values of the Movement Calculator, to resume the
calculation after the next processing start. Previously calculated values and
intermediate results are stored there.
Software access to these values is not senseful, but nevertheless possible.
(3) Virtual Position VVPn
A position value, which was submitted a hysteresis can be derived from the
VVPn variable. Its generation is explained in 5 “Hysteresis Correction PHCn”.
(4) Flags of PWM Table Selection on Low-Precision Operation VDRn, VSPn
These flags are representing the PWM sub-table selection within a physical
channel ‘s assigned virtual table set, if low-precision operation is chosen
(
CCPn is cleared).
In case of high-precision operation, these flags have no meaning, and the
associated parameters
PS1n, PS2n, PS3n and PS4n are not considered.
6.1.4 Algorithm Code
/* Calculation of new acceleration and speed */
VPT = VPT + ( ( PMP - VPT) >> PDF )
VAS = ( VPT - VAP ) >> PDF
VAX = VAS - VPS
/* Limitation of the acceleration and speed */
if ( VPS > 0 )
{
if ( VAX > PAL )
{
VAS = VPS + PAL
}
if ( VAX < ( - PDL ) )
{
VAS = VPS - PDL
}
}
else
{
if ( VAX < ( - PAL ) )
{
VAS = VPS - PAL
}
if ( VAX > PDL )
{
VAS = VPS + PDL