Semiconductor device and motor control device

JP7561657B2Active Publication Date: 2024-10-04RENESAS ELECTRONICS CORP
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
JP2021028740
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Filing Date
2021-02-25
Publication Date
2024-10-04
Estimated Expiration
2041-02-25

AI Technical Summary

Benefits of technology

【0008】 前記一実施の形態によれば、IIRフィルタからの出力データが得られるまでの時間を短縮することが可能になる。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007561657000001
    Figure 0007561657000001
  • Figure 0007561657000002
    Figure 0007561657000002
  • Figure 0007561657000003
    Figure 0007561657000003
Patent Text Reader

Abstract

To provide a semiconductor device and a motor control device which can shorten time until output data from an IIR filter is obtained.SOLUTION: A control circuit CTL receives a command CMD from the outside, and causes a calculator CAL to perform calculations for M (M is an integer being 2 or greater) times by using input data Din from the outside and calculation data D held by the memory MEM to cause the calculator and the memory to function as an IIR filter. The IIR filter can establish output data Dout by calculations for K (K<M) times of M times. The control circuit CTL establishes the output data Dout by causing the calculator CAL to precedingly perform K times of calculations after receiving the command CMD from the outside, and outputs the output data Dout to the outside at that point of time.SELECTED DRAWING: Figure 2
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present invention relates to a semiconductor device and a motor control device, and more particularly to a semiconductor device including an IIR (Infinite Impulse Response) filter, and a motor control device including the semiconductor device. [Background technology]

[0002] Patent Document 1 shows a microprocessor capable of performing IIR filter calculations at high speed. The microprocessor has a plurality of registers and a filter calculation circuit that executes IIR filter calculations using data from the plurality of registers and outputs one sample of calculated data and handover data for the next filter calculation. The plurality of registers are configured to overwrite and update previous handover data with new handover data, and to overwrite and update the data to be calculated with the operated data. [Prior art documents] [Patent documents]

[0003] [Patent Document 1] JP 2009-33371 A Summary of the Invention [Problem to be solved by the invention]

[0004] The calculation of an IIR filter is realized by making a filter calculation circuit mounted in a microprocessor perform loop processing, as shown in Patent Document 1, for example. Meanwhile, IIR filters are generally often connected in cascade. In this case, the filter calculation circuit usually performs serial processing, starting with the calculation processing of the first-stage IIR filter, and moving on to the calculation processing of the next-stage IIR filter after the calculation processing is completed. Then, when the filter calculation circuit completes the calculation processing of the final-stage IIR filter, it outputs output data as a multi-stage IIR filter.

[0005] However, when using such serial processing, it takes time from when input data is given to a multi-stage IIR filter until output data is obtained. For example, when an IIR filter is applied to various control systems, the control system usually needs to perform arithmetic processing of the multi-stage IIR filter within a control cycle and further processing using the output data thereof. If the time until output data is obtained becomes long, there has been a risk that it becomes difficult to complete the necessary processing within the control cycle.

[0006] The embodiment described below has been made in view of such circumstances, and other problems and novel features will become apparent from the description of this specification and the accompanying drawings.

Means for Solving the Problems

[0007] A semiconductor device according to an embodiment includes an arithmetic unit including a multiplier and an adder, a memory for holding calculation data, and a control circuit for controlling the arithmetic unit and the memory. The control circuit receives an instruction from the outside, and causes the arithmetic unit to perform M (M is an integer of 2 or more) operations using input data from the outside and the calculation data held in the memory, thereby causing the arithmetic unit and the memory to function as an IIR filter including a multiplication block, an addition block, and a delay block. Here, the IIR filter is a filter capable of determining output data by performing K (K < M) operations out of M operations. After receiving an instruction from the outside, the control circuit causes the arithmetic unit to perform K operations in advance to determine the output data, and outputs the output data to the outside at the time when the output data is determined.

Effects of the Invention

[0008] According to the above-described embodiment, it becomes possible to shorten the time until output data is obtained from the IIR filter.

Brief Description of the Drawings

[0009] [Figure 1] It is a schematic diagram showing a configuration example of a semiconductor device according to Embodiment 1 of the present invention. [Diagram 2] 2 is a schematic diagram illustrating an example of the configuration of a hardware accelerator in FIG. 1. [Figure 3A] 3 is a block diagram showing an example of the configuration of an IIR filter realized by the hardware accelerator of FIG. 2. [Figure 3B] 3B is a diagram illustrating an example of the operation of the IIR filter in FIG. 3A. [Figure 4A] 3 is a block diagram showing an example of the configuration of another IIR filter realized by the hardware accelerator of FIG. 2. [Figure 4B] 4B is a diagram illustrating an example of the operation of the IIR filter in FIG. 4A. [Diagram 5] FIG. 3B is a block diagram showing an example of the configuration of an IIR filter different from that of FIG. 3A. [Figure 6] FIG. 4B is a block diagram showing an example of the configuration of an IIR filter different from that of FIG. 4A. [Figure 7] 3 is a block diagram showing an example of a practical configuration of an IIR filter realized by the hardware accelerator of FIG. 2. [Figure 8] 3 is a flow chart showing an example of processing contents of a control circuit in the hardware accelerator of FIG. 2. [Figure 9] FIG. 9 is a diagram showing an example of a detailed calculation procedure by a calculator in the flow of FIG. 8. [Figure 10] FIG. 10 is a diagram showing an example of a calculation procedure different from that shown in FIG. [Figure 11] 15 is a conceptual diagram comparing the process flow of the control system when the flow of the embodiment in FIG. 8 is used and when the flow of the comparative example in FIG. 14 is used. [Figure 12] FIG. 11 is a schematic diagram showing a configuration example of the periphery of a motor control device to which a semiconductor device according to a second embodiment of the present invention is applied. [Figure 13A] FIG. 1 is a conceptual diagram showing an example of a calculation method in various processing systems. [Figure 13B] FIG. 1 is a conceptual diagram showing an example of a calculation method in various processing systems. [Figure 14]11 is a flow diagram showing an example of processing contents of a control circuit in a hardware accelerator in a semiconductor device serving as a comparative example of the present invention. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0010] In the following embodiments, when necessary for convenience, the description will be divided into multiple sections or embodiments, but unless otherwise specified, they are not unrelated to each other, and one is a partial or complete modification, detail, supplementary explanation, etc. of the other. Furthermore, in the following embodiments, when the number of elements, etc. (including the number, numerical value, amount, range, etc.) is mentioned, it is not limited to that specific number, and may be more or less than the specific number, unless otherwise specified or clearly limited in principle to a specific number.

