KR102451821B1 - Bidirectional microcomputer monitoring method - Google Patents

Bidirectional microcomputer monitoring method Download PDF

Info

Publication number
KR102451821B1
KR102451821B1 KR1020200174598A KR20200174598A KR102451821B1 KR 102451821 B1 KR102451821 B1 KR 102451821B1 KR 1020200174598 A KR1020200174598 A KR 1020200174598A KR 20200174598 A KR20200174598 A KR 20200174598A KR 102451821 B1 KR102451821 B1 KR 102451821B1
Authority
KR
South Korea
Prior art keywords
microcomputer
task
monitoring
state
period
Prior art date
Application number
KR1020200174598A
Other languages
Korean (ko)
Other versions
KR20220084775A (en
Inventor
전동진
김교민
원인정
현성환
Original Assignee
현대오토에버 주식회사
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 현대오토에버 주식회사 filed Critical 현대오토에버 주식회사
Priority to KR1020200174598A priority Critical patent/KR102451821B1/en
Publication of KR20220084775A publication Critical patent/KR20220084775A/en
Application granted granted Critical
Publication of KR102451821B1 publication Critical patent/KR102451821B1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2205Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested
    • G06F11/2236Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested to test CPU or processors
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2273Test methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/26Functional testing
    • G06F11/27Built-in tests
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/42Bus transfer protocol, e.g. handshake; Synchronisation
    • G06F13/4282Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Software Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Debugging And Monitoring (AREA)
  • Microcomputers (AREA)

Abstract

양방향 마이컴 모니터링 방법이 개시된다. 본 발명의 양방향 마이컴 모니터링 방법은 제1 마이컴이 MC 태스크(Monitoring Controller Task, MC Task)를 수행하고 제2 마이컴이 MU 태스크(Monotoring Unit Task, MU Task)를 수행하는 단계; 제2 마이컴이 제1 마이컴의 MC 태스크 수행 주기를 모니터링하여 모니터링 결과에 따라 제2 마이컴의 MC 태스크 수행 시점에 대한 옵셋값을 산출하는 단계; 및 제2 마이컴이 옵셋값에 따라 MC 태스크를 수행하는 단계를 포함하는 것을 특징으로 한다.A two-way microcomputer monitoring method is disclosed. The two-way microcomputer monitoring method of the present invention comprises the steps of: a first microcomputer performing an MC task (Monitoring Controller Task, MC Task) and a second microcomputer performing an MU task (Monitoring Unit Task, MU Task); calculating, by the second microcomputer, an MC task execution period of the first microcomputer, and calculating an offset value for the MC task execution time of the second microcomputer according to the monitoring result; and performing, by the second microcomputer, the MC task according to the offset value.

Figure R1020200174598
Figure R1020200174598

Description

양방향 마이컴 모니터링 방법{BIDIRECTIONAL MICROCOMPUTER MONITORING METHOD}Bidirectional microcomputer monitoring method {BIDIRECTIONAL MICROCOMPUTER MONITORING METHOD}

본 발명은 양방향 마이컴 모니터링 방법에 관한 것으로서, 더욱 상세하게는 2개의 마이컴이 서로 간에 모니터링을 수행하는 양방향 마이컴 모니터링 방법에 관한 것이다. The present invention relates to a two-way microcomputer monitoring method, and more particularly, to a two-way microcomputer monitoring method in which two microcomputers monitor each other.

일반적으로, 전자기기는 다수 개의 마이컴을 구비한다. 각각의 마이컴은 이상 상태를 모니터링하여 리셋을 수행하여 시스템을 초기화한다. 모니터링 방식에는 독립된 2개의 마이컴 중 어느 하나가 다른 하나의 마이컴을 모니터링하는 단방향 모니터링 방식 및 독립된 2개의 마이컴이 상호 모니터링하는 양방향 모니터링 방식이 있다. In general, an electronic device includes a plurality of microcomputers. Each microcomputer initializes the system by performing a reset by monitoring an abnormal state. The monitoring method includes a one-way monitoring method in which one of two independent microcomputers monitors the other microcomputer and a two-way monitoring method in which two independent microcomputers monitor each other.

단방향 모니터링 방식은 모니터링 마이컴의 이상 유무에 대한 판단을 할 수 없다. 이를 개선하기 위해 양방향 모니터링이 도입되었다. The unidirectional monitoring method cannot determine whether the monitoring microcomputer is abnormal. To improve this, two-way monitoring was introduced.

그러나, 종래의 양방향 모니터링 방식의 경우 2세트의 SPI 채널(Serial Peripheral Interface Channel)과 하드웨어 핀(디지털 핀)을 필요로 한다. 따라서, 양방향 모니터링 방식은 하드웨어 자원이 제한적이거나 이미 하드웨어가 결정된 상황에서는 적용하기가 어렵다. However, in the case of the conventional bidirectional monitoring method, two sets of SPI channels (Serial Peripheral Interface Channel) and hardware pins (digital pins) are required. Therefore, the bidirectional monitoring method is difficult to apply in a situation in which hardware resources are limited or hardware has already been determined.

또한 종래의 양방향 모니터링의 경우 단순 태스크 흐름과 연산에 관한 모니터링만 진행하기 때문에 모든 기능 안전 요구 사항을 만족시키지 못할 수도 있다. In addition, in the case of the conventional bidirectional monitoring, it may not satisfy all functional safety requirements because only monitoring of simple task flow and operation is performed.

본 발명의 배경기술은 대한민국 등록특허공보 10-1020889호(2011.03.02)의 '하이브리드 자동차의 제어기간 상호 감시방법'에 개시되어 있다.The background technology of the present invention is disclosed in 'Method for mutual monitoring between control periods of a hybrid vehicle' of Korean Patent No. 10-1020889 (March 02, 2011).

본 발명은 전술한 문제점을 개선하기 위해 창안된 것으로서, 본 발명의 일 측면에 따른 목적은 하나의 직렬 통신 포트를 통해서도 직렬 통신 충돌없이 양방향 모니터링을 수행할 수 있도록 한 양방향 마이컴 모니터링 방법을 제공하는 데 있다.The present invention has been devised to improve the above problems, and an object of one aspect of the present invention is to provide a bidirectional microcomputer monitoring method that enables bidirectional monitoring without serial communication collision even through one serial communication port. have.

본 발명의 일 측면에 따른 양방향 마이컴 모니터링 방법은 제1 마이컴이 MC 태스크(Monitoring Controller Task, MC Task)를 수행하는 단계; 상기 제2 마이컴이 상기 제1 마이컴의 MC 태스크 수행 주기를 모니터링하여 모니터링 결과에 따라 상기 제2 마이컴의 MC 태스크 수행 시점에 대한 옵셋값을 산출하는 단계; 및 상기 제2 마이컴이 상기 옵셋값에 따라 MC 태스크를 수행하는 단계를 포함하는 것을 특징으로 한다.A two-way microcomputer monitoring method according to an aspect of the present invention comprises the steps of: a first microcomputer performing an MC task (Monitoring Controller Task, MC Task); calculating, by the second microcomputer, an MC task execution period of the first microcomputer, and calculating an offset value for the MC task execution time of the second microcomputer according to a monitoring result; and performing, by the second microcomputer, an MC task according to the offset value.

본 발명은 상기 제1 마이컴이 MC 태스크를 수행하면, 상기 제2 마이컴이 상기 제1 마이컴으로부터 SPI 채널(Serial Peripheral Interface Channel)을 통해 전달된 연산 결과를 토대로 MU 태스크(Monotoring Unit Task, MU Task)를 수행하여 제1 마이컴의 정상 동작 여부를 판정하는 단계를 더 포함하는 것을 특징으로 한다.According to the present invention, when the first microcomputer performs the MC task, the second microcomputer performs a MU task (Monotoring Unit Task) based on the operation result transmitted from the first microcomputer through an SPI channel (Serial Peripheral Interface Channel). It characterized in that it further comprises the step of determining whether the normal operation of the first microcomputer by performing.

본 발명의 상기 제1 마이컴의 정상 동작 여부를 판정하는 단계는, 상기 제1 마이컴과 스테이트 동기를 맞추는 이닛 스테이트(Init State), 상기 제1 마이컴의 소프트웨어 버전을 확인하고 상기 제1 마이컴의 소프트웨어가 유효한지를 판단하는 크로스 체크 스테이트(Cross Check State), 파워 스토리지를 차단할 수 있는 셧-오프 패스에 대한 기능 이상 유무를 검사하는 프리드라이브 스테이트(Predrive State), 및 ADC(AD Converter) 기능 이상 유무, 인스트럭션(Instruction) 정상 유무, PFM(Program Flow Monitoring) 기능 이상 유무 중 적어도 하나를 검사하는 드라이빙 스테이트를 포함하는 것을 특징으로 한다.The step of determining whether the first microcomputer operates normally may include checking an init state that synchronizes the state with the first microcomputer, a software version of the first microcomputer, and the software of the first microcomputer. Cross Check State, which determines whether or not it is valid, Predrive State, which checks whether there is an abnormality in the shut-off path that can block power storage, and whether there is an abnormality in the ADC (AD Converter) function, instruction (Instruction) It is characterized in that it includes a driving state for checking at least one of whether there is a normal or not and whether there is an abnormality in the program flow monitoring (PFM) function.

본 발명은 상기 제2 마이컴이 MC 태스크를 수행하면, 상기 제1 마이컴이 상기 제2 마이컴으로부터 SPI 채널을 통해 전달된 연산 결과를 토대로 MU 태스크를 수행하여 상기 제2 마이컴의 정상 동작 여부를 판정하는 단계를 더 포함하는 것을 특징으로 한다. According to the present invention, when the second microcomputer performs the MC task, the first microcomputer performs the MU task based on the operation result transmitted from the second microcomputer through the SPI channel to determine whether the second microcomputer operates normally. It is characterized in that it further comprises a step.

본 발명의 상기 제2 마이컴의 정상 동작 여부를 판정하는 단계는, 상기 제2 마이컴과 스테이트 동기를 맞추는 이닛 스테이트, 상기 제2 마이컴의 소프트웨어 버전을 확인하고 상기 제2 마이컴의 소프트웨어가 유효한지를 판단하는 크로스 체크 스테이트, 파워 스토리지를 차단할 수 있는 셧-오프 패스에 대한 기능 이상 유무를 검사하는 프리드라이브 스테이트, 및 ADC 기능 이상 유무, 인스트럭션 정상 유무, PFM 기능 이상 유무 중 적어도 하나를 검사하는 드라이빙 스테이트를 포함하는 것을 특징으로 한다.The step of determining whether the second microcomputer operates normally may include checking an init state that synchronizes with the second microcomputer, a software version of the second microcomputer, and determining whether the software of the second microcomputer is valid. Includes a cross check state, a free drive state that checks whether there is an abnormality in the shut-off pass that can block power storage, and a driving state that inspects at least one of whether there is an abnormality in the ADC function, whether the instruction is normal or not, and whether there is an abnormality in the PFM function. characterized in that

본 발명의 상기 제2 마이컴의 MU 태스크 수행 주기는 상기 제1 마이컴의 MC 태스크 수행 주기보다 짧은 것을 특징으로 한다.According to the present invention, the MU task execution period of the second microcomputer is shorter than the MC task execution period of the first microcomputer.

본 발명의 상기 제2 마이컴이 상기 옵셋값에 따라 MC 태스크를 수행하는 단계에서, 상기 제2 마이컴은 상기 제1 마이컴의 MC 태스크의 주기 오차를 산출하고 상기 주기 오차를 토대로 상기 옵셋값을 보정하는 것을 특징으로 한다.In the step of the second microcomputer of the present invention performing the MC task according to the offset value, the second microcomputer calculates a periodic error of the MC task of the first microcomputer and corrects the offset value based on the periodic error characterized in that

본 발명의 상기 제2 마이컴은 상기 제1 마이컴이 MC 태스크 수행을 완료하여 상기 싱크 핀을 토글할 때마다 타이머 카운트값을 기록하고, 상기 타이머 카운트값을 이용하여 상기 제1 마이컴의 MC 태스크 수행 주기를 산출하고, 상기 제1 마이컴의 MC 태스크 수행 주기를 토대로 상기 주기 오차를 산출하는 단계를 포함하는 것을 특징으로 한다.The second microcomputer of the present invention records a timer count value whenever the first microcomputer completes the MC task execution and toggles the sync pin, and uses the timer count value to perform the MC task cycle of the first microcomputer , and calculating the period error based on the MC task execution period of the first microcomputer.

본 발명의 상기 제2 마이컴은 상기 주기 오차와 기 설정된 임계값을 비교하여 비교 결과에 따라 상기 옵셋값을 보정하는 것을 특징으로 한다.The second microcomputer of the present invention compares the period error with a preset threshold value and corrects the offset value according to the comparison result.

본 발명의 상기 제2 마이컴은 상기 주기 오차에 따라 상기 제2 마이컴의 MC 태스크 수행 시점을 변경하는 것을 특징으로 한다. The second microcomputer of the present invention is characterized in that the MC task execution time of the second microcomputer is changed according to the period error.

본 발명의 다른 측면에 따른 양방향 마이컴 모니터링 방법은 제1 마이컴이 MC 태스크(Monitoring Controller Task, MC Task)를 수행하는 단계; 상기 제2 마이컴이 상기 제1 마이컴으로부터 SPI 채널(Serial Peripheral Interface Channel)을 통해 전달된 연산 결과를 토대로 MU 태스크(Monotoring Unit Task, MU Task)를 수행하여 상기 제1 마이컴의 정상 동작 여부를 판정하고, 상기 제1 마이컴의 MC 태스크 수행 주기를 모니터링하여 모니터링 결과에 따라 상기 제2 마이컴의 MC 태스크 수행 시점에 대한 옵셋값을 산출하는 단계; 상기 제2 마이컴이 상기 옵셋값에 따라 MC 태스크를 수행하는 단계; 및 상기 제2 마이컴이 MC 태스크를 수행하면, 상기 제1 마이컴이 상기 제2 마이컴으로부터 SPI 채널을 통해 전달된 연산 결과를 토대로 MU 태스크를 수행하여 상기 제2 마이컴의 정상 동작 여부를 판정하는 단계를 포함하는 것을 특징으로 한다.A two-way microcomputer monitoring method according to another aspect of the present invention comprises the steps of: performing, by a first microcomputer, an MC task (Monitoring Controller Task, MC Task); The second micom performs a Monotoring Unit Task (MU Task) based on the operation result transmitted from the first micom through an SPI channel (Serial Peripheral Interface Channel) to determine whether the first micom operates normally, and , monitoring the MC task execution period of the first microcomputer and calculating an offset value for the MC task execution time of the second microcomputer according to the monitoring result; performing, by the second microcomputer, an MC task according to the offset value; and when the second microcomputer performs the MC task, the first microcomputer performs the MU task based on the operation result transmitted from the second microcomputer through the SPI channel to determine whether the second microcomputer operates normally. characterized by including.

본 발명의 상기 제2 마이컴의 MU 태스크 수행 주기는 상기 제1 마이컴의 MC 태스크 수행 주기보다 짧은 것을 특징으로 한다.According to the present invention, the MU task execution period of the second microcomputer is shorter than the MC task execution period of the first microcomputer.

본 발명의 상기 제2 마이컴이 상기 옵셋값에 따라 MC 태스크를 수행하는 단계에서, 상기 제2 마이컴은 상기 제1 마이컴의 MC 태스크의 주기 오차를 산출하고 상기 주기 오차를 토대로 상기 옵셋값을 보정하는 것을 특징으로 한다.In the step of the second microcomputer of the present invention performing the MC task according to the offset value, the second microcomputer calculates a periodic error of the MC task of the first microcomputer and corrects the offset value based on the periodic error characterized in that

본 발명의 상기 제2 마이컴은 상기 제1 마이컴이 MC 태스크 수행을 완료하여 상기 싱크 핀을 토글할 때마다 타이머 카운트값을 기록하고, 상기 타이머 카운트값을 이용하여 상기 제1 마이컴의 MC 태스크 수행 주기를 산출하고, 상기 제1 마이컴의 MC 태스크 수행 주기를 토대로 상기 주기 오차를 산출하는 단계를 포함하는 것을 특징으로 한다.The second microcomputer of the present invention records a timer count value whenever the first microcomputer completes the MC task execution and toggles the sync pin, and uses the timer count value to perform the MC task cycle of the first microcomputer , and calculating the period error based on the MC task execution period of the first microcomputer.

본 발명의 상기 제2 마이컴은 상기 주기 오차와 기 설정된 임계값을 비교하여 비교 결과에 따라 상기 옵셋값을 보정하는 것을 특징으로 한다.The second microcomputer of the present invention compares the period error with a preset threshold value and corrects the offset value according to the comparison result.

본 발명의 상기 제2 마이컴은 상기 주기 오차에 따라 상기 제2 마이컴의 MC 태스크 수행 시점을 변경하는 것을 특징으로 한다. The second microcomputer of the present invention is characterized in that the MC task execution time of the second microcomputer is changed according to the period error.

본 발명의 일 측면에 따른 양방향 마이컴 모니터링 방법은 마이컴의 MC 태스크를 기 설정된 옵셋에 따라 설정된 간격으로 동작함으로써, 하나의 직렬 통신 포트를 통해서도 직렬 통신 충돌없이 양방향 모니터링을 수행할 수 있다. The bidirectional microcomputer monitoring method according to an aspect of the present invention operates the MC task of the microcomputer at set intervals according to a preset offset, so that bidirectional monitoring can be performed without a serial communication collision even through one serial communication port.

본 발명의 다른 측면에 따른 양방향 마이컴 모니터링 방법은 소프트웨어적인 기법으로 기존 하드웨어가 결정된 상태나 하드웨어 자원이 제한적인 제어기에서도 양방향 모니터링에 관한 기능 안전을 만족시킬 수 있다. The bidirectional microcomputer monitoring method according to another aspect of the present invention can satisfy functional safety related to bidirectional monitoring even in a state in which existing hardware is determined or a controller having limited hardware resources using a software technique.

본 발명의 또 다른 측면에 따른 양방향 마이컴 모니터링 방법은 독립된 타임 윈도우(Time Window)의 두 마이컴의 태스크를 동기화시켜 보다 안정적으로 동작할 수 있도록 한다. The two-way microcomputer monitoring method according to another aspect of the present invention synchronizes the tasks of two microcomputers with independent time windows so that they can operate more stably.

도 1 은 본 발명의 일 실시예에 따른 양방향 마이컴 모니터링 장치의 블럭 구성도이다.
도 2 는 본 발명의 일 실시예에 따른 MMU 스테이트 다이어그램을 나타낸 도면이다.
도 3 은 본 발명의 일 실시예에 따른 MMC 스테이트 다이어그램을 나타낸 도면이다.
도 4 는 본 발명의 일 실시예에 따른 양방향 모니터링을 위한 MC 태스크와 MU 태스크의 주기를 나타낸 도면이다.
도 5 는 본 발명의 일 실시예에 따른 옵셋 보정 순서도이다.
도 6 은 본 발명의 일 실시예에 따른 옵셋이 보상된 MC 태스크와 MU 태스크의 주기를 나타낸 도면이다.
도 7 은 본 발명의 일 실시예에 따른 옵셋이 보상된 MC 태스크와 MU 태스크의 주기를 나타낸 도면이다.
도 8 은 본 발명의 일 실시예에 따른 이닛 스테이트 수행 과정을 나타낸 도면이다.
도 9 는 본 발명의 일 실시예에 따른 크로스 체크 스테이트 수행 과정을 나타낸 도면이다.
도 10 은 본 발명의 일 실시예에 따른 프리드라이브 스텝1 스테이트 수행 과정을 나타낸 도면이다.
도 11 은 본 발명의 일 실시예에 따른 프리드라이브 스텝2 스테이트 수행 과정을 나타낸 도면이다.
도 12 는 본 발명의 일 실시예에 따른 드라이빙 스테이트 수행 과정을 나타낸 도면이다.
1 is a block diagram of a bidirectional microcomputer monitoring apparatus according to an embodiment of the present invention.
2 is a diagram illustrating an MMU state diagram according to an embodiment of the present invention.
3 is a diagram illustrating an MMC state diagram according to an embodiment of the present invention.
4 is a diagram illustrating a cycle of an MC task and an MU task for interactive monitoring according to an embodiment of the present invention.
5 is a flowchart of offset correction according to an embodiment of the present invention.
6 is a diagram illustrating a cycle of an MC task and an MU task for which an offset is compensated according to an embodiment of the present invention.
7 is a diagram illustrating periods of an MC task and an MU task for which an offset is compensated according to an embodiment of the present invention.
8 is a diagram illustrating a process of performing an init state according to an embodiment of the present invention.
9 is a diagram illustrating a cross check state execution process according to an embodiment of the present invention.
10 is a diagram illustrating a process of performing a predrive step 1 state according to an embodiment of the present invention.
11 is a diagram illustrating a process of performing a predrive step 2 state according to an embodiment of the present invention.
12 is a diagram illustrating a driving state execution process according to an embodiment of the present invention.

이하에서는 본 발명의 일 실시예에 따른 양방향 마이컴 모니터링 방법을 첨부된 도면들을 참조하여 상세하게 설명한다. 이러한 과정에서 도면에 도시된 선들의 두께나 구성요소의 크기 등은 설명의 명료성과 편의상 과장되게 도시되어 있을 수 있다. 또한 후술되는 용어들은 본 발명에서의 기능을 고려하여 정의된 용어들로서, 이는 이용자, 운용자의 의도 또는 관례에 따라 달라질 수 있다. 그러므로 이러한 용어들에 대한 정의는 본 명세서 전반에 걸친 내용을 토대로 내려져야 할 것이다. Hereinafter, a bidirectional microcomputer monitoring method according to an embodiment of the present invention will be described in detail with reference to the accompanying drawings. In this process, the thickness of the lines or the size of the components shown in the drawings may be exaggerated for clarity and convenience of explanation. In addition, the terms to be described later are terms defined in consideration of functions in the present invention, which may vary according to intentions or customs of users and operators. Therefore, definitions of these terms should be made based on the content throughout this specification.

도 1 은 본 발명의 일 실시예에 따른 양방향 마이컴 모니터링 장치의 블럭 구성도이다.1 is a block diagram of a bidirectional microcomputer monitoring apparatus according to an embodiment of the present invention.

도 1 을 참조하면, 본 발명의 일 실시예에 따른 양방향 마이컴 모니터링 장치는 제1 마이컴(10)과 제2 마이컴(20)을 포함한다. 제1 마이컴(10)과 제2 마이컴(20)은 독립적으로 구비된다. Referring to FIG. 1 , an apparatus for monitoring a two-way microcomputer according to an embodiment of the present invention includes a first microcomputer 10 and a second microcomputer 20 . The first microcomputer 10 and the second microcomputer 20 are independently provided.

제1 마이컴(10)과 제2 마이컴(20)은 SPI 채널(Serial Peripheral Interface Channel)을 통해 연결된다. The first microcomputer 10 and the second microcomputer 20 are connected through an SPI channel (Serial Peripheral Interface Channel).

SPI 채널은 제1 마이컴(10)과 제2 마이컴(20)의 상호 모니터링을 위한 데이터를 송수신한다. SPI 채널을 통해 송수신되는 데이터는 제1 마이컴(10)과 제2 마이컴(20) 각각의 기능 안전에서 요구하는 데이터, 즉 마이컴 기능들과 관련된 결과값이 포함될 수 있으며, 특별히 한정되는 것은 아니다. The SPI channel transmits and receives data for mutual monitoring of the first microcomputer 10 and the second microcomputer 20 . Data transmitted/received through the SPI channel may include data required for functional safety of each of the first microcomputer 10 and the second microcomputer 20 , that is, result values related to microcomputer functions, and is not particularly limited.

일반적으로 메인 마이컴이 정상 동작을 하는지 체크하기 위해서는 서로 다른 타임 윈도우(Time window)를 가진 독립적인 마이컴이 모니터링을 해야 한다. 이에, 제1 마이컴(10)과 제2 마이컴(20)은 전원이 인가된 뒤 각자 독립적으로 5개의 스테이트(State)를 천이하며 기능 이상 유무를 체크한다. In general, in order to check whether the main microcomputer is operating normally, independent microcomputers with different time windows should monitor. Accordingly, the first microcomputer 10 and the second microcomputer 20 independently transition five states after power is applied and check whether there is a malfunction or not.

본 실시예에서, 기존 단방향 모니터링을 위해 사용되고 있던 1개의 SPI 채널과 태스크(Task) 동기화를 위해 디지털 핀(Digital Pin) 2개를 그대로 사용될 수 있다. In this embodiment, one SPI channel used for existing one-way monitoring and two digital pins for task synchronization may be used as it is.

더욱이, 상호 모니터링을 위한 태스크(Task)는 제1 마이컴(10)과 제2 마이컴(20)의 태스크 동기화를 이용하여 충돌없이 1개의 SPI 채널을 통해 데이터를 송수신한다. Moreover, the task for mutual monitoring transmits and receives data through one SPI channel without collision by using task synchronization of the first microcomputer 10 and the second microcomputer 20 .

제1 마이컴(10)과 제2 마이컴(20) 각각에 대한 단방향 모니터링의 경우 기존 방식과 동일하지만, 이들은 단방향 모니터링을 시작함과 동시에 옵셋(Offset)을 두고 반대방향 모니터링도 시작한다. In the case of unidirectional monitoring for each of the first microcomputer 10 and the second microcomputer 20, it is the same as the existing method, but they start monitoring the one-way and at the same time start the monitoring in the opposite direction with an offset.

1개의 SPI 채널을 공유하기 위해 제1 마이컴(10)과 제2 마이컴(20) 간의 태스크 동기화는 중요하다. 싱크(Sync) 핀을 활용한 제1 마이컴(10)의 통신 요청에 따라, 제2 마이컴(20)은 옵셋 시간을 두고 모니터링하는 제1 마이컴(10)에 대한 정상 동작 유무를 담은 데이터를 송수신한다.In order to share one SPI channel, task synchronization between the first microcomputer 10 and the second microcomputer 20 is important. In response to a communication request from the first microcomputer 10 using the sync pin, the second microcomputer 20 transmits and receives data indicating whether the first microcomputer 10 monitored over an offset time is operating normally. .

제2 마이컴(20)에서는 대상 마이컴과 태스크 동기화하기 위해 주기적으로 제1 마이컴(10)의 태스크의 싱크 핀을 활용하여, 태스크의 옵셋을 보정하여 통신 채널의 간섭을 제거한다. In order to synchronize the task with the target microcomputer, the second microcomputer 20 periodically utilizes the sync pin of the task of the first microcomputer 10 to correct the offset of the task to remove interference from the communication channel.

즉, 제1 마이컴(10)과 제2 마이컴(20)은 상호 모니터링 기능을 수행하지만 기존의 단방향 마이컴 모니터링의 하드웨어 자원만으로 상호 모니터링을 수행할 수 있다. 이하 상세하게 설명한다.That is, the first microcomputer 10 and the second microcomputer 20 perform the mutual monitoring function, but mutual monitoring can be performed only with the hardware resources of the existing one-way microcomputer monitoring. It will be described in detail below.

제1 마이컴(10)은 MC 태스크(Monitoring Controller Task, MC Task), ISR(Interrupt Service Routine), 및 MU 태스크(Monotoring Unit Task, MU Task)를 수행한다. 제1 마이컴(10)은 제2 마이컴(20)과 싱크 핀을 통해 연결된다. The first microcomputer 10 performs an MC task (Monitoring Controller Task, MC Task), an Interrupt Service Routine (ISR), and a Monotoring Unit Task (MU Task). The first microcomputer 10 is connected to the second microcomputer 20 through a sink pin.

제1 마이컴(10)의 MC 태스크는 ADC(AD Converter)과 PFC(Program Flow Check) 등의 기능 안전에서 요하는 마이컴 기능들과 관련된 결과값을 연산하며, 제1 마이컴(10)으로 연산 결과를 송출하기 위한 준비가 완료되면 싱크 핀을 토글한다. The MC task of the first microcomputer 10 calculates the result value related to the microcomputer functions required for functional safety such as ADC (AD Converter) and PFC (Program Flow Check), and sends the calculation result to the first microcomputer 10 . When ready to send, toggle the sink pin.

제1 마이컴(10)의 MU 태스크는 제2 마이컴(20)으로부터 전송받은 연산 결과를 기대값과 비교하여 제1 마이컴(10)의 기능의 정상 동작 여부를 판정한다. 또한, 제1 마이컴(10)의 MU 태스크는 제2 마이컴(20)의 기능 고장을 감지한 경우 고장 케이스 별로 정해진 리액션을 수행하여 연쇄 고장을 방지한다. The MU task of the first microcomputer 10 compares the calculation result received from the second microcomputer 20 with an expected value to determine whether the function of the first microcomputer 10 is operating normally. In addition, when the MU task of the first microcomputer 10 detects a functional failure of the second microcomputer 20, a predetermined reaction is performed for each failure case to prevent chain failure.

제1 마이컴(10)의 MU 태스크 수행 주기는 MC 태스크 수행 주기보다 더 빨라야 하며, 일반적으로 MU 태스크의 수행 주기는 MC 태스크 수행 주기의 1/10 정도로 설정될 수 있다. The MU task execution period of the first microcomputer 10 should be faster than the MC task execution period, and in general, the MU task execution period may be set to about 1/10 of the MC task execution period.

제1 마이컴(10)의 ISR은 싱크 핀의 토글을 감지하여 SPI 채널의 통신을 활성화하는 것으로서, 제1 마이컴(10)에 제2 마이컴(20)의 MC 태스크가 수행되었음을 알리고 제1 마이컴(10)의 MU 태스크가 다음 주기에 SPI 통신을 하도록 한다. 또한, 제1 마이컴(10)의 ISR은 주기 오차를 계산하고 옵셋값(Offset)을 보정하며, SPI 채널을 통해 송신된 데이터가 제2 마이컴(20)의 데이터임을 표시한다. 또한, 제1 마이컴(10)의 ISR은 제2 마이컴(20)의 MC 태스크가 보내는 싱크 핀의 입력에 따라 수행되며, 타이머 카운트를 이용하여 제2 마이컴(20)의 MC 태스크 수행 주기를 측정하고 제1 마이컴(10)의 MC 태스크 활성화 타이밍을 계산한다. The ISR of the first microcomputer 10 detects the toggle of the sync pin to activate communication of the SPI channel, notifies the first microcomputer 10 that the MC task of the second microcomputer 20 has been performed, and the first microcomputer 10 ) of MU task to perform SPI communication in the next cycle. In addition, the ISR of the first microcomputer 10 calculates a periodic error, corrects an offset value, and indicates that data transmitted through the SPI channel is data of the second microcomputer 20 . In addition, the ISR of the first microcomputer 10 is performed according to the input of the sync pin sent by the MC task of the second microcomputer 20, and the MC task execution period of the second microcomputer 20 is measured using the timer count. The MC task activation timing of the first microcomputer 10 is calculated.

제2 마이컴(20)은 MC 태스크, ISR(Interrupt Service Routine), 및 MU 태스크를 수행한다. 제2 마이컴(20)은 제1 마이컴(10)과 싱크 핀을 통해 연결된다. The second microcomputer 20 performs an MC task, an Interrupt Service Routine (ISR), and an MU task. The second microcomputer 20 is connected to the first microcomputer 10 through a sink pin.

제2 마이컴(20)의 MC 태스크는 ADC(AD Converter)과 PFC(Program Flow Check) 등의 기능 안전에서 요구하는 마이컴 기능들과 관련된 결과값을 연산하며, 제1 마이컴(10)으로 연산 결과 송출하기 위한 준비가 완료되면 싱크 핀을 토글한다. The MC task of the second microcomputer 20 calculates the result value related to the microcomputer functions required for functional safety such as ADC (AD Converter) and PFC (Program Flow Check), and transmits the calculation result to the first microcomputer 10 . Toggle the sink pin when you're ready to go.

제2 마이컴(20)의 MU 태스크는 제2 마이컴(20)으로부터 전송받은 연산 결과를 기대 값과 비교하여 제2 마이컴(20)의 기능의 정상 동작 여부를 판정한다. 또한, 제2 마이컴(20)의 MU 태스크는 제2 마이컴(20)의 기능의 고장을 감지한 경우 고장 케이스 별로 정해진 리액션을 수행하여 연쇄 고장을 방지한다. The MU task of the second microcomputer 20 compares the operation result received from the second microcomputer 20 with an expected value to determine whether the function of the second microcomputer 20 is operating normally. In addition, when the MU task of the second microcomputer 20 detects a malfunction of the function of the second microcomputer 20, a predetermined reaction is performed for each failure case to prevent chain failure.

