Product specifications
R01AN0168ED0101 Rev. 01.01 34
Application Note
Chapter 6 Performing Movements
}
}
if ( VAS >= 0 )
{
if ( VAS > PMS )
{
VAS = PMS
}
}
else
{
if ( ( -VAS ) > PMS )
{
VAS = ( - PMS )
}
}
/* Result output for Microstep & store old speed */
VAP = VAP + VAS
VPS = VAS
/* Calculate SW displayed position */
if ( ( VAP - VVP ) > PHC )
{
VVP = VAP - PHC
}
if ( ( VAP - VVP ) < ( - PHC ) )
{
VVP = VAP + PHC
}
/* Select Table according to speed and direction */
if ( VAS > 0 )
{
VDR = 0
if ( ( VAS <= PS1 ) or ( VAS >= PS2 ) )
{
VSP = 0
}
else
{
VSP = VSP
}
if( ( VAS >= PS3 ) and( VAS <= PS4 ) )
{
VSP = 1
}
else
{
VSP = VSP
}
}
else
{
if ( VAS < 0 )
{
VDR = 1
if ( ( ( -VAS ) <= PS1 ) or ( ( -VAS ) >= PS2 ) )
{