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

ahhhh..... github. i been avoiding you for years cause i tend not to work in teams so i do all my revision control myself. but ya, i can see its usefulness.

lets say i wanted to make a change to the schematic you posted in github. you ok if i do that? i don't know how to do this yet in github.. will need to watch some tutorials or something i guess. but, as of this moment, here's how i see it. lets say i downloaded your entire zip folder. then i open my kicad, and decide to make a change. i do that, save it. zip entirety of the folder then upload to github (following tutorial methods so repository will do revision history properly). that sounds something close to the correct method?

anyway.. haven't read enough about the AMC1303 chip yet but i was thinking the schematic you have is shunt resistance referenced to ISOGND (V- is connected to ISOGND). this would be for like measuring the current in IGBT emitter to ground path which is not what we want. we want to measure the phase current in the AC output which is not really referenced to anything, its truly differential (or should be) because this shunt is in the inverter AC output. easy enough... just don't connect ISOGND to V-. but the chip has a power supply which is referenced to ISOGND so now you have a floating measurement (which really is differential) which is good but can the chip do that? or does it have to have V- connected to ISOGND to achieve the datasheet performance. that's what i was thinking when i open your schematic and did first browse through. otherwise, looks good. and i like the voltage divider at the buffer output... gives you some interface option to different voltage level in a pinch. for me, i'll be using a DSP with 3.3V analog in.

also, there's bound to be some voltage transients on the shunt. reading AMC1303 datasheet makes me think it self protects but need to confirm by reading more.
 
HighHopes said:
ahhhh..... github. i been avoiding you for years cause i tend not to work in teams so i do all my revision control myself. but ya, i can see its usefulness.

lets say i wanted to make a change to the schematic you posted in github. you ok if i do that? i don't know how to do this yet in github.. will need to watch some tutorials or something i guess. but, as of this moment, here's how i see it. lets say i downloaded your entire zip folder. then i open my kicad, and decide to make a change. i do that, save it. zip entirety of the folder then upload to github (following tutorial methods so repository will do revision history properly). that sounds something close to the correct method?
Great, I was hoping to get you onboard.

You can skip the tutorials for now. Save them for when you destroy your repository and you need to figure out how to fix it.

About git, its not about zips, you pull entire directories from the remote (online) repository.

A good way to publicly collaborate would be this:
1) Install git on your computer
2) sign up on github.com
3) Once logged in, go to https://github.com/paltatech/current_sensor and fork the repository. There is a fork button around there. It will create a copy of my repository in your github account.
4) Now you can select a directory on your pc, open inside a terminal and run "git clone https://github.com/highhopes/current_sensor.git"
(assuming your username is highhopes)
Now you have a copy of the repository (current files and all its history) in your pc. Steps 1-4 are needed only once. I prefer command line because its very few commands to learn, I don't like GUIs with many buttons, I already have CADs.

5) perform the changes as you wish. To upload to YOUR repository, open the terminal inside the working directory and run these 3 commands
git add .
(there is a ".". This adds files to be commited)
git commit -m'Describe your changes'
git push origin master

Now your changes are in the cloud.
6) If you want me to include your changes in my repository, go to https://github.com/highhopes/current_sensor and create a pull request. It will invite me to pull your commit(s) from your repository.

Its good to make as many step 5) as possible, specially in software when you misplace a stupid colon and the whole thing falls apart and you struggle to find at which point in the history is the error.

This is how it looks like with many people contribute to a project
https://github.com/KiCad/kicad-source-mirror/commits/master

This is how a lone wolf like us uses git version control
https://github.com/paltatech/VESC-controller/commits/master

HighHopes said:
anyway.. haven't read enough about the AMC1303 chip yet but i was thinking the schematic you have is shunt resistance referenced to ISOGND (V- is connected to ISOGND). this would be for like measuring the current in IGBT emitter to ground path which is not what we want. we want to measure the phase current in the AC output which is not really referenced to anything, its truly differential (or should be) because this shunt is in the inverter AC output. easy enough... just don't connect ISOGND to V-. but the chip has a power supply which is referenced to ISOGND so now you have a floating measurement (which really is differential) which is good but can the chip do that? or does it have to have V- connected to ISOGND to achieve the datasheet performance. that's what i was thinking when i open your schematic and did first browse through. otherwise, looks good. and i like the voltage divider at the buffer output... gives you some interface option to different voltage level in a pinch. for me, i'll be using a DSP with 3.3V analog in.

