Hi,
I want to make Emergency motor stop function, to stop the motor as fast as possible and disable the controller. I don 't know If I'm running in velocity or position control.
A made this:
void Control_Emergency (INTR_Handle intr)
{
ST_Obj *stObj = (ST_Obj *) intr->stHandle;
STPOSMOVE_setCurveType(stObj->posMoveHandle,ST_MOVE_CUR_TRAP); // Set trapezoidal profile
STPOSMOVE_setDecelerationLimit(stObj->posMoveHandle,_IQmpy (STPOSMOVE_getDecelerationMaximum(stObj->posMoveHandle), _IQ(ST_SPEED_PU_PER_KRPM))); // set Deceleration to maximum
STPOSMOVE_setJerkLimit(stObj->posMoveHandle, _IQ20mpy (STPOSMOVE_getJerkMaximum(stObj->posMoveHandle), _IQ20 (ST_SPEED_PU_PER_KRPM))); // set Jerk to maximum
STPOSMOVE_setVelocityEnd (stObj->posMoveHandle,_IQ (0)); // Set end speed to 0
STPOSMOVE_setPositionStep_mrev(stObj->posMoveHandle,0,0); // set move to 0.
STPOSMOVE_setEnable(stObj->posMoveHandle, true);
// STPOSMOVE_setReset (stObj->posMoveHandle, true);
STPOSMOVE_run(stObj->posMoveHandle);
}
This works for velocity control but not position control. I tried to get in the STPOSMOVE halt state (en=false en res=true) but that didn't stop the motor. What is wrong?