Date   
Re: Ubitx batteries / charger #ubitx

Daniel Conklin
 

Re: No Boot-Up (after spikes)

John (vk2eta)
 

Hello Ted,

I will leave the recommendations for a new Raduino to others.

In the mean time, and as an alternative to the chainsaw (hihi), since you seem to have i2c activity you could, if you want to use non-gui style command line interface, install the diagnostic software in the Raduino to check that the communication with the si5351 is possible.

See https://groups.io/g/BITX20/files/uBitx%20Diagnostic%20software%20by%20VK2ETA/ubitx-Diagnostic%20-%20Version%20B0.2-2018-04-28.zip

The readme file contains the settings for the Arduino IDE terminal that is used to control the tests. 

The core system tests (option 1) will tell you if:
a) the i2c bus is locked
b) the si5351 chip is not found at the expected bus address
c) the Nano can't write to the registers of the si5351 chip

Best done with the Raduino removed from main board.

We can then take it from there.

73, John

Re: Confused about how AGC works?

Joe Puma
 

Jerry I have had great success in hooking up Sunil’s AGC. I could be the poster child. I even determined a better location to grab audio instead of Vol H which is on the relay side of the R70 resistor. 

I do admit I had a hard time figuring things out in the beginning because of my ‘I’m still learning skillset’ but also because the CD that came with my radio kit could not be read and I only got half of the images and info off of the disk.  Then Sunil sent me some links that helped. Tuning the AGC meter was tricky but just follow the instructions again. The AGC is pretty simple. Just hook up the attenuation where Sunil stated in his instructions and you should be good to go, tune the 2kohm variable. Actually you know what.  I put a 10k because I thought it wasn’t attenuating enough I even changed one of the resistors before the AGC pot to 15kohm more then what was there. I can get specifics if anyone needs I’m going off memory.  

I ended up using coax for my attenuation hookup as that area is sensitive on the board and I was getting RF in from that wire as well as my IF tap for SDR. 

 Here is a pic before the coax 

image1.png


Joe
KD2NFC 





On Apr 19, 2019, at 2:57 PM, Jerry Gaffke via Groups.Io <jgaffke@...> wrote:

From 
    https://en.wikipedia.org/wiki/Automatic_gain_control
"Automatic gain control (AGC), also called automatic volume control (AVC), is a closed-loop feedback regulating circuit in an amplifier or chain of amplifiers, ..."
A google search for "AGC vs AVC" shows they are considered synonomous in radio design (but not for power grids), and that AGC is the more modern term.

In this forum, all such circuits for receivers have been getting referred to as AGC.
For some reason, the term AVC has only been used in this forum for automatic level control while transmitting
(Except for these posts from MRM.)
Works well for me, as few of us care that much about AVC while transmitting.
I suggest we keep it that way. 


Anyways, regarding the various AGC schemes:

There is this AGC kit from Sunil, it detects audio, and uses that to somehow attenuate the signal in one of the IF amps.
    https://amateurradiokits.in/product/agc-kit-for-bitx-and-ubitx/
Unfortunately, nobody seems to know how to hook it up:
    https://groups.io/g/BITX20/topic/4809028#65586
I'm sure it's easy enough to resolve with a quick email to Sunil (he monitors this forum).
And is definitely a contender, especially if you are already ordering one of the excellent Bitx40/uBitx enclosures from Sunil.

There have been several other AGC kits made available.
Let us know if any are still active, other than Sunil's and the one from   https://shop.kit-projects.com/

An AGC scheme that attenuates audio is a perfectly fine solution.
As stated in my previous post, one that attenuates RF (or IF energy) instead of audio
can give better dynamic range, but is in some ways more complicated and error prone.
An audio only AGC scheme could be mounted on the back of the volume pot, with the only
additional wire required being one to supply power.  No worries about coax and such. 
If you never hear stations so strong that they are still distorted after you turn down the volume knob
on your stock uBitx, you don't need the extra dynamic range offered by an RF (or IF) attenuated AGC.