also, there's bound to be some voltage transients on the shunt. reading AMC1303 datasheet makes me think it self protects but need to confirm by reading more.

The schematic is intended to be used as a bidirectional current sensor, you can put the shunt in series with the phases and it will measure positive and negative currents. The working principle is a bit odd and I didn't care enough to fully comprehend it, but I know its bidirectional because I tried swapping + with - in a dc bus voltage sensor because of a wiring error, and it worked okay measuring -80v.
This is the circuit I played with.
https://eyrie.io/board/88ebffa8546c4bd0b7d9c5444c0bad18?active=schematic&sheet=2&x=5422960&y=7481548&w=5288129&h=2887639&flipped=false

ISOGND is called that way because its a kicad built in symbol, quick to place. There could be a better choice of worlds out there, its a reference rather than a ground.

I have to upload some changes, I added a buffer to reconstruct the 20MHz digital signal. If there is long wiring between the adc and the filter, that square wave can get distorted, so a buffer would return it to pristine condition.
 
This popped into my inbox from digirip

https://www.digikey.ca/en/product-highlight/t/texas-instruments/ina180-current-sense-amplifiers?WT.v_sub=6415511&WT.mc_id=em_NPA1708B.CA.Send&WT.z_email=16332_NPA1708B0B0NCA_supplier1image--296-Texas_Instruments&mkt_tok=eyJpIjoiTjJZMFpEUTBNMlU0WkRBNCIsInQiOiIwNENZTUxnVU9hRzNVMjJTdFBBaEVwUnR3eEg5UllWaW9LVzRlejQ2XC9mZUluNjh1WlRGVndtRnpUSFVkUjNDNllnd0RJOTBhZHdNTUhEMEhieEZIMGRwb0JMNGpjM0J0VytOYmpLcENqeUpQMEZ4Mmp3bHhldDdZVlBCVjNJU2YifQ%3D%3D
 
Arlo1 said:
This popped into my inbox from digirip

https://www.digikey.ca/en/product-highlight/t/texas-instruments/ina180-current-sense-amplifiers?WT.v_sub=6415511&WT.mc_id=em_NPA1708B.CA.Send&WT.z_email=16332_NPA1708B0B0NCA_supplier1image--296-Texas_Instruments&mkt_tok=eyJpIjoiTjJZMFpEUTBNMlU0WkRBNCIsInQiOiIwNENZTUxnVU9hRzNVMjJTdFBBaEVwUnR3eEg5UllWaW9LVzRlejQ2XC9mZUluNjh1WlRGVndtRnpUSFVkUjNDNllnd0RJOTBhZHdNTUhEMEhieEZIMGRwb0JMNGpjM0J0VytOYmpLcENqeUpQMEZ4Mmp3bHhldDdZVlBCVjNJU2YifQ%3D%3D

Like a modern version of a LM358. Impressively low supply current.
 
I took a last stab to the shunt board. Added some wiring harness fault tolerance (fuse, series resistors, clamping diodes, zener) and pushed to the repo.

If I get the time I might send it to fab.
 

Attachments

  • board.png
    board.png
    84.1 KB · Views: 4,860
the current sensor busbar will be affixed to the IGBT and presumably an insulated mount just before cable connection out to motor. the other end of the PCB has 2 screw holes to secure it to something. that something.. hopefully, is the same thing as the insulated mount just before cable connection. that way the vibration affects both ends of the PCB roughly the same. it looks like you could snap it in half with your bare hands..

do you have this in sim? would be good to see the bode plots.
 
This is a fascinating discussion!

It seems fairly obvious to me how to monitor phase current whether that 1 amp or 1000 amps. The noob speaks. LOL!

Use a shunt of the appropriate amperage and measure the voltage drop across it. This is pretty easy IMHO to display. Use an old analog meter and a diode. You will need 2 per phase to detect both directions of current flow. If the voltage is in the range of the meter, you will see the needle deflect in the direction of current flow for that meter. Amplify or limit as needed to get the needle deflection needed. If you need to log those voltage changes, an ADC will do the trick to make it into 1's and 0's and then you can log all you want. It will of course NEED to be isolated form everything else, but that's an easy thing to resolve.

The other choice of an external winding around the phase wires is 100% isolated and doesn't need a shunt. How does a clamp on amp meter work? That's rhetorical obviously. It's nothing but a coil that gets a voltage induced on it by the current flowing through the wire it is clamped around. That's just a bit of math to figure out the volts per amps ratio. It won't matter if the phase wire has 1 amp or 1000 amps flowing in it the coil doesn't care and the measuring device on the coil just needs to have sufficient range to measure the voltage swing on the coil and be fast enough to react. Typical USB signal analyzers and PC based o-scopes are fast enough for this application.

