Current regulation problem

Thread Starter

oussema

Joined Jan 24, 2020
8
Hello there,
i'm currently testing a design for peak and hold control for a solenoid. The circuit is this :Capture.PNG
when i probe the shunt resistor (the pink graph) i get this result :
IMG_20200123_093207.jpg
the yellow is the comparator output and blue is the microcontroller signal. the high voltage is from boost converter. The problem is that i don't get perfectly regulated signal like this
Capture1.PNG
the current drops to zero when the comparator turns off, which it shouldn't happen. Any advice?
Thanks in advance.
(Sorry for any inconvenience, this is my first post )
 

danadak

Joined Mar 10, 2018
4,057
If you are trying to actually regulate current this looks like a hysteretic approach
versus a linear approach where no switching takes place. Eg. no comparators,
just linear control loop.

What am I missing .....?


Regards, Dana.
 

ebeowulf17

Joined Aug 12, 2014
3,307
current drops to zero when the comparator turns off, which it shouldn't happen.
I'll admit that this configuration is new to me - sorry if my questions confuse things.

You say the current shouldn't drop to zero, but I don't understand why it wouldn't. It looks to me like current through the current shunt resistor has no choice but to drop to zero when the comparator turns off. Current through the solenoid will continue to flow through the flyback diode, but nothing would flow through sense resistor, right?

Should you be monitoring current before the MOSFET instead of after it in order to see the desired effect?
 

ebeowulf17

Joined Aug 12, 2014
3,307
If you are trying to actually regulate current this looks like a hysteretic approach
versus a linear approach where no switching takes place. Eg. no comparators,
just linear control loop.

What am I missing .....?


Regards, Dana.
I wondered that too - maybe the inductance of the coil maintains some current during off cycles, sustained through the flyback diode, and it's the average current, not the instantaneous values, that's being controlled?
 

MrAl

Joined Jun 17, 2014
11,389
thank you for your reply,
i tried but with no luck. Any other suggestions?
Hi,

Yes. Amplifier OA1 should be an integrator really.
Try placing a 10k resistor in series with the inverting input of OA1, then a 0.01uf cap from the output of OA1 to the inverting input of OA1. That makes it an integrator.

Oh, remove R9 (not shown in my new drawing).
Why there is a resistor R9 anyway i have no idea unless the original design was different. R9 causes the output to bounce up and down.
 

Attachments

Last edited:

Alec_t

Joined Sep 17, 2013
14,280
Simulation says it should work :-
SolenoidPeak&Hold.png

The time constant R7C1 in the sim needs to be kept small (or eleiminated). I suggest you reduce your C2 dramatically. Also OA2 needs to be fast-acting, so a TLC277 may prove too slow.
Your R2 and R7 seem redundant.
 
Last edited:

ebeowulf17

Joined Aug 12, 2014
3,307
Simulation says it should work :-
View attachment 197538

The time constant R7C1 in the sim needs to be kept small (or eleiminated). I suggest you reduce your C2 dramatically. Also OA2 needs to be fast-acting, so a TLC277 may prove too slow.
Your R2 and R7 seem redundant.
As I suspected, the circuit can potentially regulate current through the inductor.

What do you get in your simulation if you probe the top of the sense resistor, your R8? I assume it must be jumping around quite rapidly, just like the gate voltage you've shown.

I think part of the thread starter's problem is simply scoping the wrong thing to visualize current. I suspect the other problem, like you said, is the size of C2.
 

MisterBill2

Joined Jan 23, 2018
18,167
One problem not mentioned is that OA 1 is connected as a comparator with positive feedback to add a bit of hysteresis. So the oscillation is exactly what I would expect. It will only have two stable states, full on and full off.
 

ebeowulf17

Joined Aug 12, 2014
3,307
One problem not mentioned is that OA 1 is connected as a comparator with positive feedback to add a bit of hysteresis. So the oscillation is exactly what I would expect. It will only have two stable states, full on and full off.
That actually was mentioned a few times. However, @Alec_t demonstrated through simulation that, although the control circuit is switching on/off very rapidly like you said, current through the inductor can actually be maintained at a fairly stable level.

I'm no expert, but I think I understand the concept here - inductors "resist" sudden changes in current and keep current flowing through the flyback diode during the off cycles, so the inductor current isn't switched off immediately, even when the MOSFET is switched off. Maybe I'm still not understanding it correctly, but it seems like that makes sense to me.

Either way, you can see in the simulation results that it's possible to have a hysteretic comparator switching the MOSFET, and still have relatively stable current through the inductor.
 

ebeowulf17

Joined Aug 12, 2014
3,307
That's awesome! Thanks for sharing. When I first saw the original post and its circuit diagram, it baffled me. Now I think I understand the concept, and it definitely helps seeing that extra node graphed.

If you get a chance, would you mind sharing the .asc file? I'd be interested in tinkering with it a bit and zooming in really close on a few things to better understand it.

Cheers!
 

ci139

Joined Jul 11, 2016
1,898
peak and hold control for a solenoid
define what you want to achieve
____________

! possible ! modifications to get faster and more stable and more precise feedback loop
/!\ below the "pull up to supply median" actually requires a CC or CV and perhaps "active" biasing network /!\
it might be enough to pull it above the Vee about 0.7V ... 1.7V (depends on Op Amp)
AAC-1a.png
 
Last edited:

Thread Starter

oussema

Joined Jan 24, 2020
8
As I suspected, the circuit can potentially regulate current through the inductor.

What do you get in your simulation if you probe the top of the sense resistor, your R8? I assume it must be jumping around quite rapidly, just like the gate voltage you've shown.

I think part of the thread starter's problem is simply scoping the wrong thing to visualize current. I suspect the other problem, like you said, is the size of C2.
i'm scoping the between the source of the FET and the sense resistor.
 
Top