---
title: "Direct programming of a third-order controller"
subject: "Digital Control System"
chapter: 4
key: "semester_6/digital_control_system:direct-programming-6z2-7z-16"
source: https://www.bctengineer.com/q/semester_6/digital_control_system/direct-programming-6z2-7z-16
site: BCT Engineering
---

# Direct programming of a third-order controller

Digital Control System · Chapter 4: Design and Compensation of Discrete Time Control System

- Asked in: 2076 Bhadra, 4 marks
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_6/digital_control_system/direct-programming-6z2-7z-16
- Whole chapter: https://www.bctengineer.com/md/semester_6/digital_control_system/chapter-4

## Question

Realize the given digital controller by direct programming: Y(z)/X(z)=(6z²+7z+16)/(10z³+8z²+9z+15).

## Short answer

Divide by 10z^3 to get G(z) = (0.6z^-1+0.7z^-2+1.6z^-3)/(1+0.8z^-1+0.9z^-2+1.5z^-3). Direct form uses three input delays and three output delays with feedforward gains 0.6, 0.7, 1.6 and feedback gains -0.8, -0.9, -1.5. Difference equation: y(k) = -0.8y(k-1) -0.9y(k-2) -1.5y(k-3) +0.6x(k-1) +0.7x(k-2) +1.6x(k-3).

## Answer

#### Step 1: Write in powers of $z^{-1}$
Divide the numerator and denominator by $10z^3$:

$$
\frac{Y(z)}{X(z)} = \frac{0.6z^{-1} + 0.7z^{-2} + 1.6z^{-3}}{1 + 0.8z^{-1} + 0.9z^{-2} + 1.5z^{-3}}
$$

#### Step 2: Difference equation
$$
y(k) = -0.8y(k-1) - 0.9y(k-2) - 1.5y(k-3) + 0.6x(k-1) + 0.7x(k-2) + 1.6x(k-3)
$$

#### Step 3: Block diagram (direct programming)
```text
x(k)
  o              (S)--------------o--> y(k)
  |               ^               |
[z^-1]            |             [z^-1]
  | x(k-1)        |               | y(k-1)
  o--[0.6]------>(S)<[-0.8]-------o
  |               ^               |
[z^-1]            |             [z^-1]
  | x(k-2)        |               | y(k-2)
  o--[0.7]------>(S)<[-0.9]-------o
  |               ^               |
[z^-1]            |             [z^-1]
  | x(k-3)        |               | y(k-3)
  o--[1.6]------>(S)<[-1.5]-------o
```

- The input delay chain gives $x(k-1)$, $x(k-2)$, $x(k-3)$, with gains 0.6, 0.7, 1.6.
- The output delay chain gives $y(k-1)$, $y(k-2)$, $y(k-3)$, fed back with gains $-0.8$, $-0.9$, $-1.5$.
- All products are added in the summer column to give $y(k)$. There is no direct $x(k)$ term.

Direct programming uses $3 + 3 = 6$ delays. (The denominator has roots $-1.1507$ and $0.1754 \pm j1.1282$, which are outside the unit circle, so this filter is unstable as given. The question asks only for its realization.)

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. From (0.6z^-1+0.7z^-2+1.6z^-3)/(1+0.8z^-1+0.9z^-2+1.5z^-3), the difference equation for y(k) is:
   A. y(k) = 0.8y(k-1)+0.9y(k-2)+1.5y(k-3)+0.6x(k-1)+0.7x(k-2)+1.6x(k-3)
   B. y(k) = -0.8y(k-1)-0.9y(k-2)-1.5y(k-3)+0.6x(k-1)+0.7x(k-2)+1.6x(k-3)
   C. y(k) = -0.8y(k-1)-0.9y(k-2)-1.5y(k-3)+6x(k)+7x(k-1)+16x(k-2)
   D. y(k) = -0.8y(k+1)-0.9y(k+2)-1.5y(k+3)+0.6x(k)
   Answer: B. Moving the denominator terms to the right flips their signs; the numerator gives the x(k-1), x(k-2), x(k-3) terms. (Key point: Difference equation)

2. Why is there no direct path from x(k) to y(k) in this diagram?
   A. The denominator is unstable
   B. The z^0 coefficient of the numerator is zero
   C. Direct programming never has a direct path
   D. The feedback gains are negative
   Answer: B. After dividing by 10z^3, the numerator starts at z^-1, so there is no x(k) term. (Key point: No direct term)

3. How many delays does direct programming use for this third-order controller?
   A. 3
   B. 4
   C. 6
   D. 9
   Answer: C. Three delays for past inputs and three for past outputs: 3 + 3 = 6. (Key point: Delay count)

## Close variants set in other exams

- [Direct programming of a third-order controller](https://www.bctengineer.com/question.md?key=semester_6%2Fdigital_control_system%3Adirect-programming-6z2-7z) — Digital Control System, chapter 4, asked 4×
- [Series programming of a digital controller](https://www.bctengineer.com/question.md?key=semester_6%2Fdigital_control_system%3Aseries-programming-controller) — Digital Control System, chapter 4, asked 4×

## Related in Digital Control System

- [Ladder programming of a third-order controller](https://www.bctengineer.com/question.md?key=semester_6%2Fdigital_control_system%3Aladder-8z3) — Digital Control System, chapter 4
- [Ladder programming of a third-order transfer function](https://www.bctengineer.com/question.md?key=semester_6%2Fdigital_control_system%3Aladder-z3-4z2) — Digital Control System, chapter 4, asked 2×
- [Direct programming of a first-order filter](https://www.bctengineer.com/question.md?key=semester_6%2Fdigital_control_system%3Adirect-programming-first-order) — Digital Control System, chapter 4
- [Jury test: 2z⁴+7z³+10z²+4z+1](https://www.bctengineer.com/question.md?key=semester_6%2Fdigital_control_system%3Ajury-2z4-7z3) — Digital Control System, chapter 3, asked 8×
- [Ladder programming of a third-order filter](https://www.bctengineer.com/question.md?key=semester_6%2Fdigital_control_system%3Aladder-third-order-128) — Digital Control System, chapter 4, asked 2×
- [Series programming of a third-order transfer function](https://www.bctengineer.com/question.md?key=semester_6%2Fdigital_control_system%3Aseries-programming-z-plus-1) — Digital Control System, chapter 4, asked 2×

## Related in other subjects

- [Direct form and lattice of FIR, 2+1.8z⁻¹…](https://www.bctengineer.com/question.md?key=semester_7%2Fdigital_signal_analysis_and_processing%3Alattice-fir-2-1-8) — Digital Signal Analysis and Processing, chapter 4, asked 2×
- [Direct form and lattice of FIR, 1+0.7z⁻¹+1.2z⁻²−z⁻³](https://www.bctengineer.com/question.md?key=semester_7%2Fdigital_signal_analysis_and_processing%3Alattice-fir-1-0-7-1-2) — Digital Signal Analysis and Processing, chapter 4, asked 2×
