Scheduling Algorithm for Real-Time Embedded Control Systems Using Arduino Board

The time taken for the scheduling task in a control system to reduce the traffic within the system is one of significant field of research in modern era. There are different control systems that require time scheduling such as elevator control system, traffic control system and train control system. Currently, there are unique control logic strategies adopting scheduling algorithm that are implemented in real time systems like earliest deadline first and ant colony optimization. At the same time, the disadvantages possessed by them are the exponential dip in the performance ratio due to over loading. Despite of all the available resources there are many issues faced such as congestion in traffic networks due to non-adaptive scheduling algorithms, etc., which led to several misfortunes and danger for human life. Hence an improved algorithm that increases the efficiency of the system is required to validate the processing time and the deadlines. Our research is focused on validating a proposed idea of using Arduino microcontroller to implement the different scheduling tasks and validate the efficiency of the algorithm to optimize the results of the system. This take cares of assigning the critical paths which priorities the tasks and focuses on reducing the scheduling time. This rapidly increases the processing speed and efficiency of the algorithm. We plan to use the Arduino board which has an inbuilt error detection algorithm that helps in checking whether


Introduction
Automation has become a key component in the advancement of technologies in the recent past, these advancements are centered towards ensuring the increase in productivity with minimal man power by the usage of smart sensor systems and intelligent actuators that contributes to the increased efficiency of the system.Some applications that are used in day to day life such as elevator control and train traffic management require automation that has the ability to schedule processes effectively so that the safety in terms of collision avoidance and process deadline satisfaction is guaranteed.The use of multicore systems using algorithms that can schedule a process is become a common practice.The system divides the task into different sub-modules and handles deadline requirements by sharing the tasks with other modules within the system.There exists few aspects of this system that has to be considered while evaluating the efficiency of the system they are as follows: a) execution time b) worst case scenario and the deadlines of the system [1].Using an embedded system for scheduling helps in allocating the available resources for the tasks and sequencing the process through understanding the use of scheduling tasks over a given time period [2].In this paper, we propose an idea of validating the efficiency of the scheduling algorithm used in microcontroller platforms such as the VHDL-based Altera FPGA board and Arduino board to implement two practical examples of elevator control system and train traffic management.As an initial proof of concept the fabrication of the prototype model and implication of scheduling algorithm using Altera FPGA board using the logical algorithm to verify its efficiency, speed of operation and critical execution time is carried out successfully.Based on our observation from the initial phase of our proposed project, the difficulties faced while using Altera board involving the parallel processing issues is compared with the same experiment implemented using an Arduino board in phase 2 of our project.Finally, we are planning to work on optimization of the scheduling algorithms by integrating the scheduled algorithms using ant colony optimization technique.Which is focused on improving the scheduling accuracy and also reduces the energy consumption [3,4] issues related to control systems with multiple nodes in future.

Literature Review
On exploring the past pieces of literature addressed towards the development of automation systems that are used in daily application, the wildly used elevator control and train traffic management plays a very major part.The method of controller synthesis is considered as a way of acquiring train control using generic algorithm [5].Train traffic control is also achieved by using algorithms to control time interval deviations between successive trains as illustrated by M. K. Park, S. Kim, D. M. Woo, and J. H. Lee [6].Model Predictive control is an effective method for train traffic management and it allows taking intelligent decisions upon critical conditions and also follows optimization of train operation considering First Come First Serve logic [7].Elevator group can be controlled using a pseudo differential feedback.It includes least waiting time calculations along with shortest ladder time for scheduling decisions [8].Particle swarm optimization is also another method which charts simple realization and fast convergence for elevator group control [9].Also, in context aware elevator scheduling the elevator has the knowledge of emergency situation and can predict the desired path of the user [10].Also, there are many researches happening around the world for incorporating the ant colonization algorithm into the scheduling algorithm used in the automation system to increase its efficiency.On extensively reviewing all the above mentioned systems that are seeded into the research of this domain.We aim at designing an effective scheduling algorithm with appreciable efficiency that acts as an add-on to the existing systems.

