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.
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]
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.
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.
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.
Previous article:Research and Application of 54M Wireless Network Adapter in Embedded System
Next article:Application of EGI Technology in Embedded Web Server
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Questions about using GD32F207 to replace STM32F207
- Studying Things to Gain Knowledge 06 Part 2 Van de Graaff Generator
- Do you know the UWB Promotion Organization? How do they introduce UWB?
- [ESP32-S2-Kaluga-1 Review] QR code implementation and simple trial experience
- RS485 interface electromagnetic compatibility design scheme
- Push-pull circuit
- Network communication---WiFi
- NSA Network Topology
- i.MX6ULL Embedded Linux Development 3-Kernel Porting
- [RISC-V MCU CH32V103 Review] + Use of TIM timer