EGB345 Control and Dynamic Systems JF/31.07.2023
SERVO MOTOR SYSTEM IDENTIFICATION TASK
Due Date Wednesday week 8. Worth 10%
See CANVAS for details on the format and other submission requirements of the below requested MATLAB, plots, data sets, etc.
Modelling the Servo motor
This task is based on a servo motor mechanism commonly used in remote control aircraft. Simply speaking, the servo system has a motor, an arm, and a set of internal electronics. The motor is used to induce rotary (or linear) motion of the arm. There is a sensor attached which measures shaft angular velocity.
Transfer function modelling:
The simplified transfer function can be approximated by:
Experiment-based system modelling:
The above-simplified transfer function means that the servo motor system can be characterised by two numbers, 𝐾𝑚 and (this is typical of many simple electromechanical systems). However, we do not know any of the constants associated with these parameters such as motor constants, the inertia of the load and the gear ratio. We will need to treat the system as a black box from which we expect a particular response, and we will estimate the unknown parameters using experiment-based system modelling.
To do such modelling, we will provide you with the system’s shaft angular velocity response to a 2V step input (initially at rest with 𝜔(𝑡) = 0). This is referred to as the open-loop time response of the motor system and is measured in terms of how the voltage applied to the motor affects the system’s shaft angular velocity. Then, to match with our model for 𝐺(𝑠), you will derive a good approximation to the servo motor system transfer function by selecting the best values that you can find for 𝐾𝑚 and .
An example of an open-loop time response to a 2V step response is shown in Figure 1 below. Just after the step response has been applied, the motor starts to turn, and this voltage begins to increase.
In this assessment task, you will be provided fictitious data representative of what experimentally captured data would look like (this data will be generated by provided MATLAB function).
Assessed Questions – System Identification
In this section, we will provide you with simulated data from a 2V step input open-loop response test. You will use this to estimate the parameters from this model.
𝐺(𝑠) = Ω(𝑠) = 𝐾𝑚
𝑉(𝑠) (𝑠+𝛼) 𝑚
Code Help
EGB345 Control and Dynamic Systems
In preparation for these tasks, download the functions (MATLAB content-obscured executable files) GenerateCSVRandom.p and UnknownData.p from CANVAS and ensure they are in the appropriate MATLAB path. In some browsers, you might need to right-click your mouse and select the “Save Link as” option.
Task 1.1: Create your randomly assigned data using the following MATLAB command:
>> [km, alpha] = GenerateCSVRandom(‘EGB345RandomData.csv’);
This function will generate a CSV file (‘EGB345RandomData.csv’) that contains the following information:
• A time vector.
• Channel 1 is reading the 2V step response of motor speed.
Your true values of 𝐾𝑚 and will also be stored in the variables ‘km’ and ‘alpha’, respectively. Please write these values down for your assessment submission.
Note: The GenerateCSVRandom function will generate different parameter values and noise each time it is run, so you may need to reprocess data if you re-run the GenerateCSVRandom function.
Task 1.2: Read the CSV file into your MATLAB workspace. The columns are labelled with text within the CSV file. This is to match the expected configuration as if you were taking these values from a real oscilloscope.
Task 1.3: Extract the original step response data (Channel 1) which you should name ‘yn_random’. Plot Channel 1 versus the time vector. The plot will look something like the following when plotted.
Figure 1: Example of generated data
Task 1.4 Save the ‘yn_random’ using the following save command. >> save(‘yn_random.txt’,’yn_random’,’-ascii’)
Save for submission the following:
Computer Science Tutoring
EGB345 Control and Dynamic Systems
Your true 𝐾𝑚 and values in Task 1.1 The requested plot in Task 1.3.
Your MATLAB code for extracting and plotting data in Task 1.2 and Task 1.3. The file saved in Task 1.4
is to design and implement a technique to estimate from the step response data Task 2.1: Write MATLAB code to estimate 𝐾𝑚 and from yn_random. Record your estimate.
Task 2.2: Visually confirm the quality of your estimate by plotting yn_random (plotted in red) and the estimated model data using your estimated values of 𝐾𝑚 and (plotted in blue) overlaying each other on the same plot versus time vector that highlights how well, or not, your estimated model matches the data. Save as a ‘png’ or ‘jpg’ file.
Task 2.3: Comment on why/if your parameter estimates are appropriately accurate (100-200 words, indicative length). Your answer should reference the parameter error from true values, and the match between data and the response of the estimated motor.
Task 2.4: Now check if your estimation solution is reliable on other data. Repeat Task 1.1 to generate a second set of data having different 𝐾𝑚 and values (call the ‘EGB345RandomData2.csv’) with
new parameter values labels 𝐾 and ̅. Repeat Task 2.1 and 2.2. Record and report your estimates
for this second data set. Reflection and/or comment on whether your estimation solution is reliable.
Save for submission the following:
1. Your estimated 𝐾𝑚 and values in Task 2.1
2. Requested plot in Task 2.2.
3. Requested second set of parameters and estimates for Task 2.4
4. Reflection and/or comments from Task 2.3 and 2.4.
5. Your MATLAB code for estimating parameters in Task 2.1.
yn_random your true values of 𝐾𝑚 and (used to generate the data yn_random).
EGB345 Control and Dynamic Systems
Create a second set of randomly assigned data using the following MATLAB command:
>> UnknownData(‘EGB345UnknownData.csv’,yourstudentnumber)
where yourstudentnumber is replaced by your student number.
The system used to generate data will be unique to your student number and will have different (hidden) model parameters of 𝑲𝒎 and 𝜶 (different noise may be added each time you call the function).
You are required to conduct data analysis and estimate the model parameters of 𝐾𝑚 and 𝛼. This will test whether your estimation process in Task 3 generalises to other sets of data.
Task 3.1: Adjust as necessary and apply your estimation code from Task 2. Record your estimates. Task 3.2: Plot both the step response data from EGB345UnknownData (plotted in red) and your
estimated model data (plotted in blue) on the same plot to highlight how well they match.
Task 3.3: Based on the accuracy of your parameter estimation in Task 2 (with ground truth parameters known), what is the likely accuracy (use percentages) of your Task 3 estimates of EGB345UnknownData model parameters (0 – 250 words, indicative length)? This question is asking you to provide an informed quantitative prediction.
Save for submission the following:
1. Your estimated 𝐾𝑚 and values in Task 3.1
2. Requested plot in Task 3.2.
3. Reflection and/or comments from Task 3.3.
In practical 1 you were provided with the experimentally measured speed of the SEA output for 2 V step input to the system. The data for 2 different systems is available for download from CANVAS in the file SEA_speed.mat and SEA_speed.csv.
You are told the transfer function of the input voltage to the position is given by:
𝜃𝐿(𝑠) = 𝑁1
𝐸𝑎(𝑠) 𝑠4+𝐷3𝑠3+𝐷2𝑠2+𝐷1𝑠
where the parameters of the SEA_speed.mat servo are near: 𝑁 ~ 4600, 𝐷 ~ 150, 𝐷 ~900 and 132
𝐷 ~40000. (The parameters of the SEA_speed.csv might be less near these values.) 1
Task 4.1: Modify this transfer function to compute the transfer function from input voltage to output speed rather than position (recall that 𝜔𝐿(𝑠) = 𝑠𝜃𝐿(𝑠)).
Task 4.2 Use MATLAB to compute the time response of the output load speed in response to a 2 V step input.
CS Help, Email: tutorcs@163.com
EGB345 Control and Dynamic Systems
Task 4.3 Plot your computed step response against the recorded speed response in SEA_speed.mat.
Task 4.4: Write a MATLAB script in a .m file to estimate the system parameters that best matchthe2VstepresponseofthesysteminSEA_speed.mat. Recordyourestimatedparameter values.
Task 4.5: Plot the 2V step responses recorded in both your estimated transfer function and the SEA_speed.mat on the same figure.
Task 4.6: Read the SEA_speed.csv data and repeat Tasks 4.4 and 4.5 for this data.
Task 4.7: Comment on whether your 2V step responses in Task 4.5 and 4.6 match their respective data and provide reflections on the relative estimation difficulty of Task 4 compared to Task 3.
Save for submission the following:
1. Your estimated 𝑁 , 𝐷 , 𝐷 and 𝐷
values in Task 4.4 for SEA_speed.mat.
2. Your estimated 𝑁 , 𝐷 , 𝐷 and 𝐷 132 1
values in Task 4.6 for SEA_speed.csv. 3. The requested plot in Task 4.3 and 4.5
4. Both the requested plots in Task 4.6.
5. Reflection and/or comments from Task 4.7.
6. Your MATLAB code for estimating parameters in Task 4.4 and Task 4.6