Caveat; I don't do all that I say necessarily, Or say all that I do, And sometimes I only say what I wish I had done.
Just get to
the Electronics
Software
Useful Links & Technical stuff
Bakelite radio, Ultra MW/LW,
built in loop
aerial. Purchased
in 1954 for £16, pictured working 55
years later.
The
heater current
supplied by a resistor and NTC resistor in series with
the mains supply. This is evident because the Ultra
light
initially comes on, then dims, then comes up bright just before the
sound
comes through, finally returns to a medium intensity. Small valve
radio's like this usually have a live
chassis (connected to live or neutral supply). This radio
does not suffer
with audio
mains hum, that others like it can, though the supply voltage mains
ripple would be quite high. The
sound reproduced is warm mellow, as if there were a large
loudspeaker and substantial baffle
(Valve sound, which
I think, was developed by Philips). Inherent triode
valve distortion was enhanced to create sub-harmonics that gives the
impression that the radio has a
good low frequency
performance.
Electromagnetic
Compatibility;
There
are a number of strategies minimising emissions and susceptibility to
radio emissions. I intend discussing these points using various
examples and
small detours into other areas of electronics.
Filter
(bandwidth limit) at the boundaries,
use
passive filtering as opposed to active filtering, is very important.
Also keep the bandwidth limited to what is required through out the
circuit.
Transistorised Hi-Fi often use to suffer with
susceptibility
to
lights being switched on causing clicks and radio pick up or
breakthrough. The problem was that a bipolar junction
transistor could rectify radio
interference. A fix that Electronics technicians, in the 1970's used
with amplifiers
was to fit a
100nF ceramic capacitor between the Base and Emitter pins of the first
transistor. I have also seen 100pF capacitor fitted
similarly built into a design for an Eagle amplifier.
Positioning of
components is also important.
Place associated components together. Keep path lengths
short. The main point here is that you have to prioritise and choose
were you can make compromise. Therefore spend time on the PCB layout to
minimise the track lengths, bends, and maximise the track thickness
where there are fast voltage and current transitions. Insure that the
0V return current can follow the same path as the signal current. That
way you can minimise the amount of compromises.
PCB design make a ground plane, and spend time
minimising and fragmentation of that plane. If you need to add tracks
in a ground plane make them short and bring them back to routing
layer(s) as soon as possible. Therefore minimise or avoid make holes in
the plane layer. Actually the best is to have two power plane
layers, and two outer routing layers. putting the planes on the
outside, apparently can cause buckling when soldering in an oven, but
also components make holes in the planes which should be
avoided as this would be fragmentation.
One tip, if you can probe your circuit with an
oscilloscope with the ground connection to any where on the 0V plane
and
there is no difference in the waveform observed then you have
understood
and got a good PCB layout. You should also find that waveforms don't
ring, but some overshoot may be acceptable. I shall discussing this
latter.
Radio's like the Ultra above would be physically laid
out so that the
power input rectification and filtering is followed by the output valve
progressing through the detector, IF, mixer, and RF input. So the power
supply is near where the signal is largest at the output, and
furtherest away from
the RF input where the signal is smallest.
Home made Oscilloscope based on a
Practical Wireless design of about 1973. I worked on the design over a
number of years, improved it greatly. By 1977 it was evident that
I had learnt a lot but this was never going to be a particularly good
Oscilloscope primarily because of the low intensity of the CRT, and I
stopped working on it. The bandwidth is increased from
10KHz
to nearly 1MHz, High voltage CRT supply was changed to a high frequency
type, low noise, sine wave, with proportional control,
to
eliminate Z-modulated mains-hum, and voltage increased. Input
transformers relocated to under the chassis back left as far away from
the CRT as possible to eliminated X and Y axis modulation. Improved
trigger and time base. Grounded everywhere, and all modification made
with recycled parts. The next improvement would
have been to fit a larger transformer, which would have had to be
nearer the
CRT, and I had some Mu metal to screen that, as everything was under
stress.
Grounding strategy - Using one point
(star ground) or grounding
everywhere.
A star point, connection to chassis tends to give
very good
performance but
there will be
resonant frequencies. Alternatively grounding everywhere gives a lower
level of
performance, because there may be varying current across chassis that
inject low level voltage into the circuit,
but resonances are likely to be less this configuration is currently
more in favour. I recommend
that you pick and choose.
For example Radio's like the Ultra above, have a steel
chassis which is signal ground (0V). When ever 0V
(possibly live or neutral) is required there is a short connection to a
nearby point to chassis.
Compensation
- Ensure
that the circuit is compensated properly and is therefore stable;
Below is an example of a super regenerative radio
receiver. I made something like this in the 1970's and it worked well
with good sensitivity. But I did not fit the reaction
capacitor in fear of there being too much positive feed back and the
circuit could broadcast. This is an example of a circuit that it is
nearly unstable, not only is there RF positive feedback via C2, but
there is also positive gain feedback in the audio signal from the
detector
fed into the transistor base. Diodes and
transistor would be low voltage drop type Germanium such as 0A91, and
Transistor OC44. The circuit below is from memory and
may be inaccurate, the original circuit can be found at; http://www.mds975.co.uk/Content/trfradios02.html
The Inverting amplifier on the right has input
and
output filtering, formed of R4, C2, and R3, C4. Also R2 and C1 form an
active filter. R1 and R3 have been chosen to be high enough to avoid
amplifier instability. The operational amplifier is un-conditionally
stable, that is it is stable with R2 = 0, maximum feedback, which is
where the loop gain would
be highest. This circuit may become unstable though with R3=0 so that
C4 is
directly connected to the amplifier output, in this case the
propagation delay is increased but the loop gain would not have
reduced enough for the loop gain to remain below one. If the value of
C4 is reduced below 1nF this particular amplifier would become stable
again. It is also likely that this amplifier would become stable with
C4
increased to 100uF or more as the loop gain would again be reduced.
This
is because the operational-amplifiers behave like transconductance
amplifiers in that there gain is reduced when driving a large load. The
other condition where the amplifier becomes unstable is where R1 = 0,
it
is important that capacitive loading be kept away from an amplifiers
summing junction (the negative input.
This
is interesting lesson from my first year at collage - C4 looks like
positive feedback, but due to the propagation delay through the
germanium transistor (storage time) at the IF frequency of 10.7MHz,
there is
actually negative feedback. The transistor it self has capacitance and
miller capacitance between the Collector and base, is cancelled out by
the addition of
C4.
Examples of enclosures -
grounding every were or at one
point. Inductor can induce current into enclosure, keep them away from
metal enclosures.
Control Loop Compensation - more too
come.
You may avoid control loops or minimise the need for a control loop, for example by;
Use a permanent magnet or shunt wound motor for very good self speed regulation when driven from a constant voltage supply in the case of a PM motor.
Use a stepper motor, but take care
to
optimise ramp up rate when getting the motor to
the desired speed. If the speed is increased to slowly the stepper
motor may resonate for the shaft to continue rotating.
Use feed-forward techniques to
minimise the the amount of feedback.
Two control loops, is very
effective, inner fast tight response, and an outer slow for accuracy.
Example Temperature controller see manufactures of thermo-electric
devices. Note that there maths are based on current but use voltage
drive that is slightly self regulating like the DC permanent magnet
motor
above.
Picture of a PID controller compensation and the
equivalent software. to come
How to find the
constants for PID controller.
If you buy a second hand car lean on each corner
then release that corner in turn - the car should rise, fall then rise
and stop
this is critically damped, and the shock absorbers are ok. But if you
design to over damp 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 in the same time this is usually the best setting,
but in the case of the car someone
has filled the shocks with
treacle or heavy grease as they are worn-out.
Include some high
frequency filtering - this ultimately should be a factor of 1/5th to
1/10th the value of integral constant. It will compromise the loop
stability but it is necessary.
Start without any
Integral (Capacitor removed) or differential constant (capacitor
shorted)
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%.
2) Halve the loop
gain.
If this is meets the
requirement then don't go any further. You a proportional controller (P
only).
3) Add the
differential capacitor (or constant) and progressively reduce it's
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
quadrupling the
capacitor and halving the resistor again. If that achieves the
requirement leave it at that Proportional Differential controller but
with no Integral control term.
I have to not got a
good
strategy for the Differential control but the following works somewhat.
Though it is rarely necessary.
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.
A P and PD 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 Differential term (capacitor) is to
increase the gain as (1)
measure the free running frequency. Halve the gain (2), then fit a
capacitor which 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 describe how you achieve over-damping,
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
the PID will behave after the item under consideration has had a number
of years use. For example shaft encoders often have shaft sealing which
will wear in quickly and the amount of motor effort need to turn the
encoder will reduce.
Two Control Loops - inner and outer;
Consider being in a
room with the heating on and the room thermostat handy. My strategy for
getting the room to a comfortable temperature is. The out-loop usually
should have a longer time-constant than the inner loop to prevent
oscillation.
1) If I am cold and I
can hear the heating going, then;
2) If I find the room becomes warm enough before the thermostat clicks
off, then I turn the thermostat down until it just clicks off.
3) Alternatively if the room does not reach the desired temperature
before the thermostat clicks off, then guess how much warmer you would
like it then increase the temperature setting of the thermostat by that
amount.
4) Go to (1) if not satisfied. What you are doing is the outer control
(nudge
up/down the integral part of PID) with, importantly, limits necessary
to prevent the
set point (thermostat in this case) running away.
This gives you a good understanding, but usually controllers are not simply on/off control. As I said nudging the set point is the integral term. To avoid set point running clamp the set point so that it can not be set more than a chosen amount greater or lower than the parameter under control within the inner loop. You might be tempted to add a value to the parameter under control to drive the set point, but be wary of integrator drift, that would likely leave you with an unresolvable error.
Synchronous noise and Resonance -
Stability and EMC related issues from another prospective
Consider soldiers marching, they break step when crossing a bridge to
avoid resonances, and high amplitude synchronous noise. Applying this
to stability is worth bearing in mind.
In a Switch mode power supply there is
a high current gate plus snubber and any other parasitic capacitance
pulse at switch on that appears across the source current sense
resistor. This could misleadingly trigger current limiting or control
limiting. This pulse can be filtered with an RC filter, but usually (in
current mode controllers) the pulse is gated out or ignored, and an
attempt to add RC filtering would spoil this feature. Alternatively
voltage mode control with feed-forward similarly resolves this issue,
by not using the current ramp in the sense resistor within the control.
Resonance and noise in stepper motor
drive;
Decca
made in
England, transistor VHF/MW/LW radio purchased from Strange of
Sevenoaks in 1962/1963.
Originally was returned for
repair a number of times, but actually only the VHF band is any good.
AC and AF series germanium transistors - absolutely leading edge.
The aerial
broke so I replaced it. I also replaced PP9 battery supply
with a mains power supply based on a 6.3V heater transformer. Used
daily.
If you are working on a leading edge
design there may be no accurate test instrument as good as the
instrument you are designing. If you don't have the required test
equipment for the particular job. Either way spilt the system up into
parts that you can test in different ways so that you can figure out
logically the likely performance in the parameter you are interested
in. In this case build up a pattern of cross checks that give you a
subjective confidence. Continue to build up the system you are
developing cross checking in the way I have described, and reviewing
what you had done previously until the work is complete and you can say
what you have achieved and how much confidence you have in its
performance. You have not finished until if you think it is probably ok
but at this or any stage do always ask for help, support, and a second
opinion.
In conclusion you best tool is logic,
and to develop an ability to look at things in alternative ways.
Nothing is absolute even the accuracy of a measurement, but by building
up a pattern of measurement with tolerances you will come to a high
degree of certainty.
Worst Case Design and understanding
tolerancing
This about
understanding shades gray, when you can do that you are well on the way
to answer the meaning of life and everything. To start with sum the
squares of the effect of all your tolerances, then a figure of merit
can be calculated from the root of that number.
If you try calculating
the values of resistor that you require in a network such as a
Whetstone
bridge using Supper-position, or Maxwell's circulating currents the
outcome is a set on non-preferred value resistors. So what they taught
you at school was no use then, So what you do is create a model which
you can repeatedly try preferred values of resistors and use the values
that best give the lowest merit number using the least squares.
Well that was a lot of
work but you can write a basic program to do that. Eventually you
should by inspection see what parts of the circuit need to be checked
for tolerances, power rating etc. Do some sums with a calculator pen
and paper entering preferred values. All circuits with resistor
networks
can be split down to two or three resistor networks which come down to
a voltage source with an impedance, which you then load with the next
resistor network. In fact if you can avoid resistor networks that is
even
better, resistors age and have temperature coefficients.
My point is that the
best lesson in tolerancing and getting a feel circuit function and
actual behaviour is to the maths, until you feel it without having to
go through everything to prove it. Once you are there use a simulator
if you want.
If you do start
with a simulator, have a guess and do some arithmetic to support your
guess first, Use the simulator to test
your guess. If there is a disparity prototype it and see which is
correct and analyse it to understand why.
I recommend that
you download and use any spreadsheet or other model a switch mode power
supply coil maker and controller manufacturing provides they are well
tested and good. But give yourself some margin the IC makers tend to
specify to just the limit.
I find thermal
modelling from data sheets difficult. An IC won't dissipate much
without an area of copper. Hardly anything can be dissipated if the IC
is faced down, face up is better, and with the board stood vertically
is best. I have found exposed tinned or silvered copper better than
with solder resist. Tinned or silvered copper does go matt white
quickly. I have heard others contradict my observation on removing
solder resit so try it for yourself.
Software - Unlike my advice on simulators
above use PCLint at the outset it will cane you relentlessly unless you
behave and write good clear C.
Write software in a way that is
readable
Put all you constants and switches in the headers. If you want to
change anything use those switches.
Use a good Compiler for example
Cosmic C.
Use a propriety micro it will have fewer erratas, Freescale (Motorola) particularly work on eliminating all erratas on the propriety products. Don't expect the same generic processors like ARM or PowerPC.
Avoid writing anything in assembler, you should not need to. Optimiser within Cosmic, which is normally selected, is impressive both on speed and code size.
Use Lint to check the readability
and function of your code. Don't be put off because it is the oldest
software tool you will ever come across, and quite cheap. I think it is
the by far the best, subset includes MIRSA used by the motor industry.
SPLint is the free version but it is worth buying PCLint.
If there is a disparity between the
compiler and PCLint, and you are certain of that, then suspect the
compiler.
In writing C write your code to be
reusable with switches defined locally and globally.
I have nested C code for a serial port within another file written in
C, in this way the same core code can be RS232, RS485 with turn round
control, have Xon/Xoff flow control, and have modem controls. As far as
I can tell this is not recommended but even so I do recommend doing
this because it makes all the code in all the projects you are running
feel the same.
Useful
links:
http://www.cherryclough.com/
I came across this company at Electronics Weekly sponsored show in June
2009. They have an excellent understanding of EMC issues and solutions.
http://www.gimpel.com/html/ PCLint C programming checker,
http://www.splint.org/ SPLint (Virginia State University - you may come across other interesting projects)
http://www.cosmic-software.com/ A robust C compiler
http://www.freescale.com/ Very good micro-controllers such as HCS12
http://www.st.com/stonline/ ST microelectronics Switch mode power supply ICs including voltage mode (they invented it), Stepper motor drivers.
http://www.nxp.com/ Philips - Switch mode power supply ICs including voltage mode,
http://www.linear.com/ Linear Technology Current mode switch mode power supplies, and design spreadsheets. See LT1072 (obsolete)
http://www.diodes.com/ Zetex design spreadsheets
http://www.coilcraft.com/ High power density wound components and very good design spreadsheets.
My page on Windmill for power generation
I have used the following tools on this page;
* Electronics WorkBench National Instruments - Circuit diagrams.