Share this

Design and Implementation of a CAN Bus-Based Easy-Shift Gear System for Buses

2026-04-06 06:21:46 · · #1
Abstract: To achieve car-like gear shifting in buses, a design of a CAN bus-based lightweight gear shifting system is proposed. The paper focuses on the hardware and software design of the system's execution control unit, the CAN bus communication technology, and analyzes the system's reliability. The system adopts advanced electronic technology and intelligent control algorithms. Experiments have verified that the lightweight gear shifting system significantly improves the vehicle's performance in all aspects during gear shifting. Keywords: CAN bus, lightweight gear shifting, μC/OS-II, microcontroller 1 Introduction With the rapid development of the social economy, urban traffic is becoming increasingly busy, and traffic safety is receiving more and more attention. During vehicle operation, drivers must adjust the vehicle's direction and speed in a timely manner according to changes in road and traffic conditions to achieve good driving performance and fuel economy. Frequent gear shifting can easily lead to driver fatigue and distraction, increasing the risk of traffic accidents. This paper introduces the design of a CAN bus-based lightweight gear shifting system, utilizing mechatronics technology to achieve car-like gear shifting in buses. The system is mainly developed and designed in conjunction with the shifting system of the bus, including two nodes, the front node is the handle control command node, and the rear node is the execution control node. The overall system framework diagram is shown in Figure 1. 2 System application design 2.1 System hardware structure and control principle In order to achieve the design requirements of sensitive response and high reliability, the control units of the front and rear nodes are all made of Philips P87C591 microcontroller, which successfully includes the PeliCAN function of Philips Semiconductor SJAl000 CAN controller, which meets the system design requirements. The circuit diagram of the CAN communication part of the main control system is shown in Figure 2 [1]: The acquisition of gear position, vehicle speed and engine speed signals in the system is completed by Hall element A3144EU. After the signal is amplified, it is isolated by optocoupler TLP521 and sent to the CPU. After the CPU performs logic operation, the output signal is isolated by optocoupler and sent to high-power field effect transistor. The field effect transistor drives the solenoid valve to control the cylinder to complete the corresponding gear change. The main control process of the system is as follows: the front node collects signals in real time based on the different positions of the lever and the opening and closing of the clutch switch, processes them into gear commands through logic judgment, and transmits them to the rear node via the CAN bus. After receiving the gear command, the rear node judges the shift timing by combining the vehicle speed, engine speed, and current gear, and then sends an action command to the actuator. The actuator starts to activate the corresponding solenoid valve according to the command, thereby controlling the corresponding cylinder to achieve gear change. After the gear change is completed, the feedback signal is processed to confirm that the shift action is completed before proceeding to the next step. The vehicle has 5 up gears and 1 reverse gear, using an electro-pneumatic operation method. The specific gear positions and solenoid valve positions are shown in Figure 3. As shown in Figure 3, when valve 1 is vented and valve 2 is de-vented, the piston is pushed to the right end of the cylinder, and the piston rod pushes the shift fork to the predetermined position, which is defined as the KA layer; when valve 1 is de-vented and valve 2 is vented, it is defined as the KC layer; when both valves are de-vented, due to the action of the return spring in the gearbox, it will automatically position itself to the middle layer, defined as the KB layer. After the layer is selected, the two upper gear valves at the corresponding positions are used to realize the up and down gear actions in different directions, thereby completing the predetermined gear selection and gear shifting actions. 2.2 System software design The actual application has high requirements for the real-time performance and reliability of the system. In the software design, the programming method of the multi-task real-time operating system μC/OS-Ⅱ is adopted, that is, the application is decomposed into several independent processes, and a monitoring process is created to monitor the running status of each process, thus ensuring the real-time performance and reliability of the system [2]. The system uses the Keil C51 compiler. Combined with the technical characteristics of the single-chip microcomputer P89C591, the working content of porting a μC/OS-Ⅱ operating system that supports P89C591 includes: (1) Set a constant value in OS_CPU.H using #define to control the growth direction of the task stack. (2) Declare 10 data types in OS_CPU.H. (3) Define 3 macros in OS_CPU.H using #define. (4) Write six simple C language functions in OS_CPU.C, namely, task stack initialization, task creation hook function, task deletion hook function, task switching hook function, task statistics hook function, and timer hook function. (5) Write four assembly language functions in OS_CPU_A.ASM. The system needs to create a total of four tasks, and the system task allocation is shown in Figure 4. The CAN bus scanning task scans the registers of the CAN bus periodically to receive the handle position signal sent by the front node. The display task is mainly responsible for display, refresh, etc., and is used to observe the completion of actions during debugging. The system main task is used to perform logical analysis and judgment of data and over-limit alarm functions. The data acquisition task will scan each data acquisition port in real time to collect parameters such as vehicle speed and engine speed. The main function is responsible for system initialization and task creation and startup. The tasks can communicate with each other through semaphores, message queues, etc., to ensure that the tasks are executed in real time and synchronously. 3 System Communication Mechanism Design The requirements for the communication system of the lightweight shifting system are: reliable data transmission, high real-time performance, high transmission rate, and low bit error rate[3]. As a serial communication network that effectively supports distributed control or real-time control, the CAN bus has strong flexibility, simple expansion possibilities, excellent real-time communication performance, as well as communication reliability and error detection capability. It can be applied to various harsh electronic environments and has become the preferred network communication bus form for automobiles. The CAN bus model structure has only 3 layers: physical layer, data link layer and application layer. The transmission medium is twisted pair, and the communication rate can reach up to 1 Mb/s (40 m). Its communication mode is flexible, and no node information such as station address is required. It adopts non-destructive bus arbitration technology to meet real-time requirements. Based on the study of the CAN 2.0B specification, a scheme of custom communication protocol was adopted to realize the communication between the two nodes before and after the system. The preceding node sends a command, and the following node receives it but does not send an acknowledgment signal. The preceding node checks the accuracy of the information received from the following node; if incorrect or not received within a specified time, it resends the command. Exceeding the specified number of resends constitutes a communication failure. Similarly, if the following node sends information, and the preceding node receives it but does not send an acknowledgment signal, and the preceding node does not receive it within a specified time, it also constitutes a communication failure. The basic structure of the node data frame is defined as follows: Each node data frame in the system is distinguished by an ID. Each node can define multiple different data frames to transmit different information. 4. System Anti-interference Design The system will take measures from both hardware and software aspects to comprehensively prevent interference from affecting the operation of the microcontroller system. On the hardware side, the main focus is on cutting off interference from the transmission channel and power line. The design effectively suppresses interference from distributed capacitance, electromagnetic inductance, and leakage flux through the application of filter capacitors, optocouplers, and reasonable component layout and wiring. Simultaneously, the scientific grounding of the PCB board effectively solves signal integrity issues and improves the electromagnetic compatibility (EMC) of the PCB board. On the software side, instruction redundancy, software traps, and watchdog technology are used to ensure the normal operation of the program, effectively solving the problems of program crashes and infinite loops during execution. 5. Conclusion The passenger bus easy-shift system replaces manual shifting with electronically controlled easy-shifting, resulting in significantly improved shifting comfort and economy. It completely transforms passenger bus shifting into car-like operation, retaining the advantages of mechanical transmissions (high efficiency, low cost, and simple structure) while fully utilizing the fast response and high controllability of electronic control. This aligns with the development trend of automotive technology towards electronic, intelligent, and user-friendly systems. The innovation of this paper lies in abandoning the single-task mode of traditional microcontroller system software programming and adopting the programming method of the embedded real-time multi-task operating system μC/OS-II, greatly improving the system's real-time performance. Practical experience has proven that the system operates reliably, communicates normally, and achieves high performance indicators. With only minor adjustments, the system can be applied to various types of passenger buses, demonstrating broad development and application prospects.
Read next

Research on Comprehensive Performance Testing System for Vehicle Clutch

Abstract : This paper presents a measurement and control system utilizing the combined operation of a microcomputer and ...

Articles 2026-02-22