EEVblog Electronics Community Forum
Electronics => Beginners => Topic started by: trilerian on July 29, 2024, 04:23:12 pm
-
I am looking to design a high side current sensing circuit for bldc motor phases. I want to be able to read the current from 0.1A - 50A.
I have chosen a Bourns 1mΩ 5W 1% current sense resistor. @50A it will be dissipating 2.5W. Should that be heatsinked, it is going to get warm?
For the op-amp I was looking at the TSC2012 https://www.mouser.com/datasheet/2/389/tsc2010-1852588.pdf (https://www.mouser.com/datasheet/2/389/tsc2010-1852588.pdf). It has a gain of 100, so 50A will be right at 5V and 0.1A would be at 0.01V, which will be fine for a 12bit ADC. But the question is can the op-amp reliably measure a 0.0001V differential voltage? Also, would I want to filter the pwm into a dc signal before the op-amp or after the op-amp? I normally use the big Allegro current sensors, but want to start using current shunts with op-amps.
-
The offset and offset drift determine the minimum voltage the op-amp can measure. As you're using an ADC, it's possible to null out the offset voltage, but the drift is something which you can't do much about.
In this case, your amplifier has an offset voltage of up to 700µV, which can be nulled out, by recording it when the current is zero and subtracting it from subsequent readings, and you want to measure down to 100µV. The drift is 5μV/°C, do as long as the temperature doesn't change too much, it will be fine.
-
Noise 37uVp-p with G=100 equals 3.5 mVp-p. You didn't say what is pwm frequency, but overall I think it's quite possible to get 1 mV resolution simply by running adc ~1 MSPS, the higher rate - the better. It'd make sense to synchronize adc with PWM, have defined number of samples per each PWM period.
-
Noise 37uVp-p with G=100 equals 3.5 mVp-p. You didn't say what is pwm frequency, but overall I think it's quite possible to get 1 mV resolution simply by running adc ~1 MSPS, the higher rate - the better. It'd make sense to synchronize adc with PWM, have defined number of samples per each PWM period.
PWM frequency will be around 8-12kHz. I have ADS1015, ADS1016, and mcp3208 to use for ADCs. I am not sure how to synchronize them to run at the same pwm as the motors. Maybe it is in the datasheet. The goal of this project is to use the current to find rotor position and also measure the phase current. I am going to do this instead of the standard zero cross detection which I already have working on the bench.
-
mcp3208 may be o'k, AFAIR 100 ksps.
Essentially this is AC current measurements, so offset & drift of the tsc2010 are not relevant.
To extract current magnitude I'd use Goertzel or FFT, as PWM freq. is unknown
Google is a good start point for research with a text printed in red
-
I got some parts in to start testing with, and the waveforms I am getting do not make any sense. I am putting a 1mΩ shunt resistor inline on phase B of my BLDC. Using the same setup as described in the following article: https://www.st.com/resource/en/application_note/an5423-current-sensing-in-bldc-motor-application-stmicroelectronics.pdf (https://www.st.com/resource/en/application_note/an5423-current-sensing-in-bldc-motor-application-stmicroelectronics.pdf) Page 6, section 1.4. Right now I am not trying to measure amplitude, although there are some confusing things there as well, but I am just looking at the waveform in general.
Just some info on this, I am looking at the waveform on a 3rd party ESC. The ESC shares a common ground with my circuit, but other than the ground and the current shunt on phase B, there are no other connections. I am using a 3rd party ESC because I haven't built my own controller yet.
Anyway, page 23 of the datasheet: https://www.mouser.com/datasheet/2/389/tsc2010-1852588.pdf (https://www.mouser.com/datasheet/2/389/tsc2010-1852588.pdf), section Bidirectional Operation and Split Supply is how I have the TSC2012 hooked up.
Also posting a schematic of that part.
For simplicity to get rid of PWM pulses I am measuring at full throttle. My expectation is that the current waveform would be stable and look like a square wave in phase with the BEMF. However that isn't the waveform I see. I am going to attach a bunch of pics.
Pic 1 is a digital capture of the differential voltage on the current shunt.
Pic 2 is a digital caputre of the output of the TSC2012.
Pic 3 is a scope capture of the output and the RPM sensor to trigger on.
Signal 1 is the RPM sensor
Signal 2 is the output of the TSC2012
The scope capture and the digital capture of the output are the same, just different scales.
What would I expect?
Pic 4 is scope output of:
Signal 1: RPM Sensor
Signal 2: TSC2012 output
Signal 3: SIGA
Signal 4: SIGB
MATH: SIGA - SIGB
The v/div on 3 and 4 are different to show the signals are essentially the same, there is only the 1mΩ shunt between the two.
Notice the MATH signal is what I am expecting, the only exception being the voltage difference is too high. Also to note, the current is higher in this last signal due to increasing the timing on the can of the BLDC. It was a struggle to get a "cleanish" MATH signal from 3 and 4, so I had to make some changes. Also to note the voltage difference here which is way higher than it should be, but that is another struggle I'll deal with later.
Looking at other devices that do what I want, they measure current on the low side of each leg. So maybe that is the direction I will go to, but like I said, I haven't built a controller yet, so it is hard for me to insert current sense on the low side of a 3rd party ESC.