2ObjectivesTo explain the concept of a real-time system and why these systems are usually implemented as concurrent processesTo describe a design process for real-time systemsTo explain the role of a real-time operating systemTo introduce generic process architectures for monitoring and control and data acquisition systems
3Real-time systems Systems which monitor and control their environment Software system where the correct functioning of the system depends on the results produced by the system and the time at which these results are producedSoft real-time systemOperation is degraded if results are not produced according to the specified timing requirementsHard real-time systemOperation is incorrect if results are not produced according to the timing specificationInevitably associated with hardware devicesSensorsCollect data from the system environmentActuatorsChange (in some way) the system’s environmentTime is criticalReal-time systems MUST respond within specified times.
4Question 1Explain why an object-oriented approach to software development may not be suitable for real- time systems.
5Design process of real-time systems Identify the stimuli to be processed and the required responses to these stimuliFor each stimulus and response, identify the timing constraintsAggregate the stimulus and response processing into concurrent processesA process may be associated with each class of stimulus and responseDesign algorithms to process each class of stimulus and responseThese must meet the given timing requirementsDesign a scheduling system which will ensure that processes are started in time to meet their deadlinesIntegrate using a real-time operating system
6Real-time operating systems (real-time executives) Real-time clock. Provides information for process scheduling.Interrupt handler. Manages aperiodic requests for service.Scheduler. Chooses the next process to be run.Resource manager. Allocates memory and processor resources.Despatcher. Starts process execution.Figure 15.4 Components of a real-time operating system
7Monitoring and control and data acquisition systems Monitoring systems examine sensors and report their resultsControl systems take sensor values and control hardware actuatorsAcquisition systems collect data from sensors for subsequent processing and analysis
8Question 2Draw a state machine model of the control software of a compact disk player. States include:IdleReadyDoor closeDoor openReady to playDisk playingTrack selecting
9Question 3A train protection system automatically applies the brakes of a train if the speed limit for a segment of track is exceeded or if the train enters a track segment that is currently signalled with a red light (i.e., the segment should not be entered). Details are shown in Figure Identify the stimuli that must be processed by the on-board train control system and the associated responses to these stimuli.If a periodic process in the on-board train protection system is used to collect data from the trackside transmitter, how often must it be scheduled to ensure that the system is guaranteed to collect information from the transmitter? Explain how you arrived at your answer.
10Figure 15.4 Components of a real-time operating system Question 3 (cont’d)The system acquires information on the speed limit of a segment from a trackside transmitter, which continually broadcasts the segment identifier and its speed limit. The same transmitter also broadcasts information on the status of the signal controlling that track segment. The time required to broadcast track segment and status information is 50ms.The train can receive information from the trackside transmitter when it is within 10m of a transmitter.The maximum train speed is 180kph.Sensors on the train provide information about the current train speed (updated every 250ms) and the train brake status (updated every 100ms).If the train speed exceeds the current segment limit by more than 5kph, a warning is sounded in the driver’s cabin. If the train speed exceeds the current segment speed limit by more than 10kph, the train’s brakes are automatically applied until the speed falls to the segment speed limit. Train brakes should be applied within 100ms of the time when the excessive train speed has been detected.If the train enters a train segment that is signalled with a red light, the train protection system applies the train brakes and reduces speed to zero. Train brakes should be applied within 100ms of the time when the red light a signal is received.The system continually updated a status display in the deriver’s cabin.Figure 15.4 Components of a real-time operating system