negative rail for low side current sense?

fredag den 18. marts 2022 kl. 05.08.35 UTC+1 skrev DJ Delorie:

if you skip the short circuit sense resistor, does it have to be differential?

three opamps with ~60x gain and a pull up to center the output at 2.5V with zero current diode or the output and use an opamp as comperator for the short circuit detect

Reply to
Lasse Langwadt Christensen
Loading thread data ...

I thought of just outputting a square wave from the MCU into a charge pump inverter, but 4.6v minus two diode drops is only a few volts, and not a lot of milliamps (you're limited by the pin's max output). It might be enough, but if a solid 1A buck/boost negative rail is cheap and easy enough...

Reply to
DJ Delorie

That sounds like multiple op amps per leg... either both signals need an opamp to offset them, plus a third to difference them, or if you try to reduce the opamps, you can't offset them enough *and* amplify them at the same time (which is what I'm seeing now).

Reply to
DJ Delorie

formatting link

Reply to
Lasse Langwadt Christensen

The IKCM15L60GAXKMA1 power module has a design without the separate short sense (just three resistors) but it uses diodes to "or" the signals into the sense pin. The side effect of that is you need larger sense resistors (36mR instead of 5mR, and 3W instead of 0.5W) which creates a larger voltage swing, which means the negative swings are much larger. This kind of design assumes the motor will always be "running" which is not true in my case (a hard stop caused the fault in the last design)

You kinda want differential anyway to avoid ground drops, with that much current.

Yup, but that doesn't stop the sensed value from going negative...

Reply to
DJ Delorie

lørdag den 19. marts 2022 kl. 02.13.16 UTC+1 skrev DJ Delorie:

Version 4 SHEET 1 1500 1028 WIRE -208 -48 -320 -48 WIRE 16 -48 -16 -48 WIRE 208 -48 16 -48 WIRE 304 -48 208 -48 WIRE 1088 -48 304 -48 WIRE 1312 -48 1088 -48 WIRE -320 -16 -320 -48 WIRE -208 32 -208 -48 WIRE -16 32 -16 -48 WIRE 160 96 128 96 WIRE 224 96 160 96 WIRE 528 96 304 96 WIRE 768 96 528 96 WIRE 208 144 208 -48 WIRE 160 160 160 96 WIRE 176 160 160 160 WIRE 304 176 304 96 WIRE 304 176 240 176 WIRE -208 192 -208 112 WIRE -112 192 -208 192 WIRE -16 192 -16 112 WIRE -16 192 -32 192 WIRE 176 192 -16 192 WIRE 208 240 208 208 WIRE 1088 240 1088 -48 WIRE -208 320 -320 320 WIRE 16 320 16 -48 WIRE 16 320 -16 320 WIRE 208 320 16 320 WIRE -320 352 -320 320 WIRE 1088 352 1088 320 WIRE 1232 352 1088 352 WIRE -208 400 -208 320 WIRE -16 400 -16 320 WIRE 160 464 128 464 WIRE 224 464 160 464 WIRE 208 512 208 320 WIRE 160 528 160 464 WIRE 176 528 160 528 WIRE 304 544 304 464 WIRE 304 544 240 544 WIRE 512 544 304 544 WIRE 768 544 512 544 WIRE 832 544 832 96 WIRE 1088 544 832 544 WIRE -208 560 -208 480 WIRE -112 560 -208 560 WIRE -16 560 -16 480 WIRE -16 560 -32 560 WIRE 176 560 -16 560 WIRE 1312 592 1312 -48 WIRE 208 608 208 576 WIRE 1232 608 1232 352 WIRE 1280 608 1232 608 WIRE 1424 624 1344 624 WIRE 1088 640 1088 624 WIRE 1280 640 1088 640 WIRE -208 688 -320 688 WIRE 16 688 16 320 WIRE 16 688 -16 688 WIRE 208 688 16 688 WIRE -320 720 -320 688 WIRE -208 768 -208 688 WIRE -16 768 -16 688 WIRE 160 832 128 832 WIRE 224 832 160 832 WIRE 208 880 208 688 WIRE 160 896 160 832 WIRE 176 896 160 896 WIRE 304 912 304 832 WIRE 304 912 240 912 WIRE 512 912 304 912 WIRE 768 912 512 912 WIRE 832 912 832 544 WIRE -208 928 -208 848 WIRE -112 928 -208 928 WIRE -16 928 -16 848 WIRE -16 928 -32 928 WIRE 176 928 -16 928 WIRE 208 976 208 944 FLAG 304 32 0 FLAG 208 240 0 FLAG -320 64 0 FLAG 48 96 0 FLAG -208 272 0 FLAG 208 608 0 FLAG -320 432 0 FLAG 48 464 0 FLAG -208 640 0 FLAG 208 976 0 FLAG -320 800 0 FLAG 48 832 0 FLAG -208 1008 0 FLAG 1088 432 0 FLAG 1312 656 0 FLAG 1088 720 0 FLAG 528 96 I_U FLAG 512 544 I_V FLAG 512 912 I_W FLAG 1424 624 I_SC SYMBOL OpAmps\\AD824 208 112 R0 SYMATTR InstName U1 SYMBOL voltage 304 -64 R0 WINDOW 123 0 0 Left 0 WINDOW 39 0 0 Left 0 SYMATTR InstName V1 SYMATTR Value 5 SYMBOL voltage -320 -32 R0 WINDOW 3 -334 50 Left 2 WINDOW 123 0 0 Left 0 WINDOW 39 0 0 Left 0 SYMATTR Value SINE(0 {Ipeak} 100 10m) SYMATTR InstName V2 SYMBOL res 320 80 R90 WINDOW 0 0 56 VBottom 2 WINDOW 3 32 56 VTop 2 SYMATTR InstName R1 SYMATTR Value 45k SYMBOL res 144 80 R90 WINDOW 0 0 56 VBottom 2 WINDOW 3 32 56 VTop 2 SYMATTR InstName R2 SYMATTR Value 1k SYMBOL res -16 176 R90 WINDOW 0 0 56 VBottom 2 WINDOW 3 32 56 VTop 2 SYMATTR InstName R3 SYMATTR Value 1k SYMBOL res 0 128 R180 WINDOW 0 36 76 Left 2 WINDOW 3 36 40 Left 2 SYMATTR InstName R4 SYMATTR Value 91k SYMBOL res -224 176 R0 SYMATTR InstName R5 SYMATTR Value 0.005 SYMBOL res -224 16 R0 SYMATTR InstName R6 SYMATTR Value 1 SYMBOL OpAmps\\AD824 208 480 R0 SYMATTR InstName U2 SYMBOL voltage -320 336 R0 WINDOW 3 -334 50 Left 2 WINDOW 123 0 0 Left 0 WINDOW 39 0 0 Left 0 SYMATTR Value SINE(0 {Ipeak} 100 10m 0 120) SYMATTR InstName V4 SYMBOL res 320 448 R90 WINDOW 0 0 56 VBottom 2 WINDOW 3 32 56 VTop 2 SYMATTR InstName R7 SYMATTR Value 45k SYMBOL res 144 448 R90 WINDOW 0 0 56 VBottom 2 WINDOW 3 32 56 VTop 2 SYMATTR InstName R8 SYMATTR Value 1k SYMBOL res -16 544 R90 WINDOW 0 0 56 VBottom 2 WINDOW 3 32 56 VTop 2 SYMATTR InstName R9 SYMATTR Value 1k SYMBOL res 0 496 R180 WINDOW 0 36 76 Left 2 WINDOW 3 36 40 Left 2 SYMATTR InstName R10 SYMATTR Value 91k SYMBOL res -224 544 R0 SYMATTR InstName R11 SYMATTR Value 0.005 SYMBOL res -224 384 R0 SYMATTR InstName R12 SYMATTR Value 1 SYMBOL OpAmps\\AD824 208 848 R0 SYMATTR InstName U3 SYMBOL voltage -320 704 R0 WINDOW 3 -334 50 Left 2 WINDOW 123 0 0 Left 0 WINDOW 39 0 0 Left 0 SYMATTR Value SINE(0 {Ipeak} 100 10m 0 240) SYMATTR InstName V6 SYMBOL res 320 816 R90 WINDOW 0 0 56 VBottom 2 WINDOW 3 32 56 VTop 2 SYMATTR InstName R13 SYMATTR Value 45k SYMBOL res 144 816 R90 WINDOW 0 0 56 VBottom 2 WINDOW 3 32 56 VTop 2 SYMATTR InstName R14 SYMATTR Value 1k SYMBOL res -16 912 R90 WINDOW 0 0 56 VBottom 2 WINDOW 3 32 56 VTop 2 SYMATTR InstName R15 SYMATTR Value 1k SYMBOL res 0 864 R180 WINDOW 0 36 76 Left 2 WINDOW 3 36 40 Left 2 SYMATTR InstName R16 SYMATTR Value 91k SYMBOL res -224 912 R0 SYMATTR InstName R17 SYMATTR Value 0.005 SYMBOL res -224 752 R0 SYMATTR InstName R18 SYMATTR Value 1 SYMBOL schottky 768 112 R270 WINDOW 0 32 32 VTop 2 WINDOW 3 0 32 VBottom 2 SYMATTR InstName D1 SYMATTR Value BAT54 SYMATTR Description Diode SYMATTR Type diode SYMBOL schottky 768 560 R270 WINDOW 0 32 32 VTop 2 WINDOW 3 0 32 VBottom 2 SYMATTR InstName D2 SYMATTR Value BAT54 SYMATTR Description Diode SYMATTR Type diode SYMBOL schottky 768 928 R270 WINDOW 0 32 32 VTop 2 WINDOW 3 0 32 VBottom 2 SYMATTR InstName D3 SYMATTR Value BAT54 SYMATTR Description Diode SYMATTR Type diode SYMBOL res 1072 528 R0 SYMATTR InstName R20 SYMATTR Value 1k SYMBOL OpAmps\\AD824 1312 560 R0 SYMATTR InstName U4 SYMBOL res 1072 336 R0 SYMATTR InstName R21 SYMATTR Value 2.4k SYMBOL res 1072 224 R0 SYMATTR InstName R22 SYMATTR Value 3k SYMBOL res 1072 624 R0 SYMATTR InstName R19 SYMATTR Value 1k TEXT -552 -200 Left 2 !.tran .1 TEXT -672 224 Left 2 !.param Ipeak=10

