feedback MS150 Reference Manual Download Page 71

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 2: ... Instruments Ltd Park Road Crowborough E Sussex TN6 2QR UK Telephone 44 0 1892 653322 Fax 44 0 1892 663719 email feedback fdbk co uk World Wide Web Homepage http www fbk com Manual 33 008 2M5 Ed01 980930 Printed in England by Fl Ltd Crowborough Feedback Part No 1160 330082M5 ...

Page 3: ...Notes ...

Page 4: ... labels that may be fixed to the instrument are shown below CAUTION RISK OF DANGER CAUTION RISK OF ELECTRIC SHOCK CAUTION ELECTROSTATIC SENSITIVE DEVICE Refer to accompanying documents PRODUCT IMPROVEMENTS We maintain a policy of continuous product improvement by incorporating the latest developments and components into our equipment even up to the time of dispatch All major changes are incorporat...

Page 5: ...ith the supplied documentation does not cause electromagnetic disturbance outside its immediate electromagnetic environment COPYRIGHT NOTICE Feedback Instruments Limited All rights reserved No part of this publication may be reproduced stored in a retrieval system or transmitted in any form or by any means electronic mechanical photocopying recording or otherwise without the prior permission of Fe...

Page 6: ...6 GetPW 2 17 GetSampleTime 2 18 GetV2Velocity 2 19 LoadLibrary 2 20 ResetEncoder 2 22 ResetTime 2 23 SetAlgNo 2 24 SetBaseAddress 2 27 SetChan1Filt SetChan2Filt SetChan3Filt SetChan4Filt SetChan5Filt SetChan6Filt 2 29 SetDataSource 2 32 SetDivider 2 35 SetInitCond 2 38 SetModelP 2 39 SetP 2 40 SetPW 2 43 SetSampleTime 2 47 SetV2Velocity 2 48 StartAcq 2 49 StopPractical 2 50 UnloadLibrary 2 52 3 In...

Page 7: ...MODULAR SERVO Reference Manual Contents TOC 2 33 008 2M5 Notes ...

Page 8: ...ning of their parameters is done by means of the communication interface from the MATLAB environment The communication interface is also used for configuration of the Real Time Kernel parameters sampling period excitation source etc Specialised communication functions are responsible for communication between RTK and MATLAB environment The functions are described in this manual Modular Servo Toolb...

Page 9: ...he microprocessor The following sections contain the description of the communication functions There are 32 communication functions listed in the alphabetic order The functions are divided into four following categories according to the specific roles assigned to them hardware GetBaseAddress SetBaseAddress ResetEncoder data acquisition GetNoOfSamples ResetTime GetSampleTime SetSampleTime StartAcq...

Page 10: ...CHAPTER 1 MODULAR SERVO Reference Manual Introduction 33 008 2M5 1 3 ...

Page 11: ...ntroller selection parameters MATLAB SIMULINK Internal excitation Modular Servo Toolbox to DC motor software hardware switch software controlled from Encoder from tachogenerator embedded controllers commu nication interface user defined by External Interface software 33 301 Analogue Control Interface DC Motor Digital encoder Potentiometer Gearbox Tacho brake Figure 1 1 Digital control of the MS150...

Page 12: ... Real Time Kernel RTK and MATLAB environment have the following general form ReturnValue es_call FunctionName Argument where ReturnValue value returned by the function es_call name of the DLL library responsible for the communication FunctionName name of the desired operation string format The FunctionName is case insensitive Argument argument passed to the es_call function optional ...

Page 13: ...e algorithm currently active in the RTK See SetAlgNo Example The following function displays the description of the currently active control algorithm function dspdsr AlgNo es_call GetAlgNo if AlgNo 0 disp Control set to zero elseif AlgNo 1 disp Open loop control elseif AlgNo 2 disp PID controller elseif AlgNo 3 disp LQ controller elseif AlgNo 4 disp Time optimal controller elseif AlgNo 99 disp Ex...

Page 14: ...ddress of the I O board is set to zero the RTK uses the built in RTK simulator of the servo to generate data This mode is useful to test communication between RTK and MATLAB without using any external hardware see Example 2 When the simulator of the model is used the type of data which are collected in the built in data acquisition buffer is defined by the last call to the SetDataSource function S...