[0011] Furthermore, in the following embodiments, the components (including element steps, etc.) are not necessarily essential unless otherwise specified or considered to be obviously essential in principle. Similarly, in the following embodiments, when referring to the shape, positional relationship, etc. of components, etc., it is intended to include those that are substantially similar or similar to the shape, etc., unless otherwise specified or considered to be obviously not essential in principle. The same applies to the above numerical values ​​and ranges.

[0012] Furthermore, although not particularly limited, the circuit elements constituting each functional block of the embodiment are formed on a semiconductor substrate such as single crystal silicon by known integrated circuit technology such as CMOS (complementary metal oxide semiconductor).

[0013] Hereinafter, an embodiment of the present invention will be described in detail with reference to the drawings. In all the drawings for explaining the embodiment, the same members are generally designated by the same reference numerals, and the repeated description will be omitted.

[0014] (Embodiment 1) Overview of Semiconductor Device Fig. 1 is a schematic diagram showing a configuration example of a semiconductor device according to a first embodiment of the present invention. The semiconductor device DEV shown in Fig. 1 is typically a microcontroller, a SoC (System on a chip), or the like. The semiconductor device DEV includes a processor PRC, memories such as a RAM (Random Access Memory) and a non-volatile memory NVM, various peripheral circuits PERI, and a hardware accelerator HWA. These components are connected to each other via a bus BS.

[0015] The processor PRC includes a CPU (Central Processing Unit). The CPU executes programs stored in memory to realize a predetermined function. The hardware accelerator HWA is a circuit that supports the processing of the CPU. The hardware accelerator HWA receives instructions from the CPU via a bus BS, and performs, for example, IIR filter calculations in response to the instructions from the CPU.

[0016] The various peripheral circuits PERI include various elements such as an analog-digital converter, a digital-analog converter, a PWM (Pulse Width Modulation) unit, an external communication interface, etc. The semiconductor device of the first embodiment may be, for example, a field programmable gate array (FPGA) or an application specific integrated circuit (ASIC) in addition to a microcontroller.

[0017] Fig. 2 is a schematic diagram showing a configuration example of the hardware accelerator in Fig. 1. The hardware accelerator HWA shown in Fig. 2 includes an interface IF, a computing unit CAL, a memory MEM, and a control circuit CTL. The interface IF outputs input data Din from the CPU to the computing unit CAL, and outputs output data Dout from the computing unit CAL to the CPU.

[0018] The memory MEM includes, for example, a plurality of registers, etc. The memory MEM uses the plurality of registers, etc. to hold parameter data a and b used in the IIR filter and calculated data D obtained in the calculation process of the IIR filter. Accordingly, the memory MEM also functions as a delay block (DB) included in the IIR filter.

[0019] The arithmetic unit CAL includes a multiplier MUL and an adder ADD. The multiplier MUL performs the function of a multiplication block (MB) included in the IIR filter, and multiplies predetermined data by parameter data a and b from the memory MEM. The adder ADD performs the function of an addition block (AB) included in the IIR filter, and adds a plurality of predetermined data.

[0020] The control circuit CTL receives an instruction CMD from the outside, i.e., the CPU, and controls the interface IF, the arithmetic unit CAL, and the memory MEM. In general, the control circuit CTL receives an instruction CMD from the CPU and causes the arithmetic unit CAL to perform M (M is an integer equal to or greater than 2) calculations using input data Din from the CPU and calculation data D and parameter data a and b held in the memory MEM. As a result, the control circuit CTL causes the arithmetic unit CAL and the memory MEM to function as an IIR filter including a multiplication block, an addition block, and a delay block. The control circuit CTL also causes the arithmetic unit CAL to output output data Dout of the IIR filter to the CPU via the interface IF.

[0021] <<How to implement an IIR filter using a hardware accelerator>> FIG. 3A is a block diagram showing an example of the configuration of an IIR filter realized by the hardware accelerator of FIG. 2, and FIG. 3B is a diagram explaining an example of the operation of the IIR filter of FIG. 3A. The IIR filter shown in FIG. 3A is a second-order biquad IIR filter and has a direct-form (2) transposed configuration. The IIR filter has two delay blocks DB1 and DB2, five multiplication blocks MB1 to MB5, and three addition blocks AB1 to AB3. In FIG. 3A, the left half portion is a feedforward section, and the right half portion is a feedback section.

[0022] The multiplication blocks MB1, MB2, and MB3 generate calculated data D1, D2, and D3 by multiplying the input data Din by parameter data b0, b1, and b2, respectively. The multiplication blocks MB4 and MB5 generate calculated data D4 and D5 by multiplying the output data Dout by parameter data a1 and a2, respectively. The addition block AB3 generates calculated data D7 by adding the calculated data D3 and the calculated data D5. The delay block DB2 generates calculated data (in other words, delayed data) D7' by delaying the calculated data D7 by one sampling period.

[0023] The addition block AB2 generates calculated data D6 by adding the calculated data D2, the calculated data D4, and the calculated data (delayed data) D7'. The delay block DB1 generates calculated data (delayed data) D6' by delaying the calculated data D6 by one sampling period. The addition block AB1 generates output data Dout by adding the calculated data D1 and the calculated data (delayed data) D6'.

