Electronics - Control Loop

Created; 05/02/2015, Changed; 04/03/2024, 05/03/2024

Previous page; Electronics - Designing with discrete semiconductors 

In the previous page, I showed examples of linear transistor circuits with compensation capacitor networks added to improve the bandwidth.  The emitter resistor set the gain, but there was no other feedback and the circuit probably could not be described as having feedback, rather it has programmed gain.  In those circuits, bandwidth was improved by adding a much faster amplifier.   

The best solution ran the output differential amplifier, mostly turned off except when it was doing work.  In that case, the feedback resistors consumed most power 160mW = 2 * 400V^2 / 1MR. Rising to 1W = 1 * 200V^2 / 220KR or so when running.  The differential amplifier consuming 12mW and the feedback resistors 40mW.

OrCAD 16.6 or 17.2, AL-0013-01B

This Proportional Integral (P.I) controller requires two variables to be changed, and this gives a good starting point.

Generally, the filter capacitor must be a maximum of 1/5th the size of the integral capacitor.  Generally 1/10th or 1/20th is normal for the filter capacitor but the smaller, the more stable the loop provided higher frequency noise is managed adequately.

There is comparability between using a low Q soft magnetic, bead or common mode choke and a C + R+C network for EMC filtering to control loop stabilisation.  The term circuit damping is good.

The R or R+C components C2, 5, 11 in parallel with are not included in these diagrams.  They are not required, on the set point input. 

Example from CRT plate driver previous page;

Blanking is used, when the dot is moving but should not be seen such as drawing a graticule and moving the spot back to the start.

Rather than optimise the design, the drivers can be driven more slowly to avoid distortion. 

Block Diagram AL-0051-01A OrCAD Capture diagram.

AL-0047-11A Feed forward control.

The left side is the input signal amplified.  The right side is the correcting waveform generated by amplifying the error and applying correction.  The circuit does not perform particularly well but demonstrates the point.  The difference signal output and mean voltage level are constant, so the CRTs astigmatism should stay corrected compared to other examples I have created in which the mean level changes with the amount of work that the amplifier is doing.

Gaps for resistors shown may need to be fitted if more trimming is required.

Voltage mode switchmode power supply ICs usually use Feedforward to vary the pulse width to shorten as the supply voltage mains increases in the ripple thereby maintaining the same output power.  Feedback then sets the precise output voltage conventionally.

The differential amplifiers on this and the previous page demonstrate different, control and compensation strategies;

AL-0047-04? And AL-0047-05? Simple differential amplifier runs open loop with differential compensation that will need trimming to correct for variation in loading and component capacitance.  The circuit must be driven with a low impedance differential driver. 

AL-0047-01? Feedback, with common base buffering and emitter followers, gives better compensation for loading capacitance variation.  The circuit is less sensitive to load capacitance.

AL-0047-12? It is a very fast inner control.  Consequently, the circuit can work very briefly at a higher frequency.  Mostly only one side or the other side output is working, giving the opposite side time for the voltage to rise ready for that side to be used accurately, quickly.

The method turns out to be the same as the other circuits with feed back, except that the feedback is not cross coupled back to the first amplifier.  Having said that, it is worth considering, if only to looking at your problem another way.

AL-0051-01? Feed Forward compensation block diagram (OrCAD Capture).

Feedback - AGC;

Feedback for gain control instead of distortion and speed control.  A traditional radio's RF amplifier has no overall feedback for linearisation or bandwidth correction but will have low frequency automatic gain control from the detector output.  In radio, the mixer and local oscillator are designed for low distortion multiplication and oscillators sine wave purity in order to minimise the detection of other channels and interference.

An FM radio may use a limiter diode instead of an automatic gain control in the RF section.

https://www.cool386.com/zn414/zn414.html TRF Radio, R1+C1 from the automatic gain control.

Control Loop Compensation

Without feedback - Called open loop;

In the case of Motor Speed control, for example, You may avoid control loops or minimise the need for a control loop, for example by;


Constant speed motors;

Stepper motor - old low power type.  This is a 1960s or 70s model, but during the 1980s, stepper motors started using more powerful magnets.

Induction motor.  Single phase supply but with direction control capacitor.  The capacitor is reactive and applies leading alternating voltage in the second phase.  In order for magnetism to be created in, the armature rotates a little below synchronising speed in order to generate a magnetising current in the armatures copper cage. 