Page 15: ... not require any interface hardware The data are generated by the model of the real hardware which is built into the RTK The following commands display the example of data generated by the simulator ret es_call SetBaseAddress 0 ret es_call SetPW 1 1 1 1 1 1 0 3 0 3 1 zeros 1 11 ret es_call SetDataSource 1 2 3 4 5 6 ret es_call SetAlgNo 1 ret es_call StartAcq pause 5 hist es_call GetHistory plot hi...

Page 16: ...tion These functions get the parameters of the digital filters currently active in the RTK The filter functions GetChan1Filt GetChan2Filt GetChan3Filt GetChan4Filt GetChan5Filt and GetChan6Filt are associated with the input channel 1 input channel 2 input channel 3 input channel 4 input channel 5 and input channel 6 respectively see description of the GetHistory function The filter structure is de...

Page 17: ... all others parameters set to zero as default It gives the transfer function for the filter equal to 1 the output signal is equal to the input signal The return variable fi is a 2 by 9 matrix in the form a a a a a a a a a b b b b b b b b 0 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 0 See SetChan1Filt SetChan2Filt SetChan3Filt SetChan4Filt SetChan5Filt SetChan6Filt ...

Page 18: ...e Get information about data collected in the internal data acquisition buffer Synopsis src es_call GetDataSource Description The function returns the six elements vector containing information about data collected in the internal data acquisition buffer See the SetDataSource function for details See SetDataSource ...

Page 19: ...GetDivider Purpose Get the divider of the auxiliary clock Synopsis Div es_call GetDivider Description The function returns the divider of the basic RTK clock This function allows to define a sampling period different then set by SetSampleTime function See SetDivider GetSampleTime SetSampleTime ...

Page 20: ...s of the input channels is determined by the call to the SetDataSource function Table 1 Row of the matrix Description Units Hist 1 regularly spaced time seconds Hist 2 input channel 1 Hist 3 input channel 2 Hist 4 input channel 3 Hist 5 input channel 4 Hist 6 input channel 5 Hist 7 input channel 6 Hist 8 control for the DC drive relative units in the range 1 The maximum number of samples available...

Page 21: ...8 9 10 11 12 13 es_call SetPW 1 1 1 1 1 0 5 0 3 0 2 0 5 zeros 1 11 es_call SetAlgNo 1 es_call StartAcq clear data buffer while es_call GetNoOfSamples 250 wait for data end Hist es_call GetHistory get data and clear buffer es_call StopPractical To plot angle of the DC shaft execute the following MATLAB command plot Hist 1 Hist 2 grid 94 96 98 100 102 104 106 108 40 30 20 10 0 10 20 30 40 50 60 ...

Page 22: ...ly 94 seconds This means that the experiment was started after 94 seconds from the moment when es_call library was loaded to the memory If you want to plot the time from zero simple modify the command plot Hist 1 Hist 1 1 Hist 2 0 2 4 6 8 1 0 1 2 1 4 4 0 3 0 2 0 1 0 0 1 0 2 0 3 0 4 0 5 0 6 0 The following commands plot angle and angular velocity vs time plot Hist 1 Hist 2 Hist 1 Hist 3 ...

Page 23: ...0 8 6 0 4 0 2 0 0 2 0 4 0 6 0 The following command plots the control value for the DC drive plot Hist 1 Hist 8 94 96 98 100 102 104 106 108 0 5 0 4 0 3 0 2 0 1 0 0 1 0 2 0 3 0 4 0 5 Note There is a GUI interface available ready to plot data from the data acquisition buffer Execute the command es_stet to display the following window ...

Page 24: ...CHAPTER 2 MODULAR SERVO Reference Manual Description of the Toolbox Functions 33 008 2M5 2 13 ...

Page 25: ...nds to the mathematical model of the DC servo motor given by the following equations x Ax Bu y Cx where S T A 1 0 1 0 S S T K B 0 C C C 1 2 0 0 x1is angle of the DC motor shaft x2is angular velocity u is input voltage y 1 y2 are the outputs of the angle and velocity of the DC motor shaft See the Advanced Teaching Manual 33 008 4M5 for details The elements of the Ret vector are Ret 1 is equal to KS...

Page 26: ... number of samples currently available in the buffer The maximum number of samples available in the buffer is equal to 1024 See GetHistory Example 1 Wait until the number of data in the buffer is greater than 120 es_call StartAcq clear buffer length of buffer is set to zero while es_call GetNoOfSamples 120 end Example 2 The maximum data buffer length is 1024 The following sequence will never termi...