And if you occasionally do, that could be taken care of with a manual RF gain control,
which could be just a 1k pot in the received RF from the antenna.

Jerry, KE7ER



On Fri, Apr 19, 2019 at 11:21 AM, MadRadioModder wrote:

As discussed before…

 

“An AGC circuit (automatic gain control)  turns the volume down for you when a strong station shows up like that.”

 

That’s known as AVC or “Automatic Volume Control”… not necessarily AGC.

 

MRM

Re: Ubitx batteries / charger #ubitx

Jack Brabham - KZ5A
 


For powering the radio from batteries look for an "automatic buck-boost" regulator. This type will maintain your desired output V as the battery runs down.   A "step down" regulator will only work if the battery voltage is higher than the desired output V.

For charging Li-ion packs look for a "BMS - Battery Management System" rated for your pack's size.  These these handle all the over- under situations, control charging and maintain a balance between the individual cells.

I'm planning on a 3 cell pack, giving 11 to 12 volts.   I can recharge them from the shack 13.8V supply or charge directly from a solar cell. 

73 Jack KZ5A



On 4/19/2019 12:49 PM, George Blass via Groups.Io wrote:
Hi All

I’m designing my case and have a question. I plan on using 18650 batteries inside the case with this voltage regulator. 

Voltage regulator

Then for charging I’ll have one of these inside the case. 

Charger

My plan is to have everything inside the case with just the charging and USB ports exposed. This way to charge up the batteries you would just plug it in like a cell phone. 

Will this work?  Am I missing something?

George


Re: No Boot-Up (after spikes)

Joe Puma
 

Hi Ted. You did say that you can’t see frequency on LCD. But does the LCD functions let you still control the radio in some way or another. Like can you switch bands. If so that would suggest you are good with communication in that direction.  

I’ve read in the past that someone burned out a digital line on the Raduino and there was suggestions or discussion to switch the digital line to another digital line on the Raduino. Maybe that can be done here. Change it in the source code and compile. Again I’m just repeating what I heard, I’m sure someone has a more technical way of explaining my babble. Lol. 

Joe
KD2NFC 








On Apr 19, 2019, at 3:57 PM, John (vk2eta) <vk2eta@...> wrote:

Hello Ted,

I will leave the recommendations for a new Raduino to others.

In the mean time, and as an alternative to the chainsaw (hihi), since you seem to have i2c activity you could, if you want to use non-gui style command line interface, install the diagnostic software in the Raduino to check that the communication with the si5351 is possible.

See https://groups.io/g/BITX20/files/uBitx%20Diagnostic%20software%20by%20VK2ETA/ubitx-Diagnostic%20-%20Version%20B0.2-2018-04-28.zip

The readme file contains the settings for the Arduino IDE terminal that is used to control the tests. 

The core system tests (option 1) will tell you if:
a) the i2c bus is locked
b) the si5351 chip is not found at the expected bus address
c) the Nano can't write to the registers of the si5351 chip

Best done with the Raduino removed from main board.

We can then take it from there.

73, John

Re: Confused about how AGC works?

digger AB3XU
 

Thanks Don and Jerry for your explanations. In my OP I wasn't thinking about that what I described were oscillations, and as you wrote the parts are chosen to stabilize the circuit and prevent that. Does the delay in part prevent oscillations by introducing a phase shift?

Jerry, the initial link you posted Barkhausen stability criterion was a bit dense for me, but your summary  was useful. Even so it lead me to read some on feedback loops which was helpful.

Don, you are certainly right, I could understand the simple theory of your circuit but got lost on the complexity of how it actually works.

73, digger

Re: Confused about how AGC works?

Jerry Gaffke
 

Joe,

Thanks for responding.

