New User Special Price Expires in

Let's log you in.

Sign in with Facebook


Don't have a StudySoup account? Create one here!


Create a StudySoup account

Be part of our community, it's free to join!

Sign up with Facebook


Create your account
By creating an account you agree to StudySoup's terms and conditions and privacy policy

Already have a StudySoup account? Login here


by: Miss Damien Crooks
Miss Damien Crooks
GPA 3.52


Almost Ready


These notes were just uploaded, and will be ready to view shortly.

Purchase these notes here, or revisit this page.

Either way, we'll remind you when they're ready :)

Preview These Notes for FREE

Get a free preview of these Notes, just enter your email below.

Unlock Preview
Unlock Preview

Preview these materials now for free

Why put in your email? Get access to more of this material and other relevant free materials for your school

View Preview

About this Document

Class Notes
25 ?




Popular in Course


This 40 page Class Notes was uploaded by Miss Damien Crooks on Monday October 19, 2015. The Class Notes belongs to ECSE 4962 at Rensselaer Polytechnic Institute taught by Staff in Fall. Since its upload, it has received 64 views. For similar materials see /class/224780/ecse-4962-rensselaer-polytechnic-institute in ELECTRICAL AND COMPUTER ENGINEERING at Rensselaer Polytechnic Institute.





Report this Material


What is Karma?


Karma is the currency of StudySoup.

You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!

