RTOS Based Industrial Automation

M. Chandrasekaran *  R. Saravana Saran **  V. Ravishankar ***  J. Yasararafath ****
* Assistant Professor, Department of Electronics and Communication Engineering, P. A. College of Engineering and Technology, Pollachi, Coimbatore.
**_**** Student, Department of Electronics and Communication Engineering, P. A. College of Engineering and Technology, Pollachi, Coimbatore.

Abstract

A real-time operating system (RTOS) is a piece of code (usually called the kernel) that controls task allocation when the microcontroller is operating in a multi-tasking environment. RTOS (Real time operating system) selected OSA (Open system Architecture) OS (Operating System) for the project. In the project, the authors were controlling the industrial equipment with the help of the microcontroller. In this, the major parts of industries were to be maintained. The controls maintained are temperature management, entering into restricted area of the industry, emergency alarm and displaying such parameters. In processing, there are some ways of algorithm and processes which were followed by the OS. The processes are 1) Context switching - while running a task switching to another task. 2) Multitasking - running more number of tasks at a time. 3) Interrupt handling – is the process of task with high priority which will execute first by passing the running task. The algorithm followed is priority based system where in the task were executing in priority bases and the priority was given by the authors in the coding part. The tasks have the same priority that follow the round robin algorithm, which shares the running time by separating equal time slots. For example, two tasks of same priority will run for 5ms and switch to other task that runs for 5ms and switched again. These were the processes and algorithms that were followed in the OS. In the project, temperature is maintained for certain level by temperature sensor (LM35), if it reaches above the level, the fan is switched on. When PIR sensor sense live human, it will switch on the light. For emergency case, alarm would on by pressing the emergency button, different temperatures is were maintained by different sensors and are processed to the output with the help of the OSA RTOS.

Keywords :

Introduction

Industrial automation provides reliable and effective control over the different processes on the industry. Normally the microcontroller based automation was being in the industries. In the industrial automation, PLC programmable stage controller play the main role. In such a way, PIC microcontroller were used. In the PIC microcontroller, we cannot perform multitasking. It can able to run a single task at a time. These controllers will not perform more tasks at a time. So the authors used the concept of RTOS. In this project work, RTOS was used for the industrial automation purpose. This will control the task allocation, context switching, multitasking, and priority of execution and increases the speed of execution. For this project, OSA RTOS was used to control temperature, metal detection and unauthorized entry.

Embedded systems are an invention that has taken more than a hundred years to take the present day shape on real time. Embedded computing system includes a digital electronic system embedded in a larger system and it is application specific. The developer needs to select a right RTOS based on these applications.

There is a strong and compatible relationship between the system hardware and the software, primarily the operating system to ensure hard real time deadlines, which is implemented to maintain the industrial resource such as Temperature management, metal detection and human detection with the help of PIC micro controller using the RTOS functions. These measurements can be done according to priority given by the users.

1. Need of RTOS for an Embedded System

Embedded systems are continuously increasing their hardware and software complexity moving to single chip solutions. The RTOS in Embedded System mainly does the following tasks. It simplifies control code required to coordinate processes. It provides an abstraction interface between applications with hard real-time requirements and the target system architecture. Availability of RTOS models is becoming strategic inside hardware/software co-design environments.

An Embedded System is a special-purpose system in which the computer is completely educated to the device or system it controls. Unlike a general-purpose computer, such as a personal computer, an embedded system performs one or a few predefined tasks, usually with very specific requirements. Since the system is dedicated to specific tasks, design engineers can optimize it, reducing the size and cost of the product. Embedded systems are often mass-produced, benefiting from economies of scale. Physically, embedded systems range from portable devices such as digital watches and MP3 players, to large stationary installations like traffic lights, factory controllers, or the systems controlling nuclear power plants [2-3].

In terms of complexity, embedded systems can range from very simple with a single microcontroller chip, to very complex with multiple units, peripherals and networks mounted inside a large chassis or enclosure [4].

2. RTOS (Real time operating system)

RTOS can be defined as, “The ability of the operating system to provide a required level of service in abounded response time.” The real-time system responds in a predictable way to unpredictable external stimuli arrivals.

To build a predictable system, all its components (hardware & software) should enable this requirement to be in fulfilled manner. Traffic on a bus, for example, should take place in a way allowing all events to be managed within the prescribed time limit. RTOS should have all the features necessary to be a good building block for a Real Time system.

A good RTOS can be defined as one that has a bounded (predictable) behavior under all system load scenarios (simultaneous interrupts and thread execution).

