workshop 3 variable damper element

WORKSHOP 3
VARIABLE DAMPER ELEMENT
ADM703c, Workshop 3, February 2013
Copyright 2013 MSC.Software Corporation
WS3-1
ADM703c, Workshop 3, February 2013
Copyright 2013 MSC.Software Corporation
WS3-2
• Workshop Objective
– Create a variable-damping element to control the platform acceleration due
to the washing machine disturbance
• Software Version
– Adams 2013
• Files Required
– Platform_isolator_start.cmd
• Suggested Exercise Steps
1.
2.
3.
4.
Investigate the model
Create a simple damper
Check the number of subroutine input parameters
Specify Damping as a STEP function
ADM703c, Workshop 3, February 2013
Copyright 2013 MSC.Software Corporation
WS3-3
Step 1. Investigate the Model
a. Open the model file platform_isolator_start.cmd in Adams/View.
b. Run the simulation script run_it to get an idea of what the model is
doing.
c. Verify that the ‘washing machine’ spins up and provides a disturbance
that stimulates the platform.
d. With any cyclical disturbance input it is wise to investigate the linear
modes of the system. Perform a linear modes analysis with
Adams/Linear by doing the following:
• Simulation tab → Interactive Simulation
• Perform a static analysis
• Perform a linear modes analysis (‘Compute linear modes’) and
then review the linear modes results by animating the different
modes.
e. One of the modes appears to represent the case where the platform
is translating vertically. What is the frequency reported for this
particular mode? ___________________________
f. Compare this frequency to the prescribed function for MOTION
load_driver_left and the Design Variable final_angular_velocity
ADM703c, Workshop 3, February 2013
Copyright 2013 MSC.Software Corporation
WS3-4
d
Step 1. Investigate the Model (Cont.)
g. Does the MEASURE base_acceleration seem reasonable considering the natural
frequency and the input disturbance? Hint: Do an FFT of the acceleration signal.
– (yes/no)
h. Modify the damping constant variable, damping_constant, to have a standard value of 1.
i. Find the SFORCE element in the model named damping_actuator and note how the design
variable is being used in the force runtime expression.
j. Re-run the simulation and compare the acceleration measure of the platform when
damping is active.
k. Does the damper affect the platform acceleration as expected? (yes/no)
ADM703c, Workshop 3, February 2013
Copyright 2013 MSC.Software Corporation
WS3-5
Step 2. Create a Simple Damper
You will now create a simple damper element with a user-written SFOSUB subroutine that
over-rides an SFORCE element.
a. To begin, copy the sample SFOSUB implementation found in the /solver/usersubs/
directory of your Adams installation
b. Create a ‘skeleton’ SFOSUB implementation by deleting everything below the line:
C ------------- Local variable definitions -------------------
And above the lines:
C Assign and returned value
C
VALUE = IMPARY( 1 )
c. To implement a simple damper element, use the following input convention for values that
will be provided to the SFOSUB via USER(…) parameters:
• The ID of a marker on the platform, and a marker on ground (I- and J-markers defining
the damper)
• The damping coefficient
d. It is a good idea to create a comment at the top of your subroutine containing a small table
of expected input values for the subroutine
ADM703c, Workshop 3, February 2013
Copyright 2013 MSC.Software Corporation
WS3-6
Step 2. Create a Simple Damper (Cont.)
e. Remember that the input values from the USER(…) statement will appear as entries in the
PAR() array that is available to your subroutine
f. See one of the source files in the /completed directory for an example table of
documentation for the input values
g. Now that the input parameters convention has been specified, create local variables that
will help in the computations that are to be made. Variables like the following might be
helpful in your subroutine:
• VEL: a DOUBLE PRECISION variable to store the damper velocity
• DAMPING: a DOUBLE PRECISION variable storing the desired damping coefficient
value, as passed in via the PAR() array
• IMAR_ID and JMAR_ID: INTEGER variables storing the Adams/Solver ID of the
markers, as passed in via the PAR() array
• NOTE: Remember that the values passed in the PAR () array have been defined as
type DOUBLE PRECISION. It is a good idea to include an explicit type conversion via
the NINT() Fortran function when translating from one type of variable to another. This
also makes your code more readable for the future
– SOME_INT = NINT(PAR(1))
•
ERRFLG: a LOGICAL variable, needed when calling Utility subroutines
ADM703c, Workshop 3, February 2013
Copyright 2013 MSC.Software Corporation
WS3-7
Step 2. Create a Simple Damper (Cont.)
h. Using the variables listed on the previous page, in step f, put together logic to create a
simple damper force in your subroutine. In general the subroutine should:
• Gather IMAR_ID, JMAR_ID and DAMPING from the user parameter input, store as local
variables
• Create an array of marker IDs for determining damper velocity, use SYSFNC() to query
velocity. Hint: The VR function is useful for measuring the velocity between two markers.
• Calculate a damping force, return the value from the SFOSUB.
i. Look at the completed source file sfosub1.f if you need a hint.
j. Once your source code is complete, do the following to implement the SFOSUB in your
model:
• Complete the compile and link process as in previous workshops
• Alter the damping_actuator SFORCE in Adams/View to use the new subroutine
• Don’t forget to enter the subroutine inputs (marker IDs, damping coefficient) in the USER
specification for the SFORCE
• Specify the custom library in Adams/View and simulate the model
ADM703c, Workshop 3, February 2013
Copyright 2013 MSC.Software Corporation
WS3-8
Step 2. Create a Simple Damper (Cont.)
k. The figure below compares platform acceleration for the original (no damping) and modified
(user subroutine with damping coefficient of 1) cases:
Figure: System response with and without damping
ADM703c, Workshop 3, February 2013
Copyright 2013 MSC.Software Corporation
WS3-9
Step 3. Check the Number of Subroutine Input
Parameters
Next the subroutine will be enhanced to check for the proper number of input parameters.
a. With the current implementation of the damper, what would happen if no user parameters
were passed into the subroutine via the USER specification?
________________________________________________________
b. Implement logic near the beginning of the subroutine to check the number of parameters
passed in
c. If the number of inputs is not correct, issue a message and stop the simulation
d. Use the ERRMES() Utility subroutine to issue a message and stop when problems occur
e. See the ERRMES() documentation in Adams/Solver guide to determine the appropriate
calling sequence and variables needed
f. See the sfosub2.f file in the /completed directory if you need a hint implementing this
g. After implementing this, re-compile and re-create the user library file using a new library
name (“mysolver2.dll”).
h. Using this new library file, if more or less than 3 input parameters are used and a simulation
is initiated, you should see an error message like so:
ERROR:
ID = 1
Improper inputs: Enter 3 parameters.
ADM703c, Workshop 3, February 2013
Copyright 2013 MSC.Software Corporation
WS3-10
Step 4. Specify Damping as a STEP Function
Now enhance the subroutine to accept a step input for the damping with respect to time.
a. Use the STEP() Utility function to implement this and allow the user to pass in the step
parameters as USER parameters.
b. To implement this it is recommended that new variables be created in the code like so:
• CINIT, CFINAL initial and final damping coefficients
• TIME_INIT, TIME_FINAL initial and final time parameters for STEP
c. The call to the Utility Subroutine should look like the following with the appropriate variable
substitution
• CALL STEP(x, x0,h0,x1,h1,iord,value,errflg)
d. If help is required, reference sfosub3.f in the /completed directory
e. After implementing this code, re-create the Solver library with a new name (“mysolver3.dll”),
re-specify the Solver library within Adams/View and remember to specify the needed inputs
in the USER field corresponding to the step values
ADM703c, Workshop 3, February 2013
Copyright 2013 MSC.Software Corporation
WS3-11
Step 4. Specify Damping as a STEP Function
An example of stepping from zero damping up to a value of 1 in a time interval of 1 second,
beginning at 10 seconds of simulation time, is shown in the figure below:
Figure: Damping effect on system response
a. Look at the documentation for the AKISPL Utility function. How many return values does
the AKISPL function return?_____________
b. How would you declare an array in FORTRAN to hold the returned values from AKISPL?
______________________________________________________________________
ADM703c, Workshop 3, February 2013
Copyright 2013 MSC.Software Corporation
WS3-12