Application of Giotto software in real-time embedded control

Publisher:静心悠然Latest update time:2012-04-19 Source: 单片机与嵌入式系统应用 Keywords:Giotto Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
introduction

With the rapid development of computer technology, control technology, and information technology, industrial production and management methods have entered the era of production automation and intelligent control. In particular, the application of distributed embedded systems requires standardized, real-time control modules and I/O function modules for system integration and the construction of complex distributed systems that are suitable for harsh environments. Real-time embedded software modules are suitable for designing complex distributed systems. They support the system modeling and construction of distributed and heterogeneous devices. The role of embedded modules is to provide structures and technologies that make complexity easy to handle. Giorio-based embedded control devices are more suitable for applications with hard real-time control constraints. In this article, the platform refers to the hardware structure, operating system, and communication protocol, which consists of CPU, sensors, actuators, and networks. Platform-independent events include application functions and time limits, and platform-related events include timing scheduling, communication, and physical characteristics.

1 Giotto programming features

Traditional real-time embedded software design is based on abstract mathematical models. Control engineers use software tools to solve models according to object behavior and environmental impact to obtain the model's functions and performance, and then hand it over to software engineers to write code for a given platform, and test and optimize the code on the given platform until a satisfactory time behavior is obtained. In this process, the close correspondence between the model and the code is often lost, the software's complexity is abandoned, and the complexity of software design is increased. As a result, the resulting software is weakened and difficult to apply on different platforms.

The embedded control software design based on Giotto separates the functional program from the specific platform and the time limit from the function. Its platform independence makes it have better real-time performance, reliability and reusability, and is more suitable for embedded real-time distributed systems. Figure 1 is a design flow chart of an embedded control system based on Giotto. First, the control engineer and the software engineer reach an agreement on the function and time limit of the control design and design a Giotto program; then, the software engineer uses the Giotto compiler to generate an executable code that can connect to the Giotto runtime library and map the program to a given platform. The Giotto runtime library provides an intermediate layer for timing arrangement and communication, which defines the interface between the Giotto executable program and the platform. A Giotto runtime library has been established for Wind River's VxWorks real-time operating system on Intel x86 machines.

Design flow chart of embedded control system based on Giotto

2 Giotto Programming Technique

Giotto is a platform-independent, high-level programming language for specific control applications. Giotto is designed for demanding control applications that require periodic access to sensors, calling of tasks, update of execution, and mode switching. Giotto is based on time-triggered programming, and the communication from sensor to CPU and from CPU to actuator is triggered by a global clock, making it predictable. Giotto programs do not specify platform-related parts, such as priority, communication, etc. Its advantage is that it is independent of the specific execution platform and is compatible with any real-time operating system, scheduling algorithm, and real-time communication protocol.

The two core components of Giotto are periodic task calls and mode transitions. A Giotto program specifies a series of modes, each of which contains a series of tasks and mode transitions. At each moment, the program is executed in a specific mode P. Each P mode transition contains an evaluation function and a target mode Q. The system will only switch to the new mode Q when the evaluation function is true.

The Giotto task is a periodic task, and its input and output ports are updated at the start and end of the task cycle, respectively. However, the Giotto task does not necessarily have to be started at the beginning of the cycle, but only needs to be started and completed within the cycle. Figure 2(a) shows the timing of a 40ms task M and a 10ms task N running on the same CPU. The dotted line is the possible situation of the current task occupying the CPU. At 0ms, both M and N read the values ​​of their input ports; at 10ms, the calculation result of task N is written to its output port, but N has already finished executing (as shown by the dotted line in the figure); at 40ms, the calculation result of task M is written to its output port, but task M has completed execution before 40ms. Regardless of whether task M completes its calculation at any time between 0 and 40ms, task N will only read its result at 40ms.

In Giotto, a task can be viewed as a unit of work that must be completed once it is started. A mode transition cannot terminate any task before the task cycle ends. Given a Giotto mode P (including Giotto tasks M and N called by 40 ms and 10 ms, respectively) and a Giotto mode Q (including Giotto tasks M and R called by 40ms and 5ms, respectively). Figure 2(b) shows the timing of the activation of the mode transition at the 10th ms in mode P, when mode P is converted to mode Q. Since both P and Q contain task M, task M will not terminate, but task N is replaced by task R with a period of 5ms. [page]

