Real-Time Task Scheduling Design for Avionics Relay System

Follow us for free subscription to avionics news.

Real-Time Task Scheduling Design for Avionics Relay System

Abstract

This paper studies the priority allocation methods for multitasking in single-processor embedded real-time systems. Firstly, the Deadline Monotonic (DM) priority allocation method is selected to allocate priorities for the tasks designed for the avionics relay system’s data acquisition and stimulus software. Then, the schedulability theory analysis and calculation of the task set are performed using VxWorks’ priority preemptive scheduling algorithm. A general scheduling design process for data acquisition and stimulus software based on VxWorks is provided. Finally, data forwarding experiments are conducted on the avionics relay system based on this scheduling algorithm. The experimental results indicate that the maximum delay time for data forwarding in the avionics relay system does not exceed 3.5ms, enabling stable and correct forwarding of four types of data. Therefore, the task scheduling design of the avionics relay system based on the DM priority allocation preemptive scheduling algorithm meets the requirements for real-time performance and reliability.

Keywords

Avionics System; Relay; Real-Time Scheduling; Priority Allocation

Real-Time Task Scheduling Design for Avionics Relay System

Real-Time Task Scheduling Design for Avionics Relay System

1 Introduction

In recent years, large aircraft research projects tend to be collaborative, requiring participation from many research units. The research work on civil aircraft avionics systems often requires distributed design due to the complex structure of avionics systems. Therefore, there is an urgent need to design an avionics relay system with relay functionality that can collaboratively connect distributed components or models. This system operates multiple terminals in a single-processor multitasking system and can perform collaborative data interaction with real aircraft devices or models through the terminals.

The real-time system development and design for aircraft systems have very high requirements for real-time performance. Therefore, the multitasking system of the terminals must be a real-time system. The real-time performance of a real-time system depends on appropriate task scheduling strategies. Research results on efficient task scheduling strategies are abundant. Wu Wei et al. proposed a stable saturation allocation algorithm; Xing Jiansheng et al. proposed a minimal priority allocation algorithm; ALLAH et al. compared and analyzed existing monotonic rate schedulability testing methods, emphasizing the internal mechanisms of schedulability testing both theoretically and experimentally; AUDSLEY et al. studied the schedulability testing of mixed periodic and aperiodic tasks, proposing sufficient and necessary tests for schedulability under deadline monotonic scheduling; AUDSLEY et al. also discussed the application of DM scheduling theory, outlining basic pseudo-polynomial schedulability testing methods, providing alternatives for engineering designers, and assisting in theoretical proof for system implementation. Among these, the Deadline Monotonic (DM) priority allocation method is a static fixed priority allocation method with advantages of high stability, strong predictability, simplicity, ease of implementation, and low system overhead. Therefore, in accordance with the design requirements of the avionics relay system, this paper selects the DM priority allocation method for the multitasking priority allocation of the terminals.

After determining the priorities of the task set, the scheduling problem must also be addressed. This paper chooses the priority preemptive scheduling method of the VxWorks kernel to schedule the avionics relay tasks according to the assigned priorities, and then conducts schedulability calculations based on schedulability analysis theory, ultimately implementing the scheduling design in software.

Real-Time Task Scheduling Design for Avionics Relay System

1.1 Task Model

The multitasking environment of the real-time system is modeled as a task set S containing n tasks, that is,

Real-Time Task Scheduling Design for Avionics Relay System

where: Ci is the task execution time; Di is the task deadline; Ti is the task period; Pi is the task priority value, Pi=0, 1, 2, …, n, where a smaller Pi indicates a higher priority, and conversely, a larger Pi indicates a lower priority. The parameters Pi in the task model are determined based on one or several of the other parameters Ci, Di, Ti according to the corresponding task allocation algorithm.

In the scheduling algorithm based on priority allocation, this paper makes the following assumptions: 1) At any moment, the highest priority ready task is allocated to the processor; 2) The time cost of task preemption can be ignored; 3) Tasks are independent, and the requests of each task do not depend on the start or end of other task requests; 4) Each task priority is unique; 5) The task model is a discrete time model; 6) The interval between two arrivals of the same task is at least Ti, that is, periodic tasks; 7) Tasks can mutually exclude access to shared resources.

1.2 Priority-Based Preemptive Scheduling

VxWorks supports the priority preemptive scheduling algorithm. The priority preemptive scheduling algorithm assigns the processor to the highest priority ready task based on the set task priorities. If the kernel detects that a task with a higher priority than the current task becomes ready, it immediately saves the context of the current task, changes its state to ready, and inserts it at the end of the corresponding task queue according to its priority, while switching to the context of the higher priority task for execution.

1.3 Schedulability Analysis

To apply the DM priority allocation method in an engineering environment, it is necessary to determine the schedulability of the real-time system task set. The schedulability condition for a real-time task set containing only two tasks is

Real-Time Task Scheduling Design for Avionics Relay System