[0024] The multiplication blocks MB1 to MB5 are realized by the multiplier MUL in the calculator CAL in Fig. 2. The parameter data b0, b1, b2, a1, and a2 at this time are held in the memory MEM in advance. The addition blocks AB1 to AB3 are realized by the adder ADD in the calculator CAL. The delay blocks DB1 and DB2 are realized by the memory MEM. That is, the memory MEM holds the calculation data D6 and D7 as delay data D6' and D7' for one sampling period.

[0025] In the IIR filter of FIG. 3A, for example, in order to obtain the calculated data D4, the output data Dout is required as a prerequisite, and in order to obtain the output data Dout, the calculated data D1 is required as a prerequisite. Thus, there is a dependency relationship among the respective data. FIG. 3B shows the order of processing based on such a data dependency relationship. The control circuit CTL in FIG. 2 causes the arithmetic unit CAL to perform arithmetic operations M (M = 8 in this example) times in consideration of such a data dependency relationship, so that the arithmetic unit CAL, the memory MEM, etc. function as the IIR filter of FIG. 3A.

[0026] Here, as can be seen from FIG. 3B, the IIR filter of FIG. 3A is configured such that, with K < M, the output data Dout can be determined by K (K = 2 in this example) operations out of M (M = 8) operations. That is, the control circuit CTL may cause the arithmetic unit CAL to execute the operation of the multiplication block MB1 and then execute the operation of the addition block AB1. When performing the operation of the addition block AB1, the arithmetic unit CAL may add the calculated data D1 associated with the multiplication block MB1 and the calculated data (delayed data) D6' held by the memory MEM.

[0027] In the hardware accelerator HWA of Embodiment 1, after receiving the instruction CMD from the CPU, the control circuit CTL causes the arithmetic unit CAL to perform the K (K = 2) operations in advance to determine the output data Dout. Then, at the time when the determination is made, the control circuit CTL causes the arithmetic unit CAL to output the output data Dout to the CPU.

[0028] For example, the hardware accelerator as a comparative example outputs the output data Dout to the CPU when all M (M = 8) operations shown in FIG. 3B are completed. On the other hand, the hardware accelerator HWA of Embodiment 1 can output the output data Dout to the CPU when K (K = 2) operations out of M operations are completed. As a result, it is possible to shorten the time until the output data Dout is obtained.

[0029] The M (M=8) calculations shown in Fig. 3B are divided into output data calculations and delay data calculations. The output data calculations are calculations required to determine the output data Dout, and in the example of Fig. 3B, correspond to the calculation of the calculated data D1 and the calculation of the output data Dout. On the other hand, the delay data calculations are calculations required to determine the data to be stored in the memory MEM carrying the delay blocks DB1 and DB2, that is, the calculated data D6 and D7 corresponding to the delay data D6' and D7'.

[0030] In the example of FIG. 3B, the delay data calculation corresponds to at least the remaining six calculations excluding the output data calculation. However, in order to determine the calculated data D6 and D7 corresponding to the delay data, the output data Dout is also required. Therefore, on the premise that the output data Dout is unknown, the delay data calculation corresponds to a total of eight calculations. In the hardware accelerator HWA of the first embodiment, the control circuit CTL causes the calculator CAL to perform the output data calculation first, and then the delay data calculation.

[0031] FIG. 4A is a block diagram showing an example of the configuration of another IIR filter realized by the hardware accelerator of FIG. 2, and FIG. 4B is a diagram explaining an example of the operation of the IIR filter of FIG. 4A. The IIR filter shown in FIG. 4A is also a second-order biquad IIR filter, and unlike FIG. 3A, has a direct-form (1) transposed configuration. The IIR filter has four delay blocks DB1 to DB4, five multiplication blocks MB1 to MB5, and four addition blocks AB1 to AB4. In FIG. 4A, the left half portion is a feedback section, and the right half portion is a feedforward section.

[0032] The addition block AB1 generates calculated data D1 by adding the input data Din and the calculated data (delayed data) D7'. The multiplication blocks MB1, MB2, and MB3 generate calculated data D2, D3, and D4 by multiplying the calculated data D1 by the parameter data b0, b1, and b2, respectively. The multiplication blocks MB4 and MB5 generate calculated data D5 and D6 by multiplying the calculated data D1 by the parameter data a1 and a2, respectively.

[0033] The delay block DB2 generates calculated data (delayed data) D6' by delaying the calculated data D6 by one sampling period. The delay block DB4 generates calculated data (delayed data) D4' by delaying the calculated data D4 by one sampling period. The addition block AB2 generates calculated data D7 by adding the calculated data D5 and the calculated data (delayed data) D6'. The addition block AB4 generates calculated data D8 by adding the calculated data D3 and the calculated data (delayed data) D4'.

[0034] The delay block DB1 generates the calculated data (delayed data) D7' by delaying the calculated data D7 by one sampling period. The delay block DB3 generates the calculated data (delayed data) D8' by delaying the calculated data D8 by one sampling period. The addition block AB3 generates the output data Dout by adding the calculated data D2 and the calculated data (delayed data) D8'.

[0035] As in the case of Fig. 3A, the multiplication blocks MB1-MB5 in Fig. 4A are realized by multipliers MUL, the addition blocks AB1-AB4 are realized by adders ADD, and the delay blocks DB1-DB4 are realized by memories MEM. Also, Fig. 4B shows a processing order based on data dependency, similar to that in Fig. 3B, for the IIR filter in Fig. 4A. Taking such data dependency into account, the control circuit CTL in Fig. 2 makes the calculator CAL and the memory MEM function as the IIR filter in Fig. 4A by making the calculator CAL perform M (M=9 in this example) operations.