Can you point us to Sunil's instructions that state how to hook up his AGC board?
I clicked on "Download Manual" on his website, got an archive with a dozen files,
but could not find any description of how to wire the thing up.
Is this information available from his website?
Or is it only available from a CD that comes with the kit?

Looks like it could be a nice AGC implementation, does attenuation in one of the
IF stages to allow greater dynamic range than could be had if attenuating after the audio pre-amp.

Jerry, KE7ER


On Fri, Apr 19, 2019 at 01:43 PM, Joe Puma wrote:
Jerry I have had great success in hooking up Sunil’s AGC. I could be the poster child. I even determined a better location to grab audio instead of Vol H which is on the relay side of the R70 resistor. 
 
I do admit I had a hard time figuring things out in the beginning because of my ‘I’m still learning skillset’ but also because the CD that came with my radio kit could not be read and I only got half of the images and info off of the disk.  Then Sunil sent me some links that helped. Tuning the AGC meter was tricky but just follow the instructions again. The AGC is pretty simple. Just hook up the attenuation where Sunil stated in his instructions and you should be good to go, tune the 2kohm variable. Actually you know what.  I put a 10k because I thought it wasn’t attenuating enough I even changed one of the resistors before the AGC pot to 15kohm more then what was there. I can get specifics if anyone needs I’m going off memory.  
 
I ended up using coax for my attenuation hookup as that area is sensitive on the board and I was getting RF in from that wire as well as my IF tap for SDR. 
 

Re: Ubitx batteries / charger #ubitx

Jerry Gaffke
 

Daniel's three cell lithium ion 18650 holder with protection from fasttech.com looks promising.
Unfortunately, from the "discussion" section there, I doubt it does charge balancing across the cells.
Would like to hear of a 3S or 4S holder like this that does do charge balancing,
and is designed for standard issue 4.2v max lithium ion 18650 cells.

Arv said:  "Most Li-Ion and Li-Po 18650 type cells include built-in FET switching
that prevents discharge
 to less than 2.0 volts." 
Arv must be spending more money on his cells, the ones I get generally don't have protection.

Arv also says:
"If using multiple 18650 Li-Ion or Li-Po cells you have to manage the voltage on each individual  
cell during charge to insure that no cell exceeds the rated voltage.   While I abhor the "it won't 
work" and the "it will explode" scare tactics, this is one place where the nay-sayers may be justified"

The model aircraft guys might discharge a battery in 5 minutes or less of aerial acrobatics.
Then land it, and do a quick charge to almost full capacity in 3 minutes or so from 
a 100 Amp source, send it back up for more fun. 
That's the usage case where most of the explosions come from.
If charging at a fraction of an amp, explosions are much less likely.

Charge balancing is a very good idea, but if starting out with a set of all new
cells from a quality manufacturer, they will all charge and discharge at about the same rate.
Maybe back off from the spec max of 4.2v per cell, 4.1v max per cell would be safer.
Unlike lead-acid batteries, a fully charged lithium ion cell can get damaged if you push
a charge current through it while any slower cells catch up. 

If I were to buy that 3S 18650 fastech.com holder, I would charge the cells in place
from a 3*4.1v=12.3v voltage source, limited to a max of perhaps half an Amp.
Could use an adjustable 3 terminal regulator set to 12.3v, plus a series resistor to a 20v supply.
And check for balance across the cells with a voltmeter every few charge cycles.

But looks like most of the balance boards are sold separately from the the cell holders.
That's fine, just an extra 4 wires to solder.

Here's a cheap 3S balance board, though from the user's comments, the balance function is rather weak:
    https://www.amazon.com/11-1V-Balance-Lithium-Battery-Protection/dp/B075D96HVV

Here's another, totally different design (don't see the big FET's),
has a somewhat better description even if it is rather mangled:
    https://www.newegg.com/Product/Product.aspx?Item=2S7-00MH-048Z3

Too bad they don't include a schematic of the thing so I can figure out what all it does.