IMHO...easy peazy.
 
HighHopes said:
the current sensor busbar will be affixed to the IGBT and presumably an insulated mount just before cable connection out to motor. the other end of the PCB has 2 screw holes to secure it to something. that something.. hopefully, is the same thing as the insulated mount just before cable connection. that way the vibration affects both ends of the PCB roughly the same. it looks like you could snap it in half with your bare hands..
Those 2 parts are together just for my initial -and quick- testing, and in case someone *really* wants an analog signal coming right from the sensor.

A more sensible use case IMO is to snap the pcb, run the digital wiring towards the controller, and bolt the small board of the right next to the controller
shunt.png

HighHopes said:
do you have this in sim? would be good to see the bode plots.

I just copied the filter from here, my values are probably outdated
http://www.diyelectriccar.com/forums/showthread.php/high-power-100-kw-sic-inverter-129642p9.html
They are about to use it on a tesla drivetrain that uses delta sigma. 6usec lag is a bit too much though.

Honestly I didn't pay much attention to the analog filter yet, I'm more interested about the digital filtering of this signal.

It seems fairly obvious to me how to monitor phase current whether that 1 amp or 1000 amps.
In theory its very easy. Now get me an ideal, spherical cow and I'll demonstrate how easy it is.
 
ya, totally agree snap the PCB and make wired connection between sensor and brain board. this cable is going to be noisy.. you should consider, unless you already did and i didn't see it, to have a connection point for cable shield on both ends. weither it gets connected on both ends or not is debate for later but at least the option is there. in some ways, this is a lot like a wired connection to the resolver or encoder measuring the motor position. that signal can be analog or digital (depending on your sensor choice) and its also noisy. this cable is also shielded with termination done in special way. does make you think... if you terminate the shield on the inverter side, where will this connection be made and is there a convenient location to on the PCB that is a good ground (not some skinny trace near the connector to tie the shield to)
 
I didn't consider shielding for this. Do you know about a nice shielded connector? The only properly shielded connectors I used are usb, not quite appropriate for this application
 
ElectricGod said:
This is a fascinating discussion!

It seems fairly obvious to me how to monitor phase current whether that 1 amp or 1000 amps. The noob speaks. LOL!

Use a shunt of the appropriate amperage and measure the voltage drop across it. This is pretty easy IMHO to display. Use an old analog meter and a diode. You will need 2 per phase to detect both directions of current flow. If the voltage is in the range of the meter, you will see the needle deflect in the direction of current flow for that meter. Amplify or limit as needed to get the needle deflection needed. If you need to log those voltage changes, an ADC will do the trick to make it into 1's and 0's and then you can log all you want. It will of course NEED to be isolated form everything else, but that's an easy thing to resolve.

The other choice of an external winding around the phase wires is 100% isolated and doesn't need a shunt. How does a clamp on amp meter work? That's rhetorical obviously. It's nothing but a coil that gets a voltage induced on it by the current flowing through the wire it is clamped around. That's just a bit of math to figure out the volts per amps ratio. It won't matter if the phase wire has 1 amp or 1000 amps flowing in it the coil doesn't care and the measuring device on the coil just needs to have sufficient range to measure the voltage swing on the coil and be fast enough to react. Typical USB signal analyzers and PC based o-scopes are fast enough for this application.

IMHO...easy peazy.

It certainly does sound easy. In practice shunts get bulky and noisey, and magnetic sensor cores hold residual magnetic offset drift from the 0amp point.
 
marcos said:
The only properly shielded connectors I used are usb, not quite appropriate for this application
the ones i use are gigantic, metal D-sub. lets look around, see what we can find.

another option, and i just put this out there... what if the A/D were on the sensor side and from there it is fiber to brain board? at this power level the gate driver is probably separate from brain board and should be fiber anyway, so its not like introducing fiber would be a unique thing.
 
Shunts have a fundamental limit.... they are limited by their power dissipation.

Since the voltage across a shunt time the current is the dissipation, and you can only tolerate dissipation upto a certain level, you are limited.

A 1000A shunt in practise can maybe generate only 50mV of signal, meaning it will be inaccurate and susceptible to noise. Amplification will be difficult due to the amplifiers noise, bandwidth limitation, magnetic field induced voltages, offset drift etc etc
 
