MMAN3200/2021.T1
Assignment, Part A
Assignment
Part A: Parameter estimation (Offline)
Part B: Implementing and testing an observer.
Part A, expected to be solved during weeks 7 and 8. (relevance: 45%)
Part B, expected to be solved during weeks 9 and 10. (relevance 55%)
The system
We have an electromechanical system, which is composed by an electric motor, moving a rotational
load. The load is a pendulum.
We have sensors installed on it. Those are:
1) Optical encoder for measuring angular position.
2) IMU (inertial measurement unit)
The IMU is installed on the pendulum shaft in a way that one if the IMU’s gyros is used to measure the
angular velocity of the arm.
The system allows us to modify the amount of friction, and to change the position of a mass which is
attached to the arm. We can also change the gain of the amplifier which drives the electric motor.
Although we can modify those characteristics, the resulting parameters , ,a b c are not accurately
known by us.
We know that the dynamics of the system can be approximated by the following ODE.
( )
( )( )
( )
( )
2
2
sin
d t d t
a t b c u t
dt dt
= − − +
Which we can further simplify by approximating it by an LTI model
( )
( )
( )
( )
2
2
d t d t
a t b c u t
dt dt
= − − + , which is an adequate approximation for the pendulum being
operated close to 0 = (so that the linearization has been applied at that point)
Consequently, in one part of this assignment (part A), you will identify the parameters of the system.
You are required to perform the following tasks:
MMAN3200/2021.T1
Assignment, Part A
Based on the measurements provided by the encoder, and on the knowledge of the input being applied,
we want to infer the values of the parameters of the model. Those parameters are the ODE’s
coefficients , ,a b c .
We are in condition to measure the angular position and the applied input, i.e. ( ) ( ),t u t , every 1
millisecond. That sampling rate is more than enough for a slow system like this one.
We have the intention to infer the parameters , ,a b c , by exploiting the information provided by those
measurements. However, we have an additional problem, which is related to noise polluting the
measurements provided by the encoder. The encoder has a resolution of 360 degrees /2048 (~0.1758
degrees), which introduces a quantization error of(360/4096) degrees.
(The angular rate measurements are also polluted by noise; however, we do not uses those
measurements in part A.)
This fact can be appreciated as “small steps” in the plots of the angular measurements.
Figure 1. Measurements from encoder and gyroscope. The Angular position (top one), measured by the
encoder, seems smooth and free of errors. The bottom one (angular velocity), appears noisy.
0 5 10 15
0
10
20
30
time (s)
a
n
g
le
(
d
e
g
)
file [MMAN3200. Dataset B[000]]
0 5 10 15
-40
-20
0
20
40
60
time (s)
a
n
g
.
ra
te
(
d
e
g
/s
e
c
)
MMAN3200/2021.T1
Assignment, Part A
Figure 2. If we zoom in for details, we can appreciate the quantization error in the encoder’s readings. In
the lower figure, we can appreciate the random noise which affects the measurements of the angular
velocity.
Each student is provided with the data recorded from experiments performed using the system. Not all
the students have the same configuration of parameters, as we changed those multiple times. However,
the system is unchanged for the multiple tests which are assigned to one student (so that you can be
sure the datasets you receive do correspond to the same set of parameters.)
We provide three datasets per student.
Dataset A corresponds the system starting at a given initial condition (angle =~35 degrees, angular
velocity =0). The arm is released and allowed to oscillate for certain time (15 seconds). No inputs are
applied (u=0).
Dataset B: the initial conditions are [0;0], and certain “easy” rich input is applied. The input is a step of
known amplitude.
Dataset C: the initial conditions are [0;0]. In this case, a more complicated input is applied. This data can
be used to validate your results, which have been based on Datasets A and B.
For estimating the parameters, you can use the approach you prefer. The Lecturer will explain a way
using the system identification toolbox in Matlab. You can use it, for solving your assignment, or you
may try other ways, if you want.
0.9 1 1.1 1.2 1.3 1.4
26
27
28
29
time (s)
a
n
g
le
(
d
e
g
)
file [MMAN3200. Dataset B[000]]
0.4 0.45 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85
30
35
40
time (s)
a
n
g
.
ra
te
(
d
e
g
/s
e
c
)
MMAN3200/2021.T1
Assignment, Part A
Once you have estimated the parameters, you will perform a simulation (using the model with your
parameters), for verifying if the tuned model is satisfactory, by comparing the measured signals with the
simulated ones (we do not expect a perfect match, due to many factors, which the lecturer will explain
in class)
Which one is my dataset?
There are 56 sets of datasets, indexed from 0 to 55.
Your datasets will be DatasetNumber=mod( ID, 56 ), in which DatasetNumber is the index of your
assigned dataset, and ID is your student ID number.
Those files are located in the folder “DataForPartA”
Report
The assignment involves the processing of data and preparing a brief report. There will be a section in
the report for Part A, and another for Part B.
For Part A, we expect the following subsections:
A.1) A brief introduction describing this part of the assignment; then a brief explanation about the
approach you have used for estimating (a,b,c). If you used a toolbox or any third-party software solution
for that purpose, you must cite that source, and give a brief explanation of it.
A.2) You will indicate in a small table the estimated parameters, mentioning the number of dataset
you have used.
A.3) You will simulate you estimated model, using the same inputs which had been applied in the
experiments, and you will include those plots in your report, comparing the simulated one and the real
ones. In Part A, we only have interest about the angular position.
More details about the full submission will be provided with the release of Part B of the assignment.
Any questions, you may contact the lecturer, j.guivant@unsw.edu.au
MMAN3200/2021.T1
Assignment, Part A
Appendix 1:
Dataset format.
The measurements are saved in integer format. Before doing any processing, you need to convert the
arrays to floating point format, and scale them to the engineering units you are using.
The following simple Matlab program, shows the data, after properly scaling.
function ShowData1(FileName)
showGyro=1;
load(FileName);
a = double(D.a)*D.resX1;
ta=double(D.ta)*D.dt;
figure(1) ; clf();
plot(ta,a); title('Angle'); ylabel('angle (degrees)'); xlabel('time (seconds)');
grid on; zoom on;
figure(2) ; clf();
u=double(D.u)*D.resU;
plot(ta,u); title('Input'); ylabel('Input'); xlabel('time (seconds)');
grid on; zoom on;
if showGyro % not used on PartA
w = double(D.w)*D.resX2;
tw=double(D.tw)*D.dt;
figure(3) ; clf();
plot(tw,w); title('anglular rate'); ylabel('degrees/second'); xlabel('time
(seconds)');
grid on; zoom on;
end;
end
学霸联盟