Page 27: ...iption The function returns the vector containing the parameters of the control algorithm currently active in the RTK The vector contains 20 elements The set of the parameters is common for all algorithms but only specified values are used by the currently active controller See GetPW SetP Example Increase the second parameter by 120 Par es_call GetP Par 2 1 2 Par 2 es_call SetP Par ...

Page 28: ...ctor contains 20 elements The set of parameters is common for all shapes of signal waves but only some values are used by the currently active excitation source The internal excitation source may be used as a source of control value for the DC motor in the open loop mode a source of reference angle in the closed loop mode See SetPW Example Set and read the parameters of the internal excitation sou...

Page 29: ...ption of the Toolbox Functions 2 18 33 008 2M5 GetSampleTime Purpose Get the basic sampling time Synopsis SmplT es_call GetSampleTime Description The function returns the period of the basic RTK clock The period is given in seconds See SetSampleTime ...

Page 30: ...the voltage generated by the tachogenerator Synopsis v2 es_call GetV2Velocity Description The function returns a scaling coefficient used to calculate velocity of the motor shaft based on the voltage generated by the tachogenerator The output voltage from the tachogenerator is multiplied by this coefficient and divided by 5 0 to calculate velocity of the shaft expressed in deg sec See SetV2Velocit...

Page 31: ...l dll module Note The following messages can appear during execution of the LoadLibrary function Can not open ES_PAR INI file Base address is set to zero the es_par ini file is not present in the directory which contains the es_call dll file The es_par ini file should contain the following line which defines base address of the I O board BaseAddress 768 If the es_par ini file is missing the base a...

Page 32: ...AR INI file the es_par ini file is corrupted See message above for details Windows NT Couldn t access RTKIO device or Can not start IO access these two messages can appear in the Windows NT operating system only They are caused by absence of the RTKIO kernel mode device driver properly installed and running in the operating system See description of the installation procedure to solve this problem...

Page 33: ...Set the incremental encoder to the initial position Synopsis es_call ResetEncoder Description The function defines the initial position of the DC servo The function is called while the system is in a steady state The ResetEncoder function should be executed immediately after loading RTK to the memory See LoadLibrary ...

Page 34: ...ose Set the experiment time to zero Synopsis es_call ResetTime Description The function sets the time counter of the RTK to zero Time is calculated from the first call of the es_call function After a call of the ResetTime function the time vector returned by GetHistory function starts from zero See GetHistory ...

Page 35: ... used The SetAlgNo function must be preceded by a call of the SetP or SetPW functions Use the SetPW function before es_call SetAlgNo 1 and SetP in other cases Table 2 Algorithm no Description 0 Stop experiment set control to zero 1 Open loop excitation Uses internal generator as control signal sources 2 PID controller 3 state feedback controller 4 time optimal 99 External controller The PID contro...

Page 36: ...cond channel of the data acquisition buffer as the velocity of the shaft and the data available in the third channel as the reference value The time optimal controller interprets the data in the internal buffer in the same way as the state feedback controller does See GetAlgNo GetP GetPW SetP SetPW Example 1 Activate the internal excitation source and generate a triangle control signal Start an op...

Page 37: ...Source 8 9 13 1 1 1 es_call SetPW 1 2 2 2 2 50 50 50 50 zeros 1 11 es_call SetAlgNo 0 stop experiment p 0 025 3 46 0 013 1 1 zeros 1 15 p es_call SetP p es_call SetAlgNo 2 begin PID experiment es_call StartAcq clear data buffer pause 10 Hist es_call GetHistory get data and plot plot Hist 1 Hist 2 4 grid 1 3 9 2 1 3 9 4 1 3 9 6 1 3 9 8 1 4 0 0 1 4 0 2 1 4 0 4 1 5 0 1 0 0 5 0 0 5 0 1 0 0 ...

Page 38: ...ed to define the base address of the PCL 812 or the RT DAC board Notice that the base address is fixed in the configuration file es_par ini and is read each time RTK is loaded to memory If the base address is set to zero the RTK generates dummy data which are created by the software simulator of the real model See GetBaseAddress Example Set the address of the I O board to 768 220 in hexadecimal co...

Page 39: ...eference Manual Description of the Toolbox Functions 2 28 33 008 2M5 Note There is a GUI interface available which may be used to set new value of the base address To call it execute the es_sad command The result is shown below ...

