Code covered by the BSD License  

Highlights from
Motion Control Demo

image thumbnail

Motion Control Demo

by

 

30 Oct 2007 (Updated )

Model Based Design Demonstration Based on a Motion Control Case Study

PE_data_Update.m
%% Retrieve parameter estimation data from simulation
%---------------------------------------------
%|     The Digital Motion Control Demo       |
%---------------------------------------------
%| A practical lesson in Model-Based Design. |
%| Prepared by:                              |
%| Paul Lambrechts, March, 2007              |
%| Copyright 2007, The MathWorks, Inc.       |
%---------------------------------------------
%| Note: This demo is prepared with R2006b   |
%---------------------------------------------
%
% 1. open model DMC_system_demo
% 2. select desired reference block
% 3. select motion system 'Masked Math Model' 
% 4. run simulation
% 5. run this script

time = simout.time;
Tin  = simout.signals.values(:,1);
Rin  = simout.signals.values(:,4);
err  = simout.signals.values(:,5);
errm = (err+.01*randn(size(err)));
%cd '..\PE'

% Here you can specify the initial guess for the parameters to be estimated
% Note: these values will be overwritten if you use the webbrowser interface 
%       to run the demo; see ScriptFunction.m 
k   = 0.012;
b12 = 1e-6;

save PE_data time Tin Rin err errm J1 J2 b1 b12 b2 k Km Ka Ts

disp('New data stored in current directory in: PE_data.mat')

Contact us