CN109213027B - Speed regulation unit of marine low-speed common rail diesel engine based on mu/COS-II real-time operation system - Google Patents

Speed regulation unit of marine low-speed common rail diesel engine based on mu/COS-II real-time operation system Download PDF

Info

Publication number
CN109213027B
CN109213027B CN201810778836.2A CN201810778836A CN109213027B CN 109213027 B CN109213027 B CN 109213027B CN 201810778836 A CN201810778836 A CN 201810778836A CN 109213027 B CN109213027 B CN 109213027B
Authority
CN
China
Prior art keywords
task
speed
diesel engine
interruption
interrupt
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810778836.2A
Other languages
Chinese (zh)
Other versions
CN109213027A (en
Inventor
李学民
付文杰
王润芝
刘羽飞
杨云龙
冯春悦
王忠巍
马修真
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Harbin Engineering University
Original Assignee
Harbin Engineering University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Harbin Engineering University filed Critical Harbin Engineering University
Priority to CN201810778836.2A priority Critical patent/CN109213027B/en
Publication of CN109213027A publication Critical patent/CN109213027A/en
Application granted granted Critical
Publication of CN109213027B publication Critical patent/CN109213027B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/042Programme control other than numerical control, i.e. in sequence controllers or logic controllers using digital processors
    • G05B19/0428Safety, monitoring

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Automation & Control Theory (AREA)
  • Combined Controls Of Internal Combustion Engines (AREA)

Abstract

The invention discloses a speed regulating unit of a marine low-speed high-pressure common rail diesel engine based on a mu/COS-II real-time operating system, and belongs to the field of electronic control of diesel engines. The software design of the invention adopts a mu/COS-II real-time operating system, and consists of an interrupt task and a task scheduled by the mu/COS-II real-time operating system. The tasks are coordinated and synchronized by means of semaphores. The CAN data processing task, the switching value detection task, the state management task, the fault detection task, the FLASH writing task and the monitoring parameter returning task are executed in a timing mode, the CAN sending task is triggered by the state management task through the semaphore, and the control parameter calculation task is triggered by the crankshaft rotation speed interruption through the semaphore according to the fixed crankshaft rotation angle. The invention has the beneficial effects that: the method adopts the mu/COS-II real-time operating system to carry out software design, has good real-time performance, high software reliability and strong stability, is convenient for application program expansion and debugging, shortens the development period and reduces the development cost.

Description

Speed regulation unit of marine low-speed common rail diesel engine based on mu/COS-II real-time operation system
Technical Field
The invention belongs to the field of electronic control of diesel engines, and particularly relates to a speed regulating unit of a marine low-speed high-pressure common rail diesel engine based on a mu/COS-II real-time operating system.
Background
The diesel engine is the most common power device used by ships in the world at present, and particularly, the low-speed high-power diesel engine is widely applied to large and medium-sized civil ships due to the characteristics of large single-machine power, good economy, high reliability and the like.
The marine low-speed high-pressure common rail diesel engine has a complex composition structure, a large whole engine, a plurality of sensors and a wide distribution range of the sensors. On one hand, a single controller has limited resources, and on the other hand, the single controller has limited processing capacity and cannot meet the control requirement, so that a network distributed control mode formed by interconnection of a plurality of controllers through buses is required to be adopted for complete machine control.
At present, the software of the diesel engine control system which is already on the market or appears in the related papers and patents is developed based on the bare engine programming environment for the most part. For example, the document "design of a general driving platform of an electronic control unit pump injection system" and the document "design of an electronic unit of a diesel engine fuel injection system for an internal combustion engine vehicle" are established in a bare computer environment, and a front-background program running mechanism is established by matching a modularized application program and an interrupt program to design a diesel engine control system. In this form, the design of the program function is the design of the module, and many functional modules directly interface with the hardware, which makes it difficult for a complex system to form an organized complete software under the management of the scheduling mechanism. And the system has weak universality, so that the development period of the product is long, the development cost is increased, and the development efficiency is low.
In addition, although a real-time operating system is also adopted in software of a part of diesel engine control systems, for example, in the document "diesel engine integrated electric control system and monitoring system development", a high-pressure common rail diesel engine controller is developed by taking a 16-bit single chip microcomputer MC9S12DP512 of Motorola company as a CPU and based on a mu/COS-II real-time operating system; the document 'embedded software development and research of common rail diesel engine electric control system', transplanting a mu/COS-II real-time operation system to a 32-bit single-chip microcomputer to complete the injection control and the whole machine management of a high-pressure common rail diesel engine. However, the control object is a medium-high speed diesel engine, and compared with a marine low-speed high-pressure common rail diesel engine, the diesel engine has a simpler structure, a small number of sensors and actuators are distributed and centralized, and a single control unit can complete the control function, while the marine low-speed high-pressure common rail diesel engine is controlled as described above: the single controller is difficult to complete the control function, and a plurality of network distributed controllers are needed to cooperate to complete the complete machine control.
The speed regulating unit is one of a plurality of control units in a network distributed marine low-speed high-pressure common rail diesel engine control system.
Disclosure of Invention
Aiming at the defects existing in the software design of the programming environment based on a bare engine in the background technology, the invention provides a speed regulating unit of a marine low-speed common rail diesel engine based on a mu/COS-II real-time operating system, which is used for speed regulation control of the upper layer of a main pipe and aims to: the state management of the diesel engine is completed by integrating information of other controllers in a network, when the diesel engine is in a certain state, other control units are dispatched through a CAN bus to complete the control of corresponding actuators (such as an oil injector, an exhaust valve and the like), so that the diesel engine is effectively operated, the functions of starting, speed regulation, stopping, safety protection and the like of the diesel engine are completed, and the safety protection is performed on the diesel engine in a fault state (such as cooling water fault, lubricating oil fault and the like).
The invention selects a 16-bit double-core singlechip MC9S12XEP100 of Feichal as a main control chip to design a control system, and aims to enable professionals skilled in the art to understand the specific content of the invention without being used as a limiting condition of the protection scope of the invention. If other applications use other chips but still use the design method mentioned in the present invention, or make some equivalent changes and modifications, also belong to the content of the present invention, and are covered in the protection scope of the present invention.
On the basis of the above, the hardware architecture of the present invention is as follows:
the system is composed of a singlechip system and a peripheral circuit. The monolithic chip module directly related to the invention comprises: the system comprises a CAN communication module, an ECT module, an on-chip clock module, an on-chip power supply module and an I/O module. The peripheral circuit includes: the device comprises a CAN communication processing circuit, a rotating speed conditioning circuit, a clock circuit, a power management circuit, a switching value input processing circuit and a switching value output processing circuit.
The speed regulation unit is communicated with other units through CAN1 and CAN2 to complete the transmission of data information, and is communicated with an upper computer through CAN3 to complete the calibration of system control parameters and the upper computer monitoring of the parameters in the calibration process; rotational speed signals which are redundant with each other are connected into the unit from a crankshaft rotational speed sensor 1 and a crankshaft rotational speed sensor 2, and are sent into an ECT module of the singlechip after passing through a rotational speed processing circuit; key signals of the diesel engine and external operation buttons are input into the processing circuit through the switching value and then are sent into the I/O module of the single chip microcomputer.
The software content of the invention is as follows:
preprocessing the interruption of the rotating speed 1 of the crankshaft and the interruption of the rotating speed 2 of the crankshaft by using a coprocessor XGATE, and calculating a rotating speed pulse period; the coprocessor XGATE is used for preprocessing CAN1 receiving interrupt and CAN2 receiving interrupt, the information which is not needed by the unit is filtered, and then the needed information is packaged in an ID number + data mode and stored in a buffer area defined in a RAM section shared by the coprocessor XGATE and the main CPU.
The tasks scheduled by the mu/COS-II real-time operating system comprise: the system comprises a CAN data processing task, a switching value detection task, a state management task, a CAN sending task, a fault detection task, a control parameter calculation task, a FLASH writing task and a monitoring parameter returning task.
The switching value detection task is used for detecting key signals of an operation button and a diesel engine; the state management task judges the running state of the diesel engine according to the running parameters of the diesel engine and the operation intention of an operator transmitted by the CAN1 and the CAN2, sets a corresponding state mark when the running state is transferred, and provides reference for other tasks; the CAN sending task completes the encapsulation of control parameters according to the running state of the diesel engine and sends the control parameters to other control units through CAN1 and CAN 2; the fault detection task judges whether the diesel engine normally operates according to the operation condition of the diesel engine by integrating the information of each part of the diesel engine, and the detection result finally acts on the output of the control parameter of the unit; the control parameter calculation task completes various control-related MAP (MAP) searches according to the running state of the diesel engine, selects a control algorithm for the diesel engine and calculates the current control algorithm; the FLASH writing task completes the on-line FLASH writing, and the calibration parameters are solidified into the FLASH of the single chip microcomputer; and the monitoring parameter returning task finishes returning of related parameters to be monitored in the calibration process, and the parameters are displayed and analyzed on an upper computer interface.
The execution mode of each task is as follows: the CAN data processing task, the switching value detection task, the state management task, the fault detection task, the FLASH writing task and the monitoring parameter returning task are executed at regular time, the CAN sending task is triggered by the state management task through the semaphore, and the control parameter calculation task is triggered by the interruption of the crankshaft rotating speed 1 or the crankshaft rotating speed 2 according to the fixed crankshaft rotating angle through the semaphore. The priority order is: the method comprises the steps of control parameter calculation task, state management task, CAN sending task, switching value detection task, CAN data processing task, FLASH programming task and monitoring parameter return task. The software features that the FLASH writing task and the monitoring parameter returning task are mutually independent tasks generated by the division of the traditional calibration task, and are characterized in that: the FLASH programming task and the monitoring parameter return task operate independently, and CAN resources are locked and released between the two tasks through semaphore.
Because the multi-task environment is constructed by the mu/COS-II real-time operating system, the program only needs to be designed to complete various functions. In the mu/COS-II real-time operating system, each task is only a part of the whole application program, and the system has own priority and a set of special CPU register and stack space, so that the efficiency and the reliability can be greatly improved in the design of complex software. Moreover, the operating system passes the standard certification of the Federal aviation administration, and has sufficient stability and safety.
Compared with the prior art, the invention has the beneficial effects that:
the method adopts the mu/COS-II real-time operating system to carry out software design, has the advantages of good real-time performance, high software reliability, strong stability, convenient debugging, shorter development period, lower development cost, high efficiency, good reliability and strong expandability.
Drawings
FIG. 1 is a hardware architecture diagram of a marine low-speed high-pressure common rail diesel engine speed regulation unit based on a mu/COS-II operation system.
FIG. 2 is a relational diagram among tasks of the marine low-speed high-pressure common rail diesel engine speed regulating unit based on the mu/COS-II operating system.
Detailed Description
The invention will be further described with reference to the accompanying drawings in which:
as shown in figure 1, the hardware framework of the marine low-speed high-pressure common rail diesel engine speed regulating unit based on the mu/COS-II real-time operation system is composed of a single chip microcomputer system (S111) and a peripheral circuit (S108). The single chip system module connected with the peripheral circuit, which is needed to be utilized by the invention, comprises: the system comprises a CAN communication module (S112), an ECT module (S113), an on-chip clock module (S116), an on-chip power module (S117), an I/O module (S118), other control units (S101) which are connected with a CAN communication processing circuit (S109) through a CAN1(S105) and a CAN2(S106), an upper computer (S102) which is connected with the CAN communication processing circuit (S109) through a CAN3(S107), and the CAN communication processing circuit (S109) sends CAN information to the CAN communication module (S112) of the singlechip system (S111) after level conversion; a first crankshaft rotating speed sensor (S103) and a second crankshaft sensor (S104) which are redundant to each other are connected to a rotating speed conditioning circuit (S110), and processed rotating speed signals are connected to an ECT module (S113) of a single chip microcomputer system (S111); an external 24V power supply (S115) is connected to a power supply management circuit (S114) and is sent to an on-chip power supply module (S117) of a single chip microcomputer system (S111) to supply power to the system after being processed; the key signals (S121) and the external operation buttons (S122) of the diesel engines are connected to an input port of an I/O module (S118) of the single chip microcomputer system (S111) through a switching value input processing circuit (S119), and each key signal of the diesel engines is provided with a corresponding disconnection detection circuit; the output port of the I/O module (S118) of the single chip microcomputer system (11) is connected with the disconnection indicating lamps (S123) (a plurality) and the common indicating lamps (S124) (a plurality) through the switching value output processing circuit (S120), each signal needing disconnection detection is provided with one disconnection indicating lamp, and the indicating lamp is placed at the corresponding signal access port, so that the maintenance is convenient.
Under the hardware framework, as shown in fig. 2, the software of the speed regulating unit of the marine low-speed high-pressure common rail diesel engine based on the mu/COS-II real-time operating system is realized as follows:
the software structure is as follows: consists of an interrupt task (S229) and a task scheduled by the mu/COS-II real-time operating system (S201).
The interrupt task (S229) is divided into two parts:
XGATE interrupt (S230) and main CPU interrupt (S231).
XGATE is a coprocessor that handles interrupts exclusively and can share the burden of the main CPU. The invention enables XGATE to preprocess speed measurement related interrupts and CAN communication interrupts with other control units, namely XGATE crankshaft speed 1 interrupts (S234), XGATE crankshaft speed 2 interrupts (S235), count overflow interrupts (S236), CAN1 receive interrupts (S231), and CAN2 receive interrupts (S232).
The main CPU interrupt tasks include: main CPU crankshaft rotational speed 1 is interrupted (S237), main CPU crankshaft rotational speed 2 is interrupted (S238), RTI is timed interrupted (S239), and trap is interrupted (S240).
The tasks scheduled by the mu/COS-II real-time operating system comprise: the method comprises a CAN data processing task (S208), a switching value detection task (S203), a state management task (S211), a CAN sending task (S222), a fault detection task (S205), a control value calculation task (S215), a FLASH programming task (S206) and a monitoring parameter returning task (S217).
The function of each interrupt task:
CAN1 receives interrupt (S231) and CAN2 receives interrupt (S232): information of CAN1 and CAN2 is received, respectively. The specific process is realized as follows:
the coprocessor XGATE completes the processing of CAN1 receiving interrupt (S231) and CAN2 receiving interrupt (S232), and packages the required information in an ID number + data mode after filtering the information which is not required by the unit. In order to prevent communication delay or frame loss caused by bus congestion due to the fact that the host CPU is not in time to process, a first-in first-out buffer area is defined in the shared RAM section of the XGATE and the host CPU, and CAN communication information which is received in the CAN1 receiving interrupt (S231) and the CAN2 receiving interrupt (S232) and packaged in an ID number + data mode is stored. After the interruption, after confirming that one frame of data is needed by the unit, searching an empty storage unit immediately, storing the packaged information into the found storage unit, and setting the mark of the storage unit to be full.
XGATE crankshaft speed 1 interruption (S234): and recording the ECT channel count value of the crankshaft speed 1 under the condition that the signal of the crankshaft 1 is normal, providing a basis for the speed calculation, and calculating the speed pulse period.
XGATE crankshaft speed 2 interruption (S235): and recording the ECT channel count value of the crankshaft speed 2 under the condition that the crankshaft speed 1 fails, providing a basis for speed calculation, calculating a speed pulse period, and replacing the interruption of the crankshaft speed 1 and completing the established function of the interruption of the crankshaft speed 1.
Count overflow interrupt (S236): the counted overflow number of the ECT module (S113) is counted, and the result is used as a basis for the revolution speed pulse period calculation.
The revolution speed pulse period is calculated by the following steps:
SpdPulseT=(TimeOverCnt·65536+NowCnt-ExCnt)·k
SpdPulseT: the period of the pulse of the rotating speed is,
TimeOverCnt: the number of overflows is counted,
NowCnt: the count value of the ECT channel of this time,
ExCnt: the last time the ECT channel count value was counted,
k: the time constant is related to the frequency of each count.
Main CPU crankshaft speed 1 interrupt (S237): the XGATE crankshaft speed 1 interrupt is triggered by assembler instructions sif and the speed calculation task is triggered by timing the crankshaft angle by timing the teeth.
Main CPU crankshaft speed 2 interrupt (S238): the XGATE crankshaft speed 2 interrupt is triggered by assembler instructions sif and the speed calculation task is triggered by timing the crankshaft angle by timing the teeth.
RTI timer interrupt (S239): and providing clock beats for the mu/COS-II real-time operating system, and using the clock beats for the functions of delaying the task and the like.
Trap interrupt (S240): and completing task switching corresponding to the task level switching function of the mu/COS-II real-time operating system.
The function settings of each task are as follows:
operating system scheduling task (level 0-63, 0 being highest):
control parameter calculation task (S215): and finishing various control-related MAP (MAP) searches according to the state of the diesel engine, selecting a control algorithm for the diesel engine and calculating the current control algorithm. The method comprises the steps of calculating the starting air quantity and the starting oil quantity in the starting stage and calculating the PID closed loop in the speed regulation stage. This task is an urgent important task, and is triggered by a main CPU crankshaft rotational speed 1 interrupt (S237) or a main CPU crankshaft rotational speed 1 interrupt (S238) by a semaphore, and the assignment priority is 3 at the highest.
Failure detection task (S205): and (4) integrating parameter information of each part of the diesel engine, and judging whether the diesel engine operates normally according to the operating state of the diesel engine. And for the signals needing the disconnection detection: and (3) carrying out disconnection detection on key signals and rotating speed signals of the diesel engine, and lightening corresponding disconnection indicating lamps on the wiring ports for indicating if the disconnection occurs. The task is a non-urgent task, is executed at the timing of 50ms, and has the priority of 14.
The failure detection task (S205) is specifically described as follows:
when the crankshaft rotating speed 1 or 2 is judged to be broken, once a certain rotating speed is judged to be invalid, a non-invalid rotating speed signal is introduced by starting the interruption of an ECT (emission computed tomography) catching channel of the non-invalid rotating speed. And if the detection shows that the two paths of rotating speeds are invalid, carrying out emergency oil cut-off treatment on the diesel engine.
The reason why the interruption of the ECT capture channel which is opened by only one rotation speed at a certain moment is because if the phases of two rotation speed signals which are redundant to each other are the same or the phase difference time is in the us level, the jumping edges of the rotation speeds 1 and 2 of the crankshaft are the same or the interval time is in the us level, and because the singlechip responds to the time required by the interruption, the time is also in the us level according to the processing content in the rotation speed interruption of the crankshaft, the abnormal acquisition of the rotation speed interruption of one path is probably caused.
In addition, even if the phase difference of the two crankshaft rotating speed signals is large enough, the two crankshaft rotating speed signals can be normally collected. However, the two crankshaft rotation speeds frequently apply for interruption, which may affect the response speeds of the CAN1 receiving interruption (S231), the CAN2 receiving interruption (S232) and other interruptions, is not favorable for the stability of the system and the expansion of the system functions, and one of the crankshaft rotation speed signals does not work when the rotation speed signal is not disconnected.
State management task (S211): the method comprises the steps of judging the running state of the diesel engine according to the running parameters of the diesel engine and the operation intention of an operator, setting a corresponding state mark when the running state is transferred, providing reference for other tasks, and being the core of task scheduling. The task is a non-urgent but important task and is executed in a timing mode, the timing time is 20ms and the priority is 7 in consideration of the characteristic that the running speed of the low-speed machine is low (less than 300 revolutions per minute).
Switching amount detection task (S203): the detection of key signals (such as the running state of a cylinder lubricating oil pump, the pressure state of cooling water and the like) and external operation buttons (such as starting, stopping and the like) of the diesel engine is completed, and a basic basis is provided for a state management task (S211). The task is a non-emergency task, and the importance degree is generally that the task is executed in a timing mode, the timing time is 25ms, and the priority is 11, considering the operation speed of a human.
The switching value detection task (S203) is specifically described as follows:
in order to prevent jitter and accidental interference, a time delay method is adopted for software filtering in the task. The specific method comprises the following steps: and recording the current switching value state after detecting the level jump, delaying for 10ms, recording the switching value state again when the delay time is up, comparing the two states, if the two states are the same, judging that the detection result is valid, and otherwise, cancelling.
CAN transmission task (S222): the encapsulation of the control parameters is completed according to the running state of the diesel engine and is sent to other units through CAN1 and CAN 2. The task is an emergency task, the importance degree is generally determined to be triggered by the state management task (S211) through semaphore in consideration of the fact that the transmitted content is closely related to the running state of the diesel engine, and the priority is 9.
CAN data processing task (S208): the processing of the communication information of the CAN1 and the CAN2 is completed, and the control basis is provided for the system. The specific implementation is as follows: analyzing and processing the data of the buffer area after the CAN1 receives the interrupt and the data of the buffer area after the CAN2 receives the package in the interrupt, reading the buffer area, and setting the mark of the storage unit to be 'empty' immediately after reading one non-empty storage unit. The task is a non-urgent task, a certain time delay is allowed, the task is executed at a timing of 20ms, and the priority is 13.
The CAN data processing task (S208) is specifically described as follows:
reading the buffer area does not read one storage unit every time the CAN data processing task (S208) enters, but analyzes and processes the communication information in the buffer area until all the storage units in the buffer area are empty before the CAN data processing task (S208) is not deprived of the CPU use right by the mu/COS-II real-time operating system.
Calibration task (S207): the traditional calibration task is divided into two independent tasks: the method comprises a FLASH calibration task (S206) and a monitoring parameter return task (S217) so as to reduce the occupancy rate of the CPU resource in the calibration process of the calibration task (S207).
FLASH write task (S206): the method is characterized in that the online FLASH of the FLASH is completed, the data transmission quantity is large in the FLASH process, the total interruption needs to be closed in the FLASH process of a certain sector, the FLASH time of the sector and the real-time performance of other tasks are comprehensively considered, and the task adopts a timing execution mode. Considering that the operation speed of an operator of an upper computer is limited in practice, in order to not influence the FLASH writing process and ensure the real-time performance of other tasks, the task is determined to be executed at a timing of 2ms, and the priority is 15.
Parameter return task (S217): and (4) completing the return of related monitoring parameters required in the calibration process for the interface display and analysis of the upper computer. The task has large data transmission quantity when the calibration work is carried out, and the task priority is set to be the lowest and set to be 17 in order to avoid influencing the operation of other tasks. Since the most basic backhaul timing of the calibration task is 10ms, the timing time of the calibration task is set to 10ms, and other backhaul timings such as 50ms and 100ms in the task are generated in the task in a variable counting manner, so that the memory overhead is not additionally increased. The reason why the return timing can be generated in the task in this way is that the return timing is used for returning the monitoring variable at regular time, and the requirement on real-time performance is not high.
In order to facilitate the expansion of the tasks, the interval between the priorities of the tasks is 2-4.
The speed regulating unit of the marine low-speed high-pressure common rail diesel engine based on the mu/COS-II real-time operating system is shown in FIG. 2, and the relationship among tasks in the software structure is as follows:
the XGATE crankshaft rotation speed 1 interruption (S234) or the XGATE crankshaft rotation speed 2 interruption (S235) triggers the main CPU crankshaft rotation speed 1 interruption (S237) or the main CPU crankshaft rotation speed 2 interruption (S238) through an assembler instruction sif, the main CPU crankshaft rotation speed 1 interruption (S237) or the main CPU crankshaft rotation speed 2 interruption (S238) triggers a control parameter calculation task (S215) in a manner of determining a crankshaft rotation angle in a semaphore manner, and transmits rotation speed information to a control quantity calculation task (S215) through a global variable, the triggering action of the semaphore represents (S224) and (S226), and the transmission relationship of the rotation speed information is (S223) and (S225).
The FLASH programming task (S206) and the parameter returning task (S217) share the same CAN, namely the CAN3(S107), so in order to prevent data confusion, the two tasks need to be restricted by a mutual exclusion relationship. The data exchange between the FLASH writing task (S206), the parameter returning task (S217) and the upper computer directly occurs between the single chip microcomputer RAM and the FLASH (S228), and the transmission relationship is (S227).
The specific process is as follows: the FLASH writing task (S206) writes the data which is set by the upper computer and needs to be written in the FLASH of the single chip microcomputer to finish the solidification of the calibration parameters, and the monitoring parameter returning task (S217) returns the corresponding monitoring parameters in the RAM of the single chip microcomputer to the upper computer according to the needs of the upper computer. And the data needing to be flashed and the monitoring parameters are selected by an upper computer.
The CAN data processing task (S208) reads CAN communication information in the buffer area from the CAN1 interrupt and the CAN2 interrupt, and the communication relationship is represented as (S218) and (S219). The analyzed and processed CAN communication information is transmitted to a fault detection task (S204) and a state management task (S210) through global variables, and data transmission relations are expressed as (S202) and (S209).
The state management task (S211) expresses the communication information transmitted by the CAN data processing task (S208) as a transmission relation (S209), an operation button signal and a diesel engine key signal of the switching value detection task (S203) are expressed as a transmission relation (S210), data related to control, such as rotating speed and the like, of the control value calculation task (S215), and fault information of the transmission relation (S212) and the fault detection task (S205) are comprehensively judged, so that the state of the diesel engine is finally judged, and a corresponding state flag is set.
The switching value detection task (S203) completes the detection of the operation button signal and the diesel engine key signal, and the detection content comprises the following steps: the operation result of the operator on the button and the key signal condition of the diesel engine. The detection result is transferred to the failure detection task (S205) and the state management task (S211) in the form of a global variable, and the transfer relationships are respectively expressed as (S204) and (S210).
The fault detection task (S205) comprehensively analyzes the current diesel engine state (generated by the state management task (S211), the transmission relationship is (S213)), the diesel engine operation parameters (generated by the CAN data processing task (S208), the transmission relationship is (S202)), the diesel engine key signals and the disconnection condition thereof (generated by the switching value detection task, the transmission relationship is (S204)), the control quantity (generated by the control parameter calculation task, the transmission relationship is (S214)) to obtain the fault state of the current diesel engine, and finally the fault state is fed back to the state management task (S211) (the transmission relationship is (S213)) and the control parameter calculation task (S215) (the transmission relationship is (S214)) in the form of global variables, so that the fault detection task is applied to the control of the whole diesel engine to achieve the aim of protecting the diesel engine.
Under the condition of the above task division and the relationship between tasks, after the system is powered on, in order to ensure the smooth start of the mu/COS-II real-time operating system, firstly, the total interrupt system is switched off, then, all hardware of the system is initialized, finally, the mu/COS-II real-time operating system is initialized, then, the semaphore of the communication between the tasks and the tasks is established, then, the mu/COS-II real-time operating system is started, finally, the total interrupt is started, and the mu/COS-II real-time operating system is operated to complete the scheduling of the tasks according to the functions of the tasks and the relationship between the tasks.

Claims (4)

1. A speed regulation unit of a marine low-speed common rail diesel engine based on a mu/COS-II real-time operation system is characterized in that: the method comprises the steps of (S229) an interruption task and (S201) a task scheduled by a mu/COS-II real-time operating system;
the interrupt task (S229) is divided into two parts: coprocessor XGATE interrupt (S230) and main CPU interrupt (S231); wherein: the XGATE preprocesses the speed measurement related interrupts and the CAN communication interrupts with other control units, i.e., the XGATE crankshaft rotation speed 1 interrupt (S234), the XGATE crankshaft rotation speed 2 interrupt (S235), the count overflow interrupt (S236), and the CAN1 reception interrupt (S231), the CAN2 reception interrupt (S232); the main CPU interrupt tasks include: a main CPU crankshaft rotation speed 1 interruption (S237), a main CPU crankshaft rotation speed 2 interruption (S238), an RTI timing interruption (S239) and a trap interruption (S240);
the tasks scheduled by the mu/COS-II real-time operating system comprise: the method comprises the following steps that a CAN data processing task (S208), a switching value detection task (S203), a state management task (S211), a CAN sending task (S222), a fault detection task (S205), a control value calculation task (S215), a FLASH programming task (S206) and a monitoring parameter returning task (S217);
the XGATE crankshaft rotation speed 1 interruption (S234) or the XGATE crankshaft rotation speed 2 interruption (S235) triggers the main CPU crankshaft rotation speed 1 interruption (S237) or the main CPU crankshaft rotation speed 2 interruption (S238) through an assembler instruction sif, the main CPU crankshaft rotation speed 1 interruption (S237) or the main CPU crankshaft rotation speed 2 interruption (S238) triggers a control parameter calculation task (S215) in a manner of determining a crankshaft rotation angle in a semaphore manner, and transmits rotation speed information to a control quantity calculation task (S215) through a global variable;
the FLASH programming task (S206) and the parameter returning task (S217) share the same CAN, namely the CAN3(S107), the two tasks are restricted by adopting a mutual exclusion relationship, a semaphore CanInUseState software is utilized, when entering one of the tasks, a tool function OSPENd () of a mu/COS-II real-time operating system is called to lock the used CAN communication resource, when jumping out of the task, OSPost () is called to release the used CAN communication resource, and the data exchange between the FLASH programming task (S206), the parameter returning task (S217) and an upper computer directly occurs between a single chip microcomputer RAM and a FLASH (S228), and the specific process is as follows:
the FLASH writing task (S206) writes the data which is set by the upper computer and needs to be written in the FLASH of the single chip microcomputer to finish the solidification of the calibration parameters, the monitoring parameter returning task (S217) returns the corresponding monitoring parameters in the RAM of the single chip microcomputer to the upper computer according to the needs of the upper computer, and the data which needs to be written in the FLASH and the monitoring parameters are selected by the upper computer;
the CAN data processing task (S208) reads CAN communication information transmitted by CAN1 interruption and CAN2 interruption in the buffer area, and the analyzed and processed CAN communication information is transmitted to the fault detection task (S204) and the state management task (S210) through global variables;
the state management task (S211) carries out comprehensive judgment on the communication information transmitted by the CAN data processing task (S208), the operation button signal and the diesel engine key signal of the switching value detection task (S203), the data related to control of the control value calculation task (S215) and the fault information of the fault detection task (S205), finally finishes judging the state of the diesel engine and sets a corresponding state mark;
the switching value detection task (S203) completes the detection of the operation button signal and the diesel engine key signal, and the detection content comprises the following steps: the operation result of the operator on the button, the condition of the key signal of the diesel engine, and the detection result are transmitted to a fault detection task (S205) and a state management task (S211) in the form of global variables;
the fault detection task (S205) comprehensively analyzes the current diesel engine state generated by the state management task (S211), the diesel engine operation parameters generated by the CAN data processing task (S208), the diesel engine key signals generated by the switching value detection task and the disconnection condition thereof, and the control quantity generated by the control parameter calculation task obtain the fault state of the current diesel engine, and finally the fault state is fed back to the state management task (S211) and the control parameter calculation task (S215) in the form of global variables, so that the fault state is used for controlling the whole diesel engine.
2. The marine low-speed common rail diesel engine speed regulation unit based on the mu/COS-II real-time operation system of claim 1, wherein: the CAN1 receives an interrupt (S231) and the CAN2 receives an interrupt (S232): the information of CAN1 and CAN2 is respectively received, and the specific process is realized as follows:
the coprocessor XGATE completes the processing of receiving interrupt (S231) of CAN1 and receiving interrupt (S232) of CAN2, packages the needed information in an ID number + data mode after filtering the information which is not needed by the unit, defines a first-in first-out buffer area in the shared RAM section of the XGATE and the main CPU, stores the CAN communication information which is received in the receiving interrupt (S231) of CAN1 and the receiving interrupt (S232) of CAN2 and packaged in an ID number + data mode, immediately searches for an empty storage unit after confirming that one frame of data is needed by the unit after entering the interrupt, stores the packaged information into the found storage unit, and sets the mark of the storage unit as 'full'.
3. The marine low-speed common rail diesel engine speed regulation unit based on the mu/COS-II real-time operation system of claim 1, wherein: the XGATE crankshaft speed 1 is interrupted (S234): recording the ECT channel count value of the crankshaft rotating speed 1 under the condition that the crankshaft 1 signal is normal, providing a basis for rotating speed calculation, and calculating a rotating speed pulse period;
said XGATE crankshaft speed 2 interruption (S235): and recording the ECT channel count value of the crankshaft speed 2 under the condition that the crankshaft speed 1 fails, providing a basis for speed calculation, calculating a speed pulse period, and replacing the interruption of the crankshaft speed 1 and completing the established function of the interruption of the crankshaft speed 1.
4. The marine low-speed common rail diesel engine speed regulation unit based on the mu/COS-II real-time operation system of claim 1, wherein: the counting overflow interruption (S236) is used for counting the counting overflow times of the ECT module (S113), the result is used as a basis for the revolution speed pulse period calculation,
the tachometer pulse period is calculated by:
SpdPulseT=(TimeOverCnt·65536+NowCnt-ExCnt)·k
SpdPulseT: the period of the pulse of the rotating speed is,
TimeOverCnt: the number of overflows is counted,
NowCnt: the count value of the ECT channel of this time,
ExCnt: the last time the ECT channel count value was counted,
k: the time constant is related to the frequency of each count.
CN201810778836.2A 2018-07-16 2018-07-16 Speed regulation unit of marine low-speed common rail diesel engine based on mu/COS-II real-time operation system Active CN109213027B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810778836.2A CN109213027B (en) 2018-07-16 2018-07-16 Speed regulation unit of marine low-speed common rail diesel engine based on mu/COS-II real-time operation system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810778836.2A CN109213027B (en) 2018-07-16 2018-07-16 Speed regulation unit of marine low-speed common rail diesel engine based on mu/COS-II real-time operation system

Publications (2)

Publication Number Publication Date
CN109213027A CN109213027A (en) 2019-01-15
CN109213027B true CN109213027B (en) 2021-07-16

Family

ID=64990525

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810778836.2A Active CN109213027B (en) 2018-07-16 2018-07-16 Speed regulation unit of marine low-speed common rail diesel engine based on mu/COS-II real-time operation system

Country Status (1)

Country Link
CN (1) CN109213027B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101038681A (en) * 2007-04-20 2007-09-19 哈尔滨工程大学 diesel engine operation data recorder and recoding method thereof
CN101042070A (en) * 2007-04-30 2007-09-26 哈尔滨工程大学 Multifunctional on-site control apparatus of diesel engine and control method thereof
CN101315312A (en) * 2008-03-31 2008-12-03 武汉理工大学 Diesel engine gas cylinder working condition monitor
KR100885638B1 (en) * 2008-03-19 2009-02-25 (주) 일성뉴텍 A refrigerator for maintaining the freshness of sliced raw fish
CN101413454A (en) * 2007-09-25 2009-04-22 株式会社电装 Engine control system designed to manage schedule of engine control tasks
CN101634251A (en) * 2009-04-24 2010-01-27 天津大学 Internal combustion engine electronic control developing system based on industrial personnel computer
CN101936234A (en) * 2010-07-22 2011-01-05 中国船舶重工集团公司第七一一研究所 Control unit for controlling IP (Intellectual Property) core by integrating multiple engines
CN105190556A (en) * 2013-04-19 2015-12-23 克罗诺安全公司 Task time allocation method allowing deterministic error recovery in real time
CN106644492A (en) * 2016-09-30 2017-05-10 武汉理工大学 Marine middle-and-low-speed diesel engine cylinder pressure online monitoring system based on FPGA

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101038681A (en) * 2007-04-20 2007-09-19 哈尔滨工程大学 diesel engine operation data recorder and recoding method thereof
CN101042070A (en) * 2007-04-30 2007-09-26 哈尔滨工程大学 Multifunctional on-site control apparatus of diesel engine and control method thereof
CN101413454A (en) * 2007-09-25 2009-04-22 株式会社电装 Engine control system designed to manage schedule of engine control tasks
KR100885638B1 (en) * 2008-03-19 2009-02-25 (주) 일성뉴텍 A refrigerator for maintaining the freshness of sliced raw fish
CN101315312A (en) * 2008-03-31 2008-12-03 武汉理工大学 Diesel engine gas cylinder working condition monitor
CN101634251A (en) * 2009-04-24 2010-01-27 天津大学 Internal combustion engine electronic control developing system based on industrial personnel computer
CN101936234A (en) * 2010-07-22 2011-01-05 中国船舶重工集团公司第七一一研究所 Control unit for controlling IP (Intellectual Property) core by integrating multiple engines
CN105190556A (en) * 2013-04-19 2015-12-23 克罗诺安全公司 Task time allocation method allowing deterministic error recovery in real time
CN106644492A (en) * 2016-09-30 2017-05-10 武汉理工大学 Marine middle-and-low-speed diesel engine cylinder pressure online monitoring system based on FPGA

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
共轨柴油机ECU的软件分层模型及实时多任务机制;谢辉 等;《内燃机学报》;20020131;第20卷(第1期);第31-35页 *
柴油发电机组数字式电子调速器设计与研究;况涪洪;《中国优秀硕士学位论文全文数据库 工程科技Ⅱ辑》;20140430(第4期);第23-45页 *

Also Published As

Publication number Publication date
CN109213027A (en) 2019-01-15

Similar Documents

Publication Publication Date Title
US6240340B1 (en) Control unit for vehicle and total control system therefor
US5490064A (en) Control unit for vehicle and total control system therefor
CN112613691B (en) Chip relay protection universal device
KR101522477B1 (en) Simulation method, system and program
CN108500978B (en) Robot control device and method and robot
CN107680204B (en) Vehicle data processing system for analyzing driving behaviors
JPS6127571B2 (en)
CN109213027B (en) Speed regulation unit of marine low-speed common rail diesel engine based on mu/COS-II real-time operation system
CN105240123B (en) The engine RPM monitoring method and ERM controller of use priority mode
WO2024140335A1 (en) Cpu resource allocation method and apparatus based on multi-core system and task processing method and apparatus based on multi-core system
EP4372576A1 (en) Sensor data access system
CN111897330A (en) Multi-sensor information processing method in different time domains
JPH11232148A (en) Method and system for measuring load rate of computer
US20080282248A1 (en) Electronic computing device capable of specifying execution time of task, and program therefor
CN110990139B (en) SMP scheduling method and system based on RTOS
CN107154085B (en) Processing method and processing device for vehicle-mounted diagnosis data
CN117909332A (en) Data processing system, method and computer storage medium
CN114635794B (en) Combustion condition determining method and device, electronic equipment and storage medium
CN114687865B (en) State machine following method of FADEC control software
CN221238645U (en) Low-cost diesel engine off-line heat-test-free test cabinet and test system
JP2914580B2 (en) Event-driven vehicle control computer
CN217380729U (en) Distributed electric control system of diesel engine
She et al. The Research of an On-demand Threaded Interrupt Technology of Serial Port Based on the Power Edge Smart Device
Huang et al. A Device Performance Data Acquisition System Based on Data Fusion Method
Mächtel et al. Measuring the influence of real-time operating systems on performance and determinism

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant