Table of Contents
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 at periodic intervals.
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 Sigmoid block generates a smooth trajectory from the initial 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 initial position to the target position.
The Sigmoid block samples its inputs at regular intervals, determined by the Input Sample Time parameter. Each time the inputs are sampled, the trajectory is re-computed. Hence, the sample time should normally be slower than the time taken to traverse the trajectory.
The output of the 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 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.
If the Hold-Off time is greater than the Input Sample Time then the Done signal may never be asserted because the trajectory will be recomputed before the hold-off period is complete. |
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
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 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.
However, the hold-off time should also be less than or equal to the input sample time. Otherwise, the trajectory will get recalculated before the hold-off time is complete so the Done may never be asserted.
Input Sample Time
The sampling rate of the target position input. This value may be set to -1 to inherit the sampling rate from the target position input signal. Use a value of zero for continuous-time and a positive scalar for a discrete sampling rate.
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. The Output Sample Time should always be faster than the Input Sample Time.
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.