Any suggestions for a good balance board along these lines?
Can it charge the string of batteries from something like a 20v source
without any external voltage regulator?  Without external current regulation?
How large can the balance currents be?
That sort of thing is often missing from the description.

Jerry, KE7ER



On Fri, Apr 19, 2019 at 12:45 PM, Daniel Conklin wrote:
You need a 3 cell protected holder, like this one:  https://www.fasttech.com/product/1161200-3s1p-18650-11-1v-battery-holder-case-li-ion-pcm

Re: Confused about how AGC works?

Joe Puma
 

I just dumped all the photos I had that I was able to get from him. I put them here: https://groups.io/g/BITX20/album?id=89704&p=Created,,,20,2,0,0

I put other non image files here: https://groups.io/g/BITX20/files/Amatureradiokits%20Files

Hope that helps.

Joe
KD2NFC


Re: Confused about how AGC works?

Jerry Gaffke
 

Barkhausen stability criterion is dense.
If you find an explanation that is sufficient to do design work without being dense, do let us know! 
There are thousands of 3'rd year undergraduate electrical engineering students who want to see it.

> Does the delay in part prevent oscillations by introducing a phase shift? 

Specifying a delay at a given frequency is equivalent to specifying a phase shift.
For example, a 1khz audio signal has a period of 1 millisecond.
If we put it through a delay line that delays it by 0.5 milliseconds, 
then the output of the delay line is phase shifted 180 degrees with respect to the input.

Jerry, KE7ER


On Fri, Apr 19, 2019 at 02:36 PM, digger AB3XU wrote:
Thanks Don and Jerry for your explanations. In my OP I wasn't thinking about that what I described were oscillations, and as you wrote the parts are chosen to stabilize the circuit and prevent that. Does the delay in part prevent oscillations by introducing a phase shift?

Jerry, the initial link you posted Barkhausen stability criterion was a bit dense for me, but your summary  was useful. Even so it lead me to read some on feedback loops which was helpful.

Don, you are certainly right, I could understand the simple theory of your circuit but got lost on the complexity of how it actually works.

73, digger

Re: Confused about how AGC works?

digger AB3XU
 

Makes sense. Thanks Jerry

Re: Ubitx batteries / charger #ubitx

Arv Evans
 

I have and use several of the 3S and 4S charge controllers.  These have between-cell connections
for charge balancing.  Seems to work well because I have rebuilt a number of old Ni-Cad drills
so that they now use Li-Ion cells.  Drills work really well with Li-Ion or Li-Po battery packs.  

From on-line anecdotes it seems that people trying to use Ni-Cad chargers on Li-ion cells is culprit
in many of the horror stories. 

My one complaint about the Ebay sourced 3S and 4S charge controllers is that they usually like
source voltages that are only a couple of volts above the string you are trying to charge.  This
limits what voltage wall-wart you can use to trickle charge your Lithium based battery packs. 

This Li-Ion thing has spawned some research and design work here to see just how much radio
can be powered from a single 18650 cell.  The current is more than adequate but making sensitive 
circuits that run on 3.4 to 4.0 volts is a challenge.  End result I seem to be looking for is ability
to use a simple 1S charge controller (they are less than US$1.00 from Ebay) to manage several
18650 cells in parallel.  Transmitting using MOSFETs in class-C or class-E is not difficult but
at low voltages there is not much margin for noise immunity and overload in receiver circuits. 


If doing much work with 18650 type cells it is probably worthwhile to make a simple spot-welder
for attaching the cell connectors. 


Arv
_._


On Fri, Apr 19, 2019 at 4:39 PM Jerry Gaffke via Groups.Io <jgaffke=yahoo.com@groups.io> wrote:
Daniel's three cell lithium ion 18650 holder with protection from fasttech.com looks promising.
Unfortunately, from the "discussion" section there, I doubt it does charge balancing across the cells.
Would like to hear of a 3S or 4S holder like this that does do charge balancing,
and is designed for standard issue 4.2v max lithium ion 18650 cells.

