
CHAPTER 3
MODULAR SERVO Information Flow Between
Reference Manual
Simulink Models and the Real-Time Kernel
3-8
33-008-2M5
Wait for the first sample which may be sent to the output
while ( es_call( 'GetNoOfSamples', 0 ) <= downsamp )
;
end;
history = es_call( 'GetHistory', 0 )';
% initialize the initial conditions
str = []; % str is always an empty matrix
ts = [-2 0]; % initialize the array of sample times
% variable sample time
Set the initial value of the pos_in_history parameter
% Set initial conditions of the state
pos_in_history = 1;
x0 = max( history( :, 1 ) );
% change background color of Real Time Task block after simulation start
set_param('es_pid/RealTimeTask','BackgroundColor','cyan');
case 1, % Unhandled flags
sys = [];
case 2, % Calculate discrete state
If Simulink generator is selected as the source of the reference position set new
reference angle
% Set desired value
if eq( exc_src, 1 ) % Simulink signal generator
dummy = es_call( 'SetPW', [ 0 u zeros( 1, 18 ) ] );
end
sys = x;
case 3, % Calculate outputs
Calculate the output from the S-function block (see body of the es_sfco.m file for
details)
[ sys, downsamp, history ] = es_sfco( downsamp, history );
case 4, % Calculate next discrete time point
Summary of Contents for MS150
Page 1: ...MS150 Modular Servo Workshop Reference Manual 33 008 2M5 ...
Page 3: ...Notes ...
Page 7: ...MODULAR SERVO Reference Manual Contents TOC 2 33 008 2M5 Notes ...
Page 10: ...CHAPTER 1 MODULAR SERVO Reference Manual Introduction 33 008 2M5 1 3 ...
Page 24: ...CHAPTER 2 MODULAR SERVO Reference Manual Description of the Toolbox Functions 33 008 2M5 2 13 ...
Page 77: ...CHAPTER 4 MODULAR SERVO Reference Manual Quick Reference Table 4 4 33 008 2M5 Notes ...