0% found this document useful (0 votes)
15 views58 pages

Monitoring and Control Systems

Chapter 7 discusses monitoring and control systems, defining monitoring systems as those that track conditions and control systems as those that can take action based on that data. It explains the roles of sensors and actuators, the importance of feedback in closed-loop systems, and how monitoring systems can be upgraded to control systems. The chapter also covers system architecture, signal flow, and real-time programming concepts.

Uploaded by

Nourhene Aouidi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views58 pages

Monitoring and Control Systems

Chapter 7 discusses monitoring and control systems, defining monitoring systems as those that track conditions and control systems as those that can take action based on that data. It explains the roles of sensors and actuators, the importance of feedback in closed-loop systems, and how monitoring systems can be upgraded to control systems. The chapter also covers system architecture, signal flow, and real-time programming concepts.

Uploaded by

Nourhene Aouidi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 58

Chapter 7

Monitoring
and control
systems
Table of contents
01 02 03
Introduction Monitoring Control Systems
Systems

04 05 06
Feedback Control Practical Key Takeaways
Systems Applications
01
Introduction
Introduction
Can you name a system or device you used today
that monitors or controls something automatically?
Introduction
Have you ever wondered how systems like air
conditioners maintain the right temperature?
02
Fundamentals of
Monitoring Systems
What is a Monitoring System?

Have you ever wondered how systems like air


conditioners maintain the right temperature?

Definition: A system that records and tracks conditions


over time .

Primary Purpose:

● Detect when physical properties exceed desired ranges


● Example: CPU temperature monitoring
Temperature Monitoring Case Study
1. Traditional vs. Computerized Methods:
○ Traditional: Mercury thermometer (human reading)
○ Modern: Computer-based measurement
○ Key Difference: Need for electronic data
transmission
2. Introduction to Sensors:
○ Definition: Hardware devices that measure
properties and transmit values to computers
○ Example: Thermocouple
■ Operation: Converts temperature to voltage
■ Key Feature: No built-in intelligence
■ Role: Pure measurement device
Types of Sensors
1. Property-Specific Sensors:
○ Pressure sensors
○ Humidity sensors
○ Carbon monoxide detectors
○ pH meters
○ Sound sensors
2. Multi-Purpose Sensors:
○ Infrared sensors
○ Motion sensors
03
Introduction to Control
Systems
Beyond Monitoring
● Key Addition: Control capability
● Essential Component: Actuators

Understanding Actuators
● Definition: Electric motors connected to controlling devices
● Functions:
○ ON/OFF switching
○ Setting adjustment
○ Continuous control
Beyond Monitoring Which are pure monitoring systems?
Which are control systems?
● Key Addition: Control capability 1. Home thermometer
● Essential Component: Actuators 2. Smart thermostat
3. Smoke detector
4. Security camera
Understanding Actuators 5. Automated security system

● Definition: Electric motors connected to controlling devices


● Functions: How could monitoring systems be
○ ON/OFF switching upgraded to control systems?
○ Setting adjustment
○ Continuous control
Pure Monitoring Systems are those that only observe and report
data without taking any action.

Examples:

● Thermometer: Measures temperature but doesn’t change


it.
● Fitness Tracker: Tracks steps or heart rate but doesn’t
take corrective actions.
● Security Camera: Records video footage but doesn’t react
to events.
Step 2: Identify Control Systems

Control Systems both monitor and take automatic action to adjust


or manage a process.

Examples:

● Thermostat: Measures room temperature and adjusts


heating/cooling to maintain the desired level.
● Traffic Lights: Monitors traffic flow (via sensors) and
changes signals to manage congestion.
● Washing Machine: Detects water level, temperature, and
cycle progress, then automatically adjusts the process.
Step 3: How Could Monitoring Systems Be
Upgraded to Control Systems?

We can make a monitoring system into a control system by


enabling it to take action based on the data it collects.

Examples:

● Thermometer → Thermostat: Add a connection to a


heater or air conditioner that adjusts based on the
temperature reading.
● Fitness Tracker → Health Assistant: Add a feature to
alert the user or adjust their activity schedule if their heart
rate is too high or too low.
● Security Camera → Smart Security System: Add motion
sensors that trigger alarms, send alerts, or lock doors when
suspicious activity is detected.
Why can't sensors take action independently?