Reply to
Lasse Langwadt Christensen

Interesting! Hadn't thought of that... Thanks!

Reply to
DJ Delorie

Yeah, the choice of a gain-of-one current sense amp isn't great. There's gain-of-20 and gain-of-60 available, ST.com shows TSC2010, TSC2011, and for gain-of-100 TSC2012. They don't claim accuracy for big sense voltages, though.

Reply to
whit3rd

Things I've used for similar setup depending on accuracy need. BLDC driver does not sound like metrology application ;-)

- Large negative rail

- LM7705 to generate -0.23V rail

- Resistor divider (one or two sided) from sense resistor to 3.3V (say, 40 ohms and 3.3V cause the -40mV to show up at 0mV, increase 40ohms to 'lift' the signal).

- Instrumentation amplifier

- Hall current sensor

- Opamp with negative input CM (TL27L4 and successors, TS921...)

-- mikko

Reply to
Mikko OH2HVJ

Something like this should work.

formatting link
The opamp inputs run above ground.

The caps are optional. Some tricks can be played to make this 4-wire differential, or 3-wire sorta diff which preserves the shared divider.

Autozeroing is still a good idea.

Reply to
jlarkin

One other thought: set the processor adc input to have a slightly positive offset and then counter that offset in the "ad conversion complete" interupt handler.

Hul

DJ Delorie snipped-for-privacy@delorie.com wrote:

Reply to
Hul Tytus

-2V5 seems like a rather large source signal.

Is the sensed current that produces the 'below ground' situation normal or overload? Is a linear response required under those conditions?

If not, why not just ad sensor protection/conditioning?

RL

Reply to
legg

The lm324's inputs

34x (2k input, 68k feedback)

Interesting idea, but I'd lose some precision in the adc. I saw some solutions that biased the sense the *other* way too - more adc range on the useful side.

Reply to
DJ Delorie

The source signal is around 40mV in the old design, closer to 0.5v in the new design (which I'm not happy about)

The opamp changes that to a 0-5V swing centered around 2.5v

It's a servo. When it's speeding up, it's a motor, and everything's positive. When it's slowing down, it's a generator, and the currents are negative.

Reply to
DJ Delorie

Classic LM324s can go insane on all four amps if one input pin is pulled a bit below ground.

Reply to
John Larkin

When you're trying to hold a 0.09 degree step, it might as well be.

One poster had a clever idea for generating this with a charge pump off the main switcher.

That's a new one on me!

I'm not sure I want all the motor power potentially travelling through the MCU's vcc bus.

One poster hinted at these, and I've been looking at the TMCS1101 which would let me move the current sense to the three BLDC wires instead of the negative rail, so I could sense the positively-driven phases as well. It causes some layout issues, but I think it will be the most useful.

Reply to
DJ Delorie

easy to try,

formatting link

Reply to
Lasse Langwadt Christensen

I couldn't find any offsets in your schematic and didn't see the gain.

There are a number of op amps that don't have issues with inputs going tens of millivolts below ground. Are you sure its an issue?

Same question - are you actually trying to control the current during the overload, or is it simply an overloaded monitor?

RL

Reply to
legg

A typo from me - I meant 40 (or 400) ohms to shunt non-GND-end and 3k3 (or 33k) to 3.3V so you're running roughly constant 1mA through. This causes a small gain/offset error, but that's easy to compensate.

Reply to
Mikko OH2HVJ

I understood. I don't want the high voltage side connected to the 5v (not 3v3) bus at all, even through a 33k resistor, for both safety and noise reasons.

Reply to
DJ Delorie

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.