A method, system, device and medium for implementing a first order step response

CN122674262APending Publication Date: 2026-09-01MERCER (GUANGDONG) NEW ENERGY TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610672739.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-15
Publication Date
2026-09-01

AI Technical Summary

Technical Problem

方案1和方案2进行浮点型自然对数指数函数运算,需要消耗较大的控制芯片资源

Benefits of technology

[0008]本申请实施例的一阶阶跃响应的实现方法、系统、设备及介质,通过预先计算生成基准时间常数对应的一阶阶跃响应离散化曲线表,当需要获取任意目标时间常数的一阶阶跃响应时,仅需通过比例关系计算得到目标执行时间,再按照目标执行时间的时间间隔逐一查表即可得到目标时间常数对应的一阶阶跃响应曲线,无需进行复杂的指数运算;“乘以1000后化整”的处理则可以使一阶阶跃响应输出为整型,既能够适配不支持浮点运算的定点类型控制芯片,也可以降低浮点类型控制芯片的CPU资源占用,同时仅需存储一份一阶阶跃响应离散化曲线表即可适配不同目标时间常数的需求,不需要为每个时间常数单独存储一阶阶跃响应离散化曲线表,节省了存储资源,能够灵活满足不同场景下一阶阶跃响应的实现需求。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122674262A_ABST
    Figure CN122674262A_ABST
Patent Text Reader

Abstract

This application discloses a method, system, device, and medium for implementing a first-order step response. The method includes: calculating the number of points in a first-order step response discretization curve table based on a reference time constant, discretization time, and the target actual time corresponding to reaching the target output value of the first-order step response; discretizing a reference first-order step function based on the number of points and discretization time, and multiplying the discretized reference first-order step function by 1000 and rounding it to obtain each element of the first-order step response discretization curve table; calculating the target execution time based on the target time constant, reference time constant, and discretization time; and performing a lookup operation on each element of the first-order step response discretization curve table one by one according to the time interval of the target execution time to obtain the first-order step response curve with the target time constant. This application can meet the needs of both fixed-point and floating-point control chips, realize first-order step responses with different time constants, and reduce CPU resource consumption.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of electronics, and in particular to a method, system, device and medium for implementing a first-order step response. Background Technology

[0002] The program simulates the charging process of an RC circuit. The capacitor voltage exhibits a first-order step response, and the capacitor voltage changes with time. rise, It is a time constant. First-order system step responses are frequently encountered in the field of control systems. For example, the first-order step response of the active power output of a grid-connected inverter or energy storage inverter, and the first-order step response of the reactive power output of a grid-connected inverter or energy storage inverter. The TMS32 floating-point type series control chip can use the exponential function of the natural logarithm "e" from the mathematical library function of Scheme 1. "accomplish: Alternatively, the exponential function from the math library in Scheme 2 can be used. "accomplish: Schemes 1 and 2, which perform floating-point natural logarithmic exponential function operations, require significant control chip resources. The TMS32 fixed-point chip does not support floating-point exponential operations, making it impossible to achieve a first-order step response using either Scheme 1 or Scheme 2. Both floating-point and fixed-point chips can obtain the first-order step response using Scheme 3 (table lookup), but a fixed table only yields a first-order step response with a fixed time constant. Obtaining step responses with different time constants is practically impossible using the traditional table lookup method. Summary of the Invention

[0003] This application aims to propose a method, system, device, and medium for implementing a first-order step response, which can meet the needs of both fixed-point and floating-point control chips, realize first-order step responses with different time constants, and reduce CPU resource consumption.

[0004] In a first aspect, embodiments of this application provide a method for implementing a first-order step response, comprising: Obtain the target time constant, the reference first-order step function, the preset reference time constant and discretization time, and the target actual time corresponding to the preset first-order step response output target value; The number of points in the first-order step response discretization curve table is calculated based on the reference time constant, the discretization time, and the target actual time. Based on the number of points in the first-order step response discretization curve table and the discretization time, the reference first-order step function is discretized, and the discretized reference first-order step function is multiplied by 1000 and then rounded to obtain each element of the first-order step response discretization curve table. The target execution time is calculated based on the target time constant, the reference time constant, and the discretized time. A lookup operation is performed on each element of the first-order step response discretization curve table according to the time interval of the target execution time to obtain the first-order step response curve of the target time constant.

