Journal of Automation and Control Research (JACR)
Volume 1, Year 2014 - Pages 22-30
A Jitter Compensating PID Controller to Mitigate the Detrimental Effects of Software Induced Jitter in Digital Control Systems
Chamira Perera1, Trevor Pearce1, Miodrag Bolic2
1Carleton University, Department of Systems and Computer Engineering, 1125 Colonel By Drive, Ottawa, Ontario, Canada K1S 5B6
2University of Ottawa, School of Electrical Engineering and Computer Science, 161 Louis Pasteur, Ottawa, Ontario, Canada K1N 6N5
Abstract - Software induced delays in a digital control system can lead to degradation in performance and as a result plant response characterizing performance requirements such as percent overshoot, rise time, and settling time can be violated. In the worst case the digital control system can become unstable. These delays can be constant or varying from one period to the other. The latter type of delay is known as jitter. Existing solutions attempt to improve the performance of digital control systems in the presence of software induced delays notwithstanding shortcomings. These include but are not limited to, a lack of regard for satisfying plant response characterizing performance requirements, implementation complexity, and an increase in the runtime overhead to execute the solution. In addition, a solution to compensate for input-output and output jitter for proportional integral derivative (PID) controllers is not available in the literature. Taking the problem to be solved and shortcomings in the literature into account, this paper proposes method to design a discrete-time PID controller that compensates for sampling, input-output, and output jitter. The solution initially models the worst case delay between input to output and then places it in a model of the digital control system in the forward loop between the PID controller and plant. Subsequently, the PID controller is tuned to satisfy plant response characterizing performance requirements. The two main advantages of this solution is that plant response characterizing performance requirements are satisﬁed and the execution time of the PID controller remains unchanged. An evaluation of the performance using a step input experiment validate that the proposed solution is capable of satisfying plant response characterizing performance requirements whereas the uncompensated counterpart failed to satisfy one requirement. A square wave tracking experiment also demonstrated that the proposed solution improved performance.
Keywords: Jitter Compensation, Real-Time Digital Control Systems, Software Execution Delay Induced Performance Degradation, PID Controllers.
© Copyright 2014 Authors - This is an Open Access article published under the Creative Commons Attribution License terms. Unrestricted use, distribution, and reproduction in any medium are permitted, provided the original work is properly cited.
Date Received: 2014-05-23
Date Accepted: 2014-09-04
Date Published: 2014-10-20
Software that implements the functionality of a digital control system usually executes in a periodic manner. The three main operations of any task that implements the functionality of a digital control system (referred to as a control task in this paper) are: input sampling, calculation of the control law, and outputting the control law to the plant. Usually, the input sampling and outputting the control law are performed by hardware via the analog to digital converter (ADC) and digital to analog converter (DAC) respectively. Software is typically involved in calculating the control law. However, either software or hardware can be used to trigger the ADC and/or DAC.
Execution of the analog to digital (A/D) conversion via the ADC, digital to analog (D/A) conversion via the DAC, control law, and other software routines such as interrupt service routines (ISRs), and real-time operating system (RTOS) scheduler and context switching introduce a delay between sampling of inputs and outputting the control law to the plant. To make matters worse, the timing of these two events can vary from one sampling period to the other. This phenomenon is known as jitter. Therefore the type of delays considered in this paper vary from one period to the other, and it also considers the hardware induced delays from the ADC and DAC. This paper considers three types of jitters viz. sampling, input-output, and output jitter.
The negative effect of software induced delays (both constant and jitter) is a performance degradation, which in the worst case can lead to a violation of performance requirements. Ultimately, it could result in destabilizing the digital control system. This is the problem focused in this paper. Traditional digital control system design methodologies assume that the input sampling, control law calculation, and outputting to the plant all occur simultaneously without any delay. This oversight is one of the contributors to the performance degradation issue.
Literature in the ﬁeld of improving digital control system performance due to software induced delays have several shortcomings. Firstly, not prioritizing satisfying plant response characterizing performance requirements, which are: percent overshoot, rise time, and settling time. Secondly, increased complexity and execution overhead to execute the solution. Finally, a solution to compensate for input-output and output jitter using PID controllers to the best of our knowledge was not found despite its simplicity. A review of the current state of the art is presented in Section 2.
This paper considers a collection of multiple independent single input single output (SISO) digital control systems executing in parallel on a single processor and this collection is referred to as a digital control system set. The task model, model of the digital control system set, along with four representative implementations of digital control sys-tems, which reﬁne the digital control system model within a set are discussed in Section 3. Each implementation is referred to as a conﬁguration in this paper.
The solution that this paper proposes is a discrete-time PID controller capable of compensating for software in-duced jitter. The solution involves modelling the worst case delay between input sampling and outputting to the plant, and placing this delay in a model of the digital control system in the forward loop between the PID controller and plant. This worst case delay between input to output is assumed to be one sampling period and this assumption is referred to as the one sampling period delay assumption. The discrete-time PID controller is tuned to satisfy performance requirements. A discussion of the proposed solution is provided in Section 4.
An evaluation of the proposed solution which involves controlling the voltage stabilizer example plant model described by Lozoya et al.  and Marti et al.  is presented in Section 5, while the performance results from the evaluation are presented in Section 6. The performance evaluation makes use of the four conﬁgurations described in Section 3. Performance results reveal that the proposed solution is capable of satisfying plant response characterizing performance requirements in the presence of software induced jitter when its uncompensated counterpart failed to fulﬁll at least one requirement. Finally, Section 7 provides concluding remarks.
2. Related Work
The literature for improving digital control system performance in the presence of software induced delays can be classiﬁed into three perspectives and they are described in the following subsections.
2.1. Control Systems Perspective
Compensating for software induced delays in the digital controller is the hallmark feature of solutions from the control systems perspective. Astrom and Wittenmark  describe a method to model a constant delay between the input and response from the plant. A tutorial by Mathworks  discusses how to compensate only for a constant delay using a PID controller, which leverages the method described by Astrom and Wittenmark .
The research by Marti et al. , to the best of our knowledge is the only solution that compensates for sampling jitter using a PID controller. Additionally, this solution is also intended for state feedback controllers. Smeds and Lu  propose to cascade an add-on compensator to the main controller to compensate for input-output jitter. This add-on compensator adds a zero near the Nyquist frequency to attenuate the control gain. The one-shot solution by Lozoya et al.  makes use of prediction to compensate for input-output jitter for state feedback controllers. This solution allows sampling jitter to be present, and predicts the control law which is applied at the start of the next sampling period.
2.2. Real-Time Systems Perspective
Solutions from the real-time systems perspective improve control system performance indirectly by reducing software induced delays and jitter. Adjusting the relative deadline is one method to reduce jitter, because this reduces the slack time between task response and relative deadline. Hong et al.  proposed an approach to adjust the relative deadline where the relative deadline is initially adjusted ofﬂine and subsequently re-adjusted online as the workload changes.
Changes can also be made to the scheduling policy to minimize jitter. The solution described by Nasri and Kargahi  modifies the task schedule generated by the earliest deadline ﬁrst (EDF) scheduling policy. Liu et al.  proposed a different solution where the preemption segment of a task is changed statically to reduce software induced jitter.
2.3. Control Scheduling Co-Design Perspective
The control scheduling co-design type solutions aim to apply real-time systems and control systems approaches in a collaborative manner to design multiple digital controllers executing as real-time tasks. In addition, solutions from this perspective attempt to maximize performance of the digital controllers by applying optimization based approaches in an iterative manner. Solutions by Wu et al.  and Aminifar et al.  are examples of solutions from this perspective.
3. System Modelling
All details related to the model of the digital control system used in this paper are elaborated in this Section. The control task model is initially discussed, followed by a description of the structure of the digital control system set model. Finally, the structure and timing of the digital control system model within a set is reﬁned to represent four realistic ways of implementing a digital control system.
3.1. Task Model
The functionality of a digital control system set considered in this paper can be modeled as a control task set: . Each control task has an inﬁnite periodic instantiation set otherwise known as a job set: . The execution of four consecutive jobs from to is depicted in Figure 1.
The response time, (start of sampling period to event (3)) for jobis the time it takes from the start of the sampling period to output the control law to the plant. Taking the response time of a control task and one sampling period delay assumption into account (worst case delay between input to output), each control task has to adhere to the timing constraint given by (1),
is the input sampling to outputting to the plant delay (event (2) to (3)) for job . is the delay to output to the plant from the previous sampling period to the current sampling period (event (3)s from jobs to ). is the sampling interval for job , which is the delay from the input sampling event from the previous sampling period to the current sampling period (event (1)s from jobs to ). The sampling interval is distinct from the sampling period hi. The latter is always constant while the former varies from one period to the other.
Using the terminology introduced in this Section, the three types of jitters considered in this paper are deﬁned as follows:
- Sampling Jitter: Variation in for Ti.
- Input-output Jitter: Variation in for Ti.
- Output Jitter: Variation in for Ti.
When there is only one digital control system in the set, input-output and output jitter also exist. This is because the A/D and D/A conversions, RTOS scheduler execution, and control law calculation can jitter. However, sampling jitter does not exist in this scenario because no other control tasks exist to interfere the trigger of the A/D conversion. As additional digital control systems are introduced into the set, the three types of jitters increase in tandem because each task interferes with the other tasks' execution.
3.2. Model Structure
The digital control system set used in this paper (also used in the performance evaluation) consists of ﬁve SISO independent digital control systems that execute in parallel. All ﬁve digital controllers of the ﬁve digital control systems execute on a single processor. The model diagram of the structure of a digital control system in a set is depicted in Figure 2.
The two ADCs and DAC are modeled as sample and hold, and zero order hold devices respectively. Both types of devices have variable execution times so that they model real ADCs and DACs. The periodic workﬂow of the model occurs as follows:
- Discretizing the inputs r(t) and y(t) using the ADCs via sample and hold to produce r() and y(j).
- Comparing r() and y() to produce the error signal e().
- Executing the control law by the PID controller to produce the control signal u().
- Converting u() to a continuous time signal u(t) using the DAC and outputting it to the plant.
A conﬁguration is determined by the trigger method, which is either software or hardware to trigger the ADCs and DAC for all digital control systems within a set. These four conﬁgurations are described as follows:
Conﬁguration 1: This is the most conservative conﬁguration out of the four because minimization of jitter is the main priority. Hardware is used to trigger both the ADCs and DAC at precise instants in time.
Conﬁguration 2: Software is used to trigger the DAC whereas hardware is used to trigger both the ADCs. Sampling jitter is completely minimized in this conﬁguration while input-output and output jitter are much larger compared to conﬁguration 1.
Conﬁguration 3: Hardware is used to trigger the DAC while software is used to trigger both the ADCs. In this conﬁguration both sampling and input-output jitter are present whereas output jitter is minimized.
Conﬁguration 4: This is the least conservative conﬁguration among the four due to not prioritizing jitter minimization. Software is used to trigger both the ADCs and DAC and hence, sampling, input-output, and output jitter are present.
4. Jitter Compensating PID Controller
The design of the proposed solution is carried out in two main steps, which are, continuous-time design and discrete-time design. The purpose of the continuous-time design is to determine the appropriate rise time, which is used to derive the sampling period. The equation to calculate the sampling period according to Astrom and Wittenmark  is give by (2),
Tr is the rise time and N is an integer. Astrom et al. suggests [4,10] whereas J. Liu suggests [10,20] for the value of N. This research uses the value of 10 because it is the middle value of the two approaches, and it results in a good trade-off between scheduling periodic software tasks and quality of control. From a control systems point of view having a low sampling period yields good control performance. On the other hand, a low sampling period creates problems for scheduling multiple tasks as it increases the processor utilization.
The resulting rise time after the design is usually less than or equal to the required rise time. Therefore, according to (2) a lower sampling period can be chosen if the rise time is decreased. Consequently, the performance of the digital control system is improved by utilizing a smaller sampling period.
After obtaining the sampling period from the continuous-time design, the next step is to discretize the continuous-time plant. Subsequently, the worst case delay between input sampling to outputting to the plant is taken as one sampling period, and placed in the forward loop between the PID controller and discrete-time plant. This worst case delay between input sampling to output is the one sampling period delay assumption. In the z domain the one sampling period delay is modeled as z−1. The diagram of this discrete-time design is shown in Figure 3.
The next step in the design process is to tune the PID controller to satisfy performance requirements. This research used the PID tuner described by Mathworks  from Simulink. Tuning the PID controller involves using a graphical user interface with a slider that updates the plant output response when the position of the slider changed.
Finally, the designed PID controller is interfaced with a continuous-time plant and reference input through two ADCs and a DAC. A comparison of the underlying Simulink simulation model of the PID controller that compensates for jitter against a non-jitter compensating counterpart revealed that only the P, I, and D constants were updated. This implies that the execution time of the PID controller remains unchanged. Therefore, digital control systems with already strict timing budgets can beneﬁt from this solution.
5. Performance Evaluation
Details pertaining to evaluating performance of the proposed solution are presented in this Section. A discussion on the experimental setup is initially presented followed by a description of the method used to evaluate performance.
5.1. Experimental Setup
A Simulink simulation based evaluation of the proposed solution is carried out to determine its effectiveness in the presence of software induced jitter. The digital control system set model described in Section 3.2 is simulated. For the evaluation Simulink is used as the simulation engine and the TrueTime simulation platform by Cervin et al.  is used to simulate multiple control tasks executing in parallel on a single processor. TrueTime exists as a separate Simulink simulation block that can be simulated along with Simulink's native simulation blocks. This simulation block is referred to as the TrueTime kernel in the literature. A real-time kernel is used in the TrueTime kernel and EDF or Rate Monotonic (RM) is used as the task scheduling policies. This evaluation uses EDF to schedule the ﬁve digital control tasks.
In this evaluation, the performance of the following three types of digital control system sets are compared:
- NewComp: The digital control systems are implemented using the four conﬁgurations and the proposed solution (jitter compensating PID) is used.
- UnComp: The digital control systems are implemented using the four conﬁgurations and the proposed solution is not used.
- CompOnePeriod: The digital control systems are implemented using only the ﬁrst conﬁguration and the pro-posed solution is used. The ﬁxed sampling to output delay for each digital control system is set to one sampling period. This digital control system set is similar to what is used in the literature described in Section 2.1.
During performance evaluation, all digital control systems within a set (other than CompOnePeriod) use the same conﬁguration. Only the ﬁrst digital control system in a set controls an actual plant, whereas the software for the other four digital control systems execute periodically. The only difference between ﬁrst control task and the four periodic control tasks is the latter do not read from and write to ADCs and DAC respectively. Apart from that everything else that is executed in the task remains the same. The voltage stabilizer example plant presented by Lozoya et al.  and Marti et al.  is used as the plant for the ﬁrst digital control system. The transfer function of this plant is given by (3),
The Simulink simulation model with TrueTime and the voltage stabilizer plant is shown in Figure 4. Design parameters including plant response characterizing performance requirements for the voltage stabilizer plant is depicted in Table 1. Reasonable requirements were formulated as these types of requirements were not provided in the literature.
Table 1. Design parameters for the voltage stabilizer digital control system example
|% overshoot||< 10%|
|Rise time||< 30ms|
|Settling time||< 100ms|
5.2. Method of Evaluation
Two types of experiments are carried out as part of the performance evaluation which are: step input and tracking. In the ﬁrst experiment, the step input is used as the reference input and performance is measured using four metrics viz. percent overshoot, rise time, settling time, and an integrated absolute error (IAE) cost function. In the second experiment, a periodic square wave function is used as the reference input. The fourth metric is only used in the tracking experiment because the other three are not applicable. According to Astrom and Wittenmark , the IAE cost function integrates errors up to inﬁnity, however, in this evaluation a ﬁnite duration is considered. For the step input experiment the experiment duration is 100 h1 periods whereas for the tracking experiment 1000 h1 periods are used as the duration. In both experiments the reference input is only used by the ﬁrst digital control system in a digital control system set.
6. Performance Results
The step input experiment performance results are shown in Table 2. Performance results in bold font indicate a violation of performance requirements in Table 1. When compared to Table 1, NewComp and CompOnePeriod types satisﬁed performance requirements, whereas UnComp was unable to satisfy the percent overshoot requirement.
Table 2. Voltage stabilizer digital control system average step input performance
|System Type||Metric||Cfg 1||Cfg 2||Cfg 3||Cfg 4|
From a real-time systems perspective, satisfying timing constraints is important, however, results from UnComp show that despite meeting these constraints it is not a sufﬁcient condition to ensure satisfying performance require-ments. Therefore, compensation of delays is essential. An overall improvement in NewComp compared to the other two system sets is observed according to the IAE results.
The 95% conﬁdence intervals for the performance data in Table 2 is shown in Table 3. When comparing the conﬁdence intervals for each metric among the three different system set types for each individual conﬁguration, there is no overlap in the conﬁdence intervals. This implies that the difference of a particular metric among the three system set types for each conﬁguration is statistically signiﬁcant.
Table 3. Voltage stabilizer digital control system step input performance 95% confidence intervals
|System Type||Metric||Cfg 1||Cfg 2||Cfg 3||Cfg 4|
Tracking performance results are shown in Table 4 and it also demonstrates that NewComp performed better compared to CompOnePeriod and UnComp types.
Table 4. Voltage stabilizer digital control system average tracking performance
|System Type||Cfg 1||Cfg 2||Cfg 3||Cfg 4|
Table 5 shows the 95% conﬁdence intervals of the performance results in Table 4. There is no overlap in the conﬁdence intervals among the three different system set types for each conﬁguration. This implies that the difference in performance is statistically signiﬁcant.
Table 5. Voltage stabilizer digital control system tracking performance 95% confidence intervals
|System Type||Cfg 1||Cfg 2||Cfg 3||Cfg 4|
The performance results are not conclusive enough to judge which configuration has the best overall performance as there is overlap in the confidence intervals for the tracking performance results among the configurations for each system type. However, configuration 2 seems to be a popular choice because most modern microcontrollers have the facility to trigger ADCs automatically without software intervention.
This paper presents a solution to compensate for software induced delays in digital control systems using PID con-trollers, and it focuses mainly on jitter compensation. The two main advantages of this solution are: plant response characterizing requirements are satisfied and the PID controller execution time remains unchanged. The latter is a huge benefit for digital controllers that execute on computer systems that already have tight timing budgets. Simulation based experiments showed that the proposed solution satisfied plant response characterizing performance requirements for the voltage stabilizer digital control system example. Performance results also revealed that satisfying timing constraints is a necessary condition to satisfy performance requirements, however, it is not a sufficient condition. Compensation of delays is essential to obtain the required performance. According to the IAE metric, an improvement in performance is observed in the proposed solution when used in digital control systems that output the control law to the plant with an input to output delay less than one sampling period compared to digital control systems that have an input to output delay of one sampling period. This implies that reducing the delay between input to output is necessary to improve performance.
 Aminifar, A., Eles, P., Peng, Z. & Cervin, A. (2013), Control-quality driven design of cyber-physical systems with robustness guarantees, in 'Design, Automation & Test in Europe (DATE 2013)', Grenoble, France, pp. 1093-1098. View Article
 Åström, K. J. & Wittenmark, B. (1995), PID Controllers: Theory, Design, and Tuning, second edn, The Instrument Society of America, Research Triangle Park, NC. View Book
 Åström, K. J. & Wittenmark, B. (2011), Computer-Controlled Systems, third edn, Dover Publications, Mineola, NY. View Book
 Cervin, A., Henriksson, D., Lincoln, B., Eker, J. & Årzén, K. E. (2003), 'How does control timing affect performance? analysis and simulation of timing using Jitterbug and TrueTime', IEEE Control Systems Magazine 23(3), 16-30. View Article
 Hong, S., Hu, X. S. & Lemmon, M. D. (2010), Reducing delay jitter of real-time control tasks through adaptive deadline adjustments, in 'Real-Time Systems (ECRTS), 2010 22nd Euromicro Conference on', Brussels, Belgium, pp. 229-238. View Article
 Liu, Z., Zhao, H., Li, P. & Wang, J. (2009), An optimization model for IO jitter in device-level RTOS, in 'Information Technology: New Generations, 2009. ITNG '09. Sixth International Conference on', Las Vagas, Nevada, USA, pp. 1528-1533. View Article
 Lozoya, C., Velasco, M. & Marti, P. (2008), 'The one-shot task model for robust real-time embedded control systems', IEEE Transactions on Industrial Informatics 4(3), 164-174. View Article
 Marti, P., Fuertes, J. M., Fohler, G. & Ramamritham, K. (2001), Jitter compensation for real-time control systems, in 'Real-Time Systems Symposium, 2001. (RTSS 2001). Proceedings. 22nd IEEE', London, England, pp. 39-48. View Article
 Marti, P., Velasco, M., Fuertes, J., Camacho, A. & Buttazzo, G. (2010), 'Design of an embedded control system laboratory experiment', IEEE Transactions on Industrial Electronics 57(10), 3297-3307. View Article
 Mathworks (2013), Simulink©Control DesignTMUsers Guide. View Article
 Mathworks (2014), 'Modeling computational delay and sampling effects'. consulted 18 October 2014. URL: View Article
 Nasri, M. & Kargahi, M. (2012), A method for improving delay-sensitive accuracy in real-time embedded systems, in 'Embedded and Real-Time Computing Systems and Applications (RTCSA), 2012 IEEE 18th International Confer-ence on', Seoul, Korea, pp. 378-387. View Article
 Smeds, K. & Lu, X. (2012), 'Effect of sampling jitter and control jitter on positioning error in motion control systems', Precision Engineering 36(2), 175-192. View Article
 Wu, Y., Buttazzo, G., Bini, E. & Cervin, A. (2010), 'Parameter selection for real-time controllers in resource-constrained systems', IEEE Transactions on Industrial Informatics 6(4), 610-620. View Article