Microcomputer protection device based on RTOS and DSPs

1 Introduction

The micro-computer type protection of China's power system has been rapidly developed and has been widely used in power systems. From the early 8-bit machine to the current 16/32-bit machine, performance has been improved and computing power has been greatly enhanced.

The performance and reliability of microcomputer protection depends on software and hardware, so software writing and hardware selection are a key task. When we write software, we usually draw the flow chart first, then program according to the flow chart, usually an infinite loop, and call the corresponding function (subprogram) in the loop to complete the corresponding operation (called background behavior or task level). Use interrupts to handle random events (called foreground behavior or interrupt levels). The program flow is shown in Figure 1. The response time of the task depends on the execution time of the background loop (the execution time is different in different states or running modes), the time of the program passing a certain point cannot be determined, the program is modified, and the cycle timing is affected. This kind of programming method makes the program development cycle long, the modification is difficult, and any one is damaged, it will crash. In the era of 8-bit machines, it is not obvious. With the use of 16/32-bit machines and the complexity of the system, the performance is becoming more and more obvious. This traditional front-end/back-end program development mechanism can no longer meet the increasingly complex and diverse application requirements of microcomputer protection. The development of microcomputer protection applications using RTOS has become the development direction of developers.

Most of the currently operating microcomputer protection devices are 16-bit microcontrollers, which are basically satisfactory for conventional protection. However, 16-bit MCUs are often affected by factors such as the speed of operation, and it is not easy to implement more complex algorithms and higher sampling rates. With the development of microelectronics and semiconductor technology, DSPs have been used in many fields. Due to the powerful digital signal processing capabilities of DSPs, developers are increasingly favored.

2 About RTOS (Real TIme OperaTIng System) real-time operating system

The real-time operating system is a background program that is executed first after the system is started. The user's application is a task running on the RTOS. The RTOS performs resource management, message management, task scheduling, and exception handling according to the requirements of each task. The real-time multitasking kernel is a key part of the RTOS. The basic functions include task management, timer management, storage management, resource management, event management, system management, and message management. The main features of RTOS compared to other OS are small size, croppable, and microkernel.

In the development of multitasking program under the RTOS mechanism, the running time of the CPU is divided into many small time slices. The RTOS is assigned to different tasks according to a certain scheduling algorithm, and multiple tasks access the CPU in their own time slices to reach the microscopic level. The multi-task effect of running concurrently and macroscopically running concurrently. The program flow is shown in Figure 2.

A task is an infinite loop of single-threaded sequence instructions that has five states: sleep, ready, run, wait, and interrupt. The real-time kernel manages tasks through the Task Control Block (TCB). The program calls the kernel service to create a task, and assigns a task control block to the task to initialize it and put the task into a ready state. The real-time kernel is based on events, and the tasks are switched according to the state of the task execution, and the state changes accordingly. In real-time tasks, there are multiple task control modules in memory, as well as individual task-independent private stacks.

To switch between tasks, first save the contents of the CPU register to the task control block of the current task, then load the stack pointer from the task control block of the new task, and load the context of the new task into the CPU register, thus switching from one task to another. A task runs.

We decompose the system functions to be developed and construct them into several different tasks. Each task is responsible for completing some of the functions required by the system application, and determines its priority according to its importance. They operate independently of each other.

The use of RTOS can improve the reliability of the system. In the traditional linear program, when there is strong interference, any loop or damage in any part of the program will cause a crash. Only the hardware (watchdog) will reset and restart the system. In this case, for a system managed by the RTOS, only one of several processes is destroyed and can be repaired by another process. It can also improve product development efficiency and shorten development cycle. A complex application can be broken down into several tasks, and debugging and modification of each task hardly affect other modules.

Using the RTOS makes it easy to design and extend the application, adding new features without major changes, and enabling better management of system resources. However, additional ROM/RAM overhead is required, an additional CPU load of 2 to 5 percentage points, and an increase in development cost (RTOS price).

There are many RTOS vendors on the market today that produce RTOS products for 8-bit, 16-bit, 32-bit, or even 64-bit CPUs. Such as: VRTX, QNX, VxWorks, Nucleus PLUS, OS-9, PSOSystem, LynxOS, WindowsCE and domestic Hopen. In addition to real-time multitasking kernels, RTOS also includes input and output management, window systems, file systems, network language interface libraries, debugging software, and cross-compilation platforms. RTOS has been used in a variety of industries, such as: aerospace, military, power, communications and industrial control.

3 About DSPs (DiginalSignalProcessors) digital signal processing chip

Traditionally, microcontroller MCUs and microprocessors MPUs are two major branches of microcomputer development, and DSPs are a special variant of MCUs.

shape. It is a CPU with Harvard architecture, Reduced Instruction (RISC).

DSPs have multiple addresses, data and control buses on the chip, which can be pipelined to improve the processing power of the CPU. With hardware multipliers, multiplication can be done by one instruction; there are special instructions for data processing; there are DMA transfers. aisle. Its external hardware part is the same as the MCU, and consists of address, data and control three buses. In software development, modular programming is better supported.

There are a variety of DSPs available on the market. Such as: TI's TMS320 series, ADI's ADS series, MOTOROLA's DSP series.

The use of DSPs can greatly shorten the calculation time of data processing, not only can complete data acquisition, signal processing functions, but also complete operations, control and other functions.

4 RTOS and DSPs in the application of microcomputer protection device

We use the ATI company's Nucleus Plus real-time operating system, and DSPs use TI's TMS320C32 to develop a series of medium and low voltage protection devices.

Nucleus Plus is a real-time, preemptive, multitasking kernel. Approximately 95% of Nucleus Plus programs are written in ANSIC and are easy to shift values. We use Nucleus Plus as the development platform, using C language and assembly language mixed programming for software development.

For the actual situation of the protection device, we divide the whole system into several tasks such as protection, self-test, display, communication, etc., and set the protection task to the highest priority. Each task runs independently of each other, and communication between tasks is realized by global data or sending a message. Any one task runs abnormally, and other tasks run normally. The structure of the task program is shown in the following code:

The TMS320C32 is a 32-bit chip that performs floating point arithmetic. Figure 3 is a schematic diagram of the hardware system of the microcomputer protection device composed of TMS320C32. In this system, the TMS320C32 performs functions such as sampling, calculation, protection logic judgment and control.

In the development of protection devices, parallel development is possible by using the RTOS, which shortens the development cycle; the tasks are independent of each other, and the reliability of the system is improved. The use of DSPs improves the accuracy and speed of the operation. In short, the overall performance of the protection device has reached a step.

5 Conclusion

Computerization, protection, control, measurement, data communication integration and artificial intelligence are the trends in the development of relay protection technology. The application of RTOS and DSPs in the relay protection device will make the protection performance more perfect and reliable, and more effectively serve the responsibility of ensuring the safety of the power grid.

Function: The Led Work Light has 1-5 modes;

Feature: The LED Work Light usually high power and super bright;

Trait: The products are waterproof, shockproof;

Method of application: Simple on/off push button operation;

Range of application: The LED Work Light for emergency events, camping, outdoor activities and indoor;

Adervantages: Our products are saled with factory price, and the quality can guarantee, lastly we provide warranty for 1 year.


LED Work Light

Led Work Light,Led Work Lamp,Portable Led Work Lights,Portable Work Light

Ningbo Henglang Import & Export Co.,Ltd , https://www.odistarflashlight.com