Arv said:  "Most Li-Ion and Li-Po 18650 type cells include built-in FET switching
that prevents discharge
 to less than 2.0 volts." 
Arv must be spending more money on his cells, the ones I get generally don't have protection.

Arv also says:
"If using multiple 18650 Li-Ion or Li-Po cells you have to manage the voltage on each individual  
cell during charge to insure that no cell exceeds the rated voltage.   While I abhor the "it won't 
work" and the "it will explode" scare tactics, this is one place where the nay-sayers may be justified"

The model aircraft guys might discharge a battery in 5 minutes or less of aerial acrobatics.
Then land it, and do a quick charge to almost full capacity in 3 minutes or so from 
a 100 Amp source, send it back up for more fun. 
That's the usage case where most of the explosions come from.
If charging at a fraction of an amp, explosions are much less likely.

Charge balancing is a very good idea, but if starting out with a set of all new
cells from a quality manufacturer, they will all charge and discharge at about the same rate.
Maybe back off from the spec max of 4.2v per cell, 4.1v max per cell would be safer.
Unlike lead-acid batteries, a fully charged lithium ion cell can get damaged if you push
a charge current through it while any slower cells catch up. 

If I were to buy that 3S 18650 fastech.com holder, I would charge the cells in place
from a 3*4.1v=12.3v voltage source, limited to a max of perhaps half an Amp.
Could use an adjustable 3 terminal regulator set to 12.3v, plus a series resistor to a 20v supply.
And check for balance across the cells with a voltmeter every few charge cycles.

But looks like most of the balance boards are sold separately from the the cell holders.
That's fine, just an extra 4 wires to solder.

Here's a cheap 3S balance board, though from the user's comments, the balance function is rather weak:
    https://www.amazon.com/11-1V-Balance-Lithium-Battery-Protection/dp/B075D96HVV

Here's another, totally different design (don't see the big FET's),
has a somewhat better description even if it is rather mangled:
    https://www.newegg.com/Product/Product.aspx?Item=2S7-00MH-048Z3

Too bad they don't include a schematic of the thing so I can figure out what all it does.

Any suggestions for a good balance board along these lines?
Can it charge the string of batteries from something like a 20v source
without any external voltage regulator?  Without external current regulation?
How large can the balance currents be?
That sort of thing is often missing from the description.

Jerry, KE7ER



On Fri, Apr 19, 2019 at 12:45 PM, Daniel Conklin wrote:
You need a 3 cell protected holder, like this one:  https://www.fasttech.com/product/1161200-3s1p-18650-11-1v-battery-holder-case-li-ion-pcm

Re: No Boot-Up (after spikes)

John (vk2eta)
 

Also, and still assuming the symptoms are that at boot up the display stops at the version and call sign being shown, in the Ian Lee's software version the i2c address of the si5351 can be changed for non standard Raduinos.

I can't check now but I suspect there must be a field in the uBitx memory manager for that data.

The default is 0x60 hex or 96 decimal.

73, John

Re: Confused about how AGC works?

Jerry Gaffke
 

Digger previously wrote:
    Does the delay in part prevent oscillations by introducing a phase shift? 
 
I guess didn't quite answer your question

Consider an amp with positive feedback and no delays anywhere.
It would instantly ramp up to infinity.

If you want it to oscillate, you need to have a delay in that feedback loop
that gives a full 360 degrees of phase shift at the frequency of interest.
So the next cycle at that particular frequency gets reinforced by feedback from the previous cycle.
And other frequencies don't get this positive reinforcement at exactly the right time, so they die out.

