Other Parts Discussed in Thread: MOTORWARE
Hello to all ,
my system
f28069
motorware_1_01_00_15
custom firmware-based on lab 13a
electric motor
PMSM
5 pp
5 KPRM
0.023 Nm / A
pos controller and converter configuration
inline void ST_setupPosConv(ST_Handle handle) {
// get object from the handle
ST_Obj *obj = (ST_Obj *)handle;
// Initalize SpinTAC Position Convert
STPOSCONV_setSampleTime_sec(obj->posConvHandle, _IQ24(ST_SAMPLE_TIME));
STPOSCONV_setERevMaximums_erev(obj->posConvHandle, _IQ24(ST_EREV_MAXIMUM), 0);
STPOSCONV_setUnitConversion(obj->posConvHandle, USER_IQ_FULL_SCALE_FREQ_Hz, ST_SAMPLE_TIME, USER_MOTOR_NUM_POLE_PAIRS);
STPOSCONV_setMRevMaximum_mrev(obj->posConvHandle, _IQ24(ST_MREV_ROLLOVER));
STPOSCONV_setLowPassFilterTime_tick(obj->posConvHandle, 3);
if(USER_MOTOR_TYPE == MOTOR_Type_Induction) {
// The Slip Compensator is only needed for ACIM
STPOSCONV_setupSlipCompensator(obj->posConvHandle, ST_SAMPLE_TIME, USER_IQ_FULL_SCALE_FREQ_Hz, USER_MOTOR_Rr, USER_MOTOR_Ls_d);
}
STPOSCONV_setEnable(obj->posConvHandle, true);
}
//! \brief Setups SpinTAC Position Control
inline void ST_setupPosCtl(ST_Handle handle) {
// get object from the handle
ST_Obj *obj = (ST_Obj *)handle;
_iq24 maxCurrent_PU = _IQ24(USER_MOTOR_MAX_CURRENT / USER_IQ_FULL_SCALE_CURRENT_A);
// Initalize SpinTAC Position Control
STPOSCTL_setAxis(obj->posCtlHandle, ST_AXIS0);
STPOSCTL_setSampleTime_sec(obj->posCtlHandle, _IQ24(ST_SAMPLE_TIME));
STPOSCTL_setOutputMaximums(obj->posCtlHandle, maxCurrent_PU, -maxCurrent_PU);
STPOSCTL_setVelocityMaximum(obj->posCtlHandle, _IQ24(USER_MOTOR_MAX_SPEED_KRPM * ST_SPEED_PU_PER_KRPM));
STPOSCTL_setPositionRolloverMaximum_mrev(obj->posCtlHandle, _IQ24(ST_MREV_ROLLOVER));
STPOSCTL_setUnitConversion(obj->posCtlHandle, USER_IQ_FULL_SCALE_FREQ_Hz, USER_MOTOR_NUM_POLE_PAIRS);
STPOSCTL_setPositionErrorMaximum_mrev(obj->posCtlHandle, _IQ24(ST_POS_ERROR_MAXIMUM_MREV));
STPOSCTL_setRampDisturbanceFlag(obj->posCtlHandle, false);
STPOSCTL_setFilterEnableFlag(obj->posCtlHandle, true);
STPOSCTL_setInertia(obj->posCtlHandle, _IQ24(ST_SYSTEM_INERTIA_PU));
STPOSCTL_setFriction(obj->posCtlHandle, _IQ24(ST_SYSTEM_FRICTION_PU));
STPOSCTL_setBandwidth_radps(obj->posCtlHandle, _IQ20(USER_SYSTEM_BANDWIDTH));
STPOSCTL_setEnable(obj->posCtlHandle, false);
}
my question is my problem because I can not ask my position control a greater rotation of eight, or rather the difference between demand and feedback so the position error must not exceed 8 would otherwise go towards negative values.
example
request 9
current position 0
error should be 9 but in reality I have -7 and accordingly the request to the current controller is to turn in the opposite direction to -7.
here are two images that explain what happens at the output of the position controller
rotationSetpoint is the set point
rotationFeedback is the current position
requestCurrent_pu is the output of the position controller and consequently the input of the controller foc.
I configure wrong my controller or is a limitation of istaspin.
wrong output because is negative instead has to be positive
best regards