Problem Modelling
In order to validate the scheduling algorithms that are used in the real time applications like elevator and train control system we designed and fabricated a miniature model of an elevator and a train traffic control system.A brief overview of these systems are as follows.

Elevator design
An elevator is an important transportation system that runs with the help of motor actuation.The position of the elevator can be controlled using scheduling algorithm that mainly targets to decrease the average waiting time.For this study, a miniature model of elevator was built which consists of four levels and this was designed and developed using Solid works and laser printer.The following images illustrate the CAD design and the fabricated model in Figure 1(A) and 1(B).The general operation of the system is based on the input signal from the user and changes its levels based on the information obtained from the buttons that are placed inside the elevator and at every level.A proximity sensor controls the closing and opening of the elevator doors which is activated by a servo motor that opens and closes the door.Using an ultrasonic sensor and an IR obstacle detection sensor, the distance of the elevator from the ground or the current level where the cabin is parked is found out.We use a DC motor that powers the cabin is controlled by the microcontroller with the help of sensor inputs that determine the position of the cabin.The design also emphasizes on controlling the different levels and cabin position through multiple switches depending upon user commands and sorts out the average waiting time and reduce the traffic in the control system.Also we use a finite state machine approach using microcontroller setup that uses an Altera board to identify initial or current state of the cabin.In later stages of the project we plan to validate the different scheduling algorithms and effectively monitor the efficiency of the algorithm using a Arduino board as it is clear that Arduino is more effective than the VHDL logic.

Train traffic management
The train control system is necessary for avoiding train collisions and effective railway traffic signal management.It is also necessary for identifying the train position.A model of train control system was developed using sensors for position identification and motors for the train motion.A railway gate way can be implemented with the help of stepper motors.LEDs are used for the traffic signals.The train control system is also employed with finite state machine approach.This is to identify the current position of the train its track.The parts of the train were built using SolidWorks and 3D printing.The obstacle detection IR sensors are kept along the track to track the train movement as shown in the Figure 2. Train motors are controlled by the microcontroller (Arduino Board).The sensor input to the micro controller gives the train position and hence controls train motion and the traffic signals.The state of sensors is used for controlling the motor of the gateway as well.The factor to be taken care of is scheduling the train at right times for avoiding delays and starting and stopping the train right times, and providing an obstacle less path at the intersections.The state machine approach helps to clear the intersections as the current position of the train is found out efficiently.Furthermore, this system controls the train despite of the location or traffic density.An intelligent control system could be developed so as to control the train depending upon traffic delays and to support busy stations.

Algorithm Description
The key objective is to identify and implement an effective scheduling algorithm aiming to reduce the response time and the average waiting time of the automated system.These observation criterions varies depending upon the available resources, scheduling algorithm used, data structure, dispatch strategy and interrupt service routines [2].Nowadays there exist a wide range of scheduling algorithms that might include distributed systems which are used in train control system that included incremental approach which has a provision to be modified [11] and concurrent scheduling in which scheduling requests can attribute to the inherited process which is effectively increase the consistency [12].Followed by dynamic systems which is used in both Elevator and train control systems in which catastrophic results occur that affect the execution time.
Here is where the scheduling can be done depending upon priority of the task.High priority tasks can block the task that is currently running like motion of the train.Considering the least slack time of the tasks is another method.The lowest slack time is chosen where the slack time defines the difference between the deadlines and the remaining execution time [13].Validation and testing of the control system includes real time constraints and execution that meets deadlines [14].Local blocking Time is used when there is an event of worst case scenario as mentioned in [1].Non Preemptive Threshold algorithm proved in is a method that supports traffic control.Once this method starts, it jumps on to a state where it is not affected by other tasks.Once the task is computed and executed it comes back to normal priority [15].Scheduling based on priority is used when there is emergency stopping of the train or elevator is required.Whenever there is change in the average wait time for the elevator, the cabin can move to a busy level.This was further classified into Dual priority with multiprocessor [16] and Pre-emptive and non-pre emptive scheduling [1].In order to compact this, a controlled preemptive algorithm was used for preemptive tasks and other algorithms for preempted tasks [17] such closing of railway gate or elevator cabin doors.
The algorithm helps in avoiding allocation of all the resources to a set which may affect the efficiency as presented in [18].And finally we would like to validate the Ant colony optimization for scheduling algorithm is evolved from the foraging behavior of ant spices that is used to solve many problems for optimization in shortest path calculation involving multi-nodes network.In this paper we focus on validating the ant colony group control strategy comparing its operational efficiency with the different scheduling algorithms [4] [19].Assume a scheduling task that involves n elevators that are serving m floors.The dispatching plan topology of the ant colony optimization focuses on the shortest feasible scheduling path that serves the desired request call with a small waiting time [20].The dispatching mechanism is optimized based on the pheromone update logic or car-choosing probability technique [21].The Ant colony algorithm searches an optimal solution by trying out different iterations for every possible distinct items in the system and maintains a global scheduling plan which automates the feasible plan every iteration and based on the feedback obtained in the system the optimized shortest path is identified.Also, this algorithm is used in different complex systems like air craft traffic [22].

