+ Post New Thread
Results 1 to 17 of 17
  1. #1
    Member level 2
    Points: 773, Level: 6

    Join Date
    May 2010
    Posts
    46
    Helped
    3 / 3
    Points
    773
    Level
    6

    Low Side Current Sense amplifier

    Hi everyone,

    I want to create a low side current sensing circuit. The goal is to sense a 0-5 amp magnitude current by using a kelvin resistor, differential op amp, and a 0-3v ADC (from a microcontroller). The problem I have is that the direction of the current is not guaranteed. This is a motor controller, so sometimes the motor will drive current from the ground to the voltage source via the MOSFET's diodes. I want to be able to measure this current as well as the forward current. If I use a differential amplifier to amplify the voltage from the kelvin resistor (4-wire resistor), then I will get some negative voltage when the current is negative. To solve this, I think I need a second amplifier to add a voltage offset to the first amplifier. AKA, the op amp stages would be like this:

    stage 1: Amplify the small signal from current sensing resistor (4-wire resistor seems to be the way to go, but correct me if I'm wrong, I'm still relatively new to all of this). The output from here would be -3v to 3v. I guess this means I'd need a -3.3v power supply, or some negative power supply, for this op amp.
    stage 2: Add 3v to the output of stage 1, so that we have a 0-6v output. Then I can use a resistor divider to get 0-3v output.

    Maybe I'm making this too complicated, so please help me!

    Thanks,
    Matt

  2. #2
    Super Moderator
    Points: 44,219, Level: 51
    Achievements:
    Created Album picturesCreated Blog entry7 years registered
    alexan_e's Avatar
    Join Date
    Mar 2008
    Location
    Greece
    Posts
    11,205
    Helped
    2035 / 2035
    Points
    44,219
    Level
    51
    Blog Entries
    6

    Re: Low Side Current Sense amplifier

    Assuming that you mean an H bridge controller you can measure the current in the common ground connection(sources of the low side mosfet), the polarity there will always be the same
    Hbridge_mosfet_flyback.gif
    Please don't make requests for help in private using PM. Create a thread in the forum so that other members can benefit from the posted answers.

    Consider reading this before posting : How To Ask Questions The Smart Way



  3. #3
    Member level 2
    Points: 773, Level: 6

    Join Date
    May 2010
    Posts
    46
    Helped
    3 / 3
    Points
    773
    Level
    6

    Re: Low Side Current Sense amplifier

    Quote Originally Posted by alexan_e View Post
    Assuming that you mean an H bridge controller you can measure the current in the common ground connection(sources of the low side mosfet), the polarity there will always be the same
    Hbridge_mosfet_flyback.gif
    Won't current go from both drain-to-source (MOSFET "ON") of Q3/Q4 and also from source-to-drain (MOSFET "OFF", current flowing through the MOSFET body diode) when driving an inductive load?

    Thanks,
    Matt



    •   Alt3rd September 2011, 23:23

      advertising

        
       

  4. #4
    Super Moderator
    Points: 44,219, Level: 51
    Achievements:
    Created Album picturesCreated Blog entry7 years registered
    alexan_e's Avatar
    Join Date
    Mar 2008
    Location
    Greece
    Posts
    11,205
    Helped
    2035 / 2035
    Points
    44,219
    Level
    51
    Blog Entries
    6

    Re: Low Side Current Sense amplifier

    the current will flow either from Q2/Q3 or Q1/Q4, in either case the current will go through the shunt resistor which will be connected right before gnd so the voltage polarity on the resistor will be always 0 at gnd side and more positive in the mosfet source side.
    By switching different mosfets you invert the polarity applied to the motor coil but the power supply lines are still in the same place so the current flow is the same.

    I have done a similar circuit some time ago
    Hbridge.jpg

    Alex
    Please don't make requests for help in private using PM. Create a thread in the forum so that other members can benefit from the posted answers.

    Consider reading this before posting : How To Ask Questions The Smart Way



  5. #5
    Member level 2
    Points: 773, Level: 6

    Join Date
    May 2010
    Posts
    46
    Helped
    3 / 3
    Points
    773
    Level
    6

    Re: Low Side Current Sense amplifier

    Quote Originally Posted by alexan_e View Post
    the current will flow either from Q2/Q3 or Q1/Q4, in either case the current will go through the shunt resistor which will be connected right before gnd so the voltage polarity on the resistor will be always 0 at gnd side and more positive in the mosfet source side.
    By switching different mosfets you invert the polarity applied to the motor coil but the power supply lines are still in the same place so the current flow is the same.

    I have done a similar circuit some time ago
    Hbridge.jpg

    Alex
    I understand this, but what if the Back EMF on the motor (when all transistors are in the "OFF" state) causes current to flow through Q3 and Q2. If the motor is modeled as an inductor, and you turn all switches off after having one pair of switches on, then the motor will try to force current backwards through the body diodes of Q3 and Q2, right?



  6. #6
    Super Moderator
    Points: 44,219, Level: 51
    Achievements:
    Created Album picturesCreated Blog entry7 years registered
    alexan_e's Avatar
    Join Date
    Mar 2008
    Location
    Greece
    Posts
    11,205
    Helped
    2035 / 2035
    Points
    44,219
    Level
    51
    Blog Entries
    6

    Re: Low Side Current Sense amplifier

    the motor will not generate voltages below gnd (negative), it will just generate voltages reversed from the one it had while working and these will find a way to reach the power supply through the diodes, I don't see a way to have a negative voltage at the source side of the shunt resistor.

    ---------- Post added at 02:07 ---------- Previous post was at 01:52 ----------

    Take a look at H-bridge spiking -- Chuck's Robotics Notebook
    Please don't make requests for help in private using PM. Create a thread in the forum so that other members can benefit from the posted answers.

    Consider reading this before posting : How To Ask Questions The Smart Way



  7. #7
    Member level 2
    Points: 773, Level: 6

    Join Date
    May 2010
    Posts
    46
    Helped
    3 / 3
    Points
    773
    Level
    6

    Re: Low Side Current Sense amplifier

    Quote Originally Posted by alexan_e View Post
    the motor will not generate voltages below gnd (negative), it will just generate voltages reversed from the one it had while working and these will find a way to reach the power supply through the diodes, I don't see a way to have a negative voltage at the source side of the shunt resistor.

    ---------- Post added at 02:07 ---------- Previous post was at 01:52 ----------

    Take a look at H-bridge spiking -- Chuck's Robotics Notebook
    I see. This makes sense to me now. However, I would still like to build a bidirectional current sensor so that I can put it inline with the motor windings. I guess the way to do that would be to use a differential amplifier and then just read the voltage with an oscilloscope. I am still curious how to read a negative voltage with a microcontroller. This is not the first time I've needed a circuit like this. How do you convert +/- 15v to 0-3v? or +/- 0.1v to 0-3v, where 0v (from the bipolar input) = 0v (to the unipolar input) in both cases?



  8. #8
    Advanced Member level 4
    Points: 11,688, Level: 25
    ALERTLINKS's Avatar
    Join Date
    Dec 2003
    Location
    Pakistan
    Posts
    1,163
    Helped
    349 / 349
    Points
    11,688
    Level
    25

    Re: Low Side Current Sense amplifier

    Yes, how my $4 mutimeter puts ( - ) when current flows in revese direction?



    •   Alt9th September 2011, 21:42

      advertising

        
       

  9. #9
    FvM
    FvM is online now
    Super Moderator
    Points: 170,895, Level: 98
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    27,164
    Helped
    8417 / 8417
    Points
    170,895
    Level
    98

    Re: Low Side Current Sense amplifier

    I don't see a way to have a negative voltage at the source side of the shunt resistor.
    I see it though.

    As a first point, you have to distinguish between average and instantaneous current. Secondly, you have to distinguish between unipolar and bipolar PWM schemes.

    In bipolar PWM mode, you'll observe bipolar currents in the shunt resistor in most operation states. In unipolar PWM, there's a zero current period, when the current recirculates through either both low side or high side switches. You get negative current at least during generatoric (breaking) motor operation, and also negative current peaks in motoric operation, if the current ripple magnitude is sufficient high.

    In other words, dksoba is basically right.



  10. #10
    Member level 2
    Points: 773, Level: 6

    Join Date
    May 2010
    Posts
    46
    Helped
    3 / 3
    Points
    773
    Level
    6

    Re: Low Side Current Sense amplifier

    Quote Originally Posted by FvM View Post
    I see it though.

    As a first point, you have to distinguish between average and instantaneous current. Secondly, you have to distinguish between unipolar and bipolar PWM schemes.

    In bipolar PWM mode, you'll observe bipolar currents in the shunt resistor in most operation states. In unipolar PWM, there's a zero current period, when the current recirculates through either both low side or high side switches. You get negative current at least during generatoric (breaking) motor operation, and also negative current peaks in motoric operation, if the current ripple magnitude is sufficient high.

    In other words, dksoba is basically right.
    Being right or wrong doesn't really matter to me (although eventually it'd be nice to know the right answer). What I'm trying to do is measure a positive or negative current using a single sided ADC. I'd like to amplify a +- 0.1v input signal, for example, so that it outputs a 0-3v signal with 1.5v output corresponding to a 0v input.



  11. #11
    Super Moderator
    Points: 44,219, Level: 51
    Achievements:
    Created Album picturesCreated Blog entry7 years registered
    alexan_e's Avatar
    Join Date
    Mar 2008
    Location
    Greece
    Posts
    11,205
    Helped
    2035 / 2035
    Points
    44,219
    Level
    51
    Blog Entries
    6

    Re: Low Side Current Sense amplifier

    the schematic I describe is
    Hbridge_mosfet_flyback2.gif
    assuming that we have a differential amplifier where I have the opamp connected you say that we will get negative output?
    There will be times when we will have a negative voltage with reference to the gnd in the upper side of the resistor?
    Please don't make requests for help in private using PM. Create a thread in the forum so that other members can benefit from the posted answers.

    Consider reading this before posting : How To Ask Questions The Smart Way



  12. #12
    FvM
    FvM is online now
    Super Moderator
    Points: 170,895, Level: 98
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    27,164
    Helped
    8417 / 8417
    Points
    170,895
    Level
    98

    Re: Low Side Current Sense amplifier

    You are right, the amplifier question can be in fact answered without referring to the application. You should know however, which signal bandwidth has to be processed by the amplifier, or in contrast, if some kind of averaging filter is intended for the amplifier.

    I understand, that single supply operation is preferred. If we have an ADC range near to the supply voltage, a rail-to-rail OP would be required in addition. For the zero shift to mid range, you'll need a reference voltage, e.g. the ADC reference.

    The amplifier can be desgned as a basic single OP differential amplifier, for +/- 0.1 to +/- 1.5V, we need a gain of 15, respectively a resistor ratio of 1:15. To implement the 1.5 V zero shift with a 3V reference, the reference resistor to +ve OP input can be replaced by two 2*R2 resistors, connected to 0 and 3V.

    P.S.:
    There will be times when we will have a negative voltage with reference to the gnd in the upper side of the resistor?
    Yes. Obviously as a average value, when the motor is breaking/generating and sourcing power to the DC bus. And as an instantaneous value, depending on the PWM operation.
    Last edited by FvM; 9th September 2011 at 22:37.



  13. #13
    Advanced Member level 4
    Points: 11,688, Level: 25
    ALERTLINKS's Avatar
    Join Date
    Dec 2003
    Location
    Pakistan
    Posts
    1,163
    Helped
    349 / 349
    Points
    11,688
    Level
    25

    Re: Low Side Current Sense amplifier


    Something like that?


    1 members found this post helpful.

  14. #14
    Member level 2
    Points: 773, Level: 6

    Join Date
    May 2010
    Posts
    46
    Helped
    3 / 3
    Points
    773
    Level
    6

    Re: Low Side Current Sense amplifier

    Quote Originally Posted by ALERTLINKS View Post

    Something like that?
    is the ADC referenced (ground reference) to j1.1 or j1.2?



  15. #15
    FvM
    FvM is online now
    Super Moderator
    Points: 170,895, Level: 98
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    27,164
    Helped
    8417 / 8417
    Points
    170,895
    Level
    98

    Re: Low Side Current Sense amplifier

    If you read my description strictly, it refers to this circuit:



    1 members found this post helpful.

  16. #16
    Super Moderator
    Points: 44,219, Level: 51
    Achievements:
    Created Album picturesCreated Blog entry7 years registered
    alexan_e's Avatar
    Join Date
    Mar 2008
    Location
    Greece
    Posts
    11,205
    Helped
    2035 / 2035
    Points
    44,219
    Level
    51
    Blog Entries
    6

    Re: Low Side Current Sense amplifier

    Quote Originally Posted by FvM View Post
    P.S.:
    Yes. Obviously as a average value, when the motor is breaking/generating and sourcing power to the DC bus. And as an instantaneous value, depending on the PWM operation.
    Then I have to apologize for misguiding the OP.
    What I like about this forum is that I never stop learning.

    Alex
    Please don't make requests for help in private using PM. Create a thread in the forum so that other members can benefit from the posted answers.

    Consider reading this before posting : How To Ask Questions The Smart Way



  17. #17
    Member level 2
    Points: 773, Level: 6

    Join Date
    May 2010
    Posts
    46
    Helped
    3 / 3
    Points
    773
    Level
    6

    Re: Low Side Current Sense amplifier

    Quote Originally Posted by FvM View Post
    If you read my description strictly, it refers to this circuit:

    Sorry, I missed that post! It makes more sense to me now. When I get off work I'll go simulate/build that circuit and see if I can further my understanding.

    Thank you very much FvM. If I want to give you points, what kind of points should I give you?



+ Post New Thread
Please login