Permanent magnet brush motor.  The supply voltage determines the speed, the brushless type works particularly well in a control loop because of their smoother running.  Generally, these types of motor have quick acceleration and braking when driven from a bipolar driver, resulting in a tighter control loop, meaning fast and accurate. 

Modern high power stepper motor.  2-phase with 4-phase wiring.  1980s motor, the detent force needed to rotate the shaft is more because the motor is magnetised with stronger magnets. 

Central heating timer, single phase permanent magnet synchronous motor.  These also have a spring-loaded ratchet mechanism to ensure they rotate in the right direction.

Disk drive 2-phase stepper motor.  Has a low voltage winding for high speed running and long-lasting bearings. 

4/2 phase Stepper Motor Drive 2 phase on

Stepper motor driver operating one phase on mode.  I used MOSFET power transistors plus Zener diodes because the gain would not have been high enough unless I had used darlington transistors.  Power MOSFET transistors were very new in 1979 and beginning to replace the void left for very low turn on voltage, germanium power had been withdrawn a few years earlier by manufacturers.  Bipolar junction transistors sustain low current over voltage pulses.

During the 1980s, Japanese manufacturers such as Sanyo introduced very good quality 200-step stepper motors that were made with smaller air gaps and more rigid construction than British makers were making.  More powerful magnets were used in them.  They were more efficient, quieter running, and cost a lot less.  The quietest smoothest running stepper motors are five-phase motors such as; 500-step Berger Lahr, but there are some trade-off's in using these motors.  A shaft encoder, motor, and control can be more precise, though that would introduce a small amount of control loop noise.  Three-phase stepper motors are also made designed for smooth running.

For example, an encoder driven from a belt driven geared down brushless DC motor rotating at 500RPM.  The encoder's output divided down to 4 phases 22.5 pulses a revolution.  The four phase comparators (giving 90 pulses per revolution but with a better capture range with a fast, low drive ripple voltage because the higher frequency 90 adjustments a revolution can be filtered more without compromising the loop stability so much) resulted in a more stable phase accuracy than a 200-step stepper motor has (its position varies by at least 1/4 a step with temperature when it is rotating).  This edge triggered phase-locked loop was implemented partly in CPLD and included fast out of lock detection, which was an overriding frequency detector that was applied if the frequency did not match.  The control loop needed to be set about right for the motor to turn then trimmed, there was, of course, very little option to under or over compensate then adjust. 

The strategy used in a temperature controller;

There is also a fan which is turned on when cooling is required, except when the cooling drive was operating at a very low power.  The fan is also used if heating is required, except when the heat sink is hotter than ambient temperature.

The driver is not usable when the product of power required and the temperature difference is high.  In this case, driving the thermoelectric harder will cause it to heat rather than cool.   If this aspect is not managed well, perhaps by including a learning cycle, then the thermoelectric may not reach its best cooling.  This is a significant issue.

Temperature controller with ancillary functions  (AL-0023-01C CADSTAR 17). 

I spend some time tidying up diagrams particularly this one.  It also gives me a good opportunity to review my work.

How to find the constants for the PID controller.

When you consider buying a second-hand car; Test the suspension by leaning on each corner and then releasing that corner in turn - the car should rise, fall then rise and stop this is critically damped, and the shock absorbers are okay.  If your design to over damped the control loop will be stable under a range of component tolerance, in this case, the car should rise more slowly then just stop, if you set it just right that would be at the same length of time as the critically damped condition this is a good safe setting.  In the case of the second-hand car that takes a long time to return, then someone has filled the shocks with treacle or heavy grease because they are worn out.

It is usually better to set the control just under damped.  In that way the system settles in the same time but does not overshoot.

Include some high-frequency filtering - this is usually set to a factor of 1/5th to 1/10th the value of the integral constant, but can be 1/100th.  This will compromise the loop stability a little, but it is necessary.

Start without any Integral (Capacitor shorted) or differential constant (capacitor removed)

1) Reduce the loop gain (constant or resistor) until the loop is just stable, the loop is therefore simply a proportional control.  The loop error as a very broad guess might be 2% (loop gain 50-100).

2) Halve the loop gain.

If this meets the requirement, then don't go any further.  You have a proportional controller (P only).

3) Add the differential capacitor (or constant) and progressively reduce its value until the loop is just stable.  Double the capacitor value, and fix it at that.

The loop is now stable, just over-damped.  To give yourself more margin, you can quadruple the capacitor and halve the resistor again.  If that achieves the requirement, leave it at that Proportional Integral controller but with no Differential Control term.

