Electronic Control Unit
Patent Information
- Application Number
- JP2021148034
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2021-09-10
- Publication Date
- 2025-02-20
- Estimated Expiration
- 2041-09-10
AI Technical Summary
【0007】 本発明によれば、割り込みタスクが実行されたか否かを診断するにあたり、トレードオフ関係にある「精度」と「リソース」とを両立させることができる。
Smart Images

Figure 0007633911000010 
Figure 0007633911000011 
Figure 0007633911000012
Abstract
Description
[Technical field]
[0001] The present invention relates to an electronic control device mounted on a vehicle. [Background technology]
[0002] In an electronic control device mounted on a vehicle, for example, an interrupt process occurs in synchronization with a driver's operation or a crank signal. If the processing load of a controlled device is high at the time when the interrupt process occurs, the microcomputer built into the electronic control device may not be able to execute the task assigned to the interrupt process (interrupt task), and may continue to control the controlled device without executing the interrupt task. For this reason, as described in JP 2017-145784 A (Patent Document 1), a technology has been proposed that uses a map to predict the execution time of the next interrupt task according to the execution interval of the interrupt task, and diagnoses that the interrupt task has not been executed if the interrupt task is not executed at that execution time. [Prior art documents] [Patent documents]
[0003] [Patent Document 1] JP 2017-145784 A Summary of the Invention [Problem to be solved by the invention]
[0004] However, in the technology proposed in Patent Document 1, the execution time of the next interrupt task is predicted according to the execution interval of the immediately preceding interrupt task using a map, so that, for example, the transient state of the engine operating state is not taken into consideration, and it is difficult to achieve both "accuracy" and "resources", which are in a trade-off relationship. In other words, if "accuracy" is emphasized, the map becomes complex, increasing memory usage and processing time, whereas if "resources" is emphasized, the map becomes coarse and the execution time of the next interrupt task is predicted over a broad range, decreasing accuracy.
[0005] Therefore, an object of the present invention is to provide an electronic control device that can achieve both "accuracy" and "resources," which are in a trade-off relationship, when diagnosing whether an interrupt task has been executed. [Means for solving the problem]
[0006] The electronic control device includes a processor and a timing function, and the processor measures an execution interval of an interrupt task assigned to an interrupt process using the timing function; Using the equation of a circular arc that passes through three points, The execution time of the next interrupt task is predicted according to the execution interval of the interrupt task, and if the next interrupt task is not executed at the predicted execution time, it is diagnosed that the execution of the interrupt task has been skipped. Effect of the Invention
[0007] According to the present invention, when diagnosing whether an interrupt task has been executed, it is possible to achieve both "precision" and "resources," which are in a trade-off relationship. [Brief description of the drawings]
[0008] [Figure 1] FIG. 1 is a schematic diagram illustrating an example of an electronic control system mounted on a vehicle. [Diagram 2] FIG. 2 is a schematic diagram showing an example of an internal structure of an electronic control device. [Diagram 3] FIG. 11 is an explanatory diagram of a method for predicting the occurrence time of an interrupt task by a straight line method. [Figure 4] FIG. 11 is an explanatory diagram of a method for predicting the occurrence time of an interrupt task using the arc line method; [Diagram 5] FIG. 11 is an explanatory diagram of a method for diagnosing an omission of a task using a straight line method. [Figure 6] FIG. 11 is an explanatory diagram of a method for diagnosing a task omission using the arc line method. [Figure 7] 13 is a flowchart illustrating an example of a task omission diagnosis process. [Figure 8]FIG. 11 is an explanatory diagram showing an example of a measurement value for determining the execution timing of an interrupt task by the straight line method. [Figure 9] 11 is an explanatory diagram of the result of determining the execution timing of an interrupt task by the straight line method. FIG. [Figure 10] FIG. 11 is an explanatory diagram showing an example of a measurement value for determining the execution timing of an interrupt task using the arc line method; [Figure 11] 11 is an explanatory diagram of the results of determining the execution timing of an interrupt task by the arc line method; FIG. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0009] DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the accompanying drawings. The vehicle 100 is equipped with a plurality of electronic control devices 200 that electronically control, for example, an engine, an automatic transmission, an ABS (Antilock Brake System), an adaptive cruise control system, and the like. The plurality of electronic control devices 200 are connected to each other via an in-vehicle network 300 such as a CAN (Controller Area Network) so that any data can be transmitted and received between them. Here, the vehicle 100 may be a passenger car, a truck, a bus, a construction machine, or the like. Note that, although four electronic control devices 200 are installed in the vehicle 100 in the example shown in FIG. 1, more electronic control devices 200 may actually be installed.
[0010] As shown in FIG. 2, the electronic control device 200 has a built-in microcomputer including a processor 210 such as a CPU (Central Processing Unit), a non-volatile memory 220, a volatile memory 230, a timer 240, an input / output circuit 250, a communication circuit 260, and an internal bus 270.
[0011] The processor 210 is hardware that executes an instruction set (data transfer, calculation, control, management, etc.) described in an application program, and is composed of, for example, a calculation device, a register that stores instructions and data, peripheral circuits, etc. The non-volatile memory 220 is composed of, for example, a flash ROM (Read Only Memory) that can hold data even when the power supply is cut off, and holds an application program (computer program) for implementing this embodiment. The volatile memory 230 is composed of, for example, a dynamic RAM (Random Access Memory) that loses data when the power supply is cut off, and provides a storage area for temporarily storing data during the calculation process of the processor 210.
[0012] The timer 240 is composed of an electronic element such as a semiconductor device, and provides a timekeeping function of measuring time by counting an internal clock generated from a system clock. The input / output circuit 250 is composed of an A / D converter, a D / A converter, a D / D converter, etc., and provides an input / output function of analog signals and digital signals to / from external devices. The communication circuit 260 is composed of a CAN transceiver, etc., and provides a function of connecting to the in-vehicle network 300. The internal bus 270 is a path for exchanging data between devices, and includes an address bus for transferring addresses, a data bus for transferring data, and a control bus for transmitting timing and control information for actually performing input / output via the address bus and data bus.
[0013] In the electronic control device 200, for example, an interrupt process occurs in synchronization with an operation of the driver of the vehicle 100 or a crank signal. If the processing load of the controlled device is high at the time when the interrupt process occurs, the processor 210 of the electronic control device 200 cannot execute the interrupt task, and there is a risk that the control of the controlled device will continue without executing the interrupt task. If the interrupt task includes a signal input process, for example, a signal input during a transition period is skipped, causing a large change in the signal value before and after the signal input, making it impossible to smoothly control the controlled device.
[0014] Therefore, in order to detect a "task omission" in which the execution of an interrupt task is skipped, the processor 210 of the electronic control device 200 measures the execution interval of the interrupt task and predicts the execution time of the next interrupt task according to a number of consecutive execution intervals. Then, if the processor 210 of the electronic control device 200 executes the interrupt task at the predicted occurrence time, it diagnoses that a "task omission" has not occurred, and if the processor 210 does not execute the interrupt task at the predicted occurrence time, it diagnoses that a "task omission" has occurred.
[0015] The execution time of the next interrupt task can be predicted using the "straight line method" that uses a straight line passing through two points, or the "arc line method" that uses an arc (circle) passing through three points, as described in detail below.
[0016] <<Straight Line Method>> First, consider an orthogonal coordinate system, as shown in Figure 3, where the horizontal axis is the number of times an interrupt task is executed and the vertical axis is the execution interval of the interrupt task. Let Δt n-1 , the execution interval immediately before execution number n is Δt n Then, the point P in Cartesian coordinates n-1 (n-1,Δt n-1 ) and point Pn(n,Δt n ) can be expressed as follows using the line equation y=ax+b (a, b: constants).
number
[0017] If we calculate the constants a and b from these two equations, we get the following equations.
number
[0018] If we focus on the execution count n, the next execution time (n+1) of the interrupt task is Δt n+1 is the point P n-1 and point P n In this case, for the equation of the line y=ax+b, x=n+1,y=Δt n+1 Substituting the above, we obtain the following equation:
number
[0019] By substituting the constants a and b into the formula obtained in this way, it is possible to predict the execution time of the next interrupt task. Therefore, in the "straight line method" that uses a straight line passing through two points, it is possible to predict the occurrence time of the next interrupt task by using the formula obtained in this way. In this case, if the occurrence interval of the previous interrupt task is on an increasing or decreasing trend, the occurrence time of the next interrupt task can be predicted taking that trend into account.
[0020] <<Arc line method>> First, consider an orthogonal coordinate system, as shown in Figure 4, with the horizontal axis representing the number of interrupt task executions [times] and the vertical axis representing the execution interval [ms] of the interrupt task. Also, let Δt n-2 , the execution interval immediately before execution number n-1 is Δt n-1 , the execution interval immediately before execution number n is Δt n Then, the point P in Cartesian coordinates n-2 (n-2, Δt n-2 ), point P n-1 (n-1,Δt n-1 ) and point P n(n,Δt n ) is the equation of a circle that passes through three points x 2 +y 2 Since +ax+bx+c=0 (a, b, c: constants), it can be expressed as follows.
number
[0021] If we calculate the constants a, b, and c from these three equations, we get the following equations.
number
[0022] If we focus on the execution count n, the next execution time (n+1) of the interrupt task is Δt n+1 is the point P n-2 , point P n-1 and point P n In this case, the equation of the circle that passes through the three points is x 2 +y 2 For +ax+by+c=0, x=n+1, y=Δt n+1 Substituting the above, we obtain the following equation:
number
[0023] This formula is Δt n+1 Since this is a quadratic equation with variables, the solution of the quadratic equation can be expressed as follows. However, Δt n+1 ≧0.
number
[0024] By substituting the constants a, b, and c into the solution obtained in this way, it is possible to predict the execution time of the next interrupt task. Therefore, in the "arc line method" that uses an arc passing through three points, it is possible to predict the occurrence time of the next interrupt task by using the solution obtained in this way. In this case, if the occurrence interval of the previous interrupt task is on an increasing or decreasing trend, the occurrence time of the next interrupt task can be predicted taking that trend into account.
[0025] When implementing a process for predicting the execution timing of an interrupt task and a process for diagnosing a task dropout in the electronic control device 200, it is not realistic to store all of the measured values of the execution intervals of the interrupt tasks measured by the timer function in chronological order.
[0026] In the linear method, as shown in Fig. 5, when it is time to execute an interrupt task, the execution time T of the next (one time before) interrupt task is predicted from the measurement value t1 three times before and the measurement value t2 two times before, and it is possible to diagnose whether a task has been dropped or not by checking whether the immediately preceding measurement value t3 is within a range with a margin for this. Therefore, in the linear method, it is sufficient to store at least the measurements t1 to t3.
[0027] On the other hand, in the arc method, as shown in Fig. 6, when it is time to execute an interrupt task, the execution time T of the next interrupt task (one time before) is predicted from the measurement value t4 four times before, the measurement value t3 three times before, and the measurement value t2 two times before, and it is possible to diagnose whether a task has been dropped based on whether the previous measurement value t4 is within a range with a margin. Therefore, in the arc line method, it is sufficient to store at least the measurements t1 to t4.
[0028] In consideration of such considerations, the processor 210 of the electronic control device 200 measures the execution interval of the interrupt task, for example, by using a timer function of the timer 240. Then, the processor 210 of the electronic control device 200 stores the measured values t1 to t n (n=3 for the straight line method, n=4 for the circular arc method) and stored in chronological order. The processor 210 of the electronic control device 200 measures and stores the execution intervals of the interrupt tasks according to the application programs stored in the non-volatile memory 220.
[0029] 7 shows an example of a task omission diagnosis process executed by the processor 210 of the electronic control device 200 in synchronization with the execution of an interrupt task. The processor 210 of the electronic control device 200 executes the task omission diagnosis process in accordance with an application program stored in the non-volatile memory 220.
[0030] In step 10 (abbreviated as "S10" in FIG. 7, and the same applies below), the processor 210 of the electronic control device 200 refers to the volatile memory 230 and calculates the measured values t1 to t n Load.
[0031] In step 11, the processor 210 of the electronic control unit 200 predicts the execution time T of the interrupt task using the straight line method or the arc line method as described above, as will be explained in more detail below.
[0032] <<Straight Line Method>> In the linear method, as described above, the execution intervals t1 and t2 of the interrupt tasks are used to predict the execution time t3 of the next interrupt task. Therefore, in the above formula for predicting the execution time of the interrupt task in the linear method, the execution time Δt n+1 T, and the execution interval of the interrupt task is Δt n-1 and Δt n If we define these as t1 and t2, respectively, we obtain the following equation (where n=2).
number
[0033] The measured values t1 and t2 read in at step 10 are substituted into the equation thus obtained to predict the execution time T of the interrupt task.
[0034] <<Arc line method>> In the arc line method, as described above, the execution intervals t1 to t3 of the interrupt task are used to predict the execution time t4 of the next interrupt task. Therefore, in the above formula for predicting the execution time of the interrupt task in the arc line method, the execution time Δt n+1 T, and the execution interval of the interrupt task is Δt n-2 ~Δt n Assuming that n is t1 to t3, respectively, the following equation is obtained (where n=3).
number
[0035] The measured values t1 to t3 read in step 10 are substituted into the equation obtained in this manner to determine the constants a, b, and c, and the execution time T of the next interrupt task is predicted from these.
[0036] In step 12, the processor 210 of the electronic control device 200 calculates the lower limit of the range for diagnosing task omissions as "lower limit = (1 - α)T", where α is a constant (fixed value) indicating the ratio of the interrupt task to the execution time T, and is appropriately selected through, for example, experiments or simulations.
[0037] In step 13, the processor 210 of the electronic control device 200 calculates the upper limit value of the range for diagnosing task omission as "upper limit value = (1 + α)T". Therefore, the range for diagnosing task omission is set to have a width corresponding to the execution time T of the interrupt task as the center.
[0038] In step 14, the processor 210 of the electronic control device 200 calculates the measured value t n That is, it is determined whether the time from the execution of the previous interrupt task to the execution of the current interrupt task is equal to or greater than the lower limit. n If it is determined that the measured value t is equal to or greater than the lower limit (Yes), the process proceeds to step 15. n If it is determined that is less than the lower limit (No), the process proceeds to step 17.
[0039] In step 15, the processor 210 of the electronic control device 200 calculates the measured value t n Then, the processor 210 of the electronic control device 200 determines whether the measured value t n If it is determined that the measured value t is equal to or smaller than the upper limit value (Yes), the process proceeds to step 16. n If it is determined that exceeds the upper limit (No), the process proceeds to step 17.
[0040] In step 16, the processor 210 of the electronic control device 200 calculates the measured value t n was equal to or greater than the lower limit and equal to or less than the upper limit, it is determined that the interrupt task was executed at the predicted interrupt task execution time T, and it is diagnosed that there was no "task omission." After that, the processor 210 of the electronic control device 200 ends the task omission diagnosis process.
[0041] In step 17, the processor 210 of the electronic control device 200 calculates the measured value t n is less than the lower limit, or the measured value t n exceeded the upper limit, it is determined that the interrupt task was not executed at the predicted execution time T of the interrupt task, and a diagnosis is made that a "task omission" occurred. After that, the processor 210 of the electronic control device 200 ends the task omission diagnosis process.
[0042] According to this task omission diagnosis process, the processor 210 of the electronic control device 200 predicts the execution time T of the next interrupt task from the execution intervals of multiple interrupt tasks measured in the past, using the straight line method or circular arc method as described above, at the timing when the interrupt task is actually executed. The execution time T of the interrupt task predicted in this way indicates the time at a single point in time, and therefore includes, for example, measurement error, calculation error, etc. Therefore, a range is calculated with the predicted execution time T of the interrupt task as the center, with a width determined by taking into account a constant α indicating a predetermined ratio. The processor 210 of the electronic control device 200 then calculates the execution time T of the next interrupt task based on the execution interval t of the most recent interrupt task measured. n Whether or not a task omission has occurred can be diagnosed based on whether or not the time is within the above range.
[0043] Therefore, in the electronic control device 200 according to this embodiment, the execution time T of an interrupt task is predicted using the straight-line method or the circular arc method from the measured execution intervals of a plurality of interrupt tasks, so that it is possible to narrowly predict the execution time T of the interrupt task while preventing the control configuration from becoming complicated. Furthermore, because a map is not used, the transient state of the engine operating state is taken into consideration, making it possible to achieve both "precision" and "resources," which are in a trade-off relationship.
[0044] At this time, the width of the range is a predetermined ratio of the execution time T of the interrupt task, so the width is small when the execution time T is short, and the width is large when the execution time T is long. As a result, it is no longer necessary to make the range wider than necessary in order to suppress erroneous diagnosis, and the accuracy of diagnosis can be improved.
[0045] In order to facilitate understanding of this embodiment, a specific example will be given to explain the present embodiment.
[0046] <<Straight Line Method>> As shown in FIG. 8, the execution interval t1 of the interrupt task in the first execution is 2 [ms], and the execution interval t2 of the interrupt task in the second execution is 5 [ms]. In this case, as shown in FIG. 9, the execution time T of the interrupt task can be considered to be increasing, for example, reflecting the engine operating state. When the measured values t1=2 [ms] and t2=5 [ms] are respectively substituted into the equation for predicting the execution time T of the interrupt task by the linear method, the execution time T of the interrupt task becomes 8 [ms]. In FIG. 9, the straight line passing through points (1, 2) and (2, 5) also passes through point (3, 8), so it can be understood that the execution time T of the interrupt task thus obtained is correct.
[0047] <<Arc line method>> As shown in FIG. 10, the execution intervals t1 to t3 of the interrupt task for the first to third execution times are 2, 4, and 5 [ms], respectively. In this case, as shown in FIG. 11, it can be considered that the execution time T of the interrupt task has a tendency to gradually decrease in increasing rate, for example, reflecting the engine operating state. When the measured values t1=2 [ms], t2=4 [ms], and t3=5 [ms] are substituted into the equation for predicting the execution time T of the interrupt task by the arc line method, the constants a to c in the equation of the arc passing through the three points become -13, -1, and 10, respectively. When the constants a to c obtained in this way are substituted into the equation for predicting the execution time T of the interrupt task, T=5.60 [ms] is obtained. In FIG. 11, the arc passing through points (1,2), (2,4), and (3,5) also passes through point (4,5.60), so it can be understood that the execution time T of the interrupt task obtained in this way is correct.
[0048] In addition, when a task dropout occurs, for example, if the interrupt task includes a signal input process, the control parameters may change significantly during engine transient states, and the controlled device may not be smoothly controlled. For this reason, when the processor 210 of the electronic control device 200 diagnoses that a task dropout has occurred, the processor 210 may temporarily reduce the feedback gain for feedback control of the controlled device. In this way, even if the control parameters change significantly, the controlled device does not change significantly, and smooth control can be performed. Here, "temporarily" means limited to a short period of time, such as for a predetermined period of time or for a predetermined number of times, rather than permanently.
[0049] Furthermore, a person skilled in the art will easily understand that new embodiments can be created by omitting parts of the technical ideas of the various above-mentioned embodiments, combining parts of them appropriately, or replacing parts of them with well-known technology.
[0050] As an example, the execution time T of the interrupt task may be predicted not only when the interrupt task is actually executed, but also when the execution time of the interrupt task is measured. In this case, the predicted execution time T of the interrupt task is temporarily stored in the volatile memory 230, and can be acquired by referring to the volatile memory 230 when the processor 210 of the electronic control device 200 performs the task dropout diagnosis.
[0051] The crank signal is output by a sensor detecting the teeth of a signal plate that rotates integrally with the crankshaft. In this case, the signal plate has a tooth-missing portion that defines the reference position of the rotation angle of the crankshaft, and since the crank signal is not output over a predetermined angle at this tooth-missing portion, there is a possibility that an erroneous diagnosis will be made. For this reason, when the processor 210 of the electronic control device 200 detects a task dropout, it may then determine whether or not there was a tooth-missing portion, and cancel the diagnosis if it is determined that there was a tooth-missing portion. [Explanation of symbols]
[0052] 200 Electronic control device 210 Processor 230 Timer (timing function)
Claims
1. An electronic control device having a processor and a timing function, the processor is configured to measure an execution interval of an interrupt task assigned to an interrupt process using the timing function, predict a time when the next interrupt task will be executed according to three consecutive execution intervals using an equation of a circular arc passing through three points, and diagnose that the execution of the interrupt task has been skipped if the next interrupt task is not executed at the predicted execution time; Electronic control unit.
2. When the processor does not execute the next interrupt task within a range having a predetermined margin with respect to the predicted execution time of the interrupt task, the processor diagnoses that the execution of the interrupt task has been skipped. The electronic control device according to claim 1 .
3. The margin is calculated by multiplying the predicted execution time of the interrupt task by a predetermined ratio. The electronic control device according to claim 2 .
4. The predetermined ratio is a fixed value. The electronic control device according to claim 3.
Citation Information
Patent Citations
Device, method and medium for interruption
JP1999306029A
Interruption supporting circuit device, microcomputer, and interruption supporting method
JP2004252729A
Information output device, information output method and information output program
JP2014164633A
Electronic control device
JP2017145784A