Simulation model, simulation system, and simulation method
The simulation model and method address the limitation of existing technologies by incorporating a controller model with AD/DA conversion processes and parameter referencing, allowing for accurate simulation of controller behavior and its source code influences on input/output processing.
Patent Information
- Application Number
- PCT/JP2023/043639
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-03-06
- Filing Date
- 2023-12-06
- Publication Date
- 2024-09-12
AI Technical Summary
Current simulation models, such as those using TargetLink for automatic code generation, fail to accurately simulate the behavior of controllers, particularly in regards to input/output processing influences like digitization due to AD/DA conversion processing.
A simulation model and method that includes a plant model and a controller model, with the controller model comprising source codes for input and output sections, performing AD and DA conversion processes while referencing parameters to accurately simulate the behavior of controllers, including the influence of source code on input/output processing.
Enables the simulation of controller behavior, including the effects of source code on input and output processing, thereby improving the accuracy of controller simulations.
Smart Images

Figure JP2023043639_12092024_PF_FP_ABST
Abstract
Description
Simulation model, simulation system, and simulation method
[0001] The present disclosure relates generally to a simulation model, a simulation system, and a simulation method. More particularly, the present disclosure relates to a simulation model including a plant model and a controller model, a simulation system for creating the simulation model, and a simulation method for the simulation model.
[0002] Patent Document 1 describes an automatic code generation device that uses TargetLink (registered trademark) as a support tool for automatically generating C language source code from a Simulink (registered trademark) model.
[0003] Japanese Patent Application Laid-Open No. 2020-144509
[0004] The automatic code generation device described in Patent Document 1 cannot simulate the behavior of a controller including the influence of source code in input / output processing, such as the influence of digitization through AD conversion processing.
[0005] A simulation model according to one aspect of the present disclosure is a simulation model for simulating the behavior of a controlled object and the behavior of a controller that controls the controlled object. The simulation model includes a plant model and a controller model. The plant model has a function of the controlled object. The controller model is composed of a plurality of source codes and has a function of the controller. The controller model includes at least one of an input unit and an output unit. The input unit includes a first interface unit and a first processing unit. The first interface unit performs AD conversion processing to convert a first analog signal from the plant model into a first digital signal. The first processing unit performs first processing on the first digital signal from the first interface unit based on first parameters. The output unit includes a second processing unit and a second interface unit. The second processing unit performs second processing based on second parameters and outputs a second digital signal after the second processing. The second interface unit performs conversion processing including DA conversion processing to convert the second digital signal from the second processing unit into a second analog signal for the plant model. The first interface unit, in the AD conversion process, refers to the first parameter in the first process of the first processing unit, and executes a process of canceling out the conversion amount due to the first parameter in the first process on the first digital signal so as to obtain a third digital signal corresponding to the first analog signal. The second interface unit, in the DA processing, refers to the second parameter in the second process of the second processing unit, and executes a process of canceling out the change amount due to the second parameter in the second process on the second digital signal so as to obtain a second analog signal corresponding to a fourth digital signal after performing a predetermined process on the third digital signal.
[0006] A simulation system according to one aspect of the present disclosure is a simulation system for creating the simulation model. The simulation system includes an operation unit and a display unit. The operation unit accepts operations for creating the simulation model. The display unit displays the simulation model.
[0007] A simulation method according to one aspect of the present disclosure is a simulation method for a simulation model for simulating the behavior of a controlled object and the behavior of a controller that controls the controlled object. The simulation model includes a plant model and a controller model. The plant model has a function of the controlled object. The controller model is composed of a plurality of source codes and has the function of the controller. The simulation method includes at least one of an input step and an output step. The input step includes a first conversion step and a first processing step. In the first conversion step, a first analog signal from the plant model is converted into a first digital signal. In the first processing step, a first processing is performed on the first digital signal obtained in the first conversion step based on a first parameter. The output step includes a second processing step and a second conversion step. In the second processing step, a second processing is performed based on a second parameter, and a second digital signal obtained after the second processing is performed is output. In the second conversion step, the second digital signal obtained in the second processing step is converted into a second analog signal for the plant model. In the first conversion step, the first parameter in the first processing of the first processing step is referenced, and a process is performed on the first digital signal to cancel out the change due to the first parameter in the first processing step so as to obtain a third digital signal corresponding to the first analog signal. In the second conversion step, the second parameter in the second processing of the second processing step is referenced, and a process is performed on the second digital signal to cancel out the change due to the second parameter in the second processing step so as to obtain a second analog signal corresponding to a fourth digital signal after a predetermined processing is performed on the third digital signal.
[0008] According to a simulation model, a simulation system, and a simulation method according to an aspect of the present disclosure, it is possible to simulate the behavior of a controller, including the influence of source code in at least one of input processing and output processing.
[0009] Fig. 1 is a configuration diagram of a simulation model according to a first embodiment. Fig. 2 is a configuration diagram of a part of a controller model in the simulation model according to the same. Fig. 3 is a configuration diagram of a plant model in the simulation model according to the same. Fig. 4 is a block diagram of a simulation system according to the first embodiment. Fig. 5 is a flowchart showing a simulation method according to the first embodiment. Fig. 6 is a configuration diagram of a simulation model according to a second embodiment. Fig. 7 is a configuration diagram of a simulation model according to a third embodiment.
[0010] A simulation model, a simulation system, and a simulation method according to embodiments 1 to 3 will be described below with reference to the drawings. The figures described in the following embodiments 1 to 3 are schematic diagrams. The configurations described in the following embodiments 1 to 3 are merely examples of the present disclosure. The present disclosure is not limited to the following embodiments 1 to 3, and various modifications are possible depending on the design, etc., as long as the effects of the present disclosure can be achieved.
[0011] First Embodiment A simulation model 1, a simulation system 100, and a simulation method according to a first embodiment will be described with reference to FIGS.
[0012] (1) Overview First, an overview of a simulation model 1 according to the first embodiment will be described with reference to FIG.
[0013] The simulation model 1 according to the first embodiment is a model for simulating, for example, the behavior of a controlled object and the behavior of a controller that controls the controlled object. The controlled object is, for example, a boost chopper circuit 30 (hereinafter also referred to as the "controlled object 30") as shown in FIG. 3. The controller includes, for example, a control circuit that controls the boost chopper circuit 30. As shown in FIG. 1, the simulation model 1 according to the first embodiment includes a controller model 2 and a plant model 3. The controller model 2 is a model for simulating the behavior of the controller and is created using a simulation system 100 (see FIG. 4), which will be described later. The plant model 3 is a model for simulating the behavior of the controlled object (plant) 30 and is created using the simulation system 100. In the first embodiment, the controller model 2 is configured by, for example, source code written in C language. That is, the simulation model 1 according to the first embodiment is a so-called SILS (Software-In-the-Loop Simulation) model.
[0014] As shown in FIG. 1 , the simulation model 1 according to the first embodiment includes a plant model 3 and a controller model 2. The plant model 3 has the function of a controlled object 30. The controller model 2 is composed of a plurality of source codes and has the function of a controller. The controller model 2 includes an input unit 201 and an output unit 202. The input unit 201 includes a first interface unit 21 and a first processing unit 221. The first interface unit 21 performs AD conversion processing to convert a first analog signal Sig1 from the plant model 3 into a first digital signal Sig2. The first processing unit 221 performs first processing on the first digital signal Sig2 from the first interface unit 21. The output unit 202 includes a second processing unit 222 and a second interface unit 23. The second processing unit 222 performs second processing and outputs a second digital signal Sig3 after the second processing. The second interface unit 23 performs DA conversion processing to convert the second digital signal Sig3 from the second processing unit 222 into a second analog signal Sig4 to be sent to the plant model 3. In the AD conversion processing, the first interface unit 21 refers to a first parameter in the first processing of the first processing unit 221, and performs processing to cancel out a change in the first digital signal Sig2 due to the first parameter in the first processing based on the first parameter, so as to obtain a third digital signal Sig5 corresponding to the first analog signal Sig1. In the DA conversion processing, the second interface unit 23 refers to a second parameter in the second processing of the second processing unit 222, and performs processing to cancel out a change in the second digital signal Sig3 due to the second parameter in the second processing based on the second parameter, so as to obtain a second analog signal Sig4 corresponding to a fourth digital signal Sig6 after predetermined processing has been performed on the third digital signal Sig5.
[0015] In the simulation model 1 according to the first embodiment, the controller model 2 includes a first interface unit 21 and a second interface unit 23. The first interface unit 21 performs a process of canceling a first parameter on the first digital signal Sig2 in an AD conversion process so as to obtain a third digital signal Sig5 corresponding to the first analog signal Sig1. The second interface unit 23 performs a process of canceling a second parameter on the second digital signal Sig3 in a DA conversion process so as to obtain a second analog signal Sig4 corresponding to the fourth digital signal Sig6. As a result, the simulation model 1 according to the first embodiment makes it possible to simulate the behavior of a controller, including the influence of source code in both input processing and output processing.
[0016] (2) Details Next, the configuration of the simulation model 1 according to the first embodiment and the configuration of the simulation system 100 will be described with reference to FIGS.
[0017] (2.1) Simulation Model As described above, the simulation model 1 is a model for simulating the behavior of the controlled object 30 and the behavior of the controller that controls the controlled object 30. As shown in FIG. 1 , the simulation model 1 includes a controller model 2 and a plant model 3.
[0018] (2.1.1) Controller Model The controller model 2 is configured with source code written in, for example, C language. As described above, the controller model 2 has the function of a controller that controls the control target 30. As shown in FIG. 1 , the controller model 2 includes a first interface unit 21, an application unit 22, and a second interface unit 23.
[0019] (2.1.1.1) First Interface Unit The first interface unit 21 executes AD conversion processing to convert the first analog signal Sig1 from the plant model 3 into a first digital signal Sig2. In addition, in the AD conversion processing, the first interface unit 21 refers to a first parameter in a first processing by a first processing unit 221 of the application unit 22, which will be described later, and executes processing to cancel out a change in the first digital signal Sig2 due to the first parameter in the first processing, so as to obtain a third digital signal Sig5 corresponding to the first analog signal Sig1.
[0020] In the first embodiment, as shown in FIG. 2 , the first processing unit 221 includes, as first parameters, offset information, gain information, and resolution information for the first processing described below. The offset information includes, for example, an offset value Offset for AD conversion. The gain information includes, for example, a gain value Gain for AD conversion. The resolution information includes, for example, the number of bits of the first digital signal Sig2 obtained by AD conversion. In the example of FIG. 2 , the number of bits of the first digital signal Sig2 is 8 bits.
[0021] 2 , in the AD conversion process, the first interface unit 21 converts the first analog signal Sig1 into a first digital signal Sig2, subtracts an offset value Offset from the first digital signal Sig2, and divides the value after the subtraction by a gain value Gain. Then, the first interface unit 21 outputs the first digital signal Sig2 after the AD conversion process to the application unit 22.
[0022] In the first embodiment, the AD conversion process performed by the first interface unit 21 corresponds to a first conversion step, which will be described later.
[0023] (2.1.1.2) Application Unit As shown in FIG. 1, the application unit 22 includes a first processing unit 221, a second processing unit 222, a register 223 (see FIG. 2), and a third processing unit 224.
[0024] The first processing unit 221 performs a first process on the first digital signal Sig2 from the first interface unit 21. The first process includes converting a digital value x of the first digital signal Sig2 stored in the register 223 into a software internal variable 200. In the first embodiment, the first digital signal Sig2 is composed of multiple (eight in the illustrated example) digital values x. In the first process, the first processing unit 221 multiplies each of the multiple digital values x by a gain value Gain and then adds an offset value Offset. Here, the process of multiplying by the gain value Gain and the process of adding the offset value Offset are calculated as binary numbers. Then, in the first process, the first processing unit 221 converts each digital value x after the multiplication and addition into an internal variable 200. In the first embodiment, the internal variable 200 includes a DC voltage Vbat applied between a pair of input terminals 31 and 32, which will be described later, and an inductor current Iu flowing through the inductor L1 (see FIG. 3 ).
[0025] In the first embodiment, the input unit 201 is configured by the first interface unit 21 and the first processing unit 221. That is, the input unit 201 includes the first interface unit 21 and the first processing unit 221. In the first embodiment, the input unit 201 further includes a register 223 that stores the digital value x of the first digital signal Sig2.
[0026] The second processing unit 222 executes the second processing and outputs the second digital signal Sig3 after the second processing. The second processing includes converting internal variables of the software into digital values of the second digital signal Sig3. In the second processing, the second processing unit 222 converts the internal variables of the software into digital values of the second digital signal Sig3, and then subtracts an offset value from each digital value and divides the digital value by a gain value. The number of bits of the second digital signal Sig3 is, for example, 8 bits. In the first embodiment, the offset value, gain value, and number of bits are each the second parameter. That is, the second processing unit 222 includes offset information (offset value), gain information (gain value), and resolution information (number of bits) as the second parameters in the second processing.
[0027] In the AD conversion process, the register 223 stores (preserves) the multiple (eight) digital values x of the first digital signal Sig2. In the DA conversion process, the register 223 stores (preserves) the multiple (eight) digital values of the second digital signal Sig3.
[0028] The third processing unit 224 generates a fourth digital signal Sig6 by performing a predetermined process on the third digital signal Sig5 input from the first processing unit 221 and outputs the generated fourth digital signal Sig6 to the second processing unit 222. As will be described later, when the plant model 3 is a boost chopper circuit 30, the third digital signal Sig5 corresponds to, for example, the inductor current Iu flowing through the inductor L1 (see FIG. 3 ), and the fourth digital signal Sig6 corresponds to, for example, the drive signal for the switching element Q1 (see FIG. 3 ). That is, the third processing unit 224 generates the fourth digital signal Sig6 corresponding to the drive signal for the switching element Q1 based on the third digital signal Sig5 corresponding to the inductor current Iu. That is, the fourth digital signal Sig6 is a signal obtained after performing a predetermined process on the third digital signal Sig5.
[0029] In the first embodiment, as described above, the controller model 2 is configured with source code written in C. Therefore, the application unit 22 including the first processing unit 221 and the second processing unit 222 is realized in C.
[0030] In the first embodiment, the first processing performed by the first processing unit 221 corresponds to a first processing step described below, and the second processing performed by the second processing unit 222 corresponds to a second processing step described below.
[0031] (2.1.1.3) Second Interface Unit The second interface unit 23 executes a DA conversion process to convert the second digital signal Sig3 from the second processing unit 222 of the application unit 22 into a second analog signal Sig4 to the plant model 3. In addition, in the DA conversion process, the second interface unit 23 refers to the second parameter in the second processing of the second processing unit 222 described above, and executes a process to cancel out the change in the second digital signal Sig3 due to the second parameter in the second processing, so as to obtain the second analog signal Sig4 corresponding to the fourth digital signal Sig6.
[0032] In the first embodiment, in the DA conversion process, the second interface unit 23 multiplies each digital value of the second digital signal Sig3 by a gain value and then adds an offset value to the multiplied and added second digital signal Sig3. The second interface unit 23 then converts the multiplied and added second digital signal Sig3 into a second analog signal Sig4 and outputs the second analog signal Sig4 to the plant model 3.
[0033] In the first embodiment, the output unit 202 is configured by the second interface unit 23 and the second processing unit 222. That is, the output unit 202 includes the second interface unit 23 and the second processing unit 222. In the first embodiment, the controller model 2 includes both the input unit 201 and the output unit 202.
[0034] In the first embodiment, the DA conversion process executed by the second interface unit 23 corresponds to a second conversion step described later.
[0035] (2.1.2) Plant Model The plant model 3 is a model having the function of the controlled object 30. In the first embodiment, as an example, the controlled object 30 is a boost chopper circuit 30 as shown in FIG. 3 . The boost chopper circuit 30 has a switching element Q1, an inductor L1, a capacitor C1, and a plurality of diodes D1 and D2 (two in the illustrated example). The boost chopper circuit 30 also has a pair of input terminals 31 and 32 and a pair of output terminals 33 and 34.
[0036] The switching element Q1 is, for example, an insulated gated bipolar transistor (IGBT) and includes a collector, an emitter, and a gate.
[0037] The collector of the switching element Q1 is connected via an inductor L1 to the positive input terminal 31 of a pair of input terminals 31, 32. The collector of the switching element Q1 is also connected via a diode D1 to the positive output terminal 33 of a pair of output terminals 33, 34. That is, a series circuit of the inductor L1 and the diode D1 is connected between the positive input terminal 31 and the positive output terminal 33.
[0038] The emitter of the switching element Q1 is connected to the negative input terminal 32 and the negative output terminal 34. The emitter of the switching element Q1 is also connected to ground.
[0039] The capacitor C1 is connected between a pair of input terminals 31 and 32.
[0040] As described above, the diode D1 is connected in series with the inductor L1 between the input terminal 31 and the output terminal 33. The anode of the diode D1 is connected to the collector of the switching element Q1 and to the second end of the inductor L1 (the end on the diode D1 side). The cathode of the diode D1 is connected to the output terminal 33. The first end of the inductor L1 (the end opposite to the diode D1) is connected to the input terminal 31.
[0041] The diode D2 is connected in antiparallel to the switching element Q1, with the anode of the diode D2 connected to the emitter of the switching element Q1 and the cathode of the diode D2 connected to the collector of the switching element Q1.
[0042] 3, a DC voltage Vbat is applied between a pair of input terminals 31 and 32, and an inductor current Iu flows through an inductor L1. In the example of FIG. 3, the DC voltage Vbat and the inductor current Iu are included in the internal variables 200.
[0043] (2.2) Simulation System The simulation system 100 according to the first embodiment is a system for creating a simulation model 1. The simulation system 100 is, for example, a personal computer (hereinafter also referred to as "PC 100"). That is, in the first embodiment, the simulation system 100 is configured by one device (PC 100).
[0044] As shown in FIG. 4, the simulation system 100 includes a control unit 11, an operation unit 12, a display unit 13, and a storage unit 14.
[0045] (2.2.1) Control Unit The control unit 11 can be realized, for example, by a computer system (e.g., PC 100) having one or more processors and one or more memories. That is, the control unit 11 functions as the control unit 11 (including the display control unit 111 described below) by having one or more processors execute a program recorded in one or more memories of the computer system. Here, the program is pre-recorded in the memory of the control unit 11, but it may also be provided via a telecommunications line such as the Internet, or may be recorded on a non-transitory recording medium such as a memory card and provided.
[0046] The control unit 11 is electrically connected to each of the operation unit 12, the display unit 13, and the storage unit 14. The control unit 11 acquires an operation signal from the operation unit 12. The control unit 11 (strictly speaking, a display control unit 111 described later) outputs a control signal to the display unit 13, and causes the display unit 13 to display the simulation model 1 created in response to the operation signal from the operation unit 12. The control unit 11 stores the simulation model 1 created in response to the operation signal from the operation unit 12 in the storage unit 14.
[0047] The control unit 11 includes a display control unit 111. The display control unit 111 controls the display unit 13. Specifically, the display control unit 111 outputs a control signal to the display unit 13 and causes the display unit 13 to display the simulation model 1 created in response to an operation signal from the operation unit 12.
[0048] (2.2.2) Operation Unit The operation unit 12 accepts operations for creating the simulation model 1. In the first embodiment, as described above, the simulation system 100 is the PC 100. Therefore, the operation unit 12 includes pointing devices such as a keyboard, a mouse, a touch panel, and a touch pad that are attached to the PC 100. The operation unit 12 converts operation inputs made by the pointing device into operation signals and outputs the operation signals to the control unit 11.
[0049] (2.2.3) Display Unit The display unit 13 displays the simulation model 1 created using the operation unit 12. The display unit 13 is, for example, a liquid crystal display provided in the PC 100. Note that if the simulation system 100 is provided with a touch panel display, the display unit 13 may constitute the touch panel display together with the operation unit 12.
[0050] (2.2.4) Storage Unit The storage unit 14 is configured by a device selected from, for example, a ROM (Read Only Memory), a RAM (Random Access Memory), or an EEPROM (Electrically Erasable Programmable Read Only Memory). The storage unit 14 stores various information. The storage unit 14 stores, for example, the simulation model 1. In the first embodiment, the storage unit 14 stores the simulation model 1 in association with the date and time when the simulation model 1 was created, the name of the creator of the simulation model 1, etc.
[0051] (3) Simulation Method Next, a simulation method according to the first embodiment will be described with reference to FIG.
[0052] The simulation method according to the first embodiment is a simulation method used for the above-described simulation model 1. The simulation model 1 includes a plant model 3 and a controller model 2. The plant model 3 has the function of a controlled object 30. The controller model 2 is composed of a plurality of source codes and has the function of a controller. The simulation method includes at least one of an input step and an output step. The input step includes a first conversion step and a first processing step. In the first conversion step, a first analog signal Sig1 from the plant model 3 is converted into a first digital signal Sig2. In the first processing step, a first process is performed on the first digital signal Sig2 obtained in the first conversion step. The output step includes a second processing step and a second conversion step. In the second processing step, a second process is performed and a second digital signal Sig3 obtained after the second process is output. In the second conversion step, the second digital signal Sig3 obtained in the second processing step is converted into a second analog signal Sig4 to be transmitted to the plant model 3. In the first conversion step, the first parameter in the first processing step is referenced, and processing is performed on the first digital signal Sig2 to cancel out the change due to the first parameter in the first processing step, so as to obtain a third digital signal Sig5 corresponding to the first analog signal Sig1. In the second conversion step, the second parameter in the second processing step is referenced, and processing is performed on the second digital signal Sig3 to cancel out the change due to the second parameter in the second processing step, so as to obtain a second analog signal Sig4 corresponding to the fourth digital signal Sig6 after performing a predetermined processing on the third digital signal Sig5.
[0053] That is, the simulation method according to the first embodiment is a simulation method used for the simulation model 1 according to the first embodiment. In this simulation method, in the first conversion step, a process is performed on the first digital signal Sig2 to cancel out the change due to the first parameter in the first processing step, so as to obtain a third digital signal Sig5 corresponding to the first analog signal Sig1. Furthermore, in the second conversion step, a process is performed on the second digital signal Sig3 to cancel out the change due to the second parameter in the second processing step, so as to obtain a second analog signal Sig4 corresponding to the fourth digital signal Sig6. As a result, the simulation method according to the first embodiment makes it possible to simulate the behavior of a controller, including the influence of source code in at least one of the input processing and the output processing.
[0054] Fig. 5 is a flowchart showing a simulation method executed by the simulation model 1 according to the first embodiment. The simulation method includes steps ST1 to ST4 shown in Fig. 5. The example of Fig. 5 shows the operation of the input unit 201 (first interface unit 21 and first processing unit 221) of the controller model 2 in the simulation method executed by the simulation model 1.
[0055] First, the first interface unit 21 of the controller model 2 acquires the first analog signal Sig1 from the plant model 3 (ST1). The first analog signal Sig1 is, for example, a high-voltage signal.
[0056] Next, the first interface unit 21 converts the first analog signal Sig1 into a first digital signal Sig2 (ST2). In addition, in the AD conversion process, the first interface unit 21 executes a process for canceling the change in the first digital signal Sig2 due to the first parameter in the first process.
[0057] Next, the first interface unit 21 assigns each digital value x of the first digital signal Sig2 to a register variable (ST3). In other words, the first interface unit 21 stores (saves) each digital value x of the first digital signal Sig2 in the register 223.
[0058] Finally, the first processing unit 221 acquires the register variables stored in the register 223, performs the first processing on each register variable, and then converts the register variables into internal variables 200 used in the software (ST4). Here, the first processing unit 221 is usually realized by a C language program implemented in a microcontroller.
[0059] (4) Effects In the simulation model 1 according to the first embodiment, the controller model 2 includes both a first interface unit 21 and a second interface unit 23. The first interface unit 21 performs processing to cancel out a change in the first digital signal Sig2 due to the first parameter in the first processing, so as to obtain a first digital signal Sig2 corresponding to the first analog signal Sig1. The second interface unit 23 performs processing to cancel out a change in the second digital signal Sig3 due to the second parameter in the second processing, so as to obtain a second analog signal Sig4 corresponding to the second digital signal Sig3. As a result, the simulation model 1 according to the first embodiment makes it possible to simulate the behavior of a controller, including the influence of source code in both input processing and output processing.
[0060] In the simulation model 1 according to the first embodiment, the first processing unit 221 includes, as first parameters, offset information, gain information, and resolution information of the first processing, thereby making it possible to obtain a first digital signal Sig2 corresponding to the first analog signal Sig1 from the plant model 3.
[0061] In the simulation model 1 according to the first embodiment, the second processing unit 222 includes, as second parameters, offset information, gain information, and resolution information of the second processing, which enables the second analog signal Sig4 corresponding to the second digital signal Sig3 to be output to the plant model 3.
[0062] Furthermore, according to the simulation model 1 of embodiment 1, the first processing unit 221 executes the first processing, thereby making it possible to convert the digital value x of the first digital signal Sig2 into an internal variable 200 of the software.
[0063] Furthermore, according to the simulation model 1 of the first embodiment, the application section 22 including the first processing section 221 and the second processing section 222 can be configured using source code.
[0064] Furthermore, according to the simulation system 100 of the first embodiment, the simulation model 1 created using the simulation system 100 makes it possible to simulate the behavior of the controller, including the influence of the source code in both the input processing and the output processing.
[0065] (5) Modifications The first embodiment is merely one of various embodiments of the present disclosure. Various modifications of the first embodiment can be made depending on the design, etc., as long as the object of the present disclosure can be achieved. Modifications of the first embodiment are listed below. The modifications described below can be applied in appropriate combinations.
[0066] The execution entity of the simulation system 100 and the simulation method of the present disclosure includes a computer system. The computer system is primarily composed of a processor and memory as hardware. The processor executes a program stored in the memory of the computer system to realize the functions of the execution entity of the simulation system 100 or the simulation method of the present disclosure. The program may be pre-recorded in the memory of the computer system, provided via a telecommunications line, or provided by being recorded on a non-transitory recording medium readable by the computer system, such as a memory card, optical disk, or hard disk drive. The processor of the computer system is composed of one or more electronic circuits including a semiconductor integrated circuit (IC) or a large-scale integrated circuit (LSI). The integrated circuits, such as ICs or LSIs, are referred to by different names depending on the degree of integration, and include integrated circuits called system LSIs, very large-scale integrations (VLSIs), or ultra-large-scale integrations (ULSIs). Furthermore, field-programmable gate arrays (FPGAs), which are programmed after the LSI is manufactured, or logic devices that allow the reconfiguration of internal connections or internal circuit partitions of the LSI, can also be used as processors. The electronic circuits may be integrated into one chip or distributed across multiple chips. The chips may be integrated into one device or distributed across multiple devices. The computer system referred to here includes a microcontroller having one or more processors and one or more memories. Therefore, the microcontroller is also composed of one or more electronic circuits including a semiconductor integrated circuit or a large-scale integrated circuit.
[0067] Furthermore, it is not essential for the simulation system 100 that multiple functions are concentrated in one housing, and the components of the simulation system 100 may be distributed across multiple housings. Furthermore, at least some of the functions of the simulation system 100, for example, some of the functions of the control unit 11, may be realized by the cloud (cloud computing) or the like.
[0068] In the first embodiment, the first processing unit 221 includes, as first parameters, all of the offset information, gain information, and resolution information in the first processing, but it is sufficient to include at least one of them. Also, the second processing unit 222 includes, as second parameters, all of the offset information, gain information, and resolution information in the second processing, but it is sufficient to include at least one of them. However, it is essential that the second parameters include the same information as the first parameters.
[0069] In the first embodiment, the source code constituting the application unit 22 including the first processing unit 221 and the second processing unit 222 is written in C language, but the source code may be written in, for example, C++, C#, a binary language, Java, MATLAB (registered trademark), or Python. That is, the application unit 22 including the first processing unit 221 and the second processing unit 222 may be realized in C language, C++, C#, a binary language, Java, MATLAB (registered trademark), or Python.
[0070] In embodiment 1, the application unit 22 includes a first processing unit 221, a second processing unit 222, and a register 223, but may also include configurations other than the first processing unit 221, the second processing unit 222, and the register 223.
[0071] In the first embodiment, the controlled object 30 is a boost chopper circuit 30, but the controlled object 30 is not limited to the boost chopper circuit 30 and may be, for example, a step-down chopper circuit, a step-up / step-down chopper circuit, or any other circuit. Furthermore, the controlled object is not limited to the above-mentioned circuits and may have any other configuration as long as it is controlled by a controller.
[0072] In the first embodiment, the switching element Q1 is an IGBT. However, the switching element Q1 is not limited to an IGBT and may be, for example, a MOSFET (Metal-Oxide-Semiconductor Field Effect Transistor).
[0073] In the first embodiment, both the first interface unit 21 and the second interface unit 23 are included in the application unit 22, but at least one of the first interface unit 21 and the second interface unit 23 may be included in the plant model 3. Furthermore, at least one of the first interface unit 21 and the second interface unit 23 may be provided in a connection portion between the controller model 2 and the plant model 3.
[0074] In the first embodiment, the second interface unit 23 performs the DA conversion process, but the second interface unit 23 may perform a conversion process other than the DA conversion process. For example, the second interface unit 23 may perform a process of converting a DC current signal or a DC voltage signal into a PWM (Pulse Width Modulation) signal.
[0075] (Embodiment 2) A simulation model 1A according to embodiment 2 will be described with reference to Fig. 6. Regarding the simulation model 1A according to embodiment 2, the same components as those of the simulation model 1 according to embodiment 1 (see Fig. 1) are denoted by the same reference numerals, and the description thereof will be omitted.
[0076] The simulation model 1A according to the second embodiment differs from the simulation model 1 according to the first embodiment in that the input unit 201 including the first interface unit 21 and the first processing unit 221 is omitted.
[0077] As shown in FIG. 6 , the simulation model 1A according to the second embodiment includes a controller model 2A and a plant model 3.
[0078] The controller model 2A has an application unit 22A and a second interface unit 23. The application unit 22A includes a second processing unit 222 and a third processing unit 224. That is, in the simulation model 1A according to the second embodiment, the controller model 2A includes an output unit 202 that is one of the input unit 201 including the first interface unit 21 and the first processing unit 221 and the output unit 202 including the second processing unit 222 and the second interface unit 23 in the controller model 2 of the first embodiment.
[0079] The third processing unit 224 of the application unit 22A outputs the fourth digital signal Sig6 to the second processing unit 222. The second processing unit 222 of the application unit 22A performs the second processing described above on the fourth digital signal Sig6, and outputs the second digital signal Sig3 after the second processing described above has been performed to the second interface unit 23.
[0080] In the DA conversion process, the second interface unit 23 converts the second digital signal Sig3 from the second processing unit 222 of the application unit 22 into a second analog signal Sig4. In addition, in the DA conversion process, the second interface unit 23 references the second parameter in the second processing of the second processing unit 222 and executes a process to cancel out the change in the second digital signal Sig3 due to the second parameter in the second processing described above, so as to obtain the second analog signal Sig4 corresponding to the fourth digital signal Sig6. Then, the second interface unit 23 outputs the second analog signal Sig4 after the above process to the plant model 3.
[0081] The simulation model 1A according to the second embodiment makes it possible to simulate the behavior of the controller, including the influence of the output processing.
[0082] (Embodiment 3) A simulation model 1B according to embodiment 3 will be described with reference to Fig. 7. Regarding the simulation model 1B according to embodiment 3, the same components as those of the simulation model 1 according to embodiment 1 (see Fig. 1) are denoted by the same reference numerals, and the description thereof will be omitted.
[0083] The simulation model 1B according to the third embodiment differs from the simulation model 1 according to the first embodiment in that the output unit 202 including the second processing unit 222 and the second interface unit 23 is omitted.
[0084] As shown in FIG. 7, the simulation model 1B according to the third embodiment includes a controller model 2B and a plant model 3.
[0085] The controller model 2B has a first interface unit 21 and an application unit 22B. The application unit 22B includes a first processing unit 221 and a third processing unit 224. That is, in the simulation model 1B according to the third embodiment, the controller model 2B includes the input unit 201, which is one of the input unit 201 including the first interface unit 21 and the first processing unit 221 and the output unit 202 including the second processing unit 222 and the second interface unit 23 in the controller model 2 of the first embodiment.
[0086] In the AD conversion process, the first interface unit 21 converts the first analog signal Sig1 from the plant model 3 into a first digital signal Sig2. In addition, in the AD conversion process, the first interface unit 21 refers to the first parameter in the first process of the first processing unit 221, and executes a process to cancel out the change in the first digital signal Sig2 due to the first parameter in the first process described above, so as to obtain a third digital signal Sig5 corresponding to the first analog signal Sig1.
[0087] The first processing unit 221 of the application unit 22B performs the above-described first processing on the first digital signal Sig2 from the first interface unit 21. Furthermore, the first processing unit 221 outputs the third digital signal Sig5 obtained after the first processing to the third processing unit 224.
[0088] According to the simulation model 1B of the third embodiment, it is possible to simulate the behavior of the controller including the influence of input processing.
[0089] (Aspects) The present specification discloses the following aspects.
[0090] A simulation model (1; 1A; 1B) according to a first aspect is a simulation model for simulating the behavior of a controlled object (30) and the behavior of a controller that controls the controlled object (30). The simulation model (1; 1A; 1B) includes a plant model (3) and a controller model (2; 2A; 2B). The plant model (3) has the function of the controlled object (30). The controller model (2; 2A; 2B) is composed of a plurality of source codes and has the function of the controller. The controller model (2; 2A; 2B) includes at least one of an input unit (201) and an output unit (202). The input unit (201) includes a first interface unit (21) and a first processing unit (221). The first interface unit (21) performs AD conversion processing to convert a first analog signal (Sig1) from the plant model (3) into a first digital signal (Sig2). The first processing unit (221) performs a first processing on a first digital signal (Sig2) from the first interface unit (21). The output unit (202) includes a second processing unit (222) and a second interface unit (23). The second processing unit (222) performs a second processing and outputs a second digital signal (Sig3) after the second processing. The second interface unit (23) performs a DA conversion process to convert the second digital signal (Sig3) from the second processing unit (222) into a second analog signal (Sig4) to be sent to the plant model (3). In the AD conversion process, the first interface unit (21) refers to a first parameter in the first processing of the first processing unit (221) and performs a process to cancel out a change in the first digital signal (Sig2) due to the first parameter in the first processing so as to obtain a third digital signal (Sig5) corresponding to the first analog signal (Sig1). In the DA conversion process, the second interface unit (23) refers to the second parameter in the second process of the second processing unit (222) and executes a process to cancel out the change in the second digital signal (Sig3) due to the second parameter in the second process, so as to obtain a second analog signal (Sig4) equivalent to the fourth digital signal (Sig6) after performing a predetermined process on the third digital signal (Sig5).
[0091] In this aspect, the controller model (2; 2A; 2B) has at least one of a first interface unit (21) and a second interface unit (23). The first interface unit (21) performs a process of canceling out a change in the first digital signal (Sig2) due to a first parameter in the first process, so as to obtain a third digital signal (Sig5) corresponding to the first analog signal (Sig1) in the AD conversion process. Furthermore, the second interface unit (23) performs a process of canceling out a change in the second digital signal (Sig3) due to a second parameter in the second process, so as to obtain a second analog signal (Sig4) corresponding to the fourth digital signal (Sig6) in the DA conversion process. As a result, according to this aspect, it is possible to simulate the behavior of the controller, including the influence of source code in at least one of the input process and the output process.
[0092] In the simulation model (1; 1A; 1B) relating to the second aspect, in the first aspect, the first processing unit (221) includes at least one of offset information, gain information, and resolution information in the first processing as the first parameter.
[0093] According to this aspect, it is possible to obtain the third digital signal (Sig5) corresponding to the first analog signal (Sig1) from the plant model (3).
[0094] In the simulation model (1; 1A; 1B) relating to the third aspect, in the first or second aspect, the second processing unit (222) includes at least one of offset information, gain information, and resolution information in the second processing as the second parameter.
[0095] According to this aspect, it is possible to output the second analog signal (Sig4) corresponding to the fourth digital signal (Sig6) to the plant model (3).
[0096] In a simulation model (1;1B) according to a fourth aspect, in any one of the first to third aspects, the input unit (201) further includes a register (223) that stores a digital value of the first digital signal (Sig2). The first process includes converting the digital value (x) of the first digital signal (Sig2) stored in the register (223) into an internal variable (200) of the software.
[0097] According to this aspect, the first processing unit (221) executes the first processing, thereby making it possible to convert the digital value (x) of the first digital signal (Sig2) into an internal variable (200) of the software.
[0098] In the simulation model (1; 1A; 1B) according to the fifth aspect, in any one of the first to fourth aspects, the application unit (22; 22A; 22B) including at least one of the first processing unit (221) and the second processing unit (222) is realized in C language, C++, C#, a binary language, Java, MATLAB (registered trademark), or Python.
[0099] According to this aspect, the application section (22; 22A; 22B) can be configured by source code.
[0100] A simulation system (100) according to a sixth aspect is a simulation system (100) for creating a simulation model (1; 1A; 1B) according to any one of the first to fifth aspects. The simulation system (100) includes an operation unit (12) and a display unit (13). The operation unit (12) accepts operations for creating the simulation model (1; 1A; 1B). The display unit (13) displays the simulation model (1; 1A; 1B).
[0101] According to this aspect, the simulation model (1; 1A; 1B) created using the simulation system (100) makes it possible to simulate the behavior of the controller, including the influence of source code in at least one of the input processing and the output processing.
[0102] A simulation method according to a seventh aspect is a simulation method for a simulation model (1; 1A; 1B) for simulating the behavior of a controlled object (30) and the behavior of a controller that controls the controlled object (30). The simulation model (1; 1A; 1B) includes a plant model (3) and a controller model (2; 2A; 2B). The plant model (3) has the function of the controlled object (30). The controller model (2; 2A; 2B) is composed of a plurality of source codes and has the function of the controller. The simulation method includes at least one of an input step and an output step. The input step includes a first conversion step and a first processing step. In the first conversion step, a first analog signal (Sig1) from the plant model (3) is converted into a first digital signal (Sig2). In the first processing step, a first process is performed on the first digital signal (Sig2) obtained in the first conversion step. The output step includes a second processing step and a second conversion step. In the second processing step, a second processing is performed, and a second digital signal (Sig3) obtained after the second processing is output. In the second conversion step, the second digital signal (Sig3) obtained in the second processing step is converted into a second analog signal (Sig4) for the plant model (3). In the first conversion step, a first parameter in the first processing step in the first processing step is referenced, and a process is performed on the first digital signal (Sig2) to cancel out the change due to the first parameter in the first processing step so as to obtain a third digital signal (Sig5) corresponding to the first analog signal (Sig1). In the second conversion step, a second parameter in the second processing step in the second processing step is referenced, and a process is performed on the second digital signal (Sig3) to cancel out the change due to the second parameter in the second processing step so as to obtain a second analog signal (Sig4) corresponding to a fourth digital signal (Sig6) after performing a predetermined process on the third digital signal (Sig5).
[0103] In this aspect, the simulation method includes at least one of a first conversion step and a second conversion step. In the first conversion step, a process of canceling a first parameter is performed on the first digital signal (Sig2) so as to obtain a third digital signal (Sig5) corresponding to the first analog signal (Sig1). In addition, in the second conversion step, a process of canceling a second parameter is performed on the second digital signal (Sig3) so as to obtain a second analog signal (Sig4) corresponding to the fourth digital signal (Sig6). This aspect makes it possible to simulate the behavior of a controller, including the influence of source code in at least one of input processing and output processing.
[0104] The configurations according to the second to fifth aspects are not essential for the simulation model (1; 1A; 1B) and can be omitted as appropriate.
[0105] 1, 1A, 1B Simulation model 2, 2A, 2B Controller model 3 Plant model 12 Operation unit 13 Display unit 21 First interface unit 22, 22A, 22B Application unit 23 Second interface unit 30 Boost chopper circuit (controlled object) 100 Simulation system 200 Internal variable 201 Input unit 202 Output unit 221 First processing unit 222 Second processing unit 223 Register Sig1 First analog signal Sig2 First digital signal Sig3 Second digital signal Sig4 Second analog signal Sig5 Third digital signal Sig6 Fourth digital signal x Digital value
Claims
1. A simulation model for simulating the behavior of a controlled object and the behavior of a controller that controls the controlled object, comprising: a plant model having a function of the controlled object; and a controller model composed of a plurality of source codes and having a function of the controller, wherein the controller model comprises at least one of: an input unit including a first interface unit that performs AD conversion processing to convert a first analog signal from the plant model into a first digital signal, and a first processing unit that performs a first processing on the first digital signal from the first interface unit based on a first parameter; and an output unit including a second processing unit that performs a second processing based on a second parameter and outputs a second digital signal after the second processing has been performed, and a second interface unit that performs conversion processing including a DA conversion processing to convert the second digital signal from the second processing unit into a second analog signal for the plant model, wherein the first interface unit, in the AD conversion processing, refers to the first parameter in the first processing of the first processing unit, and performs a process of canceling out a change in the first digital signal due to the first parameter in the first processing so as to obtain a third digital signal equivalent to the first analog signal, the second interface unit, in the DA conversion process, refers to the second parameter in the second process of the second processing unit, and executes a process for canceling out a change in the second digital signal due to the second parameter in the second process, so as to obtain the second analog signal corresponding to a fourth digital signal after a predetermined process is performed on the third digital signal.
2. The simulation model according to claim 1, wherein the first processing unit includes, as the first parameters, at least one of offset information, gain information and resolution information in the first processing.
3. The simulation model according to claim 1 or 2, wherein the second processing section includes, as the second parameter, at least one of offset information, gain information and resolution information in the second processing.
4. A simulation model according to any one of claims 1 to 3, wherein the input section further includes a register for storing a digital value of the first digital signal, and the first processing includes a process for converting the digital value of the first digital signal stored in the register into an internal variable of software.
5. The simulation model according to any one of claims 1 to 4, wherein an application section including at least one of the first processing section and the second processing section is realized in C language, C++, C#, a binary language, Java, MATLAB (registered trademark), or Python.
6. A simulation system for creating a simulation model according to any one of claims 1 to 5, comprising: an operation unit that accepts operations for creating the simulation model; and a display unit that displays the simulation model.
7. A simulation method for a simulation model for simulating a behavior of a controlled object and a behavior of a controller that controls the controlled object, the simulation model including: a plant model having a function of the controlled object; and a controller model that is composed of a plurality of source codes and has a function of the controller, the simulation model having at least one of the following: an input step including a first conversion step of converting a first analog signal from the plant model into a first digital signal, and a first processing step of executing a first processing on the first digital signal obtained in the first conversion step based on a first parameter; and an output step including a second processing step of executing a second processing based on a second parameter and outputting a second digital signal after executing the second processing, and a second conversion step of converting the second digital signal obtained in the second processing step into a second analog signal for the plant model, the first conversion step referring to the first parameter in the first processing of the first processing step, and executing a process for canceling a change in the first digital signal due to the first parameter in the first processing step so as to obtain a third digital signal equivalent to the first analog signal, a second conversion step of referencing the second parameter in the second processing of the second processing step, and performing a process on the second digital signal to cancel out a change caused by the second parameter in the second processing step so as to obtain the second analog signal corresponding to a fourth digital signal obtained after a predetermined processing is performed on the third digital signal.
Citation Information
Patent Citations
Automatic code generation method and automatic code generating program
JP2020144509A
Simulation method and device of analog-digital converter
CN105989200A
Signal recorder for drive training simulator
JP1987227177A
Prediction analytical system, method, and program for engine performance
JP2007164436A
Method and system for programming closed-loop controllers
JP2013536480A
