picaxe controlled variable power supply

wapo54001

Senior Member
BCJkiwi,

If your circuit is fully functional, I would like to try to duplicate your results.

If your version differs in any way from the original circuit posted (including any changed resistor values), could you describe or attach your circuit?

Did you attach the sense resistors to adjust or output of the 317?

Did you use a pullup of any kind for the 2N7000?
 

Mycroft2152

Senior Member
BCJkiwi,

If your circuit is fully functional, I would like to try to duplicate your results.

If your version differs in any way from the original circuit posted (including any changed resistor values), could you describe or attach your circuit?

Did you attach the sense resistors to adjust or output of the 317?

Did you use a pullup of any kind for the 2N7000?
In poker this is 'calling your bluff"
 

BCJKiwi

Senior Member
@ Wapo,
The circuit diagram and code shown in post #95 are the last with the exception that I did not actually bother to fit the 5.1 zener. The ADC4 formula as shown limits the max Vout and provides full range of the POT for adjustment.

Please take note that the circuit shown delivers 1.25V to 10V with a 13V DC supply to Vin, a 5V supply to the PICAXE. If there is insufficient supply voltage (3V above highest Vout) then regulation fails under load and the top voltage is not achieved - you can get close to top voltage with lower Vin (say 11.5V at no or very low load). The 1.25V minimum and requirement for Vin = Vout+3V is a function of the LM317T.

Components that are not critical (in my view but this view is untested) are,
1. ADC4 Adjustment pot. This is just a divider to deliver input so I would not expect any issues with different value Pots. Tests used 10K linear as that was to hand.
2. C - tried 0.5 to 0.33 with no observable change
3. MOSFET - provided it is a logic level device. response rate will vary depending on the speed of the device (i.e. the characteristics of the slope of the resistance change with gate voltage). However I would doubt that this would stop the system working. As discussed before, the MOSFET is simply functioning as a variable resistor to change the small (up to 50mA) current on the Adj pin.

On reflection, would be cautious about reducing the 1M on leg5 to Gate however as if this is too low then change in gate voltage will be more rapid (also interacts with C of course) but 1M seems to be the standard gate bleed resistor value in most circuits. Suggest fine tuning on the C if desired.

Wapo,
would suggest you try this with all the components you have to hand - i.e. the pot you have, the 2N7000, the 0.33uF and see how you go. If you want to test it with 5V then you can do away with the divider on ADC1 and change the ADC4 formula but you would need 8V Vin on the LM317T not 5V if you expect to get 5V Vout under load.
Would be most interested to see the response rate with the 2N7000.
 
Last edited:

wapo54001

Senior Member
I'VE GOT IT!!!!!

All that's left is to perfect some resistor values, which appear to be critical.

The circuit works exactly as predicted, perfect control and good regulation from about 1.6 volts up to about 22 volts on a 24 volt supply. Poor low end attributable to pot that doesn't go to full ground plus mosfet that is, at best, 1.8ohms, and then the error is multiplied by the ratio of the resistor chain. It locks up above 22 volts, but that can be figured out and corrected in software or hardware, not sure which yet. Edit: I have some HUF76407D3 with rDS of 0.107 ohms -- will give them a try tomorrow.

317 is not on a heatsink so didn't try a lot of current, but enough to make a 300 ohm 1/4 watt resistor really, really hot while the 317 got just a little warm. Also no input/output capacitors on the 317 so maybe some instability in my test circuit.

There is no need to put the feedback resistor chain on the output -- it can connect to the adjust pin along with the 2N7000.

The secret (drum roll, please) is in the values of the various resistors. I finally used 1 meg and 3.3 meg for the feedback chain, and that seemed to work and worked better with a jumper rather than resistor from the junction of the resistors to the 08M input so, obviously, the resistor values in the chain might/must be adjusted down, but carefully. If the values are too low, the circuit doesn't work for me.