[0036] Here, as can be seen from Fig. 4B, the IIR filter in Fig. 4A is also configured to be able to determine the output data Dout by K (in this example, K=3) calculations out of M (M=9) calculations, as in the case of Fig. 3A. That is, the control circuit CTL may cause the calculator CAL to execute the process of the addition block AB1, then the process of the multiplication block MB1, and thereafter the process of the addition block AB3.

[0037] 3A and 3B, the control circuit CTL in FIG. 2, after receiving a command CMD from the CPU, determines the output data Dout by having the calculator CAL perform the K (K=3) operations in advance. Then, at the time of determining the output data Dout, the control circuit CTL causes the calculator CAL to output the output data Dout to the CPU.

[0038] As a result, the hardware accelerator HWA of the first embodiment can output the output data Dout to the CPU when K (K=3) calculations out of M (M=9) calculations are completed. As a result, it is possible to shorten the time until the output data Dout is obtained. In this case, the configuration example of FIG. 3A can shorten the time by one calculation compared to the configuration example of FIG. 4A. Note that the control circuit CTL causes the arithmetic unit CAL to perform the output data calculation first and then the delay data calculation, as in the cases of FIG. 3A and FIG. 3B.

[0039] Fig. 5 is a block diagram showing an example of an IIR filter configuration different from that of Fig. 3A, and Fig. 6 is a block diagram showing an example of an IIR filter configuration different from that of Fig. 4A. The IIR filter shown in Fig. 5 has a direct type (1) configuration different from the transposed configuration of the direct type (2) shown in Fig. 3A. The IIR filter shown in Fig. 6 has a direct type (2) configuration different from the transposed configuration of the direct type (1) shown in Fig. 4A.

[0040] The position of the delay block is different between the transposed direct type (2) configuration of Fig. 3A and the direct type (1) configuration of Fig. 5. Similarly, the position of the delay block is different between the transposed direct type (1) configuration of Fig. 4A and the direct type (2) configuration of Fig. 6. That is, in Fig. 3A and Fig. 4A, a delay is performed after multiplication and addition, whereas in Fig. 5 and Fig. 6, a multiplication and addition is performed after a delay.

[0041] As shown in Figures 5 and 6, in the case of no transposition configuration, M operations using all multiplication blocks and addition blocks are required to determine the output data Dout, unlike the case of the transposition configuration shown in Figures 3A and 4A. That is, the number K of output data operations is equal to the total number M of operations, and in Figure 5, K = M = 8, and in Figure 6, K = M = 9. For this reason, in the case of no transposition configuration, even if the output data operations are preceded, it may be difficult to shorten the time until the output data Dout is obtained.

[0042] <<Details about hardware accelerator>> Figure 7 is a block diagram showing a practical example of an IIR filter realized by the hardware accelerator of Figure 2. As shown in Figure 7, in practice, an IIR filter is often used as a cascaded multi-stage (here, three-stage) IIR filter. In this example, the first-stage, second-stage, and final-stage IIR filters FLT1, FLT2, and FLT3 each have a transposed configuration of the direct-form (2) shown in Figure 3A.

[0043] The first stage IIR filter FLT1 receives input data Din[1] and outputs output data Dout[1]. The second stage IIR filter FLT2 uses the first stage output data Dout[1] as input data Din[2] and outputs output data Dout[2]. The final stage IIR filter FLT3 uses the second stage output data Dout[2] as input data Din[3] and outputs output data Dout[3]. As a result, the three stages of IIR filters as a whole receive input data Din[1] and output output data Dout[3].

[0044] Fig. 8 is a flow diagram showing an example of the processing contents of the control circuit in the hardware accelerator of Fig. 2. Here, it is assumed that the control circuit CTL makes the arithmetic unit CAL and the memory MEM function as the three-stage IIR filter shown in Fig. 7. In Fig. 8, the control circuit CTL receives a command CMD from the CPU and first sets n=1 (step S101).

[0045] Next, the control circuit CTL causes the calculator CAL to perform an n-th stage output data calculation using input data from the CPU, i.e., the input data Din[1] of the first stage in Fig. 7 (step S102). Next, the control circuit CTL repeatedly executes the processes of steps S102 and S103 while incrementing n (step S103) until n becomes larger than the maximum number of stages N (here, N=3) (step S104).

[0046] As a result, the calculator CAL obtains the output data of the final-stage IIR filter, that is, the output data Dout[3] of Fig. 7. When n becomes greater than N in step S104, the control circuit CTL causes the calculator CAL to output the output data of the final-stage IIR filter to the CPU via the interface IF (step S105).

[0047] After that, the control circuit CTL sets n=1 again (step S106). Then, the control circuit CTL causes the calculator CAL to calculate delay data for the nth stage (step S107). Next, the control circuit CTL increments n (step S108) and repeatedly executes the processes of steps S107 and S108 until n becomes greater than the maximum number of stages N (N=3) (step S109). This determines the delay blocks DB1 and DB2 in the IIR filters FLT1 to FLT3 in FIG. 7, and further the calculated data (delay data) D6' and D7' to be stored in the memory MEM in FIG. 2, completing a series of processes as a three-stage IIR filter.

[0048] Fig. 9 is a diagram showing an example of a detailed calculation procedure by the arithmetic unit in the flow of Fig. 8. Here, it is assumed that the arithmetic unit CAL in Fig. 2 includes one adder ADD that adds two pieces of data and one multiplier MUL that multiplies two pieces of data, and that the adder ADD and the multiplier MUL perform one calculation within one clock period of the processor PRC and can perform calculations in parallel. In this case, for example, addition of three pieces of data (X=A+B+C) is realized by addition in two clock periods (tmp=A+B, X=tmp+C).

[0049] As a general operation of Fig. 9, after the control circuit CTL receives a command CMD from the CPU, it first makes the calculator CAL perform output data calculations in the multiple stages (here, three stages) of IIR filters, from the first stage to the last stage. After that, the control circuit CTL makes the calculator CAL perform delay data calculations in the multiple stages of IIR filters, from the first stage to the last stage. Then, when the control circuit CTL finishes the output data calculation in the last stage IIR filter, it makes the calculator CAL output the output data Dout[3] of the last stage IIR filter to the CPU.

