assignment continuous sys

Upload: mohamed-elsayed-harb

Post on 15-Oct-2015

22 views

Category:

Documents


1 download

TRANSCRIPT

ALEXANDRIAUNIVERSITYFACULTY OF ENGINEERING Electrical Department Postgraduate Studies

Assignment # 1

Continuous System Techniques(Example on DC Motor)

CB

Name: Code : 0719861-PHDMob :

Spring 2013

DC Motor Speed: System ModelingPhysical setupA common actuator in control systems is the DC motor. It directly provides rotary motion and, coupled with wheels or drums and cables, can provide translational motion. The electric equivalent circuit of the armature and the free-body diagram of the rotor are shown in the following figure. Example: The input of the system is the voltage source (V) applied to the motor's armature, while the output is the rotational speed of the shaft d(theta)/dt.The physical parameters for our example are:(J) moment of inertia of the rotor 0.01 kg.m^2(b) motor viscous friction constant 0.1 N.m.s(Ke) electromotive force constant 0.01 V/rad/sec(Kt) motor torque constant 0.01 N.m/Amp(R) electric resistance 1 Ohm(L) electric inductance 0.5 H

System equationsIn general, the torque generated by a DC motor is proportional to the armature current and the strength of the magnetic field. In this example we will assume that the magnetic field is constant and, therefore, that the motor torque is proportional to only the armature current i by a constant factor Kt as shown in the equation below. This is referred to as an armature-controlled motor(1)The back emf, e, is proportional to the angular velocity of the shaft by a constant factor Ke.(2)In SI units, the motor torque and back emf constants are equal, that is, Kt = Ke; therefore, we will use K to represent both the motor torque constant and the back emf constant.From the figure above, we can derive the following governing equations based on Newton's 2nd law and Kirchhoff's voltage law.(3)(4)Transfer FunctionApplying the Laplace transform, the above modeling equations can be expressed in terms of the Laplace variable s. Expressed in terms of the Laplace variable s.(5)(6)We arrive at the following open-loop transfer function by eliminating I(s) between the two above equations, where the rotational speed is considered the output and the armature voltage is considered the input.(7)State-SpaceIn state-space form, the governing equations above can be expressed by choosing the rotational speed and electric current as the state variables. Again the armature voltage is treated as the input and the rotational speed is chosen as the output.

(8)(9)

MATLAB representation1. Transfer FunctionWe will represent the above open-loop transfer function of the motor in MATLAB by defining the parameters and transfer function as follows.J = 0.01;b = 0.1;K = 0.01;R = 1;L = 0.5;s = tf('s');P_motor = K/((J*s+b)*(L*s+R)+K^2)Continuous-time transfer function. 0.01O/p T.f= --------------------------- 0.005 s^2 + 0.06 s + 0.10012. State SpaceWe can represent the system using the state-space equations. The following additional MATLAB commands create a state-space model of the motor and produce the output shown below when run in the MATLAB command window.A = [-b/J K/J -K/L -R/L];B = [0 1/L];C = [1 0];D = 0;motor_ss = tf2ss(A,B,C,D)%%%Output of state spacea = x1 x2x1 -10 1x2 -0.02 -2b = u1x1 0x2 2c = x1 x2 y1 1 0d = u1 y1 0State-space model generated by converting existing transfer function model into state-space form. This is again accomplished with the ss command Building the model with SimulinkThis system will be modeled by summing the torques acting on the rotor inertia and integrating the acceleration to give velocity. Also, Kirchoff's laws will be applied to the armature circuit. (1)(2)simulation model, open Simulink and open a new model window. Next, we will apply Newton's law and Kirchoff's law to the motor system to generate the following equations:(3)(4)The angular acceleration is equal to 1 / J multiplied by the sum of two terms (one positive, one negative). Similarly, the derivative of current is equal to 1 / L multiplied by the sum of three terms (one positive, two negative). Continuing to model these equations in Simulink, follow the steps given below. Insert two Gain blocks from the Simulink/Math Operations library, one attached to each of the integrators. Edit the Gain block corresponding to angular acceleration by double-clicking it and changing its value to "1/J". Change the label of this Gain block to "Inertia" by clicking on the word "Gain" underneath the block. Similarly, edit the other Gain's value to "1/L" and its label to "Inductance". Insert two Add blocks from the Simulink/Math Operations library, one attached by a line to each of the Gain blocks. Edit the signs of the Add block corresponding to rotation to "+-" since one term is positive and one is negative. Edit the signs of the other Add block to "-+-" to represent the signs of the terms in the electrical equation Now, we will add in the torques which are represented in the rotational equation. First, we will add in the damping torque. Insert a Gain block below the "Inertia" block. Next right-click on the block and select Format > Flip Block from the resulting menu to flip the block from left to right. You can also flip a selected block by holding down Ctrl-I. Set the Gain value to "b" and rename this block to "Damping". Tap a line (hold Ctrl while drawing or right-click on the line) off the rotational Integrator's output and connect it to the input of the "Damping" block. Draw a line from the "Damping" block output to the negative input of the rotational Add block.

