PDA

View Full Version : Current sensor output modification. PIC or opamp or something else?



retepsnikrep
- 1st December 2020, 18:29
I have a hall effect current sensor with a 0-5V output. Zero current flow is 2.5V out.
It is monitoring a 20khz motor drive signal.

I want to pass thru signals from 0-2.5V unmolested but want to reduce signals over 2.5V by an amount lets call it 20%.

What could we do to do that?

I was thinking OP amps, but I can't think of way to only reduce the signal once it is over 2.5V

I also thought about a PIC with adc in and then a pwm out with low pass filter.
But I don't think it will do 20khz.

Any brilliant ideas? Thanks Peter

Acetronics2
- 1st December 2020, 19:37
Hi, peter

why not use a TL431 or similar " zener effect diode " that will draw some current past 2.5v https://www.ti.com/lit/ds/symlink/tl431.pdf?ts=1606830421080&ref_url=https%253A%252F%252Fwww.ti.com%252Fproduct %252FTL431%253Futm_source%253Dgoogle%2526utm_mediu m%253Dcpc%2526utm_campaign%253Dapp-null-null-gpn_en-cpc-pf-google-eu%2526utm_content%253Dtl431%2526ds_k%253DTL431%25 26dcm%253Dyes%2526gclid%253DEAIaIQobChMI5Y_f4JGs7Q IVzeh3Ch2HHgdbEAAYAyAAEgKWu_D_BwE%2526gclsrc%253Da w.ds

the idea is a resistor paralled by the "zener" and a second resistor in series ... as the lower part of a voltage divider.

Now that's the raw answer to the question ...

IF your signal doesn't exceed the input range of the converter, it will be much much much simpler to apply a simple " IF conversion_result is > 2.5 THEN result = (result-2.5)/2 + 2.5 ...

the "2" divider being just an example ( might be /3*2 ... for / 1.5 )

Alain

retepsnikrep
- 2nd December 2020, 05:01
Thanks for that.

Alain. When you say 'If conversion' do you mean using a PIC?
I didn't think that would be quick enough

Or some sort of analog circuit like the TL431

Acetronics2
- 3rd December 2020, 08:55
Thanks for that.

Alain. When you say 'If conversion' do you mean using a PIC?
I didn't think that would be quick enough

Or some sort of analog circuit like the TL431

Hi, Peter

I wrote
IF Conversion_RESULT = the number the ADC returns ...

Whatever processor you use ( of course, a PIC is much better :rolleyes: )

Have a nice day
Alain

pedja089
- 3rd December 2020, 19:02
If you use your signal for regulation of something, ADC/DAC solution act like first order hold
https://en.wikipedia.org/wiki/First-order_hold
And it can cause instability in regulation.
So my advice would be OPAMP.

Circuit is not hard to make. You basically need 2 buffers and 1 compactor, few resistor, and that is it.
I can draw basic schematic, if you want...

retepsnikrep
- 4th December 2020, 18:55
An example schematic of your idea would be kind Pedja.

Thanks for responding.

I basically have this so far.

A potential divider activated by the MOSFET turning on and an non inverting unity gain opamp buffer.

When the mosfet is on output is reduced by the PD ratio R2 and R3.

R1 & R2 are out of my control in the equipment I am trying to modify.

8967

pedja089
- 4th December 2020, 20:39
You got most of circuit. I added one more buffer, so input to rest of circuit is low impedance. If you know your sensor output, you can omit first buffer.
Second OPAMP create comparator with hysteresis.
If input voltage excide trip point, output will be hi, so mosfet is turned on, and output voltage is reduced...
8968

Acetronics2
- 5th December 2020, 20:42
Hi, Pedja ...

you just redraw the TL431 !!!

http://www.bristolwatch.com/ccs/img2/TL431p.jpg

just have a look to its " OFF " state current ... : Off-State Cathode Current IK(off) VKA = 40V, VREF = 0 typ 0.26 max 0.9 ľA

;)

Alain

pedja089
- 6th December 2020, 20:01
Sorry for that...

mpgmike
- 10th December 2020, 05:22
Back to the original challenge, I'd do it in software:


IF ADC > 127 THEN ;Assuming 8-bit ADC
ADC_VAL = (ADC * 4) / 5 ;Yields 80% of value
ENDIF

The above snippet will deliver <128 results as soon as ADC > 128. I don't think that's what you want. So we have to add a filter:


IF ADC > 127 THEN ;Assuming 8-bit ADC
B0 = ADC - 127 ;Use a temporary variable to determine how much above 128 our result is
B1 = (B0 * 4) / 5 ;Get 80% of only the amount > 128
ADC_VAL = B1 + 128 ;Yields mid-point + 80% of overage
ENDIF