270 likes | 507 Views
Introduction to MATLAB. Chris Diduch University of New Brunswick January 31 – February 4, 2004 Royal Bhutan University RBIT, Rinchending Day-5. Robot Kinematics Animation. Robot Kinematic Animations. Build 3D cylinder shapes for each link
E N D
Introduction to MATLAB Chris Diduch University of New Brunswick January 31 – February 4, 2004 Royal Bhutan University RBIT, Rinchending Day-5
Robot Kinematic Animations • Build 3D cylinder shapes for each link • Coordinates of adjacent links are related through a homogenous transformation • The homogenous transformation specifies a rotation and translation of points • An end effector trajectory is generated by interpolating between points • Change the rotation and translation of each link as governed by the next interpolated point • Redraw or update the figure display
Graphical User Interfaces • GUI’s are attached to figure windows • Pull down menus • Push buttons • Check boxes • Text boxes • Sliders • Popup menus • ….
GUI for the Pendulum • Add a Pause and End push button • Add a Slider and Text box for changing and displaying the pendulum length parameter
Day 5 Proposed Topics • Symbolic math toolbox • Simulink • Control systems toolbox • Identification toolbox • Signal processing toolbox
Symbolic Math Toolbox • Manipulate and solve symbolic equations • MAPLE (licensed by Mathworks) is the underlying engine
Two Axis Robot Kinematics q2 q1 q2 q1
Simulink • Graphical entry tool for dynamic systems • A dynamic model relating outputs to inputs • May use Simulink for simulation • With other toolboxes (Real time workshop, xPC Target …) • May interface to data acquisition hardware • May be compiled and executed under a real time operating system • Supports multiple targets
Pendulum - Linear Model θ = π θ = 0
Control System Toolbox • System representation in many forms: • Transfer function • State space • Pole–zero • Step, impulse and transient response • Bode, Nyquist, Nichols, pole-zero plots • Statefeedback • Pole placement • LQG • Model order reduction
RLC Circuit L vin vout C R
Feedback Amplifier Design vn - vo vp +
+ - Proportional Feedback vp vo vn R2 R1
+ vp - vn Proportional Feedback vo
+ - Lead Compensator vp vo vn R2 C R1
u y Excitation Model Identification Toolbox System Identification Toolbox
u y fft() fft() uf yf Nonparametric Model
n yNoisey u + + Parametric Identification
Identification Algorithms • Spectral analysis, spa() • Predictive error method, pem() • Autoregressive, ar() • Instrumental variables, iv4() • Autoregressive moving average, arma() • Box-Jenkins, bj()
Signal Processing Toolbox • Filtering and FFT’s • Signals representation • Time and frequency response • IIR and FIR filter analysis and design • Statistical signal processing • Correlation and covariance • Spectral analysis • Windowing • Cepstrum analysis
Digital Filters and Correlation • Input, u, is selected as a pulse • Plot u and filter output, y • Plot FFT of input pulse, u • Plot FFT of filter output, y • Plot autocorrelation of input pulse, u • Plot autocorrelation of filter output, y
Final Summary • MATLAB windows and navigation. • Arrays: create, append, index, delete. • Array operations: element-by-element, matrix arithmetic, relational and logical. • Data analysis: linear equations, linear algebra, least squares. • 2-D and 3-D plots. • Handle graphics and simple animation • Toolboxes