marcos said:
I didn't consider shielding for this. Do you know about a nice shielded connector? The only properly shielded connectors I used are usb, not quite appropriate for this application

What about shielded ethernet cable/connector?
 
nieles said:
marcos said:
I didn't consider shielding for this. Do you know about a nice shielded connector? The only properly shielded connectors I used are usb, not quite appropriate for this application

What about shielded ethernet cable/connector?

Are you guys talking shielding the signals or the actual sensor?
 
Lebowski said:
Shunts have a fundamental limit.... they are limited by their power dissipation.

Since the voltage across a shunt time the current is the dissipation, and you can only tolerate dissipation upto a certain level, you are limited.

A 1000A shunt in practise can maybe generate only 50mV of signal, meaning it will be inaccurate and susceptible to noise. Amplification will be difficult due to the amplifiers noise, bandwidth limitation, magnetic field induced voltages, offset drift etc etc

The power shedding can be solved if you have the space and weight available for it, keep in mind a Tesla model S rear motor phase current is >1800amps and it runs shunts in each phase leg.

What gets nasty is the 0.5v-5v of noise on your shunt as referenced to "ground", relative to the 50mV peak signal.

Fortunately Maxum and a couple other IC mfgs make incredible floating differential signal input op-amps with integrated hardware noise filtering.
 
About fiber, I don't think its necessary here. A single bit error in a 20 khz gate driver pwm signal is catastrophic, I understand the use of fiber. A single bit error in a 20MHz adc is only a least significant bit error, its not much of a problem. Unless it happen very often, but you need a 2v glitch to flip a bit, we can deal with that.

About ethernet connectors, I see them used in the industry, its a shame they have 8 positions and we only need 4. Maybe it could add redundancy, but at 20MHz a redundant wire is a very long stub, so it would need separate buffers and a way to combine the signal at the end. If I find a 4pos connector a would be happier.
 
If you want to use fiber and are worried about bit errors, why not transfer a 1 bit sigma delta bitstream instead of PCM ? Then, at the controller IC side, you can do analog or digital decimation filtering ... keeping in mind the delay and bandwidth of the decimation filter should be not too low.

The isolation chip Arlo1 uses for his battery voltage measuring works this way.
 
Lebowski said:
If you want to use fiber and are worried about bit errors, why not transfer a 1 bit sigma delta bitstream instead of PCM ? Then, at the controller IC side, you can do analog or digital decimation filtering ... keeping in mind the delay and bandwidth of the decimation filter should be not too low.

The isolation chip Arlo1 uses for his battery voltage measuring works this way.

The Melexis chips do that onboard in hardware, and measure the field on 3 axis and hardware integrate a current value and spit it out digitally. All in a single tiny IC.
 
liveforphysics said:
Lebowski said:
If you want to use fiber and are worried about bit errors, why not transfer a 1 bit sigma delta bitstream instead of PCM ? Then, at the controller IC side, you can do analog or digital decimation filtering ... keeping in mind the delay and bandwidth of the decimation filter should be not too low.

The isolation chip Arlo1 uses for his battery voltage measuring works this way.

The Melexis chips do that onboard in hardware, and measure the field on 3 axis and hardware integrate a current value and spit it out digitally. All in a single tiny IC.
The Melexis chips I am using are analog out.
 
Here is the schematic of the circuit I proposed
 

Attachments

  • current_sensor.pdf
    207.5 KB · Views: 247
Lebowski said:
Watch out for the 'buffer to restore signal' ISI (inter symbol interference)
Yes, thanks. Its not easy to restore the signal, I'm only using the delta sigma but I should also use the clk as a latch to re-sync and eliminate the duty cycle offset, signal roundness, the group delay of the frequencies, etc. I was planning on just put termination resistors, twist the wires and maybe try a couple of resistor values and caps to get a reasonable eye diagram before the buffer.

Any over the top effort in an analog solution is wasting time that should be spent on the actual digital filtering implementation imo.
 
I just ordered some of your boards marcos I will build up a few and test them.

Thank you very much for the work on this.

-Arlin
 
Great to hear. 6 days ago I gently reminded Isabellenhuete about the shunt samples I asked for and after some checking they told me they will ship around christmas (ship to argentina). I'm not building pcbs until have samples in my hand.

The samples I asked for are 2000A shunts that are not actually available for ordering because they are sold with the electronics built in. The little board I made is for a commercial, ready to order shunt (that I think I'm not getting a sample of).
I'll get you in contact with the factory to get you some BAS-Z-R000035 shunts.
 
Back
Top