A software development method for the traction control of electric locomotives
Through fine-grained software architecture division and model-based design methods, embedded C code is automatically generated, which solves the problems of high difficulty, low efficiency and weak reusability of electric locomotive traction control software development, and achieves efficient and maintainable software development.
Patent Information
- Application Number
- CN202111209622.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-18
- Publication Date
- 2025-05-27
- Estimated Expiration
- 2041-10-18
AI Technical Summary
The existing software development methods for traction control of electric locomotives have problems such as high difficulty in software development, low development efficiency and weak software reusability.
Through fine-grained software architecture division, the electric locomotive traction control software module is divided into four-quadrant control software modules and inverter control software modules, and embedded C code is constructed and automatically generated through Stateflow, Simulink and Embeded Coder tools.
It realizes collaborative development of multiple people and automatic code generation, reducing the difficulty of software development, improving development efficiency, and enhancing the reusability and maintainability of software.
Smart Images

Figure CN113934403B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electric locomotive traction control, and in particular to a software development method and system for electric locomotive traction control. Background Art
[0002] In the field of rail trains, electric locomotives have replaced steam locomotives and diesel locomotives and are widely used. By taking the path of parallel introduction, digestion, absorption and independent research and development, major achievements have been made in key technologies, and the conversion from DC drive to AC drive mode has been completed. With the continuous application and development of AC drive electric locomotives, in addition to the requirements for the reliability of the electric locomotive traction control software, the requirements for its development efficiency and reusability are also getting higher and higher. The traction control system of electric locomotives has complex logic functions and strong coupling, which requires that at the beginning of product design, sufficient architecture design should be carried out for the traction control software, the logic functions should be clearly divided, and the software development efficiency should be improved. In addition, using the traditional development method of writing code by hand is prone to introducing risks caused by human factors, and the software maintenance is relatively difficult.
[0003] The existing software development methods for electric locomotive traction control generally adopt the following two methods:
[0004] 1. Technical solution of the prior art one
[0005] The traditional software development method for electric locomotive traction control refers to that designers manually write code under the requirements of a specified programming language and programming environment, and it is also the main development method for the current electric locomotive traction control software. This development method has the following characteristics: 1) High requirements for personnel capabilities, requiring technicians to have strong code writing capabilities and the ability to use integrated development environments; 2) Low cooperation development efficiency. Since everyone's logic and code style are different, cooperation among multiple people in development will introduce many difficulties, resulting in low development efficiency;
[0006] 3) Difficult to maintain. The code lacks intuitiveness, it is difficult to locate problems during maintenance, and high time costs and labor costs need to be invested; 4) Difficult to manage. It is difficult to unify and implement coding specifications, resulting in great management difficulty.
[0007] 2. Technical solution of the prior art two
[0008] Software architecture division. In the standard software development process, software architecture division should be carried out at the beginning of the design. A good software architecture division can improve software development efficiency and enhance software reusability. The development process without architecture design only focuses on the implementation of current functions and ignores the software architecture design for product lines and long-life cycle systems, which has the following risks: on the one hand, when changes in original requirements, function addition or deletion occur during the software development process, the design party cannot quickly respond to the requirements, thus affecting the development progress; on the other hand, when product updates or software function reuse are needed, it is impossible to clearly separate function blocks and their interfaces, resulting in poor software reusability. Summary of the Invention
[0009] The present invention provides a software development method for electric locomotive traction control, which is used to solve the problems of high software development difficulty, low software development efficiency and weak software reusability in the existing software development methods for electric locomotive traction control.
[0010] The technical means adopted by the present invention are as follows:
[0011] A software development method for electric locomotive traction control includes the following steps:
[0012] Step 1: Divide the electric locomotive traction control software module into a four-quadrant control software module and an inverter control software module;
[0013] Divide the four-quadrant control software module into a four-quadrant control logic model for real-time monitoring, fault identification, recording and protection of the four-quadrant control system state, a four-quadrant control algorithm model for stable control of the intermediate voltage on the DC side and control of the grid-side current, and a four-quadrant control hardware drive model for realizing data transmission between the four-quadrant control software module and the four-quadrant DSP board;
[0014] Divide the inverter control software module into an inverter control logic model for real-time monitoring, fault identification, recording and protection of the inverter system state, an inverter control algorithm model for effective control of motor torque and speed, and an inverter control hardware drive model for realizing data transmission between the inverter control software module and the inverter DSP board;
[0015] Step 2: Sequentially construct the four-quadrant control logic model and the inverter control logic model through Stateflow, sequentially construct the four-quadrant control algorithm model and the inverter control algorithm model through Simulink, and sequentially call the four-quadrant control hardware drive model and the inverter control hardware drive model through S-function;
[0016] Step 3: Use the Embeded Coder tool to automatically generate embedded C code for the four - quadrant control logic model, four - quadrant control algorithm model, four - quadrant control hardware drive model, inverter control logic model, inverter control algorithm model, and inverter control hardware drive model to form control software.
[0017] Further, the four - quadrant control logic model includes a four - quadrant initialization state unit, a four - quadrant self - check state unit, a four - quadrant pre - charge state unit, a four - quadrant operation state unit, a four - quadrant fault state unit, a four - quadrant shutdown state unit, and a four - quadrant pantograph - lifting state unit.
[0018] Further, the four - quadrant control algorithm model includes a current - loop control unit, a voltage - loop control unit, and a phase - locked loop control unit.
[0019] Further, the inverter control logic model includes an inverter initialization state unit, an inverter startup state unit, an inverter fault state unit, and an inverter stop state unit.
[0020] Further, the inverter control algorithm model includes a motor characteristic unit, a rotor flux observer unit, a phase - angle control unit, a vector control unit, and a modulation unit.
[0021] Further, the four - quadrant control hardware drive model is the same as the inverter control hardware drive model, and includes a GPIO unit, an ADC unit, an ePWM unit, an eCAP unit, an SCI unit, an SPI unit, a CAN unit, and an EMIF unit.
[0022] Compared with the prior art, the development method of the electric locomotive traction control software disclosed in the present invention has the following beneficial effects: The development method of the electric locomotive traction control software disclosed in the present invention, in the development stage of the electric locomotive traction control software, divides the four - quadrant control software module and the inverter control software module through a fine - grained software architecture and further refines these two modules, clearly separating the functional modules, interface parameters, and interaction methods of the traction control software, and modeling through corresponding tools. Through the model - based design method, multi - person collaborative development and automatic code generation can be achieved, thereby reducing the software development difficulty, improving efficiency, and enhancing the reusability and maintainability of the software, etc. Brief Description of the Drawings
[0023] Figure 1 is a flowchart of the development method of the electric locomotive traction control software disclosed in the present invention;
[0024] Figure 2 is the division of the traction control software architecture for the development method of the electric locomotive traction control software of the present invention;
[0025] Figure 3 is the structural block diagram of the four - quadrant control logic model in the present invention;
[0026] Figure 4 is the structural block diagram of the four - quadrant control algorithm model in the present invention;
[0027] Figure 5 is the structural block diagram of the inverter control logic in the present invention;
[0028] Figure 6 is the structural block diagram of the inverter control algorithm in the present invention. Detailed implementation manners
[0029] As Figure 1 shown, the software development method for the traction control of an electric locomotive disclosed in the present invention includes the following steps:
[0030] Step 1: According to the requirement specification of the electric locomotive, divide the traction control software module of the electric locomotive into a four - quadrant control software module and an inverter control software module;
[0031] Divide the four - quadrant control software module into a four - quadrant control logic model for real - time monitoring of the four - quadrant control system state and fault identification and protection, a four - quadrant control algorithm model for stabilizing the intermediate voltage on the DC side and controlling the grid - side current, and a four - quadrant control hardware driver model for realizing data transmission between the four - quadrant control software module and the four - quadrant DSP board;
[0032] Divide the inverter control software module into an inverter control logic model for real - time monitoring of the inverter system state and fault identification and protection, an inverter control algorithm model for effectively controlling the motor torque and speed, and an inverter control hardware driver model for realizing data transmission between the inverter control software module and the inverter DSP board;
[0033] Step 2: Sequentially construct the four - quadrant control logic model and the inverter control logic model through Stateflow, sequentially construct the four - quadrant control algorithm model and the inverter control algorithm model through Simulink, and sequentially call the four - quadrant control hardware driver model and the inverter control hardware driver model through S - function;
[0034] Step 3: Automatically generate embedded C code for the four - quadrant control logic model, four - quadrant control algorithm model, four - quadrant control hardware driver model, inverter control logic model, inverter control algorithm model, and inverter control hardware driver model through the Embeded Coder tool to form the control software.
[0035] Specifically, as Figure 2As shown in the figure, according to the requirements specification of the electric locomotive, the traction control software module of the electric locomotive is divided into two parts: the four - quadrant control software module and the inverter control software module. Each part is further subdivided into a logic model, an algorithm model, and a hardware driver model. That is, the four - quadrant control software module is divided into a four - quadrant control logic model for real - time monitoring of the four - quadrant control system status, fault identification and protection, a four - quadrant control algorithm model for stable control of the intermediate voltage on the DC side and control of the line - side current, and a four - quadrant control hardware driver model for realizing data transmission between the four - quadrant control software module and the four - quadrant DSP board;
[0036] The inverter control software module is divided into an inverter control logic model for real - time monitoring of the inverter system status, fault identification and protection, an inverter control algorithm model for effective control of the motor torque and speed, and an inverter control hardware driver model for realizing data transmission between the inverter control software module and the inverter DSP board;
[0037] Among them, as Figure 3 shown, the four - quadrant control logic model includes a four - quadrant initialization state unit, a four - quadrant self - check state unit, a four - quadrant pre - charge state unit, a four - quadrant operation state unit, a four - quadrant fault state unit, a four - quadrant shutdown state unit, and a four - quadrant pantograph - down state unit. In the four - quadrant control logic model, the input signals are the voltage and current signals in the circuit, and the output signal is a control instruction. According to the normal working process, first enter the initialization state to initialize the interfaces, communications, fault bits, etc. used in the software; then enter the self - check state to check for possible faults in the system. If there is no fault, enter the next state; in the pre - charge state, the establishment of the intermediate voltage can be controlled, and then enter the system operation state. In each of the above - mentioned states, it is necessary to monitor the fault bit in real time, judge the fault type. If a fault occurs, a fault code is sent, and according to the fault type, enter the fault state or the stop state.
[0038] As Figure 4 shown, the four - quadrant control algorithm model includes a current - loop control unit, a voltage - loop control unit, and a phase - locked loop control unit. The four - quadrant converter control algorithm model mainly ensures the voltage output index on the DC side.
[0039] The voltage - loop control unit is an outer - loop closed - loop control. The DC - bus voltage feedback tracks the DC voltage set value. After passing through the voltage - loop control unit, the four - quadrant DC - bus voltage is kept stable. The output current signal is used as the amplitude of the input signal of the current - loop control unit.
[0040] To ensure the unity power factor of the control unit, a phase-locked loop is used to obtain the angle of the grid-side voltage signal. The current signal output by the voltage loop control unit is combined with the angle output by the phase-locked loop control unit to form the given input signal of the current loop.
[0041] The current loop control unit is an inner-loop closed-loop control. The grid-side current feedback tracks the current given value, and then through the current loop control unit, high-precision control of the grid-side current is achieved. The output voltage control signal controls the ePWM module to generate pulses, and controls the four-quadrant rectifier to generate a stable DC output.
[0042] In the above process, the DC bus voltage feedback signal and the grid-side current feedback signal are collected by voltage and current sensors, and processed by the ADC of the DSP board as the input signal of the control algorithm.
[0043] Among them, as Figure 5 shown, the inverter control logic model includes an inverter initialization state unit, an inverter startup state unit, an inverter fault state unit, and an inverter stop state unit. The logic control of the inverter is similar to that of the four-quadrant. The system status of the inverter part is monitored in real time, including the inverter initialization state unit, the inverter startup state unit, the inverter fault state unit, and the inverter stop state unit. The input values of the fault detection process are signals such as current, voltage, motor speed, and temperature. Through system judgment, operation instructions such as reporting faults, stopping, and restarting are output.
[0044] Among them, as Figure 6 shown, the inverter control algorithm model includes a motor characteristic unit, a rotor flux observer unit, a phase angle control unit, a vector control unit, and a modulation unit. Specifically, the inverter control algorithm model takes the traction motor as the control object, adjusts the traction force and speed of the motor, etc., to meet the needs of vehicle traction and braking characteristics. The inverter control algorithm adopts a control strategy combining direct vector control and indirect vector control, with the advantages of both, and has the characteristics of fast dynamic response and strong robustness. The inverter control algorithm model mainly includes a motor characteristic unit, a rotor flux observer unit, a phase angle control unit, a vector control unit, and a modulation unit.
[0045] The input signal of the motor characteristic unit is the actual speed of the motor. According to the motor characteristics, the given flux at different speeds is output;
[0046] The rotor flux observer unit adopts a direct vector control strategy. By inputting the current after coordinate transformation and the actual speed, the actual flux is observed and transmitted to the vector control module for closed-loop control of the flux to ensure the accuracy of the flux amplitude;
[0047] The phase angle control unit adopts an indirect vector control strategy. The synchronous angular velocity can be calculated through the given torque, given flux linkage, and actual rotational speed. The integrated angle is transmitted to the vector control module as one of the input signals for the rotation transformation.
[0048] The vector control unit is the core of the inverter control algorithm. The input signals include the given torque, and signals such as the given flux linkage, actual flux linkage, and synchronous angle transmitted from the above-mentioned modules. Vector control is performed in the synchronous rotating coordinate system, and the output voltage signal is transmitted to the modulation module.
[0049] The modulation unit controls the output pulse signal through an effective modulation algorithm, thereby controlling the inverter to generate alternating current to drive the AC motor.
[0050] Among them, the four-quadrant control hardware drive model is the same as the inverter control hardware drive model, including the GPIO unit, ADC unit, ePWM unit, eCAP unit, SCI unit, SPI unit, CAN unit, and EMIF unit, which are used to implement the interaction channels and interaction methods between software and hardware.
[0051] After the model architecture of the electric locomotive traction control software is divided in the above manner, different designers can carry out the modeling design of specific function modules. Then, using the characteristics of the MATLAB modeling tool, Stateflow in the MATLAB modeling tool is selected to construct the four-quadrant control logic model and the inverter control logic model, and Simulink is selected to construct the four-quadrant control algorithm model and the inverter control algorithm model. The four-quadrant control hardware drive model and the inverter control hardware drive model are called sequentially through the S-function. The hardware drive model is realized by calling the existing underlying code through the S-function and encapsulating it as a model.
[0052] After establishing the corresponding modules in the MATLAB modeling tool, the four-quadrant control logic model, four-quadrant control algorithm model, four-quadrant control hardware drive model, inverter control logic model, inverter control algorithm model, and inverter control hardware drive model established are compiled through the Embeded Coder tool to automatically generate embedded C code to form the control software. Then the generated control software is automatically downloaded to the DSP boards corresponding to the four-quadrant and the inverter.
[0053] Apply the traction control software downloaded in the DSP board. The CAN communication method is adopted between the four-quadrant DSP board and the inverter DSP board to realize signal sending and receiving. The DSP board receives signals such as voltage, current, and speed collected from the controlled object, generates corresponding control instructions through software processing, and sends them to the controlled object to achieve the control of the target.
[0054] The development method of the traction control software for electric locomotives disclosed by the present invention, during the development stage of the traction control software for electric locomotives, through the fine-grained software architecture division, clearly separates the functional modules, interface parameters, and interaction methods of the traction control software, and then guides the subsequent software development and design, which can enhance the reusability of the software and improve the software development efficiency; through the model-based design method, multi-person collaborative development and automatic code generation can be realized, thereby reducing the software development difficulty and improving the efficiency.
[0055] Meanwhile, after the control software model design is completed, through the automatic code generation technology, embedded code is automatically generated and downloaded to the corresponding DSP board, realizing the one-key generation and deployment from the model to the code. The four-quadrant DSP board and the inverter DSP board carrying the traction control software interact with the controlled object through the control signal and the feedback signal, realizing functions such as effective control of the intermediate circuit voltage stability, motor state and motor speed, and rapid detection and rapid protection of faults.
[0056] As mentioned above, it is only the preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present invention, according to the technical solution and inventive concept of the present invention, makes equivalent substitutions or changes, and should be covered by the protection scope of the present invention.
Claims
1. A method for developing a traction control software of an electric locomotive, characterized in that: It includes the following steps: Step 1: Divide the traction control software module of the electric locomotive into a four-quadrant control software module and an inverter control software module; Divide the four-quadrant control software module into a four-quadrant control logic model for real-time monitoring, fault identification, recording and protection of the four-quadrant control system status, a four-quadrant control algorithm model for stabilizing the intermediate voltage on the DC side and controlling the grid-side current, and a four-quadrant control hardware driver model for realizing data transmission between the four-quadrant control software module and the four-quadrant DSP board; Divide the inverter control software module into an inverter control logic model for real-time monitoring, fault identification, recording and protection of the inverter system status, an inverter control algorithm model for effectively controlling the motor torque and speed, and an inverter control hardware driver model for realizing data transmission between the inverter control software module and the inverter DSP board; Step 2: Sequentially construct the four-quadrant control logic model and the inverter control logic model through Stateflow, sequentially construct the four-quadrant control algorithm model and the inverter control algorithm model through Simulink, and sequentially call the four-quadrant control hardware driver model and the inverter control hardware driver model through S-function; Step 3: Automatically generate embedded C code for the four-quadrant control logic model, four-quadrant control algorithm model, four-quadrant control hardware driver model, inverter control logic model, inverter control algorithm model and inverter control hardware driver model through the Embeded Coder tool to form a control software.
2. The method for developing a traction control software of an electric locomotive according to claim 1, characterized in that: The four-quadrant control logic model includes a four-quadrant initialization state unit, a four-quadrant self-check state unit, a four-quadrant pre-charge state unit, a four-quadrant operation state unit, a four-quadrant fault state unit, a four-quadrant shutdown state unit and a four-quadrant pantograph-drop state unit.
3. The method for developing a traction control software of an electric locomotive according to claim 2, characterized in that: The four-quadrant control algorithm model includes a current-loop control unit, a voltage-loop control unit and a phase-locked loop control unit.
4. The method for developing a traction control software of an electric locomotive according to claim 1, characterized in that: The inverter control logic model includes an inverter initialization state unit, an inverter startup state unit, an inverter fault state unit and an inverter stop state unit.
5. The method for developing a traction control software of an electric locomotive according to claim 4, characterized in that: The inverter control algorithm model includes a motor characteristic unit, a rotor flux observer unit, a phase angle control unit, a vector control unit and a modulation unit.
6. The method for developing a traction control software of an electric locomotive according to any one of claims 1 to 5, characterized in that: The four-quadrant control hardware drive model is the same as the inverter control hardware drive model, and includes a GPIO unit, an ADC unit, an ePWM unit, an eCAP unit, an SCI unit, an SPI unit, a CAN unit, and an EMIF unit.
Citation Information
Patent Citations
High-performance four-quadrant frequency converter
CN103051281A
Embedded control-software development method based on model driving
CN106502677A