Date Created: 10/19/15
Using MATLAB and Simulink for Control System Simulation and Design 12903 Outline Overview and review of MATLAB and Simulink Using MATLAB and Simulink for dynamical system analysis and simulation and control design Nonlinear vs linear simulation and analysis Application to PanTilt platform Last Time Equation of motion for dynamical systems 1ink 13 N21 9 BK NBm6ig Nrm mng sin 93 General M99quotB C9 9 G9 r As a control system we may regard I is the input 9 is the output Today we will see how to use MATLAB and Simulink to simulate the response of the system for a given input trajectory MAT LAB A powerful package with builtin math functions array and matrix manipulation capabilities plotting and lots of addon toolboxes eg control image processing symbolic manipulation block diagram programming ie Simulink etc MAT LAB Vectors thetatheta1theta2 Matrices MM11 M12 M21 M22 Polynomials pa3 a2 a1 a0 Transfer functions Gtfnumden Linear simulation step response stepG impulse response impulseG general response ylsimGut MATLAB Cont Solving ODE Xftx txode23 func 0ttxinit ffunctx Plotting plottx1tx2xlabel time sec ylabel theta deg title thetat legend theta1 theta2 Printing to printer or file print f dltdevice typegt ltfile namegt Using mfiles in MATLAB use any editor or MATLAB builtin editor just type in edit function ffunctx Getting help in MATLAB help ltfunction namegt orjust help onIine tutorial httpWWWen2inumichedugroupctm Application to PanTilt Platform pantilt m gives the symbolic expression for M 2x2 mass matrix C 2x1 coriolislcentrifugal torque G 2x1 gravity vector For numerical computation take a look of pantiltmodel m set up I p m for the two bodies massmatrixm calculates M9 coriolism calculates C9999 gravitym G9 Simulation Consider input as the motor torques T 2X1 and output as the joint angles link 9 2X1 Simulation involves nd the output response for a given input trajectory You will use a high delity simulation to validate your design including nonlinearity friction saturation etc For your control design you will need to use a linearized model pantilt dynamics Linearization Equation of motion is nonlinear M C G are nonlinear functions of 9 To facilitate control system design we first linearize about an operating point99 9610 Linearization 1D example Taylor series expansion about 96 9d0 and keep the linear term Consider the 1D example from last class 19 Fc sgn Fv mglg sin9 1 sine sin6d cos6d9 6d O5sin6d9 6d2 Linearized system 1A9 FvA mglg cos QdAQ r mglg sin 9d may be cancelled or treated as a disturbance A99 9d Linearization General Mechanical Systems M9d939D939 3 g9d9 9d r G9d cancelled or treated as disturbance 8G1 8G1 ac 801 802 362 362 8 01 E For pantilt platform input is motor torque T2X1 output is 0 2x1 1 linearized 9 gt pantilt gt dynamics Description of LT Systems npuu0utput What does LT mean differential equa on Frequency Domain State Space state Input output Description of LT Systems M9d D V9G9d9 9d r InputOutput differential equa on Frequency Domain State Space 0 I 0 X X T M IVG 44 11 M4 A9 S2M9dDSV9G9d1TS Er W3 G y 0XQT MATLAB Description of LTl Each LTl is treated as an object with a variety of possible description transfer function tf num den numerator and denominator polynomials polezerogain zpkzpk zeros poles gain state space 83 A B C D state space parameters Take a look of panti1tinit m on the webpage Open Loop Linear System Response Impulse response yimpulseG step response ystepG general response ylsimGut Bode plot ybodeG poleszerosdampings poleGzeroG dampG polezero plot pzmapG gainphase margin robustness marginG Incorporation of Control Interconnection of LT systems Gcl feedbackGKHF Simulink Instead of command line entries it may be easier to use a block diagram programming tool LTI block Take a look of pantiltlinearmd1 for linearized pantilt under PID control Pan Tilt Linear Simulation Effect of Sampling Most control systems these days are digital in nature so sampling is inherent through AID for sensor which contains a sampler and DIA for actuators which contains a zeroorderhold To analyze the effect of sampling we can find the equivalent discrete time system Gd c2dGtstssampling period sec Gd is also an LT object and the commands for LT may be applied Adding Sampling to Simulink Diagram To add sampling to your continuous time simulation just add a zeroorderhold block in the discrete time system library to the input then set the sampling time Pan Tilt Linear Simulation Nonlinear System Simulation Gs may be replaced by a nonlinear block Pan Tilt Nonlinear Simulation 7quot um mm mum is m mm m m fall I l M m mum ltwmmmuw What You Need to Do CI Turn your qualitative spec into more quantitative spec in terms of speed and precision ability to reject disturbance etc CI Develop a Simulink diagram for your design iteration Use the Simulink diagram online as a starting template Add motor and gear parameters to the pantilt skeleton generate composite m I p for each body Use your design parameters for simulation Desired input should be based on your spec You need to tweak the controllers also eg gravity compensation removing the mass matrix coupling tune gains for each axis avoid saturation etc Today at 5pm Next Tuesday 24 5pm Next Wednesday 25 5pm Work on your project proposal include preliminary design using MATLABSimulink Next Wednesday 25 9am Components of control systems amplifier encoder motor Basic Components in Control Systems Motor Amplifier and Encoder 2503 Outline Model of DC motor Amplifier consideration Encoder Force on Current element due to Mag Field Magnetic field imparts force on current carrying elements motor B u df 1df X B magnetic ux density quotquotquotquotquotquot quot Tesla Weberm2 quotquotquotquot quot Vsmz For a current element of length land B perpendicular to the conductor the total force is fwB Voltage clue to Motion in Mag Field If a conductor moves with velocity Vin a magnetic field a voltage is induced d6 vad vgtltB indicates direction of current ow if circuit is completed For a conductor of length I and B v and are mutually perpendicular the total induced voltage is evB DC Motor For a single current loop under magnetic flux density qbA the total torque is T 2 2mm A For N windings the torque is T 2i aNA Ktl39 Kt is the torque constant to 45 A quotB lt0 A magnetic uxeffective crosssectional area DC Motor Cont For a single current rotating with angular velocity 9 the total induced voltage is e 29a A For N windings the induced voltage is e ZQCWNA Kb v9a ltEi7 ngbmkmmkMMm a N v9a Complete Model From input voltage 9 to motor angle 9m we have a thirdorder system Jmem D0m Tf sgn0m Kti TL L RiKe m el dt electrical time constant LR is typically small so we can approximate the system by iel KeemR Jm 39m D m Tf sg11 m Kg cL Kt e1 Ke mR TL Jm 39m 0 KtKe R m Tf sgn m Ktei R cL Complete Model with Gear From input voltage 9 to motor angle 9m we have a thirdorder system Jm 39m ND m NTf sgn m NKtz39 TL LRiNKel9m 2 e t ignoring electrical dynamics 2 el KeN mR Jm 39m ND m NT sgn m NKtz39 45 NKI e1 NKe m R TL Jm 39m ND NZKIKe R m NTf sgn m NKtel R rL Motor Datasheet Innstan Izzaiu39u39A Time Clanstam39 Time Innstam Cons am T i Fj wat r TimB Cmsiarut min Hatin Allcwahla I orqzu Gznin Nsm u UM Relating Model to Datasheet For the constant input voltage e24V we have the steady state condltlon denh VS TL is 1 6i KeN m R a straight line ND NzKlKe R m NKlel R rL NTf N0 load speed set TL 0 solve 9m N0 load current solve for 139 based on QNL Peak torque set 9m 2 0 solve for TL Peak current iP e R TorqueSpeed Curve Speed E Eurrlam vs anqmm E El 3 I qum cgIna Gurrsamt Fl 5239 d I r I a summit 5 1 I12 What does this mean High speed generates large back EMF reducing the supplied voltage and the maximum current and torque z39 emax KeN mR max To see if your motor can support your simulation result plot speed vs torque and make sure it s not too much beyond the motor speedtorque curve Amplifier Output of controller is a voltage between 10V and 10V We need to use a current amplifier to convert this voltage to a corresponding current and finally the driving torque Linear amplifier output current is proportional to the input voltage PWM amplifier output current is switched between maxmin voltages at high frequency typically 20KHz and duty cycle is proportional to the input voltage 50 duty cycle lt gt 0 V Amplifier TDRGUE MODE ENCDDER GND 2 ENABLE 11 3 P03 ENABLE 12 J1 NEG ENABLE 13 5 l 111 NOTE S1 OFF fur gmund aciwe enables Current Feedback Loop Without current feedback we have more effective damping Jm 39m ND NZKIKE R m NTf sgn9m NKtel R TL With current feedback i is the effective input Jm 39m ND m NTf sgn m NKtKaV TL ampli er DA gain output However iKaV is still subject to saturation due to max amp current and max supplied voltage and back EMF Sensors encoder consisting of a code wheel wheel with slits and a pair of LEDphotodetector AIB channels Sometimes encoders provide differential outputs also AlA BB to remove noise effect Encoder counter counts each voltage transition so with upldown edges of AIB channels there is an effective multiplier of 4 quadrature decoding So a 1000 line encoder has a resolution of 27 4000 potentiometer variable resistor need to specify range of rotation eg of turns Online Article on encoder MotorAmpIEncoder datasheets for the pantilt built by Ben Description of Motor selectionsizing from Pittman Today at 5pm Work on your project proposal include preliminary design using MATLABSimulink Next Tuesday 211 5pm Wednesday 212 5pm Preliminary design review project proposal due on 212


