Sunteți pe pagina 1din 9

Homework 1 Solutions:

1.1 Question: Draw a component block diagram for each of the following feedback
control system.
(a) The manual steering system of an automobile
(b) Drebbel’s incubator
(c ) The water level controlled by a float and valve
(d) Watt’s steam engine with fly-ball governor

In each case, indicate the location of the elements listed below and give the units
associated with each signal.
• The process
• The process desired output signal
• The sensor
• The actuator
• The actuator output signal
• The controller
• The controller output signal
• The reference signal
• The error signal
Notice that in a number of cases the same physical device may perform more than
one of these functions.

Solution:
a) A manual steering system for an automobile:

b) Drebbel’s indicator:
c) Water level regulator:

d) Fly-ball governor:

e) Automatic steering of a ship:

f) A public address system:


1.2 Question: Identify the physical principles and describe the operation of the
thermostat in your home or office.

Solution: A thermostat is a device for maintaining a temperature constant at


a desired value. It is equipped with a temperature sensor which detects
deviation from the desired value, determines whether the temperature
setting is exceeded or not, and transmits the information to a furnace or air
conditioner so that the temperature in the room is brought back to the desired
setting.

Examples: Tubes filled with liquid mercury are attached to a bimetallic strip
which tilt the tube and cause the mercury to slide over electrical contacts. A
bimetallic strip consists of two strips of metal bonded together, each of a
different expansion coefficient so that themperature changes bend the metal.
In some cases, the bending of bimetallic strips simply cause electrical
contacts to open or close directly. Temperature can also be sensed
slectronically using a thermistor, a resistor whose resistance changes with
temperature. Modern computer-based thermostats sense the current from
the thermistor and convert that to a digital signal.

1.6. Question: Draw a block diagram of the components for an elevator-position


control. Indicate how you would measure the position of the elevator car.
Consider a combined coarse and fine measurment systems. What accuracies do
you suggest for each sensor? Your system should be able to correct for the fact
that in elevators for tall buildings there is significant cable stretch as a function of
cab load.

Solution: Elevator position control block diagram:


A coarse measurement can be obtained by an electroswitch located before
the desired floor level. When touched, the controller reduces the motor
speed. A “fine” sensor can then be used to bring the elevator precisely to the
floor level. With a sensor such as the one depicted in the figure, a linear
control loop can be created (as opposed to the on-off type of the coarse
control). The mode logic distinquishes between the course and fine
movement and directs the actuator accordingly.

In addition, accuracy required for the course switch is around 5 cm; for the
fine floor alignment an accuracy of about 2mm is desirable to eliminate any
noticeable step for those entering or exiting the elevator.

Matlab :

Solution:

Part 1:

a=

1 2 4 2 1

b=

4 3 -1 0 1

a+b=
5 5 3 2 2

a-b=
-3 -1 5 2 0
min(a) =
1

(a > b) =
0 0 1 1 0

(a == b) =
0 0 0 0 1

sin(a) = [rads]
0.8415 0.9093 -0.7568 0.9093 0.8415

exp(b) =
54.5982 20.0855 0.3679 1.0000 2.7183

Part 2:

a=

1 2 3
3 2 3
0 1 0

b=

0 0 1
0 1 1
1 1 0

c=

1
2
3

a+b=
1 2 4
3 3 4
1 2 0

d = inv(b)
1 -1 1
-1 1 0
1 0 0

b*d=
1 0 0
0 1 0
0 0 1

sin(a) = [rads]
0.8415 0.9093 0.1411
0.1411 0.9093 0.1411
0 0.8415 0

a*b=
3 5 3
3 5 5
0 1 1

a .* b =
0 0 3
0 2 3
0 1 0

Form the transpose of a


1 3 0
2 2 1
3 3 0

What is a + a transpose
2 6 0
4 4 2
6 6 0

Part 3 and 4:

What special property does b * d have?


b * d is the Identity matrix since d is the inverse of b

What is the operation given by a * b?


Matrix Multiplication of a and b.

and what is the operation given by a .* b?


Element Multiplication of a and b.

