JP2020123127A - Electronic control device - Google Patents

Electronic control device Download PDF

Info

Publication number
JP2020123127A
JP2020123127A JP2019014342A JP2019014342A JP2020123127A JP 2020123127 A JP2020123127 A JP 2020123127A JP 2019014342 A JP2019014342 A JP 2019014342A JP 2019014342 A JP2019014342 A JP 2019014342A JP 2020123127 A JP2020123127 A JP 2020123127A
Authority
JP
Japan
Prior art keywords
data
microcomputer
simultaneity
guaranteed
current command
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2019014342A
Other languages
Japanese (ja)
Other versions
JP7140689B2 (en
Inventor
鈴木 良和
Yoshikazu Suzuki
良和 鈴木
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hitachi Astemo Ltd
Original Assignee
Hitachi Automotive Systems Ltd
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 Hitachi Automotive Systems Ltd filed Critical Hitachi Automotive Systems Ltd
Priority to JP2019014342A priority Critical patent/JP7140689B2/en
Publication of JP2020123127A publication Critical patent/JP2020123127A/en
Application granted granted Critical
Publication of JP7140689B2 publication Critical patent/JP7140689B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Microcomputers (AREA)
  • Control Of Ac Motors In General (AREA)

Abstract

To assure simultaneity of data while preventing processing loads from increasing.SOLUTION: A microcomputer 109 comprises a core A1 and a core A2. The core A1 comprises a current command section 105. The core A2 comprises a current detection section 103, a current control section 104, and a three-phase voltage conversion section 106. The current command section 105 comprises an inclusive section B1. The current control section 104 comprises a splitting section B2. The inclusive section B1 includes a plurality of data whose simultaneity has to be assured in processing of the microcomputer 109 into one piece of data that can be settled by the microcomputer 109 as a group, a total data size for the plurality of data whose simultaneity has to be assured in the processing of the microcomputer 109 is equal to or less than a data size that can be settled by the microcomputer 109 as a group, and the splitting section B2 splits the one piece of data post inclusion by the inclusive section B1 into the original plurality of data.SELECTED DRAWING: Figure 2

Description

本発明は、マイクロコンピュータ(以下、マイコンと言う)が搭載された電子制御装置に関する。 The present invention relates to an electronic control device equipped with a microcomputer (hereinafter referred to as a microcomputer).

モータ制御では、三相電流値Iu、Iv、Iwまたは電流指令値Id*、Iq*などの同時性が保証されていなければならない複数のデータが用いられることがある。マルチコアマイコンを用いたモータ制御では、処理負荷を分散させるため、制御周期が異なるコアとタスクとの間で同一データ群に対して更新および参照を行うことがある。その場合、データ群を参照するタイミングによって、一方のデータは更新された今回値が採用され、もう一方のデータは更新されていない前回値が採用されるというように複数のデータの同時性が保証されないことがあった。 In the motor control, a plurality of data such as three-phase current values Iu, Iv, Iw or current command values Id*, Iq* that must be guaranteed to be synchronized may be used. In the motor control using the multi-core microcomputer, in order to distribute the processing load, the core and the task having different control cycles may update and refer to the same data group. In that case, depending on the timing of referring to the data group, one data is updated with the current value and the other data is updated with the previous value. There were things that weren't done.

複数のデータの同時性を保証するため、割込み禁止を使用すると、制御周期が速いタスクでは処理負荷が増大し、タスク破綻を招くことがある。そのため、割込み禁止を用いることなく、モータ制御で使用するデータ群の同時性を保証する必要がある。特許文献1、2によれば、割込み禁止を用いることなく、データ群の同時性を保証する方法が開示されている。 If interrupt inhibition is used to guarantee the simultaneity of a plurality of data, a task with a fast control cycle may increase the processing load and may cause a task failure. Therefore, it is necessary to guarantee the simultaneity of the data group used for motor control without using interrupt inhibition. Patent Documents 1 and 2 disclose a method of guaranteeing simultaneity of data groups without using interrupt inhibition.

特開2017−130140号公報JP, 2017-130140, A 特開2009−245009号公報JP, 2009-24509, A

しかしながら、特許文献1に開示された方法では、参照用メモリの参照中に第2プロセッサコアに割込みが入り、第2プロセッサコアの処理が止まった場合に更新処理が実行されると、更新用メモリのデータの同時性が保証されなくなる。そのため、参照側は同時性が保証されていないデータを参照する可能性があった。 However, in the method disclosed in Patent Document 1, if the second processor core is interrupted while the reference memory is being referred to and the processing of the second processor core is stopped, the update memory is executed. The data simultaneity cannot be guaranteed. Therefore, there is a possibility that the referrer may refer to data whose concurrency is not guaranteed.

特許文献2に開示された方法では、調停部が更新・参照を管理していることから、特許文献1に開示された方法で発生する同時性が保証されていないデータの参照は発生しない。しかし、特許文献2に開示された方法では、特許文献1に開示された方法よりも、処理負荷が増大するという問題があった。 In the method disclosed in Patent Document 2, since the arbitration unit manages the update/reference, the reference of data for which the simultaneity that is generated in the method disclosed in Patent Document 1 is not guaranteed does not occur. However, the method disclosed in Patent Document 2 has a problem that the processing load is larger than that of the method disclosed in Patent Document 1.

本発明は、上記事情に鑑みなされたものであり、その目的は、処理負荷の増大を抑制しつつ、データの同時性を保証することが可能な電子制御装置を提供することにある。 The present invention has been made in view of the above circumstances, and an object thereof is to provide an electronic control device capable of guaranteeing data simultaneity while suppressing an increase in processing load.

上記目的を達成するため、第1の観点に係る電子制御装置は、マイクロコンピュータを備え、前記マイクロコンピュータにおいて同一タスクで参照される複数のデータを、前記マイクロコンピュータで一度に扱うことができる1つのデータに包括する。 In order to achieve the above object, an electronic control device according to a first aspect includes a microcomputer, and a plurality of data referred to by the same task in the microcomputer can be handled at one time by the microcomputer. Include in the data.

本発明によれば、処理負荷の増大を抑制しつつ、データの同時性を保証することができる。 According to the present invention, it is possible to guarantee data simultaneity while suppressing an increase in processing load.

図1は、第1実施形態に係る電子制御装置の構成を示すブロック図である。FIG. 1 is a block diagram showing the configuration of the electronic control device according to the first embodiment. 図2は、図1のマイコンのマルチコアの適用例を示すブロック図である。FIG. 2 is a block diagram showing an application example of the multi-core of the microcomputer of FIG. 図3は、図2の電流指令値Id*、Iq*を包括しないときの更新と参照の関係の一例を示すタイミングチャートである。FIG. 3 is a timing chart showing an example of the relationship between update and reference when the current command values Id* and Iq* of FIG. 2 are not included. 図4は、図2の電流指令値Id*、Iq*を包括したデータの一例を示す図である。FIG. 4 is a diagram showing an example of data including the current command values Id* and Iq* of FIG. 図5は、図2の電流指令値Id*、Iq*を包括したときの更新と参照の関係の一例を示すタイミングチャートである。FIG. 5 is a timing chart showing an example of the relationship between update and reference when the current command values Id* and Iq* of FIG. 2 are included. 図6は、図2の電流指令値Id*、Iq*の包括方法を示すフローチャートである。FIG. 6 is a flowchart showing a method of including the current command values Id* and Iq* in FIG. 図7は、図2の電流指令値Id*、Iq*の参照方法を示すフローチャートである。FIG. 7 is a flowchart showing a method of referring to the current command values Id* and Iq* of FIG. 図8は、第2実施形態に係る電子制御装置の構成を示すブロック図である。FIG. 8 is a block diagram showing the configuration of the electronic control device according to the second embodiment. 図9は、三相電流値Iu、Iv、Iwの同時性が保証されないときの更新と参照の関係の一例を示すタイミングチャートである。FIG. 9 is a timing chart showing an example of the relationship between update and reference when the simultaneity of the three-phase current values Iu, Iv, and Iw is not guaranteed. 図10は、第2実施形態に係る三相電流値Iu、Iv、Iwの検出値の更新側と参照側との間のデータの受け渡し方法を示すブロック図である。FIG. 10 is a block diagram showing a data transfer method between the update side of the detected values of the three-phase current values Iu, Iv, and Iw and the reference side according to the second embodiment. 図11は、図10の3つのバッファを用いたときの更新と参照の関係の一例を示すタイミングチャートである。FIG. 11 is a timing chart showing an example of the relationship between update and reference when the three buffers of FIG. 10 are used. 図12は、図10の3つのバッファを用いたときの三相電流値Iu、Iv、Iwの更新方法を示すフローチャートである。FIG. 12 is a flowchart showing a method of updating the three-phase current values Iu, Iv, Iw when the three buffers of FIG. 10 are used. 図13は、図10の3つのバッファを用いたときの三相電流値Iu、Iv、Iwの参照方法を示すフローチャートである。FIG. 13 is a flowchart showing a method of referring to the three-phase current values Iu, Iv, Iw when the three buffers of FIG. 10 are used. 図14は、第3実施形態に係る電子制御装置の三相電流値Iu、Iv、Iwの更新側と参照側との間のデータの受け渡し方法を示すブロック図である。FIG. 14 is a block diagram showing a method of passing data between the update side and the reference side of the three-phase current values Iu, Iv, Iw of the electronic control device according to the third embodiment. 図15は、図14の3つのバッファを用いたときの更新と参照の関係の一例を示すタイミングチャートである。FIG. 15 is a timing chart showing an example of the relationship between update and reference when the three buffers of FIG. 14 are used. 図16は、図14の3つのバッファを用いたときの三相電流値Iu、Iv、Iwの更新方法を示すフローチャートである。FIG. 16 is a flowchart showing a method of updating the three-phase current values Iu, Iv, Iw when the three buffers of FIG. 14 are used. 図17は、図14の3つのバッファを用いたときの三相電流値Iu、Iv、Iwの参照方法を示すフローチャートである。FIG. 17 is a flowchart showing a method of referring to the three-phase current values Iu, Iv, Iw when the three buffers of FIG. 14 are used. 図18は、複数のデータの同時性の保証方法の使い分け方法を示すフローチャートである。FIG. 18 is a flowchart showing a method of selectively using the method of guaranteeing the simultaneity of a plurality of data.

実施形態について、図面を参照して説明する。なお、以下に説明する実施形態は特許請求の範囲に係る発明を限定するものではなく、また、実施形態の中で説明されている諸要素およびその組み合わせの全てが発明の解決手段に必須であるとは限らない。 Embodiments will be described with reference to the drawings. It should be noted that the embodiments described below do not limit the invention according to the claims, and all of the elements and combinations described in the embodiments are essential to the solution means of the invention. Not necessarily.

図1は、第1実施形態に係る電子制御装置の構成を示すブロック図である。
図1において、モータ装置は、モータ101、インバータ回路102、マイコン109、バッテリ110、レゾルバ111および電流センサSu、Sv、Swを備える。モータ装置は、例えば、車両、ロボット、エレベータまたはクレーンの駆動装置として用いることができる。マイコン109は、例えば、車両に搭載された電子制御装置として用いることができる。
FIG. 1 is a block diagram showing the configuration of the electronic control device according to the first embodiment.
In FIG. 1, the motor device includes a motor 101, an inverter circuit 102, a microcomputer 109, a battery 110, a resolver 111, and current sensors Su, Sv, Sw. The motor device can be used, for example, as a drive device for a vehicle, a robot, an elevator, or a crane. The microcomputer 109 can be used as, for example, an electronic control device mounted on a vehicle.

モータ101は、例えば、三相誘導電動機である。バッテリ110は、直流電圧Edcをインバータ回路102に供給する。マイコン109は、インバータ回路102をPWM(Pulse Width Modulation)制御する。インバータ回路102は、マイコン109によるPWM制御に基づいて、直流電圧Edcを三相電圧Vu、Vv、Vwに変換し、モータ101を駆動する。レゾルバ111は、モータ101に取り付ける回転軸の角度を検出し、マイコン109に出力する。電流センサSu、Sv、Swは、モータ101に流れる電流の三相電流値Iu、Iv、Iwをそれぞれ検出し、マイコン109に出力する。 The motor 101 is, for example, a three-phase induction motor. The battery 110 supplies the DC voltage Edc to the inverter circuit 102. The microcomputer 109 controls the inverter circuit 102 by PWM (Pulse Width Modulation). The inverter circuit 102 converts the DC voltage Edc into three-phase voltages Vu, Vv, Vw based on PWM control by the microcomputer 109, and drives the motor 101. The resolver 111 detects the angle of the rotating shaft attached to the motor 101 and outputs it to the microcomputer 109. The current sensors Su, Sv, Sw detect the three-phase current values Iu, Iv, Iw of the current flowing through the motor 101, and output them to the microcomputer 109.

マイコン109は、AD(Analog to Digital)コンバータ112、PWM制御部113、RDC(resolver to digital converter)114およびモータ電流制御部108を備える。モータ電流制御部108は、電流検出部103、電流制御部104、電流指令部105、三相電圧変換部106および回転位置検出部107を備える。 The microcomputer 109 includes an AD (Analog to Digital) converter 112, a PWM control unit 113, an RDC (resolver to digital converter) 114, and a motor current control unit 108. The motor current control unit 108 includes a current detection unit 103, a current control unit 104, a current command unit 105, a three-phase voltage conversion unit 106, and a rotational position detection unit 107.

ADコンバータ112は、電流センサSu、Sv、Swにて検出された三相電流値Iu、Iv、IwをAD変換し、電流検出部103に出力する。PWM制御部113は、インバータ回路102をPWM制御する。RDC114は、レゾルバ111にて検出された回転角をデジタル化し、回転位置検出部107に出力する。 The AD converter 112 AD-converts the three-phase current values Iu, Iv, Iw detected by the current sensors Su, Sv, Sw, and outputs them to the current detection unit 103. The PWM control unit 113 PWM-controls the inverter circuit 102. The RDC 114 digitizes the rotation angle detected by the resolver 111 and outputs it to the rotation position detection unit 107.

回転位置検出部107は、モータ101の回転角θeを検出し、電流検出部103および三相電圧変換部106に出力する。電流指令部105は、電流指令値Id*、Iq*を電流制御部104に出力する。電流検出部103は、ADコンバータ112でデジタル化された三相電流値Iu、Iv、Iwおよび回転位置検出部107で検出された回転角θeに基づいて、dq変換した電流検出値Id^、Iq^を生成し、電流制御部104に出力する The rotational position detection unit 107 detects the rotation angle θe of the motor 101 and outputs it to the current detection unit 103 and the three-phase voltage conversion unit 106. The current command unit 105 outputs the current command values Id* and Iq* to the current control unit 104. The current detection unit 103 dq-converts the detected current values Id^, Iq based on the three-phase current values Iu, Iv, Iw digitized by the AD converter 112 and the rotation angle θe detected by the rotation position detection unit 107. Generate ^ and output to the current control unit 104

電流制御部104は、電流検出部103から出力された電流検出値Id^、Iq^と、電流指令部105から出力された電流指令値Id*、Iq*とが一致するように電圧指令値Vd*、Vq*を生成し、三相電圧変換部106に出力する。三相電圧変換部106は、電圧指令値Vd*、Vq*と回転角θeとから三相電圧Vu、Vv、Vwに一度変換した後、パルス幅変調(PWM)したドライブ信号によって、インバータ回路113の半導体スイッチ素子をON/OFF制御して出力電圧を調整する。 The current control unit 104 sets the voltage command value Vd so that the current detection values Id^ and Iq^ output from the current detection unit 103 and the current command values Id* and Iq* output from the current command unit 105 match. *, Vq* are generated and output to the three-phase voltage conversion unit 106. The three-phase voltage conversion unit 106 once converts the voltage command values Vd*, Vq* and the rotation angle θe into three-phase voltages Vu, Vv, Vw, and then uses a pulse-width modulated (PWM) drive signal to output the inverter circuit 113. The output voltage is adjusted by controlling ON/OFF of the semiconductor switch element.

マイコン109は、モータ制御に用いられるこれらの処理を分散させるため、マルチコアを採用することができる。このとき、マイコン109は、マイコン109において同一タスクで参照される複数のデータをマイコン109で一度に扱うことができる1つのデータに包括する。タスクは、マイコン109で実行されるプログラムの実行単位である。マイコン109において同一タスクで参照される複数のデータは、マイコン109の処理において同時性を保証すべき複数のデータである。同時性を保証すべき複数のデータは、その一部のデータが今回の更新前のデータである場合は、その他のデータも今回の更新前のデータである。また、同時性を保証すべき複数のデータは、その一部のデータが今回の更新後のデータである場合は、その他のデータも今回の更新後のデータである。例えば、マイコン109は、同一タスクで参照される複数のデータを互いに異なるタイミングで更新した場合、それら複数の更新値をマイコン109で一度に扱うことができる1つのデータに包括する。同時性を保証すべき複数のデータは、例えば、マイコン109を動作させるプログラムにて指定することができる。同時性を保証すべき複数のデータは、例えば、モータ制御に用いられる三相電流値またはdq座標の電流指令値である。 Since the microcomputer 109 distributes these processes used for motor control, a multi-core can be adopted. At this time, the microcomputer 109 includes a plurality of data referred to by the same task in the microcomputer 109 into one data that can be handled by the microcomputer 109 at one time. A task is an execution unit of a program executed by the microcomputer 109. The plurality of pieces of data referred to by the same task in the microcomputer 109 are the plurality of pieces of data whose simultaneity should be guaranteed in the processing of the microcomputer 109. If a part of the data of the plurality of data for which the simultaneity is to be guaranteed is the data before this update, the other data is also the data before this update. In addition, among a plurality of data for which simultaneity should be guaranteed, when some of the data are data after this update, other data are also data after this update. For example, when the microcomputer 109 updates a plurality of pieces of data referred to by the same task at different timings, the plurality of pieces of updated values are included in one piece of data that the microcomputer 109 can handle at one time. A plurality of data whose simultaneity should be guaranteed can be designated by a program for operating the microcomputer 109, for example. The plurality of data for which the simultaneity should be guaranteed is, for example, a three-phase current value used for motor control or a current command value of dq coordinates.

図2は、図1のマイコンのマルチコアの適用例を示すブロック図である。
図2において、マイコン109は、コアA1、A2を備える。コアA1は、電流指令部105を備える。コアA2は、電流検出部103、電流制御部104および三相電圧変換部106を備える。コアA1、A2の制御周期は、必ずしも同一周期でなくてもよい。
FIG. 2 is a block diagram showing an application example of the multi-core of the microcomputer of FIG.
In FIG. 2, the microcomputer 109 includes cores A1 and A2. The core A1 includes a current command unit 105. The core A2 includes a current detector 103, a current controller 104, and a three-phase voltage converter 106. The control cycle of the cores A1 and A2 does not necessarily have to be the same cycle.

電流制御部104は、電圧指令値Vd*、Vq*を生成するために、電流指令部105から出力された電流指令値Id*、Iq*を参照する。このとき、電流指令部105から電流制御部104に出力される電流指令値Id*、Iq*は、同時性が保証されていることを前提としたデータである。 The current control unit 104 refers to the current command values Id* and Iq* output from the current command unit 105 in order to generate the voltage command values Vd* and Vq*. At this time, the current command values Id* and Iq* output from the current command unit 105 to the current control unit 104 are data on the assumption that simultaneity is guaranteed.

しかし、電流指令部105はコアA1に設けられ、電流制御部104はコアA2に設けられている。このため、異なるコアA1、A2で電圧指令値Vd*、Vq*の更新と参照が独立に実行され、電流制御部104で参照される電流指令値Id*、Iq*の同時性が保証されないことがある。すなわち、電流制御部104が電流指令値Id*、Iq*を参照するタイミングによっては、電流指令値Id*、Iq*のうちの一方のデータId*は更新された今回値が採用され、もう一方のデータIq*は更新されていない前回値が採用されることがある。 However, the current command unit 105 is provided in the core A1 and the current control unit 104 is provided in the core A2. Therefore, the update and reference of the voltage command values Vd* and Vq* are independently executed in the different cores A1 and A2, and the simultaneity of the current command values Id* and Iq* referred to by the current control unit 104 is not guaranteed. There is. That is, depending on the timing at which the current control unit 104 refers to the current command values Id*, Iq*, the updated current value is adopted as the data Id* of one of the current command values Id*, Iq*, and the other data is adopted. The previous value that has not been updated may be used as the data Iq* of.

図3は、図2の電流指令値Id*、Iq*を包括しないときの更新と参照の関係の一例を示すタイミングチャートである。
図3において、図2の電流指令部105は、同時性を保証すべき電流指令値Id*、Iq*のうちの一方のデータId*の更新301を時刻t1に実行し、もう一方のデータIq*の更新302を時刻4に実行したものとする。このとき、電流制御部104および電流指令部105は、共有RAM(Random Access Memory)を使用し、電流指令部105が電流指令値Id*、Iq*を出力し、電流制御部104が電流指令値値Id*、Iq*を参照する。
FIG. 3 is a timing chart showing an example of the relationship between update and reference when the current command values Id* and Iq* of FIG. 2 are not included.
In FIG. 3, the current command unit 105 in FIG. 2 executes the update 301 of the data Id* of one of the current command values Id* and Iq* for which simultaneity should be guaranteed at time t1, and the other data Iq. It is assumed that the update 302 of * is executed at time 4. At this time, the current control unit 104 and the current command unit 105 use a shared RAM (Random Access Memory), the current command unit 105 outputs the current command values Id*, Iq*, and the current control unit 104 outputs the current command value. The values Id* and Iq* are referred to.

ここで、電流指令値Id*、Iq*のうちの一方のデータId*と、もう一方のデータIq*は、同一タイミングで出力されない。このとき、電流制御部104は、データId*の更新301の時刻t1と、データIq*の更新302の時刻4との間の時刻t2にデータId*の参照305を実行し、時刻t3にデータIq*の参照306を実行したものとする。この場合、電流指令値Id*、Iq*の一方のデータId*の参照値303は更新されているが、電流指令値Id*、Iq*のもう一方のデータIq*の参照値304は更新前の前回値となり、電流制御部104で参照される電流指令値Id*、Iq*の同時性が保証されない。 Here, one data Id* of the current command values Id* and Iq* and the other data Iq* are not output at the same timing. At this time, the current control unit 104 executes the reference 305 of the data Id* at the time t2 between the time t1 of the update 301 of the data Id* and the time 4 of the update 302 of the data Iq*, and at the time t3. It is assumed that the reference 306 of Iq* has been executed. In this case, the reference value 303 of one data Id* of the current command values Id* and Iq* has been updated, but the reference value 304 of the other data Iq* of the current command values Id* and Iq* has not been updated. Of the current command value Id* and Iq* referred to by the current control unit 104 is not guaranteed.

図2において、電流制御部104で参照される電流指令値Id*、Iq*の同時性を保証するため、電流指令部105は、包括部B1を備え、電流制御部104は、分割部B2を備える。包括部B1は、マイコン109の処理において同時性を保証すべき複数のデータを、マイコン109で一度に扱うことができる1つのデータに包括する。このとき、マイコン109の処理において同時性を保証すべき複数のデータのデータサイズの合計は、マイコン109で一度に扱うことができるデータサイズ以下である。例えば、マイコン109で一度に扱うことができるデータサイズが32ビット、電流指令値Id*、Iq*の一方のデータId*のデータサイズが16ビット、もう一方のデータIq*のデータサイズも16ビットである場合、包括部B1は、これらの2つのデータId*、Iq*を1つのデータに包括することができる。 In FIG. 2, in order to guarantee the simultaneity of the current command values Id* and Iq* referred to by the current control unit 104, the current command unit 105 includes the enclosing unit B1, and the current control unit 104 includes the dividing unit B2. Prepare The inclusion unit B1 includes a plurality of data whose simultaneity should be guaranteed in the processing of the microcomputer 109 into one data that can be handled by the microcomputer 109 at one time. At this time, the sum of the data sizes of the plurality of data for which the simultaneity should be guaranteed in the processing of the microcomputer 109 is less than or equal to the data size that the microcomputer 109 can handle at one time. For example, the data size that can be handled at one time by the microcomputer 109 is 32 bits, the data size of one of the current command values Id* and Iq* is 16 bits, and the data size of the other data Iq* is also 16 bits. In this case, the inclusion unit B1 can include these two data Id* and Iq* in one data.

分割部B2は、包括部B1で包括後の1つのデータを元の複数のデータに分割する。例えば、分割部B2は、包括部B1で包括後の1つのデータを2つのデータId*、Iq*に分割する。 The dividing unit B2 divides one piece of data that has been covered by the covering unit B1 into a plurality of original data. For example, the dividing unit B2 divides one piece of data that has been covered by the covering unit B1 into two pieces of data Id* and Iq*.

図4は、図2の電流指令値Id*、Iq*を包括したデータの一例を示す図である。
図4において、図2の電流指令部105で更新される電流指令値Id*、Iq*の各データ401、402は、16ビットのRAMで管理されていたものとする。このとき、電流指令値Id*、Iq*の2つのデータ401、402を1つのデータ403として包括できる32ビットの共有RAM404を用意する。
FIG. 4 is a diagram showing an example of data including the current command values Id* and Iq* of FIG.
In FIG. 4, it is assumed that the data 401 and 402 of the current command values Id* and Iq* updated by the current command unit 105 of FIG. 2 are managed by a 16-bit RAM. At this time, a 32-bit shared RAM 404 capable of including the two data 401 and 402 of the current command values Id* and Iq* as one data 403 is prepared.

そして、電流指令部105は、電流指令値Id*、Iq*のデータ401、402がどちらも更新された後に、共有RAM404の上位16ビットにデータ401、下位16ビットにデータ402を格納し、1つのデータ403として管理する。 Then, the current command unit 105 stores the data 401 in the upper 16 bits and the data 402 in the lower 16 bits of the shared RAM 404 after both the data 401 and 402 of the current command values Id* and Iq* are updated, It manages as one data 403.

電流制御部104は、電流指令値Id*、Iq*として1つのデータ403が格納された共有RAM404にアクセスし、電流指令値Id*、Iq*を1つのデータ403として参照する。そして、電流制御部104は、32ビットの1つのデータ403から2つのデータ401、402を16ビットごとに取り出す。これにより、電流制御部104は、電流指令値Id*、Iq*の各データ401、402が同一タイミングで更新されない場合においても、同時性が保証された電流指令値Id*、Iq*を参照することができる。 The current control unit 104 accesses the shared RAM 404 in which one data 403 is stored as the current command values Id* and Iq*, and refers to the current command values Id* and Iq* as one data 403. Then, the current control unit 104 extracts two pieces of data 401 and 402 from one piece of 32-bit data 403 every 16 bits. As a result, the current control unit 104 refers to the current command values Id* and Iq* whose simultaneity is guaranteed even when the data 401 and 402 of the current command values Id* and Iq* are not updated at the same timing. be able to.

このとき、電流指令部105での電流指令値Id*、Iq*の更新処理と、電流制御部104での電流指令値Id*、Iq*の参照処理は、電流指令部105と電流制御部104とで非同期に独立して実行することができる。このため、電流指令部105での電流指令値Id*、Iq*の更新タイミングに応じて電流指令部105での電流指令値Id*、Iq*の参照タイミングを管理したり、電流指令部105での電流指令値Id*、Iq*の参照タイミングに応じて電流指令部105での電流指令値Id*、Iq*の更新タイミングを管理したりする必要がなく、処理負荷の増大を抑制することができる。 At this time, the updating process of the current command values Id* and Iq* in the current command unit 105 and the reference process of the current command values Id* and Iq* in the current control unit 104 are performed by the current command unit 105 and the current control unit 104. And can be run asynchronously and independently. Therefore, the reference timing of the current command values Id* and Iq* in the current command unit 105 is managed according to the update timing of the current command values Id* and Iq* in the current command unit 105, and the current command unit 105 manages the reference timing. It is not necessary to manage the update timing of the current command values Id* and Iq* in the current command unit 105 according to the reference timings of the current command values Id* and Iq* of FIG. it can.

図5は、図2の電流指令値Id*、Iq*を包括したときの更新と参照の関係の一例を示すタイミングチャートである。
図5において、図2の電流指令部105は、同時性を保証すべき電流指令値Id*、Iq*のうちの16ビットのデータId*の更新501を時刻t11に実行し、もう一方の16ビットのデータIq*の更新502を時刻12に実行したものとする。
FIG. 5 is a timing chart showing an example of the relationship between update and reference when the current command values Id* and Iq* of FIG. 2 are included.
In FIG. 5, the current command unit 105 of FIG. 2 executes the update 501 of 16-bit data Id* of the current command values Id* and Iq* for which simultaneity should be guaranteed at time t11, and the other 16 It is assumed that the update 502 of the bit data Iq* is executed at time 12.

次に、電流指令部105は、同時性を保証すべき電流指令値Id*、Iq*を1つのデータに包括し、その包括した32ビットの電流指令値Id*、Iq*を共有RAMに格納することで、共有RAMの電流指令値Id*、Iq*の更新503を時刻13に実行する。 Next, the current command unit 105 includes the current command values Id* and Iq* whose simultaneity should be guaranteed in one data, and stores the included 32-bit current command values Id* and Iq* in the shared RAM. By doing so, the update 503 of the current command values Id* and Iq* of the shared RAM is executed at time 13.

次に、電流制御部104は、共有RAMに1つのデータとして格納されている32ビットの電流指令値Id*、Iq*の参照507を時刻14に実行する。次に、電流制御部104は、1つのデータとして参照した32ビットの電流指令値Id*、Iq*の分割508を時刻15に実行し、16ビットの電流指令値Id*および16ビットの電流指令値Iq*を取得する。 Next, the current control unit 104 executes reference 507 of the 32-bit current command values Id* and Iq* stored as one data in the shared RAM at time 14. Next, the current control unit 104 executes the division 508 of the 32-bit current command values Id* and Iq* referred to as one data at time 15 to obtain the 16-bit current command value Id* and the 16-bit current command. Get the value Iq*.

このとき、16ビットのデータId*が時刻t11に更新され、16ビットのデータIq*が時刻t12に更新された場合においても、電流制御部104は、それら2つのデータが1つのデータとして包括された32ビットの電流指令値Id*、Iq*を時刻t14に参照することができる。ここで、32ビットの電流指令値Id*、Iq*の参照値504は更新されているため、その32ビットの電流指令値Id*、Iq*から分割された16ビットの電流指令値Id*の参照値505および16ビットの電流指令値Iq*の参照値505のいずれも更新された値となり、電流制御部104で参照される電流指令値Id*、Iq*の同時性を保証することができる。 At this time, even when the 16-bit data Id* is updated at time t11 and the 16-bit data Iq* is updated at time t12, the current control unit 104 includes these two data as one data. The 32-bit current command values Id* and Iq* can be referenced at time t14. Here, since the reference value 504 of the 32-bit current command value Id*, Iq* is updated, the 16-bit current command value Id* of the 32-bit current command value Id*, Iq* is divided. Both the reference value 505 and the reference value 505 of the 16-bit current command value Iq* are updated values, and the simultaneity of the current command values Id* and Iq* referenced by the current control unit 104 can be guaranteed. ..

また、電流指令部105での更新501、502、503と、電流制御部104での参照507および分割508は、電流指令部105と流制御部104とで非同期に独立して実行することができ、電流指令部105および電流制御部104の処理負荷の増大を抑制することができる。 Further, the updates 501, 502, and 503 in the current command unit 105 and the reference 507 and the division 508 in the current control unit 104 can be independently executed asynchronously in the current command unit 105 and the flow control unit 104. It is possible to suppress an increase in processing load on the current command unit 105 and the current control unit 104.

図6は、図2の電流指令値Id*、Iq*の包括方法を示すフローチャートである。
図6において、図2の電流指令部105は、電流指令値Id*、Iq*の一方のデータId*を算出する(S11)。次に、電流指令部105は、電流指令値Id*、Iq*のもう一方のデータIq*を算出する(S12)。
FIG. 6 is a flowchart showing a method of including the current command values Id* and Iq* in FIG.
In FIG. 6, the current command unit 105 of FIG. 2 calculates one data Id* of the current command values Id* and Iq* (S11). Next, the current command unit 105 calculates the other data Iq* of the current command values Id* and Iq* (S12).

次に、電流指令部105は、32ビット単位でデータが格納される共有RAMの上位16ビットにデータId*を格納し(S13)、下位16ビットにデータIq*を格納し、電流指令値Id*、Iq*を32ビットのデータとして管理する。 Next, the current command unit 105 stores the data Id* in the upper 16 bits of the shared RAM in which data is stored in units of 32 bits (S13), stores the data Iq* in the lower 16 bits, and outputs the current command value Id. *, Iq* are managed as 32-bit data.

図7は、図2の電流指令値Id*、Iq*の参照方法を示すフローチャートである。
図7において、図2の電流制御部104は、電流指令部105で包括された32ビットの電流指令値Id*、Iq*を参照する(S21)。次に、電流制御部104は、1つのデータに包括された32ビットの電流指令値Id*、Iq*から、上位16ビットのデータId*を取得する。次に、電流制御部104は、1つのデータに包括された32ビットの電流指令値Id*、Iq*から、下位16ビットのデータIq*を取得する。
FIG. 7 is a flowchart showing a method of referring to the current command values Id* and Iq* of FIG.
In FIG. 7, the current control unit 104 of FIG. 2 refers to the 32-bit current command values Id* and Iq* included in the current command unit 105 (S21). Next, the current control unit 104 acquires the upper 16-bit data Id* from the 32-bit current command values Id* and Iq* included in one data. Next, the current control unit 104 acquires the lower 16-bit data Iq* from the 32-bit current command values Id* and Iq* included in one data.

上述した第1実施形態では、更新側で更新された電流指令値Id*、Iq*を1つのデータに包括することにより、参照側で用いられる電流指令値Id*、Iq*の同時性を保証する方法について説明した。しかし、データの包括によってデータの同時性を保証する方法は、同時性を保証すべき複数のデータのデータサイズの合計がマイコン109で一度に扱えるデータサイズ以下でなければならない。 In the above-described first embodiment, the current command values Id* and Iq* updated on the update side are included in one data, thereby guaranteeing the simultaneity of the current command values Id* and Iq* used on the reference side. I explained how to do it. However, in the method of guaranteeing data simultaneity by including data, the total data size of a plurality of data for which simultaneity is to be guaranteed must be equal to or smaller than the data size that the microcomputer 109 can handle at one time.

以下、同時性を保証すべき複数のデータのデータサイズの合計がマイコン109で一度に扱えるデータサイズよりも大きい場合の複数のデータの同時性の保証方法について説明する。 Hereinafter, a method of guaranteeing the simultaneity of a plurality of data when the total data size of the plurality of data for which the simultaneity is to be guaranteed is larger than the data size that the microcomputer 109 can handle at once will be described.

図8は、第2実施形態に係る電子制御装置の構成を示すブロック図である。
図8において、この電子制御装置は、図2のマイコン109の代わりにマイコン109Aを備える。なお、以下の説明では、マイコン109Aは、32ビットマルチコアマイコンであるものとする。マイコン109Aは、図2のマイコン109の構成に加え、モータ温度推定部115を備える。モータ温度推定部115は、ADコンバータ112でデジタル化された三相電流値Iu、Iv、Iwに基づいて、図1のモータ101の温度を推定する。
FIG. 8 is a block diagram showing the configuration of the electronic control device according to the second embodiment.
In FIG. 8, this electronic control unit includes a microcomputer 109A instead of the microcomputer 109 of FIG. In the following description, it is assumed that the microcomputer 109A is a 32-bit multicore microcomputer. The microcomputer 109A includes a motor temperature estimation unit 115 in addition to the configuration of the microcomputer 109 of FIG. The motor temperature estimation unit 115 estimates the temperature of the motor 101 in FIG. 1 based on the three-phase current values Iu, Iv, Iw digitized by the AD converter 112.

マイコン109Aは、コアA11〜A13を備える。コアA11は、ADコンバータ112を備える。コアA12は、電流検出部103、電流制御部104、電流指令部105、三相電圧変換部106および回転位置検出部107を備える。コアA13は、モータ温度推定部115を備える。コアA11〜A13の制御周期は、必ずしも同周期でなくてもよい。 The microcomputer 109A includes cores A11 to A13. The core A11 includes an AD converter 112. The core A12 includes a current detection unit 103, a current control unit 104, a current command unit 105, a three-phase voltage conversion unit 106, and a rotational position detection unit 107. The core A13 includes a motor temperature estimation unit 115. The control cycle of the cores A11 to A13 does not necessarily have to be the same cycle.

モータ温度推定部115は、モータ101の温度を推定するために、ADコンバータ112から出力された三相電流値Iu、Iv、Iwを参照する。なお、以下の説明では、三相電流値Iu、Iv、Iwは、それぞれ16ビットのデータであるものとする。このとき、ADコンバータ112からモータ温度推定部115に出力される三相電流値Iu、Iv、Iwは、同時性が保証されていることを前提としたデータである。 The motor temperature estimation unit 115 refers to the three-phase current values Iu, Iv, Iw output from the AD converter 112 in order to estimate the temperature of the motor 101. In the following description, the three-phase current values Iu, Iv, and Iw are each 16-bit data. At this time, the three-phase current values Iu, Iv, and Iw output from the AD converter 112 to the motor temperature estimation unit 115 are data on the assumption that simultaneity is guaranteed.

しかし、ADコンバータ112はコアA11に設けられ、モータ温度推定部115はコアA3に設けられている。このため、異なるコアA11、A13で三相電流値Iu、Iv、Iwの更新と参照が独立に実行され、モータ温度推定部115で参照される三相電流値Iu、Iv、Iwの同時性が保証されないことがある。すなわち、モータ温度推定部115が三相電流値Iu、Iv、Iwを参照するタイミングによっては、三相電流値Iu、Iv、Iwのうちの一部のデータは更新された今回値が採用され、残りのデータは更新されていない前回値が採用されることがある。 However, the AD converter 112 is provided in the core A11, and the motor temperature estimation unit 115 is provided in the core A3. Therefore, the three core current values Iu, Iv, and Iw are independently updated and referred to by the different cores A11 and A13, and the simultaneity of the three phase current values Iu, Iv, and Iw referred to by the motor temperature estimation unit 115 is determined. May not be guaranteed. That is, depending on the timing when the motor temperature estimation unit 115 refers to the three-phase current values Iu, Iv, and Iw, some of the three-phase current values Iu, Iv, and Iw have the updated current values, For the remaining data, the previous value that has not been updated may be adopted.

図9は、三相電流値Iu、Iv、Iwの同時性が保証されないときの更新と参照の関係の一例を示すタイミングチャートである。
図9において、図8のADコンバータ112は、同時性を保証すべき三相電流値Iu、Iv、IwのうちのデータIuの更新601を時刻t21に実行し、データIvの更新602を時刻22に実行し、データIwの更新603を時刻26に実行したものとする。
FIG. 9 is a timing chart showing an example of the relationship between update and reference when the simultaneity of the three-phase current values Iu, Iv, and Iw is not guaranteed.
In FIG. 9, the AD converter 112 of FIG. 8 executes the update 601 of the data Iu of the three-phase current values Iu, Iv, Iw for which the simultaneity should be guaranteed at time t21, and the update 602 of the data Iv at time 22. The update 603 of the data Iw is executed at time 26.

一方、モータ温度推定部115は、データIvの更新602の時刻t22と、データIwの更新603の時刻26との間の時刻t23にデータIuの参照607を実行し、時刻t24にデータIvの参照608を実行し、時刻t25にデータIwの参照609を実行したものとする。この場合、三相電流値Iu、Iv、IwのうちのデータIu、Ivの参照値604、605は更新されているが、三相電流値Iu、Iv、IwのうちデータIwの参照値606は更新前の前回値となり、モータ温度推定部115で参照される三相電流値Iu、Iv、Iwの同時性は保証されない。 On the other hand, the motor temperature estimation unit 115 executes the reference 607 of the data Iu at the time t23 between the time t22 of the update 602 of the data Iv and the time 26 of the update 603 of the data Iw, and refers to the data Iv at the time t24. It is assumed that 608 is executed and the reference 609 of the data Iw is executed at time t25. In this case, the reference values 604, 605 of the data Iu, Iv of the three-phase current values Iu, Iv, Iw are updated, but the reference value 606 of the data Iw of the three-phase current values Iu, Iv, Iw is This is the previous value before updating, and the simultaneity of the three-phase current values Iu, Iv, Iw referred to by the motor temperature estimating unit 115 is not guaranteed.

この第2実施形態では、三相電流値Iu、Iv、Iwの合計データサイズは48ビットであるのに対して、マイコン109Aで一度に扱うことができるデータサイズは32ビットである。このため、マイコン109Aの処理において同時性を保証すべき三相電流値Iu、Iv、Iwのデータサイズの合計は、マイコン109Aで一度に扱うことができるデータサイズより大きく、三相電流値Iu、Iv、Iwをマイコン109Aで一度に扱うことができる1つのデータに包括することはできない。 In the second embodiment, the total data size of the three-phase current values Iu, Iv, Iw is 48 bits, whereas the data size that can be handled at one time by the microcomputer 109A is 32 bits. Therefore, the sum of the data sizes of the three-phase current values Iu, Iv, and Iw for which simultaneity should be guaranteed in the processing of the microcomputer 109A is larger than the data size that the microcomputer 109A can handle at one time, and the three-phase current value Iu, Iv and Iw cannot be included in one data that can be handled at one time by the microcomputer 109A.

以下の実施形態では、同時性を保証すべき複数のデータのデータサイズの合計がマイコン109Aで一度に扱えるデータサイズよりも大きい場合、三面の同サイズの中間バッファ(トリプルバッファ)を用意し、そのトリプルバッファに対して、三相電流値Iu、Iv、Iwの更新と参照を行うことで、三相電流値Iu、Iv、Iwの同時性を保証する方法について説明する。 In the following embodiments, when the total data size of a plurality of data for which the simultaneity is to be guaranteed is larger than the data size that can be handled at one time by the microcomputer 109A, an intermediate buffer (triple buffer) of the same size on three sides is prepared. A method of guaranteeing the simultaneity of the three-phase current values Iu, Iv, Iw by updating and referring to the three-phase current values Iu, Iv, Iw for the triple buffer will be described.

なお、第2実施形態では、同時性を保証すべき三相電流値Iu、Iv、Iwの更新側の制御周期が参照側の制御周期より速い場合を前提とし、第3実施形態では、同時性を保証すべき三相電流値Iu、Iv、Iwの参照側の制御周期が更新側の制御周期より速い場合を前提とする。 The second embodiment is premised on the case where the control cycle on the update side of the three-phase current values Iu, Iv, and Iw for which the simultaneity is to be guaranteed is faster than the control cycle on the reference side. It is premised that the control cycle on the reference side of the three-phase current values Iu, Iv, and Iw that should be guaranteed is faster than the control cycle on the update side.

図10は、第2実施形態に係る三相電流値Iu、Iv、Iwの検出値の更新側と参照側との間のデータの受け渡し方法を示すブロック図である。
図10において、図8のマイコン109Aは、トリプルバッファとして、3つのバッファ701〜703を備える。各バッファ701〜703のデータサイズは、48ビットとすることができる。このとき、各バッファ701〜703は、48ビットの三相電流値Iu、Iv、Iwを保持することができる。
FIG. 10 is a block diagram showing a data transfer method between the update side of the detected values of the three-phase current values Iu, Iv, and Iw and the reference side according to the second embodiment.
10, the microcomputer 109A in FIG. 8 includes three buffers 701 to 703 as triple buffers. The data size of each of the buffers 701 to 703 can be 48 bits. At this time, the buffers 701 to 703 can hold the 48-bit three-phase current values Iu, Iv, and Iw.

図8のマイコン109Aは、ADコンバータ112としてADコンバータ112Aを備え、モータ温度推定部115としてモータ温度推定部115Aを備える。ADコンバータ112AはコアA11に割り当てられ、モータ温度推定部115AはコアA13に割り当てられている。ADコンバータ112Aは、三相電流値Iu、Iv、Iwの更新側として動作し、モータ温度推定部115Aは、三相電流値Iu、Iv、Iwの参照側として動作する。三相電流値Iu、Iv、Iwの更新側と参照側のそれぞれは、3つのバッファ701〜703から任意に選択したいずれのバッファに対しても非同期にアクセス可能である。 The microcomputer 109A of FIG. 8 includes an AD converter 112A as the AD converter 112 and a motor temperature estimation unit 115A as the motor temperature estimation unit 115. The AD converter 112A is assigned to the core A11, and the motor temperature estimation unit 115A is assigned to the core A13. The AD converter 112A operates as an update side of the three-phase current values Iu, Iv, Iw, and the motor temperature estimation unit 115A operates as a reference side of the three-phase current values Iu, Iv, Iw. Each of the update side and the reference side of the three-phase current values Iu, Iv, and Iw can asynchronously access any of the buffers arbitrarily selected from the three buffers 701 to 703.

ここで、3つのバッファ701〜703は、更新側から参照側への三相電流値Iu、Iv、Iwの受け渡しに用いることができる。このとき、参照側が3つのバッファ701〜703から任意に選択したいずれかのバッファを参照しているときは、更新側は3つのバッファ701〜703のいずれも更新しないようにする。 Here, the three buffers 701 to 703 can be used for passing the three-phase current values Iu, Iv, and Iw from the update side to the reference side. At this time, when the reference side refers to any buffer arbitrarily selected from the three buffers 701 to 703, the updating side does not update any of the three buffers 701 to 703.

例えば、ADコンバータ112Aが、3つのバッファ701〜703から任意に選択したいずれかのバッファに三相電流値Iu、Iv、Iwのデータを格納するものとする。また、3つのバッファ701〜703のうちのバッファ703に最新データが格納されており、モータ温度推定部115Aは参照処理を行っているものとする。 For example, it is assumed that the AD converter 112A stores the data of the three-phase current values Iu, Iv, and Iw in one of the buffers arbitrarily selected from the three buffers 701 to 703. Further, it is assumed that the latest data is stored in the buffer 703 of the three buffers 701 to 703, and the motor temperature estimation unit 115A is performing the reference process.

この状態の場合に、ADコンバータ112Aが3つのバッファ701〜703のどのバッファをデータの格納対象とするかについて説明する。 In this case, which of the three buffers 701 to 703 is to be the data storage target by the AD converter 112A will be described.

ADコンバータ112Aは、最新データが格納されているバッファ703および参照対象であるバッファ702以外のバッファ701をデータの格納対象とする。すなわち、ADコンバータ112Aは、三相電流値Iu、Iv、Iwのデータの格納先をバッファ701に決定する。 The AD converter 112A sets a buffer 703 storing the latest data and a buffer 701 other than the reference target buffer 702 as data storage targets. That is, the AD converter 112A determines the storage destination of the data of the three-phase current values Iu, Iv, and Iw in the buffer 701.

最新データが格納されているバッファ703および参照対象であるバッファ702以外のバッファ701をデータの格納対象とする場合、ADコンバータ112Aは、モータ温度推定部115Aの参照対象がバッファ702であることを知らなければならない。このため、モータ温度推定部115Aは、データの参照先を異なるコアA11、A13間の共有RAMデータとしてADコンバータ112Aに通知する(705)。 When the buffer 701 that stores the latest data and the buffer 701 other than the buffer 702 that is the reference target are the data storage targets, the AD converter 112A knows that the reference target of the motor temperature estimation unit 115A is the buffer 702. There must be. Therefore, the motor temperature estimation unit 115A notifies the AD converter 112A of the data reference destination as shared RAM data between the different cores A11 and A13 (705).

また、ADコンバータ112Aが格納対象として決定したバッファ701に対して三相電流値Iu、Iv、Iwを格納しようとするタイミングでは、前回の格納先が現状で三相電流値Iu、Iv、Iwの最新データを格納しているバッファであるため、三相電流値Iu、Iv、Iwの前回の格納先であるバッファ703を記憶する。 Further, at the timing of storing the three-phase current values Iu, Iv, Iw in the buffer 701 determined as the storage target by the AD converter 112A, the previous storage destination is currently the three-phase current values Iu, Iv, Iw. Since it is the buffer that stores the latest data, the buffer 703 that is the previous storage destination of the three-phase current values Iu, Iv, and Iw is stored.

このようにして、ADコンバータ112Aは、参照対象のバッファ702および前回の三相電流値Iu、Iv、Iwの格納先のバッファ703以外のバッファ701を三相電流値Iu、Iv、Iwの次の格納先として決定することができる。 In this way, the AD converter 112A sets the buffer 701 other than the reference target buffer 702 and the buffer 703 of the storage destination of the previous three-phase current values Iu, Iv, and Iw to the next of the three-phase current values Iu, Iv, and Iw. It can be determined as the storage destination.

一方、モータ温度推定部115Aは、ADコンバータ112Aが格納した三相電流値Iu、Iv、Iwの最新データを取得することで、三相電流値Iu、Iv、Iwの最新データを常に参照できるようにする。そのために、モータ温度推定部115Aは、ADコンバータ112Aがどのバッファに対して、三相電流値Iu、Iv、Iwの最新データを格納したかを通知してもらう。このとき、ADコンバータ112Aは、データの格納先を異なるコアA11、A13間の共有RAMデータとしてモータ温度推定部115Aに通知する(704)。 On the other hand, the motor temperature estimation unit 115A acquires the latest data of the three-phase current values Iu, Iv, Iw stored in the AD converter 112A, so that the latest data of the three-phase current values Iu, Iv, Iw can be referred to at all times. To Therefore, the motor temperature estimation unit 115A has the AD converter 112A notify which buffer stores the latest data of the three-phase current values Iu, Iv, and Iw. At this time, the AD converter 112A notifies the motor temperature estimation unit 115A of the data storage destination as shared RAM data between the different cores A11 and A13 (704).

しかし、以上の方法で三相電流値Iu、Iv、Iwの同時性を保証しようとしても、割込みが発生して、処理遅延が発生すると、モータ温度推定部115Aが参照中のバッファと同一バッファに対して、ADコンバータ112Aがデータを格納し、三相電流値Iu、Iv、Iwの同時性が保証できない可能性がある。このため、モータ温度推定部115Aがトリプルバッファを参照中は必ず、ADコンバータ112Aがトリプルバッファにデータを格納しないように制限する。 However, even if an attempt is made to guarantee the simultaneity of the three-phase current values Iu, Iv, and Iw by the above method, if a processing delay occurs due to an interrupt, the motor temperature estimation unit 115A stores the same buffer as the one being referred to. On the other hand, there is a possibility that the AD converter 112A stores data and the simultaneity of the three-phase current values Iu, Iv, and Iw cannot be guaranteed. Therefore, while the motor temperature estimation unit 115A is referring to the triple buffer, the AD converter 112A is restricted so as not to store data in the triple buffer.

このようにADコンバータ112Aによるトリプルバッファへの格納を制限するには、ADコンバータ112Aは、モータ温度推定部115Aがトリプルバッファを参照中かどうかを知らなければならない。このため、モータ温度推定部115Aは、参照中フラグを異なるコアA11、A13間の共有RAMデータとしてADコンバータ112Aに通知する(706)。ADコンバータ112Aは、参照中フラグを参照し、参照中フラグがONの場合は必ずトリプルバッファに対して、データを格納しないようにすることで、トリプルバッファを使用した三相電流値Iu、Iv、Iwの同時性を保証することができる。 To limit the storage in the triple buffer by the AD converter 112A in this way, the AD converter 112A must know whether the motor temperature estimation unit 115A is referring to the triple buffer. Therefore, the motor temperature estimation unit 115A notifies the AD converter 112A of the reference flag as shared RAM data between the different cores A11 and A13 (706). The AD converter 112A refers to the reference flag and prevents the triple buffer from storing data when the reference flag is ON, so that the three-phase current values Iu, Iv, and It is possible to guarantee the simultaneity of Iw.

図11は、図10の3つのバッファを用いたときの更新と参照の関係の一例を示すタイミングチャートである。
図11において、図10のADコンバータ112Aは、同時性を保証すべき三相電流値Iu、Iv、Iwのうちの16ビットのデータIuの更新801を時刻t31に実行し、16ビットのデータIvの更新802を時刻t32に実行し、16ビットのデータIwの更新803を時刻t33に実行したものとする。
FIG. 11 is a timing chart showing an example of the relationship between update and reference when the three buffers of FIG. 10 are used.
11, the AD converter 112A of FIG. 10 executes the update 801 of the 16-bit data Iu of the three-phase current values Iu, Iv, and Iw for which the simultaneity should be guaranteed at time t31, and the 16-bit data Iv. 802 is executed at time t32, and the update 803 of 16-bit data Iw is executed at time t33.

次に、ADコンバータ112Aは、トリプルバッファのうち格納対象となるバッファを決定し、更新801〜803を実行した48ビットのデータIu、Iv、Iwの格納804を時刻t34に実行する。 Next, the AD converter 112A determines a buffer to be stored among the triple buffers, and stores 804 the 48-bit data Iu, Iv, and Iw for which the updates 801 to 803 have been executed, at time t34.

次に、モータ温度推定部115Aは、トリプルバッファのうち最新のデータIu、Iv、Iwが格納されたバッファを参照先に設定し、データIuの参照808を時刻t35に実行し、データIvの参照809を時刻t36に実行し、データIwの参照810を時刻t37に実行する。 Next, the motor temperature estimation unit 115A sets the buffer in which the latest data Iu, Iv, and Iw are stored among the triple buffers as the reference destination, executes the reference 808 of the data Iu at time t35, and refers to the data Iv. 809 is executed at time t36, and reference 810 of the data Iw is executed at time t37.

このとき、3つのデータIu、Iv、Iwの更新後に3つのデータIu、Iv、Iwがバッファに格納される。このため、モータ温度推定部115Aは、バッファに格納された3つのデータIu、Iv、Iwを参照することにより、データIuの参照値805、データIvの参照値806およびデータIwの参照値807のいずれも更新された値とすることができ、モータ温度推定部115Aで参照される三相電流値Iu、Iv、Iwの同時性を保証することができる。 At this time, after updating the three data Iu, Iv, and Iw, the three data Iu, Iv, and Iw are stored in the buffer. For this reason, the motor temperature estimation unit 115A refers to the three data Iu, Iv, and Iw stored in the buffer to determine the reference value 805 of the data Iu, the reference value 806 of the data Iv, and the reference value 807 of the data Iw. Both can be updated values, and the simultaneity of the three-phase current values Iu, Iv, and Iw referred to by the motor temperature estimation unit 115A can be guaranteed.

図12は、図10の3つのバッファを用いたときの三相電流値Iu、Iv、Iwの更新方法を示すフローチャートである。
図12において、図10のADコンバータ112Aは、モータ温度推定部115Aが設定した参照中フラグを判定し(S31)、参照中フラグがONであれば処理を終了する。
FIG. 12 is a flowchart showing a method of updating the three-phase current values Iu, Iv, Iw when the three buffers of FIG. 10 are used.
In FIG. 12, the AD converter 112A in FIG. 10 determines the reference flag set by the motor temperature estimation unit 115A (S31), and ends the process if the reference flag is ON.

一方、参照中フラグがOFFの場合、ADコンバータ112Aは、モータ温度推定部115Aが参照先として設定しているバッファと、三相電流値Iu、Iv、Iwの最新データが格納されているバッファ以外のバッファを三相電流値Iu、Iv、Iwの格納先として決定する(S32)。 On the other hand, when the in-reference flag is OFF, the AD converter 112A is other than the buffer set as the reference destination by the motor temperature estimating unit 115A and the buffer storing the latest data of the three-phase current values Iu, Iv, and Iw. Is determined as the storage destination of the three-phase current values Iu, Iv, and Iw (S32).

次に、ADコンバータ112Aは、三相電流値Iu、Iv、Iwの格納先として決定したバッファに対して、三相電流値Iu、Iv、Iwを格納し(S33)、三相電流値Iu、Iv、Iwの最新データの格納先を更新する(S34)。 Next, the AD converter 112A stores the three-phase current values Iu, Iv, and Iw in the buffer determined as the storage destination of the three-phase current values Iu, Iv, and Iw (S33), and the three-phase current value Iu, The storage destination of the latest data of Iv and Iw is updated (S34).

図13は、図10の3つのバッファを用いたときの三相電流値Iu、Iv、Iwの参照方法を示すフローチャートである。
図13において、図10のモータ温度推定部115Aは、参照中フラグをONにする(S41)。
FIG. 13 is a flowchart showing a method of referring to the three-phase current values Iu, Iv, Iw when the three buffers of FIG. 10 are used.
In FIG. 13, the motor temperature estimation unit 115A of FIG. 10 turns on the reference flag (S41).

次に、モータ温度推定部115Aは、ADコンバータ112Aが設定した三相電流値Iu、Iv、Iwの最新データが格納されているバッファを参照先に設定する(S42)。 Next, the motor temperature estimation unit 115A sets the buffer that stores the latest data of the three-phase current values Iu, Iv, and Iw set by the AD converter 112A as the reference destination (S42).

次に、モータ温度推定部115Aは、参照中フラグをOFFし(S43)、参照先のバッファから三相電流値Iu、Iv、Iwの最新データを取得する(S44)。 Next, the motor temperature estimation unit 115A turns off the reference flag (S43), and acquires the latest data of the three-phase current values Iu, Iv, Iw from the reference destination buffer (S44).

ここで、参照中フラグのONとOFFの間に参照先を設定する処理を行うことによって、参照中フラグがON中は必ずADコンバータ112Aの格納処理が発生しないことから、参照先のバッファに対して三相電流値Iu、Iv、Iwが格納されることはない。その後、モータ温度推定部115Aは、参照先として設定されたバッファから三相電流値Iu、Iv、Iwの最新データを参照する。以上の方法により、三相電流値Iu、Iv、Iwの参照側であるモータ温度推定部115Aは、同時性が保証された三相電流値Iu、Iv、Iwを参照することができる。 Here, by performing the process of setting the reference destination between ON and OFF of the reference flag, the storage process of the AD converter 112A does not always occur while the reference flag is ON. Therefore, the three-phase current values Iu, Iv, and Iw are not stored. After that, the motor temperature estimation unit 115A refers to the latest data of the three-phase current values Iu, Iv, Iw from the buffer set as the reference destination. By the method described above, the motor temperature estimation unit 115A, which is the reference side of the three-phase current values Iu, Iv, and Iw, can refer to the three-phase current values Iu, Iv, and Iw with guaranteed simultaneity.

上述した第2実施形態で示した参照中フラグを適用して同時性を保証する方法では、更新側の制御周期が参照側の制御周期よりも速い場合、参照中フラグを用いてデータ格納処理を制限することで同時性を保証している。 In the method of guaranteeing the simultaneity by applying the in-reference flag shown in the second embodiment described above, when the update-side control cycle is faster than the reference-side control cycle, the in-reference flag is used to perform the data storage processing. Concurrency is guaranteed by limiting.

しかし、参照側の制御周期が更新側の制御周期よりも速い場合、データ参照処理に制限をかけなくてはならない。以下の第3実施形態では、参照側の制御周期が更新側の制御周期よりも速い場合のデータの同時性の保証方法について説明する。 However, if the control cycle on the reference side is faster than the control cycle on the update side, the data reference processing must be restricted. In the following third embodiment, a method of guaranteeing data simultaneity when the control cycle on the reference side is faster than the control cycle on the update side will be described.

図14は、第3実施形態に係る電子制御装置の三相電流値Iu、Iv、Iwの更新側と参照側との間のデータの受け渡し方法を示すブロック図である。
図14において、図8のマイコン109Aは、3つのバッファ711〜713を備える。各バッファ711〜713のデータサイズは、48ビットとすることができる。このとき、各バッファ711〜713は、48ビットの三相電流値Iu、Iv、Iwを保持することができる。
FIG. 14 is a block diagram showing a method of passing data between the update side and the reference side of the three-phase current values Iu, Iv, Iw of the electronic control device according to the third embodiment.
14, the microcomputer 109A in FIG. 8 includes three buffers 711 to 713. The data size of each buffer 711-713 can be 48 bits. At this time, the buffers 711 to 713 can hold the 48-bit three-phase current values Iu, Iv, and Iw.

図8のマイコン109Aは、ADコンバータ112としてADコンバータ112Bを備え、モータ温度推定部115としてモータ温度推定部115Bを備える。ADコンバータ112BはコアA11に割り当てられ、モータ温度推定部115BはコアA13に割り当てられている。ADコンバータ112Bは、三相電流値Iu、Iv、Iwの更新側として動作し、モータ温度推定部115Bは、三相電流値Iu、Iv、Iwの参照側として動作する。三相電流値Iu、Iv、Iwの更新側と参照側のそれぞれは、3つのバッファ711〜713からそれぞれ任意に選択したいずれのバッファに対しても非同期にアクセス可能である。 The microcomputer 109A in FIG. 8 includes an AD converter 112B as the AD converter 112 and a motor temperature estimation unit 115B as the motor temperature estimation unit 115. The AD converter 112B is assigned to the core A11, and the motor temperature estimation unit 115B is assigned to the core A13. The AD converter 112B operates as an update side of the three-phase current values Iu, Iv, Iw, and the motor temperature estimation unit 115B operates as a reference side of the three-phase current values Iu, Iv, Iw. Each of the update side and the reference side of the three-phase current values Iu, Iv, and Iw can asynchronously access any of the buffers arbitrarily selected from the three buffers 711 to 713.

ここで、3つのバッファ711〜713は、更新側から参照側への三相電流値Iu、Iv、Iwの受け渡しに用いることができる。このとき、更新側が3つのバッファ711〜703から任意に選択したいずれかのバッファを更新しているときは、参照側は3つのバッファ711〜713のいずれも参照しないようにする。 Here, the three buffers 711 to 713 can be used to transfer the three-phase current values Iu, Iv, and Iw from the update side to the reference side. At this time, when the updating side is updating any one of the three buffers 711 to 703, the reference side does not refer to any of the three buffers 711 to 713.

例えば、ADコンバータ112Bが、3つのバッファ711〜713から任意に選択したいずれかのバッファに三相電流値Iu、Iv、Iwのデータを格納するものとする。また、3つのバッファ711〜713のうちのバッファ713に最新データが格納されており、モータ温度推定部115Bは参照処理を行っているものとする。 For example, it is assumed that the AD converter 112B stores the data of the three-phase current values Iu, Iv, and Iw in one of the buffers arbitrarily selected from the three buffers 711 to 713. Further, it is assumed that the latest data is stored in the buffer 713 of the three buffers 711 to 713, and the motor temperature estimation unit 115B is performing the reference process.

この第3実施形態は、参照中フラグを用いた制御方法以外は第2実施形態と同様の方法を用いることができる。ただし、参照側のモータ温度推定部115Bの制御周期の方が更新側のADコンバータ112Bの制御周期よりも速いため、三相電流値Iu、Iv、Iwの同時性を保証するには、ADコンバータ112Bがトリプルバッファを更新中は必ず、モータ温度推定部115Bがトリプルバッファを参照しないように制限する。 This third embodiment can use the same method as the second embodiment except for the control method using the in-reference flag. However, since the control cycle of the motor temperature estimation unit 115B on the reference side is faster than the control cycle of the AD converter 112B on the update side, in order to guarantee the simultaneity of the three-phase current values Iu, Iv, and Iw, the AD converter is required. While the 112B is updating the triple buffer, the motor temperature estimating unit 115B is restricted so as not to refer to the triple buffer.

このようにモータ温度推定部115Bによるトリプルバッファの参照を制限するには、モータ温度推定部115Bは、ADコンバータ112Bがトリプルバッファを更新中かどうかを知らなければならない。このため、ADコンバータ112Bは、更新中フラグを異なるコアA11、A13間の共有RAMデータとしてモータ温度推定部115Bに通知する(716)。モータ温度推定部115Bは、更新中フラグを参照し、更新中フラグがONの場合は必ずトリプルバッファに対して、データを参照しないようにすることで、トリプルバッファを使用した三相電流値Iu、Iv、Iwの同時性を保証することができる。 In order to limit the reference of the triple buffer by the motor temperature estimating unit 115B in this manner, the motor temperature estimating unit 115B must know whether the AD converter 112B is updating the triple buffer. Therefore, the AD converter 112B notifies the motor temperature estimating unit 115B of the updating flag as shared RAM data between the different cores A11 and A13 (716). The motor temperature estimation unit 115B refers to the updating flag, and when the updating flag is ON, the triple buffer does not refer to the data, so that the three-phase current value Iu using the triple buffer, It is possible to guarantee the simultaneity of Iv and Iw.

図15は、図14の3つのバッファを用いたときの更新と参照の関係の一例を示すタイミングチャートである。
図15において、図14のADコンバータ112Bは、同時性を保証すべき三相電流値Iu、Iv、Iwのうちの16ビットのデータIuの更新901を時刻t41に実行し、16ビットのデータIvの更新902を時刻t42に実行し、16ビットのデータIwの更新903を時刻t43に実行したものとする。
FIG. 15 is a timing chart showing an example of the relationship between update and reference when the three buffers of FIG. 14 are used.
15, the AD converter 112B of FIG. 14 executes the update 901 of the 16-bit data Iu of the three-phase current values Iu, Iv, and Iw for which the simultaneity should be guaranteed at time t41, and the 16-bit data Iv. 902 is executed at time t42, and update 903 of 16-bit data Iw is executed at time t43.

次に、ADコンバータ112Bは、トリプルバッファのうち格納対象となるバッファを決定し、更新901〜903を実行した48ビットのデータIu、Iv、Iwの格納904を時刻t44に実行する。 Next, the AD converter 112B determines a buffer to be stored among the triple buffers, and stores 904 of the 48-bit data Iu, Iv, and Iw for which the updates 901 to 903 have been executed at time t44.

次に、モータ温度推定部115Bは、トリプルバッファのうち最新のデータIu、Iv、Iwが格納されたバッファを参照先に設定し、データIuの参照908を時刻t45に実行し、データIvの参照909を時刻t46に実行し、データIwの参照910を時刻t47に実行する。 Next, the motor temperature estimation unit 115B sets a buffer in which the latest data Iu, Iv, and Iw are stored among the triple buffers as a reference destination, executes reference 908 of the data Iu at time t45, and refers to the data Iv. 909 is executed at time t46, and reference 910 of the data Iw is executed at time t47.

このとき、3つのデータIu、Iv、Iwの更新後に3つのデータIu、Iv、Iwがバッファに格納される。このため、モータ温度推定部115Bは、バッファに格納された3つのデータIu、Iv、Iwを参照することにより、データIuの参照値905、データIvの参照値906およびデータIwの参照値907のいずれも更新された値とすることができ、モータ温度推定部115Bで参照される三相電流値Iu、Iv、Iwの同時性を保証することができる。 At this time, after updating the three data Iu, Iv, and Iw, the three data Iu, Iv, and Iw are stored in the buffer. Therefore, the motor temperature estimation unit 115B refers to the three data Iu, Iv, and Iw stored in the buffer to determine the reference value 905 of the data Iu, the reference value 906 of the data Iv, and the reference value 907 of the data Iw. Both can be updated values, and the simultaneity of the three-phase current values Iu, Iv, and Iw referred to by the motor temperature estimation unit 115B can be guaranteed.

図16は、図14の3つのバッファを用いたときの三相電流値Iu、Iv、Iwの更新方法を示すフローチャートである。
図16において、図14のADコンバータ112Bは、更新中フラグをONにする(S51)。
FIG. 16 is a flowchart showing a method of updating the three-phase current values Iu, Iv, Iw when the three buffers of FIG. 14 are used.
In FIG. 16, the AD converter 112B of FIG. 14 turns on the updating flag (S51).

次に、ADコンバータ112Bは、モータ温度推定部115Bが参照先として設定しているバッファと、三相電流値Iu、Iv、Iwの最新データが格納されているバッファ以外のバッファを三相電流値Iu、Iv、Iwの格納先として決定する(S52)。 Next, the AD converter 112B uses a buffer set by the motor temperature estimation unit 115B as a reference destination and a buffer other than the buffer in which the latest data of the three-phase current values Iu, Iv, and Iw are stored. The storage destinations of Iu, Iv, and Iw are determined (S52).

次に、ADコンバータ112Bは、三相電流値Iu、Iv、Iwの格納先として決定したバッファに対して、三相電流値Iu、Iv、Iwを格納する(S53)。 Next, the AD converter 112B stores the three-phase current values Iu, Iv, Iw in the buffer determined as the storage destination of the three-phase current values Iu, Iv, Iw (S53).

次に、ADコンバータ112Bは、三相電流値Iu、Iv、Iwの最新データの格納先を更新し(S54)、更新中フラグをOFFする(S55)。 Next, the AD converter 112B updates the storage destination of the latest data of the three-phase current values Iu, Iv, and Iw (S54), and turns off the updating flag (S55).

図17は、図14の3つのバッファを用いたときの三相電流値Iu、Iv、Iwの参照方法を示すフローチャートである。
図17において、図14のモータ温度推定部115Bは、ADコンバータ112Bが設定した更新中フラグを判定し(S61)、更新中フラグがONであれば処理を終了する。
FIG. 17 is a flowchart showing a method of referring to the three-phase current values Iu, Iv, Iw when the three buffers of FIG. 14 are used.
In FIG. 17, the motor temperature estimation unit 115B of FIG. 14 determines the updating flag set by the AD converter 112B (S61), and ends the processing if the updating flag is ON.

一方、更新中フラグがOFFの場合、モータ温度推定部115Bは、ADコンバータ112Bが設定した三相電流値Iu、Iv、Iwの最新データが格納されているバッファを参照先に設定する(S62)。 On the other hand, when the updating flag is OFF, the motor temperature estimation unit 115B sets the buffer storing the latest data of the three-phase current values Iu, Iv, and Iw set by the AD converter 112B as the reference destination (S62). ..

次に、モータ温度推定部115Bは、参照先のバッファから三相電流値Iu、Iv、Iwの最新データを取得する(S63)。 Next, the motor temperature estimation unit 115B acquires the latest data of the three-phase current values Iu, Iv, Iw from the reference buffer (S63).

図18は、複数のデータの同時性の保証方法の使い分け方法を示すフローチャートである。
図6および図7に示すように、複数のデータを一つのデータに包括して参照する処理では、分岐先を決める判断処理がないが、トリプルバッファを用いる処理では、図12および図17に示すように、更新側または参照側において、分岐先を決める判断処理がある。このため、複数のデータを一つのデータに包括する処理の方が、トリプルバッファを用いる処理に比べて、処理負荷の増大の抑制効果が高い。
FIG. 18 is a flowchart showing a method of selectively using the method of guaranteeing the simultaneity of a plurality of data.
As shown in FIGS. 6 and 7, in the process of collectively referring to a plurality of data in one data, there is no determination process for determining the branch destination, but in the process using the triple buffer, the process shown in FIGS. 12 and 17 is performed. As described above, there is a determination process for determining the branch destination on the update side or the reference side. Therefore, the process of including a plurality of data in one data is more effective in suppressing the increase of the processing load than the process using the triple buffer.

このため、図18に示すように、同時性を保証すべき複数のデータのデータサイズの合計がマイコンで一度に扱えるデータサイズ以下の場合(S71のYES)、複数のデータを一つのデータに包括する処理を適用することで、データの同時性を保証する(S72)。例えば、同時性を保証すべき複数のデータが電流指令値Id*、Iq*である場合、図5および図6の処理を適用することができる。 Therefore, as shown in FIG. 18, when the total data size of a plurality of data for which the simultaneity is to be guaranteed is equal to or smaller than the data size that the microcomputer can handle at one time (YES in S71), the plurality of data are included in one data. The simultaneity of data is assured by applying the processing (S72). For example, when the plurality of data for which the simultaneity is to be guaranteed are the current command values Id* and Iq*, the processing of FIGS. 5 and 6 can be applied.

一方、同時性を保証すべき複数のデータのデータサイズの合計がマイコンで一度に扱えるデータサイズより大きい場合(S71のNO)、同時性を保証すべき複数のデータを一つのデータに包括できないため、トリプルバッファを用いる処理を適用することで、データの同時性を保証する。 On the other hand, if the total data size of the plurality of data for which the simultaneity is to be guaranteed is larger than the data size that the microcomputer can handle at one time (NO in S71), the plurality of data for which the simultaneity should be guaranteed cannot be included in one data. , Guarantee the simultaneity of data by applying the process using triple buffer.

トリプルバッファを用いる処理では、更新側の制御周期の方が参照側の制御周期よりも速い場合(S73のYES)、更新側の処理を制限するトリプルバッファを使用した処理を適用する(S74)。例えば、同時性を保証すべき複数のデータが三相電流値Iu、Iv、Iwである場合、図12および図13の処理を適用することができる。 In the process using the triple buffer, if the control cycle on the update side is faster than the control cycle on the reference side (YES in S73), the process using the triple buffer that restricts the process on the update side is applied (S74). For example, when the plurality of data for which the simultaneity is to be guaranteed are the three-phase current values Iu, Iv, Iw, the processing of FIGS. 12 and 13 can be applied.

一方、参照側の制御周期の方が更新側の制御周期よりも速い場合(S73のNO)、参照側の処理を制限するトリプルバッファを使用した処理を適用する(S75)。例えば、同時性を保証すべき複数のデータが三相電流値Iu、Iv、Iwである場合、図16および図17の処理を適用することができる。 On the other hand, when the control cycle on the reference side is faster than the control cycle on the update side (NO in S73), the processing using the triple buffer that restricts the processing on the reference side is applied (S75). For example, when the plurality of data for which the simultaneity is to be guaranteed are the three-phase current values Iu, Iv, Iw, the processing of FIGS. 16 and 17 can be applied.

以上の実施形態では、2つのコアを用いたモータ制御について説明したが、同コアかつ異なる制御周期のタスク間のデータ群の同時性の保証にも適用が可能である。また、2つ以上のコアが存在するマルチコアマイコンで2コア間のデータの同時性の保証であれば、本発明は適用可能である。 In the above embodiment, the motor control using the two cores has been described, but the invention can be applied to guaranteeing the simultaneity of the data group between the tasks of the same core and different control cycles. The present invention can be applied to a multi-core microcomputer having two or more cores as long as it guarantees data simultaneity between the two cores.

101…モータ、102…インバータ回路、103…電流検出部、104…電流制御部、105…電流指令部、106…三相電圧変換部、107…回転位置検出部、108…モータ電流制御部、109…マイコン

101... Motor, 102... Inverter circuit, 103... Current detection part, 104... Current control part, 105... Current command part, 106... Three-phase voltage conversion part, 107... Rotation position detection part, 108... Motor current control part, 109 … Microcomputer

Claims (10)

マイクロコンピュータを備える電子制御装置であって、
前記マイクロコンピュータにおいて同一タスクで参照される複数のデータを、前記マイクロコンピュータで一度に扱うことができる1つのデータに包括する電子制御装置。
An electronic control device comprising a microcomputer,
An electronic control device that includes a plurality of data referred to by the same task in the microcomputer into one data that can be handled by the microcomputer at one time.
前記マイクロコンピュータは、第1タスクおよび第2タスクを実行するときに、
前記第1タスクは、前記複数のデータを互いに異なるタイミングで更新し、
前記第2タスクは、前記第1タスクで更新された複数のデータが包括された1つのデータから、前記第1タスクで更新された複数のデータを取得する請求項1に記載の電子制御装置。
The microcomputer, when executing the first task and the second task,
The first task updates the plurality of data at different timings,
The electronic control device according to claim 1, wherein the second task acquires a plurality of data updated by the first task from one data including a plurality of data updated by the first task.
前記マイクロコンピュータにおいて同一タスクで参照される複数のデータは、前記マイクロコンピュータの処理において同時性を保証すべき複数のデータであり、
前記マイクロコンピュータの処理において同時性を保証すべき複数のデータのデータサイズの合計は、前記マイクロコンピュータで一度に扱うことができるデータサイズ以下である請求項1に記載の電子制御装置。
The plurality of data referred to by the same task in the microcomputer is a plurality of data for which simultaneity should be guaranteed in the processing of the microcomputer,
The electronic control device according to claim 1, wherein a total of data sizes of a plurality of data whose simultaneity is to be guaranteed in the processing of the microcomputer is equal to or smaller than a data size which can be handled by the microcomputer at one time.
前記マイクロコンピュータは、第1コアおよび第2コアを備え、
前記第1コアが前記同時性を保証すべき複数のデータの更新側、前記第2コアが前記同時性を保証すべき複数のデータの参照側である場合、
前記第1コアは、前記同時性を保証すべき複数のデータを1つのデータに包括し、
前記第2コアは、前記同時性を保証すべき複数のデータが包括された1つのデータから、前記同時性を保証すべき複数のデータを取得する請求項3に記載の電子制御装置。
The microcomputer includes a first core and a second core,
When the first core is an update side of a plurality of data for which the concurrency is to be guaranteed and the second core is a reference side of a plurality of data for which the concurrency is to be guaranteed,
The first core includes a plurality of data for which the concurrency should be guaranteed in one data,
The electronic control device according to claim 3, wherein the second core acquires the plurality of pieces of data for which the simultaneity is to be guaranteed from one piece of data including the plurality of pieces of data for which the simultaneity is to be guaranteed.
前記同時性を保証すべき複数のデータは、モータ制御に用いられる三相電流値またはdq座標の電流指令値である請求項4に記載の電子制御装置。 The electronic control device according to claim 4, wherein the plurality of data for which the simultaneity is to be guaranteed is a three-phase current value used for motor control or a current command value of dq coordinates. 前記第1コアは、前記電流指令値を更新する電流指令部を備え、
前記第2コアは、前記電流指令部で更新された前記電流指令値を参照する電流制御部を備え、
前記電流指令部は、前記dq座標の電流指令値を1つのデータに包括し、
前記電流制御部は、前記電流指令部にて包括された1つのデータから前記dq座標の電流指令値を取得する請求項5に記載の電子制御装置。
The first core includes a current command unit that updates the current command value,
The second core includes a current control unit that refers to the current command value updated by the current command unit,
The current command unit includes the current command value of the dq coordinates in one data,
The electronic control device according to claim 5, wherein the current control unit acquires the current command value of the dq coordinates from one data included in the current command unit.
マイクロコンピュータにおいて同一タスクで参照される複数のデータをそれぞれ格納可能な3つのバッファを備える電子制御装置であって、
前記マイクロコンピュータにおいて同一タスクで参照される複数のデータは、同時性を保証すべき複数のデータであり、
前記同時性を保証すべき複数のデータの更新側と参照側のそれぞれは、前記3つのバッファから任意に選択したいずれのバッファに対しても非同期にアクセス可能であり、
前記同時性を保証すべき複数のデータの更新側の制御周期が参照側の制御周期より速い場合、前記参照側が前記3つのバッファから任意に選択したいずれかのバッファを参照しているときは、前記更新側は前記3つのバッファのいずれも更新しない電子制御装置。
An electronic control device comprising three buffers capable of respectively storing a plurality of data referred to by the same task in a microcomputer,
The plurality of data referred to in the same task in the microcomputer is a plurality of data for which simultaneity should be guaranteed,
Each of the update side and the reference side of the plurality of data for which the simultaneity should be guaranteed can asynchronously access any buffer arbitrarily selected from the three buffers,
When the control cycle on the update side of a plurality of data for which the simultaneity should be guaranteed is faster than the control cycle on the reference side, and when the reference side refers to any one of the three buffers arbitrarily selected, An electronic control unit in which the update side does not update any of the three buffers.
前記マイクロコンピュータは、前記参照側である第1コアと、前記更新側である第2コアとを備え、
前記マイクロコンピュータの処理において同時性を保証すべき複数のデータのデータサイズの合計は、前記マイクロコンピュータで一度に扱うことができるデータサイズより大きい請求項7に記載の電子制御装置。
The microcomputer includes a first core that is the reference side and a second core that is the update side,
8. The electronic control device according to claim 7, wherein the sum of the data sizes of a plurality of data whose simultaneity should be guaranteed in the processing of the microcomputer is larger than the data size that can be handled by the microcomputer at one time.
マイクロコンピュータにおいて同一タスクで参照される複数のデータをそれぞれ格納可能な3つのバッファを備える電子制御装置であって、
前記マイクロコンピュータにおいて同一タスクで参照される複数のデータは、同時性を保証すべき複数のデータであり、
前記同時性を保証すべき複数のデータの更新側と参照側のそれぞれは、前記3つのバッファから任意に選択したいずれのバッファに対しても非同期にアクセス可能であり、
前記同時性を保証すべき複数のデータの参照側の制御周期が更新側の制御周期より速い場合、前記更新側が前記3つのバッファから任意に選択したいずれかのバッファを更新しているときは、前記参照側は前記3つのバッファのいずれも参照しない電子制御装置。
An electronic control device comprising three buffers capable of respectively storing a plurality of data referred to by the same task in a microcomputer,
The plurality of data referred to in the same task in the microcomputer is a plurality of data for which simultaneity should be guaranteed,
Each of the update side and the reference side of the plurality of data for which the simultaneity should be guaranteed can asynchronously access any buffer arbitrarily selected from the three buffers.
When the control cycle of the reference side of the plurality of data for which the simultaneity is to be guaranteed is faster than the control cycle of the update side, when the update side is updating any buffer arbitrarily selected from the three buffers, The reference side is an electronic control device that does not reference any of the three buffers.
前記マイクロコンピュータは、前記参照側である第1コアと、前記更新側である第2コアとを備え、
前記マイクロコンピュータの処理において同時性を保証すべき複数のデータのデータサイズの合計は、前記マイクロコンピュータで一度に扱うことができるデータサイズより大きい請求項9に記載の電子制御装置。

The microcomputer includes a first core that is the reference side and a second core that is the update side,
10. The electronic control device according to claim 9, wherein the sum of the data sizes of a plurality of data for which the simultaneity should be guaranteed in the processing of the microcomputer is larger than the data size that can be handled by the microcomputer at one time.

JP2019014342A 2019-01-30 2019-01-30 electronic controller Active JP7140689B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2019014342A JP7140689B2 (en) 2019-01-30 2019-01-30 electronic controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2019014342A JP7140689B2 (en) 2019-01-30 2019-01-30 electronic controller

Publications (2)

Publication Number Publication Date
JP2020123127A true JP2020123127A (en) 2020-08-13
JP7140689B2 JP7140689B2 (en) 2022-09-21

Family

ID=71992735

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2019014342A Active JP7140689B2 (en) 2019-01-30 2019-01-30 electronic controller

Country Status (1)

Country Link
JP (1) JP7140689B2 (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05143779A (en) * 1991-11-25 1993-06-11 Nkk Corp Pattern recognizing device
JP2009245009A (en) * 2008-03-28 2009-10-22 Fujitsu Ten Ltd Vehicle control device and multi-core processor
JP2015150729A (en) * 2014-02-12 2015-08-24 セイコーエプソン株式会社 Transfer system and printer
US20150357963A1 (en) * 2013-02-12 2015-12-10 Ajinextek Co., Ltd. System on-chip for controlling motor based on network and method for controlling thereof
US20170070382A1 (en) * 2015-09-03 2017-03-09 Center Of Human-Centered Interaction For Coexistence Parallel fieldbus network-based motor control system
JP2017130140A (en) * 2016-01-22 2017-07-27 株式会社デンソー Data processor
WO2017145749A1 (en) * 2016-02-25 2017-08-31 パナソニックIpマネジメント株式会社 Motor control device and motor control method

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05143779A (en) * 1991-11-25 1993-06-11 Nkk Corp Pattern recognizing device
JP2009245009A (en) * 2008-03-28 2009-10-22 Fujitsu Ten Ltd Vehicle control device and multi-core processor
US20150357963A1 (en) * 2013-02-12 2015-12-10 Ajinextek Co., Ltd. System on-chip for controlling motor based on network and method for controlling thereof
JP2015150729A (en) * 2014-02-12 2015-08-24 セイコーエプソン株式会社 Transfer system and printer
US20170070382A1 (en) * 2015-09-03 2017-03-09 Center Of Human-Centered Interaction For Coexistence Parallel fieldbus network-based motor control system
JP2017130140A (en) * 2016-01-22 2017-07-27 株式会社デンソー Data processor
WO2017145749A1 (en) * 2016-02-25 2017-08-31 パナソニックIpマネジメント株式会社 Motor control device and motor control method

Also Published As

Publication number Publication date
JP7140689B2 (en) 2022-09-21

Similar Documents

Publication Publication Date Title
JP4320743B2 (en) Rotating machine control device
JP5510842B2 (en) Three-phase motor control device, three-phase motor system, three-phase motor control method and program
JP6981272B2 (en) AC motor control device
JP2008011627A (en) Motor controller
JP2019075868A (en) Motor control device and motor system
JP2009183022A (en) Magnetic pole position estimation method for synchronous motor
JP5182302B2 (en) Rotating machine control device
JP4763329B2 (en) Control device for power converter
JP2020123127A (en) Electronic control device
JP2018182811A (en) Power converter and control device therefor
JPWO2018198694A1 (en) Control device that outputs voltage command value
JPH10225142A (en) Dead time compensation circuit for inverter
JP2020036510A (en) Motor control device
JP7032514B2 (en) AC rotating machine control device and electric power steering control device
JP4779442B2 (en) Control device for power converter
JP2022027126A (en) Power conversion device, temperature estimation method, and program
JPWO2018173102A1 (en) Magnetic pole position detection device and motor control device
JP2021023042A (en) Motor control device
JP7010197B2 (en) Inverter device
JP2008220069A (en) Control device of motor
JP7183475B2 (en) power converter
JP2020036422A (en) Control device and control method of rotary machine
JP3366705B2 (en) AC current detector
WO2019155529A1 (en) Power conversion apparatus
JP2021089662A (en) On-vehicle electronic control device and control method thereof

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20210608

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20220523

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20220607

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20220803

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20220823

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20220908

R150 Certificate of patent or registration of utility model

Ref document number: 7140689

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150