What You’ll Learn 🎛️
Understand basic process control and the role of a feedback controller in regulating system outputs
Configure and use the PID Control math module in DewesoftX—select loop type (open/closed), controller type (P, PI, PID with anti-windup), setpoints, and output channels
Tune PID parameters using built-in methods: Ziegler–Nichols, Cohen–Coon, Lambda tuning; manage dead time and integrator wind-up
Apply PID control in typical use cases, such as controlling a propeller’s rotational frequency—tuning gains and observing loop response
Manage sample timing: define loop output time and use error averaging methods to reduce noise interference
Understand limitations: recognize Windows is not real-time, so PID loop timing may jitter—but still effective for many applications
Monitor performance: reset and stop PID loops, observe controller output limits and integrator behavior using UI widgets
Course overview
The PID Control Systems course equips engineers and control engineers with hands‑on experience implementing PID controllers within DewesoftX. The course begins by introducing process control essentials—how feedback corrects deviations from a setpoint using proportional, integral, and derivative actions.
Next, you’ll learn to configure the PID module: choose open‑loop for system characterization (e.g., measuring step response), or closed‑loop for active control. You’ll define setpoints, select output channels (digital or analog), specify update rates, and manage loop behavior using averaging and output limits.
You’ll explore tuning methods built into DewesoftX—Ziegler–Nichols for oscillation-based tuning, Cohen–Coon and Lambda tuning for open-loop systems with dead time. The course includes a practical example of controlling a propeller’s RPM, where you’ll adjust KP, KI, and KD to achieve desired stability and response time.
While demonstrating real-world limitations—Windows-based DewesoftX is non-real-time—the course shows you how to mitigate timing jitter with appropriate sampling rates. Anti-windup settings and integrator limits ensure robustness and prevent controller saturation in systems with dead time.
In the final modules, you’ll validate your control system: monitor live PID behavior via UI controls, reset loops, and ensure that output levels and integrator behavior match expectations.
By course end, you’ll be ready to design and deploy effective PID control loops using DewesoftX—suited for applications like motor speed regulation, temperature control, fluid levels, or other feedback‑based systems.
Introduction to process control
A controller is a mechanism that regulates the output of a system by adjusting its control input. A feedback controller continuously measures the output, compares it to the desired value (the setpoint), and adjusts the input based on the calculated error. The PID controller is the most common type of feedback controller. It adjusts the control variable according to the present error (P – proportional control), the accumulated past error (I – integral control), and the predicted future error (D – derivative control).
A block diagram of a PID controller is shown in the figure below.
The Plant/Process block represents the system to which the input (u) is applied, and it produces the output (y). For example, a car is a system where a steering wheel angle command serves as the input, and the resulting change in direction is the output. The car’s characteristics—such as its weight, center of gravity position, suspension geometry, and tires—determine how the direction changes in response to a given steering wheel angle.
When a controller is implemented, the input (u) is calculated as shown in the diagram by combining the proportional, integral, and derivative terms. These terms are obtained by multiplying the error, the integral of the error, and the derivative of the error by the P, I, and D gains, respectively.
What is the role of the controller gains (Kp, Kd, Ki)?
Let’s look at an example to better understand the practical implementation of a PID controller. Figure 2 shows a spring–mass–damper system. We will only consider the horizontal motion of the mass. The goal is to apply a force f(t) that displaces the mass m to the position x₀ from its initial location in the shortest possible time.
The system’s equation of motion can be expressed as follows:
For further analysis, we will assume the following values for the system constants: m = 2 kg, b = 20 N·s/m, k = 10 N/m. The system’s response can be calculated by solving the differential equation. To determine the response to a step input, it is most convenient to apply the Laplace transform, calculate the step response in the frequency domain, and then apply the inverse Laplace transform to obtain the response in the time domain.
In an open-loop case, there is no feedback. A unit force is applied, and the system responds as shown in the image below. The steady-state amplitude reaches only 10% of the desired value, and the response is relatively slow. However, open-loop analysis is very useful for examining the system’s basic characteristics, which in turn helps in designing the PID controller, as we will see later.
Open-loop block diagram:
Open-loop transfer function:
Open-loop step response:
Adding feedback with a P-controller improves the response. With the P-gain set to 50, the steady-state output value is now within 20% of the setpoint, and the response is much faster. Note that the system input is no longer the force but rather a variable denoted as u in the block diagram. This is the value that we want x(t) to follow. The error e represents the difference between the desired x and the actual x.
P-controller block diagram:
P-controller transfer function:
P-controller step response:
To eliminate the steady-state error, we add the I-gain to the controller. As shown in Image 7, the steady-state error is reduced to zero. However, the system first overshoots the setpoint and then takes longer to settle at the steady-state value.
PI-controller block diagram:
PI-controller transfer function:
PI-controller step response:
To better understand the effect of the D-gain, consider the following case. We want to shorten the response time of the PI controller by increasing the P-gain. The next image shows the result when the P-gain is increased to 400.
The response is indeed faster, but the output oscillates around the setpoint value. If the P-gain were increased even further, the system would become unstable and the output would oscillate with increasing amplitude. The D-gain adds stability to the system because it is proportional to the derivative of the error: the faster the error decreases, the more negative the contribution of the D-term in the equation, thereby reducing the controller output. By adding the D-gain to the controller and tuning the other two gains, the response becomes fast, with minimal overshoot and no steady-state error.
PID-controller block diagram:
PID-controller transfer function:
PID-controller step response:
An alternative way to understand the role of the gains is that Kp works on the present error, Ki on the past error (integral), and Kd on the predicted future error (derivative).
Remember that when analyzing the open-loop response, the input to the system was a unit step force. By adding a controller, the input becomes the reference value u (setpoint). The controller adjusts the force based on the error, calculating the time-dependent force required to produce the desired output.
A practical question arises at the end of this example: how is such a controller implemented in practice? The feedback would be provided by a sensor—for instance, a linear potentiometer or an LVDT would be a good choice to measure the displacement of the mass. The force would be provided by an actuator, such as a linear actuator driven by a DC motor through an ACME screw, or a pneumatic (or hydraulic) cylinder, which would be suitable for this example.
The signal from the sensor must be processed by a data acquisition system such as Dewesoft SIRIUS. The software then calculates the error and, through the P-, I-, and D-gains, generates the input signal for the actuator.
It is also important to note that the sensor and actuator do not respond instantaneously, as assumed in the transfer functions above. They each have their own time responses, which must be considered by adding their transfer functions to the block diagram when analyzing real systems. The sensor block should be added to the feedback loop, and the actuator block should be inserted between the controller output summation and the controlled system block.
The order of the system
Before designing the PID controller, it is useful to identify the order of the system. The system analyzed in the previous example is a second-order system, which is evident from its transfer function of the form 1/(as² + bs + c). We can recognize a second-order system by the s² term in the denominator, which results from the second derivative in the differential equation.
Another characteristic of a second-order system is its open-loop step response, which may exhibit oscillations around the setpoint. In the given example, due to the combination of the parameters m, b, and k, the system was overdamped and therefore did not oscillate. However, if we reduce the damping parameter b to 2, the step response becomes underdamped:
A second-order system equation can also be expressed in the following form:
The constant in the numerator does not change the shape of the response but acts solely as a scaling factor. The values in the denominator provide much more information about the system. The natural frequency of the system, denoted as ωₙ, is given in our example by √(k/m). The damping ratio, denoted as ξ, is equal to b / (2mωₙ) in this case.
If we remove the damper from the system (b = 0), then ξ = 0, and there is no damping. If ξ = 1, the system is critically damped, providing the fastest response without oscillations. If ξ > 1, the system is overdamped, and if ξ < 1, the system is underdamped, which produces an oscillatory response. Therefore, the response of the moving mass in our example can be tuned by appropriately adjusting the spring and damper values, which represents an example of open-loop control. In many cases, however, stiffness and damping cannot be adjusted directly, and closed-loop control is required.
Second-Order System Examples
A displacement response of a spring–mass–damper system to a force input is a typical second-order system, as the force applied to the mass is proportional to its acceleration, which is the second derivative of displacement. Another example of a second-order system is the voltage response across a capacitor in an RLC circuit to a supply voltage input, where the voltage across the inductor is proportional to the second derivative of the voltage across the capacitor.
A simpler case is a first-order system, which has a transfer function of the following form:
There is only s¹ in the denominator, indicating that the differential equation of a first-order system involves only the first derivative of the output. The step response of a first-order system is shown in Image 13.
Analyzing the transfer function of a first-order system, we can compute the step response (u(s) = 1/s for a step input) in the frequency domain:
By taking the inverse Laplace transform of the response, we obtain the time-domain response:
This function is plotted in the figure above (step response of the first-order system). In this equation, the parameter a characterizes the system. When t = 1/a, the amplitude is 1 − e⁻¹, which is approximately 63% of the steady-state amplitude. The value t = 1/a is called the time constant. The parameter a is also the derivative of x(t) at t = 0, which represents the initial slope of the response.
Furthermore, we can define the rise time as the time it takes for the amplitude to increase from 10% to 90% of the steady-state value: Tᵣ = 2.2/a. The settling time is defined as the time when the amplitude reaches 98% of the steady-state value: Tₛ = 4/a. These values are obtained by substituting the corresponding amplitudes into the x(t) equation and solving for t.
A more general first-order system has the transfer function of the following form:
The only difference in the step response is that the amplitude is not 1, but rather k/a, since the time-domain response is:
The term s+as + as+a in the denominator is also called a lag term, because it introduces a lag into the system (the process variable lags behind the control input).
First-Order System Examples
An example of a first-order system is the rotational velocity response of a DC motor to a step voltage input. Earlier, we mentioned that an RLC circuit exhibits the characteristics of a second-order system. In contrast, LR and RC circuits are first-order systems because the supply voltage is related to either the voltage or the derivative of the voltage across the respective elements in the circuit. Another example is the emptying of a water tank through a valve at the bottom. The pressure at the valve decreases exponentially as the water level drops.
PID control in DewesoftX
DewesoftX can be used as a PID controller by utilizing the PID Control function in the Math section.
⚠️ Warning: DewesoftX software running on Windows is not a real-time system, because Windows itself is not a real-time operating system. This means the controller delay is not always constant and can be unpredictable. For example, Windows may give priority to another application instead of DewesoftX, which can significantly increase the controller delay.
However, many applications do not require real-time control. The controller response time depends on the computer’s specifications, but as we will see in the example, the response time can still be very short.
To access PID control in DewesoftX, go to Math → Add Math and type PID in the search box.
During measurement, the user can access three gain inputs (KP, KI, and KD) and two control buttons: Stop PID and Reset PID.
Clicking the Setup tab opens a new window with the essential PID settings:
Input – From the list on the left-hand side of the setup window, select the input channel to be controlled.
Loop type – If Open loop is selected, there is no feedback to the controller. In Measure mode, the user can set a value for the controlling channel (analog or digital output, for example) and observe the response without controller interference. This option is useful for obtaining the system’s step response. If Closed loop is selected, the feedback loop is enabled and additional settings become available.
Controller type – Choose between a PID controller and a PI controller with anti-windup (anti-windup will be described later in this tutorial). If only a P controller is needed, the PID type can be selected with zeros entered for the I and D gains.
Wanted value – The setpoint. In the figure above, we created a user input channel (under Channel Setup → User Inputs) called Set point freq to allow changing the setpoint during measurement.
Output channel – The controller output. Normally, an analog or digital output channel is selected. In the figure above, we named the analog output channel Control AO voltage.
PID loop output time – The period at which the controller updates the Output channel.
Averaging type – The method of averaging the error (error = wanted value – input). This can be useful if the process value contains significant noise.
Maximum output levels – Defines the minimum and maximum levels of the Output channel, if desired.
Integrator windup limit – (Visible when Controller type is set to PI with anti-windup) Specifies the limits of the Output channel in its units. When the Output channel exceeds these limits, the error will not be integrated (anti-windup will be described later in this tutorial).
Which are the PID tuning methods?
DewesoftX's PID Control function provides users with several basic PID tuning methods. To access these methods, click on Tuner... in the PID Control setup. The four available methods are briefly described in this section. The variables used here are best explained in the following figures.
The process gain K is calculated as the ratio of the change in the process variable to the change in the control variable:
The controller gains calculated using the tuning methods are based on the non-interactive (or ideal) definition of a PID controller in the time domain:
Because DewesoftX uses a parallel PID algorithm, the following equations apply to convert the gains Kc, Ti, and Td into KP, KI, and KD:
The difference between the non-interactive and parallel PID algorithms is illustrated below:
Non-interactive PID algorithm:
Parallel PID algorithm:
In order to choose the appropriate method, it is important to identify the characteristics of the system based on the previous sections of this tutorial. The following table summarizes the characteristics of the different methods.
Method | Type of process | Identification | Result |
---|---|---|---|
Ziegler-Nichols | Lag dominated | Closed loop | 1/4 decay ratio |
Cohen-Coon | Lag & dead time | Open loop | 1/4 decay ratio |
Lambda | Lag dominated | Open loop | Adjustable time constant |
Dead time | Dead time dominated | Open loop |
Ziegler-Nichols method
This method is based on the frequency response of the system. The KP, KI, and KD values are calculated from Ku (the ultimate gain) and Tu (the period of oscillation at Ku). The ultimate gain is the proportional gain of the controller (when the integral and derivative gains are set to zero) at which the system becomes unstable. To determine this, the system is analyzed by gradually increasing the proportional gain until it oscillates with a constant amplitude. Once Ku is obtained, the controller gains are calculated according to the following table:
Controller | Kp/Ku | Ti/Tu | Td/Tu | Tp/Tu |
---|---|---|---|---|
P | 0.5 | |||
1.0 | ||||
PI | 0.4 | 0.8 | ||
1.4 | ||||
PID | 0.6 | 0.5 | 0.125 | 0.85 |
A PID controller designed using the Ziegler-Nichols method causes the system to overshoot the setpoint and oscillate with a decay rate of 1/4 (the amplitude is reduced by a factor of 4 during each oscillation). If such oscillations are not suitable for the controlled system—since many processes cannot tolerate overshoot—further tuning is required. Another drawback of the Ziegler-Nichols method is that it requires determining the ultimate gain, which may be impossible if the system is too stable for the actuator. When measuring the response of a real system, intentionally driving it into instability can also be dangerous.
Cohen-Coon method
This method does not require the parameters TuT_uTu and KuK_uKu, which means the system does not need to be tuned to the edge of stability in order to calculate the optimal gains. A simple step response of the system is sufficient to measure the dead time T0T_0T0, the process gain GpG_pGp, and the time constant τ\tauτ.
The method is particularly suitable for systems with large dead times compared to the Ziegler-Nichols method. The result of the Cohen-Coon method is again a 1/4 decay rate of oscillation, similar to the Ziegler-Nichols method. The gains are calculated according to the following table.
Lambda method
The Lambda tuning method is also based on knowledge of the system obtained by measuring its step response. Unlike the Ziegler-Nichols and Cohen-Coon methods, the Lambda method allows the user to choose the time constant of the controlled system’s response and calculate the gains based on the desired response speed. This approach generally results in a more stable system than the previous two methods.
For tuning a PI controller, the two equations below are used. KKK, τ\tauτ, and t0t_0t0 are the open-loop step response characteristics, while τcl\tau_{cl}τcl represents the desired closed-loop time constant.
In DewesoftX’s Lambda tuning, the fast, medium, and slow loop speeds correspond to the following values:
Loop speed | τ c l |
---|---|
Fast | τ𝜏 |
Medium | 2 τ𝜏 |
Slow | 3 τ |
Dead time
Processes with large dead times compared to their time constants are difficult to control. The Cohen-Coon method can handle processes with T0T_0T0 up to 2τ2\tau2τ, but when the dead time is larger than 2τ2\tau2τ, the method produces poor results. The challenge with dead time is that the system’s initial response is not intuitive: increasing the controller gain does not necessarily yield a faster response. However, if the gain is set too high, the system becomes prone to large overshoots once the dead time has passed.
A typical example of a dead time–dominant process is a heated water tank with a long pipe between the tank and the outlet. If the water temperature is measured at the outlet while controlling the heater power, there will inevitably be a delay before any heating effect is observed at the outlet. Although the water heats up quickly in the tank, the long pipe introduces dead time. A second issue arises when the hot water reaches the outlet: reducing the controller gain at this point cannot affect the hot water already in the pipe. If the gain was set too high in the initial phase, the water temperature at the outlet may significantly exceed the setpoint.
For dead time–dominant processes, DewesoftX uses the equations below to determine the controller gains. The derivative gain is omitted.
SM is the stability margin. A value of 1 produces a response with overshoot and an amplitude decay ratio, which, as we have already learned, is not very stable. A higher SM value makes the system more stable, but the response becomes slower as a consequence. In DewesoftX's PID tuner, you can choose from the following three SM settings:
Tuner setting | SM |
---|---|
Low stability, fast loop | 2 |
Medium stability, medium loop | 3 |
High stability, slow loop | 4 |
Controlling the propeller rotational frequency in DewesoftX
A two-blade propeller was mounted on a DC motor. The motor was driven by a PWM circuit, which was controlled by the analog output signal from the Dewesoft Sirius. A rotational encoder was attached to the back end of the motor shaft and used as a feedback sensor. This encoder was connected to the counter channel of the Dewesoft Sirius. The figure below schematically illustrates the setup.
The PWM generator we used is only capable of generating unipolar voltage, which means we cannot brake the propeller. While this is not ideal, the propeller tends to reduce its speed fairly quickly, so it does not pose a significant problem. Therefore, when the control voltage from the output channel is negative, the motor voltage is zero.
Our goal is to control the rotational frequency by applying the appropriate voltage to the motor. The first step is to measure the system’s response to a step voltage input. The following variables will be used in the process.
Variable | Description | Dewesoft channel name |
---|---|---|
Process variable | Rotational frequency of the propeller | Propeller rotational frequency [RPM] |
Controller variable | Voltage at the Analog Out channel | Control AO voltage [-10 ... 10 V] |
Controller variable feedback | Actual voltage at the Analog Out channel | AO voltage feedback [-10 ... 10 V] |
Note that we will be measuring the actual control voltage at the analog output connector. This is necessary because there is a delay between the software command (Control AO voltage) and the actual output channel response, as the operating system introduces latency—Windows is not a real-time system. To minimize this delay, set the PID Loop Output Time to 0.01 s (10 ms) in the PID Control Setup. The software will then update the controller variable at this rate. The typical delay introduced by the operating system is between 20 and 30 ms.
Note: If you are controlling a very slow process, such as air temperature in a room, you can set the PID loop output time to a larger value to reduce the number of unnecessary small valve actuations.
The first step is to model the system on paper. Our goal is to determine the transfer function from voltage to rotational frequency for the system. The DC motor torque can be modeled as follows:
kT (motor torque constant), kik_iki (the product of kTk_TkT and kek_eke, the back-EMF constant), and RRR (motor winding resistance) are motor constants. However, we are currently interested in the variables that change with time: voltage UUU, rotational frequency ω\omegaω, and torque TPT_PTP. We can now rewrite the motor torque equation with the constants combined:
The opposing torque caused by air drag can be modeled as:
CQ is a constant that depends on propeller parameters such as diameter, number of blades, lift and drag coefficients of the propeller airfoil, twist, etc. The equation of motion for the system can be written as follows:
JP is the mass moment of inertia of the propeller, which is also a constant. By combining the equations, we arrive at the following expression:
The system is nonlinear because the aerodynamic drag is proportional to the square of the velocity. In linear control theory, it is common practice to linearize the equations around a certain steady-state condition. The resulting linearized equation is valid only for small deviations from this condition.
The optimal gains then depend on the initial condition, but this can be addressed using gain scheduling—a method that provides a map of gains for many different operating conditions. For example, the flight control algorithm of the F-16 fighter aircraft uses gain scheduling to handle hundreds of flight conditions with a linear controller.
Currently, Dewesoft X PID does not directly support gain scheduling, but it can be approximated by using the sequencer for certain slow process control applications.
Returning to our propeller model, if we linearize the system around the condition ω=0\omega = 0ω=0 and combine the constants into new terms, we obtain:
This equation can be transformed into the frequency domain, resulting in the following transfer function:
To linearize the equation of motion, we expand it into a Taylor series, considering only the first two terms:
f represents the function we are linearizing (rotational acceleration). xxx is the vector of all variables in the function, which in our case are ω\omegaω and UUU. fx1f_{x1}fx1 is the first derivative of the function with respect to the variables. The linearized function approximates the original function only for small perturbations of the vector xxx around the linearization point x0x_0x0 (hence Δx\Delta xΔx). The point about which we linearize the function is U=0U = 0U=0, ω=0\omega = 0ω=0. Taking the first derivative of fff, we get:
f(x0) is zero at our linearization point. The value in brackets is a constant (the value of the derivative at the linearization point), which we denote as KωK_\omegaKω. We also denote the coefficient in front of UUU as a new constant, KUK_UKU. Considering that the function represents our system for small perturbations of the variables, we can simplify:
From this point, we perform the Laplace transform:
Rearranging the equation gives the transfer function:
We immediately recognize this as the equation of a first-order system. The two constants depend on the motor windings and propeller geometry, but we do not need to concern ourselves with them, as the time constant and process gain of the system can be easily determined by measuring the step response, which is our next step.
In the PID Control setup, select the Open Loop option to disable both the feedback loop and the controller.
Our initial condition will be a control voltage of 1 V, corresponding to a propeller speed of approximately 670 RPM. This is because the encoder we are using is not very accurate at low RPMs, as it has a resolution of 1024 points per rotation. We will then introduce a 1.5 V step in the control voltage (from 1 V to 2.5 V) and measure the open-loop response.
The result is a typical first-order system response. As seen in the figure above, the time constant of the system is approximately 415 ms. The first cursor is placed at the step of the controller output voltage (purple line), and the second cursor is placed at the point where the frequency reaches 63% of its final value.Dewesoft X displays the time between the cursors in the bottom-right corner of the screen.
The dead time of this process is very low, about 0.6 ms, which can also be measured from the step response. Such a low dead time is negligible for our purposes, so we will assume the process has zero dead time. We will artificially introduce a longer dead time later in this tutorial to observe its effect on the system.
Based on this knowledge of the system, we select the Ziegler-Nichols and Lambda methods for tuning the controller. The Cohen-Coon method is suitable for systems with a larger time constant, while the Dead Time method is appropriate for systems with significant dead time, neither of which apply to our system.
Propeller control: Ziegler-Nichols tuning
For the Ziegler-Nichols tuning method, we first need to determine the ultimate gain. This is the proportional gain at which the process variable begins to oscillate when the integral and derivative gains are set to zero. In the PID setup, we initially set only the P gain to a starting value and then gradually increase it to find the ultimate gain.
KP = 0.07
KP = 0.08
In the two figures above, you can see the system response for KP=0.07K_P = 0.07KP=0.07 and KP=0.08K_P = 0.08KP=0.08. At KP=0.07K_P = 0.07KP=0.07, the controller just manages to damp the oscillations, while this is no longer the case at KP=0.08K_P = 0.08KP=0.08. Therefore, the latter is the ultimate gain, KuK_uKu. The period of oscillation, also known as the ultimate time TuT_uTu, is found to be 0.13 s.
There are a few interesting phenomena to note in these figures, which also apply to the rest of the tutorial.
The AO voltage feedback lags behind the Control AO voltage. The Control AO voltage is the voltage calculated by the PID controller and is updated every 10 ms (this period is set in the PID Control Loop Output Time option in the setup). The AO voltage feedback is the actual voltage at the analog output channel of the SIRIUS instrument, and its delay varies between approximately 15 ms and 25 ms. Remember again that Windows is not a real-time system!
The voltage at the output channel also does not follow the calculated Control AO voltage when it exceeds the channel range of ±10 V (we could limit the calculated Control AO voltage in the PID setup to match the output channel range).
The propeller frequency decreases more slowly than it increases. This is because the actual voltage at the propeller motor is never negative, as the PWM generator only produces voltage in one direction. This results in the following saturation limits:
Calculated control voltage: unlimited
Output voltage of the AO channel: ±10 V
Motor voltage: 0–10 V
From the figures above, we can see that the ultimate gain is approximately 0.08, since the controller just manages to damp the oscillations at KP=0.07K_P = 0.07KP=0.07. Using the tuner, Dewesoft X calculates the controller gains for us:
Controller | Kp | Kl | Kd |
---|---|---|---|
P | 0.04 | ||
PI | 0.036 | 0.36 | |
PID | 0.048 | 0.8 | 0.0007 |
The system responses for all controllers are shown below:
P-controller
PI-controller
PID-controller
Before discussing the results, we will first tune the controller using the Lambda method.
Propeller control: Lambda tuning
To use the Lambda tuning method, we first need to analyze the system’s step response to calculate the process gain from the values of dCO and dPV. From the step response plot, the values are:
dCO = 1.5 V
dPV = 640 RPM
We have already calculated the time constant (0.415 s) and dead time (0 s). Using this data, the Lambda tuner in Dewesoft X calculates the following gains for the PI controller:
P-gain | I-gain | Option |
---|---|---|
0.0022 | 0.0052 | Fast |
0.0007 | 0.017 | Slow |
The system response for both options is shown in the following two figures.
Fast
Slow
Note that the time scale on these plots differs from that of the Ziegler-Nichols response plots because the Lambda response is significantly slower. The results are discussed in the following section.
Propeller control: Tuning summary
The following table summarizes the main characteristics of systems tuned using different methods.
Method | Time constant [s] | Overshoot [%] | Settling time [s] | Steady-state error [%] |
---|---|---|---|---|
ZN P | 0.019 | 32 | 0.24 | -8.6 |
ZN PI | 0.015 | 80 | 1.4 | 0 |
ZN PID | 0.015 | 60 | 1.1 | 0 |
Lambda Fast | 0.36 | 1 | 2.1 | 0 |
Lambda Slow | 1 | 0 | 4.5 | 0 |
In the three cases tuned with the Ziegler-Nichols methods, we can clearly see the impact of each gain. The I-gain reduces the steady-state error to zero while introducing oscillations. The D-gain allows for a higher P-gain while maintaining stability (fewer oscillations and shorter settling time).
The response of the Ziegler-Nichols controller is much faster but also exhibits higher overshoot. When comparing the fast Lambda method with the Ziegler-Nichols tuned PI controller, the settling time is not significantly shorter for the Ziegler-Nichols controller, while the overshoot reaches 80%, which may be undesirable in certain applications. If our PWM generator were able to decelerate the motor, the overshoot would have been smaller.
Dead time
We will now consider a system with a large dead time. Since our motor is not very powerful, it is safe to block it for a few seconds to artificially introduce dead time. The following figure shows the response of a Ziegler-Nichols PI controller using the same gains as in the previous case, where no dead time was present.
The controller gains are completely inappropriate. During the dead time, the control voltage continues to rise, which causes a large overshoot when the propeller is released. The control voltage then does not respond quickly to the overshoot because of the large integral gain. During the dead time, a large negative error accumulates, which must be counteracted by a positive error for a sufficiently long period before the sum diminishes. Comparing the areas between the setpoint curve and the propeller frequency curve during the dead time and the full-speed segment, we can see that they are similar.
If we now apply the Dead Time method in DewesoftX's PID tuner, the calculated gains are as follows:
P-gain | I-gain |
---|---|
0.0004 | 0.0004 |
The response shown in the figure below is much more acceptable. Because of the low gains, the control voltage does not rise to excessively high levels during the dead time. Since the Dead Time method depends on the duration of the dead time, the calculated gains would have been even lower if the dead time were longer.
Integrator windup
There is another way to handle large dead time. In the PID setup, we can choose the PI (anti-windup) controller type. This prevents the accumulation of the integration error when the actuator is in saturation, which typically occurs during dead time. When this type of controller is selected, the Ziegler-Nichols method also provides a very good response in cases of large dead time (see figure below). Note that the control voltage stops increasing once the controller detects that there is no response from the process variable (propeller frequency).
To ensure the anti-windup functions properly, we must set the windup limits of the output channel in the setup. A practical value would be just below the actuator’s saturation level.
Page 1 of 12