Motion Platform
Motion platform
Library
Environment and Target
phasedenvlib
Description
The Motion Platform block models the motion of multiple platforms such as airplanes, ground vehicles, and/or receiving and transmitting sensors arrays, determining their positions and velocities. The platforms move along trajectories determined by initial positions and velocities, according to which motion model you choose — the velocity or acceleration model. The platform positions and velocities are updated at each simulation step. In addition, you can specify initial orientations for the platforms and obtain orientation updates.
Parameters
- Model of object motion
Object motion model, specified as
Velocity
,Acceleration
, orCustom
. When you set this parameter toVelocity
, the platform follows a constant velocity trajectory during each simulation step. When you set this parameter toAcceleration
, the platform follows a constant acceleration trajectory during each simulation step. When you set the parameter toCustom
, the platform motion follows a sequence of waypoints specified by the Custom trajectory waypoints parameter. The object performs a piecewise cubic interpolation on the waypoints to derive the position and velocity at each time step.- Initial position (m)
Specify the initial position of the platform in meters as a 3-by-N matrix where each column represents the initial position of a platform in the form
[x;y;z]
. The quantity N is the number of platforms.- Initial velocity (m/s)
Specify the initial velocity of the platform in m/s as a 3-by-N matrix where each column represents the initial velocity of a platform in the form
[vx;vy;vz]
. The quantity N is the number of platforms. This parameter appears only when you set the Source of velocity or the Source of acceleration parameters toInput port
.- Source of velocity
This parameter appears only when you set the Model of object motion parameter to
Velocity
. Then, you must supply velocity data for the model. Specify the Source of velocity data as either coming from aProperty
or anInput port
.Source of velocity Use these model parameters or ports Property
Initial position (m) parameter
Velocity (m/s) parameter
Input port
Initial position (m) parameter
Initial velocity (m/s) parameter
Vel
input port- Velocity (m/s)
Specify the current velocity of the platforms in m/s as a 3-by-N matrix where each column represents the current velocity of a platform in the form
[vx;vy;vz]
. This parameter appears only when you set the Model of object motion parameter toVelocity
and set the Source of velocity parameter toProperty
.- Source of acceleration
This parameter appears only when you set the Model of object motion parameter to
Acceleration
. Then, you must supply acceleration values for the model. Specify the Source of acceleration data as either coming from aProperty
or anInput port
.Source of acceleration Use these model parameters or ports Property
Initial Position (m) parameter
Initial Velocity (m/s) parameter
Acceleration (m/s^2) parameter
Input port
Initial Position (m) parameter
Initial Velocity (m/s) parameter
Acl
input port- Acceleration (m/s^2)
Specify the current acceleration of the platforms in m/s^2 as a 3-by-N matrix where each column represents the current acceleration of a platform in the form
[ax;ay;az]
. This parameter appears when you set the Model of object motion parameter toAcceleration
and set the Source of acceleration parameter toProperty
.- Custom trajectory waypoints
Custom trajectory waypoints, specified as a real-valued M-by-L matrix, or M-by-L-by-N array. M is the number of waypoints. L is either 4 or 7.
When L is 4, the first column indicates the times at which the platform position is measured. Columns 2 - 4 are position measurements in x, y, and z coordinates. The velocity is derived from the position measurements.
When L is 7, columns 5 - 7 in the matrix are velocity measurements in x, y, and z coordinates.
When you set the Custom trajectory waypoints parameter to a three-dimensional array, the number of pages, N, represent the number of platforms. Time units are in seconds, position units are in meters, and velocity units are in meters per second.
To enable this property, set the Model of object motion property to
Custom
.- Mechanical scanning mode
Mechanical scan mode for platform, specified as
None
,Circular
, orSector
, whereNone
is the default. When you set the Mechanical scanning mode parameter toCircular
, the platform scan clockwise 360 degrees continuously in the azimuthal direction of the platform orientation axes. When you set the Mechanical scanning mode parameter toSector
, the platform scans clockwise in the azimuthal direction in the platform orientation axes within a range specified by the Azimuth scan angle span (deg) parameter. When the platform scan reaches the span limits, the scan reverses direction and scans back to the other scan limit. Scanning happens within the orientation axes of the platform.- Initial scan angle (deg)
Initial scan angle of platform, specified as a 1-by-N vector where N is the number of platforms. The scanning occurs in the local coordinate system of the platform. The Initial orientation axes parameter specifies the original local coordinate system. At the start of the simulation, the orientation axes specified by the Initial orientation axes are rotated by the angle specified in the
InitialScanAngle
Initial scan angle (deg) parameter. The default value is zero. Units are in degrees. This parameter applies when you set the Mechanical scanning mode parameter toCircular
orSector
.- Azimuth scan angle span (deg)
The azimuth angle span, specified as an N-by-2 matrix where N is the number of platforms. Each row of the matrix specifies the scan range of the corresponding platform in the form
[ScanAngleLowerBound ScanAngleHigherBound]
. The default value is[-60 60]
. Units are in degrees. To enable this parameter, set the Mechanical scanning mode parameter toSector
.- Azimuth scan rate (deg/s)
Azimuth scan rate, specified as a 1-by-N vector where N is the number of platforms. Each entry in the vector is the azimuth scan rate for the corresponding platform. The default value is 10 degrees/second. Units are in degrees/second. To enable this parameter, set the Mechanical scanning mode parameter to
Circular
orSector
.- Initial orientation axes
Specify the three axes that define the initial local (x,y,z) coordinate system at the platform as a 3-by-3-by-N matrix. Each column of the matrix represents an axis of the local coordinate system. The three axes must be orthonormal.
- Enable orientation axes output
Select this check box to obtain the instantaneous orientation axes of the platform via the output port
LAxes
. The port appears only when the check box is selected.- Source of elapsed simulation time
Specify the source for elapsed simulation time as
Auto
orDerive from reference input port
. When you chooseAuto
, the block computes the elapsed time. When you chooseDerive from reference input port
, the block uses the time duration of a reference signal passed into theRef
input port.- Inherit sample rate
Select this check box to inherit the sample rate from upstream blocks. Otherwise, specify the sample rate using the Sample rate (Hz) parameter.
- Sample rate (Hz)
Specify the signal sampling rate (in hertz) as a positive scalar. This parameter appears only when the Inherit sample rate parameter is not selected.
- Simulate using
Block simulation method, specified as
Interpreted Execution
orCode Generation
. If you want your block to use the MATLAB® interpreter, chooseInterpreted Execution
. If you want your block to run as compiled code, chooseCode Generation
. Compiled code requires time to compile but usually runs faster.Interpreted execution is useful when you are developing and tuning a model. The block runs the underlying System object™ in MATLAB. You can change and execute your model quickly. When you are satisfied with your results, you can then run the block using
Code Generation
. Long simulations run faster than they would in interpreted execution. You can run repeated executions without recompiling. However, if you change any block parameters, then the block automatically recompiles before execution.When setting this parameter, you must take into account the overall model simulation mode. The table shows how the Simulate using parameter interacts with the overall simulation mode.
When the Simulink® model is in
Accelerator
mode, the block mode specified using Simulate using overrides the simulation mode.Acceleration Modes
Block Simulation Simulation Behavior Normal
Accelerator
Rapid Accelerator
Interpreted Execution
The block executes using the MATLAB interpreter. The block executes using the MATLAB interpreter. Creates a standalone executable from the model. Code Generation
The block is compiled. All blocks in the model are compiled. For more information, see Choosing a Simulation Mode (Simulink).
Ports
Note
The block input and output ports correspond to the input and
output parameters described in the step
method of
the underlying System object. See link at the bottom of this page.
Port | Description | Supported Data Types |
---|---|---|
Vel | Platform velocity input | Double-precision floating point |
Acl | Platform acceleration input | Double-precision floating point |
Ref | Reference signal input | Double-precision floating point |
Pos | Platform position output | Double-precision floating point |
Vel | Platform velocity output | Double-precision floating point |
LAxes | Platform orientation output | Double-precision floating point |