The Open loop gain of these three blocks is thus K/S2. where K = Ks.Kc.Kv->I
This is a double pole at DC, which from an open loop perspective, causes the gain to fall off at 40dB's per decade. In order to close the loop and make it stable, the roll off must be 20dB's per decade as the loop gain passes through unity. This helps to define the requirements of the loop filter. To lessen the roll off to 20dB’s per decade, a differentiator is required, (to cancel a pole) along with some proportional control.
The S domain gain of the controlling filter will therefore be (p + dS), where p is the proportional gain, and d is the differential gain. (This is a PD controller, not PID!) The open loop gain G(S) of the complete system is K(dS + p)/ S2, and with 100% feedback the closed loop gain :-
Eqn. 1
By comparison to the 2nd order simple harmonic motion equations, it can be shown that this creates a closed loop system where the natural frequency of the loop ωn , and damping factor ζ, are given by…
For a stable and well controlled loop, the damping factor is normally set above 0.7. In the case of the balanced beam demo, (as discussed further below), p is set by the requirement to provide enough current to actually balance the beam for a given weight. Thus, the only design variable left is d, the differential gain. By measuring K of the system, which was around 80s-2 (Diag.9, Section 4.0), the optimum value of d was found by simulation to be around 0.8 seconds.
This is a large differential gain, the effect of which is to amplify any noise on the signal and produce large amounts of jitter on the beam. To overcome this, the signal provided to the differentiator needs to be low pass filtered. A single pole filter did not provide enough noise immunity, and thus a two pole filter was employed. The 3dB point of the filter was chosen to be a decade above the signals of interest to allow a stable system to be created. The maths is complicated as a result of the filter which adds a further two poles to the loop, creating a 4th order system.
The open loop gain, G(S) which controls the loop and makes it stable is :-
Eqn.2
Where K is the loop gain of all components excluding the PD controller, p is the proportion gain, d is the differential gain, ωp is the frequency and Q is the quality factor of the additional 2 pole filter required to pre-condition the signal presented to the differentiator .
This equation totally describes the open loop dynamics. By inspection, it has two poles at DC (created by the coil) two poles at ωp created by the filter (in front of the differentiator) and two zero’s. These are a result of the differentiator introduced to keep the loop stable, and the 2 pole filter.
This has been simulated using Spectre, with d and ωp chosen so that the loop gain falls through unity at 20dB’s per decade.
- Implementation
- Position sensor
To detect the position of the beam, an LED is attached and, pointed towards a photodiode sensor, mounted on the platform (Diag.1). The LED/photodiode response varies approximately linearly w.r.t. distance. The LED is modulated by a 100KHz square wave (Diag.3), allowing the dc background response of the photodiode to be eliminated by ac coupling. This signal is generated by the AN20 on pin ADCLKOUT.
The photodiode is reverse biased (via 200K resistors) to 5V in order to allow a path for dc current produced by background light, to discharge (Diag.4).
Diag.3 – Source Diag.4 – Sensor
The photodiode current is converted to voltage and amplified by a trans-impedance AN20 CAM (Diag.5).
Diag.5 – AN20 circuitry
The 100KHz signal detected by the photodiode, is converted back to a low frequency signal, by a technique called ‘synchronous demodulation’ (Diag.6). By clocking the switched capacitor trans-impedance amplifier synchronously to the signal, and following with a sample and hold, the resultant output is affectively a rectified version of the input. The frequency 100KHz was chosen as it could be easily generated by the AN20, and was high enough to be filtered by the AN20’s continuous time output filters.
Diag.6 – Synchronous demodulation
- Loop filter
The control loop filter, required to stabilise the closed loop system, described in section 2, has been implemented using Filter Biquad, Summing Amplifier, and Differentiator CAMs (Diag’s 5 and 7).
The loop-filter consists of a proportional amplifier and differentiator, along with a 2-pole pre-conditioning filter for the differentiator, for reasons discussed in section 2.
Diag.7 – Loop filter
A continous time smoothing filter, with pole at 34 KHz is used to reduce clock noise, providing a smooth control signal to the V->I converter.
- V->I Converter
The V->I converter is required to take a low voltage signal (0-1 V), and generate a current in the order of 0-1.5 A. The circuit diagram is shown in Diag.8. A dual Darlington pair in emitter follower configuration, is driven by a voltage gain stage. Feedback to the op-amp is taken from the output, to eliminate variation in transistor performance due to temperature etc.
Diag.8
- Practicalities
- Measuring the open loop gain K, of the system
To help design the loop filter, the response of the system has to be measured. To do this, the loop was broken, (refer to Diag.2), and a 50 mV step voltage applied to the V->I converter. The response of the system to this excitation was measured at the output of the position sensor using an oscilloscope. The results were analysed using Excel.
A log/log plot of the response minus the DC offset, shows an excellent fit to the model 2t2/50e-3 ( Diag.9).
Diag.9
A double integration w.r.t. time of a constant input voltage K would yield Kt2/2. Comparison with the model shows that K must equal 4/50e-3 = 80s-2.
- Simulation of the open and closed loop system
The addition of the 2nd order pre-conditioning filter creates a 4th order system, which requires simulation to help provide stable solutions. This was carried out in Cadence DF2, using the analog S-domain voltage controlled voltage sources . Ac and transient analysis was then carried out on the open and closed loop systems, to ascertain phase margin and demonstrate the expected transient response (Diag’s 10 and 11).
Diag.10 – Simulated open and closed loop responses
The top trace in Diag.10 shows the phase change w.r.t. frequency. It starts at -180° due to the two poles at DC (response of the coil). To gain some phase margin, the differentiator zero is placed at 1.2Hz. This provides 60° of phase margin, as can be seen by measuring the phase as the open loop gain (lower trace) drops through zero. At higher frequencies, the poles of the biquad filter take affect (20Hz), and finally, the second zero at 330Hz levels the phase back to -180°.
The middle trace is the closed loop response, which shows that the bandwidth of the system is 10.6Hz.
Diag.11 – Transient response to step voltage
The transient response in diag.11 shows that the system has good damping, and is thus stable.
- Proving the model
In order to verify that the model for the open loop system is correct, the differentiator gain was reduced 10x and simulated. This showed that the system was highly under-damped, and should take 4s to stabilise, with a natural frequency of 2.4 Hz (Diag.12).
Diag.12 – Underdamped closed loop simulation
The same change was made to the differentiator gain on the AN20, and the response of the closed loop system tested by displacing the beam, and letting it go. The beam was seen to be under-damped, and slowly dying oscillations were observed at around 2.4Hz, thus proving that the modelling is correct.
- Further work
The demonstration requires to be made more robust, and more aesthetically pleasing, so that it can be carried to trade stands etc. All other work is complete.