If you want the oscillation to be stable, the gain around the entire loop
must be exactly 1.0  (so no gain and no loss).
If it is less than 1.0, the oscillation will die out.
If it is greater than 1.0, the amplitude of the oscillation will keep getting bigger till it swallows the universe.
However, any practical amplifier will have reduced gain as the oscillation gets too big,
so we will soon reach a steady state when the oscillation is so big that the amplifier gain is reduced to 1.0.
In this way the amplifier is considered non-linear, since it treats big signals differently than small signals.

The diagram on that wikipedia page shows a pure amplifier with a voltage gain of A (and no delays).
There is also a feedback network with a transfer function of Beta (a Greek B).
The transfer function mathematically describes all the phase shifts (delays) and attenuations at all possible frequencies,
all wrapped up in a nasty equation.  This is the part that keeps EE students drinking coffee the night before an exam.
But that transfer function is linear, and could be described by a bunch of resistors and capacitors and inductors
all wired up into a big rats-nest.  For example, here's a fairly simple model of the 12mhz quartz crystal
used in the feedback loop of the BFO oscillator on the Bitx40:  
    https://www.maximintegrated.com/en/app-notes/index.mvp/id/2127

Jerry, KE7ER




On Fri, Apr 19, 2019 at 03:45 PM, Jerry Gaffke wrote:
> Does the delay in part prevent oscillations by introducing a phase shift? 

Re: Confused about how AGC works?

digger AB3XU
 

Thanks again Jerry. I used to work with electronics decades ago and have forgotten almost all of it. Not in design but with repair and maintenance of telemetry and then audio equipment. The uBITX has been a great way to get reintroduced to all of it.

73, digger AB3XU

Re: No Boot-Up (after spikes)

Ted
 

Hi, John. 


I got a Nano generic to load up the diagnostic sketch, attached it to the Raduino (out of the radio), and ran through the control function tests. It saw the i2c bus and the si5351.  I ran through it kind of fast and didn't take notes on what ports were connected on each. I wanted to try a $18 genuine Nano board for kicks, as I've been skeptical of using that up to now. 

It seems I can program both the generic and the genuine board just fine but, after that initial test, I can't the the comm port monitor to see Nano output from either board, Of course I swapped comm ports to match the two different boards..  The first time I connected, I received menu lines immediately (you know, like old TNC work or with dial-up modem setups). Since then,no readback.  It seems like the more simple stuff is the most frustrating.  Maybe some sleep will fix this.  See you in the AM.  

And, thanks for the tip on the diagnostics. It's just what I was hoping for, actually, as it takes away a lot of guesswork.


- Ted

Re: No Boot-Up (after spikes)

Ted
 

Joe,

After fixing the first Raduino shorting, no luck. Maybe it's done, not sure yet. Somewhere along the line of hooking up a spare, I got pin 3 (Clock #2) and pin 4 (Gnd) a bit close for a while. It probably remained that way for 10 minutes or so while trying to trace any reasonable answer to the original problem. Anyway, the 2.8" Nextion is toast (reason unknown) and when I hook this radio to my other uBitx 3.5" screen, that screen likewise sits on the initial boot-up with zeros where the Nano information should show up.

As to your question, if I press screen buttons, I get the same false action that one gets while in the Debug mode in the Nextion software.  Ig's powered up but not speaking to anything, same as the original screen, 5 (now toast) Nano boards, and two Raduino boards (one might be dead). 

I can't wait unitl it's warm enough to go sailing again.  


With appreciation,

Ted
K3RTA

Re: Confused about how AGC works?

Tom, wb6b
 

HI,

An additional, somewhat oversimplified, way to look at the AGC control loop is this:
 
If you consider the transistor (or other type of amplifier in the control part of the loop) provides 180 degrees of phase shift then an addition delay of 180 degrees is all that is needed for the control loop to go from being a control loop to an oscillator. This can be done with as little as two equal RC time constant type delays chained together. 
 
