www.developer.com/java/article.php/1381491
| Introduction to
Java Algorithms in Control Systems By Sione Palu July 8, 2002 IntroductionThere has been a huge support and interests from industries, government agencies, academic institutions for the draft of the RTSJ API, that is the Real Time Specification for Java which had a final release at the beginning of this year, 2002. Companies who have taken interests are the big heavyweight industries in embedded systems and real time computer control. Since RTSJ addressed the issues of the Java language specification which hindered its application in real time systems, I would expect competition from different vendors in this market over the coming years. Since developing software in real time computer control is a little different from data processing development, in this article I will discuss an introductory level to Control Systems engineering with some common algorithm implemented in Java. This is a huge field, and you are encouraged to get some published material (refer Resources), for further self study, if your interests lie in the area of robotics and real time computer control. Concern of Control Systems EngineeringControl Systems Engineering are concerned with understanding segments of their environment, often called systems to provide useful economic products for society. Control Engineering must often consider the control of poorly understood systems such as chemical process systems. The current challenge to Control Systems Engineering is the modelling and the control of modern, complex, interrelated systems such as traffic control systems, chemical processes, robotic systems and industrial automation systems. All the challenges aim to solve control problems that affect the whole of society. Control Systems Engineering is based on the foundations of feedback theory and linear systems analysis. It is an interconnection of components forming a system configuration that will provide a desired system response. Historical Background to Automatic Control SystemsMechanical feedback control systems appeared in Greece from around 300 B.C onward in the development of the float regulator mechanisms. Float regulator mechanisms is still in use today, as in the water tank of the ordinary flush toilet. The first formal study of the "Theory of Control" started in the mid 1860s with a paper published by physicist J.C.Maxwell, the inventor of the theory of "Electro-Magnetism" . Work on the stability of control systems appeared towards mid 1890s by mathematicians notably E.J. Routh and A.M. Lyapunov. These two mathematicians both have their names honoured by the control engineering community with the naming of "Routh Stability Test" and the "Lyapunov Stability Criteria", which is found in almost all literature on control. During the 1930s, H. Nyquist from Bell Telephone Laboratories, applied frequency analysis to control systems design. Around the same time Electronic amplifiers from Bell Telephone appeared. Developed by H.W.Bode, such amplifiers were designed using the concepts of feedback control. From the 1950s onwards, control theory evolved with new mathematical techniques applied and computer technology becoming a substitute for mechanical control or human task oriented control systems. Discipline of Control SystemsControl Systems Engineering is a multi-disciplinary field. It covers areas as, Mechanical Engineering, Chemical Engineering, Electrical & Electronic Engineering, Environmental, Civil, Physics, Economics and Finance, Artificial Intelligence and Computer Science. Control Systems Engineering is still taught in main stream Engineering and Physics courses. Within the last decade or so it has started to appear in Computer Science courses and as post-graduate papers in Real-Time Computer Control. One of the emerging fields of Control Systems Engineering is Financial Engineering Control. This branch of engineering deals with the dynamic modelling of finance and economic systems. The majority of courses in Financial Engineering Control are still taught at post-graduate level in Mathematics, Physics and Engineering. I have not seen many academic institutions on the internet, that teach Financial Engineering Control for MBA courses, and the ones that do have a pre-requisite requiring the candidate(applicant) to have completed courses in theoretical Physics, Mathematics or Engineering. Engineers in Financial Engineering Control use the same models and concepts as feedback and feed-forward control that are found in aircraft control systems or chemical process systems and apply them to financial and economic dynamic systems. Computer Control Systems is one of the most complex fields in control engineering. For example, designing the control systems for a chemical process system would involve different types of engineers from the beginning. A mechanical engineer would specify and design most of the machinery parts and the electrical engineer will figure out how all these complex parts are wired together, what type of sensors and actuators to specify, and also how it all function as a whole. An actuator is a device that provides the motive power to the process, example is a dc motor. The chemical engineer will specify the time reaction of certain chemicals and the optimal temperature and pressure for operations. The software engineer will play the role of integrating all specifications by writing the software that meets the functional requirement of the other engineers. All these engineers, must communicate before and during the whole project, with each and every one understanding the language of Control Systems Engineering. Control Systems design parameters such as process rise-time, peak-time, settling-time, percentage-over-shoot and so on, must be well understood by all engineers involved. Concepts in Control Systems Engineering overlap with concepts in the branch of Physics and Electrical Engineering known as Digital Signal Processing (DSP) and Communication Systems, where analysis is done in frequency domain or time domain exactly as is done in Control Systems. There are disciplines that a DSP or a Communication Systems engineer would also use in designing embedded Real-Time Computer Control Systems. Revising the Mathematics of ControlUnderstanding of complex control systems requires quantitative mathematical models of these systems. Systems under consideration are dynamic in nature. The model descriptive equations are usually differential equations. If non-linearity arises for any model problem, then it has to be linearized before a technique called Laplace Transform from differential equations is applied to the problem. Linearization of model problems is done using a technique in calculus called Taylor Series Expansions. For example, in the dairy industry or liquid chemical processes, all fluid-flow exhibit non-linear flow (when rate of fluid-flow per unit volume is not proportional to time anymore) through (steel) pipes or tubes, at certain cut-off temperature or pressure. Non-linear fluid flow found in these industries is very complex to model where all the control parameters are needed to be simplified during design time. Engineers linearized physical quantity as rate of fluid-flow using Taylor Series so that they can apply Laplace Transform and it becomes easy to manipulate algebraicly.
An example of Laplace Transform is when the input control signal is a sine-wave of the form: f(t)=A*sin(w*t), where "w" is the frequency (units in hertz), "A" is the signal's amplitude (signal's maximum height, usually measured in milli-volts, or milli-amps). The result is shown in Equation 2.
When the response of the control systems to input signal is allowed enough time(infinite) to settle, it is called steady-state or final-value of the output. Estimation of steady-state is vital for accuracy of control systems to some tolerance value (error). In aircraft control, for example, if a sudden change of altitude is caused by a turbulence, the computer will restore the craft to its steady-state quite fast, because the real-time computer systems is tracking non-stop, the craft's current input set-point control parameters such as altitude, attitude and so on. Transfer function of a linear system is defined as the ratio of the Laplace Transform of the output variable to the Laplace Transform of the input variable, with initial conditions assumed to be zero. If you have worked with Photoshop, then you must have come across the concept of transfer function, it is exactly the same mathematics as discussed here. Transfer functions in Photoshop enable you to compensate for dot gain between the image and film. For example, the Transfer function makes 50% dots in the image print as 50% dots on film. The concept of transfer function is widely used is Signal Processing, Electronics, Image Processing and Control Systems.
Knowledge of differential calculus, complex numbers, graph theory, matrix algebra and numerical algorithms are required for Control Systems analysis, design and simulation. You will simulate important control parameters using a computer and, once you are satisfied, the functional requirement is finalized. You, the control systems software engineer, then write the control softwares using the numerical algorithms from the simulations. Block DiagramsDynamic systems that comprise automatic control systems are represented mathematically by a set of simultaneous differential equations. Applying Laplace Transform to the linear differential equations reduces the problem to a set of linear algebraic equations. Since control systems are concerned with the control of specific variables, the interrelationship of the controlled variables to the controlling variables is required. This relationship is represented by the transfer function of the subsystem relating the input and output variables.
The block diagram of Figure 1 above represents a simple negative-feedback (output is feeding to the input, where it is subtracted from the input) control systems. The laplace-transformed function G(s), represents the plant (a physical system to be controlled), and H(s) represents that of the feed-back-gain. Using the methods of block-diagram-transformation (breaking of nested multiple loops into an equivalent simple open loop), the close-loop negative-feedback control systems of figure Figure 1 is reduced to an open-loop control system of Figure 2 below. The opposite of negative-feedback is positive-feedback, where the output is added to the input instead of subtracting. You would have experienced positive-feedback in a rock concert where the performer(singer) is coming close to one of the huge loud speakers with the microphone, which caused a loud high pitch sound. This is because the loud speakers(output) is added to the performer's voice as input to the microphone. Block diagrams for positive-feedback is the same for negative-feedback except that the summer block has two positives (++). When the laplace-transformed function H(s) equals 1 (H(s) = 1), the negative-feedback or positive-feedback control systems is called Unity Gain. Its block diagram representation is exactly the same as in Figure 1, but the block H(s) is removed, leaving just the loop line.
The overall ratio of the laplace-transform of output Y(s) to input R(s) is the transfer function T(s) of the negative-feedback control system of Figure 1. After substitution of functions G(s) and H(s) from Figure 1 into Equation 4(a) with further algebraic manipulation, T(s) is simplified to that in Equation 4(b) shown below.
The block diagram of Figure 1 represents a single-input and a single-output (SISO). The input-output matrix form of Equation 3, represents the general relations of control variables which has multiple-input and multiple-output (MIMO). The MIMO type systems are what you find in large scale control systems as shown in Figure 3 below, with "n" inputs and "m" different outputs.
|
A systems state is described as a set of variables such that the knowledge of these variables and the input functions will, with the equations describing the dynamics, provide the future state and the output of the system. A simple example, is the state of an "on-off" switch. The switch can be in either the "on" or the "off" position, and thus the state of the switch can be assumed to be one of two possible values. If you know the present state(position) of the switch at time to and if an input is applied, you are able to determine the future value of the element.
System responses are categorized into three main excitation(input) signals:
I will only mention Step response here, because of its generality in Control Systems engineering. An example of a step response is Car Suspension Systems. When the car travelling on the road encounters a bump or a hole, the car will experience a shaky vibration (vertical), this type of excitation input (bump) is a step. Mechanical control engineers have designed automobile suspension system with the shock-absorber to restore the steady-state (equilibrium) of the car in a short period of time (around one second time span). The time it takes for the system (car) to reach equilibrium is called settling-time, and it is an important design parameter for all control systems, regardless of whether it is electrical, computer, mechanical, or chemical control. Imagine an automobile where the suspension systems has a long duration settling-time, say 10 seconds. Such an automobile would be uncomfortable to travel in.
The following diagram, Figure 4 is an arbitrary response to a Step Input signal (of constant value of 1), with some of the important control systems parameters clearly labelled.
| Figure 4 |
![]() |
The following control parameters are the time-response specification for any control systems design:
There is an applet at the end of this article, that you may want to open it right now and experiment with optimising control parameters mentioned above by inputting transfer function of a control systems and click plot.
PID controller (Proportional Integral Derivative) is widely used in industrial process control. Its popularity in industry can be attributed partly to their robust performance in a wide range of operating conditions and to its functional simplicity. There are three parameters which must be determined for the given process if it is to implement PID controllers in any control process.
The origin of the PID controller model obviously stems from calculus, as the name suggested. It is exactly the same as it is used in calculus. Its frequency-domain and time-domain representation are shown below as Equation 5 and Equation 6 :
| Equation 5: PID Transfer Function (frequency-domain) | |
| Equation 6: PID Output (time-domain) | |
For example, suppose you have an arbitrary simple input control signal as a sine-wave of the form: r(t) = Sin(t). If this signal passes through the PID controller, the output after applying Equation 6 (PID time-domain) would be: y(t) = KP.Sin(t) - KI.Cos(t) + KD.Cos(t). You can probably see how the Sin(t) function integrates to become -Cos(t) and also the derivative of Sin(t) became Cos(t).
There are a number of different numerical integration algorithms available for numerical computing, but the Runge-Kutta of fourth order (RK4) is commonly used in control systems design, particularly in PID controllers. RK4 is generally used to solve numerical answer to the type of differential equation with initial value as expressed in Equation 7, below. Note that Equation 6 is a variant of the general form, Equation 7:
| Equation 7: General First-Order Initial-Value Differential Equation | |
The following Listing 1 shows the RK4 algorithm:
| Listing 1: (RK4 Algorithm) |
Input_Parameters : boundaries endpoints (double floating) a, b ; integer N ; initial condition (double floating) yo ; Return_Value : approximation of z to y at the (N+1) values of t |
The algorithm in Listing 1, is easy to implement in Java. I have included the algorithm because you may like to implement it slightly differently. RK4 algorithms are found in many differential equations and numerical analysis books (refer resources). This algorithm is also implemented in a free source (GNU) library called JSci (Java API for Science), and also in commercial numerical Java libraries(refer resources). I implement it a little differently from JSci, so that the instruction flow from the algorithm in Listing 1 is easy to follow and also clear to you. Listing 2 is the implementation.
| Listing 2: (RK4 Implementation) |
public interface IntegrableFunction{
public double functionMap(double T, double Z);
}
public class RK4 implements IntegrableFunction{
public double[][] compute(double a,double b,int N,double inVal){
double[][] rVal = new double[2][];
double[] timePoints = new double[N+1];
double[] signalPoints = new double[N+1];
rVal[0] = timePoints;
rVal[1] = signalPoints;
//Step 1, assignment
double h = (b-a)/(double)N;
double t = a;
double z = initialVal;
//initial points
timePoints[0] = t;
signalPoints[0] = z;
//initialize
double K1 = 1.0, K2 = 1.0, K3 = 1.0, K4 = 1.0;
//Step 2, looping
for(int i=1; i<=N; i++){
//assigment
K1 = h*functionMap(t,z);
K2 = h*functionMap(t + h/2, z + K1/2);
K3 = h*functionMap(t + h/2, z + K2/2);
K4 = h*functionMap(t + h, z + K3);
z = z + (K1 + 2*K2 + 2*K3 + K4)/6.0;
t = a + i*h;
timePoints[i] = t;
signalPoints[i] = z;
}//end for
//terminate
return rVal;
}//end method
public double functionMap(double T, double Z){
double val = 1.0;
val = Z - T*T +1; //Implement your own function here.
return val;
}//end method
}//------------ End RK4 Class Definition ---------------
|
RK4 is one of the very useful numerical techniques. It is widely used in scientific and engineering computations. You will find numerous applications of RK4 outside control systems, such as financial modelling, inventory control, signal processing.
There are seven main groups in the process of designing:
| Table 1: Main Groups in the process of designing |
|
If the performance meets specification from step (g) of the list above, then finalize the design, else start from step (d) until control specifications are met.
Equations 5 and Equation 6 are both analog or continuous representations. Since Equation 6 is continuous, modern control use digital controllers. The analog Laplace Transform representation of Equation 5 is converted into discrete form (digital) by using Z-Transformation techniques of Discrete Mathematics. The resulting deriviations and simplifications of the digital controller, are shown below in Equation 8(a) and Equation 8(b).
| Equation 8(a): |
| s(n) = s(n-1) + e(n) |
| Equation 8(b): |
| m(n) = Kp*e(n) + Ki*s(n) + Kd*{ e(n) - e(n-1) } |
| s(n) - error summation from time interval t=0 to t=n*T, where T is sampling time. |
| e(n) - controller error signal |
| m(n) - controller output |
| Kp - controller proportional gain |
| Ki - controller integral gain |
| Kd - controller derivative gain |
Implementing Equation 8 can be a simple task. The following Listing 3 shows the simple digital controller.
| Listing 4: (Basic PID) |
/*
* This class ignores all timing problems and
* practical problems.
*/
public class PIDController{
//Declare an instance variable
//of ADC object (Analog-to-Digital-Converter)
ADC adc ;
//Declare an instance variable
//of DAC object (Digital-to-Analog-Converter)
DAC dac ;
private double Kp_val = 1.0 ; //Proportional Gain
private double Ki_val = 0.7 ; //Integral Gain
private double Kd_val = 0.5 ; //Derivative Gain
private double sn, Kp, Ki, en, en_prev, mn ;
public PIDController(){
//initialize whatever control variables here.
}
public void PIDControl(double EN, double MN){
en = EN; mn = MN;
sn += en;
mn = Kp*en + Ki*sn + Kd*(en - en_prev);
en_prev = en;
}
public void runPID(){
sn = 0;
Kp = Kp_val;
Ki = Ki_val;
Kd = Kd_val;
en_prev = //read data from the adc object.
do{
en = //read data from the adc object.
PIDControl(en, mn);
//convert data to analog using the dac
}
while(NOT_INTERRUPTED);
}
}//------------ End Class Definition ------------
|
The basic PID from Listing 4 ignores several important practical problems, for example, it does not take into account the need to synchronize the calculation of PIDControl method with real-time. The sampling time T is dependent on the speed of operation of the computer on which the program is run. For correct operation some means of fixing the sampling interval is required. Other omissions were :
Once started a typical real-time programs runs continuously until some external event occurs that stops it. Infinite loop programming construct is built in to the program with a terminating condition. The general form is shown in Listing 5 .
| Listing 5: (Real Time Control General Form) |
public class RealTimeControl{
//Declarations go here
public RealTimeControl(){
//Initialization go here
}
public void continuousRun(){
do {
//1) Synchronization
//2) Read Plant Data
//3) Control calculation
//4) Put control data to plant
}
while(NOT_EXTERNAL_EVENT_INTERRUPTION);
}
}//------ End Class Definition ---------
|
Synchronization can be achieved by the followings:
| Listing 6: (Polling Synchronization) |
public void pollingSynchronization(){
while(!digitalInput(sampleTimeSignal)){
//waiting
}
}//end method
public boolean digitalInput(Object sampleControlSignal){
boolean val;
//process sampleControlSignal logical signal
//object here and assign val a boolean value.
return val;
}
|
The boolean method, digitalInput reads the appropriate logical signal, from the plant interface which it has been processed. When pollingSynchronization() method is called the computer waits in the WHILE loop until digitalInput method returns a true value. No other computation can be carried out while the computer is waiting. This is called busy wait. Polling synchronization is easy to design and implement, but because of its busy waiting, its use is restricted to small dedicated control systems.
Plant signals are collected through sensors or transducers in which physical stimuli are converted to electrical signal. For example, a fluctuation of pH level in a chemical process is converted into an analog electrical signal in real time. The signal is further processed and converted to digital form (digital signal processed) by an ADC (analog-to-digital Converter). The processed signal is then relayed from the plant to the control systems application. The whole process of signal processing, relaying to and from the plant, ranges from microseconds and milliseconds for fast response systems to seconds and minutes for systems which require longer response time.
Ballast coding makes the loop time completely dependent on the internal operations of the computer and independent of external timing or synchronization signals. This synchronization type minimises the amount of external hardware required and is thus cost effective for systems that are to be produced in large quantities.
External interrupt is associated with a particular line, and this line is activated by some external device, like a clock. While the control loop is waiting to be activated, other tasks or programs can be running.
The problem of timing a control loop is provided by adding a real-time clock to the computer systems. The provision of real-time clock involves the addition of some hardware components and some software. A timer can be implemented using RTSJ (Real Time Specification for Java) API as shown in Listing 7.
| Listing 7: (Timer) |
import javax.realtime.*;
public class TimerExample {
//set for 20 milliseconds
private long sampleTimeInterval = 20 ;
private PeriodicTimer pTimer ;
private RelativeTime interval;
private Clock realTimeClock ;
public TimerExample(){
realTimeClock = Clock.getRealtimeClock();
//relative sample interval of 20 milli-sec
interval = new RelativeTime(sampleTimeInterval, 0);
//instantiate a periodic-timer according to a
//real-time clock
pTimer = new PeriodicTimer(realTimeClock.getTime(),
interval,
realTimeClock,
new EHandler() );
//start timer
ptimer.enable();
ptimer.start();
}
public AbsoluteTime getClockTicks(){
realTimeClock.getTime();
}
/*
* Return the next sampling time, that is schedule
* for pTimer object to fire an AsyncEvent .
*/
public RelativeTime getNextSampleTime(){
return pTimer.getFireTime();
}
public void setSampleTimeInterval(long t){
sampleTimeInterval = t ;
interval = new RelativeTime(t, 0);
pTimer.setInterval(interval);
}
}
class EHandler extends AsyncEventHandler {
private int externalCount = 0;
/** Interrupt handler method. */
public void handleAsyncEvent() {
externalCount++;
//specific driver code.
}
}
|
The following sample code, shown in Listing 8, is a real time clock control loop. It uses a busy wait in the control loop of the method realTimeClockSynchronisation( ). During the busy wait the timer continually checks the current time against next sample time and when the current time exceeds, the busy wait exits to do other tasks as reading plant input, control calculation and so on. Since the method will run an infinite loop, the new cycle starts again and new busy wait is encountered, this goes on till some external interruption occurred.
| Listing 8: (Real Time Clock Synchronization) |
public class ClockRealTimeControl{
//instantiate a timer
private TimerExample timer = new TimerExample();
/*
*This method will run an infinite loop until an
*external event interruption takes place.
*/
public void realTimeClockSynchronization(){
do{
while(timer.getClockTicks().getMilliseconds() <
timer.getNextSampleTime().getMilliseconds())
{
//waiting and do nothing
}
//1. get plant input
//2. control calculation
//3. put plant output
}
while(NOT_EXTERNAL_EVENT_INTERRUPTION);
}//end method
}//--------- End Class Definition -----------
|
This the transfer of control from manual to automatic. From Equation 8(b), it implies that in the steady-state, with zero error, the controlled variable m(n) is equal to the value of the integral term , Ki*s(n) . Ideally in the steady-state with zero error it is needed that the integral term to be zero, which mean that m(n) is also zero. In some applications the steady-state operating conditions require that m(n) has some other value than zero. It is normal practice to modify Equation 8(b) by adding a constant term (M) representing the value of the manipulated variable at the steady-state operating point. Modification is shown by Equation 9.
| Equation 9: |
| m(n) = Kp*e(n) + Ki*s(n) + Kd*{ e(n) - e(n-1) } + M |
If M is omitted and integral action is present, the integral action term, Ki*s(n) will compensate for its omission but there will be difficulties in changing smoothly, without disturbance to the plant, from manual to automatic. Bumpless transfer can be achieved by different methods.
| Equation 10: Velocity PID (time-domain) | |
![]() |
| Equation 11: Velocity PID Algorithm in Digital form | |
In the real world, control signals may be noisy (unwanted signals) and it may also require the application of a calibration factor. Since noise is unavoidable in the real world, signal filtering techniques are applied to real time computer control systems. In many industrial applications, a simple first-order low pass filter is satisfactory. The choice of filtering frequency will reduce the aliasing effect by about 90%.
One of the most advanced filtering technique of today in modern control is called Kalman filter. This filter type can eliminates the noise in the control signal and reconstruct the original signal with no distortion. Interestingly, Kalman filter has been incorporated into business intelligence software within the last six years or so. It has been used to great success in predicting financial time series, forecastings, datamining and so on. Kalman filter has been employed in Signal Processing and Control Systems in the last two decades, it is only recent that business analysts adopt the algorithm for business analytics.
In implementing and designing real controllers, the characteristics of the actuators used to control the process are important. The normal practice is to take the value of the manipulated variable m(n) from Equation 11 as the input to the actuator control module.
In all computations in the computer as in digital filtering, analog-to-digital, digital-to-analog, control variable calculation all take a finite amount of time. There is a difference or computational delay between sampling the plant output and changing the value of the actuator. It is normal to take computational delay into account by including the delay as part of the plant model.
System sensitivity is defined as the ratio of the percentage change in the system transfer function to the percentage change of the process transfer function. A process represented by the transfer function G(s), is subject to a changing environment. In a closed feedback system senses the change in the output due to the process changes and attempts to correct the output. A good control systems is the one which withstands or does not significantly change when there is a disturbance to it. Therefor a good sensitive systems is a good disturbance rejector.
In considering the design and analysis of feedback control systems, stability is of utmost importance. A stable system is defined as a system with a bounded(limited) system response. That is if the system is subjected to a bounded input or disturbance and the response is bounded in magnitude, the system is regarded as stable. An example of an unstable systems, is when the output signal keeps growing or its amplitude increases over time.
The followings are some examples of modern control from thousands of different applications. Use this applet, if you wish to design important control parameters, as rise-time, settling-time, overshoot, peak-time. Iterate through the design process using the steps from Listing 3 to determine control optimal parameters.
| Figure 5 |
![]() |
| Equation 12: Anaesthesia Transfer Function | |
![]() |
The concept of control algorithm, such as PID is the same for all control systems, whether it is a patient blood pressure monitoring, a washing machine, automobile suspension systems or an aircraft automatic flight control. The difference lies mainly in the scale of the control systems. MIMO type would involve control parameter tuning, and some complicated filtering algorithm to built such system. In comparison to small embedded systems as a dish washer, the algorithm implementation can be as simple as has been shown in all previous listings in this article.
Expert Systems applications have been used in automation and control industries over the last decade. The Expert Systems replace human operators in some complicated control tasks. In fact it is the knowledge of the human operator that use to build the knowledge of the Expert Systems. Neural Network is used to self-tune controllers (adaptive control), so that the systems can response to unpredictable stimuli so that the control software is well prepared for any unexpected disturbance. Fuzzy Logic Controllers (FLC) have been used extensively in control systems. Fuzzy Logic comes in handy, when the control problem is becoming too complex or ill-defined systems that are not easily subjected to conventional automatic control methods. In other words there is just no algorithmic way to solve the control problem. FLC provide a feasible alternative since they can capture the approximate, qualitative of human reasoning and decision-making processes. However FLC is not adaptable, so a hybrid systems is used such as NeuroFuzzy control. This is a combination of Neural Network and FLC.
The applet that comes with this article, is to help you design important control parameters and get optimum values that satisfy the goal of the control systems. Once the optimum parameter values are achieved, then proceed to implementing the algorithm in Java. Use the javax.realtime for implementing test classes, you may want to experiment with. The applet is easy to use, where the numerator textboxes are the coefficients of the Transfer Functions numerator polynomial. The same is applied to the denominator textboxes. If you, want to test the applet before you want to use it, then try the following second order control systems transfer function. First example, Numerator = [0, 0, 0, 1], Denominator = [0, 0.5, 0.3, 1]. Second example, [0, 0, 0, 1], Denominator = [0, 0.5, 1, 1] . Enter the numbers from left-to-right as the order of textboxes. Click on the button named "Plot" to draw the step response. To read the coordinates on the graph, check the checkbox named "Coordinate-Mouse Click", and the cursor will change to cross-hair so that you can click on any point on the graph. All clicked points will be displayed on a text-area on the left. The applet is not, for complicated design of MIMO type systems, it cannot handle those. There are other appropriate commercial tools which are excellent for algorithm design of the large scale control systems, such as MatLab from MathWorks and Mathematica from Wolfram Research Inc. These tools have Java support, where you can call their routines from a Java application or vice versa. MatLab and Mathematica are standard in most tertiary institutions such as universities Engineering, Physics and Maths department around the world. If your machine does not have Java2 JRE, you will be directed to Sun's site to download the plug-in to be able to run the applet.
In this article, I have described the introductory level to the background of control systems. I have also introduced some common algorithms for real time control systems and basic implementations in Java. The javax.realtime API from JSR-1 has just been released earlier this year and in my opinion, there will be a huge interest in the embedded systems and computer control industries for application development in Java. In the paradigm of control systems software design, it is a secondary importance for the language of choice to use for development of computer embedded control applications. The primary important factor is the understanding of modelling of control system parameters. C is still the popular language for developing real time computer control applications and embedded systems, but I see that Java will overtake in coming years. My prediction is based on the massive interest from companies that develop embedded systems and computer control related application softwares. There were over a hundred participants at the National Institute of Standards and Technology workshop for Real Time Java. To name a few, participants were from heavyweight in aerospace industries such as Lockheed-Martin and Rockwell, Motorola, Nortel Networks and Lucent from telecommunications and electronics.
Downloads (RTSJ) Reference Implementation:
Sione Palu has developed software for Publishing Systems, Imaging, and Web Applications. Currently, Palu develops (Swing-based) his own software application in Symbolic Algebra Systems with Visualization Mathematics for high-school level. Palu graduated from the University of Auckland, New Zealand, with a science degree in mathematics and computing. He has a personal interest in applying Java and mathematics in the fields of mathematical modelling and simulations, symbolic AI and soft-computing, wavelets, digital signal processing, and control systems.