The state machine module plays a key role in the autonomous driving system. It is responsible for managing and controlling the state transitions and behavior execution of each function. Today we will talk about how to design the state machine of the autonomous driving system.
0. Small talk
As an engineer of autonomous driving system, it is essential to deal with the state management module from the beginning of participating in the project, because the state machine plays a management role in the full functional cycle of the system operation. From the perspective of technical implementation, the state machine module is not difficult. There are many articles on the Internet introducing FSM (Finite-state machine). If you are interested, you can learn about it yourself. However, how to design it cleverly, thoughtfully and exquisitely is a test of the designer's background and understanding of the system.
Most ADAS functions require state machines for state management. I have more than a dozen state machine design documents, including FCW/LDW/AEB/ACC/LKA/NOP/APA/AVP, etc. The designs are very different, but the cores are similar. The state jump of the NOP function is relatively complex, involving lateral and longitudinal control and function degradation logic, which requires long-term carving and iteration to design an effect that meets the project requirements.
The author has recently been responsible for the state machine design of the APA function. Although it is relatively simple, I still want to take this opportunity to summarize the state machine module and review my previous work.
1. Module Overview
The main function of the state machine module is to track the current state of the system and perform state transitions based on specific events and conditions. It can determine the availability and execution conditions of the current function based on sensor data, vehicle status, and system input. The state machine module can also monitor the operation of the system, respond to driving decisions or user instructions in a timely manner, and trigger the execution of corresponding functions as needed.
The state machine module ensures that the system correctly performs corresponding functions in different scenarios and conditions by defining and maintaining a set of states, as well as the transition conditions and behaviors between states. For example, when the distance between the vehicle in front and the vehicle is too close, the FCW function will be triggered, and the state machine module will switch to the corresponding warning state according to the preset logical conditions and behaviors, and trigger warning measures such as sound or vibration.
The design of the state machine module needs to consider the priority, dependency and conflict between various functions. It needs to be flexible and scalable to cope with different road conditions and traffic scenarios. For example, cat-in, cat-out scenarios, lane change space judgment during automatic lane change, etc. At the same time, the state machine module also needs to have efficient algorithms and real-time performance to ensure the rapid response and reliability of the system.
In short, the state machine module plays a key role in decision-making and control in the autonomous driving system. By effectively managing and controlling the state transitions and behavior executions of each function, the state machine module can ensure the stability, safety and reliability of the system. It is one of the basic modules for realizing ADAS functions.
2. Design principles
The design principle of the state machine is based on the concepts of state, event, and transition. The state represents the specific state of the system or function at a certain moment, the event represents the condition that triggers the state transition, and the transition represents the switching process between states.
First, you need to define the states of the system or function. The state can be a specific behavior state or an abstract control state. Each state represents a specific aspect or function of the system, such as "Standby", "OFF", "Parking", etc.
Next, define the events that trigger the state transition. Events can be trigger signals from sensors, user input commands, or conditional judgments within the system. By detecting the occurrence of events, the state machine can determine whether a state transition is required.
Then, define the transition conditions and behaviors between states. Transition conditions are logical conditions that determine whether a state transition can be made, such as meeting a certain time limit, specific sensor data, or user instructions. Transition behaviors are actions performed when a state transition occurs, such as triggering an alarm, adjusting the vehicle speed, or switching to the next state.
In order to better design and manage state machines, state tables and state transition diagrams can be used. A state table is a table that lists the various states of the system and the corresponding transition conditions. A state transition diagram represents each state and transition through nodes and arrows, intuitively showing the relationship between states and transition rules.
EA Example State Transition Diagram
EA Example Status Table
When designing a state machine, you need to ensure its properties, including determinism, completeness, and reachability.
Determinism means that each state has clear transition rules, without ambiguity or conflict.
Completeness means that all possible states of the system have been considered and the corresponding transition rules have been defined.
Reachability means that the system can reach the target state from any initial state, ensuring the reliability and stability of the state machine.
By using the design principle of the state machine, the various states and transition rules of the system can be clearly defined to ensure that the system correctly executes the corresponding behaviors and functions under different conditions. At the same time, the design principle of the state machine also facilitates the expansion and maintenance of the system, allowing the system to adapt to changing needs and environments.
4. Define the state
State definition: Clearly define the states in the system, ensuring that each state is clear and mutually exclusive. Each state should have a clear meaning and behavior.
Different autonomous driving functions may have different state machines. The definition of the state is determined by the function, and the system needs to correctly execute the corresponding behavior and function under different conditions. At the same time, the design principle of the state machine should also facilitate the expansion and maintenance of the system, so that the system can adapt to changing needs and environments; for example, when designing the NOP function, it should be considered how to switch with functions such as LCC/ACC.
L0 ADAS functions, such as FCW/LDW/BSD, etc., basically do not involve vehicle control, but only serve as warnings. Their state definitions are also relatively simple and can be divided into the following states:
OFF: The system is off and not working.
Standby: The system meets the operating conditions and is on standby.
Warning: The warning trigger conditions are met and the alarm is being sounded.
Inhibit: The warning is suppressed by the user.
Error: System failure.
According to national standards and regulations, the Warning status may also include the Pre-Warning status.
L1's AEB/LCC and other functions only involve single lateral or longitudinal control. For example, AEB is mainly responsible for emergency braking, and will add the Brake state after FCW Warning. According to the functional definition, ACC will have Speed Control, Distance Control, Override, Temp Stop and other states. LCC will have Lane Keeping and other states. It can be seen that the state machine mainly serves the function and is decomposed into different states around the core function.
State Flow logical system modeling textbook diagram from the author
Since the L2-level NOP function requires simultaneous lateral and longitudinal control of the vehicle, the lateral control and longitudinal control states in the main state will be running at the same time. Due to the limitations of the ODD range, there are also downgrade requirements, such as the Safe Stop state. The logic is relatively complex and has high compatibility requirements.
The parking function state machine will of course have states such as Searching (searching for a parking space), Parking (parking process), Suspend (parking interruption), and Completed (parking completion).
5. Event Definition
Event definition: Identify possible events that may occur in the system and define clear trigger conditions for each event. Events can be sensor inputs, user actions, or other changes inside or outside the system.
For example, in many systems, the trigger event of OFF->Standby is "the vehicle is in IGN ON state", that is, the vehicle is powered on. This event can be considered as vehicle state input. The trigger event of Stadnby->Active may be "the user clicks the function start button on the central control screen", which can be considered as a user operation, and so on.
If there are multiple events in the system and they can occur at the same time, then the event priority needs to be considered. Event priority determines which event will be processed first when multiple events are triggered at the same time. For example, an emergency braking event may have a higher priority than a forward obstacle detection warning event.
6. Conversion Rules
Transition rules: Determine the transition rules between states, that is, how to transition from one state to another when a specific event occurs. The transition rules should take into account the logic and constraints of the system.
Previous article:5v2.4a power chip U65153 integrates multiple protection functions
Next article:Why do new energy vehicles use range extenders without diesel engines?
- Popular Resources
- Popular amplifiers
- A review of deep learning applications in traffic safety analysis
- A review of learning-based camera and lidar simulation methods for autonomous driving systems
- Mission-oriented wireless communications for cooperative sensing in intelligent unmanned systems
- Computer Vision Applications in Autonomous Vehicles: Methods, Challenges, and Future Directions
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
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
- Commonly used algorithms for drones - Kalman filter (I)
- 【AT-START-F403A Review】+RTC Test Verification
- 【CH579M-R1】Unboxing and setup environment
- Dial design based on lvgl
- Soldering example of SMA coaxial connector to PCB board
- 100% duty design of buck chip
- Image Processing Based on FPGA
- Limited time download gift: "What you need to know about USB3.1"
- Bluetooth host and slave address mutual binding communication test
- [Evaluation and experience of Zhongke Yihaiwei EQ6HL45 development platform] + ip_pll routine and eLinx software debugging