Also, appears that the pullup resistor I mentioned is not required. (EDIT: Wait, I think I take this back. I think I did use a pullup from adjust to input pins, 10K. I'll verify when I go back to my workshop tomorrow.

I put a 220 ohm between output and adjust (didn't have a 240).

So, that's it, a done deal. Haxby, are you reading this?? :)
 
Last edited:

BCJKiwi

Senior Member
Well Wapo, don't know what you are doing.
Back a few posts you said:- "If your circuit is fully functional, I would like to try to duplicate your results."

The regulator should give from 1.2 to 21V on a 24V supply but note the comments in previous posts about current capacity and efficientcy drop off when out of the optimum range, in this case above Vin-Vout > 15V ~ check the data sheet on the LM317T.
A 3:1 divider on Vout would give you 20V out and 5V max on ADC1. Formula for ADC would become;
w1 = w1 * 50 / 16 * 15 / 50 + 63

Obviously the circuit you are trying is not the one I used so please post the circuit and code so we can follow along.
Don't quite understand why you would need critical resistor values and be having issues with range but then the circuit is different.

Just a question - if sensing the Adj pin creates critical component issues with resistors and MOSFET, and code issues, why not sense on the Vout which seems not to have any of these critical factors?
 
Last edited:

BCJKiwi

Senior Member
@Wapo,
Just re-read your post.
I would suggest that the need for high (1m / 3.3M) values in the divider chain is because (as suggested earlier in post #63) when sensing the Adj, the divider chain is in parallel with the Mosfet and if too low will rob critical adjust current from the MOSFET and upset the MOSFETs ability to control the Adj current. Don't think the values are critical, they just need to be in the right ratio and be high enough to be negligible relative the working range of R in the MOSFET.
 
Last edited:

wapo54001

Senior Member
BCJ,

Well, I'm not sure what I'm doing, either, so we agree on that! :)

I think the circuit I'm using is the same one you are using, except I connect the divider chain to the adjust pin of the 317 and I don't use the 5.1V zener. Originally, I tried to use small value resistors in the divider but my circuit would not work. I went to the extreme and used a 1 meg and 3.3 meg, and the circuit started to work fine, but must now start scaling back and find an optimal resistance range that works best.

My divider is not quite 3:1 -- it is 3.3:1 at this point, maybe explains higher top voltage? It was late and I had to leave so didn't nail down the highest voltage that was still under control (not locked up), but it was around 22 volts, I think.

Looking at your formula, I'm not understanding why you are multiplying and dividing twice, could you elucidate?

I prefer this divider-connected-to-adjust-pin configuration because I already have a circuit card designed and built that requires virtually no modification to run this circuit in this configuration. With this card, all I need off-card is the 317 and associated caps and 240R (and possibly a 10K from input to adjust, I can't remember at this point). In addition, this card has additional circuitry built in that can support features such as jumper configuration of software (to select multiple output ranges maybe?) plus a small power mosfet (60V 11A) that could control an output relay or warning light, and the card connects all circuitry to the outside world through a 9-pin Sub-D connector, so it's very convenient. If it weren't for this, I'd be happy to connect the divider to the output, but for now I sincerely hope I don't have to.
 

BCJKiwi

Senior Member
Can I assume from these comments that the circuit layout you are testing is the same as that in post #27?

If you have boards made up and can make it work then all is well and good. Just seems that sensing Adj instead of Vout has the potential to introduce additional requirements/considerations/interactions of components in the feedback circuit which are not necessary and, in principle, undesirable.
 
Last edited:

Dippy

Moderator
(Politely and with the greatest respect for the benefits of discussion):- Instead of pondering and theorising, why not make one of each and try it?

It's not as though the circuit is complicated is it.

PS. I can't see the point of taking feedback from 'Adj' but I haven't tried it.
PPS. I also can't see why your capacitor goes from Drain to Gate. Why not from Gate to Gnd? Again I haven't tried it.
 
Last edited:

BCJKiwi

Senior Member
@ Dippy,
Is it theory? Wapo has shown the need to significantly raise the values of R in the divider for Adj sensing to obtain stability/control (started with <3K and now has >4M)
This is not required for Vout sensing.
There is a parallel R circuit introduced which has to be dealt with, again not required with Vout sensing.

Good point about the Cap. Charge should be more stable/predictable relative to 0V rather than relative to the divider V which tracks Vout ~ unless of course that is supposed to be some magic associated with the feed back in the original circuit.

Guess I'll have to reconstruct the circuit to test! Of course you could have tested it yourself and given us the answer!!;)
 
Last edited:

Dippy

Moderator
I haven't the time. I'm trying to get my maser working.

AIUIC: Surely any resistor // MOSFET Rds is going to improve stability and affect overall Rds intrinsically and thus your gate driving. The effect is obvious, the degree needs testing.
 
Last edited:

wapo54001

Senior Member
Can I assume from these comments that the circuit layout you are testing is the same as that in post #27?

If you have boards made up and can make it work then all is well and good. Just seems that sensing Adj instead of Vout has the potential to introduce additional requirements/considerations/interactions of components in the feedback circuit which are not necessary and, in principle, undesirable.
Yes, this is the circuit I'm using.

I will try lower values in the divider chain today, see how low I can go before things start to misbehave . . .
 

Mycroft2152

Senior Member
I'll follow Dippy's lead and be polite here...

I redrew the circuit for post #95, I don't like the ASCII schematics, they re diffcult to follow and don't flow well.

There is a sgnificant difference between the circuit on post # 27 and post #95. I'm not talking about resisprt values. Look carefully where the PICAXE ADC is ultimately connected.

In post #27 the ADC is connected though the divider chain between the Adjust leg and the 240 ohm resistor, in post #95. the ADC is connected between the output leg and the resistor.

It is a subtle shift but the PICAXE ADC is sensing a diferent voltge ansd could be loading the Adj circuit of the the LM317.

Myc
 

wapo54001

Senior Member
I'll follow Dippy's lead and be polite here...

I redrew the circuit for post #95, I don't like the ASCII schematics, they re diffcult to follow and don't flow well.

There is a sgnificant difference between the circuit on post # 27 and post #95. I'm not talking about resisprt values. Look carefully where the PICAXE ADC is ultimately connected.

In post #27 the ADC is connected though the divider chain between the Adjust leg and the 240 ohm resistor, in post #95. the ADC is connected between the output leg and the resistor.

It is a subtle shift but the PICAXE ADC is sensing a diferent voltge ansd could be loading the Adj circuit of the the LM317.

Myc
That's what BCJ and I have been discussing. I want to take my feedback from the adjust pin, and BCJ wants to take it from output. My reasons are in one of my last posts. BCJ is concerned that it could upset things if taken from there. At this point, I don't think anyone has proven themselves totally correct. I'm hoping that today I can do some tests that will settle the matter to my satisfaction.
 

Mycroft2152

Senior Member
That's what BCJ and I have been discussing. I want to take my feedback from the adjust pin, and BCJ wants to take it from output. My reasons are in one of my last posts. BCJ is concerned that it could upset things if taken from there. At this point, I don't think anyone has proven themselves totally correct. I'm hoping that today I can do some tests that will settle the matter to my satisfaction.
That point got lost in the discussion about the size of the resistors.
 

boriz

Senior Member
The source impedance of a voltage input to an AXE ADC should be less that 10k. The source impedance of a 1M+3M divider is 750K. Would that mean your ADC is getting approximately 1/100th of the current required for it to work properly?
 

wapo54001

Senior Member
Could I get some help from someone who is familiar with how the Picaxe deals with math, please? I need to find the difference between two numbers without dealing with negative values.

The code below adjusts levels up or down until the actual output matches the desired output.

With the existing code, the adjustment is a fixed (small) value per iteration. If the desired value and the actual feedback value are close, then you want small nudges which is fine with the current code. On the other hand, if they are far apart, you want bigger nudges, but presently we are stuck with small nudges. Ideally, the size of the nudge would track proportionally the (reducing) distance between the two values as the picaxe adjusts the output.

I would like to add code to this correction routine that will add a pause value that is directly proportional to the size of the required correction.

Thus, if the required correction is a count of 3 out of the 1023 available, there should be no pause. However, if the required correction is 200, the pause might be set to be 1/5th of that, or 40.

So, it would look like this:

1. set up variable for pause value

2. find the difference (up or down doesn't matter) between the commanded output value and the existing output value

3. divide this difference number by some constant (to be determined by experimentation) and store it in the variable

4. run the correction code, with a "pause &variable&" command included between the high/low commands and the input command.

This would make correction response times much faster when a large correction is required, while retaining fine adjustment when only a small change is needed.




This is the current code:



'Adjust Output Voltage

adjust:
readadc10 1,w4 'get voltage data from output
if w3=w4 then main 'return if output is correct
if w3>w4 then increase 'else adjust

decrease:
high 2 'set pin2 high to decrease Output
input 2 'tri-state pin2 and hold Output
goto adjust

increase:
low 2 'set pin2 low to increase Output
input 2 'tri-state pin2 and hold Output
goto adjust




Any solution welcome!
 

hippy

Ex-Staff (retired)
I'd use something like ...

Code:
If a > b Then
  difference = a - b
  pausetime = difference * N / M
  :
Else
  difference = b - a
  pausetime = difference * N / M
  :
End If
 

BCJKiwi

Senior Member
Do we have a ballpark figure for how long it takes to performa ReadADC10?, we have two of these, one in the outer setting loop (ADC4), and one in the innner adjust loop (ADC1)

If the ReadADC is fast enough and the loop is cycling fast (8Mhz, No pause) then the small increments are happening at very short intervals.
If ReadADC is slow, and/or pauses are long, then the cycles are slow.
In principle, many small increments rather than fewer larger increments would provide better resolution and response but it all comes down to the speed of ReadADC.

More things to test!
 

wapo54001

Senior Member
This is what I wound up with:

I tried many combinations of using just the difference, taking the difference and dividing by 2, 3, 4, etc, and also multiplying by values. I wound up using the difference value "as is" and also telling the program to set no pause if the error is less than three.

Darned little difference, but I did see some reduced jitter in output voltage. The jitter is around 10mv or less after adjusting the pause as below.

Code:
'Adjust Output Voltage

adjust:
	readadc10 1,w4 			'get voltage data from output
	if w3=w4 then main 		'return if output is correct

'if adjusting, set pause time based on size of error
	if w3 > w4 Then
 		pausetime = w3 - w4
	else
 		pausetime = w4 - w3
	endIf
	if pausetime < 3 then
		pausetime = 0
	endif
	
	if w3>w4 then increase	'else adjust

decrease:
	high 2						'set pin2 high to decrease Output
	pause pausetime						'pause 3ms
	input 2 						'tri-state pin2 and hold Output
	goto adjust

increase:
	low 2 						'set pin2 low to increase Output
	pause pausetime
	input 2 						'tri-state pin2 and hold Output
	goto adjust
 

BCJKiwi

Senior Member
So it looks like you have it all sorted.
How about posting the final circuit and final code?

Have you tried different MOSFETs? - If so does anything need to be changed?
 

hippy

Ex-Staff (retired)
This might reduce the ripple even further ...

Code:
adjust:
  readadc10 1,w4
  if w3=w4 then main
  Do
    If w3 > w4 then             ' Increase
      pausetime = w3 - w4
      If pausetime < 3 Then
        low 2
        input 2
        goto adjust
      Else
        low 2
        pause pausetime
        input 2
      End If
    Else                        ' Decrease
      pausetime = w4 - w3
      If pausetime < 3 Then
        high 2
        input 2
        goto adjust
      Else
        high 2
        pause pausetime
        input 2
      End If
    End If
  Loop
  Goto main
These are the sorts of problems I've wrestled with in the past in commercial developments and there's no easy solution other than to keep trying things, noting the results and seeing what improves things and what doesn't.

I spent weeks listening to Michael Jackson's Thriller just to get sound-to-light, beat detect and crescendo detect responding as best it could. What you'll probably end up with is a number of algorithms to suit different cases, don't expect it to be a fifteen minute task, but don't be afraid to put it to one side and come back to it later when you suddenly get inspied.
 

wapo54001

Senior Member
BCJ,

I think I've got the circuit nailed down pretty well. I'd use about 8K for the first feedback resistor and 15K for the second. That seems to work fine for 15~16 volts, and that combination lives quite harmoniously in parallel with the mosfet with everything connected to the adjust pin.

I'll want to try those values in my circuit card as well. It should work just the same as the breadboard, but just to be sure . . .

I'll also try Hippy's cleaner 'adjustment' code to see if it will make any noticeable difference. When I tried the various iterations of inserting calculated pauses, the simple no-pause code was pretty close to the best.

When I'm done I'll post the circuit again with my choice of resistor values, and a listing of the control code as I am using it after I test Hippy's fragment.

Ooops, never mind, I see you've already done it, thanks.
 
Last edited:

BCJKiwi

Senior Member
Is there anything you want to add - like a decent circuit diagram?:rolleyes:

Do your latest tests support my findings?

With the 08M running @ 8mHz, I found the <3 test not worthwhile and opted for removing that in the interest of less code = faster cycling.

Also felt that moving more code into the internal increase/decrease loop was not desirable as it placed additional code and delay into the tight loop that is key to fast matching output to input. The values from ReadADC are not checked within this loop so as far as I could see, recalculating the same values each time was wasted effort.
 
Last edited:

wapo54001

Senior Member
Is there anything you want to add - like a decent circuit diagram?:rolleyes:

Do your latest tests support my findings?

With the 08M running @ 8mHz, I found the <3 test not worthwhile and opted for removing that in the interest of less code = faster cycling.

Also felt that moving more code into the internal increase/decrease loop was not desirable as it placed additional code and delay into the tight loop that is key to fast matching output to input. The values from ReadADC are not checked within this loop so as far as I could see, recalculating the same values each time was wasted effort.
BCJ,

JPEG of my circuit is attached, please copy it to the finished projects to suit. If you would like me to change something, let me know and I will change and repost.

Yes, I agree with your findings. I set my divider resistor to 8K because I was looking for the lowest I could go, but I think your 10K is the best permanent solution, and upper resistor at 0K, 10K, 20K will give an excellent choice of output voltages.

I propose that the final software code include only the basic increase/decrease loops exactly as Wilf wrote it -- I think that trying to optimize that code with pauses was a red herring. Best to leave it alone.

I think that further enhancements to this project are very possible, both software and hardware. The 08M I/O is not fully utilized at this point, and there is a lot of room for additional code.

For example, I suggest that we use "high 2" as the very first line of code before the main program to set output low as soon as possible until the circuit has begun to function and control output.

Also would like to see multiple reading and averaging of the wiper input both to stabilize the input value and also to protect against wiper noise and momentary disconnects that Hippy has mentioned. I would suggest multiple reads and averaging that lasts about 100ms, with more reads and less "pause" time preferred.

Could a second 08M control a mosfet as a variable resistor on a second 317 that is configured to be a variable current limit on the output of the first 317? Could feedback from the current-limit 317 be used to reduce voltage output on the first 317? Infinite possibilities.

I do worry about turn-on and turn-off -- lack of control of the adjust pin will send the output high. I think in order to be practical, this issue must be addressed and solved in a final circuit. Otherwise, an unsuspecting user could fry his 5V circuit under test with full Vin at turn-on or turn-off.

I guess we're done? I do like the result, and since I have a boxful of these circuit cards this will be my regulator circuit of choice henceforth. I wish I had a ready source of -1.25V on the board to connect the mosfet source to so that I could get true 0V at the output . . .
 

Mycroft2152

Senior Member
W,

Nicely done!

I thnk you should call it the Pheonix Picaxe Power supply. As you raised it from the ashes of an abandoned design.

I do have one suggestion, remove the pot and add a couple of buttons to raise and lower the voltage set point.

Myc
 
Last edited:

wapo54001

Senior Member
Say, wouldn't this be a terrific basis for a "smart" battery charger??

Everything is here -- ability to control charge rate, even pulse charge, ability to monitor battery voltage and adjust charge, ability to trickle charge after charge complete, ability to charge multiple different types of battery from one charger, etc etc.

Cool.
 

Mycroft2152

Senior Member
Say, wouldn't this be a terrific basis for a "smart" battery charger??

Everything is here -- ability to control charge rate, even pulse charge, ability to monitor battery voltage and adjust charge, ability to trickle charge after charge complete, ability to charge multiple different types of battery from one charger, etc etc.

Cool.
Very cool!

Don't stop now.
 

BCJKiwi

Senior Member
@ Wapo,
Thanks for the diagram, You couldn't do one for the Vout mode as well could you? - don't know what you use to draw the circuit but have Diptrace and find it a bit of a learning curve which I've not yet mastered for 'quick and dirty' circuits. PICAXE libraries for Diptrace anyone?

1. Found the pause code beneficial. I presume this will relate to the MOSFET used and the speed at which it responds to the the charge pulses to the gate circuit.

2. Tried a sort averaging loop in the Pot circuit and found it dramatically delayed response.
However was doing repeat reads of ADC and averaging before moving on. The ReadADC is the slowest part of the whole system so averaging that is gong to be a problem. Maintaining an average of the last 5 reads in some way might be possible.

3. National in their datasheet show a Pot in the Vout line to manage current with Vout (after the pot) directly connected to Adj. This pot could be replaced with a beefy MOSFET but you would also need a sense resistor in the Vout line that would convert to usable Voltage for ReadADC to make it all work. Op-amps etc probably required.

4. As reported previously, provided 08M is running first (before Vin), or, both start together, the voltage rises from minimum to set point. The only issue is when Vin remains on when the 08M goes Off. - will add notes to that effect as that is the main risk. Will add a High 2 as well.
 

wapo54001

Senior Member
BCJ

I'm not happy with the speed of adjust, either. Have been playing with that.

Here's an exercise for you:

Remove the pot from the circuit. Connect a 10K resistor between the outboard end of the input readadc 1meg and ground so that the input is grounded and the output is running at minimum voltage 1.25V.

Then, short the outboard end of the 1meg resistor input to +5V -- overriding the 10K resistor and in effect instantly going from minimum output to maximum output -- and see how long your circuit takes to make the full transition.


My circuit (with .47uF, NO pause code) very crude timing:

1meg - 13 seconds
500K - 6 seconds
100K - 3 seconds
10K - virtually instantaneous

I'm thinking I don't like the 1meg & .47uF combination because it's too slow. I'm thinking I might go with the 100K. This is the component that is keeping the circuit from performing with alacrity. When I monitor the input count vs the output count, they stay the same even with the 100K, so I don't think this will affect the regulation.

Do you see a downside to using the 100K in lieu of the 1meg?

PS Go to www.expresspcb.com and download their free software. Even if you never use their PCB service, their circuit design software is easy to use, and you can copy a drawing to your clipboard for creating of a jpeg of your circuit in some other program (I use photoshop CS2).
 

hippy

Ex-Staff (retired)
Maximum transition time inevitably comes down to "t=RC", smaller R faster charge, bigger R slower charge.

The issue with going to a lower R is that a short pulse produces a greater change in charge than a higher R so too low and there could be more ripple.

This comes back to what I was saying about multiple algorithms, and in this case perhaps multiple hardware - use 100M when the difference is small so it really is small nudges but use a different pin and a 10K for bigger changes ...

Code:
               10K
.--------.     ____
|     Of |----|____|---.
|        |     ____    |
|     Os |----|____|---^---> MOSFET
`--------'     100M

Adjust:
  Do
    ReadAdc pin, w4
    If w3 > w4 Then
      difference = w3 - w4
      If difference > N Then
        Low   Of                ' Fast Charge
        Input Of
      Else
        Low   Os                ' Slow charge
        Input Os
      End If
    Else
    :
    End If
  Loop
 

BCJKiwi

Senior Member
Have just run some tests and find oscillation with =< 220R on the gate and no pauses ~ 08M at 8Mhz and IRL520.
@ 470R speed was very similar to that at 1M and auto pause length.
Also need to protect the port against high currents but 10k is more than enough for that.

Based on this I would not be happy publishing a circuit with less than 1M. The circuit as published has a wide tolerance of MOSFET used and as such I think is safe.
Also don't see any real advance in performance with the proposed tweaks. If the builder wants to fine tune then it is over to them.

@ Hippy,
Is there a spare tristateable input for Of/Os? only spares are Legs 2,4,7 none of which are (as standard) both inputs and outputs.
The code would also need to ensure that both were inputs to begin with so only one or other was active, or can you rely on the default port state at turn on for this?
 
Last edited:

hippy

Ex-Staff (retired)
Having two tri-stateable output lines would probably require going to up a 14M. It shouldn't matter if both are outputs at the same times as that would just parallel the 10K/100M which is as near as makes no difference still 10K.

If you've only got outputs, you could use diode blocking to pull or push charge out quickly; te output can then be biased above/below C charge to prevent current flow. That way you could use a tri-state for normal slow control, an output for fast charge, another for fast discharge. Not sure what effect Vdrop would have or how successful it would be. As long as I/Os were active whenever Oc or Od were active there would be charging / discharging going on, albeit slower than desired ...

Code:
                   2 x 10K
.--------.          ____
|     Oc |---|>|---|____|---.
|        |          ____    |
|     Od |---|<|---|____|---|
|        |          ____    |
|   I/Os |---------|____|---^---> MOSFET
`--------'          100M

Oc = 1 - fast charge / 0 - Hold
Od = 0 - fast discharge / 1 - Hold
Os = 1 - slow charge / 0 - slow discharge / Input - Hold
 
Last edited:

BCJKiwi

Senior Member
Bottom line for the circuits I tested is that I can't improve on the response to a step change (from near min to near max ~ 1.2V to 10V) with the circuit and program as currently published using the IRL520. If making a normal slowish pot movement as if you were wanting to move up or down a volt and watching the output not wanting to overrun, then the out precisely tracks the pot.
If however you swing the pot as fast as you can, it takes around 0.5 sec to get close and a bit more to settle on a decrease step change and about 50% longer on an increase step change. I suspect having the Cap tied to the Vout via 240R may have something to do with that but the circuit does not like the Cap to 0V (oscillates).

I am actually quite happy with the 'feel' of this adjustment the way it is. It's much better than the original tests. It enables you to move the pot steadily and have it track rock solid. If you move it fast, it lags a bit so you can bring it back before it overshoots.

With 470k, /0.47uF to 0.33uF is best, and with 1M 0.22uF is best. With lower Vout bounces or jerks on a step change. As far as I can see, the inner loop matches, then it rereads the setting while the pot is still being moved so it resyncs to the new setting - really fast but most disconcerting.

I think the MOSFET gate characteristics have a lot to do with this. The IRL520 is a 10A device (managing 50uA!) and has a relatively high threshold on the gate of 2.9 to 4V (at 250uA). It also has a relatively high Gate capacitance and a relatively slow response (compared to the VN2222L or 2N7000). However the VN2222L is not as stable with any combinations of R/C under load and a high frequency oscillation sets up of about a 2V (which is the gate voltage) as the gate V appears to collapse and re-assert at a rate that my CRO can't stablise (min time base of 0.1uS).
 
Last edited:
Top