In Pulse Width Modulation, the duty cycle is modulated, not the pulse levels. They are constant.
Ah i'm sorry, I see where I've misled you. It's not actually a PWM as such, I am not modulating duty cycle, rather just setting the motor phase to either high or low, and then reevaluating its state in 5uS. Therefore the minimum pulse width is 5uS. A very brief comparison of DTC vs other PWM drive is here:
https://www05.abb.com/global/scot/scot201.nsf/veritydisplay/9f01a97f33f3df6bc125744f003b2db8/$file/factfiletd1_motor_control_with_dtc_revb_en_lowres.pdf
The amplitude of this pulse is dependent on the source voltage (including sag), switch state (connected to DC+ or DC-), and switching losses. Therefore the phase voltage can also be approximated by the DC bus voltage.
Maybe I still don't understand. Are you filtering the PWM to provide a DC voltage, and then sampling that, or are you feeding the pulse waveform directly to your ADC (through a resistive divider and buffer)? If you are doing the latter, you are accomplishing nothing.
I am doing the latter, with hope to get either a reading close to DC+, or 0V. This of course will change depending on the issues raised earlier. I will be switching a couple hundred amps, so I imagine voltage drops to be severe causing a DC bus ripple.
The control needs these values to estimate its torque and flux and rotor angle. These need to be as accurate as possible as everything is estimated from these readings.
Tell us the BIG picture. I'll ask you for the third time:
Why are you digitizing the PWM signal?
I am hoping to get a highly accurate reading of the phase voltage just before I issue a new switching state. I just need to know the (average) amplitude of the pulse, I know its width as I command when it starts and stops. Really the more readings the better because I convert these 3-phases into DQ reference plane and then integrate, but i think 5uS is quite short to do 3x 12bit voltage readings + 2x 12bit phase current readings.
Example of code and voltage readings: The MCU code will loop every 5uS to give a new switch state, where the phase voltages will be sensed @t-1uS (and stored in DMA) as they are needed for the control maths to determine the motors flux&torque in the control loop.
t=0, switching state=0 (tied to GND), voltage=0V ---> change to switch state 1
t=5uS, switching state=1 (tied to DC+), voltage=DC+ (+- switching losses & noise) measured at t=4uS (assume measurement takes 1uS) ---> remain switch state 1
t=10uS, switching state=1 (tied to DC+), voltage=DC+ (+- switching losses & noise) measured at t=9uS (assume measurement takes 1uS) ---> change to switch state 0
t=15uS, switching state=0 (tied to GND), voltage=0V (+- switching losses & noise) measured at t=14uS (assume measurement takes 1uS) ---> change to switch state 1
Here is a zoomed in picture of PhaseU's voltage wrt time. Yellow is actual phase voltage, purple is estimated from VDC*switchstate. The error between them is due to switching losses etc. Note that the DC bus voltage, and hence the amplitude of the pulses, are not flat due to the massive switching current. The skinnier pulses are 5uS, and the motor is sampled at 2e-7 to show transients
View attachment 65000
Here is a picture of the effect the error in the phase estimation (seen in previous picture) has on the torque and flux estimations. Note an error of 0.5V causes a big error in torque estimation (~15Nm). When this is scaled 131:1 as per my voltage divider, that resembles 3.8mV.
View attachment 65001