FEDEM Solver  R8.0
Source code of the dynamics solver
Data Types | Functions/Subroutines
controlstructmodule Module Reference

Module with data types and subroutines for coupled modal analysis. More...

Data Types

type  structsensorgradtype
 Data type representing a control input gradient. More...
 
type  forcecontrolgradtype
 Data type representing a control output gradient. More...
 
type  controlstructtype
 Data type representing the control-system/structure coupling. More...
 
interface  writeobject
 Standard routine for writing an object to file. More...
 

Functions/Subroutines

subroutine writecontrolstructtype (pCS, io, complexity)
 Standard routine for writing an object to io. More...
 
subroutine initiatecontrolstruct (pCS, inputs, triads, joints, forces, numVreg, numNod, ierr)
 Initializes the control struct data type. More...
 
subroutine getctrlparamswithstructsensors (ctrlParams, numStructCtrlParams, ctrlParamsWithStructSensors)
 Finds all control input parameters coupled to structural DOFs. More...
 
subroutine getctrloutforces (forces, numCtrlOutForces, ctrlOutForces)
 Finds all control out forces. More...
 
subroutine buildstructcontroljacobi (pCS, ctrl, sys, msim, ierr)
 Computes the gradient matrices of forces w.r.t. controller inputs. More...
 
subroutine estimatecontrollerproperties01 (sys, ctrl, msim, whichVregIn, whichVregOut, ctrlProps, ierr)
 Estimates the controller gradient properties by perturbation. More...
 
subroutine estimatecontrollerproperties02 (sys, ctrl, msim, whichVregIn, whichVregOut, ctrlProps, ierr)
 
subroutine estimatecontrollerproperties03 (sys, ctrl, msim, whichVregIn, whichVregOut, ctrlProps, ierr)
 
subroutine estimatecontrollerproperties04 (sys, ctrl, msim, whichVregIn, whichVregOut, nStep, ctrlProps, ierr)
 
subroutine estimatecontrollerproperties500 (sys, ctrl, msim, whichVregIn, whichVregOut, ctrlProps, ierr)
 Perturbation method without initial perturbation. More...
 
subroutine perturbcontroller (sys, ctrl, msim, iPert, dt, dy, numVregOut, whichVregOut, uy, ierr)
 Perturbs one of the inputs of the control system. More...
 
subroutine deallocatectrlcopy (ctrl)
 Deallocates a control system copy. More...
 

Detailed Description

Module with data types and subroutines for coupled modal analysis.

This module contains some data types and associated subroutines for conducting coupled modal analysis of mechanim models with control systems.

Function/Subroutine Documentation

◆ buildstructcontroljacobi()

subroutine controlstructmodule::buildstructcontroljacobi ( type(controlstructtype), intent(inout)  pCS,
type(controltype), intent(in)  ctrl,
type(systemtype), intent(inout)  sys,
integer, dimension(:), intent(in)  msim,
integer, intent(out)  ierr 
)

Computes the gradient matrices of forces w.r.t. controller inputs.

◆ deallocatectrlcopy()

subroutine controlstructmodule::deallocatectrlcopy ( type(controltype), pointer  ctrl)

Deallocates a control system copy.

Parameters
ctrlPointer to controltypemodule::controltype object to deallocate.
Author
Knut Morten Okstad
Date
19 Jan 2024
Here is the caller graph for this function:

◆ estimatecontrollerproperties01()

subroutine controlstructmodule::estimatecontrollerproperties01 ( type(systemtype), intent(inout)  sys,
type(controltype), intent(in)  ctrl,
integer, dimension(:), intent(in)  msim,
integer, dimension(:), intent(in)  whichVregIn,
integer, dimension(:), intent(in)  whichVregOut,
real(dp), dimension(:,:,:), intent(out)  ctrlProps,
integer, intent(out)  ierr 
)

Estimates the controller gradient properties by perturbation.

Parameters
sysSystem level model data
ctrlControl system data
[in]msimMatrix of simulation parameters
[in]whichVregInWhich vreg inputs to perturb
[in]whichVregoutWhich vreg outputs to read variation from
[out]ctrlProps3D table for storing controller properties (no. of outputs, no. of controller properties, no. of inputs)
  • ctrlProps(:,1,:) = Q
  • ctrlProps(:,2,:) = K
  • ctrlProps(:,3,:) = C
  • ctrlProps(:,4,:) = M
[out]ierrError flag

We use a perturbation method, simular to the Matrix Stiffness Method / (Virtual) Displacement Method / Unit Load Method to find the equivalent mechanical properties of the controller. These controller properties will be added to existing matrices when conducting modal/eigenvalue analysis.

In this routine, the controller is limited to be of type PID. The equation for the system is:

M*x'' + C*x' + K*x + Q*int(x)dt = F

or

M*(d2x/dt2) + C*(dx/dt) + K*x + Q*int(x)dt = F

where M is the mass, C is the damping, K is the stiffness, and Q is the steady state error elimination.

Controller input = y, controller output = u.

The values of interest are:

  • du/dy: The change du in output from controller with respect to the change dy in input to controller. du/dy = proportional gain, Kp.
  • du/(int(dy)dt): The change du in output from controller with respect to the change int(dy)dt in input to controller. du/(int(dy)dt) = integral gain, Ki.
  • du/(dy/dt): The change du in output from controller with respect to the change dy/dt in input to controller. du/(dy/dt) = derivative gain, Kd.

