INA240 current sensing design

Thread Starter

andrew74

Joined Jul 25, 2022
212
Hello everyone, I am designing a 48V three-phase inverter that will be connected to a BLDC motor controlled using an FOC algorithm.

In fact, the inverter I am designing can be connected either to the "150" motor or the "85" motor, as you can see in the photo below.

Currently, the motor is controlled by another commercial driver, and these are the currents (phase, bus and quadrature) values I have measured:


image.png


I will use a microcontroller with a 12-bit ADC.

1) I’ve chosen the INA240 for phase current sensing – do you think that’s the right choice?

2) Is the RMS value sufficient for sizing? Or do we also need the maximum and minimum values??

3) Assuming the INA240 is ok and using RMS value, I’ve attached the calculations I’ve done… are they correct?

(for Iphase,max I assumed twice the value of Iphase,max measured using an oscilloscope current clamp, so twice 2,92A .. which is 6A)

SmartSelect_20260511_112735_Samsung Notes.png


I've set G=50V/V and calculated Rsense=6m ohm
SmartSelect_20260511_112803_Samsung Notes.png




I would be grateful if you could provide some feedback on the calculations and the choice of 50V/V

1778493024178.png
 

Irving

Joined Jan 30, 2016
5,053
Are your RMS figures for a sinusoidal phase current or a rectangular one?

For a rectangular signal, Irms = Ipk . D, so Ipk = Irms/D, so what is your expected duty cycle D at min and max RPM?

INA240 is perfect for this application, but can you get a 6mohm shunt that can take 10A+
Yes: TE Connectivity Current Sense Resistors TLRP 2512 2.0W R006 1% 25PPM 4K RL (being generous at 2W capability)

Assuming sinusoidal Ipk = 1.414 Irms . For a 50V/V device, biassed midpoint ipk = (2.3/50) / 6e-3ohm =7.66A, Irms = 5.4A, might be a little tight. 2.3v assumes 5v supply less 0.2v as per datasheet, low side isn't an issue.
I'd go for a 5mohm shunt. Ipk = (2.3/50)/5e-3ohm = 9.2A, Irms = 6.5A
Also more options on 5mohm shunts as more common value.
 

Thread Starter

andrew74

Joined Jul 25, 2022
212
Are your RMS figures for a sinusoidal phase current or a rectangular one?

For a rectangular signal, Irms = Ipk . D, so Ipk = Irms/D, so what is your expected duty cycle D at min and max RPM?

INA240 is perfect for this application, but can you get a 6mohm shunt that can take 10A+
Yes: TE Connectivity Current Sense Resistors TLRP 2512 2.0W R006 1% 25PPM 4K RL (being generous at 2W capability)

Assuming sinusoidal Ipk = 1.414 Irms . For a 50V/V device, biassed midpoint ipk = (2.3/50) / 6e-3ohm =7.66A, Irms = 5.4A, might be a little tight. 2.3v assumes 5v supply less 0.2v as per datasheet, low side isn't an issue.
I'd go for a 5mohm shunt. Ipk = (2.3/50)/5e-3ohm = 9.2A, Irms = 6.5A
Also more options on 5mohm shunts as more common value.
RMS is sinewave

1) I did not understand if I should use rms or pk current in the first colums for the calculations
1778503615635.png

2) I have imported into Altium Res Metal Strip 1206 6m Ohm 1% 1/2W |110ppm/|C SMD Embossed Plastic T/R .. Is that OK? Of course, I’m still in time to change. Never mind the 6 mΩ value; I’ll use a 5 mΩ one as you suggested .. I’m interested in the power rating and other characteristics
 
Last edited:

panic mode

Joined Oct 10, 2011
4,913
hold your horses....! are you sure you thought this through?

your calculation does not match your notes - it assumes that Vref = Vs/2, where Vs=3.3V

1778504424312.png
then why did you connect both REF pins to Vs? connecting both REF to Vs or connecting both to GND is for unidirectional measurement...

1778504209992.png

but your circuit has HS and LS mosfest so clearly it needs to measure bidirectional (phase current direction depends on which mosfet is on: HS or LS).
by connecting one REF pin to GND and other to VS you create reference voltage that is 1/2Vs.
1778503578140.png
and that reference is going to fluctuate with Vs, resulting in inaccuracies.

a better solution of course is to use external reference. though since you are using 3.3V you would want reference to be 1.65V so you would want to use something like REF2033 (which has both 3.3 and 1,65V outputs).
1778503940913.png
 

panic mode

Joined Oct 10, 2011
4,913
also how are you driving the mosfets? are you sure that your signal is sine wave and not modified sine wave? modified sine wave is a square-ish wave - mosfets are either on or off.
 

Thread Starter

andrew74

Joined Jul 25, 2022
212
hold your horses....! are you sure you thought this through?

your calculation does not match your notes - it assumes that Vref = Vs/2, where Vs=3.3V

View attachment 367045
then why did you connect both REF pins to Vs? connecting both REF to Vs or connecting both to GND is for unidirectional measurement...

View attachment 367044

but your circuit has HS and LS mosfest so clearly it needs to measure bidirectional (phase current direction depends on which mosfet is on: HS or LS).
by connecting one REF pin to GND and other to VS you create reference voltage that is 1/2Vs.
View attachment 367040
and that reference is going to fluctuate with Vs, resulting in inaccuracies.

