# opamp problem (current measuring)

Status
Not open for further replies.

#### seyyah To measure a high current(up to 30A, typically 15-20A.) i used a resistor based current measurement. I connected the sensing resistor to the low side and amplified(x10) the voltage on the resistor via an opamp (LM358N). Then i applied some tests and saw that, output voltage of the opamp is not directly proportional to the current. What may be the problem?

#### IanP You have to built circuit around your opamp in fully differential configuration: 2 resistors for non-inverting input (one between power resistor and input, second input to GND) and 2 resistors for inverting input (1 between power resistor -other side, ond one feedback from output).
If you have this done as above the output voltage has to be proportional to the power resistor's current...

#### picotube

##### Member level 5 Is it a constant error?
Do you think elevated temperature of the resistor could be the error source?

#### seyyah The configuration and the output is something like this:

#### picotube

##### Member level 5 1) How many data points did you use to plot the current vs output voltage?

2) How did you obtain the value of current? Using current meter? Or, based on the calculation of V (across Rsense) / Rsense?

3) What is the value of R1 and Rsense?

4) What is the 'current (PWM)' in the schematic diagram? I think a variable voltage source should be connected to Rsense so that various current values can be obtained to produce various voltage values from opamp's output terminal.

#### echo47 Current PWM? Are you trying to measure current pulses? Maybe your opamp circuit doesn't have enough bandwidth. An oscilloscope will help you troubleshoot such problems.

Uh, this may seem like a dumb question, but have you connected pins 4 and 8 somewhere?

#### btbass The LM358 is not so linear close to ground, try biasing the non-inverting input to about 3 volts using a resistor divider between it's supplies.

#### seyyah picotube said:
1) How many data points did you use to plot the current vs output voltage?

2) How did you obtain the value of current? Using current meter? Or, based on the calculation of V (across Rsense) / Rsense?

3) What is the value of R1 and Rsense?

4) What is the 'current (PWM)' in the schematic diagram? I think a variable voltage source should be connected to Rsense so that various current values can be obtained to produce various voltage values from opamp's output terminal.
1) 5-6

2) I used a current meter to measure it. Also output voltage is measured by a voltmeter.

3) R1 is 1k. Rsense is some miliohm, i couldn't measure, it is only a piece of conductor so i don't know the exact value.

4) A 20khz pwm voltage is applied to a dc motor. The current is the motor's current. It's small ripple on it.

I made the measurements on a locked rotor motor by applying different duty cycles.

#### seyyah echo47 said:
Current PWM? Are you trying to measure current pulses? Maybe your opamp circuit doesn't have enough bandwidth. An oscilloscope will help you troubleshoot such problems.

Uh, this may seem like a dumb question, but have you connected pins 4 and 8 somewhere?

Not pulses current has very small ripple. Sure i've connected the pins 4 and 8.

#### seyyah btbass said:
The LM358 is not so linear close to ground, try biasing the non-inverting input to about 3 volts using a resistor divider between it's supplies.
You may be right i'm vorking around 1V or less.

#### echo47 What voltage power supplies are you using?
What load are you driving with the opamp?
What are the values of the components in your schematic?
What are the magnitudes of the voltage and current values on that curve?
Have you confirmed that pins opamp 2 and 3 are at nearly the same voltage, and that they are within the common mode voltage range of the opamp?

#### picotube

##### Member level 5 seyyah said:
1) 5-6

4) A 20khz pwm voltage is applied to a dc motor. The current is the motor's current. It's small ripple on it.
1) '5 - 6' might not be enough to tell the true relationship between the measured current and the output voltage at op-amp.

4) May be, in testing/calibration stage, it's better to use 'known' variable voltages to check whether the circuit works correctly before testing with 'real' motor current.

By the way, have you found out the reason? Pls update us. Thanks.

#### btbass I am working with the same problems, brushless motor control. You can find some good app notes on Microchip and IR websites with some circuit diagrams for low side current sensing. One trick is to bias the non-inverting input to about 3 volts using resistor divider circuit, but it is a very noisey enviroment. We have now moved from a single op-amp to a quad op-amp comprising a gain stage, a low pass filter and a comparator for the final output to the micro!

#### seyyah I think i must go step by step. A better low past filter, choosing the linear region for opamp or replacing the opamp with a different one, or using diffrerential configuration. I must try all of this i think. My current design limits me to change certain things so I'll try to optimize it for now. Actually i disabled some features due this and similar problems. Before i proceed to the second version, i'll first design these parts.

#### echo47 