A simulation experiment teaching system of dalin algorithm based on proteus
By building the Dalin algorithm simulation experiment teaching system within the Proteus platform, operational amplifiers and Laplace delay operators are used to simulate inertial and pure time delay elements. Parameter adjustment is achieved by combining self-locking buttons and potentiometers. A real microcontroller model is introduced, which solves the problems of complexity and high cost in teaching control experiments for inertial time delay systems, and realizes flexible simulation and efficient simulation experiment teaching.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- YANGZHOU UNIV
- Filing Date
- 2026-04-24
- Publication Date
- 2026-06-09
AI Technical Summary
In the existing technology, experimental teaching of inertial lag system control is complicated by the cumbersome construction of physical devices, long parameter adjustment cycle, high cost, difficult equipment maintenance, and inability to meet the needs of large-scale student group experiments. Moreover, the existing simulation system lacks a dedicated simulation platform for the Dalin algorithm for first-order/second-order inertial plus pure lag elements, resulting in high system complexity, ignoring the real characteristics of hardware circuits and devices, and failing to effectively simulate lag time and inertial time constant.
A simulation experiment teaching system for the Daling algorithm was built within the Proteus platform. This system includes a pulse signal generator, a deviation calculation unit, an ADC conversion unit, a controller unit, a DAC conversion unit, a controlled object unit, and a virtual oscilloscope. The system uses the peripheral circuit of the operational amplifier and the Laplace delay operator element to simulate the inertial plus pure time delay element. The parameters are adjusted by combining self-locking buttons and potentiometers. A real microcontroller model is introduced, and the built-in control program drives the timer and interrupt service to execute the recursive control formula of the Daling algorithm and eliminate the ringing phenomenon.
It enables flexible simulation of first- and second-order inertial and pure time-delay components within a single Proteus platform, reducing system deployment threshold and equipment costs, providing independent practice conditions, improving the efficiency of closed-loop control signal flow analysis, bridging the gap between simulation and hardware implementation, promoting the transition from algorithm theory to hardware implementation, and is highly adaptable, suitable for engineering education and low-level control algorithm development.
Smart Images

Figure CN122176998A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer control technology simulation teaching technology, and in particular to a simulation experiment teaching system based on the Dalin algorithm of Proteus. Background Technology
[0002] In the field of industrial process control, first- or second-order inertial systems with pure time delay are typical mathematical models for controlled objects such as temperature, pressure, and liquid level. The Dahlin algorithm is a classic control algorithm specifically designed for pure time delay systems.
[0003] Traditional experimental teaching of inertial lag system control relies on physical controlled objects, controller hardware, and detection instruments, which has the following problems: First, the construction of physical inertial lag devices is cumbersome, the parameter adjustment cycle is long, and it is difficult to accurately simulate working conditions with different lag times and inertial time constants; second, the experimental cost is high, the equipment maintenance is difficult, and it cannot meet the needs of large-scale student group experiments; third, existing simulation systems based on Proteus mostly focus on motor control, lacking a dedicated simulation teaching platform for the DaLin algorithm for first-order / second-order inertial plus pure lag elements, and often require a host computer to complete data display, which increases the system complexity and is not conducive to students focusing on learning the algorithm itself.
[0004] Proteus software enables integrated operation of microcontroller hardware circuit design, programming, and system simulation, allowing for control system verification without additional hardware. Building a simulation teaching system for the DaLin algorithm, which utilizes this platform for inertial and pure time-delay systems, effectively addresses the shortcomings of traditional experiments.
[0005] Furthermore, existing experimental platforms for the Dalin algorithm, using Matlab / Simulink software and combining Simulink modules and the m-language, can help students better grasp the characteristics and implementation methods of the Dalin algorithm. However, this method focuses on the algorithm itself, neglecting the implementation platform, lacking simulation of the real characteristics of hardware circuits, devices, and interfaces, and ignoring the computing power, timing, and resource limitations of the main control chip, resulting in significant deviations from actual hardware operation. Proteus, with its built-in accurate microcontroller, peripheral device, and interface circuit models, can completely reproduce all the physical constraints and non-ideal characteristics of the Dalin algorithm running in a real microcontroller hardware system, bridging the gap between Simulink and physical hardware, and effectively facilitating the transition from algorithm theory to hardware implementation. Summary of the Invention
[0006] To address the shortcomings of existing technologies, this invention provides a simulation experiment teaching system based on the Proteus-based DaLin algorithm.
[0007] The objective of this invention is achieved as follows: a Dalin algorithm simulation experiment teaching system based on Proteus, in which the circuit and program are built and run in a single Proteus simulation environment, including a pulse signal generator, a deviation calculation unit, an ADC conversion unit, a controller unit, a DAC conversion unit, a controlled object unit, and a virtual oscilloscope;
[0008] A pulse signal generator is used to generate and input a desired given signal into the system;
[0009] The deviation calculation unit is used to receive the given signal and the actual response signal output by the controlled object, and to perform an inverse summation operation between the given signal and the actual response signal to obtain the deviation signal.
[0010] The input of the ADC conversion unit is connected to the deviation calculation unit, which is used to convert the acquired deviation signal into a digital deviation quantity;
[0011] The controller unit uses a microcontroller as its core processor to receive the digital deviation output from the ADC conversion unit, and calculates and outputs the digital control quantity based on the built-in Dalin algorithm control program.
[0012] The input of the DAC conversion unit is connected to the controller unit to receive digital control signals and convert them into analog control signals for output.
[0013] The controlled object unit receives analog control signals, the circuit simulates a first-order inertial element with pure time delay or a second-order inertial element with pure time delay, and outputs the actual response signal to form a closed-loop feedback.
[0014] The virtual oscilloscope is simultaneously connected to the given signal generation terminal, the DAC conversion unit output terminal, and the controlled object output terminal to observe and record the system's dynamic response curve in real time.
[0015] Preferably, the circuit of the controlled object unit is composed of an operational amplifier peripheral circuit and a Laplace delay operator element connected in series; when simulating a first-order inertial element with pure time delay, it is implemented by an operational amplifier circuit configured as an inverting proportional amplifier, an operational amplifier circuit configured as an inertial element, and a Laplace delay operator element connected in series; when simulating a second-order inertial element with pure time delay, it is implemented by two-stage inertial element operational amplifier circuits connected in series and a Laplace delay operator element connected in series.
[0016] Preferably, the controlled object unit has a self-locking button connected to the resistor branch at the inverting input terminal of the operational amplifier and the capacitor and resistor branch at the feedback terminal. Different combinations of resistance and capacitance values can be selected by turning the self-locking button on or off; or a potentiometer can be used as the resistor at the inverting input terminal and the feedback terminal. The system resistance and capacitance values can be changed by adjusting the self-locking button and the potentiometer to dynamically configure the inertial time constant and gain of the first-order or second-order inertial element; the Laplace delay operator element can have its delay time set through the element attribute editing pop-up window to achieve pure time delay configuration.
[0017] Preferably, the connection and signal processing path between the deviation calculation unit and the ADC conversion unit is as follows: the rectangular wave given signal generated by the pulse signal generator is first inverted by the first-stage operational amplifier, and then fed into the second-stage operational amplifier with the output signal of the controlled object unit for inversion and summation to obtain the analog deviation signal between the output and the given value; the analog deviation signal is connected to the analog input pin of the ADC conversion unit composed of the ADC0808 chip for analog-to-digital conversion.
[0018] Preferably, the control program running within the controller unit is written in C51 language and includes a main program, a timer interrupt service routine, and an external interrupt service routine. The main program is used to perform system initialization, including the initialization settings of the timer and external interrupt triggering mode, setting the initial values of the deviation and control quantity to zero, and initializing the sampling period variable. The timer interrupt service routine is used to trigger periodically according to a preset time and start the A / D conversion of the ADC conversion unit. The external interrupt service routine, as a sampling interrupt routine, is used to be triggered after each A / D conversion to perform the acquisition of the deviation signal, the calculation of the Dalin algorithm control formula, and the limiting output of the control quantity.
[0019] Preferably, the execution timing logic of the control program is as follows: the timing period of the timer is set to 10ms, and an A / D conversion is started every 10ms; after the ADC0808 conversion is completed, the EOC pin generates a rising edge, which is inverted into a falling edge by a hardware inverter to trigger the microcontroller's external interrupt 1 to enter the sampling interrupt service routine; in the interrupt service routine, the sampling period variable is decremented by 10ms, and when it is reduced to 0, it is determined that the set control system sampling period time has been reached. At this time, the Dalin algorithm control formula is called and executed once to update the output control quantity, and the initial value of the sampling period variable is reassigned to start the next sampling period loop.
[0020] Preferably, the derivation and design steps of the recursive control formula in the Dalin algorithm control program of the controller unit include:
[0021] S1. Determine the control sampling period The pure time delay set by the controlled object With sampling period Satisfying integer multiples Relationship, that is And set the closed-loop system time constant;
[0022] S2. Based on the parameters of the configured circuit, obtain the transfer function of the controlled object in the continuous domain, and discretize it to obtain the control object's... transfer function ;
[0023] S3. Determine the desired closed-loop transfer function in the continuous domain. The corresponding closed-loop pulse transfer function is obtained by using the pulse transfer function approximation method. .
[0024] Preferably, the derivation and design steps of the recursive control formula of the Dalin algorithm control program further include:
[0025] S4, Based on Formula Through the controlled object The digital controller is derived by inversely using the transfer function and the closed-loop pulse transfer function. transfer function ;
[0026] S5. The digital controller transfer function Expanding on this, the recursive formula for calculating control quantities for microcontroller code execution is derived using inverse Z-transform. .
[0027] Preferably, the Dalin algorithm control program further includes an algorithm optimization step to eliminate the ringing phenomenon of the output control quantity: after obtaining the digital controller transfer function Then, find the pole factor in the denominator that causes the control quantity to oscillate at a high frequency with alternating decay at half the sampling frequency; let the pole factor... This converts the pole factor into a constant, reconstructs the recursive control formula after ringing elimination, and burns it into the microcontroller to eliminate the high-frequency oscillation of the controller output without affecting the steady-state value of the output.
[0028] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0029] This invention utilizes the peripheral circuitry of an operational amplifier in conjunction with a Laplace delay operator element within a single Proteus platform to reconstruct a controlled object model with highly adjustable parameters. By introducing a self-locking button and a potentiometer array, it is possible to dynamically and flexibly switch between first-order and second-order inertial and pure time delay elements, as well as continuously adjust the gain and time constant, without changing the physical connections, thus breaking the limitations of traditional physical condition simulation.
[0030] This invention introduces a real microcontroller model as the control center, and in conjunction with analog-to-digital and digital-to-analog conversion units, constructs a closed-loop architecture with real timing logic and hardware resource constraints. By driving timers and interrupt services through built-in control programs, it accurately executes the recursive control formula of the Dalin algorithm and the optimization steps to eliminate ringing, thereby transforming a simple mathematical algorithm into an engineering practice adapted to the characteristics of a microcontroller, bridging the gap between pure algorithm simulation and physical hardware.
[0031] This invention eliminates redundant external monitoring software and physical display modules, and uses a virtual oscilloscope to simultaneously observe the given signal, control output and actual system response; it facilitates a fundamental shift from complex systems that rely on multiple peripherals to a single immersive environment, allowing operators to focus entirely on the analysis of the closed-loop control data flow and the dynamic characteristics of the Dalin algorithm itself.
[0032] This invention presents a unified simulation experiment technology solution that highly integrates the underlying hardware interface, the simulated object circuit, and the microcontroller digital algorithm. By integrating pulse signal generation, deviation calculation, A / D and D / A conversion, adjustable parameter controlled circuits, and microcontroller operation logic, and using a virtual oscilloscope as a unified observation window, a complete hardware-based closed-loop link for the algorithm is successfully constructed. This eliminates the dependence on physical hardware and host computers, reduces the deployment threshold and equipment costs of the system, and provides learners with independent practice conditions without location restrictions. The intuitive and transparent oscilloscope observation mechanism improves the analytical efficiency of the closed-loop control signal flow. By flexibly simulating diverse controlled operating conditions and even abnormal delay states in industrial sites, it provides a direct and safe verification environment for exploring the parameter tuning and ringing elimination of the Dalin algorithm, demonstrating excellent adaptability and application value in engineering education and the development of underlying control algorithms. Attached Figure Description
[0033] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0034] Figure 1 This is the simulation circuit diagram of the DaLin algorithm based on Proteus in this invention.
[0035] Figure 2 The circuit diagram of the controlled object of the first-order / second-order inertial plus pure time delay element of the present invention is shown.
[0036] Figure 3 This is a flowchart of the sampling interruption service routine of the present invention.
[0037] Figure 4 This is a schematic diagram of the response curve of the second-order inertial plus pure time delay element of the present invention with ringing.
[0038] Figure 5 This is a schematic diagram of the response curve after eliminating ringing in the second-order inertial plus pure hysteresis element of the present invention. Detailed Implementation
[0039] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0040] Please see Figures 1 to 5 The present invention provides a technical solution: a Dalin algorithm simulation experiment teaching system based on Proteus, wherein the circuit and program are built and run in a single Proteus simulation environment, including a pulse signal generator, a deviation calculation unit, an ADC conversion unit, a controller unit, a DAC conversion unit, a controlled object unit, and a virtual oscilloscope;
[0041] A pulse signal generator is used to generate and input a desired given signal into the system;
[0042] The deviation calculation unit is used to receive the given signal and the actual response signal output by the controlled object, and to perform an inverse summation operation between the given signal and the actual response signal to obtain the deviation signal.
[0043] The input of the ADC conversion unit is connected to the deviation calculation unit, which is used to convert the acquired deviation signal into a digital deviation quantity;
[0044] The controller unit uses a microcontroller as its core processor to receive the digital deviation output from the ADC conversion unit, and calculates and outputs the digital control quantity based on the built-in Dalin algorithm control program.
[0045] The input of the DAC conversion unit is connected to the controller unit to receive digital control signals and convert them into analog control signals for output.
[0046] The controlled object unit receives analog control signals, the circuit simulates a first-order inertial element with pure time delay or a second-order inertial element with pure time delay, and outputs the actual response signal to form a closed-loop feedback.
[0047] The virtual oscilloscope is simultaneously connected to the given signal generation terminal, the DAC conversion unit output terminal, and the controlled object output terminal to observe and record the system's dynamic response curve in real time.
[0048] In this embodiment, preferably, the circuit of the controlled object unit is composed of an operational amplifier peripheral circuit and a Laplace delay operator element connected in series; when simulating a first-order inertial element with pure time delay, it is implemented by an operational amplifier circuit configured as an inverting proportional amplifier, an operational amplifier circuit configured as an inertial element, and a Laplace delay operator element connected in series; when simulating a second-order inertial element with pure time delay, it is implemented by two-stage inertial element operational amplifier circuits connected in series and a Laplace delay operator element connected in series.
[0049] It should be noted that by transforming the purely theoretical first-order or second-order inertial mathematical model into a real operational amplifier physical circuit and cleverly connecting the Laplace delay operator in series, the deficiency of pure software simulation in lacking hardware electrical characteristics is effectively compensated; thus establishing an intuitive mapping relationship between the theoretical transfer function and the underlying hardware circuit.
[0050] In this embodiment, preferably, the controlled object unit has a self-locking button connected to the resistor branch at the inverting input terminal of the operational amplifier and the capacitor and resistor branch at the feedback terminal. Different combinations of resistance and capacitance values can be selected by turning the self-locking button on or off; or a potentiometer can be used as the resistor at the inverting input terminal and the feedback terminal. The system resistance and capacitance values can be changed by adjusting the self-locking button and the potentiometer to dynamically configure the inertial time constant and gain of the first-order or second-order inertial element; the Laplace delay operator element can set the delay time through the element attribute pop-up window to achieve the configuration of pure time delay.
[0051] It should be noted that learners do not need to rewire or change the core circuit. They can dynamically and continuously change the system's inertial time constant, gain, and freely set the pure time delay by simply switching buttons and turning potentiometers. This allows the system to easily simulate all kinds of industrial objects and even harsh working conditions (in this embodiment, harsh working conditions are severe time delays), providing an excellent testbed for verifying the robustness of the algorithm and tuning parameters.
[0052] In this embodiment, preferably, the connection and signal processing path between the deviation calculation unit and the ADC conversion unit is as follows: the rectangular wave given signal generated by the pulse signal generator is first inverted by the first-stage operational amplifier, and then fed into the second-stage operational amplifier with the output signal of the controlled object unit for inversion and summation to obtain the analog deviation signal between the output and the given value; the analog deviation signal is connected to the analog input pin of the ADC conversion unit composed of the ADC0808 chip for analog-to-digital conversion;
[0053] It should be noted that by using two operational amplifiers to invert and sum the analog signals before connecting them to a real ADC0808 chip model, the control system is forced to face hardware constraints such as real analog signal attenuation and conversion accuracy limitations, which effectively trains users' engineering practice ability to handle real physical interfaces and low-level analog-to-digital conversion.
[0054] In this embodiment, preferably, the control program running within the controller unit is written in C51 language and includes a main program, a timer interrupt service routine, and an external interrupt service routine. The main program is used to perform system initialization, including the initialization settings of the timer and external interrupt triggering mode, setting the initial values of the deviation and control quantity to zero, and initializing the sampling period variable. The timer interrupt service routine is used to trigger periodically according to a preset time and start the A / D conversion of the ADC conversion unit. The external interrupt service routine, as a sampling interrupt routine, is used to be triggered after each A / D conversion to perform the acquisition of the deviation signal, the calculation of the Dalin algorithm control formula, and the limiting output of the control quantity.
[0055] It should be noted that the allocation of microcontroller resources is made explicit, and the initialization, analog-to-digital conversion triggering and core algorithm execution are separated through the interrupt mechanism. The modular program design not only ensures the stability of system operation, but also allows beginners to deeply understand the collaborative operation principle of event-driven and time-triggered systems in the underlying microcontroller system.
[0056] In this embodiment, preferably, the execution timing logic of the control program is as follows: the timing period of the timer is set to 10ms, and an A / D conversion is started every 10ms; after the ADC0808 conversion is completed, the EOC pin generates a rising edge, which is inverted into a falling edge by a hardware inverter to trigger the microcontroller's external interrupt 1 to enter the sampling interrupt service routine; in the interrupt service routine, the sampling period variable is decremented by 10ms, and when it is reduced to 0, it is determined that the set control system sampling period time has been reached. At this time, the Dalin algorithm control formula is called and executed once to update the output control quantity, and the initial value of the sampling period variable is reassigned to start the next sampling period loop;
[0057] It should be noted that an external interrupt is triggered by the hardware EOC pin level toggling, which truly simulates the asynchronous communication between the external device and the microcontroller; at the same time, a 10ms basic beat is used to count down the sampling period variable, which cleverly realizes the engineering strategy of combining high-frequency ADC sampling with low-frequency algorithm operation, ensuring that the DaLin algorithm strictly follows the set discrete sampling period to execute stably.
[0058] In this embodiment, preferably, the derivation and design steps of the recursive control formula of the Dalin algorithm control program in the controller unit include:
[0059] S1. Determine the control sampling period The pure time delay set by the controlled object With sampling period Satisfying integer multiples Relationship, that is And set the closed-loop system time constant;
[0060] S2. Based on the parameters of the configured circuit, obtain the transfer function of the controlled object in the continuous domain, and discretize it to obtain the control object's... transfer function ;
[0061] S3. Determine the desired closed-loop transfer function in the continuous domain. The corresponding closed-loop pulse transfer function is obtained by using the pulse transfer function approximation method. ;
[0062] S4, Based on Formula Through the controlled object The digital controller is derived by inversely using the transfer function and the closed-loop pulse transfer function. transfer function ;
[0063] S5. The digital controller transfer function Expanding on this, the recursive formula for calculating control quantities for microcontroller code execution is derived using inverse Z-transform. ;
[0064] It should be noted that the entire lifecycle logic of the Dalin algorithm, namely "parameter matching - object discretization - expected closed-loop reconstruction - controller Z-inverse calculation - difference equation extraction", is clearly demonstrated; the theory is transformed into a C language recursive formula that can be directly executed by a microcontroller, thus opening up the path from theoretical derivation to engineering coding.
[0065] In this embodiment, preferably, the Dalin algorithm control program further includes an algorithm optimization step to eliminate the ringing phenomenon of the output control quantity: after obtaining the digital controller transfer function Then, find the pole factor in the denominator that causes the control quantity to oscillate at a high frequency with alternating decay at half the sampling frequency; let the pole factor... This converts the pole factor into a constant, reconstructs the recursive control formula after ringing elimination, and burns it into the microcontroller to eliminate the high-frequency oscillation of the controller output without affecting the steady-state value of the output.
[0066] It should be noted that by locating the poles and replacing the constants... Using technical means, the high-frequency alternating oscillation wave output by the controller was successfully filtered out without changing the system's set steady-state value; this cultivates learners' deep engineering thinking in algorithm design, which emphasizes not only accurate control but also hardware resistance to losses.
[0067] In this embodiment, preferably, it also includes a method for analyzing the simulation results, and the analysis method is as follows: extract the output step response curve and control output curve from the virtual oscilloscope panel, and analyze the waveform time difference by enabling the dual cursor mode of the virtual oscilloscope. and voltage difference Measurements are performed to calculate and analyze the rise time, settling time, overshoot, and steady-state error performance indicators of the closed-loop control system.
[0068] It should be noted that a virtual oscilloscope is used to visually display multiple waveforms, and the time difference of the waveforms is measured using the dual-cursor mode. and voltage difference This makes abstract performance indicators such as system rise time, overshoot, and settling time accurately calculable and quantifiable; it forms a complete engineering closed loop for design, operation, evaluation, and optimization, greatly enhancing the scientific rigor and precision of teaching experiments.
[0069] The specific operational embodiments of this application are as follows:
[0070] The core digital controller of the controller unit is the AT89C52 microcontroller, which is responsible for calculating the control formula of the Dalin algorithm, acquiring the deviation signal, and outputting the control quantity. The ADC conversion unit consists of an ADC0808 and peripheral circuits, which is responsible for converting the deviation between the given value and the system output into a digital quantity and sending it to the microcontroller. The DAC conversion unit consists of a DAC0832 and peripheral circuits, which is responsible for converting the control quantity output by the microcontroller into an analog quantity and sending it to the controlled object. The controlled object consists of operational amplifiers, resistors, capacitors, and pure time delay elements, simulating first-order inertia plus pure time delay elements and second-order inertia plus pure time delay elements. The deviation calculation unit consists of operational amplifiers and resistors, which realizes the deviation calculation between the given signal and the system output. The virtual oscilloscope is responsible for displaying and analyzing the step response curve.
[0071] When running and using it, open the Proteus software, create a new project, and add the following components in sequence: AT89C52 microcontroller, resistors, capacitors, operational amplifiers, Laplace delay operator elements, ADC converters, DAC converters, pulse signal generators, and virtual oscilloscopes.
[0072] The pulse signal generator ST generates a given signal, which is set as a rectangular wave ST with a pulse period of 9s, a pulse width of 5s, and a pulse amplitude of 2V. The rectangular wave is first inverted by operational amplifier U3:C, and then fed together with the output of the controlled object into operational amplifier U3:D for inversion and summation to obtain the deviation signal A17 between the system output and the given value. The deviation signal A17 is then sent to the IN7 pin of ADC0808 for AD conversion. The microcontroller can obtain the digital value corresponding to the deviation by acquiring the ADC conversion result.
[0073] After the microcontroller obtains the deviation signal A17, it runs the Dalin algorithm to calculate the control quantity and outputs it. The DAC0832 converts the control quantity into an analog quantity and sends it to the controlled object. Finally, the given signal terminal ST, the output terminal VOUT of the controlled object, and the output terminal OUT1 of the control quantity are connected to a virtual oscilloscope to display the step response curve and the output curve of the control quantity.
[0074] The following describes the construction of two types of controlled object circuits: first-order / second-order inertial plus pure time-delay hardware circuits, as shown below. Figure 2 As shown, the circuit consists of an inertial element and a pure time delay element connected in series. It comprises two operational amplifiers U7:A and U7:B connected to external resistors, capacitors, potentiometers, a latching button, and a Laplace delay operator. By opening or closing the latching button, the resistance and capacitance values of the controlled object are changed, thereby altering the inertial time constant and gain of the inertial element. Four resistors are connected to the inverting input of the first-stage operational amplifier U7:A: R17 = 10KΩ, R18 = 20KΩ, R19 = 50KΩ, and R20 = 100KΩ. A latching button is connected to each resistor branch. Each time, one button can be activated, controlling the voltage at the inverting input of U7:A. Resistor selection; U7:A has a total of 6 feedback resistors and capacitors, of which R14=50KΩ, R15=100KΩ, R16=200KΩ, C1=1uF, C2=2uF, and C3=3uF; the feedback resistors and capacitors of U7:A can also be selected by turning the self-locking button on or off; the inverting input resistor, feedback resistor, and capacitor of the second stage U7:B can also be selected. The difference is that the inverting input of U7:B is connected to a 100KΩ potentiometer RV1, and the feedback resistor is connected to a 250KΩ potentiometer RV2. Continuously adjusting the potentiometer resistance values can more easily configure the inertia time constant and gain;
[0075] The pure time delay element is implemented by the Laplace delay operator element. Double-clicking the Laplace delay operator element allows you to set the delay time in the pop-up dialog box, thus realizing pure time delay elements with different delay times.
[0076] Construction of a first-order inertial circuit with pure time delay: Configure one stage of the op-amp as an inverting amplifier and the other stage as an inertial circuit, and then connect a Laplace delay operator element in series; adjust the values of the selector resistor and capacitor to configure the inertial time constant and gain, and set the delay time at the same time.
[0077] Construction of a second-order inertial and pure time-delay circuit: Connect two operational amplifiers in series, both configured as inertial circuits, and then connect a series-connected Laplace delay operator element with the same parameters as the second-order inertial and pure time-delay circuit.
[0078] Assume the transfer function of the controlled object with a second-order inertial and pure time-delay element is:
[0079] ;
[0080] Where the gain K=10, the inertial time constant T1=0.4s, T2=1s, and the pure time delay τ=0.2s;
[0081] The specific circuit configuration method is as follows: Figure 2 As shown:
[0082] The self-locking button of the resistor R19 branch, the self-locking button of the capacitor C2 branch, and the self-locking button of the resistor R16 branch are closed to realize the configuration of the first first-order inertial element, with a gain K1=200K / 50K=4 and an inertial time constant T1=210-6200103=0.4s;
[0083] Adjust potentiometer RV1 to 100%, adjust potentiometer RV2 to 100%, close the self-locking button of capacitor C4 branch, close the self-locking button of capacitor C6 branch to realize the configuration of the second first-order inertial element, its gain K2=250K / 100K=2.5, and the inertial time constant T2=(1+3)10-6250103=1s;
[0084] Double-click the Laplace delay operator element and set the pure time delay to 0.2 s in the pop-up dialog box to configure a pure time delay element with a pure time delay τ=0.2s.
[0085] The final gain of the second-order inertial and pure time-delay element is K = K1K2 = 42.5 = 10, the inertial time constant is T1 = 0.4s, T2 = 1s, and the pure time delay is τ = 0.2s.
[0086] Create a new project in the Proteus built-in C51 editor and write the main program, timer interrupt service routine, and sampling interrupt service routine.
[0087] The main program primarily completes system initialization tasks, including timer initialization, setting the timer to timing mode with a timing interval of 10ms; setting external interrupts to edge-triggered mode; initializing variables such as deviation and control variables to 0; and setting the sampling period variable TK=20, so the sampling period T=sampling period variabletiming interval=2010ms=200ms, or 0.2s.
[0088] The timer interrupt service routine is entered every 10ms to start the A / D conversion;
[0089] Each time an A / D conversion ends, the ADC0808 generates a rising edge at EOC. After being inverted by an inverter, the falling edge triggers an external interrupt in the microcontroller, entering the sampling interrupt service routine. The sampling interrupt service routine is entered approximately every 10ms. In the interrupt service routine, the given signal is first detected through the P1.0 pin. If a high level of the given signal is detected, the sampling period variable TK is decremented by one. When TK reaches 0, it indicates that the sampling period has ended, and the Dalin algorithm control program is executed. The control quantity is output to the DAC converter to control the output of the controlled object, realizing the closed-loop control of the system.
[0090] Taking a second-order inertial element with pure time delay as an example, the derivation of the control formula for the Daling algorithm is presented. The design goal of the Daling algorithm is to determine the control formula based on the transfer function of the controlled object. and expected closed-loop transfer function Inversely derive the Z-transfer function of the digital controller. ;
[0091] Assume the transfer function of the controlled object with a second-order inertial and pure time-delay element is:
[0092] ;
[0093] The controlled object's gain K=10, time constant T1=0.4s, T2=1s, and pure time delay τ=0.2s;
[0094] Step 1: Determine the sampling period This makes the pure time delay With sampling period Satisfy the integer multiple relationship; take the sampling period , To balance response speed and stability, the closed-loop system time constant is chosen. ;
[0095] Step 2: Discretize the controlled object and find its Z-transfer function. ;
[0096] ;
[0097] Step 3: Determine the desired closed-loop transfer function The corresponding closed-loop pulse transfer function is obtained using the pulse transfer function approximation method. ;
[0098] ;
[0099] Step 4: Reverse the direction of the Dalin controller transfer function ;
[0100] ;
[0101] Step 5: Derive the recursive control formula Calculate the control quantity;
[0102] ;
[0103] Step 6: Analyze whether ringing exists and eliminate ringing;
[0104] First find The pole factor that causes ringing ,make Processing steady-state values that do not affect the output; the pole factor becomes Substitute into the recursive control formula have to:
[0105] ;
[0106] The recursive control formula after eliminating ringing is:
[0107] ;
[0108] Finally, based on the recursive control formula Write C51 programs for the recursive control formulas after ringing and ring-eliminating, and compile them. Then, the ringing program or the ring-eliminating program can be automatically burned / associated with the 51 microcontroller in the circuit diagram.
[0109] Launching the Proteus simulation, the virtual oscilloscope automatically plots the response curves of the given signal, control output, and system output signal. Adjusting the time base and voltage scale of the virtual oscilloscope allows the waveform to be displayed clearly, stably, and completely on the screen for accurate signal observation and measurement. Dual cursor mode can also be enabled to adjust the waveform time difference. and voltage difference Accurate measurement facilitates the calculation of performance indicators such as rise time, settling time, overshoot, and steady-state error;
[0110] from Figure 4The ringing response curve of the second-order inertial element with pure time delay shows that the pure time delay part of the controlled object in the Dalin algorithm control system only shifts the control action by one time delay on the time coordinate. The system output curve fluctuates, tracks the given value, has a settling time of 1.34s, an overshoot of 0%, and a steady-state error close to 0. However, the output waveform of the digital controller shows that the output of the control quantity oscillates with a large attenuation at 1 / 2 sampling frequency, i.e., ringing occurs. Due to the low-pass characteristic of the inertial element in the controlled object, the oscillation has little impact on the system output. However, the ringing phenomenon increases the wear of the actuator. In interactive multi-parameter control systems, the ringing phenomenon may also affect the stability of the system, so it is necessary to eliminate the ringing.
[0111] Figure 5 The response curve is that of a second-order inertial system with pure time delay after eliminating ringing. The system output tracks the given value more smoothly, with a settling time of 3.25s, 0% overshoot, and 0% steady-state error. Although the time required for the system to reach a steady state (i.e., the settling time) increases after eliminating ringing, the controller output eliminates high-frequency oscillations, and the system response is more stable. Therefore, eliminating ringing is a key step in the application of the Dahlin algorithm. Sacrificing some response speed in exchange for a significant improvement in system stability, actuator lifespan, and control quality, it represents a superior solution sought in engineering practice.
[0112] Based on the Proteus-based Darlin algorithm simulation experiment teaching system, students can achieve clear and quantifiable results from four core dimensions: theoretical cognition, simulation verification, engineering practice, and performance analysis. They can master the design logic of Darlin algorithm for high-order lag objects, understand the core idea of "theoretical design-engineering optimization-performance trade-off" in discrete control, and form a complete "modeling-design-simulation-analysis" closed-loop capability, which is also a core capability training goal in engineering experiments and course design.
[0113] The above description of the embodiments is only for the purpose of helping to understand the method and core ideas of the present invention. It should be noted that those skilled in the art can make several improvements and modifications to the present invention without departing from the principles of the present invention, and these improvements and modifications also fall within the protection scope of the claims of the present invention.
Claims
1. A simulation experiment teaching system based on the Proteus-based DaLin algorithm, characterized in that, The circuit and program are built and run in a single Proteus simulation environment, including a pulse signal generator, a deviation calculation unit, an ADC conversion unit, a controller unit, a DAC conversion unit, a controlled object unit, and a virtual oscilloscope; A pulse signal generator is used to generate and input a desired given signal into the system; The deviation calculation unit is used to receive the given signal and the actual response signal output by the controlled object, and to perform an inverse summation operation between the given signal and the actual response signal to obtain the deviation signal. The input of the ADC conversion unit is connected to the deviation calculation unit, which is used to convert the acquired deviation signal into a digital deviation quantity; The controller unit uses a microcontroller as its core processor to receive the digital deviation output from the ADC conversion unit, and calculates and outputs the digital control quantity based on the built-in Dalin algorithm control program. The input of the DAC conversion unit is connected to the controller unit to receive digital control signals and convert them into analog control signals for output. The controlled object unit receives analog control signals, the circuit simulates a first-order inertial element with pure time delay or a second-order inertial element with pure time delay, and outputs the actual response signal to form a closed-loop feedback. The virtual oscilloscope is simultaneously connected to the given signal generation terminal, the DAC conversion unit output terminal, and the controlled object output terminal to observe and record the system's dynamic response curve in real time.
2. The DaLin algorithm simulation experiment teaching system based on Proteus according to claim 1, characterized in that: The circuit of the controlled object unit is composed of an operational amplifier peripheral circuit and a Laplace delay operator element connected in series. When simulating a first-order inertial element with pure time delay, it is implemented by an operational amplifier circuit configured as an inverting proportional amplifier, an operational amplifier circuit configured as an inertial element, and a Laplace delay operator element connected in series. When simulating a second-order inertial element with pure time delay, it is implemented by two-stage inertial element operational amplifier circuits connected in series and a Laplace delay operator element connected in series.
3. The DaLin algorithm simulation experiment teaching system based on Proteus according to claim 2, characterized in that: The controlled object unit has a self-locking button connected to the resistor branch at the inverting input terminal of the operational amplifier and the capacitor and resistor branch at the feedback terminal. Different combinations of resistance and capacitance values can be selected by turning the self-locking button on or off; or a potentiometer can be used as the resistor at the inverting input terminal and the feedback terminal. The system resistance and capacitance values can be changed by adjusting the self-locking button and the potentiometer to dynamically configure the inertial time constant and gain of the first-order or second-order inertial element; the Laplace delay operator element can set the delay time through the element attribute pop-up window to achieve the configuration of pure time delay.
4. The DaLin algorithm simulation experiment teaching system based on Proteus according to claim 3, characterized in that: The connection and signal processing path between the deviation calculation unit and the ADC conversion unit are as follows: the rectangular wave given signal generated by the pulse signal generator is first inverted by the first-stage operational amplifier, and then fed into the second-stage operational amplifier with the output signal of the controlled object unit for inversion and summation to obtain the analog deviation signal between the output and the given value; the analog deviation signal is connected to the analog input pin of the ADC conversion unit composed of the ADC0808 chip for analog-to-digital conversion.
5. The DaLin algorithm simulation experiment teaching system based on Proteus according to claim 4, characterized in that: The control program running within the controller unit is written in C51 language and includes a main program, a timer interrupt service routine, and an external interrupt service routine. The main program is used to perform system initialization, including the initialization settings of the timer and external interrupt triggering mode, setting the initial values of the deviation and control quantity to zero, and initializing the sampling period variable. The timer interrupt service routine is used to trigger periodically according to a preset time and start the A / D conversion of the ADC conversion unit. The external interrupt service routine, as a sampling interrupt routine, is used to be triggered after each A / D conversion to perform deviation signal acquisition, calculation of the Dalin algorithm control formula, and amplitude limiting output of the control quantity.
6. The DaLin algorithm simulation experiment teaching system based on Proteus according to claim 5, characterized in that: The execution timing logic of the control program is as follows: the timing period of the timer is set to 10ms, and an A / D conversion is started every 10ms; after the ADC0808 conversion is completed, the EOC pin generates a rising edge, which is inverted into a falling edge by the hardware inverter to trigger the microcontroller's external interrupt 1 to enter the sampling interrupt service routine; in the interrupt service routine, the sampling period variable is decremented by 10ms, and when it is reduced to 0, it is determined that the set control system sampling period time has been reached. At this time, the Dalin algorithm control formula is called and executed once to update the output control quantity, and the initial value of the sampling period variable is reassigned to start the next sampling period loop.
7. The DaLin algorithm simulation experiment teaching system based on Proteus according to claim 6, characterized in that: The derivation and design steps of the recursive control formula in the Dalin algorithm control program of the controller unit include: S1. Determine the control sampling period The pure time delay set by the controlled object With sampling period Satisfying integer multiples Relationship, that is And set the closed-loop system time constant; S2. Based on the parameters of the configured circuit, obtain the transfer function of the controlled object in the continuous domain, and discretize it to obtain the control object's... transfer function ; S3. Determine the desired closed-loop transfer function in the continuous domain. The corresponding closed-loop pulse transfer function is obtained by using the pulse transfer function approximation method. .
8. The DaLin algorithm simulation experiment teaching system based on Proteus according to claim 7, characterized in that: The derivation and design steps of the recursive control formula of the Dalin algorithm control program also include: S4, Based on Formula Through the controlled object The digital controller is derived by inversely using the transfer function and the closed-loop pulse transfer function. transfer function ; S5. The digital controller transfer function Expanding on this, the recursive formula for calculating control quantities for microcontroller code execution is derived using inverse Z-transform. .
9. The DaLin algorithm simulation experiment teaching system based on Proteus according to claim 8, characterized in that: The Dalin algorithm control program also includes algorithm optimization steps to eliminate ringing phenomena in the output control quantity: after obtaining the digital controller transfer function Then, find the pole factor in the denominator that causes the control quantity to oscillate at a high frequency with alternating decay at half the sampling frequency; let the pole factor... This converts the pole factor into a constant, reconstructs the recursive control formula after ringing elimination, and burns it into the microcontroller to eliminate the high-frequency oscillation of the controller output without affecting the steady-state value of the output.