[ad_1]
Updated: August 9th, 2018
46660 Dynamics and Control
Preparing Your Data
Great, you’ve got some data! Nice work.
But gosh-all-darn-it if you don’t know what to do next. It’s ok, we’ve got your back, here’s what to do
for assignment 1, and some more general rules for when you get out there and do this on your own.
Step 1: Name your data something intuitive
The default name of “20180808_175925.csv” from remote labs is good and all, but It’s always a good
idea to name your data something that makes sense, usually a combination of pertinent information
and the date. This is especially useful where you’re taking more than one dataset (which you
probably should be doing in your assignments, never trust single sets of data!). So instead of
“20180808_175925.csv”, lets rename the data something like this:
Rig<no.>_<percentage open>%_<YYMMdd>_<raw(?)>.csv
Examples:
• Rig1_16%_180808.csv
This would indicate that I used rig 1, I set the valve percentage to 15%, I took the data on the 8th
August, 2018, and the lack of the “_raw” suffix means that I’ve already prepped this data.
• Rig2_20%_180807_raw.csv
This would indicate that I used rig 2, I set the valve percentage to 20%, I took the data on the 7th
August, 2018, and this is the raw data I downloaded from the remote labs.
Updated: August 9th, 2018
Step 2: Open and inspect the data
For this I would just use MS excel as it is intuitive, and the pre-built functions make examining your
data easy. Go ahead and open some data. For the purposes of this tutorial I’m going to assume you
know how to use excel.
Delete Empty Columns
The first thing we’ll do is just delete the columns with empty values. I find they just get in the way,
and it’s better to just unburden ourselves of these null fields upfront. For our example, we’re not
storing any data in columns B to E (Setpoint (mm), Kp, Ki, Kd). Go ahead and delete them.
Figure 1. Columns to Delete
Inspect the Data
Before we go snipping off the ends, plot some of the data sets and just make sure the data you’ve
recorded is what you meant to. For example, select the ‘Timestamp (s)’ and ‘Tank 2 Level (mm)’
columns and create a scatter plot. Go through and do this for a few different columns until you’re
confident that the data you’ve downloaded is indeed the data you are meaning to work with, and
that there are no irregularities.
Updated: August 9th, 2018
Step 3: Truncate your data
For our purposes everything before we’ve set the valve percentage to greater than 0 is irrelevant.
For that reason, highlight all the rows where the ‘Valve %’ column is 0 and delete them
Figure 2. Delete all rows where ‘Valve %’ is 0
We want to ensure the data we’re analysing is in the linear operating region of the system. To
ensure this, go a head and truncate any data where a boundary condition has been exceeded.
Boundary condition include the tank heights, valve percentage, etc. If these boundaries are
exceeded, for example a tank overflows, we’re no longer observing the linear system we
characterised mathematically. You can check this by either manually checking the numbers, or
plotting graphs of the responses and looking for any sudden changes.
Other non-linearities could come from a change you’ve made. For example, if you’ve emptied the
tanks before ending the data logging you’ll see a sharp decline in the water levels of both tanks. This
change is also not modelled by our linear system. You’ll want to delete all the data passed the point
where the system becomes non-linear, leaving us just with the smooth and (approximately) linear
system response.
Updated: August 9th, 2018
Step 4: Account for offsets
You’ll notice now that the ‘Timestamp (s)’ column no longer begins at 0. That’s fine, let’s just rest
this column to begin counting at 0. I would do this by setting A2 = 0 and A3 to ‘=A2+0.1’ and copying
this equation down the length of the dataset, but feel free to do whatever suits you. Whatever you
do the time offset should now be accounted for.
There’s one other offset we need to take care of, the Tank Level 2 offset. In most of the rigs, when
the valve % is 0 some small flowrate still exists, and each tank has a small level of water in it. To
account for this offset and so that our data starts at (0, 0) lets minus the first tank value from the
whole dataset. I would do this by creating a new column called ‘Tank 2 Level Adjusted’. In fact the
Matlab Live Script will look for a column named this to process the data so either make it exactly as
stated here, or update the Matlab Script to look for the name you’ve given it.
Why do we care that it starts at (0, 0)?
Because we’re assuming the response is linear, that we’ll get a second order transfer function, and
that we can perform regression analysis with the following model:
[Button id=”1″]
[ad_2]
Source link
"96% of our customers have reported a 90% and above score. You might want to place an order with us."