where Ii is the interference encountered by task τi between its start and deadline, attributed to the execution demands of higher-priority tasks, i.e., the occupation of the processor by higher-priority tasks is interference to lower-priority tasks. Obviously, the highest priority task runs first, with no tasks occupying the processor before it, thus, I1=0. When i>1, the value of Ii is

Real-Time Task Scheduling Design for Avionics Relay System

Real-Time Task Scheduling Design for Avionics Relay System

2 Avionics Relay System Task Characteristics

The avionics relay system terminal runs on the VxWorks real-time operating system, belonging to a single-processor real-time system. When multiple types of avionics data are relayed simultaneously, the terminal software must implement functions such as network communication control, control of various data boards, and reflective memory forwarding control, which requires breaking down the functions into specific tasks based on the characteristics of the real-time system. The real-time performance of the real-time operating system application software largely depends on task real-time scheduling. Before task scheduling, task partitioning, priority allocation, and schedulability determination are all very important.

2.1 Task Partitioning

Task partitioning often faces a contradiction between increasing system switching overhead due to too many tasks and reducing system parallelism and real-time performance due to too few tasks. Therefore, this paper follows the following principles for task partitioning of the terminal system: 1) Time criticality; 2) High computational load; 3) Functional cohesion; 4) Temporal cohesion; 5) Periodic execution.

Thus, through in-depth analysis of the time characteristics, computational load, and periods (initialization tasks are not subject to periodic constraints) of the terminal software, tasks are created based on the above principles: 1) System initialization module task, which initializes system resources, sets clock frequency, starts network control communication, and starts reflective memory read/write; 2) Network control communication task, which receives control commands from the configuration management system and controls the initialization, start, and stop of the relay network; 3) Data board initialization module task, which initializes ARINC429 boards, CAN bus boards, discrete boards, and serial bus boards; 4) Reflective memory card initialization task, including initializing the reflective memory card hardware resources and initializing FIFO area data; 5) Reflective memory read/write task, which writes and reads reflective memory data, performs reflective memory data forwarding and writing operations; 6) ARINC429 board data acquisition and stimulus task, which collects ARINC429 data and performs ARINC429 data stimulation; 7) CAN bus board data acquisition and stimulus task, which collects CAN data and performs CAN data stimulation; 8) Serial bus board data acquisition task, which collects RS422 data, as the serial bus board’s acquisition task is blocking mode, it continues execution only after receiving valid data or timing out, which affects the sending of stimulus data, thus, two tasks are created for the serial bus board; 9) Serial bus board stimulus task, which stimulates RS422 data; 10) Discrete board data acquisition and stimulus task, which collects discrete data and performs discrete data stimulation.

2.2 Priority Allocation

Based on the deadline parameters of the avionics relay system tasks and specific allocation algorithms, the priorities of these tasks are allocated. Based on the data transmission delay of optical fibers and the execution time of reflective memory network hardware found in the literature, the deadline for the reflective memory read/write task is set to 0.02ms. The data transmission rate of ARINC429 in the avionics relay system is 12.5Kibit/s, and one frame of ARINC429 data is 32 bits. By calculation, the transmission time of one frame of ARINC429 data is 2.56ms, thus, the deadline for the ARINC429 board data acquisition and stimulus task is set to 2.56ms. Similarly, the deadlines for the serial bus board data acquisition task and the serial bus board stimulus task are both set to 0.833ms, the deadline for the discrete board data acquisition and stimulus task is set to 0.05ms, and the deadlines for the CAN bus board data acquisition and stimulus tasks are set to 1.016ms.

The priorities of the terminal system tasks are determined based on the DM priority allocation method. The DM priority allocation method stipulates that the shorter the deadline of a task, the higher its priority. The Wind kernel supports 256 priorities, ranging from high to low as 0-255. Generally, system tasks correspond to 0-50, driver tasks correspond to 51-99, and user application tasks correspond to 100-255. Therefore, the priority allocation of terminal periodic tasks is shown in Table 1, where the initialization task and control communication task do not affect schedulability.

Real-Time Task Scheduling Design for Avionics Relay System

2.3 Schedulability Determination

Based on equations (6) and (7) and the task parameters, calculations are performed to determine whether the task set is schedulable. The calculation results are shown in Table 2. All values in the table are approximations, and Ti and Ci are set according to functional requirements. The results indicate that the priority preemptive scheduling based on the DM priority allocation method is schedulable for this task set.

Real-Time Task Scheduling Design for Avionics Relay System

The scheduling logic for the avionics relay periodic tasks is shown in Figure 1, where the vertical lines represent task preemption of processor execution. For convenience in drawing, the processor’s idle time is minimized.

Real-Time Task Scheduling Design for Avionics Relay System

