Share this

Design of a state machine-based control system for a line-following robot

2026-04-06 07:58:31 · · #1
Abstract: This paper analyzes the motion control system of a line-inspection robot and proposes a method to implement the motion protection and mechanism positioning system in the motion control system using a finite state machine. Considering the special requirements of the line-inspection robot's motion control, a state machine for the motion protection and positioning system is designed through timing analysis of the motion control system. The line-inspection robot's motion controller is then implemented on a programmable device, thus providing a method for designing a control system based on a programmable device. Keywords: Line-inspection robot, motion control, state machine, timing, programmable device 1. Introduction 1.1 Line-inspection robot High-voltage transmission lines, as the main mode of power transmission, are the lifeblood of the national economy, and their safe and reliable operation is an important guarantee for social production and people's lives. Due to the special working environment of high-voltage transmission lines, various facilities on the transmission lines are prone to damage. Therefore, regular inspection of high-voltage transmission lines is an important foundation for ensuring reliable power transmission. Currently, the inspection method for transmission lines is mainly manual. However, since many transmission lines are erected in mountainous areas, and the outdoor environment is relatively harsh, the manual inspection method is subject to many limitations. This greatly affects the timely maintenance of transmission lines and poses a safety hazard to the reliable transmission of electricity. The development of robotics technology has made automated inspection of power transmission lines possible. Power line inspection robots are a type of robot specifically designed for this purpose. The main tasks of power line inspection are to check the condition of towers, conductors, lightning protection wires, insulators, and hardware. This requires the robot to operate autonomously on the power transmission line and to autonomously identify and cross obstacles. To meet the mechanical requirements of obstacle-crossing behavior and to adapt to the flexible environment of power transmission lines, power line inspection robots are designed as two-arm suspended robots, using two gripping robotic arms as their walking mechanism. During normal inspections, the robot is driven by motors mounted on the two arms. When an obstacle needs to be crossed, the gripper on one arm clamps the power line, and the robot's rotation mechanism drives it to turn and bypass the obstacle. After one arm has bypassed the obstacle, based on the relative position of the robotic arm and the power line provided by a vision sensor, the gripper and the power line are precisely aligned by a swing arm mechanism mounted on the arm. It is easy to see that the main problems that the two-arm suspended robot needs to solve during obstacle crossing are stability and the positioning of the gripper. To achieve reliable obstacle crossing, the robotic arm of the line-following robot is designed with a double-joint structure: a rotary joint at the bottom of the arm allows for 180-degree rotation, and a swing joint in the middle allows for left and right swinging. This structure is primarily designed to facilitate posture adjustment when the robotic arm is detaching from or gripping the line. 1.2 Line-Following Robot Motion Control System As can be seen from the above description, the obstacle-crossing behavior of a two-arm suspended line-following robot is quite complex, which presents significant challenges to the design of the motion control system. The motion control system of the line-following robot mainly performs two tasks: First, controlling the motors to complete the corresponding motion process, achieving the required dynamic characteristics and stability. Second, protection and positioning during the motion process. This paper mainly discusses the design and implementation of the protection and positioning functions of the motion control system. Generally, the above two functions of the motion control system are implemented in two main ways: software-based and hardware-based. The software-based implementation method is highly flexible and can implement more complex algorithms; therefore, the first function of the motion control system is generally implemented in software. However, the biggest drawback of the software-based implementation method is its insufficient reliability and slow response speed. The second function of the motion control system for the line-following robot—various limit protections, accident handling, overcurrent and overload protection, and zero-position adjustment—requires high reliability. When these functions are implemented in software, software malfunctions such as program crashes or freezes will inevitably cause significant damage to the drive motors and robot mechanism. Furthermore, the robot mechanism has high requirements for the response speed of the motion control system. In case of unexpected situations, the control system must provide the corresponding control signals to the drive motors with the shortest possible delay to protect the motors and mechanism. Although software based on real-time operating systems offers significant improvements in real-time performance, this largely depends on the number of tasks running on the system; a large number of tasks can lead to slow response times. Compared to software-based implementations, hardware-based implementations offer higher reliability and faster response speeds, but their biggest drawback is lower flexibility and a more complex implementation process. Therefore, hardware is not suitable for implementing complex control algorithms. For the second major task in the motion control system, hardware implementation is more appropriate. This is mainly because the second function requires high reliability and response speed, while not requiring complex calculations; it is a logic control function, making hardware implementation more suitable. 1.3 Description of Motion Control Problems Regarding the protection and positioning system in the motion control system of the line-following robot, its essence is to provide corresponding motor control signals based on sensor signals. In other words, the motor protection and positioning system completes the mapping between control input (sensor signals) and control output (motor control signals). The characteristics of the motor protection and positioning system make it very suitable for design using finite state machines. The preceding description has roughly described the functions that the motion protection and positioning system needs to perform. Specifically, when the motion mechanism moves to the left and right limit positions, the sensors provide corresponding limit signals, and the motion control system stops the motor accordingly, restricting the movement of the mechanism at these two positions. That is, if the mechanism swings clockwise to the limit point, after the limit is reached, the mechanism can only move counterclockwise; clockwise movement is restricted, and vice versa. A more complex function in the motion control system of the line-following robot is the positioning of the two robotic arms. The robotic arm positioning requirement is that no matter from which direction the robotic arm approaches the central zero position, it must always automatically stop at a position—a position where the robotic arm is perpendicular to the robot body. Because the position sensor we use is a Hall effect sensor, the sensor gives a valid signal when the distance between the sensor probe and the magnet is less than a certain threshold. Therefore, when the magnet approaches the sensor probe from different directions, the position of the limit signal given by the sensor is different. Experimental verification shows that when the magnet enters a certain area, the sensor immediately gives a valid signal; this area is approximately 1 cm wide. Therefore, if entering this area is always considered as the robot arm being in zero position, it is obvious that the robot arm cannot be guaranteed to be perpendicular to the body when zeroing from different directions. In fact, due to the influence of the sensor's installation position and the overall length of the robot arm, the robot arm's posture varies greatly when zeroing from different directions. To ensure that the robot arm always stops at the same position regardless of the direction of zeroing, the controller must only use the same edge signal from the sensor as the zeroing signal. For example, when the robot arm is zeroing clockwise, if the falling edge of the sensor signal is detected, the motor stops, and zeroing is considered complete; when the robot arm is zeroing counterclockwise, the rising edge of the sensor signal (which is the falling edge in clockwise rotation, i.e., the same edge signal) must be detected before zeroing is considered complete. In our designed motion control system, for any motor, the control system provides only three control signals: two direction signals and a speed signal (dira, dirb, and PWM). The two direction signals control the motor's direction and start/stop. The motor can move only when dira and dirb are different, and the motor stops when they are the same. The PWM signal can also control the motor's operation; the motor can run when PWM is high, and it stops otherwise. The positioning and adjustment system of the robot arm requires three sensors: a left limit sensor (sensor_l), a middle zero-position sensor (sensor_m), and a right limit sensor (sensor_r). For motion mechanisms that do not require zeroing, the middle zero-position sensor is not set. 2. Finite State Machine Design 2.1 Finite State Machine Design of Motion Control System The typical timing of the motion protection and positioning system in the motion control system is shown in the figure below: Figure 1 Timing and Block Diagram of Motion Protection and Positioning System As can be seen from the timing diagram above, the timing of the motion control system is significantly divided into four segments: The first segment L1: is the left limit stage of the motion mechanism. That is, when the movement reaches the left limit point, the control system should stop the motor and restrict the movement in this direction. The second segment, L2, is unique to the robotic arm. When the robotic arm swings clockwise towards the vertical position, the control system stops the motor when it reaches the vertical position (sensor_m changes from high to low). However, unlike the limit switch, the control system cannot restrict the movement of the mechanism in any direction at this time. To allow the robotic arm to move left or right after reaching the vertical position, another control variable is introduced in our design: the motor speed signal pwm. The third segment, L3, is also unique to the robotic arm, similar to the second segment. When the robotic arm moves counterclockwise towards the vertical position, unlike the clockwise movement, it requires the motor to stop only when the sensor signal changes from low to high. Again, it cannot restrict the movement of the mechanism in any direction. The fourth segment, L4, is the right limit stage of the motion mechanism. Similar to the first segment, when the mechanism reaches the right limit point, the control system needs to automatically stop the motor and restrict movement in this direction. Based on the typical timing characteristics of the motion control system, corresponding states and state transition conditions can be defined: First, set the initialization state s0, which is automatically entered after the system is powered on or reset. Upon power-up, internal signals and outputs are initialized in this state. This state is also the system's default motor-stop state. Under normal movement, clockwise and counterclockwise rotations correspond to states s1 and s2, respectively. When the mechanism returns to zero clockwise, unlike the limit switch, since movement in any direction cannot be restricted at this time, the state machine needs to enter state s3 after the PWM signal goes low. S3 is actually a transitional state. Through S3, the state machine can enter S1 and S2 based on the control signals given by the microprocessor at this time. Similarly, when the mechanism returns to zero counterclockwise, unlike clockwise zeroing, it needs to detect that the intermediate position sensor is high before stopping the motor. Therefore, when moving counterclockwise, once sensor_m is detected to be low, the state machine enters the transitional state s5. In this state, if sensor_m goes high, it means that the mechanism has left the sensor area and reached the vertical position, at which point the state machine enters state s6. From the above analysis, it can be seen that for the mechanism to return to zero in two different states, clockwise and counterclockwise, we set two special transition state sets {s3, s4} and {s5, s6} respectively. This is mainly because the zeroing operation is different from the limit switch. After returning to zero, the control system cannot restrict the movement of the mechanism in any direction, so an additional control input is needed as the trigger signal for the state machine state transition after returning to zero. Based on the above analysis, the state transition diagram of the state machine can be obtained as follows: Figure 2 Finite State Machine State Transition Diagram 2.2 Design Simulation and Implementation 2.2.1 Design Simulation This design was synthesized, placed, routed, and simulated on the ISE8.2i+Modelsim XE III 6.0d platform. The timing diagram of the simulation after placement and routing is as follows: Figure 3 Timing Simulation Diagram From the above post-simulation timing, it can be seen that when sensor_l goes low, dira and dirb go low at the same time. Only when the direction signal dir changes, dira and dirb change accordingly. The change of sensor_r is similar to that of sensor_l. A crucial part of the simulation timing is the two instances where sensor_m goes low, representing clockwise and counterclockwise zeroing respectively. As shown in the figure above, the designed state machine effectively recognizes the same edge signal from the sensor. Furthermore, with the addition of the control signal PWM, the mechanism can still move in any direction after returning to zero, meeting the design requirements. 2.2.2 Design Implementation The designed state machine was coded using VHDL and implemented on the Xilinx XC9572 CPLD device. Experimental verification showed that the designed state machine is safe and reliable. 3. Conclusion There are two main methods for implementing robot control systems. Software-based implementation methods have shown various shortcomings in demanding practical applications. The development of programmable devices has provided a completely new mode for the implementation of control systems. Control systems based on programmable devices offer high reliability, simple implementation, and high flexibility. Compared to traditional software implementations and control systems implemented with discrete components, programmable device-based control systems have many irreplaceable advantages. This paper abstracts the behavioral-level description of the control system based on the timing requirements of the controlled object for the controller, and designs the state of a finite state machine accordingly. The EDA software was used for synthesis, placement and routing and simulation. Finally, the motion control system designed was implemented on the CPLD, which provides an effective method for the digital design of the control system. The innovation of this paper is to apply the finite state machine to the hardware design of the robot control system and implement the design on the programmable device. This is a great improvement over the common software-based control system implementation method and the hardware-based control system implementation method constructed by discrete components, which greatly improves the reliability, anti-interference and real-time performance of the control system. References [1]. James R. Armstrong F. Gail Gray: VHDL Design Representation and Synthesis. China Machine Press. [2]. Zhao Shixia, Yang Feng, Liu Jiesheng. VHDL and Microcomputer Interface Design. Beijing, Tsinghua University Press, 2004. [3]. Zhou Huaide, Xiao Chuan, Wei Haozhihang. Design and Development of Intelligent Camera System Based on DSP and CPLD. Microcomputer Information, 2006, Vol.22, No.17 [4]. Wang Cheng, Xue Xiaogang, Zhong Xinchao. Detailed Explanation of Xilinx ISE. Beijing: People's Posts and Telecommunications Press, 2004. [5]. Yang Qing. Design and optimization of finite state machines. Journal of Hubei University for Nationalities (Natural Science Edition), Vol.24, No.1, Mar 2006. [6]. Wu Yangbo, Wang Shuguang, Hu Jianping. VHDL design and optimization of finite state machines. Information Technology. Vol.28, No.1, Jan.2004. [7]. Wang Jian, Zhao Haiyan. Redundancy design of controller based on CPLD. Microcomputer Information. 2005 Vol.12, No.23
Read next

CATDOLL 108CM Sabrina (TPE Body with Soft Silicone Head)

Height: 108cm Weight: 14.5kg Shoulder Width: 26cm Bust/Waist/Hip: 51/47/59cm Oral Depth: 3-5cm Vaginal Depth: 3-13cm An...

Articles 2026-02-22
CATDOLL 146CM Mila TPE

CATDOLL 146CM Mila TPE

Articles
2026-02-22
CATDOLL Himari Hard Silicone Head

CATDOLL Himari Hard Silicone Head

Articles
2026-02-22