Comment on page

🚴♂

# Continuous Blocks

The following blocks are defined as having a continuous time_mode

Implements a dynamic electro-chemical cell as presented in Experimental Validation of a Battery Dynamic Model for EV Applications. Note, this block only implements the Li-ion model presented, not the Lead-Acid nor the NiMH/NiCd models.

By using appropriate parameters, the cell model can be used to model a battery pack with the assumption that the cells of the pack behave as a single unit.

Parameters E0, K, A, below are abstract parameters used in the model presented in the reference paper. As described in the reference paper, these parameters can be extracted from typical cell manufacturer datasheets, see section 3. Section 3 also provides a table of example values for these parameters.

- Parameters
- E0: described as "battery constant voltage (V)" by the reference paper.
- K: described as "polarization constant (V/Ah)" by the reference paper.
- Q: battery capacity in Ah
- R: internal resistance (Ohms)
- A: described as "exponential zone amplitude (V)" by the reference paper.
- B: described as "exponential zone time constant inverse (1/Ah)" by the reference paper.
- Initial SOC: normalized value between 0 and 1 used as the starting State of Charge.

- Inputs
- the current (A) flowing through the cell. Positive is discharge.

- Outputs
- the dynamic voltage at the cell terminals (V)
- the state of charge of the cell (normalized between 0 and 1)

- Data Types
- double

- Events Zero Crossings
- none

Delays the input signal by a fixed amount of time.

- Parameters
- Delay: amount of time to delay the input signal.
- Initial Output: when time is less than Delay, the block outputs this value.

- Inputs
- The signal to be delayed

- Outputs
- The delayed signal

- Data Types
- double

In Collimator, Ordinary Differential Equations are drawn using the continuous integrator block. This block instantiates exactly one continuous state. The input to the block is the state derivative like this: input = dy/dt, output = y.

- Features
- Reset: enables resetting the integrator state to some value. the value can come from either the
`intial_state`

parameter or an input signal. - Hold: enables pausing of the integration action based on an input signal.
- Limit: enable constraining of the integrator state within some bounds provided as values. When the state reaches one of the bounds, and the derivative tends to drive the state further, integration is prevented. When the state is at a bound, but the derivative tends to drive the state back to inside the bound, integration continues normally.

- Parameters
- Initial State: use this to set the value of the state at the start of the simulation.
- Enable Reset: creates an additional input port to trigger reset of the state. Reset port is Boolean datatype and will trigger reset action continuously when input is high. When reset port is high, the state derivative is set to zero.
- Enable External Reset: creates an additional input port used as the value to reset the state to. When unchecked, the value used in the
`initial_state`

parameter. - Enable hold: creates an additional input port for the hold signal.
- Enable limits: exposes additional parameter value fields for providing the upper and lower limits.

- Inputs
- state derivative
- [optional] reset
- [optional] reset value
- [optional] hold

- Outputs
- state value

- Data Types
- double
- boolean

- Events
- when reset is enabled, an event is associated with the reset input, and an event is triggered for rising edge.
- when hold is enabled, an event is associated with the hold input, and an event is triggered for both rising and falling edges.
- when limits are enables, an event is associated with each limit relative to the state value, and an event is triggered when the state encounters the limit, and when it departs from the limit.

Implements a typical transfer function as defined in https://en.wikipedia.org/wiki/Transfer_function

- Parameters
- Numerator: This input field is used to pass an array of coefficients for the numerator polynomial. the formatting of the input must be [Cn, Cn-1, .... C1, C0], where Cn is the coefficient of the nth power of s in the polynomial.
- Denominator: This input field is used to pass an array of coefficients for the denominator polynomial. the formatting of the input must be [Cn, Cn-1, .... C1, C0], where Cn is the coefficient of the nth power of s in the polynomial.

- Inputs
- the input to the transfer function

- Outputs
- the output of the transfer function

- Data Types
- double

- Events Zero Crossings
- none

Implements three dimensional rigid body dynamics as described in https://en.wikipedia.org/wiki/Rigid_body_dynamics. Uses Euler angles to specify rotational orientations in the yaw-pitch-roll (3-2-1) convention.

The block can be configured to model only the translational degrees of freedom (3 DoF), or the combination of the translational and rotational degrees of freedom (6 DoF). For the full 6 DoF body, the state vector is

$\bf{x} = \begin{bmatrix}
\bf{v}^b \\ \bf{p}^i \\ \boldsymbol{\omega}^b \\ \boldsymbol{\Phi}
\end{bmatrix}$

where

- $\bf{v}^b$- translational velocity with respect to body-fixed axes$b$
- $\bf{p}^i$- position in the inertial reference frame$i$
- $\boldsymbol{\omega}^b$- angular velocity about the body-fixed axes
- $\boldsymbol{\Phi}$- roll, pitch, and yaw Euler angles

The mass and inertia properties of the block can independently be defined statically as parameters, or dynamically as inputs to the block.

The concept of moment of inertia used by the block is described in https://en.wikipedia.org/wiki/Moment_of_inertia

- Assumptions:
- The inertia matrix is computed at the center of mass.
- The mass and inertia matrix are quasi-steady. This means that if one or both is specified as dynamic inputs their time derivative is neglected in the dynamics. For instance, for pure translation the approximation to Newton's law is

- ParametersThe parameters are organized with the translational parameters first, then the rotational parameters
- The translational parameters are:
- Enable external mass: check this box to expose an inport where the value of mass is provided. Note, when checked, the
`Mass`

parameter is not visible. When checked, the blocks expect the mass input value to be a scalar, with units of kilograms (kg). - Mass: the constant value for the body mass in kilograms (kg) when
`Enable external mass`

is unchecked. - Vx0: Initial velocity in the X direction (m/s).
- Vy0: Initial velocity in the Y direction (m/s).
- Vz0: Initial velocity in the Z direction (m/s).
- Px0: Initial position in the X direction (m).
- Py0: Initial position in the Y direction (m).
- Pz0: Initial position in the Z direction (m).

- Enable rotational DoFs: check this box to expose the parameters of the rotational degrees of freedom and enable the computation of the rotational states.
- The rotational parameters are:
- Enable external inertia matrix: check this box to expose an inport where the value of inertia matrix is provided. Note, when checked, the
`Inertia matrix`

parameter is not visible. When checked, the block expects the inertia matrix input value to be a 3x3 matrix, with units of (kg*m*m). - Inertia matrix: the constant value for the body inertia matrix in kg*m*m when
`Enable external inertia matrix`

is unchecked. - Wx0: Initial angular velocity around the X axis (rad/s).
- Wy0: Initial angular velocity around the Y axis (rad/s).
- Wz0: Initial angular velocity around the Z axis (rad/s).
- ThetaX0: Initial roll angle angular position around the X axis (rad).
- ThetaY0: Initial angular position around the Y axis (rad).
- ThetaZ0: Initial angular position around the Z axis (rad).

- Inputs
- force_vector: This input requires a 3x1 vector of type double, with values in units of Newtons (N). The elements are [Fx, Fy, Fz] where F is the force along one of the axes. Positive values of force result in acceleration in the positive direction and vice verse for negative force values. The forces should be defined in the
*body-relative*coordinate frame. If gravity is acting on the body, the gravity vector should be pre-rotated using the CoordinateRotation block. - torque_vector: This input requires a 3x1 vector of type double with values in units of Newton*meters (Nm). The elements are [Tx, Ty, Tz] where T is the torque around one of the axes in the
*body-fixed*frame. Positive values of torque result in angular acceleration around the axis according to the right-hand-rule for normal vectors, and the opposite direction for negative torque values.

- Outputs
- translational_states: a 6x1 vector of with the following elements: [Vx, Vy, Vz, Px, Py, Pz]. Velocity states have units of (m/s), and position states have units of meters (m).
- rotational_states: a 6x1 vector with the following elements: [Wx, Wy, Wz, ThetaX, ThetaY, ThetaZ]. Angular velocity states have units of (rad/s), and angular position states have units of radians (rad).

- Data Types
- double

- Events Zero Crossings
- none

Implements a typical state space system as defined in https://en.wikipedia.org/wiki/State-space_representation

- Parametersthe four input parameters are for the coefficients of the A, B, C, and D matrices.Collimator determines the expected shape of each matrix from the following values:
- the size of the first dimension of the A matrix, number of rows, or length of the column.
- the number of input ports
- the number of output ports

Collimator requires that A matrix be perfectly square, all rows must have the same length as there are number of rows.With this, Collimator can infer the required shape of the B, C and D matrices.1x1 matrices can be entered as [x] where x is the value of coeff.1xN or Nx1 matrices can entered as [x,y,z]. Collimator will infer the correct orientation for the provided vector.MxN matrices can be entered as [[w,x],[y,z]] where [w,x] is the first row, and [y,z] is the second row. Collimator can detect incorrect matrix dimensions, however, presently, it cannot re-orient matrices provided in transpose orientation. For example, [[a,b,c],[x,y,z]] has 2 rows and 3 columns, if the required matrix dimensions were determined to be 3 rows and 2 columns, Collimator will not presently reorient this, and it must be entered as [[a,b],[c,x],[y,z]].N states, M inputs, P outputs- A: An NxN array where N is the number of states. For example [[a1,a2,a3],[a4,a5,a6],[a7,a8,a9]] for 3 states.
- B: An NxM array where N is the number of states, and M in the number of inputs. For example [[b1,b2],[b3,b4],[b5,b6]] for 3 states and 2 inputs.
- C: An NxP array where N is the number of states, and P in the number of outputs. For example [[c1],[c2],[c3]] or [c1,c2,c3] for 3 states and 1 output.
- D: An MxP array where M is the number of inputs, and P in the number of outputs. For example [[d1],[d2]] or [d1,d2] for 2 inputs and 1 output.

- Data Types
- double

- Events Zero Crossings
- none

- Parameters
- Kp: the proportional gain.
- Ki: the integral gain.
- Kd: the derivative gain.

- Data Types
- double

- Events Zero Crossings
- none

Last modified 3mo ago