Motion platform
Environment and Target
phasedenvlib
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.
Object motion model, specified as Velocity
,
Acceleration
, or
Custom
. When you set this parameter to
Velocity
, the platform follows a constant
velocity trajectory during each simulation step. When you set this parameter
to Acceleration
, the platform follows a constant
acceleration trajectory during each simulation step. When you set the
parameter to Custom
, 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.
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.
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 to Input port
.
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 a Property
or
an Input 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
|
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
to Velocity
and set the Source of velocity parameter
to Property
.
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 a Property
or
an Input 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
|
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 to
Acceleration
and set the Source of
acceleration parameter to Property
.
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. The 2nd through 4th columns are position measurements in x, y, and z coordinates. The velocity is derived from the position measurements.
When L is 7, the 5th through seventh columns 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 scan mode for platform, specified as
None
, Circular
, or
Sector
, where None
is the default. When you set the Mechanical scanning
mode parameter to Circular
, the
platform scan clockwise 360 degrees continuously in the azimuthal direction
of the platform orientation axes. When you set the Mechanical
scanning mode parameter to Sector
,
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 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 to
Circular
or
Sector
.
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 to Sector
.
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
or
Sector
.
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.
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.
Specify the source for elapsed simulation time as Auto
or Derive from reference input port
. When you choose
Auto
, the block computes the elapsed time. When you
choose Derive from reference input port
, the block uses
the time duration of a reference signal passed into the
Ref
input port.
Select this check box to inherit the sample rate from upstream blocks. Otherwise, specify the sample rate using the Sample rate (Hz) parameter.
Specify the signal sampling rate (in hertz) as a positive scalar. This parameter appears only when the Inherit sample rate parameter is not selected.
Block simulation method, specified as Interpreted Execution
or Code
Generation
. If you want your block to use the MATLAB® interpreter,
choose Interpreted Execution
. If you want your
block to run as compiled code, choose Code 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).
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 |