[0005] Secondly, embodiments of this application provide a system for implementing a first-order step response, comprising: The data acquisition unit is used to acquire the target time constant, the reference first-order step function, the preset reference time constant and discretization time, and the target actual time corresponding to the preset first-order step response output target value. The point determination unit is used to calculate the number of points in the first-order step response discretization curve table based on the reference time constant, the discretization time, and the target actual time. The element determination unit is used to discretize the reference first-order step function based on the number of points in the first-order step response discretization curve table and the discretization time, and then multiply the discretized reference first-order step function by 1000 and round it to obtain each element of the first-order step response discretization curve table. The target execution time determination unit is used to calculate the target execution time based on the target time constant, the reference time constant, and the discretized time. The target step response curve determination unit is used to perform a lookup operation on each element of the first-order step response discretization curve table according to the time interval of the target execution time, so as to obtain the first-order step response curve of the target time constant.

[0006] Thirdly, embodiments of this application provide an electronic device, the electronic device including a processor and a memory storing computer program instructions; when the processor executes the computer program, it implements the method for implementing a first-order step response as described in the first aspect embodiment above.

[0007] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions for performing the implementation method of the first-order step response as described in the first aspect embodiment above.

[0008] The implementation method, system, device, and medium for the first-order step response in this application embodiment pre-calculates and generates a table of discretized first-order step response curves corresponding to a reference time constant. When it is necessary to obtain the first-order step response for any target time constant, it is only necessary to calculate the target execution time through the proportional relationship, and then look up the table one by one according to the time interval of the target execution time to obtain the first-order step response curve corresponding to the target time constant, without performing complex exponential calculations. The "multiply by 1000 and then round down" processing can make the first-order step response output an integer, which can not only adapt to fixed-point type control chips that do not support floating-point operations, but also reduce the CPU resource occupation of floating-point type control chips. At the same time, only one table of discretized first-order step response curves needs to be stored to adapt to the needs of different target time constants, without the need to store a separate table of discretized first-order step response curves for each time constant, saving storage resources and flexibly meeting the implementation needs of the first-order step response in different scenarios.

[0009] Other features and advantages of this application will be set forth in the following description, and will be apparent in part from the description, or may be learned by practicing this application. Attached Figure Description

[0010] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, in which: Figure 1 This is a flowchart illustrating a method for implementing a first-order step response according to an embodiment of this application. Figure 2 This is an execution flowchart of a method for implementing a first-order step response according to an embodiment of this application. Detailed Implementation

[0011] The embodiments of this application are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain this application, and should not be construed as limiting this application.

[0012] In the description of this application, the use of terms such as "first," "second," etc., is for the purpose of distinguishing technical features only and should not be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated or the order of the technical features indicated.

[0013] In the description of this application, it should be understood that the orientation descriptions, such as up, down, etc., are based on the orientation or positional relationship shown in the accompanying drawings, and are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this application.

[0014] In the description of this application, it should be noted that, unless otherwise explicitly defined, terms such as "setup," "installation," and "connection" should be interpreted broadly, and those skilled in the art can reasonably determine the specific meaning of the above terms in this application in conjunction with the specific content of the technical solution.

[0015] The technical solution of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the embodiments described below are some embodiments of this application, not all embodiments.

[0016] See Figure 1 and Figure 2 , Figure 1 This is a flowchart illustrating a method for implementing a first-order step response according to an embodiment of this application. Figure 2 This is an execution flowchart of a method for implementing a first-order step response according to an embodiment of this application. The method for implementing the first-order step response includes, but is not limited to, steps S100 to S500: Step S100: Obtain the target time constant, the reference first-order step function, the preset reference time constant and discretization time, and the target actual time corresponding to reaching the preset first-order step response output target value; Step S200: Calculate the number of points in the first-order step response discretization curve table based on the reference time constant, discretization time, and target actual time. Step S300: Discretize the reference first-order step function based on the number of points and discretization time of the first-order step response discretization curve table, and multiply the discretized reference first-order step function by 1000 and round it to obtain each element of the first-order step response discretization curve table. Step S400: Calculate the target execution time based on the target time constant, the reference time constant, and the discretized time; Step S500: Perform a lookup operation on each element of the first-order step response discretization curve table according to the time interval of the target execution time to obtain the first-order step response curve with the target time constant.

[0017] In this embodiment, by pre-calculating and generating a table of first-order step response discretization curves corresponding to a reference time constant, when it is necessary to obtain the first-order step response for any target time constant, it is only necessary to calculate the target execution time through the proportional relationship, and then look up the table one by one according to the time interval of the target execution time to obtain the first-order step response curve corresponding to the target time constant, without performing complex exponential calculations. The "multiply by 1000 and then round down" processing can make the first-order step response output an integer, which can not only adapt to fixed-point type control chips that do not support floating-point operations, but also reduce the CPU resource occupation of floating-point type control chips. At the same time, only one table of first-order step response discretization curves needs to be stored to adapt to the needs of different target time constants, without the need to store a separate table of first-order step response discretization curves for each time constant, saving storage resources and flexibly meeting the implementation needs of first-order step response in different scenarios.

