Table of Contents
Triggered Sigmoid
Generates a sigmoid trajectory from the initial position and velocity to the target position. Position, velocity and acceleration profiles are generated, as well as a signal to indicate when the trajectory has reached the target. Trajectories are recomputed whenever the trigger input is fired.
Library
MATLAB Command Line
Click to copy the following command line to the clipboard. Then paste it in the MATLAB Command Window:
qc_open_library('quarc_library/Sources/Sigmoids')Description
The Triggered Sigmoid block generates a smooth trajectory from the current position (and velocity) to the target position. The velocity at the target position will be zero. It uses the specified maximum velocity and acceleration to derive the fastest possible trajectory from the current position to the target position.
The Triggered Sigmoid block samples its inputs when the trigger input fires. Each time the inputs are sampled, the trajectory is re-computed. Hence, the trigger should generally not be fired when a trajectory is in progress.
The output of the Triggered Sigmoid block is generated using the sampling rate specified by the Output Sample Time parameter. The Output Sample Time may be set to zero for a continuous-time trajectory.
The Triggered Sigmoid block provides the Done signal to indicate when the trajectory reaches its target. A Hold-Off time can also be specified to wait a certain amount of time after reaching the target before asserting the Done signal. This output may be used to trigger another event, or reset encoder counts, for example.
The block supports vector signals, in which case it will produce a separate sigmoid trajectory for each element. The Maximum Velocity, Maximum Acceleration and Hold-Off parameters may be vectors in this case.
Input Ports
Trigger
The signal that triggers the computation of a new trajectory. The signal may be rising, falling, either or a function-call trigger.
x0
The initial position for the trajectory.
v0
The initial velocity for the trajectory.
xd
The target position for the trajectory.
vmax
This port appears when the Source of parameters is set to External(input ports)
, and
provides the maximum velocity that will be allowed in the trajectory. The output trajectory will never exceed the
specified maximum velocity.
amax
This port appears when the Source of parameters is set to External(input ports)
, and
provides the maximum acceleration that will be produced in the trajectory. The output trajectory will never exceed
the specified maximum acceleration.
Output Ports
x
The position profile. It is a smooth trajectory going from the initial position to the target position.
v
The velocity profile. It is a continuous curve going from the initial velocity to zero. The velocity is computed independently of the position - it is not computed via a numerical derivative of the position.
a
The acceleration profile. Due to the nature of the sigmoid trajectory, the acceleration curve is discontinuous. Like the velocity, it is also computed independently of the position rather than by numerical differentiation.
Done
A signal indicating when the trajectory is complete. The signal is zero until the target position is reached. After reaching the target position, the Triggered Sigmoid block waits for the number of seconds specified in the Hold-Off parameter before setting the Done signal to one.
Data Type Support
This block accepts scalar or vector input of type double
. The block outputs are all of type double
.
Parameters and Dialog Box
Source of parameters
The source of maximum velocity and acceleration is controlled by this field to be Internal (dialog parameters) or External (block inputs).
Maximum Velocity
This parameter is enabled when the Source of parameters is set to
Internal(dialog parameters)
, and provides the maximum velocity that will be allowed in the trajectory.
The output trajectory will never exceed the specified maximum velocity.
Maximum Acceleration
This parameter is enabled when the Source of parameters is set to
Internal(dialog parameters)
, and provides the maximum acceleration that will be produced in the trajectory.
The output trajectory will never exceed the specified maximum acceleration.
Hold-Off
The hold-off time is the time between the trajectory reaching its target and the Done signal being asserted. The hold-off time should generally be equal to, or greater than, the Output Sample Time.
The hold-off time is needed when the Done signal is used to trigger other events. Suppose the first trajectory reaches its target and the Done signal is asserted. If for the next trajectory the current position and target position are the same, the Done signal never goes low if the hold-off time is zero because we are already at the target position. In an event-driven system, the fact that Done never goes low means that it will not have a rising edge and will not produce another trigger event.
By specifying a non-zero hold-off time, the Done signal will always go low for at least the hold-off time. Hence, it will always produce a trigger event.
Output Sample Time
The sampling rate used for the output trajectory. This value may be set to zero for continuous-time or a positive scalar for a discrete sampling rate.
Trigger Type
The type of trigger may be selected. See Simulink's Trigger block for details.
Targets
Target Name |
Compatible* |
Model Referencing |
Comments |
---|---|---|---|
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
Last fully supported in QUARC 2018. |
|
Rapid Simulation (RSIM) Target |
Yes |
Yes |
|
S-Function Target |
No |
N/A |
Old technology. Use model referencing instead. |
Normal simulation |
Yes |
Yes |
Copyright ©2024 Quanser Inc. This page was generated 2024-10-17. Submit feedback to Quanser about this page.
Link to this page.