< Day Day Up > |
9.7 Summary
In this chapter, I discussed the final steps in the embedded control system development process. Beginning with a linear controller design developed with the methods shown in previous chapters, it is often necessary to add nonlinear features such as limiting and gain scheduling. These elements compensate for nonlinearities within the plant and variations in the operational environment. It might also be necessary to modify the linear plant model by including a Padé time delay approximation if the control algorithm execution time is a significant portion of the sampling interval h.
Following the completion of the controller design, it is necessary to implement the design within the constraints of the embedded system software environment. The software environment can consist of anything from no operating system at all to a sophisticated multitasking real-time operating system.
With no operating system and no requirement to perform additional tasks other than the controller function, the simplest control system implementation is to initialize the controller and then execute a loop at timed intervals, as shown in Figure 9.3. On each pass through the loop, the processor reads the controller inputs from the sensors, executes the controller algorithm, and writes the outputs to the plant actuators.
When using a multitasking operating system, the controller software should be separated into an initialization function and an update function. The initialization function sets up the controller state and schedules the update function for execution at the sampling rate. On each execution, the update function reads the sensor inputs, computes the controller algorithm, and writes the actuator outputs.
When the implementation of the embedded controller has been completed, it is necessary to perform thorough testing to ensure correct operation of the system under all conditions. Two fundamental types of system testing were described in this chapter: system simulation and operational testing.
System simulation testing exercises a software model of the embedded system under simulated test conditions. To produce meaningful results, the simulation must have undergone a process of verification and validation. Verification demonstrates that a simulation has been implemented according to its specifications. Validation shows that the simulation is a sufficiently good representation of the real-world system it attempts to simulate. Given a valid simulation, thorough system testing can be performed quickly and inexpensively. Simulation also allows the testing of dangerous conditions in which the actual system would never intentionally be placed.
Operational testing exercises the actual system in its intended operating environment. This is the most realistic type of testing available. Sufficient data must be recorded during each test to understand the significant aspects of the system's behavior and its interaction with the surrounding environment. However, operational testing can be a slow and expensive way to collect test data. It can also be difficult to perform tests repeatably when operating in the uncontrolled environment of the real world.
For many development projects, the most cost-effective approach for system testing is to combine simulation testing with operational testing. One of the primary goals of the operational tests should be to provide data for simulation validation. With a validated simulation, additional testing can be performed much faster than equivalent operational tests and at comparatively low cost.
No comments:
Post a Comment