Timing diagram

3. Design of autonomous vehicle for logistics system

The 2-autonomous car system includes 2 autonomous cars, each of which contains a microprocessor, a motor and a touch sensor. It is assumed that only one autonomous car is the leader at any time, and the other autonomous cars are followers. Among them, the autonomous car in the leading or avoiding state is called the "leader", and the autonomous car in the following or stopping state is called the "follower". When the leader is blocked, the leader enters the avoiding state and the follower enters the stopping state. The autonomous car entering the avoiding state executes an avoiding procedure to avoid obstacles, and the autonomous car in the stopping state still stops; when the leader completes the avoiding procedure and returns to the leading state, the follower returns to the following state. When one of the followers is blocked, the autonomous car enters the avoiding state, and all other autonomous cars enter the stopping state, and the blocked autonomous car becomes the new leader. Figure 3 shows the state behavior of the 2-autonomous car system.

2. State behavior of the autonomous car system

Since other autonomous vehicles are in the following or stopping state when the autonomous vehicle is in the leading or avoiding state, one LeildXFollow mode and one EvadeXStop mode are used for each leader X. In the LeadlFollow mode, autonomous vehicle l is the leader; in the EvadeStop mode, autonomous vehicle l executes the avoiding procedure. In addition, a stopX mode is introduced for each autonomous vehicle X, which allows the autonomous vehicle to stop quickly. The runCom1 task runs the command stored in the output port command every 40 ms. The two Giotto tasks rrailerCtrl and trailerCtr2 have a period of 10 ms, and they control the motors of the two autonomous vehicles according to the command in command; the data in command is transmitted to the input ports of tasks trailerCtrl and trailerCtr2 by the task driver trailerDrv.

The system continuously detects the sensors of autonomous vehicles 1 and 2. When autonomous vehicle 1 is blocked, the system switches to stop1 mode. Both autonomous vehicles stop moving; after completing stop1 mode, the system switches to EvadelStop mode. At this time, autonomous vehicle 1 executes the avoidance procedure while autonomous vehicle 2 stops moving. Similarly, when autonomous vehicle 2 is blocked, autonomous vehicle 2 switches to Evade2Stop mode after passing stop2 mode. In EvadelStop mode, the Evadel task calculates whether the avoidance action is completed and the next action to avoid once per cycle; the task trailerCtrl with a 10ms cycle controls the motor of autonomous vehicle 1 according to the avoidance steps in command, and once the avoidance action is completed, it switches to LeadlFollow mode.

Figure 4 is a timing diagram of the system mode transition from LeadlFollow mode to Stopl mode, EvadelStop mode and LeadlFollow mode. The transition to Stopl mode occurs at the 60th ms of LeadlFollow mode. The sensor of autonomous car 1 detects an obstacle, and the system switches from LeadlFollow mode to Stopl mode. The two autonomous cars execute the stop procedure; after completing the Stopl mode, the system switches to another mode EvadelStop at the 80th ms. The control task of autonomous car 1 is immediately called, and autonomous car 1 executes the avoidance procedure. At this time, autonomous car 2 is still stopped; when autonomous car 1 completes the avoidance action, at the 110th ms, the control tasks of the two autonomous cars are immediately called, and the system switches to LeadlFollow mode. When autonomous car 2 is the leader, its mode transition is similar.

Autonomous car mode conversion timing diagram

4 Conclusion

In the embedded control design based on Giotto, the separation of timing program and functional program makes Giotto program independent of the specific operating platform, thereby improving the robustness, stability and code reusability of the program. The calling of tasks and the detection of environment variables in the Giotto system are triggered by the global clock, and its time behavior is highly predictable, making Giotto very suitable for embedded control systems with hard real-time constraints.

Keywords:Giotto Reference address:Application of Giotto software in real-time embedded control

Previous article:Research and Application of 54M Wireless Network Adapter in Embedded System
Next article:Application of EGI Technology in Embedded Web Server

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号