Torque calculation in Motor Control
Hello everyone, I’m using the STM32G464RE core and the IHM 08M1.
I’m trying to work out how to calculate/measure the torque, but I don’t have a dynamometer. The load is a peristaltic pump, so it varies depending on the two rollers that the motor drives.
-----------------------------------------------------------------------METHOD 2: using the firmware-------------------------------------------------------------------------------------------
In the code, I’ve written:
currentRef_float_read = MCI_GetIqdref_F(pMCI[M1]);
iq_ref_A = currentRef_float_read.q;
current_float_read = MCI_GetIqd_F(pMCI[M1]);
iq_A = current_float_read.q;
//I’m converting the motor’s Kt (expressed in [Nm/Arms]) to [Nm/Apk] because I’m going to multiply it by Iq (which is not rms)
#define KT_NM_PER_APEAK (KT_NM_PER_ARMS / SQRT2_F)
torque_calc_Nm = KT_NM_PER_APEAK * iq_A;
torque_ref_calc_Nm = KT_NM_PER_APEAK * iq_ref_A;
//I think this is the "overall" stator current, and I don’t think it should be used to calculate torque, but I’ll plot it anyway
phase_current_ampl_s16a = MCI_GetPhaseCurrentAmplitude(pMCI[M1]);
phase_current_A = ((float)phase_current_ampl_s16a * 3.3f) / (65536.0f * 0.01f * 5.18f);When I plot the variable, I usually get a pattern like this:


-----------------------------------------------------------------------METHOD : using the oscilloscope--------------------------------------------------------------------------------------
I put the amperometric probe around one of the motor’s three phases and read the RMS, maximum and minimum values ((see the example in the photo below):

I calculate the torque quite simply using the motor’s Kt and the current reading from the oscilloscope probe:
Torque = Kt [Nm/Arms] * Iphase [Ams]
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Which of the two is correct?
I’m getting different results.
