Current Sensors How to select a good one or roll your own.

Electric Motors and Controllers
User avatar
Arlo1
100 GW
100 GW
Posts: 8494
Joined: Apr 26, 2009 10:36 pm
Location: Nanaimo BC Canada
Contact:

Current Sensors How to select a good one or roll your own.

Post by Arlo1 » Aug 07, 2017 12:13 am

For many of you know I am pushing the limited with inverter tech as far as I can on the budget I have.

One of the main limitations I have is the current sensor I use for the phase current measurements.
A list of what is needed for a good current sensor is.

1 fast response as fast as possible 4us or less!!
2 very low or no magnetic memory.
3 low cost
4 small and compact.
5 Light weight
6 simple to use
7 read current in 2 directions.
8 the end signal needs to be analog and still within the time from number 1

Did I miss anything?

For many of you following my work I have CSLA2EN 950 amp AC/DC current sensors in use!

I have taken the toroid out of one and opened up the gap hoping I can make it read more current but thats not easy as its laminated metal.

I have parts coming from a generous memeber for a 1000hp controller (peak).... I will need 2000 amp current sensors!

Also I have used the melaxis chip MLX91208LDC-CAV-001-SP
With it you make a cheep simple circuit board and it can lay right on you buss bars. I made one that reads about 850 amps (have to look at my notes for the exact number) But it needed shielding or it didn't work at all. I ended up using 9 layers of .020" thick mu-metal it works ok but it has a problem with reading 0 amps on my gauges in the car. The Mu-metal is not perfectly magnetic memory free.

https://www.digikey.ca/product-detail/e ... ND/6173904

Another current sensor I have not tested was suggested to me is the A1326

Also STM32F302, TI TMS320F28 were mentioned!

Anyone who wants to step into this we could all use help because more current means less voltage! (Or for me MORE POWER!!!!!!!!!!!!!!!!!!!!!!!!!!)
My Leaf motor controller build. https://endless-sphere.com/forums/viewto ... 27#p963227
My YSR build http://www.youtube.com/watch?v=BRo8r5g4NBg
RC and most types of Lithium batteries you MUST know your individual cell voltages charging and discharging.
Don't keep them were you cant afford smoke or fire!
Never above 4.2v never below 2.7v EVER!!!
HI power controller design. Game Changer

User avatar
tecnologic
1 mW
1 mW
Posts: 11
Joined: Mar 24, 2015 12:41 pm

Re: Current Sensors How to select a good one or roll your ow

Post by tecnologic » Aug 07, 2017 2:00 am

Hi Arlo,

have u tried to split the current paths? See: http://www.allegromicro.com/en/Design-C ... tions.aspx

By splitting ur bus bars u could measure a fraction of the real current flowing and use known current sensors. But u could run into trouble with an uneaven current distribution due to skin or other strange effects at this high currents.

regards

Tec

User avatar
Arlo1
100 GW
100 GW
Posts: 8494
Joined: Apr 26, 2009 10:36 pm
Location: Nanaimo BC Canada
Contact:

Re: Current Sensors How to select a good one or roll your ow

Post by Arlo1 » Aug 07, 2017 2:14 am

tecnologic wrote:Hi Arlo,

have u tried to split the current paths? See: http://www.allegromicro.com/en/Design-C ... tions.aspx

By splitting ur bus bars u could measure a fraction of the real current flowing and use known current sensors. But u could run into trouble with an uneaven current distribution due to skin or other strange effects at this high currents.

regards

Tec

Thanks yes we have hopped up prius's and old RAV4ev's that way. But I prefer to do it right.
My Leaf motor controller build. https://endless-sphere.com/forums/viewto ... 27#p963227
My YSR build http://www.youtube.com/watch?v=BRo8r5g4NBg
RC and most types of Lithium batteries you MUST know your individual cell voltages charging and discharging.
Don't keep them were you cant afford smoke or fire!
Never above 4.2v never below 2.7v EVER!!!
HI power controller design. Game Changer

marcos
100 W
100 W
Posts: 154
Joined: Nov 19, 2016 11:38 pm

Re: Current Sensors How to select a good one or roll your ow

Post by marcos » Aug 07, 2017 5:20 am

