For my caving robot project, I have 8 motors for which I need torque control (they will mainly be stalled or nearly stalled.)
Each motor is driven by a DRV8801PWPR H-bridge (commanded by one digital and one PWM signal from a STM32F723.)
In order to get the torque, I was planning to measure the current.
The DRV8801 provides a VPROPI pin, which gives a voltage proportional to the current in the sense resistor.
Which kind of current measure is the most accurate to estimate torque:
The average current (ie adding a low pass filter to VPROPI.)
The current at some well chosen moment of the PWM cycle (probably choosing the most "stable" moment of the PWM high.)
The same as 2, but multiplied by the duty cycle of the PWM (can easily be done, as it's the same micro-controller generating the PWM and measuring)
PS: I started my PCB design with solution 1, but @bobflux's answer in my question about cross-talk made me rethink about what I really need to measure.