As shown in Figure 1, after the system starts running, all tasks trigger at the beginning, with task τ1 having the highest priority and preempting the processor for execution. Then, tasks τ2 to τ6 are executed in order of priority from high to low, until task τ1 preempts the currently executing task τ6 in its next cycle. After task τ1 completes execution, task τ6 continues execution. There is idle time for the processor before the next cycle of other tasks. At 2ms, tasks τ1 and τ2 are triggered simultaneously again; at this moment, task τ1 preempts the processor for execution again, and after its execution ends, task τ2 executes next. This continues, and all tasks in the avionics relay system can complete execution before their respective deadlines, theoretically achieving the scheduling objectives.

Real-Time Task Scheduling Design for Avionics Relay System

3 Function Implementation

Taking the ARINC429 data forwarding function of the avionics relay system as an example, this function is mainly implemented by the reflective memory read/write task, ARINC429 board data acquisition and stimulus task, and other initialization tasks, with different tasks completing mutual communication through binary semaphores during the design process.

Firstly, a global structure variable for ARINC429 is defined, where the ARINC429 data from each channel FIFO of the ARINC429 board is read into this structure variable for caching. Secondly, the reflective memory read/write task reads this cached data from the global structure variable and stores it in the corresponding address of the reflective memory. Then, the reflective memory read/write task writes this data back to the local global structure variable from the same address in the network’s reflective memory. Finally, the ARINC429 acquisition and stimulus task writes this data from the local global structure variable into the corresponding channel FIFO cache of the local ARINC429 board, and the board driver sends the data. The data acquisition and stimulus process is shown in Figure 2, while the scheduling flow of the system task set is shown in Figure 3.

Real-Time Task Scheduling Design for Avionics Relay System

Real-Time Task Scheduling Design for Avionics Relay System

Real-Time Task Scheduling Design for Avionics Relay System

4 Experimental Analysis

This mainly conducts experimental analysis of the correctness and delay measurement of data forwarding.

1) Data forwarding correctness measurement. The avionics relay system starts running, and all terminals synchronously forward data of four types across all their channels, that is, the data sources synchronously send data to the terminals. During the long-term stable operation of the system, measurement tools are used to repeatedly detect the forwarded output data of different channels of CAN bus data, ARINC429 data, discrete data, and serial bus data. The results indicate that the data forwarded by the avionics relay system is correct.

In one measurement, the recorded ARINC429 data is shown in Figure 4, where the CHA channel TX indicator light is on, indicating that the ARINC429 transceiver is sending data, and the RX indicator light is on, indicating that the device is receiving data. As seen in Figure 4, the data displayed on the TXLIST sending end, 0x9100840A, is consistent with the data displayed on the receiving end in the upper left corner, 0x9100840A.

Real-Time Task Scheduling Design for Avionics Relay System

2) Data forwarding delay measurement. The four types of data are still set for synchronous forwarding, and oscilloscopes are used to measure the delay of the system’s output of CAN data, serial bus data, ARINC429 data, and discrete data multiple times, with the delay measurement values taken as averages, as shown in Figure 5. As seen in Figure 5, the delay for ARINC429 data forwarding does not exceed 3.5ms, the delay for CAN data forwarding is about 1.5ms, the delay for serial bus data forwarding is around 1.2ms, and the delay for discrete data forwarding does not exceed 0.2ms. Therefore, the experimental results indicate that the maximum delay for data forwarding in the system does not exceed 3.5ms, meeting the real-time requirements, which refer to a few milliseconds of data forwarding delay.

Real-Time Task Scheduling Design for Avionics Relay System

The DM stable saturation allocation method and the minimal priority allocation algorithm are not suitable for VxWorks application development. Combining DM priority allocation with VxWorks’ priority preemptive scheduling can fully leverage the advantages of VxWorks development. ALLAH primarily studies schedulability testing theory but has not combined it with practical application development, leading to a lack of clear guidance for specific engineering projects. AUDSLEY mainly provides theoretical proof of schedulability but lacks a concrete development process illustration for pseudo-polynomial schedulability testing applications. The avionics relay system terminal application development provides a complete example from allocation methods to scheduling algorithms, to scheduling design, schedulability theoretical analysis, and finally to application implementation, offering a more intuitive reference for engineering development of real-time operating system applications.

Real-Time Task Scheduling Design for Avionics Relay System

5 Conclusion

This paper studies the priority allocation algorithms for single-processor real-time systems and combines them with priority preemptive scheduling methods, selecting the deadline monotonic priority allocation preemptive scheduling strategy to schedule tasks for the avionics relay system, and conducts theoretical schedulability analysis calculations. A general design process for user application software based on VxWorks is provided, and data forwarding experiments are completed on the avionics relay system implemented through this design process, proving that its real-time performance and reliability meet the requirements, providing a reference for the practical application development of real-time systems.

(This article is selected from “Electro-Optics and Control” by authors: Fan Zhiyong, Lu Yan, Liu Tao, affiliated with the Civil Aviation University of China, Engineering Technology Training Center, School of Electronic Information and Automation. This article is reproduced solely for the purpose of disseminating knowledge. If there are any copyright issues, please contact us promptly!)

Real-Time Task Scheduling Design for Avionics Relay System

Leave a Comment