Friday, June 29, 2012

Capacity focus, 52: Reforming ICT education, to equip people for productivity in the digital control and digital communication age

I am convinced that ICT education has to be transformed to equip people to be productive in the age of digital control systems and digital communications. "How to play with Wintel machines using MS Office applications such as Word, Excel and Powerpoint" is no longer nearly good enough. As was discussed here at KF recently, that is going to call for education in programming in realistic languages, and it is going to call for being able to work with interfacing, networking and signal processing.

A tall order, but if we are to be competitive in the days ahead, one we have to figure out a way to fill.

Let me speak in the context of the proposed AACCS, assuming that students will have been introduced to computer programming, and are now looking at an interfacing and control course, with things like robots or drip irrigation systems in mind. (Let's hold on networking for now. One slice of a cake has in it all the ingredients.)

The host and target architecture of such a system can be laid out in a diagram, such as:

A host and target interfacing and control system
In this system, the controlled "plant" is monitored by using an array of sensors. The sensor outputs are then processed through instrumentation and are fed back to a digital controller. At some stage, analogue -- smoothly varying -- signals are converted into digital ones, suitable for a digital controller. 

The sensed performance of the plant is then compared to the intended one for that time, and the gap between the two is used to drive controller action. 

The controller puts out a control signal that then drives the plant through power amplifiers, actuators and effectors, the latter perhaps mounting tools. Somewhere in that forward path, if an analogue control signal is needed, there will be digital to analogue conversion. 

Sometimes, though, a digital -- stepwise, discontinuous -- signal is what we need, e.g. turn the power switch on. Such switches are on or off, and there is no relevant intermediate state. 

(In general, a real world controller will need to do both types of control. There is a discrete sequence of steps to be taken: discrete state control, and there may be set values or paths that must be followed smoothly in the face of disturbances, component wear and drift, etc: process regulation or servo-system control. [A car's power steering is a common servo-system, and the float ball level controller in a toilet tank is a familiar process regulator. The flush of course is a massive disturbance, but a desired one, and the float ball controller refills to a controlled level!])

Students, then, should be familiar with the control loop, and with the various elements and components that go into it: plants, sensors, instrumentation, controllers, actuators and effectors. Simple robots and drip irrigation systems are excellent exemplars for that. 

We thus need to become sufficiently familiar with these technologies and how to hook them up together to get  a functioning system.

Something else lurks.

The controller is carrying out digital processing of signals. 

A way to begin to understand that without getting lost in the forest of complex mathematics, is to understand the action of the three basic digital signal processing elements:
Basics of digital signal processing (HT Wiki for the handy simple filters used)

Here, we can see that by combining unit-period delay, gain and summing elements, we can carry out quite sophisticated processing of digital signals. But, the process of sampling, processing through combining networks (esp IIR ones) and so forth have effects on how the signals behave. For instance, if we look back up at the control loop, we can see that we are feeding back the output to affect the input. That means that the system can end up feeding itself and starting to oscillate or it could drive itself hard to a limit, perhaps damaging components. Feedback can introduce instability.

Not good.

That also means that we need to understand how forces and elements that store energy (e.g. if you lift a weight, you store energy in it that can come back out when it falls) tend to act across time, and we need to see how loops create gain and phase shifts that can trigger oscillations. (This is a major headache in control engineering.)

A simple way to look at this, is to see z as a variable that has two perpendicular components, Re-Z and Im-Z. These terms mean real and imaginary, for reasons tracing to the origins of so-called complex numbers. The imaginary component is based on the imaginary square root of minus one, a very useful trick in mathematics. The best way to view Z is to see that it is a composite number, where the real and imaginary parts are like x and y axes respectively. 

Then, we can look at how the transfer function -- a measure of the relationship between output and input -- behaves in the z plane. It turns out that the transfer function, H(z) is normally a ratio of two polynomials: 

H(z) = P(z)/Q(z)

As well all know from high school, polynomials can be factored and this gives rise to roots, where the polynomial's value goes to zero. Obviously, if P(z) is zero, H(z) must be zero. These are the zeros of H. 

But also, Q can go to zero, forcing H to infinity!

These last  -- for reasons we will shortly see -- are called the "Poles" of H.

The poles and zeros of H control the behaviour of a system when an input X(z) is given. For, in the z-domain, output Y(z) = H(z) x X(z). [These are related to the signals we can see in the time domain, y(t), and x(t), by some sophisticated math. But we can think of all of this as a way to turn that math into algebra in the z domain. Similar to how logarithms used to be used to simplify arithmetic in the days before digital calculators became commonplace.]

The magic trick is to imagine that the z-plane is covered by a thin, flexible, stretchy but heavy rubber sheet. Zeros pin it to the plane, and poles stick up under it. And, it turns out that if we cut a circle of unit radius centred on the origin where z = 0, the cross section going around the circle gives us the system's frequency response. 

That it, it tells us how it would behave in response to sine wave signals of varying frequency, up to the limit imposed by the sampling and digitising process. 

Phase-shifting of the sinusoids is also related to the gain behaviour, and so we can spot where there may be problems, as well as see how the system will behave in general. Just what we need for design and testing work.

All of this can be pictured:

The rubber sheet, showing how z-plane poles and zeros drive system response
In short, design boils down to manipulating the heavy rubber sheet. (Easier said than done, but the software that shows the picture helps! Cf this short primer on design, noting the onward linked book. This intro on DSP will also help. This is a full bore textbook on DSP.)

One more thing.

Rigol DS 1052E, US$ 329 - 400 or so, 50 MHz digital 'scope
The issues of time and frequency domain should make the significance of test instrumentation plain.The oscilloscope helps us see what is happening in time, the Fast Fourier Transform driven spectrum analyser helps us see the frequency domain (including frequency response and across-time frequency behaviour), and the logic analyser allows us to inspect the sequence of logic states.

As the Rigol DS 1052E shows, the cost to acquire a reasonable test bench  unit has come way down. 

The sound card type software oscilloscope looked at previously is also worth looking at for more basic work, noting that most control type signals are well under 10 kHz. In fact, the more significant challenge may be to use chopper stabilisation techniques to bring a slowly varying, low amplitude signal into a domain where it can be more easily and accurately processed.

We can thus see a framework for digital productivity emerging, that brings familiarity with ICTs to the table, joins to it programming and interfacing, and applies this to real world productivity.

The challenge is to flesh these ideas out into a reasonable course sequence.

And, given the need to move beyond digital consumption to productivity, the issue is not whether something like that is needed. It is HOW can we do it successfully.

For that, I hope the above is a first, modest step. END