Assuming there are delays in the AGC control loop due to other components not being infinitely fast, or other circuit compromises, you can make sure one of the RC time constant delays is much larger than the rest. That will swamp out the effects of the other delays. Many AGC circuit go even further by causing the AGC to cut in fast but restore the gain at a slower rate. 
 
If there was no delay in the control loop the AGC might be so good as to adjust the gain microsecond by microsecond and result in an output signal (audio) of zero volts AC, across every cycle of the audio. 
 
Finally if you are controlling a system with a lot of inertia (such as the hot water temperature to your shower head, air conditioning, motors or the melting temperature of the heated head of your 3D printer) another type of control loop, called the PID loop, is used.
 
In the PID loop the rate of change of the temperature/speed/whatever is fed into the control voltage to help the loop anticipate when to shut off (or turn on) just ahead of the desired value, so the temperature/…/…  will arrive at but not overshoot the desired value (set point).
 
The PID loop would likely not be as beneficial in an AGC circuit when your neighbor down the street keys up his kilowatt with his beam pointed your way, at there is nothing gradual to anticipate. So simpler control loops are the better choice for AGC.

Tom, wb6b

Re: No Boot-Up (after spikes)

Joe Puma
 

Sounds like you’ve had some bad luck. Order some new parts and just push through it. 

73
Joe
KD2NFC 




On Apr 19, 2019, at 9:52 PM, Ted via Groups.Io <k3rta@...> wrote:

Joe,

After fixing the first Raduino shorting, no luck. Maybe it's done, not sure yet. Somewhere along the line of hooking up a spare, I got pin 3 (Clock #2) and pin 4 (Gnd) a bit close for a while. It probably remained that way for 10 minutes or so while trying to trace any reasonable answer to the original problem. Anyway, the 2.8" Nextion is toast (reason unknown) and when I hook this radio to my other uBitx 3.5" screen, that screen likewise sits on the initial boot-up with zeros where the Nano information should show up.

As to your question, if I press screen buttons, I get the same false action that one gets while in the Debug mode in the Nextion software.  Ig's powered up but not speaking to anything, same as the original screen, 5 (now toast) Nano boards, and two Raduino boards (one might be dead). 

I can't wait unitl it's warm enough to go sailing again.  


With appreciation,

Ted
K3RTA

Re: Confused about how AGC works?

Jerry Gaffke
 

All the AGC circuits proposed in this forum (and there have been many) have a fast attack and then a relatively slow decay.
That way when the QRO guy across town keys up, it saves our ears as much pain as possible, and keeps the gain throttled
back in case he decides to utter yet another syllable.  The fast attack and slow decay thing is non-linear, and thus harder
to model with equations.  

The PID algorithm is worth knowing about, an ideal approach to many feedback loops for us punters:
    https://en.wikipedia.org/wiki/PID_controller
No nasty math, easy to understand. 
You get three knobs, and you twiddle them till the system starts to behave itself.
A good example of where you might want to use PID would be on a heater for an oven-controlled-crystal-oscillator, or OCXO.
A processor such as the Nano would be entirely adequate for implementing the algorithm.
The goal would be to add enough heat when the oven is cold to quickly bring it up to temperature,
but not leave the heater on so long that the oven temperature overshoots and gets too hot.
Note that there will be a time lag between when the heater shuts off and when the
sensor near the quartz crystal sees the temperature stop rising.
This system could easily oscillate if the knobs are set wrong,
with the temperature alternating between too high and too low. 


> The PID loop would likely not be as beneficial in an AGC circuit when your neighbor down the street
> keys up his kilowatt with his beam pointed your way, at there is nothing gradual to anticipate.


In that case, you want the "D" knob turned way up, for a very fast AGC attack.
However, since the PID loop is a linear system, the AGC decay will be equally fast, and that is not what you want.

Jerry, KE7ER


On Fri, Apr 19, 2019 at 07:30 PM, Tom, wb6b wrote:
Many AGC circuit go even further by causing the AGC to cut in fast but restore the gain at a slower rate.