Next, we will add in the torque from the armature. Insert a Gain block attached to the positive input of the rotational Add block with a line. Edit its value to "K" to represent the motor constant and Label it "Kt". Continue drawing the line leading from the current Integrator and connect it to the "Kt" block.

Now, we will add in the voltage terms which are represented in the electrical equation. First, we will add in the voltage drop across the armature resistance. Insert a Gain block above the "Inductance" block and flip it from left to right. Set the Gain value to "R" and rename this block to "Resistance". Tap a line off the current Integrator's output and connect it to the input of the "Resistance" block. Draw a line from the "Resistance" block's output to the upper negative input of the current equation Add block.Next, we will add in the back emf from the motor. Insert a Gain block attached to the other negative input of the current Add block with a line. Edit it's value to "K" to represent the motor back emf constant and Label it "Ke". Tap a line off the rotational Integrator's output and connect it to the "Ke" block. Add In1 and Out1 blocks from the Simulink/Ports & Subsystems library and respectively label them "Voltage" and "Speed".The final design should look like the example shown in the figure below

In order to save all of these components as a single subsystem block, first select all of the blocks, then select Create Subsystem from the Edit menu. Name the subsystem "DC Motor" and then save the model.

We then need to identify the inputs and outputs of the model we wish to extract. First right-click on the signal representing the Voltage input in the Simulink model. Then choose Linearization > Input Point from the resulting menu. Similarly, right-click on the signal representing the Speed output and select Linearization > Output Point from the resulting menu.The input and output signals should now be identified on your model by arrow symbols as shown in the figure below

In order to perform the extraction, select from the menus at the top of the model window Tools > Control Design > Linear Analysis. This will cause the Linear Analysis Tool to open. Within the Linear Analysis Tool window, the Operating Point to be linearized about can remain the default, Model Initial Condition. In order to perform the linearization, next click the Linearize button identified by the green triangle. The result of this linearization is the linsys1 object which now appears in the Linear Analysis Workspace as shown below. Furthermore, the open-loop step response of the linearized system was also generated automatically.

The open-loop step response above is consistent with the response generated in the DC Motor Speed: System Analysis page The reason the responses match so closely is because this Simulink model uses only linear components. Note that this process can be used extract linear approximations of models with nonlinear elements too.We will further verify the model extraction by looking at the model itself. The linearized model can be exported by simply dragging the object into the MATLAB Workspace. This object can then be used within MATLAB in the same manner as an object created directly from the MATLAB command line. Specifically, entering the command zpk(linsys1) in the MATLAB command window demonstrates that the resulting model has the following form.(1)

s = tf('s');P_motor = K/((J*s+b)*(L*s+R)+K^2);zpk(P_motor)Open-loop responseThe open-loop step response can also be generated directly within Simulink, without extracting any models to the MATLAB workspace. In order to simulate the step response, the details of the simulation must first be set. This can be accomplished by selecting Configuration Parameters from the Simulation menu. Within the resulting menu, define the length for which the simulation is to run in the Stop time field. We will enter "3" since 3 seconds will be long enough for the step response to reach steady state. Within this window you can also specify various aspects of the numerical solver, but we will just use the default values for this example.Next we need to add an input signal and a means for displaying the output of our simulation. This is done by doing the following: Remove the In1 and Out1 blocks. Insert a Step block from the Simulink/Sources library and connect it with a line to the Voltage input of the motor subsystem. To view the Speed output, insert a Scope from the Simulink/Sinks library and connect it to the Speed output of the motor subsystem. To provide a appropriate unit step input at t=0, double-click the Step block and set the Step time to "0". The final model should appear as shown in the following figure

Controllability TestQ =[B A*B A^2*B];Q = 0 2.0000 -24.0000 2.0000 -4.0000 7.9600c_r = rank(Q)= 2 then system controllableObservability Test R = [ C; C*A ; C*A^2 ];R = 1.0000 0 -10.0000 1.000099.9800 -12.0000O_r = rank(R) =2,then system observableStability TestE = eig(A)E = -9.9975 -2.0025The system is stable since eigen values have a ve real part