Engine control device
By separating crank and reference position interrupt processing and prioritizing crank interrupt processing, the engine control device addresses interrupt omissions, ensuring stable and accurate engine control by minimizing processing delays and skips.
Patent Information
- Application Number
- JP2023220987
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-12-27
- Publication Date
- 2025-07-09
AI Technical Summary
Existing engine control systems face issues with the omission of interrupt processing due to overlapping startup requests for medium- and low-priority tasks, particularly at high rotational speeds, leading to incomplete execution of critical engine control functions.
The engine control device separates crank interrupt processing from reference position interrupt processing, allowing continuous execution of reference position interrupt processes at predetermined intervals and temporarily interrupting reference position processing during crank interrupt processing to ensure all tasks are completed without delay.
This approach effectively suppresses the occurrence of interrupt processing omissions, stabilizes engine control, and improves processing accuracy by reducing unintended skips and buffer area consumption, thereby enhancing the reliability of engine operations.
Smart Images

Figure 2025103536000001_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to an engine control device that executes interrupt processing by detecting a crank signal of a crank angle sensor.
Background Art
[0002] In an electronically controlled engine, a problem may occur in that subsequent interrupt processing may be missed, such as when the execution interval of interrupt processing synchronized with a crank signal becomes shorter as the rotational speed increases. As an example of a technique for dealing with such a problem, a technique has been proposed in which priorities are assigned to interrupt processing to suppress the omission of processing of high-priority tasks.
Prior Art Documents
Patent Documents
[0003]
Patent Document 1
Summary of the Invention
Problems to be Solved by the Invention
[0004] In the above prior art, when an interrupt handler makes a startup request for a high-priority task, all are processed. However, when startup requests for medium-priority tasks or low-priority tasks overlap, an instruction to ignore subsequent startup requests is included. For this reason, medium-priority tasks and low-priority tasks may be skipped without being processed.
[0005] Therefore, an object of one aspect of the present invention is to provide an engine control device capable of further suppressing the occurrence of omission of interrupt processing by detecting a crank signal.
Means for Solving the Problems
[0006] In an engine control device, when a processor detects an output of a crank angle sensor that outputs a crank signal as the crankshaft rotates, the processor executes crank interrupt processing. On the other hand, reference position interrupt processing is executed at each period in which the crank angle determined based on the output of the crank angle sensor becomes a predetermined reference position. And such an engine control device has the following configuration. That is, when there are a plurality of the reference position interrupt processes respectively executed at different reference positions, the processor continuously executes the plurality of the reference position interrupt processes at at least one reference position. And when the crank interrupt process occurs during the execution of the reference position interrupt process, the reference position interrupt process is interrupted and the crank interrupt process is executed, and when the crank interrupt process ends, the interrupted reference position interrupt process is resumed.
Effect of the Invention
[0007] According to one aspect of the present invention, it is possible to further suppress the occurrence of omission of interrupt processing due to detection of a crank signal.
Brief Description of the Drawings
[0008]
Figure 1
Figure 2
Figure 3
Figure 4
Figure 5
Figure 6
Figure 7
Figure 8
Figure 9
Figure 10
Figure 11
Figure 12
Figure 13
Embodiments for Carrying Out the Invention
[0009] Hereinafter, embodiments for carrying out the present invention will be described in detail with reference to the attached drawings. FIG. 1 shows an example of a control system for a four-cycle engine applied to a vehicle. The engine 100 includes a cylinder block 110, a piston 120, a crankshaft 130, a connecting rod 140, and a cylinder head 150. A cylinder bore 110A into which the piston 120 is reciprocally inserted is formed in the cylinder block 110. The crankshaft 130 is disposed below the cylinder block 110 so as to be relatively rotatable with respect to the cylinder block 110 via a bearing (not shown). The piston 120 is connected to the crankshaft 130 via the connecting rod 140 so as to be relatively rotatable.
[0010] The cylinder head 150 is formed with an intake port 150A for introducing intake air and an exhaust port 150B for discharging exhaust gas, respectively. When the cylinder head 150 is fastened to the upper surface of the cylinder block 110, the region partitioned by the cylinder bore 110A of the cylinder block 110, the crown surface of the piston 120, and the lower surface of the cylinder head 150 functions as a combustion chamber 160. An intake valve 180 that is opened and closed by an intake camshaft 170 is disposed at the open end of the intake port 150A facing the combustion chamber 160. Further, an exhaust valve 200 that is opened and closed by an exhaust camshaft 190 is disposed at the open end of the exhaust port 150B facing the combustion chamber 160.
[0011] At a predetermined position of the cylinder head 150 facing the combustion chamber 160, an electromagnetic fuel injection valve 210 for injecting fuel into the combustion chamber 160 and a spark plug 220 for igniting the air-fuel mixture of fuel and intake air are respectively attached. Note that the fuel injection valve 210 is not limited to a configuration in which fuel is directly injected into the combustion chamber 160, and may be a configuration in which fuel is injected into the intake port 150A, or a configuration including both of these.
[0012] At the end of the crankshaft 130, a crank plate 230 is attached. As shown in FIG. 2, the crank plate 230 is a detected member in which a disc-shaped plate portion 230A and a plurality of tooth portions 230B extending radially outward from the outer peripheral end of the plate portion 230A at every arbitrary predetermined angle are integrated. Further, a tooth notch portion 230C for identifying the position for every 360° of the crank angle is formed in the crank plate 230 by cutting a part of the tooth portion 230B. Here, the tooth notch portion 230C is formed by cutting two tooth portions 230B, but it may be formed by cutting an arbitrary number of tooth portions 230B. In the case of the three-cylinder engine 100, for example, when the predetermined angle is 6°, the crank plate 230 has 58 tooth portions 230B and a tooth notch portion 230C extending over 18° with two tooth portions 230B cut off. Note that the crank plate 230 may have two or more tooth notch portions 230C, and the predetermined angle may be an angle other than 6°.
[0013] At a predetermined location below the cylinder block 110 and facing the outer peripheral end of the crank plate 230, a crank angle sensor 240 for detecting the tooth portion 230B of the crank plate 230 and outputting a pulse signal is attached. Accordingly, the crank angle sensor 240 outputs a crank signal including a signal for every predetermined angle detecting the tooth portion 230B and a signal indicating that it is the tooth notch position for every 360° of the crank angle detecting the tooth notch portion 230C as the crankshaft 130 rotates.
[0014] At the end of the intake camshaft 170, a cam plate 250 is attached. As shown in FIG. 3, the cam plate 250 is a detected member in which a disc-shaped plate portion 250A and an arc-shaped detected portion 250B extending radially outward from a part of the outer peripheral end of the plate portion 250A are integrated.
[0015] Also, at a predetermined position on the upper part of the cylinder head 150 facing the outer peripheral end of the cam plate 250, a cam angle sensor 260 is attached that detects the detected portion 250B of the cam plate 250 and outputs a signal. The cam plate 250 is configured such that the cam angle sensor 260 outputs different signals at two tooth missing positions where the crank angle sensor 240 detects the tooth missing portion 230C of the crank plate 230 while the crankshaft 130 rotates twice. For example, the detected portion 250B of the cam plate 250 is attached such that the cam plate 250 outputs a LOW signal at the tooth missing position of the first rotation of the crankshaft 130 and a HIGH signal at the tooth missing position of the second rotation.
[0016] Therefore, the cam angle sensor 260 outputs cam signals of different levels according to whether it detects the detected portion 250B of the cam plate 250 or not. Thus, by monitoring such cam signals, for the crankshaft 130 that rotates at twice the rotational speed of the intake camshaft 170, it can be distinguished whether it is at the front position indicating that it is rotating during the first rotation (0° to 360°) corresponding to 0° to 180° of the intake camshaft 170, or at the back position indicating that it is rotating during the second rotation (360° to 720°) corresponding to 180° to 360° of the intake camshaft 170. In short, during one rotation of the intake camshaft 170, it can be distinguished whether the crankshaft 130 is at the front position indicating that it is rotating during the first rotation or at the back position indicating that it is rotating during the second rotation. Note that the cam plate 250 and the cam angle sensor 260 may be provided not only on the intake camshaft 170 but also on the exhaust camshaft 190 or both of them. Also, the cam plate 250 is not limited to the shape shown in FIG. 3, and may have any shape as long as it can output signals of different levels at the tooth missing position of the first rotation and the tooth missing position of the second rotation.
[0017] The engine control module (ECM) 270 includes a microcomputer 271. The microcomputer 271 includes a processor 272, a volatile memory 273, and a non-volatile memory 274. The processor 272 executes an application program stored in the non-volatile memory 274 while writing and reading data to and from the volatile memory 273 and the non-volatile memory 274. Also, the ECM 270 includes a communication interface (not shown) connected to the in-vehicle network and performs data communication with other in-vehicle devices. The crank signal of the crank angle sensor 240 and the cam signal of the cam angle sensor 260 described above are respectively input to the ECM 270. Also, in addition to the output signals of the crank angle sensor 240 and the cam angle sensor 260, the ECM 270 receives the output signals of a rotation speed sensor 280 that detects the rotation speed Ne of the engine 100, a load sensor 290 that detects the load Q of the engine 100, a water temperature sensor 300 that detects the water temperature Tw of the engine 100, and an air-fuel ratio sensor 310 that detects the air-fuel ratio A / F in the exhaust gas. Here, as the load Q of the engine 100, for example, state quantities closely related to the required torque of the engine 100 such as intake air flow rate, intake negative pressure, supercharging pressure, accelerator opening, and throttle opening can be used. The ECM 270 electronically controls the fuel injection valve 210 and the ignition plug 220 respectively according to the output signals of the crank angle sensor 240, the cam angle sensor 260, the rotation speed sensor 280, the load sensor 290, the water temperature sensor 300, and the air-fuel ratio sensor 310. In the following description, the execution of processing by the processor 272 included in the microcomputer 271 of the ECM 270 is simply referred to as being executed by the ECM 270. The ECM 270 is cited as an example of an engine control device.
[0018] The ECM 270 reads the rotational speed Ne and the load Q from the rotational speed sensor 280 and the load sensor 290 respectively, and calculates the basic fuel injection quantity according to the engine operating state based on these. Also, the ECM 270 reads the coolant temperature Tw from the coolant temperature sensor 300, and calculates the fuel injection quantity obtained by correcting the basic fuel injection quantity with the coolant temperature Tw. Then, the ECM 270 outputs a control signal corresponding to the fuel injection quantity to the fuel injection valve 210 at a timing according to the engine operating state, and causes the fuel injection valve 210 to inject fuel into the combustion chamber 160. Further, the ECM 270 outputs an actuation signal to the spark plug 220 at a timing according to the engine operating state after fuel injection, and ignites the air-fuel mixture of fuel and intake air. At this time, the ECM 270 reads the air-fuel ratio A / F from the air-fuel ratio sensor 310, and performs feedback control on the fuel injection valve 210 so that the air-fuel ratio A / F in the exhaust gas approaches the target air-fuel ratio.
[0019] Here, with reference to FIGS. 4 and 5, an outline of the method for calculating the crank angle and the method for cylinder discrimination by the ECM 270 will be described. In the following, the three-cylinder engine 100 will be taken as an example for description, but the number of cylinders of the engine 100 is not limited to three cylinders, and may be any number of cylinders.
[0020] As shown in FIG. 4, the crank angle sensor 240 outputs a crank signal that becomes pulsed HIGH when the tooth portion 230B of the crank plate 230 is detected, and becomes LOW (including the toothless portion 230C) when the tooth portion 230B of the crank plate 230 is not detected. On the other hand, the cam angle sensor 260 outputs a cam signal that becomes HIGH when the detected portion 250B of the cam plate 250 is detected, and becomes LOW when the detected portion 250B of the cam plate 250 is not detected. Then, when the toothless position (front-back discrimination position) is detected from the period ratio of the crank signal, i.e., the period ratio of the pulsed HIGH signal, the cam signal is read from the cam angle sensor 260 at the front-back discrimination position, and it is determined whether the level is LOW or HIGH. Specifically, at the front-back discrimination position, if the level of the cam signal is LOW, it is determined that the crankshaft 130 is at the front crank angle during the first rotation, and if the level of the cam signal is HIGH, it is determined that the crankshaft 130 is at the back crank angle during the second rotation.
[0021] Then, as shown in FIG. 5, based on the determination result of the crank angle determined by the above-described method, the ECM 270 increments a crank angle counter that periodically counts the crank angle at intervals of top dead center (TDC) corresponding to the number of cylinders. For example, the crank angle counter is set to 0 when the level of the cam signal is HIGH at the front / rear discrimination position. Also, at the front / rear discrimination position, when the level of the cam signal is LOW, it is set to 20. Further, when the crank angle counter reaches 39, the crank angle counter is reset to 0. In addition, when the detected crank signal is the crank signal immediately after the tooth missing position, the crank angle counter is incremented by 3 counts. At other timings, the crank angle counter is incremented by 1 in synchronization with the crank signal. Then, when the crank angle counter is 0, the cylinder position is determined. The cylinder position can be determined, for example, by the level of the cam signal and the nearest cylinder position. In this way, by determining the crank angle and the cylinder position, it becomes possible to appropriately set the ignition timing for each cylinder at each period in which the crank angle reaches a predetermined reference position. For example, it is possible to preset the timing when the crank angle counter is 15 as a reference position and perform the ignition timing setting process for each cylinder at the reference position.
[0022] Here, the details of the process executed when the crank angle sensor 240 detects the tooth portion 230B of the crank plate 230 and possible problems will be described. As shown in FIG. 6, when the crank angle sensor 240 detects "1" of the tooth portion 230B of the crank plate 230 and outputs a crank signal, an interrupt request for the interrupt handler operating in the ECM 270 is generated (P11). When the interrupt request is generated, the ECM 270 starts the software processing of the interrupt function by the interrupt handler (P12) and clears the interrupt request (P13). Then, the ECM 270 executes various calculations in the interrupt function corresponding to the detection of "1" of the tooth portion 230B. The processing executed every time such a crank signal is detected is hereinafter referred to as crank interrupt processing. The crank interrupt processing includes a crank angle determination process.
[0023] When the engine 100 is rotating at a low speed, an interrupt request due to the detection of "2" of the next tooth part 230B occurs after the previous crank interrupt process ends. In this state, the crank interrupt process based on the detection of "2" of the next tooth part 230B is executed without problems. However, as shown on the right side of FIG. 6, when the rotational speed of the engine 100 increases and the processing load of the ECM 270 increases, the following problems may occur. That is, before the crank interrupt process executed due to the occurrence of the interrupt request (P111) by the detection of "11" of the previous tooth part 230B ends, an interrupt request (P121) due to the detection of "12" of the next tooth part 230B occurs. In this case, the ECM 270 starts the next crank interrupt process (P122) by the interrupt handler at the timing when the crank interrupt process based on the detection of "11" of the tooth part 230B ends, clears the interrupt request (P123), and executes the crank interrupt process based on the detection of "12" of the tooth part 230B. Then, further, before the crank interrupt process ends, an interrupt request due to the detection of "13" of the next tooth part 230B occurs (P131). So far, the interrupt handler can accept the interrupt request. Therefore, the ECM 270 can execute the crank interrupt process (P132) at the timing when the crank interrupt process based on the detection of "12" of the tooth part 230B ends. However, further, when an interrupt request due to the detection of "14" of the next tooth part 230B occurs (P141), the interrupt request of the interrupt handler has not been cleared yet (P133), and it is impossible to accept the interrupt request. In this case, the crank interrupt process to be executed by this interrupt request will be skipped and not executed. Thus, if the next interrupt request occurs before the interrupt request accepted by the interrupt handler is cleared, an unexpected skip of the crank interrupt process will occur.
[0024] Here, in the ECM 270, in addition to such crank interrupt processing, various processes associated with the driving of the engine 100 are executed at a predetermined cycle of the aforementioned crank angle. Such processes include, for example, ignition timing setting processing as shown in FIG. 5 described above, engine 100 rotation speed calculation processing, fuel injection setting processing, knocking detection processing, and the like. When the engine 100 has three cylinders as in the present embodiment, these processes are executed at a cycle of every 240°. Hereinafter, these processes are referred to as reference position interrupt processing. Such reference position interrupt processing is executed when the value of the crank angle counter becomes a predetermined value set as the reference position, respectively.
[0025] Compared with the crank interrupt processing, such reference position interrupt processing generally requires a long processing time. FIG. 7 shows an example of the processing when the reference position interrupt processing is further executed in addition to the aforementioned crank interrupt processing. In this example, it is assumed that the reference position interrupt processing is executed after the crank interrupt processing by detecting "3" of the tooth portion 230B. However, as described above, since the processing time of the reference position interrupt processing is long, the execution of the crank interrupt processing by detecting "4" of the tooth portion 230B of the next crank plate 230 is delayed. For this reason, an interrupt request by detecting "5" of the tooth portion 230B cannot be received, and the said processing will be missed.
[0026] Therefore, in the embodiment described below, the execution of various reference position interrupt processes respectively executed at a cycle (240° cycle) in which the crank angle becomes a predetermined reference position is separated from the crank interrupt processing by detecting the tooth portion 230B of the crank plate 230. At this time, when there are a plurality of reference position interrupt processes respectively executed at different reference positions, the plurality of the reference position interrupt processes are continuously (collectively) executed at at least one reference position.
[0027] FIG. 8 shows an example of the processing when the reference position interrupt processing is executed in such a manner. In the present embodiment, the ECM 270 sequentially executes the crank interrupt processing regardless of whether the reference position interrupt processing is executed. Then, for example, when the ECM 270 executes the reference position interrupt processing after the crank interrupt processing by detecting "3" of the tooth portion 230B is executed, the following processing is performed. That is, after the execution of the reference position interrupt processing, when the crank interrupt processing by detecting "4" of the tooth portion 230B of the next crank plate 230 occurs, the reference position interrupt processing is interrupted (temporarily stopped), and the crank interrupt processing is executed. Then, when the crank interrupt processing ends, the interrupted reference position interrupt processing is resumed. Further, when the crank interrupt processing by detecting "5" of the tooth portion 230B of the next crank plate 230 is executed, the reference position interrupt processing is interrupted again. In the reference position interrupt processing here, the reference position interrupt processing executed at 240° intervals, for example, the ignition timing setting processing, the fuel injection setting processing, the knocking detection processing, etc. are continuously executed.
[0028] FIG. 9 shows the processing method of this embodiment more specifically. When the crank angle sensor 240 detects "3" of the tooth portion 230B of the crank plate 230 and outputs a crank signal, an interrupt request for the interrupt handler operating in the ECM 270 occurs (P31). When the interrupt request occurs, the ECM 270 starts the crank interrupt processing by the interrupt handler (P32) and clears the interrupt request (P33). Then, the ECM 270 executes the crank interrupt processing by detecting "3" of the tooth portion 230B of the crank plate 230.
[0029] Here, after the crank interrupt process is completed, ECM270 performs buffer processing to store the data used for the reference position interrupt process in the buffer of the memory. Then, when the buffer processing is completed (P1001), ECM270 starts the reference position interrupt process by the interrupt handler (P1002). As described above, this reference position interrupt process includes various reference position interrupt processes that are executed at a 240° cycle respectively. Here, ECM270 executes the reference position interrupt process, but when an interrupt request due to the detection of "4" in the tooth portion 230B of the crank plate 230 occurs (P41), and when the crank interrupt is executed (P42), the reference position interrupt process is interrupted (P1003). At this time, ECM270 saves the information related to the reference position interrupt process to the stack. Then, ECM270 clears the interrupt request (P43) and executes the crank interrupt process. Further, when the crank interrupt process due to the detection of "4" in the tooth portion 230B of the crank plate 230 is completed (P1004), ECM270 resumes the interrupted reference position interrupt process using the information saved to the stack.
[0030] Next, the process executed by ECM270 will be described with reference to the flowcharts shown in FIGS. 10 to 12. FIG. 10 shows the crank interrupt process. The crank interrupt process is executed when the crank angle sensor 240 detects the tooth portion 230B of the crank plate 230 and outputs a crank signal. In step 1001 (denoted as S1001 in the figure. The same applies hereinafter), ECM270 performs arithmetic processing of the crank angle counter. The details of the arithmetic processing will be described separately later.
[0031] In step 1002, ECM270 determines whether the crank angle counter is 0. If the crank angle counter is 0, the process proceeds to step 1003 (Yes), and if not, the process proceeds to step 1004 (No). In step 1003, the ECM 270 performs a cylinder position determination process. As an example, the ECM 270 can determine the cylinder position as follows based on the level of the cam signal and the most recent cylinder position. First, when the most recent cylinder is cylinder 3, it is determined to be cylinder 1. Also, when the most recent cylinder is not cylinder 3 and the level of the cam signal is LOW, the ECM 270 determines that it is cylinder 2. Further, when the most recent cylinder is not cylinder 3 and the level of the cam signal is HIGH, the ECM 270 determines that it is cylinder 3.
[0032] In step 1004, the ECM 270 determines whether the crank angle counter is at the reference position. The reference position can be set in advance as a constant in the non-volatile memory 274, for example. In this embodiment, as an example, it is assumed that the position of the crank angle counter is set as the reference position at 15. If the crank angle counter is at the reference position, the process proceeds to step 1005 (Yes); otherwise, the process ends (No).
[0033] In step 1005, the ECM 270 performs a buffer process of storing the data used for the reference position interrupt process in the buffer of the memory. In this embodiment, as described above, the reference position interrupt process is executed separately from the crank interrupt process. And the reference position interrupt process may be interrupted by the next crank interrupt process depending on the case. For this reason, the ECM 270 stores the data in the buffer of another area in advance to avoid the data used in the reference position interrupt process being overwritten when the reference position interrupt process is interrupted by the next crank interrupt process. In step 1006, the ECM 270 issues an interrupt request for the reference position interrupt process by the interrupt handler. Thereby, the reference position interrupt process described later is executed.
[0034] Figure 11 shows the arithmetic processing of the crank angle counter. In step 1011, the ECM 270 determines whether it is at the tooth missing position of the crank plate 230 based on the crank signal. If it is not at the tooth missing position, it proceeds to step 1012 (No), and if it is at the tooth missing position, it proceeds to step 1017 (Yes). In step 1012, the ECM 270 determines whether the crank angle counter is 39. Note that this value of 39 is the maximum value of the count number per cycle (240 degrees / tooth pitch 6 degrees - 1) in the case of a three-cylinder engine. If the crank angle counter is not 39, it proceeds to step 1013 (No), and if the crank angle counter is 39, it proceeds to step 1016 (Yes). In step 1013, the ECM 270 determines whether the detected crank signal is the crank signal immediately after the tooth missing position. If it is not the crank signal immediately after the tooth missing position, it proceeds to step 1014 (No), and if it is the crank signal immediately after the tooth missing position, it proceeds to step 1015 (Yes).
[0035] In step 1014, the ECM 270 adds 1 to the crank angle counter. In step 1015, the ECM 270 adds 3 to the crank angle counter. In step 1016, the ECM 270 sets the crank angle counter to 0. In step 1017, the ECM 270 determines whether the voltage level indicated by the cam signal is HIGH. If the voltage level indicated by the cam signal is LOW, it proceeds to step 1018 (No), and if the voltage level indicated by the cam signal is HIGH, it proceeds to step 1019 (Yes). In step 1018, the ECM 270 sets the crank angle counter to 20. In step 1019, the ECM 270 sets the crank angle counter to 0.
[0036] Figure 12 shows the reference position interrupt process. As described above, the reference position interrupt process is a process that is executed every predetermined cycle of the crank angle (240° in the case of a three-cylinder engine). In step 1021, the ECM 270 calculates the timing for igniting the spark plug 220 and executes an ignition timing setting process for setting the timing. In step 1022, the ECM 270 executes a fuel injection setting process for setting the fuel to be injected from the fuel injection valve 210. In step 1023, the ECM 270 executes a knocking determination process. Note that the processes of these steps 1021 to 1023 are merely an example of the processes that can be included in the reference position interrupt process, and various other processes can also be executed.
[0037] Here, as described with reference to FIGS. 8 and 9, when the crank interrupt process is executed during the execution of this reference position interrupt process, the reference position interrupt process is interrupted. At this time, the information related to the reference position interrupt process is saved on the stack. Also, after the interruption, when the crank interrupt process ends, the reference position interrupt process is resumed based on the information saved on the stack and the information stored in the buffer by buffer processing.
[0038] According to such an embodiment, the reference position interrupt process executed at each predetermined cycle of the crank angle is executed separately from the crank interrupt process. At this time, in the above-described embodiment, if there are reference position interrupt processes executed at different reference positions, they are grouped together at one reference position and executed continuously. Then, during the execution of the crank interrupt process with a higher priority than the reference position interrupt process, the reference position interrupt process is interrupted and resumed when the crank interrupt process ends. By having such a configuration, it is possible to suppress the delay of the crank interrupt process due to the execution of the reference position interrupt process, and reduce the occurrence of processing waits. As a result, it is possible to suppress the occurrence of interrupts being skipped and unintended processing omissions. Furthermore, since the occurrence of processing omissions can be suppressed in this way, for example, the necessity of control to reduce the processing load by thinning out interrupt processes with low priority in advance can also be reduced. Also, since the occurrence of waiting for the crank interrupt process can be suppressed, the consumption of the buffer area that may occur during such waiting for the interrupt can also be reduced. Therefore, while suppressing the cost required for the hardware resources of the ECM 270, it is possible to more stably realize engine control processing and further improve the processing accuracy.
[0039] In this embodiment, the reference position interrupt process is separated from the crank interrupt process as described above. However, for a part of the reference position interrupt process, it may be executed together with the crank interrupt process as before. For example, for the process with a priority higher than a predetermined standard in the reference position interrupt process, interrupts due to the crank interrupt process occurring during the execution of the reference position interrupt process may not be performed. Also, even in such a configuration, for example, when the processing load is high, the process may be separated from the crank interrupt. Also, it is not always necessary to group all the reference position interrupt processes at a single reference position. Instead, they may be grouped and executed at multiple positions respectively. As a specific example, ignition timing setting processing may be executed at a position of BTDC90° which is 90° before top dead center, fuel injection setting processing may be performed at a position of BTDC60° which is 60° before top dead center, and other processes may be grouped at any of these positions.
[0040] Furthermore, as another modification example of this embodiment, the processing may be changed according to the processing load situation of the ECM270. Here, in the above description, when the crank angle is the reference position, buffer processing is performed following the crank interrupt processing, but it is not necessarily configured in this way. Also, at this time, the crank angle information used in the reference position interrupt processing may be corrected according to the number of crank interrupt processes executed during the execution of the reference position interrupt processing, that is, the number of times the reference position interrupt processing is interrupted by the execution of the crank interrupt. For example, in the ignition timing setting processing, when the ignition timing is set to be 90° after the reference position, if the crank interrupt processing is executed twice during the reference position interrupt processing, it may be corrected and set to be 78° after (90° - 12° (6° × 2 times)). By making such a correction, it becomes possible to suppress the decrease in the accuracy of various set values due to the passage of processing time in the reference position interrupt processing which requires a longer processing time compared to the crank interrupt processing.
[0041] Furthermore, as an example of changing the processing according to the processing load status of the ECM270, in order to further suppress an unintended processing omission, different processes may be executed according to whether the number of crank interrupt processes from the start to the completion of the reference position interrupt process is equal to or greater than a predetermined number. As a specific example, the following configuration can be adopted. First, when the number of crank interrupt processes from the start to the completion of the reference position interrupt process reaches 5 times (30°) or more, as a first step, thin out the crank interrupt processes. Also, for example, change the ignition timing set in the reference position interrupt process to the TDC two ahead from the most recent TDC. At this time, for the first time during the change, it may be set to two, i.e., the most recent TDC and the TDC one ahead. Then, when the number of crank interrupt processes from the start to the completion of the reference position interrupt process reaches 10 times (60°) or more, as a second step, stop ignition and fuel injection to reduce the rotational speed of the engine 100 itself. Although such a situation usually does not occur, it is assumed that there is a problem in communication via the in-vehicle network or a problem in the program that requires a long time for the processing of the reference position interrupt process.
[0042] Also, as a modification of this embodiment, when the processor 272 of the microcomputer 271 incorporated in the ECM270 has a plurality of cores, as shown in FIG. 13, it is also possible to distribute and execute various processes included in the reference position interrupt process on each core. For example, when the processor 272 of the microcomputer 271 is a quad-core processor having four cores from core 0 to core 3, the processes can be distributed as follows. That is, in the processor 272, for example, the clock interrupt process can be executed on core 0, the ignition timing setting process among the reference position interrupt processes can be executed on core 1, the fuel injection setting process can be executed on core 2, and the knocking determination process can be executed on core 3. By distributing the processes among a plurality of cores in this way, it is possible to reduce the processing load on each core and further suppress the processing delay caused by the reference position interrupt process.
[0043] Those skilled in the art will easily understand that new embodiments can be created by omitting a part of the technical idea of the various above-described embodiments, appropriately combining a part thereof, or replacing a part thereof with well-known techniques.
Description of Reference Numerals
[0044] 130…Crankshaft 240…Crank Angle Sensor 260…Cam Angle Sensor 270…ECM (Engine Control Unit), 272…Processor
Claims
1. An engine control device that executes crank interruption processing when a processor detects an output of a crank angle sensor that outputs a crank signal as the crankshaft rotates, and executes reference position interruption processing at each period in which the crank angle determined based on the output of the crank angle sensor becomes a predetermined reference position, wherein: when there are a plurality of the reference position interruption processes respectively executed at different reference positions, the processor continuously executes the plurality of the reference position interruption processes at at least one reference position, and when the crank interruption process occurs during the execution of the reference position interruption process, interrupts the reference position interruption process to execute the crank interruption process, and when the crank interruption process ends, resumes the interrupted reference position interruption process; Engine control device.
2. The engine control device according to claim 1, wherein the processor changes the content of the reference position interruption process according to the number of times the reference position interruption process is interrupted due to the occurrence of the crank interruption process during the execution of the reference position interruption process.
3. The engine control device according to claim 2, wherein the processor corrects the crank angle information used in the reference position interruption process according to the number of times the reference position interruption process is interrupted.
4. The engine control device according to claim 1, wherein for a reference position interruption process whose priority is higher than a predetermined reference, the processor does not interrupt the process due to the crank interruption process occurring during the execution of the reference position interruption process.
5. The engine control device according to claim 1, wherein the processor includes a plurality of cores, and each of the plurality of the reference position interruption processes is executed in a distributed manner by different cores.
Citation Information
Patent Citations
Electronic control device
JP2000034947A