제2 마이컴(20)의 MU 태스크 수행 주기는 MC 태스크 수행 주기보다 더 빨라야 하며, 일반적으로 MU 태스크의 수행 주기는 MC 태스크 수행 주기의 1/10 정도로 설정될 수 있다. The MU task execution period of the second microcomputer 20 should be faster than the MC task execution period, and in general, the MU task execution period may be set to about 1/10 of the MC task execution period.

제2 마이컴(20)의 ISR은 싱크 핀의 토글을 감지하여 SPI 채널의 통신을 활성화하는 것으로서, 제2 마이컴(20)에 제1 마이컴(10)의 MC 태스크가 수행되었음을 알리고 제2 마이컴(20)의 MU 태스크가 다음 주기에 SPI 통신을 하도록 한다. 또한, 제2 마이컴(20)의 ISR은 주기 오차를 계산하고 옵셋값(Offset)을 보정하며, SPI 채널을 통해 송신된 데이터가 제1 마이컴(10)의 데이터임을 표시한다. 또한, 제2 마이컴(20)의 ISR은 제1 마이컴(10)의 MC 태스크가 보내는 싱크 핀의 입력에 따라 수행되며, 타이머 카운트를 이용하여 제1 마이컴(10)의 MC 태스크 주기를 측정하고 제2 마이컴(20)의 MC 태스크 활성화를 위한 타이밍을 계산한다. The ISR of the second micom 20 detects the toggle of the sync pin to activate the communication of the SPI channel, informs the second micom 20 that the MC task of the first micom 10 has been performed, and ) of MU task to perform SPI communication in the next cycle. In addition, the ISR of the second microcomputer 20 calculates a periodic error, corrects an offset value, and indicates that data transmitted through the SPI channel is data of the first microcomputer 10 . In addition, the ISR of the second micom 20 is performed according to the input of the sync pin sent by the MC task of the first micom 10, and the MC task period of the first micom 10 is measured using the timer count and the second 2 Calculate the timing for MC task activation of the microcomputer 20 .

즉, 제1 마이컴(10)과 제2 마이컴(20)은 동일한 하드웨어 구성 및 프로세서를 구비하며, 동일한 기능을 수행할 수 있다. 다만, 제1 마이컴(10)과 제2 마이컴(20) 각각은 독립적으로 동작을 수행하되, 모니터링을 수행하는지 또는 모니터링 대상이 되는지에 따라 상호 간에 신호 또는 데이터를 송수신하면서 상기한 기능을 선택적으로 수행한다. That is, the first microcomputer 10 and the second microcomputer 20 have the same hardware configuration and processor, and can perform the same function. However, each of the first microcomputer 10 and the second microcomputer 20 independently performs an operation, and selectively performs the above function while transmitting and receiving signals or data between each other depending on whether monitoring is performed or a monitoring target. do.

한편, 제1 마이컴(10)과 제2 마이컴(20)은 서로 간에 정상 동작 여부를 판정할 수 있다. 즉, 제2 마이컴(20)은 제1 마이컴(10)으로부터 SPI 채널을 통해 전달된 데이터를 토대로 제1 마이컴(10)의 정상 동작 여부를 판정하고, 제1 마이컴(10)은 제2 마이컴(20)으로부터 SPI 채널을 통해 전달된 데이터를 토대로 제2 마이컴(20)의 정상 동작 여부를 판정한다. Meanwhile, the first microcomputer 10 and the second microcomputer 20 may determine whether each other is operating normally. That is, the second microcomputer 20 determines whether the first microcomputer 10 is operating normally based on the data transmitted from the first microcomputer 10 through the SPI channel, and the first microcomputer 10 determines whether the second microcomputer 10 is operating normally. 20), it is determined whether the second microcomputer 20 is operating normally based on the data transmitted through the SPI channel.

도 2 는 본 발명의 일 실시예에 따른 MMU 스테이트 다이어그램을 나타낸 도면이고, 도 3 은 본 발명의 일 실시예에 따른 MMC 스테이트 다이어그램을 나타낸 도면이다.2 is a diagram illustrating an MMU state diagram according to an embodiment of the present invention, and FIG. 3 is a diagram illustrating an MMC state diagram according to an embodiment of the present invention.

도 2 및 도 3 을 참조하면, 정상 동작 여부를 판정하는 모니터링 기능에는 5가지의 스테이트가 포함될 수 있다. 스테이트에는 이닛 스테이트(Init State), 크로스 체크 스테이트(Cross Check State), 프리드라이브 스테이트(Predrive State), 및 드라이빙 스테이트(Drving State)가 포함된다. 2 and 3 , the monitoring function for determining whether a normal operation is performed may include five states. States include Init State, Cross Check State, Predrive State, and Driving State.

이닛 스테이트는 제1 마이컴(10)과 제2 마이컴(20)의 스테이트 동기를 맞추기 위한 스테이트이다. 이닛 스테이트에서는 제1 마이컴(10)과 제2 마이컴(20)에 전원이 인가되는 시점이 다른 경우 물리적인 디지털 핀을 이용하여 스테이트를 서로 동기화시킨다. The init state is a state for synchronizing the states of the first microcomputer 10 and the second microcomputer 20 . In the init state, when power is applied to the first microcomputer 10 and the second microcomputer 20 at different times, the states are synchronized with each other using a physical digital pin.

크로스 체크 스테이트는 모니터링 이전에 제1 마이컴(10)과 제2 마이컴(20) 서로의 소프트웨어 버전을 확인하고 모니터링하고자 하는 대상 마이컴의 소프트웨어가 유효한지를 판단하는 스테이트이다. The cross check state is a state in which the first microcomputer 10 and the second microcomputer 20 check each other's software versions before monitoring and determine whether the software of the target microcomputer to be monitored is valid.

프리드라이브 스테이트는 파워 스토리지(Power Storage)를 차단할 수 있는 셧-오프 패스(Shut-Off Path)에 대한 기능 이상 유무를 검사하는 스테이트이다. The free drive state is a state that checks whether there is an abnormality in the shut-off path that can block the power storage.

드라이브 스테이트는 ADC(AD Converter) 기능 이상 유무, 인스트럭션(Instruction) 정상 유무, PFM(Program Flow Monitoring) 기능 이상 유무 중 적어도 하나를 검사하는 스테이트이다. 드라이브 스테이트에서 검사되는 기능들은 상기한 실시예에 한정되는 것은 아니다. The drive state is a state that checks at least one of whether an ADC (AD Converter) function is abnormal, an instruction is normal, or a PFM (Program Flow Monitoring) function is abnormal. The functions tested in the drive state are not limited to the above-described embodiment.

한편, 본 발명의 일 실시예에 따른 양방향 마이컴 모니터링 방법은 직렬 통신 포트를 통해 제1 마이컴(10)과 제2 마이컴(20) 간에 데이터를 송수신해야 하므로, 직렬 통신의 충돌 방지를 위해서 제1 마이컴(10)과 제2 마이컴(20)의 MC 태스크 간 옵셋을 두고 양방향 모니터링을 수행한다. On the other hand, in the bidirectional microcomputer monitoring method according to an embodiment of the present invention, data must be transmitted and received between the first microcomputer 10 and the second microcomputer 20 through the serial communication port. Bidirectional monitoring is performed with an offset between (10) and the MC task of the second microcomputer (20).

이 경우, 옵셋은 MC 태스크 수행 주기의 1/2로 설정될 수 있다. 예를 들어, 제1 마이컴(10)의 MC 태스크 수행 주기가 10ms인 경우, 즉 제1 마이컴(10)의 MC 태스크가 10ms 주기로 수행될 경우, 제2 마이컴(20)의 MC 태스크는 제1 마이컴(10)의 MC 태스크 대비 5ms의 옵셋을 갖고 10ms 주기로 동작한다. 이 때, 제2 마이컴(20)의 MC 태스크의 옵셋은 제1 마이컴(10)의 첫번째 싱크 핀 토글로부터 계산 및 반영될 수 있다. 제2 마이컴(20)의 MC 태스크 수행 주기는 제1 마이컴(10)의 MC 태스크 주기와 동일하다. In this case, the offset may be set to 1/2 of the MC task execution period. For example, when the MC task execution period of the first microcomputer 10 is 10ms, that is, when the MC task of the first microcomputer 10 is performed at a 10ms period, the MC task of the second microcomputer 20 is the first microcomputer It has an offset of 5ms compared to the MC task of (10) and operates in a period of 10ms. In this case, the offset of the MC task of the second microcomputer 20 may be calculated and reflected from the first sync pin toggle of the first microcomputer 10 . The MC task execution cycle of the second microcomputer 20 is the same as the MC task cycle of the first microcomputer 10 .

통신 리퀘스트 요청은 MC 태스크의 시작에서 수행하며, 타 마이컴과 연결된 디지털 출력 핀을 토글시켜 줌으로써 통신을 요청한다. 제1 마이컴(10)과 제2 마이컴(20) 중 MC 태스크를 수행하는 마이컴은 다른 마이컴에 의한 싱크 핀 토글을 감지하면, 인터럽트를 발생시키며, 해당 ISR은 다른 마이컴의 MC 태스크 수행 주기를 측정하고, 측정된 MC 태스크 수행 주기로 주기 오차를 계산하다. 아울러, ISR은 주기 오차를 다음 수행될 MC 태스크의 옵셋에 반영한다. 여기서, 직렬 통신을 위한 클럭 송출은 옵셋값이 반영된 MC 태스크가 시작될 때 수행한다.The communication request request is performed at the start of the MC task, and the communication is requested by toggling the digital output pin connected to the other microcomputer. Among the first microcomputer 10 and the second microcomputer 20, the microcomputer that performs the MC task generates an interrupt when it detects a sync pin toggle by another microcomputer, and the corresponding ISR measures the MC task execution period of the other microcomputer, and , calculate the periodic error with the measured MC task execution period. In addition, the ISR reflects the periodic error to the offset of the next MC task to be performed. Here, the clock transmission for serial communication is performed when the MC task to which the offset value is reflected starts.

이하, 본 발명의 일 실시예에 따른 양방향 마이컴 모니터링 방법을 도 4 내지 도 7 을 참조하여 상세하게 설명한다. Hereinafter, a bidirectional microcomputer monitoring method according to an embodiment of the present invention will be described in detail with reference to FIGS. 4 to 7 .

도 4 는 본 발명의 일 실시예에 따른 양방향 모니터링을 위한 MC 태스크와 MU 태스크의 주기를 나타낸 도면이다.4 is a diagram illustrating a cycle of an MC task and an MU task for interactive monitoring according to an embodiment of the present invention.

먼저, 도 4 를 참조하면, 제어기에 전원이 인가된 후 제1 마이컴(10)의 MC 태스크와 제2 마이컴(20)의 MU 태스크가 우선적으로 수행된다. First, referring to FIG. 4 , after power is applied to the controller, the MC task of the first microcomputer 10 and the MU task of the second microcomputer 20 are preferentially performed.

제2 마이컴(20)은 제1 마이컴(10)의 싱크 핀의 토글을 감지하여 타임 카운터를 통해 제1 마이컴(10)의 MC 태스크 수행 주기를 기록한다. The second microcomputer 20 detects the toggle of the sync pin of the first microcomputer 10 and records the MC task execution period of the first microcomputer 10 through the time counter.

제2 마이컴(20)에 의해 기록된 제1 마이컴(10)의 MC 태스크 수행 주기는 이후 주기 오차를 계산하는데 사용될 수 있다. The MC task execution cycle of the first microcomputer 10 recorded by the second microcomputer 20 may be used to calculate a subsequent cycle error.

예를 들어, 제1 마이컴(10)의 MC 태스크가 10ms 주기로 동작한다고 가정하면, 제2 마이컴(20)은 제1 마이컴(10)이 MC 태스크를 시작하는 시점에서 싱크 핀을 토글할 때, 인터럽트를 띄워 카운터 타이머 값을 기록한다. For example, if it is assumed that the MC task of the first microcomputer 10 operates at a cycle of 10ms, the second microcomputer 20 provides an interrupt when the sync pin is toggled at the time when the first microcomputer 10 starts the MC task. to record the counter timer value.

이어, 제2 마이컴(20)은 가장 최근에 기록했던 타이머 카운터값과 그 이전 기록했던 타이머 카운터값의 차를 구해 제1 마이컴(10)의 주기 오차를 산출할 수 있다. Next, the second microcomputer 20 may calculate the period error of the first microcomputer 10 by calculating the difference between the most recently recorded timer counter value and the previously recorded timer counter value.

한편, 제1 마이컴(10)의 MC 태스크는 싱크 핀을 토글함에 따라 기능 안전에 부합하는 요소들을 점검하여 해당 데이터를 기 설정된 주기, 예를 들어 1ms 주기로 SPI 채널을 통해 전달한다. Meanwhile, as the sync pin is toggled, the MC task of the first microcomputer 10 checks elements conforming to functional safety and transmits the corresponding data through the SPI channel at a preset period, for example, 1 ms period.

이때, 제2 마이컴(20)의 ISR은 SPI 채널을 통해 송신되는 데이터가 제1 마이컴(10)의 데이터임을 알리고, 제2 마이컴(20)의 MU 태스크가 제1 마이컴(10)으로부터 전송된 데이터를 이용하여 제1 마이컴(10)의 정상 동작 여부를 판정한다. At this time, the ISR of the second microcomputer 20 notifies that the data transmitted through the SPI channel is the data of the first microcomputer 10 , and the MU task of the second microcomputer 20 is the data transmitted from the first microcomputer 10 . is used to determine whether the first microcomputer 10 is operating normally.

이 과정에서, 제2 마이컴(20)의 MC 태스크는 제1 마이컴(10)으로부터 MC 태스크의 토글이 감지된 후 상기한 옵셋이 경과하는 시점에, 기능 안전에서 요구하는 마이컴 기능들과 관련된 데이터를 연산하여 연산 결과를 준비하고, 이를 제1 마이컴(10)으로 전송하기 위해 싱크 핀을 토글한다.In this process, the MC task of the second microcomputer 20 receives data related to the microcomputer functions required for functional safety at the time when the above-described offset elapses after the toggle of the MC task is detected from the first microcomputer 10 . The sync pin is toggled to prepare an operation result by performing an operation and transmit it to the first microcomputer 10 .

이어, 제1 마이컴(10)은 SPI 채널을 통해 상기한 데이터를 기 설정된 주기, 예를 들어 1ms 주기로 SPI 채널을 통해 전달한다. 이때, 제1 마이컴(10)의 ISR은 SPI 채널을 통해 송신되는 데이터가 제2 마이컴(20)의 데이터임을 알리고, 제1 마이컴(10)의 MU 태스크가 제2 마이컴(20)으로부터 전송된 데이터를 이용하여 제2 마이컴(20)의 정상 동작 여부를 판정한다. Then, the first microcomputer 10 transmits the data through the SPI channel through the SPI channel at a preset period, for example, 1 ms period. At this time, the ISR of the first microcomputer 10 informs that the data transmitted through the SPI channel is data of the second microcomputer 20 , and the MU task of the first microcomputer 10 is the data transmitted from the second microcomputer 20 . is used to determine whether the second microcomputer 20 operates normally.

여기서, 제1 마이컴(10) 또는 제2 마이컴(20) 각각은 MC 태스크가 기 설정된 수행 주기인 10ms보다 지연되거나 일찍 실행된 경우 그에 해당하는 주기 오차를 설정하여, 이 주기 오차를 다음 수행될 MC 태스크의 옵셋에 반영한다. 이는 도 5 내지 도 7 을 참조하여 설명한다.Here, each of the first microcomputer 10 or the second microcomputer 20 sets a period error corresponding to the MC task when the MC task is delayed or executed earlier than the preset execution period of 10ms, and uses this period error as the next MC to be performed. It is reflected in the offset of the task. This will be described with reference to FIGS. 5 to 7 .

도 5 는 본 발명의 일 실시예에 따른 옵셋 보정 순서도이며, 도 6 은 본 발명의 일 실시예에 따른 옵셋이 보상된 MC 태스크와 MU 태스크의 주기를 나타낸 도면이며, 도 7 은 본 발명의 일 실시예에 따른 옵셋이 보상된 MC 태스크와 MU 태스크의 주기를 나타낸 도면이다.5 is a flowchart showing an offset correction according to an embodiment of the present invention, FIG. 6 is a diagram showing the cycles of an MC task and an MU task for which an offset is compensated according to an embodiment of the present invention, and FIG. 7 is an embodiment of the present invention It is a diagram showing the periods of the MC task and the MU task for which the offset is compensated according to an embodiment.

참고로, 본 실시예에서는 제2 마이컴(20)을 예시로 설명하나, 이는 제1 마이컴(10)에서도 동일하게 적용된다. For reference, although the second microcomputer 20 is described as an example in this embodiment, the same applies to the first microcomputer 10 .

도 5 를 참조하면, 제2 마이컴(20)은 제1 마이컴(10)의 싱크 핀의 토글을 감지하여 타임 카운터를 통해 제1 마이컴(10)의 MC 태스크 수행 주기를 저장한다(S10). Referring to FIG. 5 , the second microcomputer 20 detects the toggle of the sync pin of the first microcomputer 10 and stores the MC task execution period of the first microcomputer 10 through the time counter ( S10 ).

이 경우, 제2 마이컴(20)은 제1 마이컴(10)이 MC 태스크를 시작하는 시점에서 싱크 핀을 토글할 때 인터럽트를 띄워 카운터 타이머 값을 기록한다. In this case, the second microcomputer 20 records the counter timer value by generating an interrupt when the first microcomputer 10 toggles the sink pin at the time when the MC task starts.

이어, 제2 마이컴(20)은 가장 최근에 기록했던 타이머 카운터값과 그 이전 인터럽트에 기록했던 타이머 카운터값의 차, 즉 주기 오차를 산출한다(S20). Next, the second microcomputer 20 calculates the difference between the most recently recorded timer counter value and the timer counter value recorded in the previous interrupt, that is, a period error (S20).

이때, 제2 마이컴(20)은 주기 오차와 기 설정된 임계값을 비교하여 주기 오차가 임계값 미만인지를 판단한다(S30).At this time, the second microcomputer 20 compares the periodic error with a preset threshold to determine whether the periodic error is less than the threshold (S30).

S30 단계에서의 판단 결과, 주기 오차가 임계값 이상이면, 제2 마이컴(20)은 폴트 상황인 것으로 판단(S60)하고 기 설정된 스펙에 따라 동작한다. 폴트 상황에서의 동작은 제어기 특성별로 사용자에 의해 정의될 수 있다. As a result of the determination in step S30, if the periodic error is equal to or greater than the threshold value, the second microcomputer 20 determines that it is a fault condition (S60) and operates according to a preset specification. The operation in the fault situation can be defined by the user for each controller characteristic.

여기서, 임계값은 제1 마이컴(10)의 MC 태스크 수행 주기의 10%일 수 있다.Here, the threshold value may be 10% of the MC task execution period of the first microcomputer 10 .

한편, S30 단계에서의 판단 결과, 주기 오차가 임계값 미만이면, 제2 마이컴(20)은 옵셋값에 주기 오차를 반영하여 옵셋값을 보정한다(S40). On the other hand, if it is determined in step S30 that the periodic error is less than the threshold value, the second microcomputer 20 corrects the offset value by reflecting the periodic error in the offset value (S40).

이어 제2 마이컴(20)은 현재 타이머 카운값을 이전 타이머 카운터에 저장하고(S50), S10 단계로 리턴하여 상기한 과정을 반복한다. Then, the second microcomputer 20 stores the current timer count value in the previous timer counter (S50), returns to step S10, and repeats the above process.

도 6 을 참조하면, 제1 마이컴(10)의 MC 태스크의 수행 주기를 측정했을 때, 0.02ms 만큼의 주기 오차가 있다고 가정했을 경우, 해당 주기 오차 만큼의 옵셋 보상을 수행하는 예가 도시되었다. Referring to FIG. 6 , when it is assumed that there is a period error of 0.02 ms when the execution period of the MC task of the first microcomputer 10 is measured, an example of performing offset compensation by the period error is illustrated.

제1 마이컴(10)의 상태를 모니터링하는 SPI 통신을 마친 뒤 제2 마이컴(20)의 상태를 모니터링하는 통신을 수행하기 이전에 안정적인 SPI 채널 점유를 위해 5ms의 시간 확보가 필요하다.After completing the SPI communication for monitoring the state of the first microcomputer 10 , before performing the communication for monitoring the state of the second microcomputer 20 , it is necessary to secure a time of 5 ms for stable SPI channel occupation.

제2 마이컴(20)은 매 제1 마이컴(10)의 MC 태스크의 MC 태스크 시작점을 기준으로 타이머 카운터를 기록하여 MC 태스크 수행 주기를 측정한다. The second microcomputer 20 records a timer counter based on the MC task start point of the MC task of every first microcomputer 10 to measure the MC task execution period.

타이머 카운터로 계산된 MC 태스크 수행 주기가 10.02ms로 측정되면 정상적으로 10ms에 수행되었어야 했던 MC 태스크가 0.02ms 지연된 것을 볼 수 있다. If the MC task execution period calculated by the timer counter is measured as 10.02ms, it can be seen that the MC task, which should have been normally performed in 10ms, was delayed by 0.02ms.

이에, 제2 마이컴(20)은 0.02ms 지연된 것을 옵셋 계산에 반영하여 MC 태스크를 0.02ms만큼 지연시켜 보정한다. 결과적으로 제2 마이컴(20)은 제1 마이컴(10)의 싱크 핀이 토글된 시점으로부터 4.98ms 이후에 데이터를 송수신하는 MC 태스크를 활성화시킨다.Accordingly, the second microcomputer 20 delays the MC task by 0.02 ms and corrects it by reflecting the 0.02 ms delay in the offset calculation. As a result, the second microcomputer 20 activates the MC task for transmitting and receiving data 4.98 ms after the sync pin of the first microcomputer 10 is toggled.

도 7 을 참조하면, 반대로 제1 마이컴(10)의 MC 태스크가 0.02ms만큼 일찍 수행되었을 때도 그만큼의 Offset 보상을 해주어야한다. 즉, 제1 마이컴(10)의 MC 태스크가 0.02ms만큼 일찍 실행됐다고 가정했을 때, 해당 주기 오차 만큼 옵셋 보상을 해주어야 한다. Referring to FIG. 7 , on the contrary, even when the MC task of the first microcomputer 10 is performed as early as 0.02 ms, offset compensation should be provided as much as that amount. That is, assuming that the MC task of the first microcomputer 10 is executed as early as 0.02 ms, offset compensation should be performed by the corresponding period error.

제2 마이컴(20)은 제1 마이컴(10)의 상태를 모니터링하는 SPI 통신을 마친 뒤 제2 마이컴(20)의 상태를 모니터링하는 통신을 수행하기 이전에 안정적인 SPI 채널 점유를 위해 5ms의 시간 확보가 필요하다. After completing the SPI communication for monitoring the state of the first micom 10, the second micom 20 secures a time of 5 ms for stable SPI channel occupation before performing the communication for monitoring the state of the second micom 20 is needed

제2 마이컴(20)은 제2 마이컴(20)의 MC 태스크의 시작점을 기준으로 타이머 카운터를 기록하여 MC 태스크 수행 주기를 측정한다. 도 7 에는 타이머 카운터로 계산된 MC 태스크 수행 주기가 9.98ms로 측정된 예가 도시되었으며, 정상적으로 10ms에 수행되었어야 했던 제1 마이컴(10)의 MC 태스크 수행 주기가 0.02ms 먼저 실행된 것을 볼 수 있다. The second microcomputer 20 measures the MC task execution period by recording a timer counter based on the start point of the MC task of the second microcomputer 20 . 7 shows an example in which the MC task execution period calculated by the timer counter is measured as 9.98 ms, and it can be seen that the MC task execution period of the first microcomputer 10, which should have been normally performed in 10 ms, was executed 0.02 ms earlier. .

제2 마이컴(20)은 오차 주기를 옵셋 계산에 반영하여 다음 MC 태스크를 0.02ms만큼 미리 수행한다. The second microcomputer 20 performs the next MC task in advance by 0.02 ms by reflecting the error period in the offset calculation.

결과적으로, 제2 마이컴(20)은 제1 마이컴(10)의 싱크 핀이 토글된 후, 5.02ms 이후에 데이터를 송신 MC 태스크를 활성화시킨다.As a result, the second micom 20 activates the data transmission MC task after 5.02 ms after the sync pin of the first micom 10 is toggled.

즉, MC 태스크가 지연되거나 일찍 수행되더라도 제1 마이컴(10)과 제2 마이컴(20)의 MC 태스크가 동기화되어 안정적으로 SPI 채널을 공유하여 사용할 수 있다.That is, even if the MC task is delayed or performed early, the MC tasks of the first microcomputer 10 and the second microcomputer 20 are synchronized and the SPI channel can be shared and used stably.

다음으로, 제1 마이컴(10)과 제2 마이컴(20) 각각의 MU 태스크가 기능 이상 유무를 판정하는 5가지 스테이트를 수행하는 과정을 설명한다. Next, a process in which the MU task of each of the first microcomputer 10 and the second microcomputer 20 performs five states for determining whether a function is abnormal will be described.

도 8 은 본 발명의 일 실시예에 따른 이닛 스테이트 수행 과정을 나타낸 도면이다. 8 is a diagram illustrating a process of performing an init state according to an embodiment of the present invention.

도 8 을 참조하면, 제어기에 전원이 인가된 후 제1 마이컴(10)의의 MC 태스크와 제2 마이컴(20)의 MU 태스크가 우선적으로 수행된다.Referring to FIG. 8 , after power is applied to the controller, the MC task of the first microcomputer 10 and the MU task of the second microcomputer 20 are preferentially performed.

우선, 제2 마이컴(20)의 MU 태스크가 이닛 스테이트를 끝내게 되면, 물리적인 싱크 핀을 하이로 띄워 주어 제1 마이컴(10)의 MC 태스크가 크로스체크 스테이트로 전환된다. First, when the MU task of the second microcomputer 20 ends the init state, the MC task of the first microcomputer 10 is switched to the cross check state by raising the physical sync pin to high.

크로스체크 스테이트로 넘어간 제1 마이컴(10)의 MC 테스크는 자신의 소프트웨어 버전을 제1 마이컴(10)에 보내 유효한 소프트웨어 버전인지 확인한 후, 제2 마이컴(20)도의 스테이트도 크로스체크 스테이트로 전환된다. The MC task of the first microcomputer 10 that has gone to the crosscheck state sends its own software version to the first microcomputer 10 to check whether it is a valid software version, and then the state of the second microcomputer 20 is also switched to the crosscheck state. .

제2 마이컴(20)이 MC 태스크는 MU 태스크의 스테이트가 이닛 스테이트가 끝난 상태임을 확인하고 상기한 바와 같은 크로스체크 스테이트로 전환된다. The second microcomputer 20 confirms that the state of the MU task is the end state of the MC task, and is converted to the cross-check state as described above.

제2 마이컴(20)의 MC 태스크는 상기한 바와 같이 옵셋을 보상하여 MU 태스크 기준으로 옵셋 시간 이후에 수행된다. The MC task of the second microcomputer 20 is performed after the offset time based on the MU task by compensating for the offset as described above.

도 9 는 본 발명의 일 실시예에 따른 크로스 체크 스테이트 수행 과정을 나타낸 도면이다.9 is a diagram illustrating a cross check state execution process according to an embodiment of the present invention.

도 9 를 참조하면, 제2 마이컴(20)의 MU 태스크가 크로스체크 스테이트로 변환된 이후 제1 마이컴(10)에게 자신의 소프트웨어 버전을 보낸다. Referring to FIG. 9 , after the MU task of the second microcomputer 20 is converted to a cross check state, the software version of the second microcomputer 20 is transmitted to the first microcomputer 10 .

제2 마이컴(20)의 소프트웨어 버전이 유효할 경우 제1 마이컴(10)의 MC 태스크는 프리드라이브 스텝 1 스테이트로 변환된다.When the software version of the second microcomputer 20 is valid, the MC task of the first microcomputer 10 is converted to the free drive step 1 state.

프리드라이브 스텝 1 스테이트가 된 제1 마이컴(10)의 MC 태스크는 셧-오프 패스 핀을 하이로 인가하라는 데이터를 보낸다.The MC task of the first microcomputer 10 in the free drive step 1 state sends data to apply the shut-off pass pin high.

제1 마이컴(10)의 프리드라이브 스텝 1 스테이트의 데이터가 정상적으로 도착해 셧-오프 패스 핀을 하이로 인가하라는 데이터가 유효하면 프리드라이브 스텝 1 스테이트로 변환되면서 셧-오프 패스 핀을 하이로 인가한다.If the data of the predrive step 1 state of the first microcomputer 10 arrives normally and the data to apply the shut-off pass pin high is valid, the state is converted to the predrive step 1 state and the shut-off pass pin is applied high. .

제2 마이컴(20)의 MC 태스크와 제1 마이컴(10)의 MU 태스크 역시 상기한 바와 같은 동작을 옵셋 시간 차를 두고 동일하게 진행된다.The MC task of the second microcomputer 20 and the MU task of the first microcomputer 10 are also performed in the same manner as described above with an offset time difference.

도 10 은 본 발명의 일 실시예에 따른 프리드라이브 스텝1 스테이트 수행 과정을 나타낸 도면이다.10 is a diagram illustrating a process of performing a predrive step 1 state according to an embodiment of the present invention.

제1 마이컴(10)의 MC 태스크는 제2 마이컴(20)의 MU 태스크가 보낸 프리드라이브 스텝1 스테이트의 데이터를 받고 실제 셧-오프 패스 핀의 핀이 하이로 인가되었는지 확인 후 하이인 경우 프리드라이브 스텝2 스테이트로 전환된다.The MC task of the first microcomputer 10 receives the data of the predrive step 1 state sent by the MU task of the second microcomputer 20, checks whether the actual shut-off pass pin is high, and if it is high, freedrive It switches to step 2 state.

프리드라이브 스텝 2 스테이트가 된 제1 마이컴(10)은 셧-오프 패스를 로우로 인가하라는 데이터를 전송하고, 해당 데이터를 받은 제2 마이컴(20)의 MU 태스크는 정상적으로 로우로 인가하라는 데이터를 받았는지 검사 후 프리드라이브 스텝 2 스테이트로 변환되면서 셧-오프 패스 핀에 로우를 인가한다. The first microcomputer 10 in the free drive step 2 state transmits data to apply the shut-off pass low, and the MU task of the second microcomputer 20 that has received the data normally receives the data to apply low. After checking whether or not is checked, it is converted to the predrive step 2 state and a low is applied to the shut-off pass pin.

제2 마이컴(20)의 MC 태스크와 제1 마이컴(10)의 MU 태스크는 동일한 과정을 수행하며 셧-오프 패스는 제2 마이컴(20) 기준으로 새롭게 정의된 것이다(기존 셧-오프 패스와 다름).The MC task of the second microcomputer 20 and the MU task of the first microcomputer 10 perform the same process, and the shut-off path is newly defined based on the second microcomputer 20 (different from the existing shut-off path) ).

도 11 은 본 발명의 일 실시예에 따른 프리드라이브 스텝2 스테이트 수행 과정을 나타낸 도면이다.11 is a diagram illustrating a process of performing a predrive step 2 state according to an embodiment of the present invention.

도 11 을 참조하면, 제1 마이컴(10)의 MC 태스크는 현재 셧-오프 패스 핀이 실제로 로우로 인가되었는지 확인한 뒤, 드라이빙 스테이트로 변환된다. Referring to FIG. 11 , the MC task of the first microcomputer 10 is converted to the driving state after checking whether the current shut-off pass pin is actually applied as low.

제2 마이컴(20)의 MU 태스크는 제1 마이컴(10)의 MC 태스크가 보낸 MU 태스크의 스테이트를 확인하고 드라이빙 스테이트가 된 것을 확인하고 드라이빙 스테이트로 변환한다. The MU task of the second microcomputer 20 checks the state of the MU task sent by the MC task of the first microcomputer 10, confirms that the driving state has been reached, and converts it to the driving state.

