Ada Msp Id Me 451

download Ada Msp Id Me 451

of 27

Transcript of Ada Msp Id Me 451

  • 8/3/2019 Ada Msp Id Me 451

    1/27

    PID controls in

    ADAMS/ViewBy,Makarand Datar

    ME 451, Spring 09

  • 8/3/2019 Ada Msp Id Me 451

    2/27

    Building the model

    The model consists

    of two cylindricalparts and 2 joints.The ste s for

    building the modelare described in thesubsequent slides.The final modelshould like thissnapshot.

  • 8/3/2019 Ada Msp Id Me 451

    3/27

    Building the model: Parts

    Turn on the Coordinate Window

    (View Coordinate Window)

    e ec e u cy n er oo romthe ridig body tool stack in theMainToolbox

    Build the outer cylinder (OC) byselecting (0,0,0) as the start point

    and (400,400,0) as the end point

  • 8/3/2019 Ada Msp Id Me 451

    4/27

    To build the inner cylinder (IC),

    again select the Cylinder tool asbefore

    Building the model: Parts

    box is checked and put the value ofradius to be 3.0 cm

    Build the IC by selecting the

    center of mass (CM) of the OC asthe starting point and(1000,1000,0) as the end point.

  • 8/3/2019 Ada Msp Id Me 451

    5/27

    Apply a Revolute Joint between the

    OC and ground at (0,0,0) Before applying the joint, select the

    o tions for the oint as shown here

    Building the model: Joints

    Apply a Translational Joint betweenthe OC and IC at the location ofCM of the OC

    The direction of the Translational jointshould be along the lengths of the

    cylinder

  • 8/3/2019 Ada Msp Id Me 451

    6/27

    Apply a motion on thetranslational joint

    Right click the motion icon andpoint to modify

    Change the function value for*

    Building the model: Motions

    Run a trial simulation to makesure that the IC movesoutwards. If not, put a ve

    sign in the function value (-12* time)

    Note: Do not worry aboutwhere the motion icon ispointing.

  • 8/3/2019 Ada Msp Id Me 451

    7/27

    Parts (total 2) OC [(0,0,0)(400,400,0)

    IC [CMoc (1000,1000,0)]

    oints (total 2)

    Building the model: Check

    Revolute between OCand ground

    Translational between

    OC and IC Motion (total 1)

    On the translational

    joint

  • 8/3/2019 Ada Msp Id Me 451

    8/27

    What are we trying to achieve?

    Imagine that a torque is applied at the revolute

    joint between OC and the ground. As the ICextends outwards, more and more torque needs tobe a lied at this oint to kee the model in the

    same orientation. Thus, a PID controlled torque is applied at the

    joint.

    The change in location and change in velocity of themodel is sensed and a corrective action is taken byapplying an appropriately changing the magnitude of

    the torque.

  • 8/3/2019 Ada Msp Id Me 451

    9/27

    Building Measures for PID controls

    2 measures will be necessary

    1. Measure for the angular displacement of the model

    2. Measure for the angular velocity of the model

    Measure

    Create the above mentioned measures by selectingappropriate options

    The details of this are on the next two slides alongwith the snapshots.

  • 8/3/2019 Ada Msp Id Me 451

    10/27

    Measure for Angular

    Displacement Replicate the options

    as shown on right

    Building Measures for PID controls

    ou can c ange t emeasure name. Becareful to change onlythe highlighted part

    (see figure) in themeasure name. Theinitial part is themodel name.

  • 8/3/2019 Ada Msp Id Me 451

    11/27

    Measure for Angular

    Velocity Replicate the options

    as shown on right

    Building Measures for PID controls

    ou can c ange t emeasure name. Becareful to change onlythe highlighted part

    (see figure) in themeasure name. Theinitial part is themodel name.

  • 8/3/2019 Ada Msp Id Me 451

    12/27

    Building the PID controls

    Go to Build Controls Toolkit This will launch the Create Controls

    Blockwindow as shown

    Create Inputs for referencemeasures and actual measures

    Calculate the error in the actual

    measure by comparing it withreference input

    Build the PID based on this error

  • 8/3/2019 Ada Msp Id Me 451

    13/27

    Create Input-Signals Three input signals will be created

    1. Reference input for theAngular DisplacementandAngular Velocity (this value will be set to zero as ourgoal is to have the model maintain its orientation and

    Angular Velocity)

    2. Input for the actual measured value of theAngularDisplacement(this input will use the measure for

    Angular Displacement that you previously created)3. Input for the actual measured value of theAngular

    Velocity (this input will use the measure for Angular

    Velocity that you previously created)

  • 8/3/2019 Ada Msp Id Me 451

    14/27

    Create Reference input

    Click on the Create input signal block

    icon Give some suitable name by only modifying

    the highlighted area

    Create Input-Signals

    As the reference input represents an ideal(error free) signal, in our model this value iszero. Hence enter 0.0 * timein the functionblock

    Note that we will use the same reference forboth the measures (angular displacementand angular velocity) as the value of

    reference is zero in both the cases.

  • 8/3/2019 Ada Msp Id Me 451

    15/27

    Create input for angular displacement

    Follow the same process as before tocreate a new input

    But this time, the function value is not*

    Create Input-Signals

    . .value ofAngular Displacementmeasurewhich was previously created

    Delete everything from the function area

    Click on the button next to the functionexpression bar. This will launch FunctionBuilderas shown on the next slide.

  • 8/3/2019 Ada Msp Id Me 451

    16/27

    Create Input-Signals

  • 8/3/2019 Ada Msp Id Me 451

    17/27

    Inside the function builder, select Measures in the

    Getting Object Data drop down menu Right click in the bar next to the drop down and point

    to Runtime_Measure Guess and then select the

    Create Input-Signals

    measure t at you create or t e ngu ar sp acemen Once this is done, the Insert Object Name button

    under the bar will be activated. Click this button andthen select OK to close the function builder

    This will take you back to the Create Controls Blockwindow. Select OK or Apply to finalize the creationof this input signal

  • 8/3/2019 Ada Msp Id Me 451

    18/27

    Follow the same procedure as before to create the

    third input signal forAngular Velocity measure

    Create Input-Signals

  • 8/3/2019 Ada Msp Id Me 451

    19/27

    Building the error signal

    The next step is to calculate the error signal by

    using (Reference Measured) format Error in Angular Displacement will be

    .

    Error in Angular Velocity will be

    Reference Input Signal Input Signal for Angular Vel.

    Also note that the Error in Angular Velocity is the firsttime derivative of Error in Angular Displacement

  • 8/3/2019 Ada Msp Id Me 451

    20/27

    Creating error signal for AngularDisplacement

    To build the error signal, click on the CreateSumming Block button

    Give some appropriate name

    Building the error signal

    Right click in the bar of Input 1 and point tocontrols_input Guesses and select thereference input that you previously created

    Click the + sign under the Input 2 to toggle it

    to - Right click in the bar of Input 2 and point to

    controls_input Guesses and select theAngular Displacement input that you previouslycreated and then select Apply

  • 8/3/2019 Ada Msp Id Me 451

    21/27

    Follow the same procedure to create a second

    error signal for the Angular Velocity

    Building the error signal

  • 8/3/2019 Ada Msp Id Me 451

    22/27

    Creating the PID block Click on the Create PID block button

    Give an appropriate name Right click in the bar under the Input and

    point to controls_sum Guesses and select

    that you previously created

    Right click in the bar under the Derivative

    Input and point to controls_sum Guesses

    and select the error signal for the AngularVelocity that you previously created

    Use the P Gain of 200000

    Use the I Gain of 1

    Use the D Gain of 5000 (select Apply to finish)

  • 8/3/2019 Ada Msp Id Me 451

    23/27

    Note that the values for the gains are guessed.

    The required torque depends on the configurationof the system and part inertias. If the part inertiasare chan es one will need to ad ust the ain to

    Creating the PID block

    scale the torque accordingly

    As a thumb rule, choose a high value for the gainsto that the mechanism is quickly stabilized (andwe achieve what we want to) and then adjust itlater to make finer changes

  • 8/3/2019 Ada Msp Id Me 451

    24/27

    Applying PID Torque to the model

    Select the Torque from Applied Force

    tool stack Make sure that the options are selected as

    Apply this torque between the ground andOC at (0,0,0). (see the snapshot)

    Hint: Pay

    attention to thestatus bar for cues

    while building thetorque

  • 8/3/2019 Ada Msp Id Me 451

    25/27

    Once the torque is applied, we need tomodify it so that it reads values from the

    PID block that we created Right click the Torque icon and select

    modify to launch the modify torque

    Applying PID Torque to the model

    window as shown

    Delete everything from the functionexpression bar

    Click on the button next to thefunction expression bar to launch the

    Function Builder

  • 8/3/2019 Ada Msp Id Me 451

    26/27

    Inside thefunction builder, right click the bar next to Measures

    (Getting Object Data) and point to Runtime_Measure Guessesand select the name of the PID controller that you previously created

    Then click Insert Object Name and select OK

    Applying PID Torque to the model

  • 8/3/2019 Ada Msp Id Me 451

    27/27

    Test the model The model is ready to be simulated

    Run a trial simulation of 15 seconds with 500 steps and see

    the behavior If instead of maintaining the position, the torque is causing

    the model to uncontrollably rotate, that means the torque is

    getting applied in the opposite direction Go back to modify torque and put a -ve sign in the torque

    expression {for example -(.model_1.pid_1.pid_1)}

    Rerun the simulation

    Simulate unexpected scenarios like an object fallingon the model (say a tree branch) and check if themodel is able to take the corrective action. See the

    two attached videos