[0018] In step S100 above, the target time constant is the time constant corresponding to the first-order step response that needs to be generated this time, which is the time constant corresponding to the first-order step response that the user actually needs.

[0019] The aforementioned first-order step function is the first-order step response characteristic curve, i.e. ,in, The output is a first-order step response. This is the actual time. is the time constant.

[0020] The aforementioned reference time constant is a pre-set reference time constant used to generate a table of first-order step response discretization curves. In this embodiment, it is only necessary to generate a table of first-order step response discretization curves based on this reference time constant. Subsequently, for different target time constants, the corresponding first-order step response curves can be obtained by looking up the table based on this table of first-order step response discretization curves.

[0021] In some implementations, the reference time constant is obtained through the following steps: Retrieve historical usage records of the time constant; The time constant with the highest frequency of use in the historical usage record of the time constant is determined as the baseline time constant.

[0022] The aforementioned reference time constant can be selected from those frequently used in the project to improve the adaptability of the first-order step response discretization curve table and reduce unnecessary computational overhead during table lookup. Of course, in practical applications, the specific value of the reference time constant can be arbitrarily chosen according to the commonly used requirements; this application does not impose any specific limitations on this.

[0023] The discretization time mentioned above is the sampling interval for time-discrete sampling of the reference first-order step function. This parameter can be set according to the required accuracy. The smaller the discretization time, the more points are generated in the first-order step response discretization curve table, and the higher the accuracy of the final first-order step response. Conversely, the accuracy is lower.

[0024] In some implementations, the discretization time is obtained by the following steps: setting the discretization time in response to a user's setting operation.

[0025] The discretization time can be set by the user or automatically adjusted according to the storage resources of the control chip. The more abundant the storage resources, the smaller the discretization time should be to obtain higher output accuracy.

[0026] The aforementioned target actual time is the actual time corresponding to when the first-order step response output reaches the preset target value. In practical applications, when the first-order step response output rises to near the target output value, it can be considered that the response requirement has been met; therefore, a target output value can be preset. This is based on the first-order step response characteristic curve. When the time constant is When, when the actual time Reach 3 At that time, the first-order step response output reaches 95%; when the actual time... Reaching 4 At that time, the first-order step response output reached 98%; when the actual time... Reaching 7 At that time, the first-order step response output reaches 99.9%. This application sets the target value for the first-order step response output to 99.9%; therefore, the target actual time is 7 seconds. .

[0027] In step S200 above, the target actual time is 7. The constraint formula for the number of points in the first-order step response discretization curve table is: ,in, The number of points in the discretized curve table of the first-order step response. As the reference time constant, For discretization time.

[0028] When the target value of the first-order step response output is set to 99.9% in advance, the actual target time corresponds to 7 times the reference time constant. Therefore, the total number of points required can be accurately calculated directly using this formula. This calculation method is simple and direct, and the number of points can be confirmed without complex calculations. It is compatible with the computing power of various control chips and provides a clear quantitative basis for the subsequent generation of the first-order step response discretization curve table. This ensures that the number of points stored in the first-order step response discretization curve table just covers the entire response process from the output 0 to the first-order step response output target value. It will not occupy unnecessary storage resources, nor will it cause the problem of incomplete response process due to insufficient points.

[0029] In step S300 above, the constraint formula for each element of the first-order step response discretization curve table is: ,in, The first discretized curve of the first-order step response is shown in the table. One element, The number of points in the discretized curve table of the first-order step response.

[0030] The above-mentioned discretization of the reference first-order step function based on the number of points and discretization time in the first-order step response discretization curve table refers to discretizing the reference first-order step function according to the discretization time as the time interval. By performing point-by-point sampling, the output value of the reference first-order step function corresponding to each sampling time point is obtained.

[0031] Each output value corresponds to a first-order step response discretization curve table. one of the elements in " .

[0032] The above-mentioned "multiply by 1000 and then round down" process is to ensure that the first-order step response output is an integer, thus satisfying the requirements of both floating-point and fixed-point control chips. Subsequent lookup results, divided by 1000, yield the actual first-order step response output. If a fixed-point control chip that does not support floating-point operations is used, the integer output can be directly retained for subsequent processing without additional conversion.