[0050] As a detailed operation of Fig. 9, the calculator CAL first performs output data calculations in two clock cycles for the first stage, and then performs output data calculations in two clock cycles for the second and third stages. In the output data calculations for the first stage, the calculator CAL receives input data Din[1] from the CPU, generates calculated data D1[1] in the first clock cycle, and generates output data Dout[1] in the second clock cycle. Here, "x" in [x] represents the number of stages.

[0051] In the second-stage output data calculation, the calculator CAL receives the output data Dout[1] of the first stage as input data Din[2], and generates the calculated data D1[2] and the output data Dout[2] in the same manner. The same is true for the output data calculation of the third stage.

[0052] After that, the calculator CAL performs the delay data calculation of the first stage in five clock cycles, and then performs the delay data calculation of the second and third stages in five clock cycles each. Here, the control circuit CTL stores the input data Din[1] from the CPU in the memory MEM prior to the output data calculation of the first stage described above. Then, the control circuit CTL causes the calculator CAL to perform the delay data calculations from the first stage to the third stage in order using the stored input data Din[1]. In other words, the calculator CAL restarts the calculation of the multi-stage IIR filter from the beginning.

[0053] In the first stage delay data calculation, the calculator CAL generates the calculated data D1[1], D2[1] in the first and second clock cycles in the five clock cycles, and also generates the output data Dout[1] in the second clock cycle in parallel. The calculator CAL generates the calculated data D3[1], D4[1], D5[1] in the third, fourth, and fifth clock cycles in the third, fourth, and fifth clock cycles, and also divides and generates the calculated data D6[1] in parallel in the third and fifth clock cycles. With regard to the calculated data D6[1], specifically, the calculator CAL adds the calculated data D2[1] and the delayed data D7'[1] in the third clock cycle, and adds the result of this addition to the calculated data D4[1] in the fifth clock cycle.

[0054] The delay data calculation in the second stage is the same as that in the first stage, except for the following two differences. The first difference is that the calculator CAL performs calculation processing using the output data Dout[1] of the first stage as the input data Din[2] of the second stage. The second difference is that the calculator CAL generates the calculated data D7[1] of the first stage in parallel with the generation of the calculated data D1[2] of the second stage in the first clock cycle out of five clock cycles. The delay data calculation in the third stage is the same as that in the second stage.

[0055] Fig. 10 is a diagram showing an example of a calculation procedure different from that of Fig. 9. In Fig. 10, the output data calculations in the first, second, and third stages are the same as those in Fig. 9. However, unlike Fig. 9, in Fig. 10, the control circuit CTL stores the calculated data obtained by the output data calculations in the first to third stages, in this example, the output data Dout[1], Dout[2], and Dout[3], in the memory MEM. Then, the control circuit CTL causes the calculator CAL to perform delay data calculations in the first to third stages in order using the stored calculated data.

[0056] Here, when the first-stage IIR filter FLT1 performs delay data calculation, if the output data Dout[1] is held, the calculator CAL can generate the calculated data D4[1], D5[1], etc. without generating the calculated data D1[1]. The same is true for the second and third stages. Therefore, in the delay data calculations of the first, second, and third stages in Fig. 10, the clock cycle for generating the calculated data D1[1], D1[2], and D1[3] is deleted compared to the case of Fig. 9.

[0057] As a result, the calculator CAL can perform the first-stage delay data calculation in four clock cycles, and then perform the second-stage and third-stage delay data calculations in four clock cycles each. Also, the calculator CAL generates the previous-stage calculation data D7[1], D7[2], which was generated in parallel with the calculation data D1[2], D1[3] in Fig. 9, in the first clock cycle of the four clock cycles. That is, the calculator CAL generates the first-stage calculation data D7[1] in parallel with the calculation data D2[2] in the first clock cycle of the second-stage delay data calculation, and generates the second-stage calculation data D7[2] in parallel with the calculation data D2[3] in the first clock cycle of the third-stage delay data calculation.

[0058] Comparing the method of Fig. 9 with the method of Fig. 10, the method of Fig. 10 is more advantageous in terms of the number of clock cycles required for delay data calculation. However, in the method of Fig. 10, it is necessary to store the output data Dout[1], Dout[2], and Dout[3] for the number of stages of the IIR filter in the memory MEM, so the method of Fig. 9 is more advantageous in terms of circuit size (e.g., the number of registers, etc.). Note that, here, the configuration example of Fig. 3A is used for the IIR filter of each stage, but when using the method of Fig. 10 using the configuration example of Fig. 4A, the control circuit CTL only needs to store the calculated data D1 of each stage obtained by output data calculation in the memory MEM.

[0059] <<Major Effects of the First Embodiment>> As described above, by using the method of the first embodiment, it is possible to shorten the time until output data is obtained from the IIR filter. As a result, in various control systems, it is possible to complete necessary processing within a control period without, for example, increasing the clock frequency of the processor. From another perspective, it is possible to shorten the control period and build a highly accurate control system. These details will be described below.

[0060] Fig. 14 is a flow diagram showing an example of the processing contents of a control circuit in a hardware accelerator in a semiconductor device as a comparative example of the present invention. The flow shown in Fig. 14 is different from the flow shown in Fig. 8 in that, in the processing of each stage, an output data calculation in the nth stage (step S102) is followed by a delay data calculation in the nth stage (step S107). Then, when the output data calculation and the delay data calculation in the final stage are completed (step S104), the output data is output to the CPU (step S105).

[0061] Fig. 11 is a conceptual diagram comparing the process flow of a control system when the flow of the embodiment in Fig. 8 is used and when the flow of the comparative example in Fig. 14 is used. As shown in Fig. 11, in a general control system including an IIR filter, CPU processing periods CPU_P[1], CPU_P[2], CPU_P[3] and waiting periods IIR_W[1], IIR_W[2] for IIR filter calculation are provided in a control period Tc.