3. RTOS Parameters

Among the different parameters for selecting the RTOS, the ones used in our system are: 1. Interrupt Latency, 2. Context switching 3. Inter task Communication (Message Queue Mechanism, Signal Mechanism, Semaphores), 4.Power Management(Sleep mode, Low power mode, idle mode, Standby mode) 5. No. of Interrupt levels 6. Kernel Size7.Scheduling Algorithms 8.Round Robin Scheduling 9.First Come First Serve10. Shortest Job First 11.Preemptive Scheduling., 12.Interrupt Levels 13.Maintenance Fee 14.Timers.

4. Industrial Operation

In many industries, there are lot of Departments. Each department may have many separate workshops. Lot of parameters were to be controlled like temperature, cooling system, unauthorized entry, security, metal detections, etc., Industries were majorly running world wide. Its automation is the major task with lower number of cost, complexity and lot of things. The automated industries were done by the processors or by the large controllers. The major automation processes were designed and controlled by the PLC. There are many parameters to be maintained at the same time. These were the major tasks to develop with the help of single microcontroller. Single controller can do a single task properly. For lots of parameter, lot of controllers are required. These will increase the use of controllers in the industries.

5. Existing Method

A real-time microkernel is the near-minimum amount of software that can provide the mechanisms needed to implement a real-time operating system. Real-time systems are those systems whose response is deterministic in time[1]. In this research, a 32-task Real Time Microkernel is designed using which multi- tasking can be done on the targeted processor ARM7TDMI. Two sets of functions are developed in this research work.

First one is Operating System functions and second is application functions. Operating System functions are mainly for carrying out task creation, multi-tasking, scheduling, context switching and Inter task communication. The process of scheduling and switching the CPU (Central Processing Unit) between several tasks is illustrated in this paper. The number of application functions can vary between 1 to 32. Each of these application functions is created as a task by the microkernel and scheduled by the pre-emptive priority scheduler. Multitasking of these application tasks is demonstrated in this paper.

6. RTOS In Embedded System

RTOS provides a number of services to an embedded system design such as case management, memory management, and Resource Management to build a program.

Choosing the best OS for an embedded system is based on the available OS for system designers and their previous knowledge and experience. This can cause an imbalance between the OS and embedded systems. RTOS performance analysis is critical in the design and integration of embedded software to ensure that it limits the application meet at runtime. To select an appropriate operating system for an embedded system for a particular application, the OS services are to be analyzed. These OS services are identified by parameters to establish performance metrics. Performance Metrics selected include context switching, Preemption time and interrupt latency. Performance Metrics are analyzed to choose the right OS for an embedded system for a particular application.

7. Proposed Method

This method is designed to control the major task in the industries with the help of RTOS. The parameters controlled are temperature, unauthorized entry, metal detection. The controller will calculate the temperature continuously. When the temperature exceeds the specified range or defined range, it automatically switches ON the FAN and Buzzer. When the temperature reduces below certain level, both the FAN and Buzzer will OFF automatically. For metal detection, the metal detector sensors were used. If it detects the metal, it gives the output in the real time. The unauthorized entry can be detected by the PIR sensor.

By using this technique efficiently the controller can be used for many purposes. It will give more advantage than using in normal way. RTOS is most powerful operating system for the microcontrollers.

8. Block Diagram

Figure 1 describes the functional block diagram of the concept. In this, the temperature sensor will measure the temperature in the industries and it displays the temperature with the help of the LCD display.

Figure 1. Block diagram of Proposed Method

If the temperature range is greater than the critical range or defined temperature, it switches ON the FAN and the Buzzer. The metal detector will give the input to the PIC microcontroller and it gives the output and also displays the comment. The PIR will give the output when the Human crosses its range. It is also displayed in the LCD display. These processes will be done as parallel process in the defined manner or according to the priority assigned to the task. These are the functions which can be done with the help of PIC microcontroller (PIC16F877A).

9. Circuit Diagram

The simulation of the concept can be done with the help of proteus software and the output is produced through the simulation. Figure 2 shows the proposed Method of Circuit diagram.

Figure 2. Circuit diagram of the Proposed Method

10. Microkernal

A microkernel is the near-minimum amount of software that can provide the mechanisms needed to implement an operating system. These mechanism sinclude lowlevel address space management, thread management and Inter Process Communication (IPC) [5].