[0033] After the rounding process is completed, all the resulting elements form a reusable table of first-order step response discretization curves. This information can be pre-stored in the control chip for later table lookup.

[0034] In step S400 above, the constraint formula for the target execution time is: ,in, For the target execution time, The target time constant is As the reference time constant, For discretization time.

[0035] It can be seen that when At that time, target execution time ;when At that time, target execution time ;when At that time, target execution time .

[0036] In this embodiment, the target execution time is directly calculated through proportional relationships. After determining the target execution time, the table of discretized first-order step response curves can be looked up step by step according to the time interval.

[0037] See Figure 2 The above step S500 includes, but is not limited to: If the actual execution time is not an integer multiple of the target execution time, the first-order step response output of the target time constant is: ,in, It equals the integer value of the actual execution time divided by the target execution time; If the actual execution time equals The first-order step response output of the target execution time, which is twice the target time constant, is ; like The first-order step response output of the target time constant is 1000, thus obtaining the first-order step response curve of the target time constant.

[0038] Figure 2 middle, That is, the first discretization curve of the first-order step response. Each element.

[0039] Understandably, the reference time constant is... First-order step response curve The output at time t is If the target time constant Then the target time constant " The first-order step response curve of "" is in Output at time , equal to the reference time constant First-order step response curve Output at time If the target time constant T1 / 2, then the target time constant " The first-order step response curve of "" is in Output at time , equal to the reference time constant First-order step response curve Output at time .

[0040] Therefore, for first-order step response curves with different target time constants, the actual time corresponding to the same output value is proportional to the time constant. Based on the pre-stored table of discretized first-order step response curves corresponding to the reference time constant, it is only necessary to adjust the time interval of the table lookup according to the ratio of the target time constant to the reference time constant to directly obtain the first-order step response curve corresponding to the target time constant.