상기한 과정과 동일하게 제2 마이컴(20)의 MC 태스크와 제1 마이컴(10)의 MU 태스크가 수행된다.In the same manner as described above, the MC task of the second microcomputer 20 and the MU task of the first microcomputer 10 are performed.

도 12 는 본 발명의 일 실시예에 따른 드라이빙 스테이트 수행 과정을 나타낸 도면이다. 12 is a diagram illustrating a driving state execution process according to an embodiment of the present invention.

도 12 를 참조하면, 제1 마이컴(10)의 MC 태스크는 제2 마이컴(20)의 MU 태스크로부터 PFM 1 수행 지시를 받아 자신이 수행해야할 PFM이 1번인지 확인한다. Referring to FIG. 12 , the MC task of the first microcomputer 10 receives a PFM 1 execution instruction from the MU task of the second microcomputer 20 and checks whether the PFM to be performed is #1.

지시한 값과 일치할 경우, 제1 마이컴(10)의 MC 태스크는 PFM1에 대한 연산을 수행한 후 답변과 ADC Path 중에서 공통으로 센싱하고 있는 경로의 ADC 센싱을 준비한다.If the indicated value is the same, the MC task of the first microcomputer 10 performs an operation on PFM1 and prepares for ADC sensing of a common sensing path among the answer and the ADC path.

제2 마이컴(20)의 MU 태스크는 제1 마이컴(10)의 PFM 1에 대한 답변을 가지고 해당 PFM 수행에 대한 정상 유무를 판단한다. The MU task of the second microcomputer 20 determines whether the PFM is normally performed with the answer to the PFM 1 of the first microcomputer 10 .

그리고 제2 마이컴(20)의 MU 태스크는 ADC 센싱과 제2 마이컴(20)의 ADC 센싱값과 비교하여 허용 오차 범위 이내에서 정상 동작하는지 판단한다.In addition, the MU task of the second micom 20 compares the ADC sensing with the ADC sensing value of the second micom 20 to determine whether it operates normally within an allowable error range.

상기한 바와 과정과 동일하게 제2 마이컴(20)의 MC 태스크와 제1 마이컴(10)의 MU 태스크가 수행된다.In the same manner as described above, the MC task of the second microcomputer 20 and the MU task of the first microcomputer 10 are performed.

드라이빙 스테이트 이후부터는 PFM을 순차적으로 반복한다. After the driving state, PFM is sequentially repeated.

이와 같이, 본 발명의 일 실시예에 따른 양방향 마이컴 모니터링 방법은 마이컴의 MC 태스크를 기 설정된 옵셋에 따라 설정된 간격으로 동작함으로써, 하나의 직렬 통신 포트를 통해서도 직렬 통신 충돌없이 양방향 모니터링을 수행할 수 있도록 한다. As described above, the bidirectional microcomputer monitoring method according to an embodiment of the present invention operates the MC task of the microcomputer at a set interval according to a preset offset, so that bidirectional monitoring can be performed without a serial communication collision even through one serial communication port. do.

또한, 본 발명의 일 실시예에 따른 양방향 마이컴 모니터링 방법은 기존 하드웨어가 결정된 상태나 하드웨어 자원이 제한적인 제어기에서도 소프트웨어적인 기법으로 양방향 모니터링에 관한 기능 안전을 만족시킬 수 있다. In addition, the bidirectional microcomputer monitoring method according to an embodiment of the present invention can satisfy functional safety related to bidirectional monitoring through a software technique even in a state in which existing hardware is determined or a controller having limited hardware resources.

게다가, 본 발명의 일 실시예 따른 양방향 마이컴 모니터링 방법은 독립된 타임 윈도우(Time Window)의 두 마이컴의 태스크를 동기화시켜 보다 안정적으로 동작할 수 있도록 한다. In addition, the bidirectional microcomputer monitoring method according to an embodiment of the present invention synchronizes the tasks of two microcomputers in independent time windows so that they can operate more stably.

본 명세서에서 설명된 구현은, 예컨대, 방법 또는 프로세스, 장치, 소프트웨어 프로그램, 데이터 스트림 또는 신호로 구현될 수 있다. 단일 형태의 구현의 맥락에서만 논의(예컨대, 방법으로서만 논의)되었더라도, 논의된 특징의 구현은 또한 다른 형태(예컨대, 장치 또는 프로그램)로도 구현될 수 있다. 장치는 적절한 하드웨어, 소프트웨어 및 펌웨어 등으로 구현될 수 있다. 방법은, 예컨대, 컴퓨터, 마이크로프로세서, 집적 회로 또는 프로그래밍가능한 로직 디바이스 등을 포함하는 프로세싱 디바이스를 일반적으로 지칭하는 프로세서 등과 같은 장치에서 구현될 수 있다. 프로세서는 또한 최종-사용자 사이에 정보의 통신을 용이하게 하는 컴퓨터, 셀 폰, 휴대용/개인용 정보 단말기(personal digital assistant: "PDA") 및 다른 디바이스 등과 같은 통신 디바이스를 포함한다.Implementations described herein may be implemented in, for example, a method or process, an apparatus, a software program, a data stream, or a signal. Although discussed only in the context of a single form of implementation (eg, discussed only as a method), implementations of the discussed features may also be implemented in other forms (eg, as an apparatus or program). The apparatus may be implemented in suitable hardware, software and firmware, and the like. A method may be implemented in an apparatus such as, for example, a processor, which generally refers to a computer, a microprocessor, a processing device, including an integrated circuit or programmable logic device, or the like. Processors also include communication devices such as computers, cell phones, portable/personal digital assistants ("PDA") and other devices that facilitate communication of information between end-users.

본 발명은 도면에 도시된 실시예를 참고로 하여 설명되었으나, 이는 예시적인 것에 불과하며 당해 기술이 속하는 기술분야에서 통상의 지식을 가진 자라면 이로부터 다양한 변형 및 균등한 타 실시예가 가능하다는 점을 이해할 것이다. 따라서, 본 발명의 진정한 기술적 보호범위는 아래의 특허청구범위에 의하여 정해져야할 것이다.Although the present invention has been described with reference to the embodiment shown in the drawings, this is merely exemplary, and it is understood that various modifications and equivalent other embodiments are possible by those of ordinary skill in the art. will understand Accordingly, the true technical protection scope of the present invention should be defined by the following claims.

10: 제1 마이컴
20: 제2 마이컴
10: first microcomputer
20: second microcomputer

Claims (16)

제1 마이컴이 MC 태스크(Monitoring Controller Task, MC Task)를 수행하는 단계;
제2 마이컴이 상기 제1 마이컴의 MC 태스크 수행 주기를 모니터링하여 모니터링 결과에 따라 상기 제2 마이컴의 MC 태스크 수행 시점에 대한 옵셋값을 산출하는 단계; 및
상기 제2 마이컴이 상기 옵셋값에 따라 MC 태스크를 수행하는 단계를 포함하는 양방향 마이컴 모니터링 방법.
performing, by the first microcomputer, an MC task (Monitoring Controller Task, MC Task);
calculating, by a second microcomputer, an MC task execution period of the first microcomputer, and calculating an offset value for the MC task execution time of the second microcomputer according to a monitoring result; and
and performing, by the second microcomputer, an MC task according to the offset value.
제 1 항에 있어서, 상기 제1 마이컴이 MC 태스크를 수행하면, 상기 제2 마이컴이 상기 제1 마이컴으로부터 SPI 채널(Serial Peripheral Interface Channel)을 통해 전달된 연산 결과를 토대로 MU 태스크(Monotoring Unit Task, MU Task)를 수행하여 상기 제1 마이컴의 정상 동작 여부를 판정하는 단계를 더 포함하는 것을 특징으로 하는 양방향 마이컴 모니터링 방법. The method of claim 1, wherein when the first microcomputer performs the MC task, the second microcomputer performs the MU task (Monotoring Unit Task, MU Task) to determine whether the first microcomputer is operating normally. 제 2 항에 있어서, 상기 제1 마이컴의 정상 동작 여부를 판정하는 단계는,
상기 제1 마이컴과 스테이트 동기를 맞추는 이닛 스테이트(Init State), 상기 제1 마이컴의 소프트웨어 버전을 확인하고 상기 제1 마이컴의 소프트웨어가 유효한지를 판단하는 크로스 체크 스테이트(Cross Check State), 파워 스토리지를 차단할 수 있는 셧-오프 패스에 대한 기능 이상 유무를 검사하는 프리드라이브 스테이트(Predrive State), 및 ADC(AD Converter) 기능 이상 유무, 인스트럭션(Instruction) 정상 유무, PFM(Program Flow Monitoring) 기능 이상 유무 중 적어도 하나를 검사하는 드라이빙 스테이트를 포함하는 것을 특징으로 하는 양방향 마이컴 모니터링 방법.
The method of claim 2, wherein determining whether the first microcomputer operates normally comprises:
Init State for synchronizing the state with the first micom, Cross Check State for checking the software version of the first micom and determining whether the software of the first micom is valid At least among the predrive state, which checks whether there is an abnormality in the shut-off path, whether there is an abnormality in the ADC (AD converter) function, whether the instruction is normal, and whether there is an abnormality in the program flow monitoring (PFM) function. A two-way microcomputer monitoring method comprising a driving state for checking one.
제 1 항에 있어서, 상기 제2 마이컴이 MC 태스크를 수행하면, 상기 제1 마이컴이 상기 제2 마이컴으로부터 SPI 채널을 통해 전달된 연산 결과를 토대로 MU 태스크를 수행하여 상기 제2 마이컴의 정상 동작 여부를 판정하는 단계를 더 포함하는 것을 특징으로 하는 양방향 마이컴 모니터링 방법. The method of claim 1, wherein when the second microcomputer performs the MC task, the first microcomputer performs the MU task based on the operation result transmitted from the second microcomputer through the SPI channel to determine whether the second microcomputer operates normally. Bidirectional microcomputer monitoring method, characterized in that it further comprises the step of determining. 제 4 항에 있어서, 상기 제2 마이컴의 정상 동작 여부를 판정하는 단계는,
상기 제2 마이컴과 스테이트 동기를 맞추는 이닛 스테이트, 상기 제2 마이컴의 소프트웨어 버전을 확인하고 상기 제2 마이컴의 소프트웨어가 유효한지를 판단하는 크로스 체크 스테이트, 파워 스토리지를 차단할 수 있는 셧-오프 패스에 대한 기능 이상 유무를 검사하는 프리드라이브 스테이트, 및 ADC 기능 이상 유무, 인스트럭션 정상 유무, PFM 기능 이상 유무 중 적어도 하나를 검사하는 드라이빙 스테이트를 포함하는 것을 특징으로 하는 양방향 마이컴 모니터링 방법.
5. The method of claim 4, wherein determining whether the second microcomputer operates normally comprises:
An init state that synchronizes the state with the second micom, a cross check state that checks the software version of the second micom and determines whether the software of the second micom is valid, and a shut-off pass function that can block power storage A bidirectional microcomputer monitoring method, comprising: a free drive state for checking whether there is an abnormality; and a driving state for inspecting at least one of whether there is an ADC function abnormality, whether an instruction is normal or not, and whether there is an abnormality in the PFM function.
제 1 항에 있어서, 상기 제2 마이컴의 MU 태스크 수행 주기는 상기 제1 마이컴의 MC 태스크 수행 주기보다 짧은 것을 특징으로 하는 양방향 마이컴 모니터링 방법. The method of claim 1, wherein the MU task execution period of the second microcomputer is shorter than the MC task execution period of the first microcomputer. 제 1 항에 있어서, 상기 제2 마이컴이 상기 옵셋값에 따라 MC 태스크를 수행하는 단계에서,
상기 제2 마이컴은 상기 제1 마이컴의 MC 태스크의 주기 오차를 산출하고 상기 주기 오차를 토대로 상기 옵셋값을 보정하는 것을 특징으로 하는 양방향 마이컴 모니터링 방법.
The method of claim 1, wherein in the step of performing the MC task according to the offset value by the second microcomputer,
The second microcomputer calculates a periodic error of the MC task of the first microcomputer and corrects the offset value based on the periodic error.
제 7 항에 있어서, 상기 제2 마이컴은
상기 제1 마이컴이 MC 태스크 수행을 완료하여 상기 제1 마이컴의 태스크의 싱크 핀을 토글할 때마다 타이머 카운트값을 기록하고, 상기 타이머 카운트값을 이용하여 상기 제1 마이컴의 MC 태스크 수행 주기를 산출하고, 상기 제1 마이컴의 MC 태스크 수행 주기를 토대로 상기 주기 오차를 산출하는 단계를 포함하는 것을 특징으로 하는 양방향 마이컴 모니터링 방법.
The method of claim 7, wherein the second microcomputer
Each time the first microcomputer completes the MC task execution and toggles the sync pin of the task of the first microcomputer, a timer count value is recorded, and the MC task execution period of the first microcomputer is calculated using the timer count value. and calculating the period error based on the MC task execution period of the first microcomputer.
제 7 항에 있어서, 상기 제2 마이컴은
상기 주기 오차와 기 설정된 임계값을 비교하여 비교 결과에 따라 상기 옵셋값을 보정하는 것을 특징으로 하는 양방향 마이컴 모니터링 방법.
The method of claim 7, wherein the second microcomputer
The bidirectional microcomputer monitoring method, characterized in that by comparing the period error with a preset threshold value and correcting the offset value according to the comparison result.
제 7 항에 있어서, 상기 제2 마이컴은
상기 주기 오차에 따라 상기 제2 마이컴의 MC 태스크 수행 시점을 변경하는 것을 특징으로 하는 양방향 마이컴 모니터링 방법.
The method of claim 7, wherein the second microcomputer
A bidirectional microcomputer monitoring method, characterized in that the second microcomputer changes the execution time of the MC task according to the period error.
제1 마이컴이 MC 태스크(Monitoring Controller Task, MC Task)를 수행하는 단계;
제2 마이컴이 상기 제1 마이컴으로부터 SPI 채널(Serial Peripheral Interface Channel)을 통해 전달된 연산 결과를 토대로 MU 태스크(Monotoring Unit Task, MU Task)를 수행하여 상기 제1 마이컴의 정상 동작 여부를 판정하고, 상기 제1 마이컴의 MC 태스크 수행 주기를 모니터링하여 모니터링 결과에 따라 상기 제2 마이컴의 MC 태스크 수행 시점에 대한 옵셋값을 산출하는 단계;
상기 제2 마이컴이 상기 옵셋값에 따라 MC 태스크를 수행하는 단계; 및
상기 제2 마이컴이 MC 태스크를 수행하면, 상기 제1 마이컴이 상기 제2 마이컴으로부터 SPI 채널을 통해 전달된 연산 결과를 토대로 MU 태스크를 수행하여 상기 제2 마이컴의 정상 동작 여부를 판정하는 단계를 포함하는 양방향 마이컴 모니터링 방법.
performing, by the first microcomputer, an MC task (Monitoring Controller Task, MC Task);
A second micom performs a MU task (Monotoring Unit Task, MU Task) based on the operation result transmitted from the first micom through a Serial Peripheral Interface Channel (SPI) to determine whether the first micom operates normally, monitoring an MC task execution period of the first microcomputer and calculating an offset value for the MC task execution time of the second microcomputer according to a monitoring result;
performing, by the second microcomputer, an MC task according to the offset value; and
When the second microcomputer performs the MC task, the first microcomputer performs an MU task based on the operation result transmitted from the second microcomputer through an SPI channel to determine whether the second microcomputer operates normally. Two-way microcomputer monitoring method.
제 11 항에 있어서, 상기 제2 마이컴의 MU 태스크 수행 주기는 상기 제1 마이컴의 MC 태스크 수행 주기보다 짧은 것을 특징으로 하는 양방향 마이컴 모니터링 방법. The method of claim 11, wherein the MU task execution period of the second microcomputer is shorter than the MC task execution period of the first microcomputer. 제 11 항에 있어서, 상기 제2 마이컴이 상기 옵셋값에 따라 MC 태스크를 수행하는 단계에서,
상기 제2 마이컴은 상기 제1 마이컴의 MC 태스크의 주기 오차를 산출하고 상기 주기 오차를 토대로 상기 옵셋값을 보정하는 것을 특징으로 하는 양방향 마이컴 모니터링 방법.
The method of claim 11, wherein in the step of performing the MC task according to the offset value by the second microcomputer,
The second microcomputer calculates a periodic error of the MC task of the first microcomputer and corrects the offset value based on the periodic error.
제 13 항에 있어서, 상기 제2 마이컴은
상기 제1 마이컴이 MC 태스크 수행을 완료하여 상기 제1 마이컴의 태스크의 싱크 핀을 토글할 때마다 타이머 카운트값을 기록하고, 상기 타이머 카운트값을 이용하여 상기 제1 마이컴의 MC 태스크 수행 주기를 산출하고, 상기 제1 마이컴의 MC 태스크 수행 주기를 토대로 상기 주기 오차를 산출하는 단계를 포함하는 것을 특징으로 하는 양방향 마이컴 모니터링 방법.
14. The method of claim 13, wherein the second microcomputer
Each time the first microcomputer completes the MC task execution and toggles the sync pin of the task of the first microcomputer, a timer count value is recorded, and the MC task execution period of the first microcomputer is calculated using the timer count value. and calculating the period error based on the MC task execution period of the first microcomputer.
제 13 항에 있어서, 상기 제2 마이컴은
상기 주기 오차와 기 설정된 임계값을 비교하여 비교 결과에 따라 상기 옵셋값을 보정하는 것을 특징으로 하는 양방향 마이컴 모니터링 방법.
14. The method of claim 13, wherein the second microcomputer
The bidirectional microcomputer monitoring method, characterized in that by comparing the period error with a preset threshold value and correcting the offset value according to the comparison result.
제 13 항에 있어서, 상기 제2 마이컴은
상기 주기 오차에 따라 상기 제2 마이컴의 MC 태스크 수행 시점을 변경하는 것을 특징으로 하는 양방향 마이컴 모니터링 방법.
14. The method of claim 13, wherein the second microcomputer
A bidirectional microcomputer monitoring method, characterized in that the second microcomputer changes the execution time of the MC task according to the period error.
KR1020200174598A 2020-12-14 2020-12-14 Bidirectional microcomputer monitoring method KR102451821B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020200174598A KR102451821B1 (en) 2020-12-14 2020-12-14 Bidirectional microcomputer monitoring method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020200174598A KR102451821B1 (en) 2020-12-14 2020-12-14 Bidirectional microcomputer monitoring method

Publications (2)

Publication Number Publication Date
KR20220084775A KR20220084775A (en) 2022-06-21
KR102451821B1 true KR102451821B1 (en) 2022-10-06

Family

ID=82221486

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020200174598A KR102451821B1 (en) 2020-12-14 2020-12-14 Bidirectional microcomputer monitoring method

Country Status (1)

Country Link
KR (1) KR102451821B1 (en)

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0764930A (en) * 1993-08-31 1995-03-10 Matsushita Electric Works Ltd Mutual monitoring method between cpus
KR102023164B1 (en) * 2013-01-15 2019-09-19 콘티넨탈 오토모티브 시스템 주식회사 Method for monitoring os task of twin micom in rtos
KR20150007732A (en) * 2013-07-12 2015-01-21 현대모비스 주식회사 Watchdog system and watchdog control method
KR102045869B1 (en) * 2013-07-26 2019-11-18 현대모비스 주식회사 Apparatus and Method for timing control of Motor Driven Power Steering Electronic Control Unit
KR101997723B1 (en) * 2017-07-10 2019-07-08 현대오트론 주식회사 Method and apparatus for monitoring relative processor

Also Published As

Publication number Publication date
KR20220084775A (en) 2022-06-21

Similar Documents

Publication Publication Date Title
US7802138B2 (en) Control method for information processing apparatus, information processing apparatus, control program for information processing system and redundant comprisal control apparatus
US10496128B2 (en) Method for obtaining timestamp and computer device using the same
TWI586107B (en) Timing Error Detection and Correction Device and Its Normal Timing Design Method
US7949120B2 (en) Information processing system in which information expressing a current time point is transmitted from one computer to another for use in calculating an amount of delay in transferring data between the computers
KR102451821B1 (en) Bidirectional microcomputer monitoring method
US6557147B1 (en) Method and apparatus for evaluating a circuit
EP3118749B1 (en) System and method of monitoring a serial bus
KR101594453B1 (en) An apparatus for diagnosing a failure of a channel and method thereof
US10769038B2 (en) Counter circuitry and methods including a master counter providing initialization data and fault detection data and wherein a threshold count difference of a fault detection count is dependent upon the fault detection data
US20130191845A1 (en) Load control device and load control method
KR102438148B1 (en) Abnormality detection apparatus, system and method for detecting abnormality of embedded computing module
US7668837B2 (en) Multiplex apparatus and method for multiplexing legacy device
CN111447333B (en) TDM bus fault detection method, device, equipment and readable storage medium
US11526137B2 (en) Operation verification program, operation synchronization method, and error detection apparatus
KR20140092132A (en) Method for monitoring os task of twin micom in rtos
US11397661B1 (en) System and method for monitoring offline state of electronic device
JP3415636B2 (en) Processor unit
JPS5855535B2 (en) Multi-computer device for vehicles
JP5375756B2 (en) Time monitoring apparatus and method
WO2024092193A1 (en) Bus transaction security in multi-chip module
JP3361919B2 (en) Programmable controller
CN116414766A (en) Heterogeneous system inter-core time synchronization method, heterogeneous system and mobile terminal
US20060112316A1 (en) Method of monitoring status of processor
KR101519351B1 (en) Task execution diagnosis apparatus
JPH11284605A (en) Information processing system and its serial communication method

Legal Events

Date Code Title Description
E902 Notification of reason for refusal
E701 Decision to grant or registration of patent right
GRNT Written decision to grant