In terms of source code size, microkernels (as a rule of thumb) tend to be under 10,000 lines of code. MINIX3, for example, has around 4,000 lines of code. Kernels larger than 20,000 lines are generally not considered as microkernels. As an operating system design approach, microkernels permit typical operating system services, such as device drivers, protocol stacks, file systems code, to run in user space. If the hardware provides multiple rings or CPU modes, the microkernel is the only software executing at the most privileged level, generally referred to as supervisor or kernel model [6-7].

11. Sensors

11.1 Temperature Sensor

The LM35 series temperature sensors, are those whose output voltage is proportional to the Celsius of temperature. The LM35 has an advantage over temperature calibrated in ° Kelvin, as the user is not required to subtract a large constant voltage from its output to obtain convenient Centigrade scaling. The temperature sensor does not require any external calibration or trimming to provide typical accuracies of ±1⁄4°C at room temperature and ±3⁄4°C over a full −55 to +150°C temperature range. Low cost is assured by trimming and calibration at the wafer level.

11.1.1 Features

1.Calibrated directly in ° Celsius (Centigrade). 2. Linear + 10.0 mV/°C scale factor. 3. 0.5°C accuracy guarantee able (at +25°C). 4. Rated for full −55° to +150°C range. 5.

Operates from 4 to 30 volts. 6. Less than 60 μA current drain. 7. Low self-heating, 0.08°C in still air.

11.2 PIR Motion-Based Detector

A PIR-based motion detector is used to sense movement of people, living organisms, or other objects. They are commonly used in burglar alarms and automaticallyactivated lighting systems. They are commonly called simply "PIR", or sometimes "PID", for "passive infrared detector".

11.3 Metal Detector

A metal detector sensor can detect metal targets approaching the sensor, without any physical contact with the target. Metal detector sensors are roughly classified into the following three types according to the operating principle: the high-frequency oscillation type using electromagnetic induction, the magnetic type material using a magnet, and the capacitance type material using the change of capacitance. KEYENCE proximity sensors are of the high-frequency oscillation type.

11.3.1 Features

1. Non-contact detection, eliminating damage to sensor head and target. 2. Non-contact output, ensuring long service life. 3. Stable detection even in harsh environments exposed to water or oil splash. 4. High response speed.

12. Applications

The resource management will be the major task in the industrial environment which will be made better and easier with the help of the RTOS. The RTOS in the microcontroller will help to do multitasking, Interrupt Latency, Context switching, Inter task Communication, Scheduling Algorithms (1.Round Robin Scheduling, 2.First Come First Serve, 3.Shortest Job First, 4.Preemptive Scheduling).

This will reduce the human work, human wages, number of controller usage, low cost initialization etc.

Conclusion

Thus the RTOS based industrial Automation provides reliable control of the different tasks in the industries. It provides the facility of context switching, inter task communication, message passing, priority based execution, task creation, task passing, task deleting controls and the faster execution of the task. It runs different tasks at the same time. The flow of control in a program was controlled by the kernel of the RTOS OS. The process execution will be based on the priority assigned to the tasks. With the help of advanced controllers and RTOS, better and faster performance can be achieved.

Reference

[1]. Shaktiraj Kumar Chaganty, B.Lavan, Dr.S.Siva (2013). Prasad “Design & Development of Real-Time Multitasking Microkernel Based on Arm7tdmi for Industrial Automation” International Journal of Instrumentation, Control and Automation (IJICA), ISSN: 2231-1890, Vol. 2, No. 1.
[2]. Edwards S, Lavagno L, Lee E.A. “Design of Embedded systems: Formal modules, validation and synthesis” IEEE transactions of Computer design, Vol 85, No. 3 pp. 366- 390.
[3]. Raghunathan V, (2012). “Advanced techniques for programming networked Embedded Systems” in IEEE conference on, pp.36-37.
[4]. Wilhelm,R, Grund D, Reineke J, (2009). “Memory hierarchies, pipelines and buses for future architectures in time critical embedded systems” IEEE transactions on integrated circuits and systems. Vol. 28 No. 7, pp 966-978.
[5]. Nanjing Xiaozhuang Coll., Nanjing (2012). “Design of Embedded OS Micro-kernel Experiment Series” International conference of Electrical and Computer Engineering, pp 2109-2113.
[6]. JianjunShenSihan Qing; QingniShen (2006). “Design Of A Micro-Kernel Based Secure System Architecture” Information Assurance Workshop, IEEE pp, 384-385.
[7]. HaiyingZhou , Kun Mean Hou, Christophe De Vaulx “ASuper Small Distributed REAL-Time Microkernel Dedicated to Wireless Sensors” International Journal of Pervasive Computing and Communications, Vol. 2, No 4.