[0062] For example, after the CPU executes a predetermined process during the CPU processing period CPU_P[1], it causes the hardware accelerator HWA to perform an IIR filter operation by outputting a command CMD and input data Din. Next, the CPU waits during the waiting period IIR_W[1] for the output data Dout from the hardware accelerator HWA to be obtained. After that, when the output data Dout is obtained, the CPU executes the next process using the output data Dout during the CPU processing period CPU_P[2].

[0063] In the processing of such a control system, in the method of the comparative example, the CPU must wait for the completion of the delay data calculation of the final stage (here, the third stage) to obtain the output data Dout, that is, for the completion of all the output data calculations and delay data calculations in the multiple stages of IIR filters. This increases the waiting periods IIR_W[1] and IIR_W[2], and there is a risk that the required processing time will exceed the control period Tc. In addition, in order to shorten the required processing time, it is necessary to increase the clock frequency of the processor, which may lead to increased costs and power consumption.

[0064] On the other hand, in the method of the embodiment, the CPU only needs to wait for the output data calculation in the multiple-stage IIR filter to be completed in order to obtain the output data Dout. The CPU can execute the next process using the output data Dout obtained by this output data calculation. Furthermore, the CPU can cause the hardware accelerator HWA to perform delay data calculation in the multiple-stage IIR filter in parallel with the next process.

[0065] As a result, by using the method of the embodiment, the waiting periods IIR_W[1] and IIR_W[2] can be shortened compared to the method of the comparative example, and the processing time required within the control period Tc can be shortened by ΔT. Accordingly, it is also possible to shorten the control period Tc.

[0066] (Embodiment 2) <Application example to motor control device> Fig. 12 is a schematic diagram showing a configuration example of the periphery of a motor control device to which a semiconductor device according to a second embodiment of the present invention is applied. Fig. 12 shows a motor control system including a semiconductor device DEV, a pre-driver PDV, an inverter INV, a motor MT, and a position sensor PG. Of these, for example, the semiconductor device DEV, the pre-driver PDV, and the inverter INV are mounted on a wiring board to configure the motor control device. The motor MT is, for example, a three-phase (u-phase, v-phase, w-phase) brushless DC motor or the like, and controls the position of an object to be controlled. The position sensor PG is attached to the motor MT and detects the rotational position of the motor MT.

[0067] The inverter INV includes three-phase high-side switching elements connected between a high-potential power supply and three-phase input terminals of the motor MT, and three-phase low-side switching elements connected between a low-potential power supply and three-phase input terminals of the motor MT. The inverter INV supplies power, specifically three-phase AC power, to the motor MT by switching each switching element. The pre-driver PDV receives a three-phase PWM signal from the semiconductor device DEV, and controls the switching of each switching element in the inverter INV based on the PWM signal.

[0068] As described in the first embodiment, the semiconductor device DEV is configured by, for example, a microcontroller or the like, and includes a position / speed controller PSCT, a current controller ICT, and a PWM unit PWMU. The position / speed controller PSCT and the current controller ICT are realized by, for example, program processing by the processor PRC in Fig. 1, and the PWM unit PWMU is realized by, for example, a hardware unit included in various peripheral circuits PERI in Fig. 1.

[0069] In general, the semiconductor device DEV controls the motor MT via the inverter INV based on the sensing results of the motor MT input at a predetermined control period. The sensing results of the motor MT include the position value detected by the position sensor PG and the three-phase current values ​​of the motor detected by a current sensor (not shown). When the sensing results are analog values, the semiconductor device DEV converts them into digital values ​​using an analog-to-digital converter included in various peripheral circuits PERI, and then outputs them to the position / speed controller PSCT and the current controller ICT.

[0070] The position / speed controller PSCT controls the position and speed of the motor MT based on the detected position value from the position sensor PG. In the position / speed controller PSCT, a position command unit 10 generates a position command value for determining the position of a controlled object based on, for example, a predetermined control sequence. A vibration suppression control unit 11 corrects the position command value from the position command unit 10 to generate a corrected position command value in order to suppress residual vibration of the controlled object that may occur during this positioning. A speed feedforward (abbreviated as FF) calculation unit 12 calculates a speed FF compensation value based on the corrected position command value from the vibration suppression control unit 11.

[0071] The PI (proportional-integral) control & phase compensation unit 13 calculates an operation value for bringing the error closer to zero, i.e., a speed command value, based on the error between the corrected position command value from the vibration suppression control unit 11 and the detected position value from the position sensor PG. At this time, the PI control & phase compensation unit 13 calculates the speed command value after reflecting the speed FF compensation value from the speed FF calculation unit 12. The PI control & phase compensation unit 13 also calculates an operation value for bringing the error closer to zero, i.e., a torque command value, based on the error between the speed command value and the detected speed value from the instantaneous speed observer 17.

[0072] The mechanical resonance suppression filter 14 is, for example, a notch filter for suppressing resonance of the controlled object, and filters the operation value from the PI control & phase compensation unit 13. The torque compensation unit 15 compensates the filtered operation value from the mechanical resonance suppression filter 14, i.e., the torque command value, in accordance with, for example, the magnitude of the load on the motor MT.

[0073] Flux-weakening control unit 16 generates a d-axis current command value and a q-axis current command value based on the torque command value from torque compensation unit 15. Instantaneous speed observer 17 calculates a detected speed value based on the detected position value from position sensor PG and the torque command value from torque compensation unit 15. Specifically, instantaneous speed observer 17 calculates the detected speed value based on, for example, a differential value of the detected position value and an integral value of the torque command value.