This is a tesla model s current sensor. At least 1200 Amps but I don't know the specific full scale limits
2017-08-04 19.24.08.jpg
The image came from here, and they figured out every chip on the board
http://www.diyelectriccar.com/forums/sh ... 753p9.html

As a wild guess, I think it measures +-50mv. In that case the resistor would be ~ 0.04mOhm. The sensor is made by isabellenhutte.
One big remark is that it outputs a digital delta sigma signal, which is great for signal integrity but a bit of a pain to deal in the controller side. IMO they used a shunt just to be able to use a delta sigma output.

Here is a circuit I made this year. It works very much the same way, but I used it to measure 500v with a resistor divider and its an analog differential output instead of delta sigma.
Screenshot_20170807_064858.png
Isolated power supply on the left, transformer+ldo. Isolated amplifier on the right, +-50mv range.
Screenshot_20170807_070515.jpg
(48.91 KiB) Downloaded 2 times
It worked well for voltage sensing.

If I had that fancy resistor I'd give my AMC1301 circuit a try. And then jump into the delta sigma train changing it to the amc1203.

User avatar
HighHopes
10 kW
10 kW
Posts: 845
Joined: Mar 28, 2013 6:25 pm

Re: Current Sensors How to select a good one or roll your ow

Post by HighHopes » Aug 07, 2017 5:19 pm

just some re-wording and quantitative numbers and comments/feedback. these are just for ball-park, if you have different number in mind put your values. i also added #9


1 bandwidth: >50kHz
2 group delay (latency) including signal conditioning: 10ms
3 low cost: <$50 per piece
4 small and compact.: <24 in^3
5 Light weight: 400g per piece
6 simple to use <-- ? i think this one is irrelevant
7 Bi-directional (AC only, DC as well is considered a bonus), range +/- 2000A
8 the end signal needs to be analog and still within the time from number 1 <-- you sure it "needs" to be analog? anyway, i agree analog is my preference too .. so lets stick with that and just reword it to: 0 to 3.3V analog scaling at DSP analog in pin
9 linearity over 95% range, +/- 1%

User avatar
Arlo1
100 GW
100 GW
Posts: 8494
Joined: Apr 26, 2009 10:36 pm
Location: Nanaimo BC Canada
Contact:

Re: Current Sensors How to select a good one or roll your ow

Post by Arlo1 » Aug 07, 2017 7:16 pm

Thanks HH.

As for simple to use what I mean is some of the off the shelf current sensors want you to put +15 and -15 volts in then they spit out 0v at 0 amps....

What we need (I need is 2.5v at 0 amps) and simple to supply power to.. having to run 4 wires to a current sensor and use 2 isolated supplies or one with dual outputs seems complicated and unnecessary

Which leads me into #8 I would prefer 0-5v. Its easy to divide it down from 0-5 to 0-3.3v and if you are using 5v stuff like me then it will give you a touch more resolution and a bit more noise immunity.
My Leaf motor controller build. https://endless-sphere.com/forums/viewto ... 27#p963227
My YSR build http://www.youtube.com/watch?v=BRo8r5g4NBg
RC and most types of Lithium batteries you MUST know your individual cell voltages charging and discharging.
Don't keep them were you cant afford smoke or fire!
Never above 4.2v never below 2.7v EVER!!!
HI power controller design. Game Changer

User avatar
Lebowski
1 GW
1 GW
Posts: 3112
Joined: Jun 28, 2011 1:38 am
Location: beautiful Zurich, Switzerland

Re: Current Sensors How to select a good one or roll your ow

Post by Lebowski » Aug 08, 2017 1:29 am

What I would try... get a small chip that measures magnetic field as the ones mentioned earlier in the thread. Now we need to stick this in the magnetic field of a motor wire. Preferably in such a way that we can tune how many volts per amp we get, adjustable and also linear (so no magnetic material as this can be non-linear and have hysteresis).

How about something like this:
WP_20170807_20_47_49_Pro.jpg
WP_20170807_20_47_49_Pro.jpg (147.6 KiB) Viewed 961 times
note how the current carrying wire is first coiled one way and then the coil direction changes into the other way. With this construction the field in the middle of the combined coil is exacly 0 and not dependent on current (the fields from both coils are equal but opposite strength in the middle, cancelling each other). If you move away from the middle you will see a field dependent on the current, the field strength increases as you move away from the middle (you will get less and less cancellation). The sensor would be stuck on the end of the pencil, moving the pencil in and out changes the Volts per Amps of the sensor.