Results and Discussions
The main objective of doing this project is to analyze and find out the most efficient scheduling algorithm with least execution time and the best platform for implementing scheduling algorithm i.e.Altera board or Arduino Board.The phase 1; project fabrication was done initially by designing it using Solid Works and output model was obtained using 3D printing and laser cutting.Then the model was integrated with sensors and control circuitry.Implementing scheduling algorithm using FPGA based Altera board with VHDL coding is phase 2. This phase is to develop a control system and validate the scheduling algorithm.The Altera board uses VHDL coding where the scheduling algorithm implemented is based on first come first serve criterion for elevator and the train control system uses basic scheduling algorithm for Traffic signaling and collision avoidance.In the later part of the project we are planning to use Arduino board to implement the systems that were validated using VHDL in phase 1 with the following scheduling logics like First Come First Serve algorithm (FCFS) and ant colonization.In order to find out an efficient scheduling algorithm for elevator and train control system the initial proof of concept is obtained by validating the logical flow using a software simulation of the logic in LabVIEW.Many algorithms can be applied to the different nodes in the system depending upon efficiency.Earliest Deadline first (EDF) is an efficient algorithm suitable with both pre-emptive and non-pre-emptive systems with controller algorithm manipulation.Ant colony optimization is considered the best for the multiple node systems implemented in a large scale that has to be incorporated into both the systems and validate the test results by measuring the execution time and the AWT.This project blossomed from the seed which was planned during the Embedded systems unit of our course which led us to further investigate this issue and come up with this idea which is planned to be validated in the coming future.
The different issues that are subjected to our experimentation in VHDL are discussed as follows: • The change in process power and thermal constraints is mentioned in [23].
• Use of security algorithms for preventing accidental/intentional loss of data (train traffic control room) is necessary.Another method is database backed up in cloud storage [24].
• Multiple interrupts can change the algorithm output.Multiple interrupt control design is presented in [20] and can be used for multi-processor systems.
• Scheduling overheads can occur due to non-redundant data.This is taken care of in [25].
• Resource constrained project scheduling problem is an issue as mentioned in [26].This problem is taken care of in [27] The above figure illustrated the project scope and the blue ones indicate the things that are done and the green one indicates the stuffs that are planned to be done in the coming future.Scheduling algorithm using Altera board showed delay in response and also multiple input error and hence can be less effective compared to the one using Arduino board.The next part of this project includes examination of Average Weighting Time (AWT) to improve the efficiency of the project and incorporation of ant colony optimization into these systems.

Figure 1 :
Figure 1: (A) CAD DESIGN OF THE ELEVATOR SETUP (B) FABRICATED ELEVATOR MODEL.