Buy Material

Are you sure you want to buy this material for

25 Karma

Buy Material

BOOM! Enjoy Your Free Notes!

We've added these Notes to your profile, click here to view them now.


You're already Subscribed!

Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'

Why people love StudySoup

Jim McGreen Ohio University

"Knowing I can count on the Elite Notetaker in my class allows me to focus on what the professor is saying instead of just scribbling notes the whole time and falling behind."

Allison Fischer University of Alabama

"I signed up to be an Elite Notetaker with 2 of my sorority sisters this semester. We just posted our notes weekly and were each making over $600 per month. I LOVE StudySoup!"

Steve Martinelli UC Los Angeles

"There's no way I would have passed my Organic Chemistry class this semester without the notes and study guides I got from StudySoup."

Parker Thompson 500 Startups

"It's a great way for students to improve their educational experience and it seemed like a product that everybody wants, so all the people participating are winning."

Become an Elite Notetaker and start selling your notes online!

Refund Policy


All subscriptions to StudySoup are paid in full at the time of subscribing. To change your credit card information or to cancel your subscription, go to "Edit Settings". All credit card information will be available there. If you should decide to cancel your subscription, it will continue to be valid until the next payment period, as all payments for the current period were made in advance. For special circumstances, please email


StudySoup has more than 1 million course-specific study resources to help students study smarter. If you’re having trouble finding what you’re looking for, our customer support team can help you find what you need! Feel free to contact them here:

Recurring Subscriptions: If you have canceled your recurring subscription on the day of renewal and have not downloaded any documents, you may request a refund by submitting an email to

Satisfaction Guarantee: If you’re not satisfied with your subscription, you can contact us for further help. Contact must be made within 3 business days of your subscription purchase and your refund request will be subject for review.

Please Note: Refunds can never be provided more than 30 days after the initial purchase date regardless of your activity on the site.