Digital Signal Conditioning & Digital Fundamentals
Instruments 3.1
Imron Rosyadi
Learning Objectives
By the end of this session, you should be able to:
Explain what digital signal conditioning is and why it is needed in modern instrumentation and control.
Describe how analog process variables (e.g., temperature, level) are represented using digital words.
Convert between binary, decimal, octal, and hexadecimal representations (including fractional numbers).
Interpret and construct simple Boolean algebra expressions for control logic.
Map Boolean expressions into digital gate circuits (AND/OR and NAND/NOR).
Describe the basic role of PLCs and computer interfaces (buses and tri‑state buffers) in control systems.
Why Digital Signal Conditioning?
Modern systems are dominated by digital electronics and computers.
Common ECE/control examples:
Automotive ECUs (engine, ABS, airbags)
Home appliances (washing machines, microwave ovens)
Building automation (HVAC, security, lighting)
Industrial process control (chemical plants, refineries)
All these systems sense analog variables (temperature, pressure, motion, etc.) but internally use digital data.
What Is Digital Signal Conditioning?
In process control, digital signal conditioning means:
Representing analog process information in a digital format.
Ensuring the digital representation is compatible with:
Digital logic families and voltage levels
Microcontrollers, PLCs, and computers
Communication buses and networks
Typically involves:
A/D conversion (analog to digital)
Scaling, encoding, or formatting digital data
Error detection/correction, filtering in the digital domain
Note
Digital representation rarely increases raw accuracy; in fact, quantization and finite word length usually reduce it slightly. But the big win is robustness to noise, drift, and long‑distance transmission.
Why Use Digital Techniques in Control?
Beyond noise immunity, digital control offers:
Multivariable control
One computer can coordinate many variables and loops.
Linearization of sensor outputs
Nonlinear sensor curves (e.g., thermocouples) can be corrected in software.
Complex control algorithms
PID with scheduling, model predictive control, adaptive control, etc.
Easy modification and upgrades
Change control laws or tuning by updating software rather than rewiring.
Networking and integration
Multiple controllers, HMIs, and databases share data over a plant network.
Digital Fundamentals – Big Picture
To use digital techniques in process control we need a basic toolkit:
Digital information and words
Bits, binary representation of numbers.
Number systems
Decimal, binary, octal, hexadecimal; integer and fractional forms.
Boolean algebra
Represent logic conditions as equations.
Digital electronics
Logic gates implementing Boolean operations.
Programmable Logic Controllers (PLCs)
Industrial digital controllers for logic‑heavy tasks.
Computer interfaces and tri‑state buffers
How digital devices share a bus.
Digital Information: Bits and Logic Levels
Digital signals are binary (two‑state) levels.
Physical implementations can be:
Two voltages (e.g., 0 V and 5 V)
Two currents
Two frequencies
Two phases
We label the states:
Logic high: H or 1
Logic low: L or 0
From Bits to Words
A single binary signal (one wire) can carry only 1 bit of information.
To represent richer information (e.g., a measured temperature), we use multiple bits together as a binary word.
Example: a 6‑bit word
Pattern: 101011₂
That’s a 6‑digit base‑2 number, with each digit a bit.
Rugged I/O modules for analog and digital signals.
Programmable using ladder logic, function block diagrams, etc.
Real‑time operation with deterministic scan cycles.
Note
In practice, Boolean equations and gate diagrams for process control are often implemented as PLC ladder logic, not discrete gates.
Computer Interface: The Bus
A typical computer (or microcontroller) connects to external devices through a bus:
Data lines: carry data values.
Address lines: select specific devices/locations.
Control lines: indicate read/write, interrupts, etc.
All attached devices share these lines.
Generic model of a computer bus system
Warning
Sharing the bus safely requires that only one device drive a line at a time. Otherwise, you get bus contention and possibly hardware damage.
Tri‑State Buffers – Sharing a Bus Line
To prevent devices from fighting on a shared line, we use tri‑state buffers.
A tri‑state buffer has:
An input (logic 0 or 1).
An output.
An enable control signal.
It can put the output into three states:
Logic 0
Logic 1
High‑impedance (effectively disconnected)
Two signals sharing a bus via tri-state buffers
When \(E_1\) is active, \(A\) is placed on the bus; other buffers must be disabled.
When \(E_2\) is active, \(B\) is placed on the bus.
Tip
High‑impedance state = “not driving the line” → like opening a switch.
Worked Problem 1 – Encoding a Sensor Reading
Scenario: You have a temperature sensor whose output after analog conditioning is mapped to a digital word between 0 and 63 (6 bits). At a given moment, the reading is \(101011_2\).
What is the decimal value of this reading?
If 0 corresponds to 0 °C and 63 corresponds to 63 °C, what temperature does this code represent?
Successive division by 2 (decimal → binary integer)
Repeatedly divide the decimal number by 2.
Record remainders; read them in reverse order as bits.
Successive multiplication by 2 (decimal fraction → binary)
Repeatedly multiply the fractional part by 2.
The integer parts of each result form the bits in order.
Boolean expression for mixing‑tank alarm\[
D = \bar{A} \cdot B + A \cdot C + A \cdot \bar{C} \cdot B
\] Simplified: \[
D = A \cdot C + B
\]
Example interlock logic\[
M = S \cdot \bar{T} \cdot \bar{E}
\]
Interactive Deck
Warmup: Binary to Decimal
Use this code cell to convert a binary string to decimal. Change the binary_str variable and click Run Code.
Decimal to Binary
Now convert a non‑negative integer to binary using the successive division by 2 method. Modify n and re‑run.
Explore Binary Fractions – Manual Conversion
Use the binary fraction formula from the main deck: \[
N_{10} = b_1 2^{-1} + b_2 2^{-2} + \dots + b_m 2^{-m}
\]
Edit binary_fraction (just bits after the point) and run the cell.
Decimal Fraction to Binary – Successive Multiplication
This implements the “repeated multiply by 2” algorithm from the text. Change x and max_bits to see more/less precision.
Converting Between Binary, Octal, and Hex
This code groups bits in 3s (octal) and 4s (hex) to convert a binary string.
Reactive Demo: Word Length and Resolution (Sliders + Plotly)
Use the sliders to change the number of bits and the full‑scale range of an A/D converter. We’ll compute and plot the quantization staircase.
viewof n_bits = Inputs.range([2,12], {step:1,value:6,label:"Number of bits (N)"})viewof full_scale = Inputs.range([1,20], {step:1,value:10,label:"Full-scale range (V)"})
Reactive Demo: Binary Fraction Explorer
Use the slider to select how many fractional bits to keep. We’ll display the approximate value of a fixed target number (e.g., 0.7) as a binary fraction.
Control three Boolean inputs with buttons, and let Python compute the alarm condition from the mixing tank example: \[
D = \bar{A} \cdot B + A \cdot C + A \cdot \bar{C} \cdot B
\]
viewof A = Inputs.toggle({label:"A (Level high?)",value:false})viewof B = Inputs.toggle({label:"B (Pressure high?)",value:false})viewof C = Inputs.toggle({label:"C (Temperature high?)",value:false})
Interactive Exercise: Design Your Own Logic
Now define your own Boolean logic for a motor enable signal (M).
Conditions (suggestion):
(S): Start command (1 = requested).
(P): Pressure OK (1 = within safe range).
(T): Temperature OK (1 = within safe range).
You can propose your own rule, e.g.: \[
M = S \cdot P \cdot T
\]
Use the toggles and modify the expression inside the code.
viewof S = Inputs.toggle({label:"S (Start command)",value:false})viewof P = Inputs.toggle({label:"P (Pressure OK)",value:true})viewof T = Inputs.toggle({label:"T (Temperature OK)",value:true})