UST034

86 Focus | Real-time operating systems that can come from multiple sources, which can be 3-4 million lines of code. This combination of compiler, linkers and libraries can require complex software development tools. Standards Real-time operating systems are not just used in the embedded market. The leading standard is a real-time application programming interface (API) called Posix. It was initially standardised in 1988 for the enterprise market, and defines the interface rather than the operating system; it has been adopted by some operating system developers to provide standardisation. A key difference is that an RTOS using Posix, like Linux, relies on a memory management unit (MMU) being present in the microprocessor, notably those from Intel and PowerPC, to handle those context switches in large amounts of memory. Other RTOS software has been developed for microcontrollers that do not have an MMU. Now processors that have an optional MMU and the ability to address larger amounts of memory are being developed that will give non-Posix RTOS software more applications. For larger UAV designs, the Future Airborne Capability Environment (FACE) in the US is pushing a component- oriented approach for software with standardised interfaces such as Posix, ARINC 653 and DDS. That however can lead to problems for RTOS developers that are not close to FACE and using the standard interfaces. Single core with an open source RTOS Off-the-shelf open source RTOS source code can be used for the design of an autopilot for a UAV running on a single core. If the source code is well- supported and has been widely used in areas such as industrial, automotive and medical designs, there is a high level of confidence in its reliability and performance. That is because the developers feed back any bugs or issues as part of the licence agreement. This then means that the development tools such as the C-based compiler and debugger are the next area where bugs can be introduced. One such RTOS uses task scheduling that allows a developer to use existing code that runs directly on a microcontroller. With this approach, functions are declared as tasks, with the RTOS taking care of the priorities and timing constraints. That means every task has to produce a result by a certain deadline, with the scheduling based on the allocated priority. Each task runs on each system tick, typically 1 ms, with the RTOS checking for the highest priority task and run in a hierarchical approach. These high-priority tasks include reading sensors and moving control surfaces. There are also other tasks, such as pointing a camera or updating waypoints, that need to run frequently but have lower priority, so they run afterwards and at a lower frequency. With this approach, both the tasks and the drivers that are compiled with the RTOS need to be RTOS-aware. If they are not, deadlocks and priority inversions after compilation occur. Dealing with interrupts in a timely fashion is a key part of a design with an RTOS. One way to do that is to keep the interrupt service routine that processes and stores incoming data as small as possible, to minimise the impact in the overall execution. One approach is to use the interrupt service routine (ISR) to store incoming data in a queue and release the CPU to the RTOS to maintain the timing. The data can then be used by a receiving task, which ensures that data is captured as it arrives and is not lost. There is still the need to mitigate the risks that can occur though, however unlikely they may be. A simple watchdog with a notification mechanism alongside the RTOS can reset a task or even a complete autopilot in less than 400 ms, allowing a completely fresh application to run. This is suitable even for a complex helicopter UAV. Development tools are also key to effective development with an RTOS, identifying which tasks are being executed and which resources they are using. Embedded trace is an approach that adds code that monitors the execution of the code and allows developers to visualise the flow. This code instrumentation approach helps developers anticipate failures and problems, and solve them before October/November 2020 | Unmanned Systems Technology LynxOS is a Posix-compliant RTOS with support for Linux via a memory management unit in the processor and a hypervisor that allows separate secure partitions for running different applications (Courtesy of Lynx Software Technologies)

RkJQdWJsaXNoZXIy MjI2Mzk4