Hi Charbely,
I was thinking you might add a new function call of Kinematics->ComputeAnglesOption(i) into the CCoordMotion:: DoRateAdjustments function (see code fragment below). The DoRateAdjustments function is executed after the trajectory segments have been finalized in the sense that they will no longer be split, deleted, or moved. The XYZ path has already been finalized but the motion trajectory has not yet been planned. It then examines each i'th segment to determine the kinematic actuator limitations on velocity and acceleration based on the direction and "curvature" (direction change from the previous segment). The Trajectory structure for the i'th segment can be referenced with GetSegPtr(i). The trajectory structure (SEGMENT) contains the starting and ending point of the segment so the tangent angle could be computed. The a0 a1 values could be modified to perform the angular rotation from the previous angle to the tangent angle as I described in the previous diagram. ComputeAnglesOption would be a virtual function where each Kinematic subclass could do whatever it wants including nothing as defined in the base class. The rate adjustments would then be subsequently performed that would include limiting the motion to avoid exceeding any actuator constraints including the A axis. I'm not sure what other issues would need to be handled but that seems like the best approach to me.
Code:
// limit speeds based on proportion in that direction
int CCoordMotion::DoRateAdjustments(int i0, int i1)
{
double tdx,tdy,tdz,tda,tdb,tdc,rate,FeedRateToUse,Accel,AccelToUse;
for (int i = i0; i<=i1; i++)
{
if (i>=0)
{
SEGMENT *s=GetSegPtr(i);
if (Kinematics->ComputeAnglesOption(i)) return 1;
CalcBegDirectionOfSegment(s, tdx, tdy, tdz, tda, tdb, tdc);
HTH
Regards