Part 5:
The roots of [2 3 1] are:
-1.0000
-0.5000

These are the roots of what polynomial: a


1.0000 1.5000 0.5000

Verify that the roots come from the stated polynomial:


[2 3 1] = 2 * [1 1.5 0.5]
2 3 1

Part 6: Graph Sine Wave - See Figure 1

>>

Figure 1
Plot of Sine from 0 to 4
1

0.8

0.6

0.4

0.2

0
y

-0.2

-0.4

-0.6

-0.8

-1
0 0.5 1 1.5 2 2.5 3 3.5 4
t

Matlab Code
% Hw1.m - program
%
% Homework 1 Matlab Assignment: Working with Vectors and Related Operations

% Matlab Preprocessing
clear, clc

% Initialization
% none

% Part 1: Set Vectors a and b


disp(' '), disp('Part 1:'), disp(' ') % Here, disp is used to print to the screen
a = [1 2 4 2 1]
b = [4 3 -1 0 1]

%% Perform the Vector Operations


c = a + b; disp(' a + b = '), disp(c) % Element addition
c = a - b; disp(' a - b = '), disp(c) % Element subtraction
c = min(a); disp(' min(a) = '), disp(c) % Find the smallest value of a
c = (a > b); disp(' (a > b) = '), disp(c) % Boolean operation: if one element of
% a is larger than an element of b, then false
% (0) is displayed. True is one (1)
c = (a == b); disp(' (a == b) = '), disp(c) % Boolean operation: Element of a must
% equal element of b to be true (1)
c = sin(a); disp(' sin(a) = [rads]'), disp(c) % Take the sine of elements of a
c = exp(b); disp(' exp(b) = '), disp(c) % Take e^4, e^3, e^-1, e^0, and e^1

% Part 2: Create the vectors and matrices


disp(' '), disp('Part 2:'), disp(' ') % Here, disp is used to print to the screen
a = [1 2 3;
3 2 3;
0 1 0]
b = [0 0 1;
0 1 1;
1 1 0]
c=[1
2
3]

%% Perform the Matrix and Vector Operations


e = a + b; disp(' a + b = '), disp(e) % Element addition
d = inv(b); disp(' d = inv(b) '), disp(d) % Inverse of matrix b
e = b * d; disp(' b * d = '), disp(e) % B*inv(B) = I (I = Identity matrix)
e = sin(a); disp(' sin(a) = [rads]'), disp(e) % Take the sine of elements of a
e = a * b; disp(' a * b = '), disp(e) % Matrix Multiplication of a and b
e = a .* b; disp(' a .* b = '), disp(e) % Element Multiplication of a and b
% example: a(2,2) * b(2,2) = 2

disp(' Form the transpose of a'), e = a'; disp(e)


disp(' What is a + a transpose'), e = (a + a)'; disp(e)

% Part 3 and 4:
disp(' '), disp('Part 3 and 4:'), disp(' ')
disp(' What special property does b * d have?')
disp(' b * d is the Identity matrix since d is the inverse of b'); disp(' ')
disp(' What is the operation given by a * b? ')
disp(' Matrix Multiplication of a and b. '), disp(' ')
disp(' and what is the operation given by a .* b?')
disp(' Element Multiplication of a and b.'), disp(' ')

% Part 5:
disp(' '), disp('Part 5:'), disp(' ')
a = [2 3 1];
c = roots(a); disp(' The roots of [2 3 1] are: '), disp(c)
e = poly(c); disp(' These are the roots of what polynomial: a'), disp(e)
f = 2*e; disp(' Verify that the roots come from the stated polynomial:')
disp(' [2 3 1] = 2 * [1 1.5 0.5]'), disp(f)

% Part 6:
disp(' '), disp('Part 6: Graph Sine Wave - See Figure 1'), disp(' ')
t = 0:0.01:4; % Create a vector from 0 to 4 in increments of 0.01
y = sin(2*pi*t); % Create a sine wave with a period of t
figure(1), plot(t,y) % Plot the sine wave in Figure 1
title('Plot of Sine from 0 to 4'), xlabel('t'), ylabel('y'), grid