Sensors are input devices designed to measure or detect


physical properties (e.g., temperature, motion, light) and convert
them into data. They cannot take action because:

1. Lack of Processing Power: Sensors only collect data;


they don’t analyze it or decide what actions to take.
2. No Actuation Mechanism: Sensors don’t have the
physical components needed to perform actions (e.g.,
turning on a motor or adjusting a valve).
3. Dependency on Control Units: The decision-making and
action are typically handled by a separate controller or
system that interprets the sensor's data.
03
System Architecture
Computer-Controlled Environment
Components
● Signal Flow:
1. Analogue signals from environment
2. ADC conversion for computer processing
3. Digital processing and decision making
4. DAC conversion for actuator control

"Why do computers need to convert analog signals to digital?"

"What might happen if we skipped the conversion process?"


Signal Flow:

1. Analogue signals from environment


○ Analogue signals are continuous signals that represent real-world data.
Examples include the temperature detected by a thermometer or the light
intensity measured by a light sensor.
○ These signals are analog because they vary continuously and are not in a
discrete form. For instance, a thermometer gives a value like 22.5°C, which can
take any value between 0°C and 100°C (if it's Celsius).
2. ADC (Analog-to-Digital Conversion) for computer processing
○ ADC (Analog-to-Digital Converter) is a device that converts the continuous
analog signals into a discrete digital format that computers can process.
○ Digital signals are represented by binary data (0s and 1s), which are easy for
computers to handle. The ADC samples the analog signal at specific intervals and
converts it into a corresponding digital value.
Digital processing and decision-making

● Once the signal is converted to digital form, the computer can process the data using
algorithms or decision-making logic.
● For example, in a thermostat system, the computer processes the digital temperature
reading to decide whether to turn the heater on or off.

DAC (Digital-to-Analog Conversion) for actuator control

● DAC (Digital-to-Analog Converter) takes the digital decision from the computer and
converts it back into an analog signal to control physical devices (actuators).
● For instance, after deciding that the room is too cold, the computer can send a digital
signal to the heater's actuator (e.g., a relay) to activate it. This is the part where the
digital decision results in physical action.
04
Feedback Control Systems
Slide: Timing and Feedback Mechanisms

System Operation Cycle:

1. Measurement Phase:
○ The computer triggers sensor readings at fixed intervals.
○ The data is converted from analog to digital using an ADC.
2. Sampling Rates:
○ Sampling rate: The frequency at which the system checks the environment.
○ Example: A temperature sensor may take readings every second or minute.

What happens if the sampling rate is too slow?

What happens if the sampling rate is too fast?


05
Closed-Loop Feedback
Systems
Closed-Loop Feedback Control System

Overview:

● A closed-loop feedback control system is a type of system where feedback directly


influences the system's operation.
System Components:
How It Works:
1. Desired Value (Setpoint):
● The sensor reads the actual output and
○ The target value that the system should
achieve (e.g., a temperature of 22°C). sends it to the controller.
2. Controller (Microprocessor): ● The controller compares this value with
○ Compares the actual output to the the desired output.
desired value. ● If there’s a difference, the controller
○ Calculates the difference (error) and sends a signal to the actuator to adjust
determines the necessary action. the system (e.g., turn on the heater).
3. Sensor:
● The cycle repeats, continuously
○ Measures the actual output (e.g.,
correcting the system to match the
current temperature).
4. Actuator: desired value.
○ Receives the controller's command
and adjusts the process to correct any
difference between the actual and
desired output.
5. Process:
○ The system or environment being
controlled (e.g., heating system).
Group Activity: Design a simple closed-loop system for:

1. Water tank level control


2. Room lighting control
06
Real-Time
Programming
Implementation
Understanding Bit Flags (30 minutes)

What are Bit Flags?


● Single bits representing boolean states
● Efficient memory usage
● Fast processing
● Multiple flags in one byte
Assembly Language Operations (40 minutes)

1. Initializing Flags (System Start)


What's happening:

● Loading memory location 0034


● Using AND to set all bits to 0
● Storing back to memory
Assembly Language Operations (40 minutes)

2. Toggling a Flag
Use cases:

● Problem detection/resolution
● State changes
● Alert acknowledgment
Assembly Language Operations (40 minutes)

3. Setting a Specific Flag


● Bit 2 becomes 1
● Other bits unchanged
● Used for status indication
Assembly Language Operations (40 minutes)

4. Isolating a Flag
Applications:

● Testing specific conditions


● Status checking
● Error detection
; Program to input numbers and calculate their sum
; Using symbolic addressing

IN ; Input first number (count of numbers to process)


SUB #48 ; Convert ASCII to binary
STO MAX ; Store at MAX label - this is how many numbers to process

LDM #0 ; Load 0 into accumulator


STO TOTAL ; Initialize TOTAL to 0
STO COUNT ; Initialize COUNT to 0

STRTLP: IN ; Input a number from keyboard


SUB #48 ; Convert ASCII code to binary value
ADD TOTAL ; Add current total to new number
STO TOTAL ; Store new sum back in TOTAL

LDD COUNT ; Load current count


INC ACC ; Increment count by 1
CMP MAX ; Compare count with max number of inputs
JPN STRTLP ; If not equal, jump back to STRTLP
END ; End program if count equals max

; Data storage locations


MAX: 0 ; Stores how many numbers to process
TOTAL: 0 ; Stores running total of numbers
COUNT: 0 ; Stores current count of numbers processed
; Example: Let's calculate sum of 3 ; First number (5)
numbers: 5, 7, 4 STRTLP: IN ; Input first number 5
; Program shows state of registers/memory (ASCII 53)
after each instruction ; ACC = 53

IN ; User inputs 3 SUB #48 ; Convert ASCII to


(ASCII 51) binary
; ACC = 51 (ASCII ; ACC = 5 (53 - 48 = 5)
code for '3')
ADD TOTAL ; Add current TOTAL (0)
SUB #48 ; Convert ASCII to ACC
to binary ; ACC = 5 (5 + 0 = 5)
; ACC = 3 (51 - 48
= 3) STO TOTAL ; Store sum in TOTAL
; TOTAL = 5, ACC = 5
STO MAX ; Store 3 at MAX
; MAX = 3, ACC = 3 LDD COUNT ; Load COUNT into ACC
; ACC = 0
LDM #0 ; Load immediate
value 0 INC ACC ; Increment COUNT
; ACC = 0 ; ACC = 1

STO TOTAL ; Initialize CMP MAX ; Compare with MAX (3)


TOTAL to 0 ; 1 ≠ 3, so continue
; TOTAL = 0, ACC = loop
0
JPN STRTLP ; Jump back as COUNT ≠
; Second number (7)
IN ; Input
second number 7 (ASCII 55) ; Third number (4)
; ACC = 55 IN ; Input third
number 4 (ASCII 52)
SUB #48 ; Convert ; ACC = 52
ASCII to binary
; ACC = 7 (55 SUB #48 ; Convert ASCII
- 48 = 7) to binary
; ACC = 4 (52 -
ADD TOTAL ; Add 48 = 4)
current TOTAL (5) to ACC
; ACC = 12 (7 ADD TOTAL ; Add current
+ 5 = 12) TOTAL (12) to ACC
; ACC = 16 (4 +
STO TOTAL ; Store new 12 = 16)
sum in TOTAL
; TOTAL = 12, STO TOTAL ; Store final
ACC = 12 sum in TOTAL
; TOTAL = 16, ACC
LDD COUNT ; Load COUNT = 16
into ACC
; ACC = 1 LDD COUNT ; Load COUNT
into ACC
INC ACC ; Increment ; ACC = 2
COUNT
; ACC = 2 INC ACC ; Increment
COUNT
; Final state of memory locations:
MAX: 3 ; Number of
inputs processed
TOTAL: 16 ; Final sum
(5 + 7 + 4 = 16)
COUNT: 3 ; Final
count equals MAX
Exercise 1: Calculate average of N numbers
; Example: For inputs 3, 6, 8, 4 (N=3, numbers=6,8,4)
Program to add two numbers
Program to add two numbers

; Program to add two numbers


; Example: If user enters 3 and 4, result will
be 7

IN ; Get first number (in ASCII)


SUB #48 ; Convert from ASCII to decimal
(subtract 48)
STO NUM1 ; Store first number in NUM1

IN ; Get second number (in ASCII)


SUB #48 ; Convert from ASCII to decimal
ADD NUM1 ; Add first number to second
number
STO RESULT ; Store sum in RESULT
END

NUM1: 0 ; Storage for first number


RESULT: 0 ; Storage for final sum
Exercise: Find the Larger Number

Purpose: Compare two numbers and keep the larger one


; Program to find larger of two numbers
; Example: If user enters 3 and 7, result will be 7

IN ; Get first number (ASCII)


SUB #48 ; Convert to decimal
STO NUM1 ; Store in NUM1

IN ; Get second number (ASCII)


SUB #48 ; Convert to decimal
STO NUM2 ; Store in NUM2

LDD NUM1 ; Load first number


SUB NUM2 ; Subtract second number
JPN NUM2_BIGGER ; If result negative, NUM2 is bigger

LDD NUM1 ; NUM1 was bigger


STO RESULT ; Store NUM1 as result
JMP DONE ; Skip to end

NUM2_BIGGER:
LDD NUM2 ; Load NUM2
STO RESULT ; Store NUM2 as result

DONE: END

NUM1: 0 ; Storage for first number


NUM2: 0 ; Storage for second number
RESULT: 0 ; Storage for larger number
Exercise: Double a Number
Exercise: Double a Number

; Program to double a number


; Example: If user enters 4, result will be 8

IN ; Get number (ASCII)


SUB #48 ; Convert to decimal
STO NUM ; Store in NUM
; At this point if user entered 4, NUM = 4

ADD NUM ; Add the number to itself


; This doubles it (like multiplying by 2)
STO RESULT ; Store the doubled number

END

NUM: 0 ; Storage for input number


RESULT: 0 ; Storage for doubled number
Exercise: Check if Number is Even
Exercise: Check if Number is Even

; Program to check if number is even


; Result will be 1 if even, 0 if odd
; Example: If user enters 6, result = 1 (even)
; If user enters 5, result = 0 (odd)

IN ; Get number (ASCII)


SUB #48 ; Convert to decimal
STO NUM ; Store number

DIV #2 ; Divide by 2
MUL #2 ; Multiply by 2
; If number was even, we get original number
; If odd, we get number - 1

SUB NUM ; Subtract original number


; If result is 0, number was even
; If result is -1, number was odd

JPN ODD ; If negative (odd), jump

LDM #1 ; Load 1 (for even)


STO RESULT
JMP DONE

ODD:
LDM #0 ; Load 0 (for odd)
STO RESULT

DONE: END

NUM: 0 ; Storage for input number


RESULT: 0 ; 1 if even, 0 if odd
Title: Understanding Flags in Computer Architecture
Flags are single-bit (0 or 1) indicators in a processor that provide information about the result of the most recent
operation. Think of them like warning lights on a car's dashboard. The most common flags are:

1. Zero Flag (Z)


○ Set to 1 if result is zero
○ Example: After 5-5=0, Z=1
2. Sign Flag (S/N)
○ Set to 1 if result is negative
○ Example: After 3-7=-4, S=1
3. Carry Flag (C)
○ Set to 1 if operation produced a carry
○ Example: 8-bit addition: 255+1 sets C=1
4.
Common Uses:

● Control program flow (conditional jumps)


● Error detection
● Status monitoring
06
Key Takeaways
● Monitoring systems observe and record; control
systems act.
● Sensors and actuators are essential components.
● Feedback loops ensure adjustments based on real-time
data.
● Bit manipulation plays a vital role in programming
control systems.
Thank you
Educational Icons Medical Icons
Business Icons Teamwork Icons
Help & Support Icons Avatar Icons
Creative Process Icons Performing Arts Icons
Nature Icons
SEO & Marketing Icons

You might also like