JP2016018274A - Method for calculating control input to control device, and control device - Google Patents
Method for calculating control input to control device, and control device Download PDFInfo
- Publication number
- JP2016018274A JP2016018274A JP2014139078A JP2014139078A JP2016018274A JP 2016018274 A JP2016018274 A JP 2016018274A JP 2014139078 A JP2014139078 A JP 2014139078A JP 2014139078 A JP2014139078 A JP 2014139078A JP 2016018274 A JP2016018274 A JP 2016018274A
- Authority
- JP
- Japan
- Prior art keywords
- manipulated variable
- digits
- deviation
- unit
- coefficient
- 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.)
- Pending
Links
Images
Landscapes
- Feedback Control In General (AREA)
- Dc-Dc Converters (AREA)
Abstract
Description
本発明は、パルス伝達関数に対応する差分方程式に基づいて制御対象に入力する操作量を時系列的に演算する制御装置の操作量の演算方法、及び該演算方法を実行する制御装置に関する。 The present invention relates to a method for calculating an operation amount of a control device that calculates, in a time series, an operation amount input to a control target based on a differential equation corresponding to a pulse transfer function, and a control device that executes the operation method.
DC/DCコンバータの出力電圧を安定化するための制御方式として、出力電圧を帰還する電圧モード制御方式が広く用いられている。電圧モード制御方式は、制御が比較的簡単であるが位相補償回路が複雑になるという側面がある。 As a control method for stabilizing the output voltage of the DC / DC converter, a voltage mode control method that feeds back the output voltage is widely used. The voltage mode control method is relatively easy to control but has a complicated phase compensation circuit.
一方、出力電圧に加えて出力電流を帰還する電流モード制御方式は、制御自体が比較的複雑になるが位相補償回路が簡単になる上、ラインレギュレーション性に優れており、フィードバックループの安定性が高く、並列に構成して大容量化するのに適している等、多くの利点があるとされている(例えば特許文献1参照)。 On the other hand, the current mode control method that feeds back the output current in addition to the output voltage makes the control itself relatively complicated, but the phase compensation circuit is simple and the line regulation is excellent, and the feedback loop is stable. It is said that there are many advantages, such as being high in parallel and suitable for increasing the capacity (see, for example, Patent Document 1).
さて、電源装置における制御回路の機能をデジタル化して構成の簡略化を図る方法が提案されている。例えば特許文献2には、フィードバックされた電圧のA/D変換値に基づいてCPUが一定時間毎に制御指令値を算出し、この制御指令値に基づいてスイッチング素子に与えるPWM信号のデューティを決定する電圧モード制御方式の電源装置が記載されている。
There has been proposed a method for simplifying the configuration by digitizing the function of the control circuit in the power supply apparatus. For example, in
しかしながら、例えば電流モード制御方式のような複雑な制御方式を採用する場合、高精度の演算が必要となることが多く、一度に扱えるビット数が多い演算器、マイコン又はDSPを用いた場合は、コスト増の要因となる。 However, for example, when a complicated control method such as a current mode control method is adopted, high-precision calculation is often required, and when using an arithmetic unit, microcomputer, or DSP with a large number of bits that can be handled at one time, It becomes a factor of cost increase.
本発明は斯かる事情に鑑みてなされたものであり、その目的とするところは、ビット数が比較的少ない演算を行うにもかかわらず操作量の演算精度の低下を防止することが可能な制御装置の操作量の演算方法及び制御装置を提供することにある。 The present invention has been made in view of such circumstances, and an object of the present invention is to provide a control capable of preventing a decrease in the calculation accuracy of the manipulated variable in spite of performing a calculation with a relatively small number of bits. An object of the present invention is to provide a method for calculating an operation amount of a device and a control device.
本発明に係る制御装置の操作量の演算方法は、伝達特性がパルス伝達関数で表される制御対象に入力する操作量を、目標値に対する制御量の偏差に基づいて制御する制御装置で、前記パルス伝達関数に対応する差分方程式に基づいて前記操作量を反復的に演算する方法において、記憶部と、N桁(Nは2以上の整数)の固定小数点の乗数及び被乗数を乗算する乗算部とを用意し、前記記憶部は、前記偏差及び操作量夫々の係数をN桁の固定小数点数として予め記憶すると共に、前記差分方程式に基づく演算の都度、前記偏差及び操作量夫々をN桁及びN+M桁(MはNより小さい自然数)の固定小数点数として記憶し、前記乗算部は、前記差分方程式に基づく演算の都度、前記偏差及び該偏差の係数、前記操作量の上位N桁及び該操作量の係数、並びに前記操作量の下位M桁及び該操作量の係数の夫々を前記記憶部から読み出して乗算することを特徴とする。 The operation amount calculation method of the control device according to the present invention is a control device that controls an operation amount input to a control target whose transfer characteristic is represented by a pulse transfer function based on a deviation of the control amount from a target value. In the method of iteratively calculating the manipulated variable based on a differential equation corresponding to a pulse transfer function, a storage unit, and a multiplication unit that multiplies an N-digit (N is an integer of 2 or more) fixed-point multiplier and multiplicand. And the storage unit stores in advance the coefficients of the deviation and the manipulated variable as N-digit fixed-point numbers, and each time the calculation based on the difference equation, the deviation and the manipulated variable are stored in N digits and N + M, respectively. Stored as a fixed-point number with digits (M is a natural number smaller than N), and the multiplication unit calculates the deviation and the coefficient of the deviation, the upper N digits of the manipulated variable, and the manipulated variable each time an operation is performed based on the difference equation. Person in charge And characterized by multiplying the respective coefficients of lower M digits and the operation amount of the operation amount is read from the storage unit.
本発明に係る制御装置の操作量の演算方法は、前記乗算部の乗算結果を積算する積算部を用意し、前記差分方程式は、下記の式(1)であり、前記積算部の積算結果における最下位からのM桁及び該M桁に続くN桁の夫々を、前記式(1)の演算結果におけるUL (n)及びUH (n)とすることを特徴とする。
UH (n)+UL (n)・2-M =b0 ・E(n)+b1 ・E(n−1)+・・+bm ・E(n−m)+a1 ・UH (n−1)+a2 ・UH (n−2)+・・+ak ・UH (n−k)+{a1 ・UL (n−1)+a2 ・UL (n−2)+・・+ak ・UL (n−k)}2-M ・・・(1)
但し、
n :2以上の整数
m、k:1≦m≦k≦n−1を満たす整数
E(n):目標値に対するn回目の制御量の偏差
UH (n):n回目の操作量U(n)の上位N桁
UL (n):n回目の操作量U(n)の下位M桁
bm :偏差の係数
ak :操作量の係数
The operation amount calculation method of the control device according to the present invention provides an integration unit that integrates the multiplication results of the multiplication unit, and the difference equation is the following equation (1), in the integration result of the integration unit: The M digit from the least significant digit and the N digit following the M digit are defined as U L (n) and U H (n) in the calculation result of the formula (1).
U H (n) + UL (n) · 2 −M = b 0 · E (n) + b 1 · E (n-1) + ·· + bm · E (n−m) + a 1 · U H (n− 1) + a 2 · U H (n−2) + ·· + a k • U H (n−k) + {a 1 • U L (n−1) + a 2 • U L (n−2) +・ ・ + A k・UL (n−k)} 2 −M (1)
However,
n: integer m greater than or equal to 2, k: integer satisfying 1 ≦ m ≦ k ≦ n−1 E (n): deviation of control amount for the nth time U H (n): nth manipulated variable U ( n) upper N digits U L (n): lower M digits of the nth manipulated variable U (n) bm: coefficient of deviation a k : coefficient of manipulated variable
本発明に係る制御装置は、伝達特性がパルス伝達関数で表される制御対象に入力する操作量を、目標値に対する制御量の偏差に基づいて制御し、前記パルス伝達関数に対応する差分方程式によって前記操作量を反復的に演算する制御装置において、前記偏差及び操作量夫々の係数をN桁(Nは2以上の整数)の固定小数点数として記憶すると共に、前記差分方程式に基づく演算の都度、前記偏差及び操作量夫々をN桁及びN+M桁(MはNより小さい自然数)の固定小数点数として記憶する記憶部と、前記差分方程式に基づく演算の都度、前記偏差及び該偏差の係数、前記操作量の上位N桁及び該操作量の係数、並びに前記操作量の下位M桁及び該操作量の係数の夫々を前記記憶部から読み出して乗算する乗算部とを備えることを特徴とする。 The control device according to the present invention controls an operation amount input to a control target whose transfer characteristic is represented by a pulse transfer function based on a deviation of the control amount with respect to a target value, and uses a difference equation corresponding to the pulse transfer function. In the control device that repeatedly calculates the manipulated variable, the coefficient of each of the deviation and manipulated variable is stored as a fixed-point number of N digits (N is an integer of 2 or more), and each calculation based on the difference equation, A storage unit that stores the deviation and the operation amount as N-digit and N + M-digit (M is a natural number smaller than N) fixed-point numbers, and for each calculation based on the difference equation, the deviation and the coefficient of the deviation, the operation And a multiplication unit that reads out and multiplies the upper N digits of the quantity and the coefficient of the manipulated variable, and the lower M digits of the manipulated variable and the coefficient of the manipulated variable from the storage unit.
本発明に係る制御装置は、前記制御対象は、演算された操作量に基づいてPWM信号を生成するPWM生成部と、該PWM生成部が生成したPWM信号によってスイッチングするスイッチング素子を有する電圧変換部とを含むことを特徴とする。 In the control device according to the present invention, the control target includes a PWM generation unit that generates a PWM signal based on the calculated operation amount, and a voltage conversion unit that has a switching element that is switched by the PWM signal generated by the PWM generation unit. It is characterized by including.
本発明に係る制御装置は、前記制御量は、前記電圧変換部が出力する電流であることを特徴とする。 The control device according to the present invention is characterized in that the control amount is a current output from the voltage converter.
本発明にあっては、パルス伝達関数に対応する差分方程式に基づく演算の前に、偏差及び操作量夫々の係数をN桁の固定小数点数として予め記憶部に記憶し、偏差及び操作量夫々をN桁及びN+M桁(MはNより小さい自然数)の固定小数点数として記憶するための領域を確保しておく。差分方程式に基づく演算の都度、先ず現在の偏差をN桁の固定小数点数として記憶部に記憶する。そして、偏差及びその係数と、操作量の上位N桁及び操作量の係数と、操作量の下位M桁及び操作量の係数とを夫々記憶部から読み出して乗算部で乗算し、差分方程式の演算結果が示す操作量をN+M桁の固定小数点数として記憶部に記憶する。
これにより、N桁以下の乗数及び被乗数を乗算する乗算部を用いるにもかかわらず、演算結果が示す操作量が高精度で次の演算に引き継がれる。
In the present invention, before the calculation based on the difference equation corresponding to the pulse transfer function, the coefficients of the deviation and the manipulated variable are stored in advance in the storage unit as N-digit fixed-point numbers, and the deviation and the manipulated variable are respectively stored. An area to be stored as a fixed-point number of N digits and N + M digits (M is a natural number smaller than N) is secured. For each calculation based on the difference equation, the current deviation is first stored in the storage unit as an N-digit fixed-point number. Then, the deviation and its coefficient, the upper N digits of the manipulated variable and the manipulated variable coefficient, and the lower M digit of the manipulated variable and the manipulated variable coefficient are read from the storage unit and multiplied by the multiplier, and the difference equation is calculated. The operation amount indicated by the result is stored in the storage unit as a fixed-point number of N + M digits.
As a result, the operation amount indicated by the calculation result is succeeded to the next calculation with high accuracy despite the use of a multiplication unit that multiplies the multiplier and multiplicand of N digits or less.
本発明にあっては、式(1)に含まれる複数の乗算項の乗算結果を積算し、積算結果における最下位からのN+M桁のうち、上位N桁及び下位M桁夫々を、式(1)の演算結果におけるUH (n−1)及びUL (n−1)とする。
これにより、式(1)のn+1回目の演算に先立って、U(n)が桁落ちなしにUH (n−1)及びUL (n−1)に代入される。
In the present invention, the multiplication results of the plurality of multiplication terms included in the equation (1) are integrated, and the upper N digits and the lower M digits of the N + M digits from the lowest in the integration result are expressed by the equation (1). ) To U H (n−1) and U L (n−1) in the calculation result.
As a result, prior to the (n + 1) th calculation of Equation (1), U (n) is substituted into U H (n−1) and U L (n−1) without any loss of digits.
本発明にあっては、演算された操作量に基づいてPWM生成部がPWM信号を生成し、生成されたPWM信号によって電圧変換部のスイッチング素子がスイッチングする。
これにより、演算精度の低下を防止する演算方法によって演算された操作量に基づいて、電圧変換部のスイッチング素子がオン/オフに制御される。
In the present invention, the PWM generator generates a PWM signal based on the calculated operation amount, and the switching element of the voltage converter is switched by the generated PWM signal.
Accordingly, the switching element of the voltage conversion unit is controlled to be turned on / off based on the operation amount calculated by the calculation method that prevents the calculation accuracy from being lowered.
本発明にあっては、電圧変換部が出力する電流が制御量であり、いわゆる電流モード制御方式によって、電圧変換部が出力する電流が高精度に制御される。 In the present invention, the current output from the voltage converter is the controlled variable, and the current output from the voltage converter is controlled with high accuracy by a so-called current mode control method.
本発明によれば、N桁以下の乗数及び被乗数を乗算する乗算部を用いるにもかかわらず、演算結果が示す操作量が高精度で次の演算に引き継がれる。
従って、ビット数が比較的少ない演算を行うにもかかわらず操作量の演算精度の低下を防止することが可能となる。
According to the present invention, despite the use of a multiplication unit that multiplies a multiplier and a multiplicand of N digits or less, the operation amount indicated by the operation result is succeeded to the next operation with high accuracy.
Accordingly, it is possible to prevent a reduction in the calculation accuracy of the manipulated variable even though an operation with a relatively small number of bits is performed.
以下、本発明をその実施の形態を示す図面に基づいて詳述する。
(実施の形態1)
図1は、本発明の実施の形態1に係る制御装置の構成例を示すブロック図であり、図2は、制御装置における制御部2の機能構成を示すブロック図である。図1に示す制御装置は、例えば外部のバッテリ4の電圧を降圧して負荷5に供給するDC/DCコンバータ(電圧変換部に相当:以下、単にコンバータという)1と、該コンバータ1にPWM信号を与える制御部2とを備える。コンバータ1は、バッテリ4の電圧を昇圧又は昇降圧するものであってもよい。
Hereinafter, the present invention will be described in detail with reference to the drawings illustrating embodiments thereof.
(Embodiment 1)
FIG. 1 is a block diagram illustrating a configuration example of a control device according to
コンバータ1は、一端がバッテリ4に接続されたスイッチング素子11と、該スイッチング素子11の他端に夫々の一端が接続された第2のスイッチング素子12及びインダクタ13と、該インダクタ13の他端に一端が接続された抵抗器14と、該抵抗器14の他端及び接地電位の間に接続されたコンデンサ15とを備える。第2のスイッチング素子12の他端は、接地電位に接続されている。負荷5はコンデンサ15の両端に接続される。スイッチング素子11及び第2のスイッチング素子12は、例えば夫々の一端をドレインとするNチャネル型のMOSFETである。
The
コンバータ1は、また、スイッチング素子11及び第2のスイッチング素子12をオン/オフに駆動する駆動信号を与える駆動回路16を備える。駆動回路16は、制御部2から与えられたPWM信号及び該PWM制御信号と相補的なPWM信号の夫々をスイッチング素子11及び第2のスイッチング素子12のゲートに与える。
The
制御部2は、CPU21を有し、CPU21は、プログラム等の情報を記憶するROM22、一時的に発生した情報を記憶するRAM(記憶部に相当)23及びPWM制御の周期等の各種時間を計時するタイマ24と互いにバス接続されている。
The
CPU21には、また、駆動回路16に与えるPWM信号を生成するPWM回路(PWM生成部に相当)25、抵抗器14の両端の電圧を検出して抵抗器14に流れる電流をデジタルの電流値に変換するA/D変換回路26、及びコンデンサ15の両端の電圧をデジタルの電圧値に変換するA/D変換回路27がバス接続されている。PWM回路25及びコンバータ1が、制御対象に相当する。
The
図2に移って、制御部2は、負荷5に供給する電圧を所謂電流モード制御方式によって制御するための電圧ループ制御器28及び電流ループ制御器29夫々の機能を実現する。制御部2では、電圧ループ制御器28による電圧ループ制御と、電流ループ制御器29による電流ループ制御とが同時並行的に実行される。図中「○」の記号は減算器を表す。
2, the
電圧ループ制御器28は、負荷5に供給された出力電圧をA/D変換回路27で変換したデジタルの電圧値Voを、目標の電圧値Vrefから減算した偏差に基づいて、後段の電流ループ制御器29に対する目標の電流値Irefとなる操作量を演算する。この電圧ループ制御では、コンバータ1が出力する電圧が制御量である。
The
電流ループ制御器29は、抵抗器14に流れる電流をA/D変換回路26で変換したデジタルの電流値Ilを、電圧ループ制御器28からの目標の電流値Irefから減算した偏差に基づいて、PWM回路25に対する操作量を演算する。PWM回路25は、与えられた操作量に応じたデューティのPWM信号を生成する。この電流ループ制御では、コンバータ1が出力する電流が制御量である。
The
電圧ループ制御としてPID制御を行う場合、操作量としての電流値Iは、例えば以下の式(2)により演算される。式(2)の値は、一定桁の固定小数点数同士の積和を求める公知の方法を用いて反復的に演算することが可能であるため、演算方法の説明を省略する。 When performing PID control as voltage loop control, the current value I as the operation amount is calculated by, for example, the following equation (2). Since the value of equation (2) can be repeatedly calculated using a known method for obtaining the product sum of fixed-point numbers having a fixed number of digits, description of the calculation method is omitted.
I(n)=I(n-1)+Kp ・{e(n)−e(n-1)}+Ki ・{e(n)+e(n−1)}+Kd ・[{e(n)−e(n-1)}−{e(n-1)−e(n-2)}]・・・(2)
但し、
n :2以上の整数
I(n):n回目の操作量
e(n):n回目の目標値に対するn回目の制御量の偏差
Kp :比例項の係数
Ki :積分項の係数
Kd :微分項の係数
I (n) = I (n -1) + K p · {e (n) -e (n-1)} + K i · {e (n) + e (n-1)} + K d · [{e (n ) -E (n-1)}-{e (n-1) -e (n-2)}] (2)
However,
n: integer of 2 or more I (n): n-th manipulated variable e (n): deviation of the n-th controlled variable from the n-th target value K p : proportional term coefficient K i : integral term coefficient K d : Coefficient of differential term
次に、電流ループ制御について説明する。離散時間制御システムにおける制御対象のパルス伝達関数Gc(z)は、z変換によって一般的に以下の式(3)で表すことができる。 Next, current loop control will be described. The pulse transfer function Gc (z) to be controlled in the discrete time control system can be generally expressed by the following equation (3) by z conversion.
Gc(z)=(b0 +b1 ・z-1 +b2 ・z-2 +・・+bm ・z-m )/(1−a1 ・z-1 −a2 ・z-2 −・・−ak ・z-k )・・・(3)
但し、m≦k
Gc (z) = (b 0 + b 1 · z −1 + b 2 · z −2 + ·· + b m · z −m ) / (1−a 1 · z −1 −a 2 · z −2 − ·· − a k · z −k ) (3)
However, m ≦ k
式(3)に対応する差分方程式は、以下の式(4)によって表される。式(4)によって演算されるU(n)をPWM回路25に対する操作量とする場合、E(n)は、式(2)で演算されたI(n)に対する、A/D変換回路26で変換されたデジタルの電流値の偏差である。
The difference equation corresponding to Equation (3) is expressed by Equation (4) below. When U (n) calculated by the equation (4) is an operation amount for the
U(n)=b0 ・E(n)+b1 ・E(n−1)+・・+bm ・E(n−m)+a1 ・U(n−1)+a2 ・U(n−2)+・・+ak ・U(n−k)・・・(4)
但し、
n :2以上の整数
m、k:1≦m≦k≦n−1を満たす整数
E(n):目標値に対するn回目の制御量の偏差
U(n):n回目の操作量
bm :偏差の係数
ak :操作量の係数
U (n) = b 0 · E (n) +
However,
n: integer m greater than or equal to 2, k: integer satisfying 1 ≦ m ≦ k ≦ n−1 E (n): deviation of the nth controlled variable from the target value U (n): nth manipulated variable bm: deviation Coefficient a k : coefficient of manipulated variable
式(4)の右辺をN桁(Nは2以上の整数)の固定小数点数同士の積和として演算する場合、演算結果の桁数が2N以上となるため、右辺の演算結果を左辺のU(n)に代入するときに、演算結果の下位N桁が失われて演算精度が低下する。そこで、U(n)、U(n−1)、・・・U(n−k)をN+M桁(MはNより小さい自然数)の固定小数点数として、式(4)を上述の式(1)に置き換える。以下に式(1)を再掲する。 When the right side of Expression (4) is calculated as a product sum of N-digit (N is an integer of 2 or more) fixed-point numbers, the number of digits of the operation result is 2N or more. When substituting for (n), the lower N digits of the operation result are lost and the operation accuracy is reduced. Therefore, U (n), U (n−1),... U (n−k) is a fixed-point number of N + M digits (M is a natural number smaller than N), and equation (4) is expressed by the above equation (1). ). Equation (1) is shown again below.
UH (n)+UL (n)・2-M =b0 ・E(n)+b1 ・E(n−1)+・・+bm ・E(n−m)+a1 ・UH (n−1)+a2 ・UH (n−2)+・・+ak ・UH (n−k)+{a1 ・UL (n−1)+a2 ・UL (n−2)+・・+ak ・UL (n−k)}2-M ・・・(1)
但し、
UH (n):n回目の操作量U(n)の上位N桁
UL (n):n回目の操作量U(n)の下位M桁
U H (n) + UL (n) · 2 −M = b 0 · E (n) + b 1 · E (n-1) + ·· + bm · E (n−m) + a 1 · U H (n− 1) + a 2 · U H (n−2) + ·· + a k • U H (n−k) + {a 1 • U L (n−1) + a 2 • U L (n−2) +・ ・ + A k・UL (n−k)} 2 −M (1)
However,
U H (n): Upper N digits of the nth manipulated variable U (n) UL (n): Lower M digits of the nth manipulated variable U (n)
ここで特に、偏差の係数と操作量の係数とで数値に大きな差がある場合、数値が小さい方の係数と操作量又は偏差との乗算結果が、左辺の操作量に十分反映されないこととなり、制御が正確に行えなくなる。例えば、係数bm の各数値が係数ak の各数値よりもJ桁(ここでは、JはNより小さい自然数とする)程度小さい場合、式(1)を以下の式(5)に置き換える。つまり、予め係数bm に2J を乗じて係数bm 及び偏差の積和に桁落ちが生じないようにする。 Here, in particular, when there is a large difference in numerical value between the coefficient of deviation and the coefficient of manipulated variable, the multiplication result of the coefficient with the smaller numerical value and the manipulated variable or deviation will not be sufficiently reflected in the manipulated variable on the left side, Control cannot be performed accurately. For example, when each numerical value of the coefficient bm is smaller than each numerical value of the coefficient ak by J digits (where J is a natural number smaller than N), the expression (1) is replaced with the following expression (5). In other words, the coefficient bm is preliminarily multiplied by 2 J so that the product sum of the coefficient bm and the deviation is not lost.
UH (n)+UL (n)・2-M ={(b0 ・2J )・E(n)+(b1 ・2J )・E(n−1)+・・+(bm ・2J )・E(n−m)}2-J +a1 ・UH (n−1)+a2 ・UH (n−2)+・・+ak ・UH (n−k)+{a1 ・UL (n−1)+a2 ・UL (n−2)+・・+ak ・UL (n−k)}2-M ・・・(5) U H (n) + U L (n) · 2 −M = {(b 0 · 2 J ) · E (n) + (b 1 · 2 J ) · E (n−1) + ·· + (bm • 2 J) · E (n- m)} 2 -J + a 1 · U H (n-1) + a 2 · U H (n-2) + ·· + a k · U H (n-k) + { a 1 · U L (n- 1) + a 2 · U L (n-2) + ·· + a k · U L (n-k)} 2 -M ··· (5)
このように桁数を増加させた操作量の上位N桁及び下位M桁を分割して演算し、且つ、bm の数値精度を変換することにより、各係数と操作量又は偏差との乗算を行う乗算部で乗数及び被乗数の桁数をN桁から増やすことなく、高精度の演算を行えるようにする。
なお、以下では、N桁の固定小数点数をN桁の2進数で表す例について説明するが、2進数に限定されず、例えばN桁の10進数について演算を行う場合に適用してもよい。本実施の形態1では、N=16であり、M=15である(詳細については後述する)。
In this way, the upper N digits and the lower M digits of the manipulated variable with the increased number of digits are divided and operated, and the numerical precision of bm is converted to multiply each coefficient by the manipulated variable or deviation. High-precision arithmetic can be performed without increasing the number of digits of the multiplier and multiplicand from N digits in the multiplier.
In the following, an example in which an N-digit fixed-point number is represented by an N-digit binary number will be described. However, the present invention is not limited to a binary number, and may be applied to, for example, an arithmetic operation on an N-digit decimal number. In the first embodiment, N = 16 and M = 15 (details will be described later).
実際に式(5)に基づく演算を行う場合、演算結果の数値が小さくなる積和から先に演算して桁落ちを極力避けることが好ましい。ここでは、式(5)を例えば以下の式(6)のように変形して演算すればよい。 When the calculation based on the formula (5) is actually performed, it is preferable to calculate first from the product sum in which the numerical value of the calculation result is small, and to avoid the carry loss as much as possible. Here, equation (5) may be transformed into, for example, the following equation (6) for calculation.
UH (n)+UL (n)・2-M =[{a1 ・UL (n−1)+a2 ・UL (n−2)+・・+ak ・UL (n−k)}2J-M +(b0 ・2J )・E(n)+(b1 ・2J )・E(n−1)+・・+(bm ・2J )・E(n−m)]2-J +a1 ・UH (n−1)+a2 ・UH (n−2)+・・+ak ・UH (n−k)・・・(6) U H (n) + UL (n) · 2 −M = [{a 1 · UL (n−1) + a 2 · UL (n−2) + ·· + ak · UL (n−k )} 2 JM + (b 0 · 2 J ) · E (n) + (b 1 · 2 J ) · E (n−1) + ·· + (b m · 2 J ) · E (n−m)] 2 −J + a 1 · U H (n−1) + a 2 · U H (n−2) + ·· + ak · U H (n−k) (6)
次に、電流ループ制御について、具体的な数値を用いて説明する。電流ループ制御では、インダクタ13に流れる電流をフィードバックしてスイッチング素子11をオン/オフに制御しており、PWM回路25が生成するPWM信号の変化に対してインダクタ13に流れる電流の変化が急峻である。このような特性に対応するため、式(1)及び式(4)〜(6)における偏差の係数bm は、1より十分小さくすることが好ましい。
Next, current loop control will be described using specific numerical values. In the current loop control, the switching
さて、式(3)で表されるパルス伝達関数Gc(z)におけるポール及びゼロ点が夫々2つ存在する場合、Gc(z)は、以下の式(7)のように表される。 When there are two poles and two zero points in the pulse transfer function Gc (z) represented by Expression (3), Gc (z) is represented by Expression (7) below.
Gc(z)=(b0 +b1 ・z-1 +b2 ・z-2 )/(1−a1 ・z-1 −a2 ・z-2 )・・・(7) Gc (z) = (b 0 + b 1 · z −1 + b 2 · z −2 ) / (1−a 1 · z −1 −a 2 · z −2 ) (7)
式(7)に対応する差分方程式は、式(6)から抽出して以下の式(8)のとおりとなる。 The difference equation corresponding to the equation (7) is extracted from the equation (6) and becomes the following equation (8).
UH (n)+UL (n)・2-M =[{a1 ・UL (n−1)+a2 ・UL (n−2)}2J-M +(b0 ・2J )・E(n)+(b1 ・2J )・E(n−1)+(b2 ・2J )・E(n−2)]2-J +a1 ・UH (n−1)+a2 ・UH (n−2)・・・(8) U H (n) + UL (n) · 2 −M = [{a 1 · UL (n−1) + a 2 · UL (n−2)} 2 JM + (b 0 · 2 J ) · E (n) + (b 1 · 2 J ) · E (n−1) + (b 2 · 2 J ) · E (n−2)] 2 −J + a 1 · U H (n−1) + a 2・ U H (n-2) (8)
式(8)における各係数の数値の具体例を10進数で示すと、以下の式(9)及び(10)のとおりである。 When a specific example of the numerical value of each coefficient in the equation (8) is represented by a decimal number, the following equations (9) and (10) are obtained.
a1 =1.997、a2 =−0.997・・・(9)
b0 =0.0004076、b1 =0.0001103、b2 =−0.0002973・・・(10)
a 1 = 1.997, a 2 = −0.997 (9)
b 0 = 0.0004076, b 1 = 0.0001103, b 2 = −0.0002973 (10)
つまり、係数ak の絶対値の最大値は、係数bm の絶対値の最大値に対して5千倍程度大きい。これは2進数で言うと12〜13桁程度大きいことになる。以下では、例えばJ=12とする。
次に、式(8)に基づく演算を行う制御部2によって実現される演算器について、その動作を示すフローチャートを用いて説明する。
In other words, the maximum absolute value of the coefficient ak is about 5,000 times larger than the maximum absolute value of the coefficient bm. This is about 12 to 13 digits larger in binary. In the following, for example, J = 12.
Next, an arithmetic unit realized by the
図3は、本発明の実施の形態1に係る制御装置における演算器の構成例を示すブロック図であり、図4は、本発明の実施の形態1に係る制御装置でPWM回路25に対する操作量を演算するCPU21の処理手順を示すフローチャートである。図4の処理は、式(8)に基づく演算を行う周期、即ちPWM制御の制御周期毎に起動され、ROM22に予め格納された制御プログラムに従って、CPU21により実行される。
FIG. 3 is a block diagram illustrating a configuration example of the arithmetic unit in the control device according to the first embodiment of the present invention. FIG. 4 illustrates an operation amount for the
図3における31及び32は乗算部であり、乗算部31は、RAM23に夫々記憶された16ビット長の乗数及び被乗数を乗算する。乗算部31の乗算結果は、加算部33によって32ビット長のAcc34の内容に累積的に加算される。乗算部32は、32ビット長のAcc34の内容を、RAM23に記憶された内容に対応する桁数だけ算術シフトするものである。従って、加算部33及びAcc34が積算部に相当する。Acc34の最上位ビットは符号ビットである。
In FIG. 3,
反復的な演算を開始する前に、CPU21は、式(8)における定数であるa1 及びa2 を所定ビット数(以下、Dという)だけ左に算術シフトして被演算数としての精度が最も高くなるようにする。具体的には、被演算数を整数として見た場合、−32768〜32767の範囲内にてできるだけ絶対値が大きくなるようにする。ここではD=14であるから、a1 及びa2 を14ビットだけ算術左シフトするが、演算中の桁溢れを防ぐために、算術左シフトする桁数を13ビット又はそれ以下にしてもよい。
Before starting the iterative calculation, the
図3に示すA1 及びA2 は、以上のとおり予め以下の式(11)によって算出された数値であり、RAM23に記憶される。これにより、A1 及びA2 夫々をビット0(LSB)からビット15(MSB)までの16ビットの符号付き固定小数点数として見た場合、ビット13及び14の間に小数点があるものとして扱われる。ここではD=14であるから、A1 及びA2 は、符号ビットを除いて整数部が1ビットであり、小数部が14ビットである。
A 1 and A 2 shown in FIG. 3 are numerical values calculated in advance by the following equation (11) as described above, and are stored in the
A1 =a1 ・2D 、A2 =a2 ・2D 、・・・(11) A 1 = a 1 · 2 D , A 2 = a 2 · 2 D , (11)
一方、b0 、b1 及びb2 は、a1 及びa2 よりも更にJビットだけ算術左シフトすべき係数であるから、図3に示すB0 、B1 及びB2 が、予め以下の式(12)によって算出されてRAM23に記憶される。D=14、且つJ=12の場合、B0 、B1 及びB2 は、仮想的にビット25及び26の間に小数点があるものとして扱われる。
On the other hand, b 0 , b 1, and b 2 are coefficients that should be shifted to the arithmetic left by J bits further than a 1 and a 2 , so that B 0 , B 1, and B 2 shown in FIG. It is calculated by Expression (12) and stored in the
B0 =b0 ・2D+J 、B1 =b1 ・2D+J 、B2 =b2 ・2D+J ・・・(12) B 0 = b 0 · 2 D + J , B 1 = b 1 · 2 D + J , B 2 = b 2 · 2 D + J (12)
また、図3に示すAEL 及びAHL 夫々は、式(8)における他の定数が予め以下の式(13)によって算出されたものであり、RAM23に記憶される。
Further, each of A EL and A HL shown in FIG. 3 is obtained by previously calculating the other constants in the equation (8) according to the following equation (13), and is stored in the
AEL =2J-M 、AHL =2-J ・・・(13) A EL = 2 JM , A HL = 2 -J (13)
その他、図3に示すUL (n−1)、UL (n−2)、E(n−1)、E(n−2)、UH (n−1)及びUH (n−2)については、初期値としての0がRAM23に記憶される。Acc34の初期値は0である。
In addition, UL (n-1), UL (n-2), E (n-1), E (n-2), UH (n-1) and UH (n-2) shown in FIG. ) Is stored in the
次に図4に移って、図3に示す演算器によって式(8)を反復的に演算する処理について詳述する。以下では、「格納」を「記憶」と同じ意味で用いる。また、Acc34に対する記憶又は格納を除いて、全ての記憶又は格納は、RAM23に対して行われる。予めRAM23に格納されたA1 ,A2 ,B0 ,B1 ,B2 ,AEL ,AHL の内容は、適時RAM23から読み出される。
Next, moving on to FIG. 4, the process of repeatedly calculating the equation (8) by the calculator shown in FIG. 3 will be described in detail. In the following, “store” is used in the same meaning as “memory”. All storage or storage is performed on the
図4の処理が起動された場合、CPU21は、式(2)で演算されたI(n)を目標値として、目標値に対するA/D変換回路26で変換されたデジタルの電流値の偏差を算出し(S11)、算出した偏差をE(n)に格納する(S12)。本実施の形態1では、一例として、E(n)を正規化して、絶対値が1より小さい適当な大きさの値となるようにする。つまり、E(n)は、ビット15が符号ビットであり、ビット14及び15の間に小数点があるものとして扱われる。但し、E(n)の正規化は必須ではない。
When the process of FIG. 4 is started, the
次いで、CPU21は、A1 とUL (n−1)の内容を乗算部31で乗算し、乗算結果を加算部33によってAcc34に加算する(S13)。同様に、CPU21は、A2 とUL (n−2)の内容を乗算部31で乗算し、乗算結果を加算部33によってAcc34に加算する(S14)。
Next, the
次いで、CPU21は、Acc34の内容をAEL の内容に応じて算術シフトする(S15)。具体的には、AEL に2J-M が格納されているから、CPU21は、Acc34の内容をJ−Mビットだけ算術左シフト(換言すればM−Jビットだけ算術右シフト)する。
Then,
次いで、CPU21は、B0 とE(n)の内容を乗算部31で乗算し、乗算結果を加算部33によってAcc34に加算する(S16)。同様に、CPU21は、B1 とE(n−1)の内容を乗算部31で乗算し、乗算結果を加算部33によってAcc34に加算する(S17)と共に、B2 とE(n−2)の内容を乗算部31で乗算し、乗算結果を加算部33によってAcc34に加算する(S18)。
Next, the
ここで、B0 、B1 及びB2 は小数部が仮想的に26ビットであり、E(n)、E(n−1)及びE(n−2)は小数部が15ビットであるため、これらの積和が積算されて格納されるAcc34は、小数部が仮想的に41ビットとなる。つまりAcc34を符号付き固定小数点数として見た場合、仮想的にビット40及び41の間に小数点がある。
Here, B 0 , B 1 and B 2 are virtually 26 bits in the decimal part, and E (n), E (n−1) and E (n−2) are 15 bits in the decimal part. ,
次いで、CPU21は、Acc34の内容をAHL の内容に応じて算術シフトする(S19)。具体的には、AHL に2-J が格納されているから、CPU21は、Acc34の内容をJビットだけ算術右シフトする。この算術右シフトを実行した後では、Acc34の小数点の位置は、ビット28及び29の間にある。
Then,
次いで、CPU21は、A1 とUH (n−1)の内容を乗算部31で乗算し、乗算結果を加算部33によってAcc34に加算する(S20)。同様に、CPU21は、A2 とUH (n−2)の内容を乗算部31で乗算し、乗算結果を加算部33によってAcc34に加算する(S21)。この時点でAcc34には、既に式(8)の演算結果としてのU(n)が格納されている。
Next, the
その後、CPU21は、次の周期における演算のために、UH (n−1)及びUL (n−1)夫々の内容をRAM23から読み出してUH (n−2)及びUL (n−2)に格納する(S22)。
Thereafter, the
さて、本実施の形態1では、U(n)が、PWM回路25に対する操作量であり、絶対値が1より小さいデューティを表す値として演算される。つまり、U(n)は、ビット15が符号ビットであり、ビット14及び15の間に小数点がある。一方、ステップS21の演算結果としてのAcc34は、ビット28及び29の間に小数点があるから、符号ビット(ビット30)を含めて、Acc34のビット30からビット0までの31ビットをU(n)として抽出すればよい。
In the first embodiment, U (n) is an operation amount for the
そこで、CPU21は、次の周期における演算のために、Acc34のビット30〜15及びビット14〜0夫々の内容をUH (n−1)及びUL (n−1)に格納する(S23)。この場合、Acc34のビット14〜0の内容は、UL (n−1)に右詰で格納される。
Therefore, the
その後、CPU21は、E(n−1)の内容をE(n−2)に格納し(S24)、更にE(n)の内容をE(n−1)に格納して(S25)図4の処理を終了する。以上のステップS11からS25までの処理を反復的に繰り返すことにより、コンバータ1の出力電圧が電流モード制御方式で制御される。
Thereafter, the
以上のように本実施の形態1によれば、式(7)で示されるパルス伝達関数に対応する式(8)の差分方程式に基づいて演算を開始する前に、偏差及び操作量夫々の係数b0 ,b1 ,b2 及びa1 ,a2 を16ビットの固定小数点数として予めRAM23に記憶し、偏差E(n),E(n−1),E(n−2)及び操作量U(n),U(n−1),U(n−2)夫々を16ビット及び31ビットの固定小数点数として記憶するための領域をRAM23に確保しておく。この場合、U(n−1)はUH (n−1)及びUL (n−1)に、U(n−2)はUH (n−2)及びUL (n−2)に、夫々分割して記憶されるようにする。式(8)の差分方程式に基づく演算の都度、先ず現在の偏差E(n)を16ビットの固定小数点数としてRAM23に記憶する。そして、UL (n−1)及びA1 、UL (n−2)及びA2 、E(n)及びB0 、E(n−1)及びB1 、E(n−2)及びB2 、UH (n−1)及びA1 、並びにUH (n−2)及びA2 を夫々RAM23から読み出して乗算部31で乗算し、式(8)の演算結果が示す操作量U(n)を実質的に31(=16+15)ビットの固定小数点数としてUH (n−1)及びUL (n−1)に分割して記憶する。
これにより、16ビットの乗数及び被乗数を乗算する乗算部31を用いるにもかかわらず、演算結果が示すU(n)が31ビットの精度で次の演算に引き継がれる。
従って、ビット数が比較的少ない演算を行うにもかかわらず操作量の演算精度の低下を防止することが可能となる。
As described above, according to the first embodiment, before starting the calculation based on the difference equation of the equation (8) corresponding to the pulse transfer function represented by the equation (7), the coefficient of each of the deviation and the manipulated variable is calculated. b 0 , b 1 , b 2 and a 1 , a 2 are previously stored in the
Accordingly, U (n) indicated by the operation result is succeeded to the next operation with an accuracy of 31 bits, although the
Accordingly, it is possible to prevent a reduction in the calculation accuracy of the manipulated variable even though an operation with a relatively small number of bits is performed.
また、実施の形態1によれば、式(8)に含まれる複数の乗算項の乗算結果をAcc34に積算し、積算結果における最下位からの30ビットのうち、上位16ビット及び下位14ビット夫々を、式(8)の演算結果におけるUH (n−1)及びUL (n−1)とする。
従って、式(8)のn+1回目の演算に先立って、U(n)を桁落ちなしにUH (n−1)及びUL (n−1)に代入することが可能となる。
Further, according to the first embodiment, the multiplication results of the plurality of multiplication terms included in Equation (8) are accumulated in Acc34, and the upper 16 bits and the lower 14 bits of the 30 bits from the least significant in the accumulation result, respectively. Are defined as U H (n−1) and U L (n−1) in the calculation result of Expression (8).
Therefore, prior to the (n + 1) th calculation of Equation (8), U (n) can be substituted into U H (n−1) and U L (n−1) without any loss of digits.
更にまた、実施の形態1によれば、演算された操作量U(n)に基づいてPWM回路25がPWM信号を生成し、生成されたPWM信号によってコンバータ1のスイッチング素子11がスイッチングする。
従って、演算精度の低下を防止する演算方法によって演算された操作量U(n)に基づいて、コンバータ1のスイッチング素子11をオン/オフに制御することが可能となる。
Furthermore, according to the first embodiment, the
Therefore, the switching
更にまた、実施の形態1によれば、コンバータ1が出力する電流が制御量であり、いわゆる電流モード制御方式によって、コンバータ1が出力する電流を高精度に制御することが可能となる。
Furthermore, according to the first embodiment, the current output from
(実施の形態2)
実施の形態1が、式(8)に基づく演算に際して積和を3回演算する形態であるのに対し、実施の形態2は、式(8)を簡略化した式に基づく演算に際して積和を2回に分割して演算する形態である。
実施の形態2における制御装置のブロック構成及び制御部2の機能構成は、実施の形態1と同じであるため、対応する箇所に同様の符号を付してその説明を省略する。
(Embodiment 2)
In the first embodiment, the product-sum is calculated three times in the calculation based on the formula (8), whereas in the second embodiment, the product-sum is calculated in the calculation based on the simplified formula (8). In this form, the calculation is divided into two times.
Since the block configuration of the control device and the functional configuration of the
さて、実施の形態1で例えばJがNと同等の桁数である場合、式(8)における係数a1 及びa2 に予め2J-N を乗じておくことにより、式(8)が以下の式(14)のように変形される。これにより、演算の精度を下げることなく、右辺の積和を演算する回数を3回から2回に減少させることができる。 Now, in the first embodiment, for example, when J has the same number of digits as N, by multiplying the coefficients a 1 and a 2 in equation (8) by 2 JN in advance, equation (8) becomes the following equation: It is deformed as in (14). Thereby, the number of times of calculating the product sum of the right side can be reduced from 3 times to 2 times without reducing the accuracy of the calculation.
UH (n)+UL (n)・2-N ={(a1 ・2J-N )・UL (n−1)+(a2 ・2J-N )・UL (n−2)+(b0 ・2J )・E(n)+(b1 ・2J )・E(n−1)+(b2 ・2J )・E(n−2)}2-J +a1 ・UH (n−1)+a2 ・UH (n−2)・・・(14) U H (n) + U L (n) · 2 -N = {(a 1 · 2 JN) · U L (n-1) + (a 2 · 2 JN) · U L (n-2) + (b 0 · 2 J ) · E (n) + (b 1 · 2 J ) · E (n−1) + (b 2 · 2 J ) · E (n−2)} 2 −J + a 1 · U H ( n-1) + a 2 · U H (n-2) (14)
次に、式(14)に基づく演算を行う制御部2によって実現される演算器について、その動作を示すフローチャートを用いて説明する。
図5は、本発明の実施の形態2に係る制御装置における演算器の構成例を示すブロック図であり、図6は、本発明の実施の形態2に係る制御装置でPWM回路25に対する操作量を演算するCPU21の処理手順を示すフローチャートである。図6の処理は、式(14)に基づく演算を行う周期、即ちPWM制御の制御周期毎に起動され、ROM22に予め格納された制御プログラムに従って、CPU21により実行される。
Next, an arithmetic unit realized by the
FIG. 5 is a block diagram illustrating a configuration example of a computing unit in the control device according to the second embodiment of the present invention. FIG. 6 illustrates an operation amount for the
図5における乗算部31,32の構成と、加算部33及びAcc34からなる積算部の構成とは、実施の形態1の図3の場合と同様であるため、その説明を省略する。
The configuration of the
反復的な演算を開始する前に、CPU21は、式(14)における定数であるa1 及びa2 を所定ビット数だけ左に算術シフトして被演算数としての精度が最も高くなるようにする。
Before starting the repetitive calculation, the
図5に示すA1 及びA2 は、実施の形態1と同様に予め式(11)によって算出された数値であり、RAM23に記憶される。これにより、A1 及びA2 夫々をビット0(LSB)からビット15(MSB)までの16ビットの符号付き固定小数点数として見た場合、ビット13及び14の間に小数点があるものとして扱われる。
A 1 and A 2 shown in FIG. 5 are numerical values calculated in advance by the equation (11) as in the first embodiment, and are stored in the
一方、b0 、b1 及びb2 は、実施の形態1と同様にa1 及びa2 よりも更にJビットだけ算術左シフトすべき係数であり、図5に示すB0 、B1 及びB2 が予め式(12)によって算出されてRAM23に記憶される。B0 、B1 及びB2 については、仮想的にビット25及び26の間に小数点があるものとして扱われる。
On the other hand, b 0 , b 1, and b 2 are coefficients to be arithmetically shifted to the left by J bits further than a 1 and a 2 as in the first embodiment, and B 0 , B 1, and B shown in FIG. 2 is calculated in advance by Expression (12) and stored in the
図5に示すAHL は、実施の形態1と同様に予め式(13)によって算出されたものであり、RAM23に記憶される。また、A1 ’及びA2 ’夫々は、予め以下の式(15)によって算出されたものであり、RAM23に記憶される。
A HL shown in FIG. 5 is calculated in advance by equation (13) as in the first embodiment, and is stored in the
A1 ’=A1 ・2J-M 、A2 ’=A2 ・2J-M ・・・(15)
A 1 '= A 1 · 2 JM, A 2' =
その他、図5に示すUL (n−1)、UL (n−2)、E(n−1)、E(n−2)、UH (n−1)及びUH (n−2)については、実施の形態1と同様に初期値としての0がRAM23に記憶される。
In addition, UL (n-1), UL (n-2), E (n-1), E (n-2), UH (n-1) and UH (n-2) shown in FIG. ), 0 as an initial value is stored in the
次に図6に移って、図5に示す演算器によって式(14)を反復的に演算する処理について説明する。図6に示すステップS31、S32、及びS36〜S45の夫々については、実施の形態1の図4におけるステップS11、S12、及びS16〜S25と同等の内容であるため、これらの説明の一部を省略する。 Next, moving to FIG. 6, a process of repeatedly calculating Expression (14) by the calculator shown in FIG. 5 will be described. Since each of steps S31, S32, and S36 to S45 shown in FIG. 6 is the same as steps S11, S12, and S16 to S25 in FIG. 4 of the first embodiment, a part of these descriptions is provided. Omitted.
図6の処理が起動された場合、CPU21は、式(2)で演算されたI(n)を目標値として、目標値に対するA/D変換回路26で変換されたデジタルの電流値の偏差を算出し(S31)、算出した偏差をE(n)に格納する(S32)。本実施の形態2でも、E(n)は、絶対値が1より小さい適当な大きさの値となるように正規化する。つまり、E(n)は、ビット15が符号ビットであり、ビット14及び15の間に小数点があるものとして扱われる。
When the processing of FIG. 6 is started, the
次いで、CPU21は、A1 ’とUL (n−1)の内容を乗算部31で乗算し、乗算結果を加算部33によってAcc34に加算する(S33)。同様に、CPU21は、A2 ’とUL (n−2)の内容を乗算部31で乗算し、乗算結果を加算部33によってAcc34に加算する(S34)。
Next, the
次いで、CPU21は、B0 とE(n)の内容、B1 とE(n−1)の内容、及びB2 とE(n−2)の内容を夫々乗算部31で乗算し、乗算結果を加算部33によってAcc34に夫々加算する(S36〜S38)。
Next, the
ここで、B0 、B1 及びB2 は小数部が仮想的に26ビットであり、E(n)、E(n−1)及びE(n−2)は小数部が15ビットであるため、これらの積和が積算されて格納されるAcc34は、小数部が仮想的に41ビットとなる。つまりAcc34を符号付き固定小数点数として見た場合、仮想的にビット40及び41の間に小数点がある。
Here, B 0 , B 1 and B 2 are virtually 26 bits in the decimal part, and E (n), E (n−1) and E (n−2) are 15 bits in the decimal part. ,
次いで、CPU21は、Acc34の内容をAHL の内容に応じて算術シフトする(S39)。この算術右シフトを実行した後では、Acc34の小数点の位置は、ビット28及び29の間にある。
Then,
次いで、CPU21は、A1 とUH (n−1)の内容、及びA2 とUH (n−2)の内容を夫々乗算部31で乗算し、乗算結果を加算部33によってAcc34に夫々加算する(S40〜S41)。この時点でAcc34には、既に式(14)の演算結果としてのU(n)が格納されている。
Next, the
その後、CPU21は、次の周期における演算のために、UH (n−1)及びUL (n−1)夫々の内容をRAM23から読み出してUH (n−2)及びUL (n−2)に格納する(S42)。
Thereafter, the
さて、本実施の形態2でも、U(n)が、絶対値が1より小さいデューティを表す値として演算される。つまり、U(n)は、ビット15が符号ビットであり、ビット14及び15の間に小数点がある。一方、ステップS41の演算結果としてのAcc34は、ビット28及び29の間に小数点があるから、Acc34のビット30からビット0までの31ビットをU(n)として抽出すればよい。
In the second embodiment, U (n) is calculated as a value representing a duty with an absolute value smaller than 1. That is, in U (n),
そこで、CPU21は、次の周期における演算のために、Acc34のビット30〜15及びビット14〜0夫々の内容をUH (n−1)及びUL (n−1)に格納する(S43)。この場合、Acc34のビット14〜0の内容は、UL (n−1)に右詰で格納される。
Therefore, the
その後、CPU21は、E(n−1)の内容をE(n−2)に格納し(S44)、更にE(n)の内容をE(n−1)に格納して(S45)図6の処理を終了する。以上のステップS31からS45までの処理を反復的に繰り返すことにより、コンバータ1の出力電圧が電流モード制御方式で制御される。
Thereafter, the
以上のように本実施の形態2によれば、式(7)で示されるパルス伝達関数に対応する式(14)の差分方程式に基づいて演算を開始する前に、偏差及び操作量夫々の係数b0 ,b1 ,b2 及びa1 ,a2 を16ビットの固定小数点数として予めRAM23に記憶し、偏差E(n),E(n−1),E(n−2)及び操作量U(n),U(n−1),U(n−2)夫々を16ビット及び31ビットの固定小数点数として記憶するための領域をRAM23に確保しておく。この場合、U(n−1)はUH (n−1)及びUL (n−1)に、U(n−2)はUH (n−2)及びUL (n−2)に、夫々分割して記憶されるようにする。式(14)の差分方程式に基づく演算の都度、先ず現在の偏差E(n)を16ビットの固定小数点数としてRAM23に記憶する。そして、UL (n−1)及びA1 ’、UL (n−2)及びA2 、E(n)及びB0 、E(n−1)及びB1 、E(n−2)及びB2 、UH (n−1)及びA1 、並びにUH (n−2)及びA2 を夫々RAM23から読み出して乗算部31で乗算し、式(14)の演算結果が示す操作量U(n)を実質的には31(=16+15)ビットの固定小数点数としてUH (n−1)及びUL (n−1)に分割して記憶する。
これにより、16ビットの乗数及び被乗数を乗算する乗算部31を用いるにもかかわらず、演算結果が示すU(n)が31ビットの精度で次の演算に引き継がれる。
従って、ビット数が比較的少ない演算を行うにもかかわらず操作量の演算精度の低下を防止することが可能となる。
As described above, according to the second embodiment, before starting the calculation based on the difference equation of the equation (14) corresponding to the pulse transfer function represented by the equation (7), the coefficient of each of the deviation and the manipulated variable is calculated. b 0 , b 1 , b 2 and a 1 , a 2 are previously stored in the
Accordingly, U (n) indicated by the operation result is succeeded to the next operation with an accuracy of 31 bits, although the
Accordingly, it is possible to prevent a reduction in the calculation accuracy of the manipulated variable even though an operation with a relatively small number of bits is performed.
また、実施の形態2によれば、式(14)に含まれる複数の乗算項の乗算結果をAcc34に積算し、積算結果における最下位からの31ビットのうち、上位16ビット及び下位15ビット夫々を、式(14)の演算結果におけるUH (n−1)及びUL (n−1)とする。
従って、式(14)のn+1回目の演算に先立って、U(n)を桁落ちなしにUH (n−1)及びUL (n−1)に代入することが可能となる。
Further, according to the second embodiment, the multiplication results of the plurality of multiplication terms included in Expression (14) are accumulated in Acc34, and the upper 16 bits and the lower 15 bits of the 31 bits from the least significant bit in the accumulation result, respectively. Are defined as U H (n−1) and U L (n−1) in the calculation result of Expression (14).
Therefore, prior to the (n + 1) th calculation of Equation (14), U (n) can be substituted into U H (n−1) and U L (n−1) without any loss of digits.
なお、実施の形態1及び2では、本発明を電流モード制御方式によってコンバータ1の出力電圧を制御する制御装置に適用したが、フィードバック制御を行う一般的な制御に適用してもよい。本発明は、特に制御対象の伝達特性をパルス伝達関数で表した場合、対応する差分方程式の係数間の数値に大きな差があるときに格別の効果を奏する。
In the first and second embodiments, the present invention is applied to the control device that controls the output voltage of the
今回開示された実施の形態は、全ての点で例示であって、制限的なものではないと考えられるべきである。本発明の範囲は、上述した意味ではなく、特許請求の範囲によって示され、特許請求の範囲と均等の意味及び範囲内での全ての変更が含まれることが意図される。また、各実施の形態で記載されている技術的特徴は、お互いに組み合わせることが可能である。 The embodiment disclosed this time is to be considered as illustrative in all points and not restrictive. The scope of the present invention is defined by the terms of the claims, rather than the meanings described above, and is intended to include any modifications within the scope and meaning equivalent to the terms of the claims. In addition, the technical features described in each embodiment can be combined with each other.
1 コンバータ
11、12 スイッチング素子
13 インダクタ
14 抵抗器
15 コンデンサ
2 制御部
21 CPU
22 ROM
23 RAM
25 PWM回路
26、27 A/D変換回路
28 電圧ループ制御器
29 電流ループ制御器
31、32 乗算部
33 加算部
34 Acc
4 バッテリ
5 負荷
DESCRIPTION OF
22 ROM
23 RAM
25
4
Claims (5)
記憶部と、
N桁(Nは2以上の整数)の固定小数点の乗数及び被乗数を乗算する乗算部とを用意し、
前記記憶部は、前記偏差及び操作量夫々の係数をN桁の固定小数点数として予め記憶すると共に、前記差分方程式に基づく演算の都度、前記偏差及び操作量夫々をN桁及びN+M桁(MはNより小さい自然数)の固定小数点数として記憶し、
前記乗算部は、前記差分方程式に基づく演算の都度、前記偏差及び該偏差の係数、前記操作量の上位N桁及び該操作量の係数、並びに前記操作量の下位M桁及び該操作量の係数の夫々を前記記憶部から読み出して乗算すること
を特徴とする制御装置の操作量の演算方法。 A control device that controls an operation amount input to a control target whose transfer characteristic is represented by a pulse transfer function based on a deviation of the control amount from a target value, and the operation amount based on a difference equation corresponding to the pulse transfer function In a method of iteratively calculating
A storage unit;
A multiplication unit for multiplying a fixed-point multiplier and multiplicand of N digits (N is an integer of 2 or more);
The storage unit stores in advance the coefficients of the deviation and the manipulated variable as N-digit fixed-point numbers, and each time the calculation based on the difference equation, the deviation and the manipulated variable are N digits and N + M digits (M is Stored as a fixed-point number (natural number smaller than N),
The multiplication unit performs the calculation based on the difference equation, the deviation and the coefficient of the deviation, the upper N digits of the manipulated variable and the manipulated variable coefficient, and the lower M digit of the manipulated variable and the manipulated variable coefficient. Each of the above is read out from the storage unit and multiplied, and the operation amount of the control device is calculated.
前記差分方程式は、下記の式(1)であり、
前記積算部の積算結果における最下位からのM桁及び該M桁に続くN桁の夫々を、前記式(1)の演算結果におけるUL (n)及びUH (n)とすること
を特徴とする請求項1に記載の制御装置の操作量の演算方法。
UH (n)+UL (n)・2-M =b0 ・E(n)+b1 ・E(n−1)+・・+bm ・E(n−m)+a1 ・UH (n−1)+a2 ・UH (n−2)+・・+ak ・UH (n−k)+{a1 ・UL (n−1)+a2 ・UL (n−2)+・・+ak ・UL (n−k)}2-M ・・・(1)
但し、
n :2以上の整数
m、k:1≦m≦k≦n−1を満たす整数
E(n):目標値に対するn回目の制御量の偏差
UH (n):n回目の操作量U(n)の上位N桁
UL (n):n回目の操作量U(n)の下位M桁
bm :偏差の係数
ak :操作量の係数 Preparing an integration unit for integrating the multiplication results of the multiplication unit,
The difference equation is the following equation (1):
The M digits from the least significant position and the N digits following the M digits in the integration result of the integration unit are set as U L (n) and U H (n) in the calculation result of the formula (1), respectively. The operation amount calculation method of the control device according to claim 1.
U H (n) + UL (n) · 2 −M = b 0 · E (n) + b 1 · E (n-1) + ·· + bm · E (n−m) + a 1 · U H (n− 1) + a 2 · U H (n−2) + ·· + a k • U H (n−k) + {a 1 • U L (n−1) + a 2 • U L (n−2) +・ ・ + A k・UL (n−k)} 2 −M (1)
However,
n: integer m greater than or equal to 2, k: integer satisfying 1 ≦ m ≦ k ≦ n−1 E (n): deviation of control amount for the nth time U H (n): nth manipulated variable U ( n) upper N digits U L (n): lower M digits of the nth manipulated variable U (n) bm: coefficient of deviation a k : coefficient of manipulated variable
前記偏差及び操作量夫々の係数をN桁(Nは2以上の整数)の固定小数点数として記憶すると共に、前記差分方程式に基づく演算の都度、前記偏差及び操作量夫々をN桁及びN+M桁(MはNより小さい自然数)の固定小数点数として記憶する記憶部と、
前記差分方程式に基づく演算の都度、前記偏差及び該偏差の係数、前記操作量の上位N桁及び該操作量の係数、並びに前記操作量の下位M桁及び該操作量の係数の夫々を前記記憶部から読み出して乗算する乗算部とを備えること
を特徴とする制御装置。 The manipulated variable input to the controlled object whose transfer characteristics are represented by a pulse transfer function is controlled based on the deviation of the controlled variable from the target value, and the manipulated variable is iteratively calculated by the differential equation corresponding to the pulse transfer function. In the control device
The coefficient of each of the deviation and the manipulated variable is stored as a fixed-point number of N digits (N is an integer of 2 or more), and the deviation and the manipulated variable are respectively represented by N and N + M digits (N + M ( A storage unit for storing M as a fixed-point number (a natural number smaller than N);
For each calculation based on the difference equation, the deviation and the coefficient of the deviation, the upper N digits of the manipulated variable and the manipulated variable coefficient, and the lower M digits of the manipulated variable and the manipulated variable coefficient are stored in the memory, respectively. A control unit comprising: a multiplication unit that reads out and multiplies from the unit.
を特徴とする請求項3に記載の制御装置。 The control target includes a PWM generation unit that generates a PWM signal based on the calculated operation amount, and a voltage conversion unit that includes a switching element that switches according to the PWM signal generated by the PWM generation unit. The control device according to claim 3.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2014139078A JP2016018274A (en) | 2014-07-04 | 2014-07-04 | Method for calculating control input to control device, and control device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2014139078A JP2016018274A (en) | 2014-07-04 | 2014-07-04 | Method for calculating control input to control device, and control device |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2016018274A true JP2016018274A (en) | 2016-02-01 |
Family
ID=55233485
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2014139078A Pending JP2016018274A (en) | 2014-07-04 | 2014-07-04 | Method for calculating control input to control device, and control device |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2016018274A (en) |
-
2014
- 2014-07-04 JP JP2014139078A patent/JP2016018274A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20090184695A1 (en) | Method and system for rms computation on digitized samples | |
CN1705922A (en) | Digital signal processor architecture optimized for controlling switched mode power supply | |
Wang et al. | Decimal floating-point division using Newton-Raphson iteration | |
JP5487438B2 (en) | Power conversion circuit control device and control method | |
US20150212533A1 (en) | Power control device and power control method | |
JP2016018274A (en) | Method for calculating control input to control device, and control device | |
JPH07234778A (en) | Arithmetic circuit | |
JP5146820B2 (en) | Power supply | |
US6347326B1 (en) | N bit by M bit multiplication of twos complement numbers using N/2+1 X M/2+1 bit multipliers | |
WO2017073497A1 (en) | Signal generating circuit, voltage converting device and computer program | |
Stellato et al. | Real-time FPGA implementation of direct MPC for power electronics | |
JP2018085827A (en) | Voltage controller | |
JP6185325B2 (en) | Switching power supply device and semiconductor integrated circuit device | |
CN105468067B (en) | Parameter determination method, computer readable recording medium storing program for performing and message processing device | |
JP3222313B2 (en) | Arithmetic device and arithmetic method | |
Arévalo et al. | A software platform for adaptive high order multistep methods | |
JPS6156523B2 (en) | ||
WO2016121735A1 (en) | Signal generation circuit, voltage conversion device, and signal generation method | |
US20050125479A1 (en) | Hardware for performing an arithmetic function | |
JP4293665B2 (en) | Remainder multiplier | |
Boshkovski et al. | Development of embedded model predictive controller | |
US4563749A (en) | Floating point digital differential analyzer | |
EP4455859A1 (en) | Operation method of multiplier, operation apparatus, electronic device, and storage medium | |
JP2001159927A (en) | Method and device for interpolation | |
JP7120885B2 (en) | Semiconductor device and division method |