I'm currently doing some experimentation with 3-phase inverters for BLDC motors and current sense. I have at hand this board featuring:
- IR2103 MOSFET driver. LIN# inputs are connected to HIN inputs through jumpers
- 5 mohm shunt resistor
- LMV324 Op-Amp for low-side current measurement, in non-inverting configuration, Gain=25
The setup comprises of:
- STM32 NUCLEO F411RE providing to the inverter 3 HIN inputs and 3.3V VCC (for Op-Amp)
- 24V power supply for PVDD
- 3 27 ohm resistors connected at the motor terminals in Y configuration, to "simulate" a 3-phase load.
In the code, I'm generating 3 left-aligned PWM signals (frequency=25 kHz) for a-b-c terminals with duty cycles of, respectively, 30%, 50%, 80%.
With an oscilloscope I'm monitoring the 3 "motor" terminals and the IS1, IS2, IS3 terminals (the amplified voltage across the low-side shunt resistors on the 3 branches)
What I expect to see
3 0-24 V square waves with duty cycles of, respectively, 30%, 50%, 80%.
The IS1 (Ia) current-sense voltage:
- 0V for the first 30% of the cycle, since all high-side mosfets are ON (and low-side ones are OFF)
- some voltage corresponding to ib+ic = -ia (theoretically around 592 mA) for the following 20% of the cycle, since the low-side MOSFET on branch a is ON while on the other 2 branches the high-side is ON
- some voltage corresponding to -ia = ic/2 (theoretically around 296 mA) for the following 30% of the cycle, since only the c high-side MOSFET is ON
- 0V for the rest of the period, since all low-side switches are ON
The IS2 (Ib) current-sense voltage:
- 0V for the first 50% of the PWM period since b low-side is always OFF
- some voltage corresponding to -ib = ic/2 (theoretically around 296 mA) for the following 30% of the cycle
- 0V for the rest of the period
The IS3 (Ic) current-sense voltage always 0V (all low-side MOSFETS ON, no current circulation)
I simulated the approximated circuit with the Falstad circuit simulator, obtaining the following results, which seem to agree with the above analysis (currents Ia, Ib, Ic are currents flowing from the low-side MOSFETs' source to ground):
What I actually see
The voltages at "motor" terminal appear to be correct: 0-24 V square waves with the correct duty cycles:
What I cannot understand is the output of the current-sensing amplifiers:
Where the first signal is the voltage at terminal "a" (for reference with the previous image, used also for triggering) and the following 3 signals are the Is1, Is2, Is3 current sense output voltages.
I understand that for a current of 592 mA I should get an amplified voltage of:
Vs = Gain * Rsense * I = 25 * 0.005 * 0.592 = 0.074V
which is maybe hardly detectable on the oscilloscope, but I cannot understand the big transient at the beginning of the PWM cycle, with its long-lasting settling tail. Wouldn't this invalidate any ADC readings performed on these signals in order to implement current control (field oriented control)?
So the question is, what am I looking at? Is the previous analysis wrong? Is there some hardware problem with the Op-Amp or the board in general?
Adding a clarification: at this stage I'm not controlling a motor or doing some meaningful switching patterns: the load at "motor terminals" is just 3 resistors in Y configuration. I'm just experimenting with the current sensing circuitry, applying a known PWM pattern (maybe not meaningful for proper motor control) and checking if the signals are coherent with what I expected.
I add some more waveforms after some comments regarding the possibility of shoot-through. These are the signals related with turn-on and turn-off of leg "a" of the inverter, output of IR2103. From top to bottom, first is HO, second is Vs ("motor" terminal), third is LO.