Working order:

  1. Do an initial perturbation on the controller with dy = 0 and dt ≠ 0. This is to insure dy/dt = 0.
  2. Get the initial values y0 and u0 for the controller.
  3. Establish dy(j) and dt(j). j = number of perturbations. For a PID-controller: j = 1...3.
  4. Calculate d(int(dy(j))dt) and d(dy/dt).
  5. Calculate y(j) and t(j).
  6. Iterate the controller with these new values for the input y(j) and time t(j) and save the reaction from the controller u(j) due to the change in the input.
  7. Calculate du(j) based on u0 and u(j).
  8. Calculate Kp, Ki and Kd.
  9. Based on sensor type (position, velocity or acceleration), calculate Q, K, C and M.
Author
Magne Bratland
Date
25 Nov 2010
Here is the call graph for this function:
Here is the caller graph for this function:

◆ estimatecontrollerproperties02()

subroutine controlstructmodule::estimatecontrollerproperties02 ( type(systemtype), intent(inout)  sys,
type(controltype), intent(in)  ctrl,
integer, dimension(:), intent(in)  msim,
integer, dimension(:), intent(in)  whichVregIn,
integer, dimension(:), intent(in)  whichVregOut,
real(dp), dimension(:,:,:), intent(out)  ctrlProps,
integer, intent(inout)  ierr 
)

◆ estimatecontrollerproperties03()

subroutine controlstructmodule::estimatecontrollerproperties03 ( type(systemtype), intent(inout)  sys,
type(controltype), intent(in)  ctrl,
integer, dimension(:), intent(in)  msim,
integer, dimension(:), intent(in)  whichVregIn,
integer, dimension(:), intent(in)  whichVregOut,
real(dp), dimension(:,:,:), intent(out)  ctrlProps,
integer, intent(inout)  ierr 
)

◆ estimatecontrollerproperties04()

subroutine controlstructmodule::estimatecontrollerproperties04 ( type(systemtype), intent(inout)  sys,
type(controltype), intent(in)  ctrl,
integer, dimension(:), intent(in)  msim,
integer, dimension(:), intent(in)  whichVregIn,
integer, dimension(:), intent(in)  whichVregOut,
integer, intent(in)  nStep,
real(dp), dimension(:,:,:), intent(out)  ctrlProps,
integer, intent(inout)  ierr 
)

◆ estimatecontrollerproperties500()

subroutine controlstructmodule::estimatecontrollerproperties500 ( type(systemtype), intent(inout)  sys,
type(controltype), intent(in)  ctrl,
integer, dimension(:), intent(in)  msim,
integer, dimension(:), intent(in)  whichVregIn,
integer, dimension(:), intent(in)  whichVregOut,
real(dp), dimension(:,:,:), intent(out)  ctrlProps,
integer, intent(inout)  ierr 
)

Perturbation method without initial perturbation.

Perturbation w.r.t. a single integral. nPerturb = 1 in this subroutine, therefore no loop necessary.

Author
Magne Bratland
Date
7 July 2010

◆ getctrloutforces()

subroutine controlstructmodule::getctrloutforces ( type(forcetype), dimension(:), intent(in), target  forces,
integer, intent(out)  numCtrlOutForces,
integer, dimension(:), intent(out), pointer  ctrlOutForces 
)

Finds all control out forces.

◆ getctrlparamswithstructsensors()

subroutine controlstructmodule::getctrlparamswithstructsensors ( type(ctrlprm), dimension(:), intent(in), target  ctrlParams,
integer, intent(out)  numStructCtrlParams,
integer, dimension(:), intent(out), pointer  ctrlParamsWithStructSensors 
)

Finds all control input parameters coupled to structural DOFs.

◆ initiatecontrolstruct()

subroutine controlstructmodule::initiatecontrolstruct ( type(controlstructtype), intent(out)  pCS,
type(ctrlprm), dimension(:), intent(in), target  inputs,
type(triadtype), dimension(:), intent(in), target  triads,
type(masterslavejointtype), dimension(:), intent(in), target  joints,
type(forcetype), dimension(:), intent(in), target  forces,
integer, intent(in)  numVreg,
integer, intent(in)  numNod,
integer, intent(out)  ierr 
)

Initializes the control struct data type.

◆ perturbcontroller()

subroutine controlstructmodule::perturbcontroller ( type(systemtype), intent(inout)  sys,
type(controltype), intent(inout)  ctrl,
integer, dimension(:), intent(in)  msim,
integer, intent(in)  iPert,
real(dp), intent(in)  dt,
real(dp), intent(in)  dy,
integer, intent(in)  numVregOut,
integer, dimension(:), intent(in)  whichVregOut,
real(dp), dimension(:), intent(out)  uy,
integer, intent(out)  ierr 
)

Perturbs one of the inputs of the control system.

Parameters
sysSystem level model data
ctrlControl system data
[in]msimMatrix of simulation parameters
[in]iPertWhich input to perturb
[in]dtIncremental time step
[in]dyIncremental step for use in du/dy
[in]numVregOutNumber of outputs from the controller to read
[in]whichVregOutWhich outputs from the controller to read
[out]uyPerturbed output from controller, u(y) = u(y0+dy)
[out]ierrError flag

This subroutine perturbs one of the control inputs and calculates the reaction in all of the control outputs.

Working order: 1) Change the input y for the controller from y0 to y = y0+dy, where dy is a small number. Change the time from t0 to t = t0+dt, where dt is a small number. 2) Run this new input through the controller to get the reaction (output) u(y) from the controller due to the change in the input.

Author
Magne Bratland
Date
18 Sept 2009
Here is the call graph for this function:
Here is the caller graph for this function:

◆ writecontrolstructtype()

subroutine controlstructmodule::writecontrolstructtype ( type(controlstructtype), intent(in)  pCS,
integer, intent(in)  io,
integer, intent(in)  complexity 
)

Standard routine for writing an object to io.

Parameters
[in]pCSData for coupled control system and structure modal analysis
[in]ioFile unit number to write to
[in]complexityIndicates the amount of print
Author
Knut Morten Okstad
Date
19 Feb 2024