Hello,
I setup lab13C for running the system for moving between 2 points about 4mm. it seem a different position movement between st-curve and Trapezoidal, I checked the encoder and seem during Trapezoidal movement encoder count less than st-curve.
How it possible to make both method start stop as the same position?
I just change below side
// Establish the Velocity, Acceleration, Deceleration, and Jerk Maximums
velMax = _IQ24(USER_MOTOR_MAX_SPEED_KRPM * ST_SPEED_PU_PER_KRPM);
accMax = _IQ24(10.0);
jrkMax = _IQ20(62.5);
// Configure SpinTAC Position Plan: Sample Time, LoopENB
STPOSPLAN_setCfg(stObj->posPlanHandle, _IQ(ST_SAMPLE_TIME), false);
// Configure halt state: PosStep[MRev], PosStepFrac[MRev], VelEnd, AccMax, JrkMax, Timer
STPOSPLAN_setCfgHaltState(stObj->posPlanHandle, 0, 0, velMax, accMax, jrkMax, 1000L);
//Example: STPOSPLAN_addCfgState(handle, PosStep[MRev], PosStepFrac[MRev], StateTimer[ticks]);
STPOSPLAN_addCfgState(stObj->posPlanHandle, 0, 0, 0L); // StateIdx0: A
STPOSPLAN_addCfgState(stObj->posPlanHandle, 0, _IQ24(0.2), 20L); // StateIdx1: B 12mm _IQ24(0.584)
STPOSPLAN_addCfgState(stObj->posPlanHandle, 0, _IQ24(-0.2), 20L); // StateIdx2: C
//Example: STPOSPLAN_addCfgTran(handle, FromState, ToState, CondOption, CondIdx1, CondiIdx2, VelLim[pups], AccLim[pups2], DecLim[pups2], JrkLim[pups3]);
// NOTE: The deceleration limit must be set between the following bounds [acceleration limit, 10*acceleration limit]
STPOSPLAN_addCfgTran(stObj->posPlanHandle, STATE_A, STATE_B, ST_COND_NC, 0, 0, _IQ(0.3 * ST_SPEED_PU_PER_KRPM), _IQ24(11), _IQ24(11), _IQ24(5)); // From StateA to StateB
STPOSPLAN_addCfgTran(stObj->posPlanHandle, STATE_B, STATE_C, ST_COND_NC, 0, 0, _IQ(0.6 * ST_SPEED_PU_PER_KRPM), _IQ24(7), _IQ24(7), _IQ24(5)); // From StateB to StateC
STPOSPLAN_addCfgTran(stObj->posPlanHandle, STATE_C, STATE_B, ST_COND_NC, 0, 0, _IQ(0.6 * ST_SPEED_PU_PER_KRPM), _IQ24(7), _IQ24(7), _IQ24(5)); // From StateC to StateB
}
is the trapezoidal less accurate than st-curve? is not both movement method count same amount of encoder counter to move?
I can command the motor for 4mm movement and do correctly, but seem there is little different between ST-Curve and Trapezoidal move curve type ( Trapezoidal move less than 4mm)
Best
Reza