[0074] The current controller ICT controls the current, and therefore the torque, of the motor MT based on the detected position value from the position sensor PG, the d-axis current command value and the q-axis current command value from the position-speed controller PSCT, and the three-phase detected current values ​​from the current sensor (not shown). In the current controller ICT, a dq conversion unit 25 converts the three-phase detected current values ​​from the current sensor (not shown) into a d-axis detected current value and a q-axis detected current value based on the detected position value from the position sensor PG.

[0075] The dead time compensator 24 corrects the error between the voltage command and the voltage actually output, which occurs due to the dead time inserted by the PWM unit PWMU, and compensates the voltage command value based on the three-phase detected current values ​​from a current sensor (not shown). The dead time is an interval that must be provided between the on / off time of the high-side switching element and the off / on time of the low-side switching element in each phase of the inverter INV.

[0076] The voltage FF calculation unit 20 calculates a voltage FF compensation value based on a d-axis current command value and a q-axis current command value from the position / speed controller PSCT, specifically, the flux-weakening control unit 16. For example, a voltage error caused by a dead time is compensated for by the voltage FF compensation value. The PI control & phase compensation unit 21 calculates operation values ​​for bringing the error closer to zero, that is, a d-axis voltage command value and a q-axis voltage command value, based on the error between the d-axis current command value and the q-axis current command value from the position / speed controller PSCT and the d-axis current detection value and the q-axis current detection value from the dq transformation unit 25. At this time, the PI control & phase compensation unit 21 calculates the d-axis voltage command value and the q-axis voltage command value after reflecting the voltage FF compensation value from the voltage FF calculation unit 20.

[0077] The dq inverse transform unit 22 converts the d-axis voltage command value and the q-axis voltage command value from the PI control & phase compensation unit 21 into an α-axis voltage command value and a β-axis voltage command value by inverse Park transform using the detected position value from the position sensor PG. The space vector modulation unit 23 modulates the α-axis voltage command value and the β-axis voltage command value from the dq inverse transform unit 22 into a three-phase voltage command value and further a three-phase PWM duty command value based on a specified modulation pattern.

[0078] The PWM unit PWMU generates a three-phase PWM signal reflecting a three-phase PWM duty command value based on the current controller ICT, specifically, a three-phase PWM duty command value from the space vector modulation unit 23. At this time, the PWM unit PWMU inserts a dead time to prevent a short circuit caused by simultaneously turning on the high-side switching element and the low-side switching element. Then, the PWM unit PWMU uses the three-phase PWM signal to control the switching of each switching element in the inverter INV via the pre-driver PDV.

[0079] In such a semiconductor device DEV, for example, biquad IIR filters are mounted in vibration suppression control section 11, mechanical resonance suppression filter 14, torque compensation section 15 and instantaneous speed observer 17 in position / speed controller PSCT. For example, vibration suppression control section 11 is mounted with a cascaded six-stage IIR filter, and mechanical resonance suppression filter 14 is mounted with a cascaded five-stage IIR filter. Moreover, torque compensation section 15 is mounted with a cascaded five-stage IIR filter, and instantaneous speed observer 17 is mounted with a cascaded two-stage IIR filter.

[0080] In the semiconductor device DEV used in such a motor control device, a series of processes consisting of the position / speed controller PSCT, the current controller ICT, and the PWM unit PWMU must be completed within the control period of the motor MT. On the other hand, particularly when high speed and high accuracy control of the motor MT is required, many control blocks equipped with IIR filters may be required as shown in FIG. 12. This increases the processing time of the semiconductor device DEV, and as described in FIG. 11, there is a risk of exceeding the control period Tc. The control period Tc of the motor MT is set to, for example, several tens of μs.

[0081] 11, after the CPU in the semiconductor device DEV finishes the processing of the position command unit 10 during the CPU processing period CPU_P[1], the CPU causes the hardware accelerator HWA to perform the calculation of the IIR filter in the vibration suppression control unit 11 during the waiting period IIR_W[1]. Next, the CPU receives the output data Dout from the hardware accelerator HWA, and executes the processing of the speed FF calculation unit 12 and the PI control & phase compensation unit 13 during the CPU processing period CPU_P[2]. After that, the CPU causes the hardware accelerator HWA to perform the calculation of the IIR filter in the mechanical resonance suppression filter 14 during the waiting period IIR_W[2]. Thereafter, the necessary processing is executed in the same manner.

[0082] Therefore, as described in the first embodiment, by using a method of prioritizing the output data calculation, it becomes possible to shorten the processing time of such a semiconductor device DEV as described in Fig. 11. As a result, it becomes possible to realize high-speed and high-precision motor control. Specifically, for example, it becomes possible to shorten the control cycle and realize many calculation processes of the IIR filter within the control cycle.

[0083] 13A and 13B are conceptual diagrams showing examples of calculation methods in various processing systems. Fig. 13A shows the flow of processing in the batch calculation method. The batch calculation method is, for example, used in non-real-time processing, and is a method in which a certain amount of input data Din is processed in a batch and then output data Dout is generated. For example, there is a case where a certain amount of input data Din is buffered and multiple input data Din are processed at once periodically, such as in audio processing.

[0084] FIG. 13B shows the process flow of the single-shot calculation method. The single-shot calculation method is, for example, used in real-time processing, and is a method in which the calculation process for the first input data Din can be completed before the second input data is input. In the case of the method of FIG. 13A, it is necessary to perform the calculation process for the second input data Din after completing both the output data calculation and the delay data calculation for the first input data Din. For this reason, it is difficult to obtain the effect of prioritizing the output data calculation, and the effect is, for example, that the output data associated with the last calculation process can be obtained earlier.

[0085] On the other hand, in motor control, a single-shot calculation method as shown in Fig. 13B is used. In the case of the method of Fig. 13B, as described above, a great effect can be obtained by prioritizing the output data calculation. The method of the embodiment is not limited to such motor control, and can be applied to a processing system or a control system using the single-shot calculation method to obtain a beneficial effect.

[0086] <<Major Effects of the Second Embodiment>> As described above, by using the method of embodiment 2, it is possible to obtain the same effects as those described in embodiment 1. In addition, it is possible to achieve high speed and high precision motor control.

[0087] The invention made by the present inventor has been specifically described above based on the embodiments, but the present invention is not limited to the above-mentioned embodiments and can be modified in various ways without departing from the gist of the invention. For example, the above-mentioned embodiments have been described in detail to easily explain the present invention, and the present invention is not necessarily limited to those having all of the configurations described. In addition, it is possible to replace a part of the configuration of one embodiment with the configuration of another embodiment, and it is also possible to add the configuration of another embodiment to the configuration of one embodiment. In addition, it is possible to add, delete, or replace a part of the configuration of each embodiment with another configuration. [Explanation of symbols]

[0088] AB Addition Block ADD Adder CAL calculator CMD instruction CTL Control circuit D Calculated Data DB Delay Block DEV Semiconductor device Din Input data Dout Output data FLT IIR Filter HWA Hardware Accelerator INV Inverter MB Multiplication Block MEM Memory MT motor MUL Multiplier PRC Processor

Claims

1. an arithmetic unit including a multiplier and an adder; A memory for storing the calculated data; a control circuit for controlling the arithmetic unit and the memory; A semiconductor device having the control circuit receives an external command and causes the arithmetic unit to perform M (M is an integer equal to or greater than 2) calculations using input data from the outside and the calculation data held in the memory, thereby causing the arithmetic unit and the memory to function as an infinite impulse response (IIR) filter including a multiplication block, an addition block, and a delay block; the IIR filter is a filter capable of determining output data through K (K<M) calculations among the M calculations, the control circuit, after receiving the command from an external device, causes the arithmetic unit to perform the K number of operations in advance to determine the output data, and at the time when the output data is determined, causes the control circuit to output the output data to an external device; The M operations in the IIR filter are divided into an output data operation required to determine the output data and a delay data operation required to determine the calculated data to be stored in the memory that handles the delay block, The control circuit includes: causing the arithmetic unit to perform the output data calculation first and then the delay data calculation; making the arithmetic unit and the memory function as the IIR filter having a plurality of stages connected in cascade, and after receiving the command from the outside, making the arithmetic unit perform the output data calculation in the IIR filter having a first stage to a final stage in order, and then make the arithmetic unit perform the delay data calculation in the IIR filter having a first stage to a final stage in order, and when the output data calculation in the IIR filter having a final stage is completed, outputting the output data of the IIR filter having a final stage to the outside. Semiconductor device.

2. 2. The semiconductor device according to claim 1, The control circuit causes the memory to store the calculated data obtained by the output data calculation from the first stage to the final stage, and causes the calculator to sequentially perform the delay data calculation from the first stage to the final stage using the stored calculated data. Semiconductor device.

3. 2. The semiconductor device according to claim 1, the control circuit causes the memory to hold the input data from the outside, and causes the arithmetic unit to sequentially perform the delay data calculation from the first stage to the final stage using the held input data; Semiconductor device.

4. The semiconductor device according to any one of claims 1 to 3, The IIR filter is a transposed structure. Semiconductor device.

5. The semiconductor device according to any one of claims 1 to 3, Further, the device has a CPU (Central Processing Unit) that outputs the command from an external device and the input data from an external device. Semiconductor device.

6. An inverter that supplies power to the motor; a semiconductor device including a CPU (Central Processing Unit) and a hardware accelerator that supports processing by the CPU, and that controls the motor via the inverter based on a sensing result of the motor input at a predetermined control period; A motor control device having The hardware accelerator includes: an arithmetic unit including a multiplier and an adder; A memory for storing the calculated data; a control circuit for controlling the arithmetic unit and the memory; having the control circuit receives an instruction from the CPU and causes the arithmetic unit to perform M (M is an integer equal to or greater than 2) calculations using input data from the CPU and the calculation data held in the memory, thereby causing the arithmetic unit and the memory to function as an infinite impulse response (IIR) filter including a multiplication block, an addition block, and a delay block; the IIR filter is a filter capable of determining output data through K (K<M) calculations among the M calculations, the control circuit, after receiving an instruction from the CPU, causes the arithmetic unit to perform the K number of operations in advance to determine the output data, and at the time when the output data is determined, causes the control circuit to output the output data to the CPU; The M operations in the IIR filter are divided into an output data operation required to determine the output data and a delay data operation required to determine the calculated data to be stored in the memory that handles the delay block, The control circuit includes: causing the arithmetic unit to perform the output data calculation first and then the delay data calculation; making the arithmetic unit and the memory function as the IIR filter of a plurality of stages connected in cascade, and, after receiving the instruction from the CPU, making the arithmetic unit perform the output data calculation in the IIR filter of the plurality of stages in order from a first stage to a final stage, and then make the arithmetic unit perform the delay data calculation in the IIR filter of the plurality of stages in order from the first stage to the final stage, and when the output data calculation in the IIR filter of the final stage is completed, output the output data of the IIR filter of the final stage to the CPU. Motor control device.

7. 7. The motor control device according to claim 6, The control circuit causes the memory to store the calculated data obtained by the output data calculation from the first stage to the final stage, and causes the calculator to sequentially perform the delay data calculation from the first stage to the final stage using the stored calculated data. Motor control device.

8. 7. The motor control device according to claim 6, the control circuit causes the memory to hold the input data from the outside, and causes the arithmetic unit to sequentially perform the delay data calculation from the first stage to the final stage using the held input data; Motor control device.

9. The motor control device according to any one of claims 6 to 8, The IIR filter is a transposed structure. Motor control device.

Citation Information

Patent Citations

  • Induction motor control equipment

    JP1999206200A

  • Sum-of-product operation circuit

    JP2005149009A

  • Power steering control apparatus and method used for the same

    JP2008155677A

  • microprocessor

    JP2009033371A

  • Efficient implementation of cascaded biquads

    US20160112033A1