You are here

Measured stator resistance not consistent

2 posts / 0 new
Last post
LoicLL
Offline
Last seen: 6 days 3 hours ago
VESC Free
Joined: 2025-10-06 17:01
Posts: 2
Measured stator resistance not consistent

I'm currently implementing a custom VESC hardware based on the VESC4 architecture, using a STM32F405 and version 6.06 of the firmware.

I'm encountering an issue with stator resistance measurement. Using the terminal command "measure_res [current]", I've observed that the lower the current target, the higher the stator resistance value, and the higher the current target (still less than 5.0 A), the lower the stator resistance value. Is this expected behavior?

I've verified that the current regulation is working correctly. Since the mcpwm_foc_measure_resistance function calculates the resistance using the formula resistance = voltage_avg / current_avg, I investigated its two components and suspect that voltage_avg (vq) might be the culprit.

One of my questions is: where and when are vd and vq calculated? From my understanding, phase currents and phase voltages are measured at V0. The update_valpha_vbeta function, called by control_current when the motor is running, updates v_alpha and v_beta. Since this function is called after V0 and before V7 (see the scope shot below), are the phase voltages used inside update_valpha_vbeta coming from the V0 measurement? 

The attached scope shot represents the measure_res 2.0 command, zoomed in when the current is steady.

phasesVoltagesMeasurements.png

I would be thankful if someone could offer some insight into this problem.

LoicLL
Offline
Last seen: 6 days 3 hours ago
VESC Free
Joined: 2025-10-06 17:01
Posts: 2

Update : 

I found what was the issue. It was my deadtime compensation factor for the foc that hadn't the right value. It was set to the default value of  0.120us but with my custom hardware I need it to be 0.600us.

This factor is very important, since when the motor is in running state, Valpha and Vbeta are estimated coming from the inverse Park transform and are not measured. For this estimation to be as accurate as possible it has to compensate the propagation losses from the pwm logic to the applied pwm.