Page 40: ...ilt fi ret es_call SetChan3Filt fi ret es_call SetChan4Filt fi ret es_call SetChan5Filt fi ret es_call SetChan6Filt fi Description These functions set the parameters of the digital filters currently active in RTK The filter are associated with appropriate input channels The filter structure is described by the difference equation y t a x t a x t iT b y t iT i i i i 0 0 1 8 0 1 8 where y t filter o...

Page 41: ...se the argument fi must be defined as 2 by 9 matrix in the form a a a a a a a a a b b b b b b b b 0 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 0 See GetChan1Filt GetChan2Filt GetChan3Filt GetChan4Filt GetChan5Filt GetChan6Filt Example Execute the following commands to collect and plot angle and velocity of the motor shaft calculated from the incremental encoder channel es_call SetDataSource 8 11 1 1 1 1 es_c...

Page 42: ...0 100 50 0 50 Notice the difference in the velocity data after the following commands fi 0 125 0 125 0 125 0 125 0 125 0 125 0 125 0 125 0 0 0 0 0 0 0 0 es_call SetChan2Filt fi es_call StartAcq clear data buffer pause 10 Hist es_call GetHistory get data and plot Hist 1 Hist 3 grid 2302 2304 2306 2308 2310 2312 2314 60 40 20 0 20 40 60 ...

Page 43: ...the data_source input argument have the meaning described in Table 3 Table 3 Value Description 1 voltage of the signal connected to the analogue input channel 10 of the I O board expressed in V 2 voltage of the signal connected to the analogue input channel 11 of the I O board expressed in V 3 voltage of the signal connected to the analogue input channel 12 of the I O board expressed in V 4 voltag...

Page 44: ...ard expressed in deg sec 10 angular velocity calculated from position signal connected to the analogue input channel 3 channel A D 11 of the I O board of the I O board expressed in deg sec 11 angular velocity calculated from position signal obtained from incremental encoder expressed in deg sec 12 reference value from the signal connected to the analogue input channel 12 of the I O board expressed...

Page 45: ...DULAR SERVO Reference Manual Description of the Toolbox Functions 2 34 33 008 2M5 Note The user can use the es_src MATLAB function to set data source using MATLAB GUI interface The appropriate window is shown below ...

Page 46: ...k of RTK This function allows the definition of a control period different from the value defined by the SetSampleTime function This clock can be used by control algorithms The Div argument must be a positive integer number See GetDivider Example 1 Set the control period 3 times longer than the sampling period es_call SetDivider 3 Example 2 Set the control period equal to the sampling period es_ca...

Page 47: ...ontrol es_call SetDivider 1 set triangle open loop excitation es_call SetPW 2 1 2 1 1 zeros 1 15 es_call SetDataSource 8 1 1 1 1 1 es_call SetSampleTime 0 1 es_call SetAlgNo 1 es_call StartAcq pause 5 h es_call GetHistory stairs h 1 h 1 1 h 2 creates the following diagram 0 0 5 1 1 5 2 2 5 3 3 5 4 4 5 5 3170 3160 3150 3140 3130 3120 3110 3100 3090 3080 3070 ...

Page 48: ... 008 2M5 2 37 After the commands es_call SetDivider 2 es_call StartAcq pause 5 h es_call GetHistory stairs h 1 h 1 1 h 2 the picture changes see figure below Notice that the control value changes three times slower 0 0 5 1 1 5 2 2 5 4620 4600 4580 4560 4540 4520 4500 4480 4460 4440 ...

Page 49: ... model Synopsis Ret es_call SetInitCond par Description The function sets the initial conditions for the mathematical model built into the RTK The new initial conditions are applied starting from the next sample time step The par vector contains two elements par 1 is initial value of the angle and par 2 is initial value for the velocity See GetModelP SetModelP ...

Page 50: ...l model The model is used by the internal system simulator and is given in the form of the following linear equations x Ax Bu y Cx where S T A 1 0 1 0 S S T K B 0 C C C 1 2 0 0 x1is angle of the DC motor shaft x2is angular velocity u is input voltage y 1 y2 are the outputs of the angle and velocity of the DC motor shaft The elements of the par vector are par 1 is equal to KS par 2 is equal to TS p...

Page 51: ...arameters The function SetP can be used for all control algorithms The controller parameters have the following meaning for algorithm number 0 set control value to zero the parameters are not required for algorithm number 1 open loop control see function SetPW detailed description for algorithm number 2 PID controller the control value is calculated due to the following algorithm εn n n Ch Ch 3 1 ...

