Вы находитесь на странице: 1из 6

ENE S214 Bomewoik Set 1 0ut: }anuaiy 17, 2u1S

Bue: }anuaiy 24, 2u1S


Problem 1:
Consiuei a noninteiacting twotank system:

The working fluid enters the upper tank through the valve with flow rate

. A second valve
connects the upper tank to the lower tank and has flow resistance R
t
and flow rate
t
. The lower
tank empties through a third valve with flow resistance R
o
and flow rate
o
.
Use the following steps to develop a Simulink model of this system with input

and output E
2
.
1. Create a MATLAB m-file to store the values of the constants. These are not particularly
realistic values!
C1 = 1u
m
S
Nm

C2 = 1u
m
S
Nm

Rt = u.1
Nm
2
m
3
s

Ro = u.S
Nm
2
m
3
s

p = 1uuu kgm
S

g = 9.81 ms
2

i = Suuu m
S
s
2. Create a new Simulink model. Save it with a name that is significant. For instance
your_name_hw1p1.
3. The fluid capacitance of each tank is related to the net flow rate by
C
1

J
Jt
(P
1
- P
0
) =

-
t

ENE S214 Bomewoik Set 1 0ut: }anuaiy 17, 2u1S
Bue: }anuaiy 24, 2u1S
C
2

J
Jt
(P
2
- P
0
) =
t
-
o

Define the differences in pressure between the bottom of the tanks and atmospheric as
P
10
= P
1
- P
0

P
20
= P
2
- P
0

Then our model of the tanks is given by
P

10
=
1
C
1
(

-
t
)
P

20
=
1
C
2
(
t
-
o
)
4. Use an Add block and a Gain block to write these equations in Simulink. Double
click each line between blocks to label it appropriately. Your diagram should look
something like the figure below. Note that Simulink reads left to right. The Add block
takes signals

and
t
and adds them to make the signal

-
t
. The gain block
multiplies the signal by a constant value, 1C
1
.

5. Add an integrator block to the P

10
and P

20
signals to get P
10
and P
20
.

6. Consider the flow through the open valve. The fluid equivalent to Ohms law considers
the potential (pressure) difference on each side of the valve, the resistance of the valve
and the fluid flow through the valve
P
1
- P
0
= R
t

t

P
2
- P
0
= R
o

o

As we already have P
10
and P
20
in our Simulink model, rewrite these to solve for the
flow rates

t
=
1
R
t
P
10

ENE S214 Bomewoik Set 1 0ut: }anuaiy 17, 2u1S
Bue: }anuaiy 24, 2u1S

o
=
1
R
o
P
20

7. Use two gain blocks to connect the
t
and
o
signals to the P
10
and P
20
signals with the
valve equations in Simulink.
8. Choose the input,

, to be a Step block. Double click on the block and set the final
value to Qi.
9. The height of fluid in each tank is a function of the pressure difference between the
bottom of the tank and ambient, the fluid density and gravity
E
1
=
1
pg
P
10

E
2
=
1
pg
P
20

Using a gain block and a Scope block, display the height of fluid in the second tank.

10. Your final model should look similar to the figure below.

11. Run the m-file with your parameter values and then run the model. Double click on the
Scope to get a display of the output. Include your m-file, Simulink model, and Scope
output with your solution.

ENE S214 Bomewoik Set 1 0ut: }anuaiy 17, 2u1S
Bue: }anuaiy 24, 2u1S
Problem 2:
You have been hired as a mechatronics engineer at a Chef Boyardee Ravioli factory. On your
first day, you are told that they are having problems with the Pasta Magix Ravioli Rolling
Machine and you are expected to fix it. Management has determined that the problem is with the
estimate of the time delay between a change in the pneumatic thickness controller and the
thickness measurement that is used in the ravioli roller controller and has arranged to have data
supplied to you so you can come up with a better estimate of the time delay. A meeting has been
scheduled for next Wednesday where you will present your results.
You are expected to present:
An equation (model) for an estimated time delay
Explanation of how the model was developed
Conclusions about the suitability of your estimate
Sufficient graphics / statistics / analysis to support your conclusion
Recommendations


Pneumatic
Ravioli
Ravioli Roller Motor
Thickness
Delay
Ravioli
Temperature
Thicknessmeasurement
feedsbacktothe
Pneumaticcontroller.
ENE S214 Bomewoik Set 1 0ut: }anuaiy 17, 2u1S
Bue: }anuaiy 24, 2u1S
The machine has a variable speed motor to drive the dough through the rollers and a hydraulic
controller on one roller that is used to control the thickness of the final product.
Specifications:
Motor Speed: 150 and 600 RPM
Pneumatic controller: 0 to 750 PSI
Temperature Sensor: 0 to 250 deg. F range
Thickness Measurement: 0 to 0.25 inches
Management instructed the machine operator to make a change to the position of the thickness
controller and measure the time between the commanded change and a change in the measured
thickness at various motor speeds and provide you with the results.
To assist you in your analysis some useful examples of MATLAB scripts have been provided:
poly_curve_fit.m
Example of using the polyfit and polyval commands to determine the coefficients of a
polynomial that best fits the supplied independent / dependent data.
Type: help polyfit and help polyfit to get help on these functions at the Matlab prompt
Regression_Example.m
Example of using the backslash ( \ ) operator (Matrix left divide) to determine the
coefficients of an arbitrary set of independent variables (states) that best fit the dependent
data.
Type help mldivide to get help on this function
r_squared.m
Function called by the above functions to calculate the R Squared statistic a measure of
how much of the variation in the dependent variable is explained by the regression. This
function needs to be unzipped and in the same directory as the above functions for them
to work properly.

ENE S214 Bomewoik Set 1 0ut: }anuaiy 17, 2u1S
Bue: }anuaiy 24, 2u1S
Problem 2 Solution Steps:
1. What are the inputs to this system? What is the output of this system?
2. Are motor speed and delay correlated? What about temperature and delay? What about
time and delay? What about temperature and motor speed? In light of these changing
inputs, is this a good experimental design?
3. Assume that only motor speed and delay are important. Using MATLAB, perform a
linear regression relating motor speed (input) to delay (output). Determine the R
2
value
for the regression. Hint: modify the polyfit.m example.
4. Using MATLAB, plot the actual data points and the regression. Include a legend. Label
your axes, including units. The following MATLAB commands will be useful: plot,
xlabel, ylabel, legend.
5. Using your results from 3 and 4, is this a good fit to the data? Consider the entire
operating range! What are the estimated time delays at the maximum and minimum
motor speeds? What recommendations can you make based on this linear regression?
6. Repeat 3, 4, and 5 with a 2
nd
order polynomial. Based on the operating conditions, is this
a good fit? What are the estimated time delays at the maximum and minimum motor
speeds? Is this an improvement over a linear fit within the operating conditions?
7. Given that the distance between the rollers and sensor is constant, write a mathematical
expression that relates velocity and time required for the dough to travel between the
rollers and sensor. Use this to relate delay to motor speed using unknown (to be
determined) constants.
8. Repeat 3, 4 and 5 for your model from 7. Based on the operating conditions, is this a
good fit? What are the estimated time delays at the maximum and minimum motor
speeds? Is this an improvement over a linear fit within the operating conditions?

Вам также может понравиться