[0041] In this embodiment of the application, when the sequence number corresponding to the actual execution time accumulated by the table lookup exceeds the total number of points in the first-order step response discretization curve table ( When the actual time is [a certain value], the first-order step response output is 1000, corresponding to an actual output close to 100% of the preset target value. According to the aforementioned description, when the actual time [is different]... Reaching 7 The first-order step response output reaches 99.9%, therefore it can be approximately considered that... At that moment, the first-order step response output reaches 100%.

[0042] Points ,when At that time, actual time You can get At this point, the first-order step response output is greater than 99.9%, which is approximately considered to be 100%.

[0043] The implementation method for a first-order step response provided in this application can be executed by a system that implements a first-order step response. This application uses the execution of the first-order step response implementation method by the system that implements the first-order step response as an example to illustrate the system that implements the first-order step response provided in this application.

[0044] The first-order step response implementation system of this application includes a data acquisition unit, a point determination unit, an element determination unit, a target execution time determination unit, and a target step response curve determination unit.

[0045] The data acquisition unit is used to acquire the target time constant, the reference first-order step function, the preset reference time constant and discretization time, and the target actual time corresponding to the preset first-order step response output target value. The point count determination unit is used to calculate the number of points in the first-order step response discretization curve table based on the reference time constant, discretization time, and target actual time. The element determination unit is used to discretize the reference first-order step function based on the number of points and discretization time of the first-order step response discretization curve table, and then multiply the discretized reference first-order step function by 1000 and round it to obtain each element of the first-order step response discretization curve table. The target execution time determination unit is used to calculate the target execution time based on the target time constant, the reference time constant, and the discretized time. The target step response curve determination unit is used to perform a lookup operation on each element of the first-order step response discretization curve table according to the time interval of the target execution time, so as to obtain the first-order step response curve of the target time constant.

[0046] Since the implementation system for the first-order step response in this application adopts all the technical solutions of the implementation method for the first-order step response and can achieve the same technical effect, it will not be described again here to avoid repetition.

[0047] The system implementing the first-order step response in this application embodiment can be an electronic device or a component within an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices besides a terminal. For example, the electronic device can be a mobile phone, tablet computer, laptop computer, PDA, in-vehicle electronic device, mobile internet device (MID), augmented reality (AR) / virtual reality (VR) device, robot, wearable device, ultra-mobile perSonal computer (UMPC), netbook, or perSonal digital assistant (PDA), etc. It can also be a server, network attached storage (NAS), perSonal computer (PC), television, ATM, or self-service machine, etc. This application embodiment does not specifically limit the scope of the electronic device.

[0048] This application also provides an electronic device, including a processor and a memory. The memory stores a program or instructions that can run on the processor. When the program or instructions are executed by the processor, they implement the various steps of the above-described method for implementing the first-order step response and achieve the same technical effect. To avoid repetition, they will not be described again here.

[0049] This application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above-described implementation method of the first-order step response and achieve the same technical effect. To avoid repetition, they will not be described again here.

[0050] It should be clarified that this application is not limited to the specific configurations and processes described above. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and illustrated as examples. However, the method process of this application is not limited to the specific steps described and illustrated. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of this application.

[0051] The functional blocks described above can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this application are programs or code segments used to perform the required tasks. The programs or code segments can be stored on a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried on a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio frequency (RF) links, etc. Code segments can be downloaded via computer networks such as the Internet, intranets, etc.

[0052] It should also be noted that the exemplary embodiments mentioned in this application describe methods or systems based on a series of steps or apparatus. However, this application is not limited to the order of the above steps; that is, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.

[0053] The above are merely specific embodiments of this application. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. It should be understood that the protection scope of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the protection scope of this application.

Claims

1. A method for implementing a first-order step response, characterized in that, include: Obtain the target time constant, the reference first-order step function, the preset reference time constant and discretization time, and the target actual time corresponding to the preset first-order step response output target value; The number of points in the first-order step response discretization curve table is calculated based on the reference time constant, the discretization time, and the target actual time. Based on the number of points in the first-order step response discretization curve table and the discretization time, the reference first-order step function is discretized, and the discretized reference first-order step function is multiplied by 1000 and then rounded to obtain each element of the first-order step response discretization curve table. The target execution time is calculated based on the target time constant, the reference time constant, and the discretized time. A lookup operation is performed on each element of the first-order step response discretization curve table according to the time interval of the target execution time to obtain the first-order step response curve of the target time constant.

2. The method for realizing a first-order step response according to claim 1, characterized in that, The target actual time is seven times the time constant; the constraint formula for the number of points in the first-order step response discretization curve table is: ; in, The number of points in the discretized curve table of the first-order step response. The reference time constant is... The discretization time is denoted as .

3. The method for realizing a first-order step response according to claim 1, characterized in that, The constraint formula for each element of the first-order step response discretization curve table is as follows: ; in, The first-order step response discretization curve table is the first... One element, The number of points in the discretized curve table of the first-order step response is given.

4. The method for realizing a first-order step response according to claim 1, characterized in that, The constraint formula for the target execution time is: ; in, The target execution time, The target time constant is... The reference time constant is... The discretization time is denoted as .

5. The method for realizing a first-order step response according to claim 3, characterized in that, The step of performing a lookup operation on each element of the first-order step response discretization curve table at time intervals according to the target execution time to obtain the first-order step response curve with the target time constant includes: If the actual execution time is not an integer multiple of the target execution time, the first-order step response output of the target time constant is: ,in, It is equal to the integer value obtained by dividing the actual execution time by the target execution time; If the actual execution time equals The first-order step response output of the target time constant is [time factor] times the target execution time. ; like The first-order step response output of the target time constant is 1000, thus obtaining the first-order step response curve of the target time constant.

6. The method for realizing a first-order step response according to claim 1, characterized in that, The reference time constant is obtained through the following steps: Retrieve historical usage records of the time constant; The time constant with the highest frequency of use in the historical usage record of the time constant is determined as the reference time constant.

7. The method for realizing a first-order step response according to claim 1, characterized in that, The discretization time is obtained through the following steps: In response to the user's setting operation, the discretization time is set.

8. A system for implementing a first-order step response, characterized in that, include: The data acquisition unit is used to acquire the target time constant, the reference first-order step function, the preset reference time constant and discretization time, and the target actual time corresponding to the preset first-order step response output target value. The point determination unit is used to calculate the number of points in the first-order step response discretization curve table based on the reference time constant, the discretization time, and the target actual time. The element determination unit is used to discretize the reference first-order step function based on the number of points in the first-order step response discretization curve table and the discretization time, and then multiply the discretized reference first-order step function by 1000 and round it to obtain each element of the first-order step response discretization curve table. The target execution time determination unit is used to calculate the target execution time based on the target time constant, the reference time constant, and the discretized time. The target step response curve determination unit is used to perform a lookup operation on each element of the first-order step response discretization curve table according to the time interval of the target execution time, so as to obtain the first-order step response curve of the target time constant.

9. An electronic device, characterized in that, The electronic device includes a processor and a memory storing computer program instructions; when the processor executes the computer program, it implements the method for implementing a first-order step response as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions for causing a computer to perform the method for implementing a first-order step response as described in any one of claims 1 to 7.