Page 52: ...espectively Par 1 is equal to the Kp parameter Par 2 is equal to the Ki parameter Par 3 is equal to the Kd parameter Par 4 is equal to the Imax parameter Par 5 is equal to the Umax parameter for algorithm number 3 state feedback controller the control value is calculated due to the following algorithm εn n n Ch Ch 3 1 U K K Ch n n n 1 2 2 ε if U U thenU U n n max max if U U thenU U n n max max whe...

Page 53: ...parameter for algorithm number 4 time optimal controller the control value is calculated using the algorithm described in the Advanced Teaching Manual 33 008 4M5 See GetP GetPW Example Start PI controller for the DC drive es_call SetDataSource 8 9 13 1 1 1 es_call SetPW 1 2 2 2 2 50 50 50 50 zeros 1 11 es_call SetAlgNo 0 stop experiment p 0 025 Kp 3 46 Ki 0 0 Kd 1 Isat 1 Umax zeros 1 15 p es_call ...

Page 54: ... as a source of control value for the DC drive in the case of open loop control mode algorithm number 1 a source of reference value for the position in the case of all closed loop control algorithms The following periodical functions can be selected constant square triangle sinusoidal or random The elements of the Par argument have the following meaning Par 1 0 constant value In this case Figure 2...

Page 55: ...2 Par 2 Par 3 Par 4 Par 5 time periods Par 6 Par 7 Par 7 Par 8 appropriate levels of the signal Par 10 Par 9 Par 7 Par 6 Par 5 Par 4 Par 3 Par 2 time s 1 1 0 Level Figure 2 2 Square excitation Par 1 2 triangle wave In this case Figure 2 3 Par 2 Par 3 time periods Par 4 Par 5 appropriate levels Par 5 Par 4 Par 2 Par 3 1 1 0 time s Level ...

Page 56: ...ave In this case Figure 2 4 Par 2 time period Par 3 Par 4 maximum and minimum values of the signal Par 2 Par 4 Par 3 1 1 0 time s Level Figure 2 4 Sinusoidal excitation Par 1 4 random wave In this case Figure 2 5 Par 2 time period when the output of the random generator is kept constant Par 3 Par 4 maximum and minimum values of the random signal ...

Page 57: ... 2 5 Random excitation See GetPW SetAlgNo Example Set the internal excitation source to generate a sinusoidal wave period equals to 4 seconds minimum value is 0 3 maximum value is 0 9 Par es_call GetPW Par 1 4 3 4 0 3 0 9 es_call SetPW Par es_call GetPW ans 3 4 0 3 0 9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 es_call SetAlgNo 1 Open loop control ...

Page 58: ...on The controller output rate D A can be equal to or greater than the basic clock frequency The Period parameter must be in the range from 0 001s to 32 767s The lower bound depends on the hardware configuration The resolution is 0 001s See SetDivider GetSampleTime Example To set and to read the sampling period use the following statements es_call SetSampleTime 0 025 es_call GetSampleTime ans 0 025...

Page 59: ...chogenerator The output voltage from the tachogenerator is multiplied by this coefficient and divided by 5 0 to calculate velocity of the disk expressed in deg sec The call to this function sets the new value of the coefficient only for the current session of the RTK When you remove the RTK library from the memory and load it again you have to call this function again To make the definition of thi...

Page 60: ...he data acquisition buffer Synopsis es_call StartAcq Description The function erases the content of the buffer The action is similar to that of the GetHistory function but does not return the content of the buffer Notice that the GetNoOfSamples function returns zero when invoked immediately after the StartAcq call See GetNoOfSamples ...

Page 61: ...o stop the practical It suspends the currently active RTK control algorithm and sets control values for DC motor to zero The action is similar to es_call SetAlgNo 0 See SetAlgNo Example You can create the Simulink model containing single block which can be used to stop experiments Double click over this block will cause execution of the es_call StopPractical function The Simulink model is shown be...

Page 62: ...shown below To join the StopPractical block with the StopPractical action the following MATLAB command must be executed set_param untitled Subsystem OpenFcn es_call StopPractical This command sets the OpenFcn property of the Subsystem block from the untitled Simulink model to the es_call StopPractical statement It causes execution of the es_call StopPractical command when the user double clicks ov...

Page 63: ...Functions 2 52 33 008 2M5 UnloadLibrary Purpose Remove the RTK library from memory Synopsis Count es_call UnloadLibrary Description The function removes immediately the RTK library from the memory The termination of MATLAB removes the RTK from the memory See LoadLibrary ...