To go for high currents I would not use a wire put get a 1/2" (or 1 cm) copper pipe from a plumbing store:
WP_20170807_20_54_17_Pro.jpg
WP_20170807_20_54_17_Pro.jpg (128.51 KiB) Viewed 961 times
Imagine the yellow paper is the copper pipe, the blue line it a spiraling cut (reversing in the middle). The red arrows show how the current would flow.
I would use a 3D printer to print a core of non-magnetic plastic. In the center of the copper tube place the (3D printed) plastic pipe with thread in it so you can screw in a plastic bolt. The sensor is glued to the top of the plastic bolt. Once adjusted you can glue down the plastic bolt.The plastic tube and bolt will give the whole structure regidity.

marcos
100 W
100 W
Posts: 154
Joined: Nov 19, 2016 11:38 pm

Re: Current Sensors How to select a good one or roll your ow

Post by marcos » Aug 08, 2017 6:09 pm

Arlo,you may be very not okay with the heat and power loss on a shunt resistor, or having an extra pcb near the controller, but I can make some boards like this, if it works for you
current sensor.png
current sensor.png (23.45 KiB) Viewed 924 times
I reckon its about 15usd in components plus the shunt. (isolator+transformer+supply+ldo+opamp+connector)

A quick search found this, I guess there are plenty out there.
https://www.alibaba.com/product-detail/ ... b095lt8yxQ

If I make such board I could start playing with a fully digital signal chain for my build. In my end its just copypasting sheets of previous designs.

I could make this a single breakable board so you only have to wire that 2.5v centered analog signal. If you want the digital signal on your wiring like me you just break the pcb and add the wires.

User avatar
HighHopes
10 kW
10 kW
Posts: 845
Joined: Mar 28, 2013 6:25 pm

Re: Current Sensors How to select a good one or roll your ow

Post by HighHopes » Aug 08, 2017 9:25 pm

having to run 4 wires to a current sensor and use 2 isolated supplies or one with dual outputs seems complicated and unnecessary
i think in the end you'll find that you need the 4 wires and an isolated supply. the problem is the current sensor is external to your main control board AND the current sensor is very close to a noisy thing (motor cable) which is extremely relevant at your power levels.

AMC1303, section 1.2
"For use in high-resolution measurement applications, an effective accuracy of 14-bits can be obtained with a digital filter bandwidth of 20 kHz at a modulator rate of 10 MHz." <-- 20khz bandwidth? too slow. seems its max is double that..still, 40kHz? too slow. that's low to mid level performance stuff.. you want minimum 50kHz for 20kHz PWM switching & current movements to get the higher performance. but maybe.. you don't need high accuracy, you can get away with 8 or 10bit resolution, can you get higher bandwidth with this tradeoff? if yes, then its still possible to use this chip. overall, your current measurement does not need to be accurate, but it needs to have high repeatability. that is, if you have 100Amps in each phase exactly, but phase A measures 105A, phase B measures 106A and phase C measures 105.5A ... that's OK. if instead you have phase A measures 100A, phase B measures 100A, phase C measures 105A.. that's a problem.

shunt resistor - i agree with marcus, your power losses are going to be intense and as it gets hotter it gets less accurate (linearity... spec). i looked through my datasheets i had on proper 4-wire shunt resistors but i think none if them are good for your power level. not sure anything off the shelf exists.

User avatar
HighHopes
10 kW
10 kW
Posts: 845
Joined: Mar 28, 2013 6:25 pm

Re: Current Sensors How to select a good one or roll your ow

Post by HighHopes » Aug 08, 2017 9:36 pm

This is a tesla model s current sensor.
ya, that's just copper.. not a resister per say. no way you can do anything so high amps with an actual shunt resistor.

the way i'm doing high amps is different (and can't measure DC), but also no resistor. can't be done with a resistor.

User avatar
Inwo
1 kW
1 kW
Posts: 425
Joined: Dec 13, 2016 12:01 pm
Location: SE MN. USA

Re: Current Sensors How to select a good one or roll your ow

Post by Inwo » Aug 08, 2017 10:16 pm

Is this a one off?
I have some Chevy volt sensors.
Possibly only dc. Never looked.

marcos
100 W
100 W
Posts: 154
Joined: Nov 19, 2016 11:38 pm

Re: Current Sensors How to select a good one or roll your ow

Post by marcos » Aug 08, 2017 10:40 pm

HighHopes wrote: AMC1303, section 1.2
"For use in high-resolution measurement applications, an effective accuracy of 14-bits can be obtained with a digital filter bandwidth of 20 kHz at a modulator rate of 10 MHz." <-- 20khz bandwidth? too slow. seems its max is double that..still, 40kHz? too slow. that's low to mid level performance stuff.. you want minimum 50kHz for 20kHz PWM switching & current movements to get the higher performance
It says so for 10MHz clock, but the exact same part has a 20MHz variant, so it would jump to 40khz at 14bit. There is another one that the clock pin is an input so you set the freq, up to 21mhz.
14 bit its probably too much, I usually use 12bit so it shouldn't be hard to reach 20% extra bandwidth in exchange of reducing the resolution to 1/4 (16384 -> 4096 counts)
ya, that's just copper.. not a resister per say. no way you can do anything so high amps with an actual shunt resistor.
Um, take a look for yourself
Image
Copper temp co is terrible. Besides, its probably not rated for continuous 1200Amps, for how long could you use that much current in a car? You either hit the speed limiter or the motor torque starts to decrease, battery depleted in 20min.
But yeah, that bus bar with shunt is certainly not an off the shelf part

User avatar
tecnologic
1 mW
1 mW
Posts: 11
Joined: Mar 24, 2015 12:41 pm

Re: Current Sensors How to select a good one or roll your ow

Post by tecnologic » Aug 09, 2017 2:53 am

HighHopes wrote:
AMC1303, section 1.2
"For use in high-resolution measurement applications, an effective accuracy of 14-bits can be obtained with a digital filter bandwidth of 20 kHz at a modulator rate of 10 MHz." <-- 20khz bandwidth? too slow. seems its max is double that..still, 40kHz? too slow. that's low to mid level performance stuff.. you want minimum 50kHz for 20kHz PWM switching & current movements to get the higher performance.
this is kind of misleading. The AMC samples at lets say 20MHz this sample stream is recorded and decimated by the filter. So it literally sums up all the samples and calculates the mean (very simple speaking) and this calculation is done every half pwm period of the centered pwm. With common SAR ADC u sample once for 1µs at the center of the PWM.

So the AMC has literaly a bandwidth of 10MHz sampling at 20MHz but with 1Bit samples. The Filter than has a bandwidth of 40kHz. But u only take the samples of one half period in to account.

User avatar
fechter
100 GW
100 GW
Posts: 11822
Joined: Dec 31, 2006 3:23 pm
Location: California Bay Area, USA

Re: Current Sensors How to select a good one or roll your ow

Post by fechter » Aug 09, 2017 8:12 am

I searched my normal supply sources and didn't find much that looked better than the CSLA2EN 950 amp. To increase the range, it may be possible to shift the position of the hall sensor out of the slot half way, so it sits right at the edge of the OD of the ferrite. If the sensor die gets out of the slot, the flux will drop.

Here is another possible choice:
http://www.mouser.com/ds/2/397/L34SXXXD15-35616.pdf

$40.61 ea. Available up to 1.5kA. (I only saw 1.2kA in stock).
Current Sensor.jpg
Current Sensor.jpg (9.39 KiB) Viewed 877 times
"One test is worth a thousand opinions"

User avatar
Arlo1
100 GW
100 GW
Posts: 8494
Joined: Apr 26, 2009 10:36 pm
Location: Nanaimo BC Canada
Contact:

Re: Current Sensors How to select a good one or roll your ow

Post by Arlo1 » Aug 09, 2017 10:09 am

^^ Takes +15 -15v and spits out 0v at 0 amps -v at - amps and +v at + amps.... Needs 4 wires and dual isolated supplies....
My Leaf motor controller build. https://endless-sphere.com/forums/viewto ... 27#p963227
My YSR build http://www.youtube.com/watch?v=BRo8r5g4NBg
RC and most types of Lithium batteries you MUST know your individual cell voltages charging and discharging.
Don't keep them were you cant afford smoke or fire!
Never above 4.2v never below 2.7v EVER!!!
HI power controller design. Game Changer

User avatar
HighHopes
10 kW
10 kW
Posts: 845
Joined: Mar 28, 2013 6:25 pm

Re: Current Sensors How to select a good one or roll your ow

Post by HighHopes » Aug 09, 2017 7:44 pm

t says so for 10MHz clock, but the exact same part has a 20MHz variant, so it would jump to 40khz at 14bit. There is another one that the clock pin is an input so you set the freq, up to 21mhz.
14 bit its probably too much, I usually use 12bit so it shouldn't be hard to reach 20% extra bandwidth in exchange of reducing the resolution to 1/4 (16384 -> 4096 counts)
if you can get the tesla method working at AT LEAST 40kHz bandwidth i think its worth pursuing.

tesla method, is that a copper bus bar some how fused to a piece of ceramic (i.e. the "resistor") ?
tesla method, are they using this thing for over current protection only? or also for torque control ? i'm assuming its for both..

arlo - the latest/greatest in transmission & electrical distribution substations is to get away from traditional current transformers and move to "optical transformers". maybe one of these, low voltage (i.e. 600V rated) and 2000A could be good for our application. i haven't seen a datasheet that goes into the specifics for bandwidth & linearity, but i know it spits out the data over fiber at a near "real time" rate. but "real time" to industry might be too slow for EV application. once i can find a datasheet i'll give a look.

User avatar
PaulD
100 W
100 W
Posts: 180
Joined: Aug 28, 2008 5:42 pm
Location: Ashland, OR
Contact:

Re: Current Sensors How to select a good one or roll your ow

Post by PaulD » Aug 09, 2017 9:15 pm

HighHopes wrote:
tesla method, is that a copper bus bar some how fused to a piece of ceramic (i.e. the "resistor") ?
Manganin is often Electron Beam Welded  to copper for this purpose. Not sure if that's the case here. It has a low temp coefficient.

Sent from my Pixel using Tapatalk

marcos
100 W
100 W
Posts: 154
Joined: Nov 19, 2016 11:38 pm

Re: Current Sensors How to select a good one or roll your ow

Post by marcos » Aug 13, 2017 12:55 pm

This is what I meant
3D view.png
It uses this $12 shunt
http://www.isabellenhuette.de/fileadmin ... de/BAS.PDF

All ICs are from texas instruments, if you care about $ you can order free samples
Simple 2 layer pcb, 5usd plus shipping at seeed studio for 10 boards

As it is right now it would measure 1400 Amps linearly, and 1850 Amp with less linearity. The ADC input is rated for +/-50mV, but works at +/- 64mV with derated linearity. A fix for that would be to choose the +/-250mV ADC and use a good external opamp to set a gain to reach 250mV at 2000A. (gain=3.5)
Or ask for a 25 uOhm resistor instead of the 35 uOhm resistor of isabellenhuette's catalog, I'd prefer not having to add an opamp for such low signals.

A note about the resistor, I understand its rated for 30W (925 Amps) continuous. I think it won't be a problem if you occasionally drive a 2000 Amps current.

User avatar
tecnologic
1 mW
1 mW
Posts: 11
Joined: Mar 24, 2015 12:41 pm

Re: Current Sensors How to select a good one or roll your ow

Post by tecnologic » Aug 14, 2017 8:10 am

Hi Macros,

nice unit! Why not using 2 of these Shunts in parallel? Do u suspect any issues with the current distribution?

marcos
100 W
100 W
Posts: 154
Joined: Nov 19, 2016 11:38 pm

Re: Current Sensors How to select a good one or roll your ow

Post by marcos » Aug 14, 2017 9:10 am

tecnologic wrote:nice unit! Why not using 2 of these Shunts in parallel? Do u suspect any issues with the current distribution?
I guess you could stack 2 shunts and on top solder the pcb. IMO a simpler heatsink+silpad attached to the shunt would work as well, resistors, afaik, don't care about the current, only about the temperature. Your measurement starts to drift with temperature, and above 170°C the resistance change is irreversible for these types of shunts. So decreasing the °C/Watt should be enough. After all this shunt is also suggested for welding applications.

According to the curves in the datasheet, it can sustain pulses of 70W for 10 seconds as a maximum for "permanent operation". That is 1400 Amps RMS, 2000 A peak.

So power-wise I'd use only 1, but if I really need 2000 Amp, stacking 2 of those 50 uOhm shunts would get me the 25 uOhm that I need, its a good option. Before you should ask the manufacturer, just in case they already have 25uOhm resistors

Here is a probably worthless timelapse of the layout process, its less entertaining than I anticipated, but meh, its uploaded.
https://www.youtube.com/watch?v=QeFgT8ByIdM

marcos
100 W
100 W
Posts: 154
Joined: Nov 19, 2016 11:38 pm

Re: Current Sensors How to select a good one or roll your ow

Post by marcos » Aug 14, 2017 3:32 pm

The BOM of this pcb is $15 in qty = 10. (tends to 9.5usd in large quantities)
Add the shunt: $13.22. (I didn't ask for bulk prices)
10 PCBs costs $17 ($1.7 each)
The assembly cost will depend on the assembler.

So its 30usd plus assembly, its actually a good figure. I guess it would cost 25usd in production. For us, it costs ~20usd if we use the free sample program and assemble ourselves. And today I got a 5usd coupon from seeed studio.

User avatar
HighHopes
10 kW
10 kW
Posts: 845
Joined: Mar 28, 2013 6:25 pm

Re: Current Sensors How to select a good one or roll your ow

Post by HighHopes » Aug 14, 2017 7:49 pm

marcus $25/unit, that's more than reasonable. linear up to 1400A and then non-linear in "overdrive" mode that's fine. you can do some math to linearize that portion or at least improve. do you have the SCH & BOM for this? we can do some analysis and change the design if needed to suit our purpose. the 250mv diff op-amp is available, i have an old one in the ivan garage schematic you've seen, and a newer one i'm using now in later design. also, i recall that TI has a temperature compensation method for this type of current sensing if its not already there.

also, BAS sensor, the high amp one.. you think it can put ~900A into the shunt resistor that is only 3mm thick? geez....

User avatar
HighHopes
10 kW
10 kW
Posts: 845
Joined: Mar 28, 2013 6:25 pm

Re: Current Sensors How to select a good one or roll your ow

Post by HighHopes » Aug 14, 2017 7:59 pm

PaulD wrote:Manganin is often Electron Beam Welded  to copper for this purpose.
sounds like a process that is not easily DIY .. i'm trying to find ways to make all this high power EV stuff "doable" to a highly interested practitioner on a shoestring budget and typical bench tools only.

marcos
100 W
100 W
Posts: 154
Joined: Nov 19, 2016 11:38 pm

Re: Current Sensors How to select a good one or roll your ow

Post by marcos » Aug 15, 2017 5:22 am

HighHopes wrote:marcus $25/unit, that's more than reasonable. linear up to 1400A and then non-linear in "overdrive" mode that's fine. you can do some math to linearize that portion or at least improve. do you have the SCH & BOM for this? we can do some analysis and change the design if needed to suit our purpose. the 250mv diff op-amp is available, i have an old one in the ivan garage schematic you've seen, and a newer one i'm using now in later design.
I can prepare it for upload, its not even versioned yet.
HighHopes wrote:also, BAS sensor, the high amp one.. you think it can put ~900A into the shunt resistor that is only 3mm thick? geez....
Ugh, I didn't think about that. It gives an ampacity of 200 Amp. Its also 3.5 uOhm in the copper section, 10% of the total resistance. 3.5W at 1000 Amp. If you look it as a bus bar is terrible, but as a shunt its not that bad. I would use it for a 1400 amp peak car if I'm the user. For more current we should pick the phone and ask the manufacturer.

marcos
100 W
100 W
Posts: 154
Joined: Nov 19, 2016 11:38 pm

Re: Current Sensors How to select a good one or roll your ow

Post by marcos » Aug 15, 2017 4:58 pm

The board is here
https://github.com/paltatech/current_sensor

This is the bom generated by kicad
https://github.com/paltatech/current_se ... x?raw=true

I didn't bother to fill the passives part#, I copied the filter from the other forum and those values or even the opamp could change.

Something worth asking is how to solder the shunt to the pcb. If 170°C is the max temp, how do you do a 250°C reflow?

Post Reply