Carousel Drive – step 0031 – February 2009

1 Purpose of SrrDriveA

SrrDriveA simulates a rotating drive according to a dynamic model. The input value is taken from the actualState output of a contained SrrSwitchA object. This input value enables/disables the drive and the output value is angle, a value between 0 and 2.p.

The angle is synchronized among several scene instances using two Network Sensors with streamName/networkSensorId = “Srr-<moduleName>-<objId>” and “Srr-<moduleName>-<objId>-Anim”.

The dynamic model is described by the parameters inertia, friction, characM and characW.

CharacM by characW is the characteristic Mi(w) of the inner momentum Mi by the angular velocity w.

The derivation of the angular velocity can be calculated by Newton’s equation.

M = inertia.w'

where

w'....angular acceleration

w....angular velocity

M....momentum

M = Mi-friction.w

Mi = f(w, actualState)

If actualState is false, then Mi is 0. If actualState is true, then Mi is calculated by w, characM and characW.

2 User Interface of SrrDriveA (uiObj)

SrrDriveA is an external prototype that is available at the directory srr/.

<ProtoInterface>

<field accessType='inputOutput' name='objType' type='SFString' value='SrrDriveA'/>

<field accessType='inputOutput' name='version' type='SFFloat' value='0.0031'/>

<field accessType='inputOutput' name='quasiModule' type='SFString'/>

<field accessType='inputOutput' name='objId' type='SFString'/>

<field accessType='inputOutput' name='initialState' type='SFVec3f' value='0 0 0'/>

<field accessType='inputOutput' name='inertia' type='SFFloat' value='10.0'/>

<field accessType='inputOutput' name='friction' type='SFFloat' value='1'/>

<field accessType='inputOutput' name='characM' type='MFFloat' value='1 0'/>

<field accessType='inputOutput' name='characW' type='MFFloat' value='0 1'/>

<field accessType='inputOutput' name='minimumJump' type='SFFloat' value='0.05'/>

<field accessType='inputOutput' name='accelWeakness' type='SFFloat' value='.05'/>

<field accessType='inputOutput' name='maxDuration' type='SFFloat' value='3.0'/>

<field accessType='inputOutput' name='minDuration' type='SFFloat' value='0.5'/>

<field accessType='inputOutput' name='modParam' type='SFNode'/>

<field accessType='inputOutput' name='enabled' type='SFBool' value="true"/>

<field accessType='outputOnly' name='initialized' type='SFNode'/>

<field accessType='inputOutput' name='switch' type='SFNode'/>

<field accessType='outputOnly' name='angle' type='SFFloat'/>

</ProtoInterface>

Initialization

quasiModule and objId identify the SRR object. objIdis a string unique within the module and quasiModule needs only be set if the SRR object is used within a global (vehicel) model.

initialState is a vector, where initialState[0] is the initial angle, initialState[1] is the initial angular velocity and initialState[2] is the initial angular acceleration of the drive.

inertia, friction, characM and characW describe the dynamic model of the drive.

modParam is routed from SrrModCoord (module coordinator) to the SRR-object to initialize the object, after the module has been registered.

enabled can be used to disable all active elements of the SRR object, if the model is unloaded.

switch

The SrrSwitchA node, that has been created by the user and that will be initialized with the object ID <objId>.Switch.

angle

output value of the dynamic model, synchronized among all scene instances which have activated the module which contains this SRR-object.

minimumJump

Usually, the MOC starts the so-called “target timer” a first time, when taking over the MOC role. Afterwards, each time the target timer expires, a new duration for the target timer and a new target for the carousel state are calculated. Sometimes, especially when the acceleration does a jump, it is desired to send targets immediately and to restart the target timer without waiting for the expiration. minimumJump is the minimum absolute jump the acceleration must do to trigger such behaviour.

accelWeakness, maxDuration, minDuration

Each time a new “target duration” has to be calculated, this is done on the basis of the current acceleration.

It is calculated by the formula

Target_duration = minDuration * accelWeakness / currentAcceleration;

If this calculation results in value out of the interval [minDuration, maxDuration], then one of the end values – minDuration or maxDuration – is taken as the current value of targetDuration.