Page 64: ...ms and so on In our applications special S functions perform information exchange between SIMULINK models and the Real Time Kernel It is important to realise that user defined S functions are at the heart of how your control experiments are performed Inside a proper S function you can select a real time controller set its parameters and make process data being available in MATLAB environment Notic...

Page 65: ...M5 Guide for S functions example We shall discuss the S function of the PID Controller block This block belongs to the main MS150 window called by the es command from the MATLAB Command Window The SIMULINK model executed after a double click on PID Controller block is shown in Figure 3 1 Figure 3 1 PID Controller block ...

Page 66: ...Task dialogue box The window shown in Figure 3 2 sets the parameters of the SIMULINK model The parameters are passed to the S function during the execution of the model after the Start command from the Simulation menu The Real Time Task block is masked Masking mechanism available in SIMULINK allows you to define a block in terms of its dialogue box its icon and initialisation commands To see the d...

Page 67: ...ng The name of the S function connected with the S function block is es_pidsf This S function may be found in the es_pidsf m file A double click on the es_pidsf S function block opens the following window Figure 3 4 Figure 3 4 S function dialogue box In the window shown in Figure 3 4 the user can set the subsystem S function name and parameters In this example the function name is es_pidsf The nam...

Page 68: ...ion is described in the following part of this section The lines written in italics are statements of the es_pidsf m file The lines marked on the left side contain comments added for explaining statements of the S function The es_pidsf function may use the SIMULINK signal generator external signal generator or built in signal source to set the reference angle of the servo disk The source is select...

Page 69: ...ontroller downsamp downsampling ratio Defines how many samples are transferred to the output of the S function block For instance if downsamp is equal to 10 only 1 sample of every 10 samples is transferred from the Real Time Kernel to the output of the S function block stop_pr flag used to stop experiment when the Simulink simulation is terminated exc_src variable which is used to select the sourc...

Page 70: ... es_call GetP Kr par 1 Ti par 2 Td par 3 p 1 5 Kr Ti Td 1 1 p es_call SetP p dummy es_call SetInitCond 0 0 dummy es_call SetAlgNo 2 PID Reset the experiment time dummy es_call ResetTime 0 Set initial state of the internal signal source p es_call GetPW p 1 2 0 0 p es_call SetPW p Set source of the reference position switch exc_src case 1 Simulink signal generator dummy es_call SetDataSource 8 9 13 ...

Page 71: ...tial 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 generato...

Page 72: ... for details sys downsamp history es_sfntp downsamp history case 9 Terminate change background color of Real Time Task block after simulation stop set_param es_pid RealTimeTask BackgroundColor green Terminate experiment if the stop_pract flag is set if stop_pract 0 dummy es_call SetAlgNo 0 dummy es_call SetSampleTime 0 05 end otherwise Unexpected flags error Unexpected flag num2str flag end ...

Page 73: ...CHAPTER 3 MODULAR SERVO Information Flow Between Reference Manual Simulink Models and the Real Time Kernel 3 10 33 008 2M5 Notes ...

Page 74: ...der auxiliary clock multiplier GetHistory content of the buffer GetModelP parameters of the mathematical model GetNrOfSamples number of samples in the buffer GetP parameters of the control algorithm GetPW parameters of internal excitation generator GetV2Velocity get conversion coefficient LoadLibrary load RTK DLL library ResetTime set experiment s time to zero SetAlgNo selects the control algorith...

Page 75: ...l SetP set parameters of the controller SetPW set parameters of internal excitation generator SetSampleTime set basic clock SetV2Velocity set conversion coefficient StartAcq clear content of the buffer StopPractical stop practical UnloadLibrary remove RTK DLL library from memory 2 Demo Simulink models es start main demo es_open open loop control es_pid PID control algorithm es_topt time optimal co...

Page 76: ...ers es_egen set parameters of excitation generator es_stet stethoscope GUI window es_test basic tests of the hardware es_tune calibration of the 33 301 box es_model set built in model oparameters es_zglr Ziegler Nichols method es_idnt time domain identification es_freq frequency characteristics es_char DC drive static characteristic es_sim closed loop system design and simulation ...

Page 77: ...CHAPTER 4 MODULAR SERVO Reference Manual Quick Reference Table 4 4 33 008 2M5 Notes ...

Reviews: