Hi,
I’m doing some motor testing based off InstaSpin lab13e with a sensored BLDC motor and DRV8301-HC eval board.
I’ve successfully completed the inertia identification, tuning and the position control is stable. However, when I try to increase the acceleration limits for my position move I seem to be running into limits that I don’t understand where they are being set. Regardless of how I set the curve type, jerk and acceleration limits my profile is limited to 2 krpm/sec.
For example:
- I have set the gMotorVars. PosStepInt_MRev to 500 revs to allow enough time to accelerate, reach the max velocity limit and then decelerate back to zero speed. I have set the CurveType to Trapezoidal to avoid any jerk limitations.
- I then execute the following code to kick off the move:
STPOSMOVE_setCurveType(stObj->posMoveHandle, gMotorVars.SpinTAC.PosMoveCurveType);
STPOSMOVE_setProfileType(stObj->posMoveHandle, ST_POS_MOVE_POS_TYPE);
STPOSMOVE_setPositionStep_mrev(stObj->posMoveHandle, gMotorVars.PosStepInt_MRev, gMotorVars.PosStepFrac_MRev);
STPOSMOVE_setVelocityLimit(stObj->posMoveHandle, _IQmpy(gMotorVars.MaxVel_krpm, _IQ(ST_SPEED_PU_PER_KRPM)));
STPOSMOVE_setAccelerationLimit(stObj->posMoveHandle, _IQmpy(gMotorVars.MaxAccel_krpmps, _IQ(ST_SPEED_PU_PER_KRPM)));
STPOSMOVE_setDecelerationLimit(stObj->posMoveHandle, _IQmpy(gMotorVars.MaxDecel_krpmps, _IQ(ST_SPEED_PU_PER_KRPM)));
STPOSMOVE_setJerkLimit(stObj->posMoveHandle, _IQ20mpy(gMotorVars.MaxJrk_krpmps2, _IQ20(ST_SPEED_PU_PER_KRPM)));
// Enable the SpinTAC Position Profile Generator
STPOSMOVE_setEnable(stObj->posMoveHandle, true);
- If I add a breakpoint before the movement starts I can confirm that the correct values get loaded to the STPOSMOVE config
CurveType = ST_MOVE_CUR_TRAP
AccLim = 50 krpmps => 5.55 [pu]
VelLim = 3.0 krpm => 0.333 [pu]
DecLim = 0.2 krpmps => 0.0222 [pu]
JerkLim = 5.0 krpmps2 => 0.55 [pu]
However, if I then look at the actual limits (ie - STPOSMOVE_getActualAcceleration() I get the following
ActualVelLimits = .111 [pu] => 1 krpm
ActualAccLimit = .221 [pu] => 1.99 krpmps
ActualDecLim = 0.022 [pu] => 0.2 krpmps
ActualJrkLim = 0 [pu] = 0 krpmps2
What causes ‘AcualVelLimits’ and ‘ActualAccLimit’ to be limited to these values? When the move executes I get the acceleration and time the profile generator expects and I’m not seeing any limits due to max current, max speed, etc.
I’ve repeated the same type of test with ProfileType set to velocity and I run into the acceleration limit regardless of what I set it to.
Is there other parameters that influence what actual limits are used when creating the profile or am I missing something?
Thanks
Adam