I have not got a good strategy for the Differential control but the following works somewhat.  It is rarely necessary to have a differential control term.

4) Progressively increase I and reduce the D constant, and progressively reduce loop gain P until you can go no further.  Then give yourself a factor of two to four margin by reducing I and increasing D and P.

P and PI controllers can be set empirically quickly, but PID is a bit more fiddly to set up, and I am not sure of the best method.  Using the above method increases the frequency of the loop jitter and reduces its amplitude.

A method of finding the approximate value of the Integral term (capacitor) is to increase the gain as (1) measure the free running frequency.  Halve the gain (2), then fit a capacitor that gives a time constant equal to the period of oscillation, or double that period.  Then proceed to (3).

Look at Wikipedia on PID control you will see that they show you how to derive the terms for critical damping, whereas I have described how you achieve over-damping, which gives you a good solution with a margin for variation in load and tolerance.  What you need to consider and experiment with is how the PID will behave after the item under consideration has had several years of use.  For example, shaft encoders often have shaft sealing which will wear in quickly and the amount of motor effort needed to turn the encoder will reduce.

----------------------------------------------------------------------------------------------------

Negative feedback to form a relaxation oscillator

The digital output stops this circuit settling at the desired output voltage but switching instead at the mean level of the desired output voltage, called a relaxation oscillator.  The output which is after filtering is at the desired voltage with a more modest loss than could be achieved with a conventional linear amplifier, but less efficient than was achieved using a buck-mode switch mode power supply with output polarity switch.   This type of amplifier is used in audio amplification.

AL-0021-01F Switch mode amplifier, LTspice.  Variable frequency, with a maximum but with no minimum frequency.  The output LC filter will also resonate at some frequencies.  The circuit works fine operating over a small output voltage range, at lighter load the output filter will have higher Q and will resonate producing high voltages when the output is close to the power supply voltage and the operating frequency is consequently low. 

There is little problem with using an op-amp as a comparator as above the switching is not slowed by driving to power rails but on the other hand the output is slow and will cause power wastage in the output driver.  A speed-up up capacitor is fitted to improve the op-amp in comparator mode's output speed.

AL-0021-02G Fixed 100KHz open loop.   There is no feedback the circuit functions open loop, so the output voltage is a percentage of the supply voltage.

The mark space ratio is set by adjusting the input voltage.  There is distortion when the output is close to the power supply rails, and distortion around mid-voltage, which I do not know the cause?

LTspice is hard to use at first, and its help tells you some of an answer but does not complete all the steps.  LTspice is continually improved, and the newest user interface has some buttons that had been an obscure meaning before.  On the other hand, the modelling is said to be better and faster than other simulator tools.  The key thing with any simulator is to keep the circuit small. 

AL-0021-03B Relaxation oscillator from output feedback synchronised to 100KHz. 

It has now become infuriating that, for example, Texas Instrument model do not run in any other tools than their own.  Specifically, the CADENCE, tool is difficult it is better used as a very good circuit design tool.  Consequently, you need to model use things near enough, but then use better parts in your final design.  Because I am retired, I can not ask a question, which TI may have a good answer for?

TI's solution; https://www.ti.com/video/5625983804001

--------------------------------------------

 Analogue v Digital integrator;

A filter or control system can be modelled in Labview.  

Integration is simply the time constant and is 100% or nothing after a set period compared to a simple RC filter which produces a slope. 

This model's time constant can be varied and is set fast initially and progressively increases in time.  Therefore, a result is shown rapidly, then over time it becomes more precise.  It also looks very good to the user.

Lab View tool used to create this diagram.  I do not find this diagram useful, it tends to cloud the solution.  There are complications in order to use this tool, these invoke more work but are clearer in themselves.

1946 Lenton sport has a particularly good frame.  The frame is very much more springy than a modern bike's frame, but there is a very good active damping that the cyclist would not be aware he is providing.  Consequently, is that when I hit bumps, the bike handles them better and the bump is softer for me.  The hub gears are also easier to manage, so I can pay better attention to road traffic. 

Unlike a child's bike or a modern bike, a veteran adult bike is less easy to learn to ride on because it needs more speed to start going with.  On the other hand, managing derailleur gears whilst cycling on busy roads is harder, or you need to use a lower gear change down early, which is all more effort.

https://blog.andrew-lohmann.me.uk/2018/10/lenton-sports-bicycle.html