a better solution of course is to use external reference. though since you are using 3.3V you would want reference to be 1.65V so you would want to use something like REF2033 (which has both 3.3 and 1,65V outputs).
View attachment 367042
also how are you driving the mosfets? are you sure that your signal is sine wave and not modified sine wave? modified sine wave is a square-ish wave - mosfets are either on or off.
You’re absolutely right, I’d forgotten to adjust the Vref!

Yes, I have three gate drivers with their respective high-side and low-side drivers, which control the gates of the MOSFETs in the inverter’s three legs.
1778506112749.png

I'm a bit out of my depth when it comes to the 'modified sine wave' aspect – is there a way to check it?
All I know is that I’ll be using field oriented control at 40kHz
 

panic mode

Joined Oct 10, 2011
4,913
btw. not that it would not work but how many of you have seen PNP transistors in such application?
by convention GND is reference or 0V potential. so the supply would have to be negative.... hello TI?
1778506087593.png
 
Last edited:

panic mode

Joined Oct 10, 2011
4,913
I'm a bit out of my depth when it comes to the 'modified sine wave' aspect – is there a way to check it?
All I know is that I’ll be using field oriented control at 40kHz
for efficiency reasons (and simpler driving), mosfets are not operated in linear region (like in a classic audio amp) which would be needed to produce pure sine wave.
instead of that, mosfets are driven hard (into saturation) so basically they operate as switches (simple on/off). result is that output is not smooth changing sine wave but some sort of approximation.

1778506393073.png
example generating sine using PWM:
1778507095083.png

and that signal form affects how you calculate Irms.
 
Last edited:

Thread Starter

andrew74

Joined Jul 25, 2022
212
hold your horses....! are you sure you thought this through?

your calculation does not match your notes - it assumes that Vref = Vs/2, where Vs=3.3V

View attachment 367045
then why did you connect both REF pins to Vs? connecting both REF to Vs or connecting both to GND is for unidirectional measurement...

View attachment 367044

but your circuit has HS and LS mosfest so clearly it needs to measure bidirectional (phase current direction depends on which mosfet is on: HS or LS).
by connecting one REF pin to GND and other to VS you create reference voltage that is 1/2Vs.
View attachment 367040
and that reference is going to fluctuate with Vs, resulting in inaccuracies.

a better solution of course is to use external reference. though since you are using 3.3V you would want reference to be 1.65V so you would want to use something like REF2033 (which has both 3.3 and 1,65V outputs).
View attachment 367042
Here’s the correction, right?
1778507324678.png
I don't know if use a 1uF or 10uF bypass capacitor, but this should do the trick
 
Last edited:

Thread Starter

andrew74

Joined Jul 25, 2022
212
for efficiency reasons (and simpler driving), mosfets are not operated in linear region (like in a classic audio amp) which would be needed to produce pure sine wave.
instead of that, mosfets are driven hard (into saturation) so basically they operate as switches (simple on/off). result is that output is not smooth changing sine wave but some sort of approximation.

View attachment 367048
example generating sine using PWM:
View attachment 367052

and that signal form affects how you calculate Irms.
Oh, I see.
There are certainly square waves with a variable duty cycle; they’re generated by the Space Vector Modulation block in Field Oriented Control.
1778507460912.png


That said... I’m not sure whether this affects the calculations I’ve made and those made by @Irving
Perhaps I should do this underlined calculation using D?
1778508001857.png
 
Last edited:

panic mode

Joined Oct 10, 2011
4,913
yup. post by Irving was spot on... SMD shunts are cheap and small. if you have room on your PCB you can just make PLC trace a shunt. in fact that is shown in application notes for INA240.
1778508546651.png
 

Thread Starter

andrew74

Joined Jul 25, 2022
212
Are your RMS figures for a sinusoidal phase current or a rectangular one?

For a rectangular signal, Irms = Ipk . D, so Ipk = Irms/D, so what is your expected duty cycle D at min and max RPM?

INA240 is perfect for this application, but can you get a 6mohm shunt that can take 10A+
Yes: TE Connectivity Current Sense Resistors TLRP 2512 2.0W R006 1% 25PPM 4K RL (being generous at 2W capability)

Assuming sinusoidal Ipk = 1.414 Irms . For a 50V/V device, biassed midpoint ipk = (2.3/50) / 6e-3ohm =7.66A, Irms = 5.4A, might be a little tight. 2.3v assumes 5v supply less 0.2v as per datasheet, low side isn't an issue.
I'd go for a 5mohm shunt. Ipk = (2.3/50)/5e-3ohm = 9.2A, Irms = 6.5A
Also more options on 5mohm shunts as more common value.
Having clarified Vref's error, let's get back to the calculations.
I'm still unsure whether it's a sinusoidal or rectangular shape.

This is a photo from an old simulation of mine.
The EPC2152 is a power stage (it has integrated gate drivers and MOSFETs), so it receives the HI and LI signals from the uC on the left input, and the motor phase is directly connected to the right output.

From the simulation and the output plot, note that:
- the current of the phase is sinusoidal
- the voltage between one phase and the other is a positive and negative rectangular wave whose duty cycle varies between 0.1 and 0.9
- the voltage between the phases and "neutral point" is a rectangular wave but positive (not shown in the photo).

1778508859926.png
Although I included the "Rb" in the simulation to model the resistance of the motor winding, for the sake of simplicity we can treat it as my shunt; the IN+ and IN- terminals of my INA240 are connected to its terminals.

That said, are we dealing with a square wave rather than a sine wave?

EDIT: we can assume Duty cycle = [0.1 ... 0.9]
 
Last edited:
Top