Is there a way to read the total current in LowsideCurrentSense?

So it has nothing to do with the velocity mode. I guess it’s the same with torque mode without load.

I think with no load it’s more difficult to use the current measurements, there is much more noise. Is it better with only 3(Vq*Iq)/2Vbus ?

Maybe you have a chance to try using the adc calibration as well.
Adding the following here:

// Run adc self-calibration
HAL_ADCEx_Calibration_Start(&hadc1,ADC_SINGLE_ENDED);
HAL_ADCEx_Calibration_Start(&hadc2,ADC_SINGLE_ENDED);

Quite a bit better, yes! And obviously it’s the same in stall conditions, since Vd=0 in stall

I think I have an idea why Vd*Id makes it worse.
In this post I was showing that a delay between current measurement and angle measurement wrongly increases the measured Id.

image
As the speed increases, Id is more and more off.

From the other side, Ibus doesn’t seem to be impacted, because it’s only using the angle to define the sign of the current, not to derive Id and Iq.

Maybe you can try this also (3XIbus*SQRT(Vq*Vq+Vd*Vd))/(2*Vbus)

@RaphZufferey I created a branch with adc calibration.

I would be curious to know how it impacts your measurements.

It’s glued using shoe goo to the actual motor. It trips when the motor gets too hot, it’s not a breaker that trips when too much current flows, it’s a thermal breaker that trips when the temperature gets above 65 degrees C.

With stepper motors, yes, disconnecting a phase from the driver will actually usually fry the driver, but this does not appear to be a problem with these 3 phase motor drivers, probably because the inductance of the coils is much lower.

It could definitely be a problem for the driver! this is not the recommended technique for this, it should be software cutting power or kill power to the input of the driver, not the outputs of the half-bridges.

It does kill the input to the driver. The power to the driver makes a detour, out to the motor and back again.

Thank you very much, I will try that as soon as possible!

1 Like

@Candas1, I have tried your branch, thank you very much. I don’t notice any difference in the current measure, regardless of torque/velocity control. What were you hoping to see? I’ll keep digging to see if I can get total bus current, which is important for efficiency measures of the whole system in my case.

Adc calibration should slighly improve the adc measurement accuracy.
At least it had no bad impact.