This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hello,
i am using InstaSPIN motion with eQEP sensor and it works well for our application.
now, i am building a torque control (act as dynamometer) leveraging lab 12-b to remove speed control.
i disabled SpinTAC speed control:
STVELCTL_setEnable(stObj->velCtlHandle, false);
comment out:
STVELCTL_setBandwidth_radps(stObj->velCtlHandle, gMotorVars.SpinTAC.VelCtlBw_radps);
STVELCTL_setOutputMaximums(stObj->velCtlHandle, _IQmpy(gMotorVars.SpinTAC.VelCtlOutputMax_A, _IQ(1.0/USER_IQ_FULL_SCALE_CURRENT_A)), _IQmpy(gMotorVars.SpinTAC.VelCtlOutputMin_A, _IQ(1.0/USER_IQ_FULL_SCALE_CURRENT_A)));
ST_setupVelCtl(stHandle);
ST_setupPosConv(stHandle);
inside ISR, i comment out these speed control too:
if(stCnt++ >= ISR_TICKS_PER_SPINTAC_TICK) {
ST_runPosConv(stHandle, encHandle, ctrlHandle);
// ST_runPosMove(stHandle);
// ST_runPosCtl(stHandle, ctrlHandle);
ST_runVelCtl(stHandle, ctrlHandle);
stCnt = 1;
}
then, i add this function to update torque from gMotorVars.IqRef_A just like lab 4.
void updateIqRef(CTRL_Handle handle)
{
_iq iq_ref = _IQmpy(gMotorVars.IqRef_A,_IQ(1.0/USER_IQ_FULL_SCALE_CURRENT_A));
// Set the Iq reference that use to come out of the PI speed control
CTRL_setIq_ref_pu(handle, iq_ref);
return;
} // end of updateIqRef() function
with these changes, i am able to spin the motor as i changed the gMotorVars.IqRef_A from debug window and i can turn the motor counter direction and see lab supply current increases.
this is all good.
now, i would like to limit the maximum torque (current) that this dynamometer can apply for a given values of gMotorVars.IqRef_A.
for example, if i set gMotorVars.IqRef_A (IQ24) = 0.2 and start rotate the reverse direction, i would like to limit the max current of the motor consumption to say 0.5A.
how can i do that?
i defined USER_MOTOR_MAX_CURRENT limit to 0.5 as suggested by spruhj1h.pdf page 226, but it does not seems to limit to 0.5A when i turn the motor in opposite direction.
was this parameter USER_MOTOR_MAX_CURRENT only used by speed control loop for saturation?
I debugged some more in CTRL_runOnline_User of ctrlEQP.h file, i see this:
_iq maxVsMag = CTRL_getMaxVsMag_pu(handle);
this maxVsMag returns 0.5 as i set which is good.
but when it ran the PID it does not honor my max value. i can counter rotate the motor shaft and i can see current higher than 0.5 A consumption.
maybe i miss understand something here.
can you please advise?
Thanks,
Henry
If you want to run the motor with torque control, you may try to use the lab05a with InstaSPIN-FOC. We don't recommend that the torque mode will be used for InstaSPIN-motion, if you want to implement this, you have to change the control flow for an example lab by yourself.
Hi Yanming,
but i need an angle sensor because my RPM is low speed.
in the below link, it seems that they are able to adapt lab 12b which involves angle sensor for low speed torque control.
i am able to get the basic torque control to work using their approach, but have the basic question on the input current limit from lab supply.
let say my motor rating is up to 4A, but i would like to limit the max current consumption to like 0.8A because of limitation on our battery.
Our DC bus is from a battery which can not support 4A.
so either in lab 5a or 12b and the InstaSPIN user guide, how do you limit the maximum input current that the system can draw?
USER_MOTOR_MAX_CURRENT should be set to 4 or 0.8?
Thanks and Best Regards,
Henry
Right, you can implement the sensored-FOC for torque control. As mentioned above, you can change the control flow by disabling the speed closed-loop.
The USER_MOTOR_MAX_CURRENT is used to set a limit on the maximum current command output of the provided Speed PI Controller to the Iq controller. So you can limit the maximum input current by setting USER_MOTOR_MAX_CURRENT if the speed closed-loop with PI regulator is enabled. Otherwise, you should set the right torque current (Iq_ref) if you only want to implement the torque control.
Hi Yanming,
thanks. I tested the USER_MOTOR_MAX_CURRENT for the SpinTac motion control and it works as expected where it limited the Iq_ref to the values.
in the torque only mode, i can bypass speed loop and set the Iq_ref_A directly. this works fine.
however, i am still a little confuse on how to convert my desired Torque (Nm) to the torque current Iq_ref for this motor which is recommended by TI: https://www.ti.com/tool/LVSERVOMTR. I read this motor spec: https://www.teknic.com/files/product_info/N23_Industrial_Grade_Motors_v6.3.pdf and can not find any value to convert from Torque to current Torque (Iq_ref_A).
can you please shed some light?
Thanks,
Henry
You can't convert the torque to the torque current directly, it's not a linear relationship according to the electromagnetic torque equation as below if the motor is an IPM motor.
Te = 1.5 * Pole pair * [flux * Iq + (Ld -lq) *Id * iq)]
But if it's a PMSM motor Te = 1.5 * Pole * flux * Iq, so you can set the the reference torque current Iq, according to the torque.
You might find more information about this in the electric motor drive textbooks.
Yanming,
thank you so much for your advise. i think i can see your point.
for the motor that TI recommended for dynamometer, https://www.teknic.com/files/product_info/N23_Industrial_Grade_Motors_v6.3.pdf , can you please advise if this is IPM or PMSM motor? i read the spec but did not see a clear indication. my guessing is that it is PMSM.
Thanks,
Henry