KinematicPTPBoundedJerk
A component emitting a time-optimal point-to-point trajectory with bounded velocity, acceleration, and jerk, generated using JerkLimiter from TrajectoryLimiters.jl.
By default the motion goes from q0 to q1. To traverse a mission of several waypoints, pass a waypoints matrix of size nout × nwp whose columns are the successive waypoints (the first column is the start, the last the target); this overrides q0/q1. The motion comes to a full stop at every intermediate waypoint, and each segment between consecutive waypoints is an independent time-optimal jerk-limited motion, concatenated on the time axis.
When multiple axes are specified, the per-segment trajectories are by default time-synchronized so all axes reach the next waypoint at the same time. Time synchronization does not keep the axis velocities proportional to each other, so the path traced in output space is in general not a straight line. With phase_synchronization = true, the axes are phase-synchronized: the path is an exact straight line between consecutive waypoints, at the same time-optimal duration as time synchronization. This requires per-axis limits that admit the straight-line profile (always satisfied when all axes share the same limits); otherwise an error is thrown.
The outputs are:
q: Positionqd: Velocityqdd: Accelerationqddd: Jerk
Usage
MultibodyComponents.KinematicPTPBoundedJerk(q0=fill(0.0, nout), q1=fill(1.0, nout), waypoints=hcat(q0, q1), qd_max=fill(1.0, nout), qdd_max=fill(1.0, nout), qddd_max=fill(10.0, nout))
Parameters:
| Name | Description | Units | Default value |
|---|---|---|---|
nout | Number of output axes | – | 1 |
nwp | Number of waypoints (columns of the waypoints matrix) | – | 2 |
phase_synchronization | Phase-synchronize the axes so the path in output space is a straight line | – | false |
q0 | Initial position for each axis | – | fill(0.0, nout) |
q1 | Final position for each axis | – | fill(1.0, nout) |
waypoints | Waypoints to traverse; each column is a waypoint (first = start, last = target). Defaults to the q0 -> q1 motion; set it together with nwp to run a multi-waypoint mission | – | hcat(q0, q1) |
qd_max | Maximum velocity for each axis | – | fill(1.0, nout) |
qdd_max | Maximum acceleration for each axis | – | fill(1.0, nout) |
qddd_max | Maximum jerk for each axis | – | fill(10.0, nout) |
Connectors
q- This connector represents a real signal as an output from a component (RealOutput)qd- This connector represents a real signal as an output from a component (RealOutput)qdd- This connector represents a real signal as an output from a component (RealOutput)qddd- This connector represents a real signal as an output from a component (RealOutput)
Behavior
using MultibodyComponents #hide
using ModelingToolkit #hide
@variables q0 #hide
@variables q1 #hide
@variables waypoints #hide
@variables qd_max #hide
@variables qdd_max #hide
@variables qddd_max #hide
@named sys = MultibodyComponents.KinematicPTPBoundedJerk(q0=q0, q1=q1, waypoints=waypoints, qd_max=qd_max, qdd_max=qdd_max, qddd_max=qddd_max) #hide
let eqs = full_equations(sys); Base.length(eqs) > 25 ? nothing : eqs end #hideSource
"""
A component emitting a time-optimal point-to-point trajectory with bounded velocity,
acceleration, and jerk, generated using `JerkLimiter` from TrajectoryLimiters.jl.
By default the motion goes from `q0` to `q1`. To traverse a mission of several waypoints,
pass a `waypoints` matrix of size `nout × nwp` whose columns are the successive waypoints
(the first column is the start, the last the target); this overrides `q0`/`q1`. The
motion comes to a full stop at every intermediate waypoint, and each segment between
consecutive waypoints is an independent time-optimal jerk-limited motion, concatenated on
the time axis.
When multiple axes are specified, the per-segment trajectories are by default
time-synchronized so all axes reach the next waypoint at the same time. Time
synchronization does not keep the axis velocities proportional to each other, so the path
traced in output space is in general not a straight line. With
`phase_synchronization = true`, the axes are phase-synchronized: the path is an exact
straight line between consecutive waypoints, at the same time-optimal duration as time
synchronization. This requires per-axis limits that admit the straight-line profile
(always satisfied when all axes share the same limits); otherwise an error is thrown.
The outputs are:
- `q`: Position
- `qd`: Velocity
- `qdd`: Acceleration
- `qddd`: Jerk
"""
external component KinematicPTPBoundedJerk
"Position output for each axis"
q = [RealOutput() for i in 1:nout] {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 960, "y1": 100, "x2": 1060, "y2": 200, "rot": 0}
},
"tags": []
}
}
"Velocity output for each axis"
qd = [RealOutput() for i in 1:nout] {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 960, "y1": 330, "x2": 1060, "y2": 430, "rot": 0}
},
"tags": []
}
}
"Acceleration output for each axis"
qdd = [RealOutput() for i in 1:nout] {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 960, "y1": 590, "x2": 1060, "y2": 690, "rot": 0}
},
"tags": []
}
}
"Jerk output for each axis"
qddd = [RealOutput() for i in 1:nout] {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 960, "y1": 790, "x2": 1060, "y2": 890, "rot": 0}
},
"tags": []
}
}
"Number of output axes"
structural parameter nout::Integer = 1
"Number of waypoints (columns of the waypoints matrix)"
structural parameter nwp::Integer = 2
"Phase-synchronize the axes so the path in output space is a straight line"
structural parameter phase_synchronization::Boolean = false
"Initial position for each axis"
parameter q0::Real[nout] = fill(0.0, nout)
"Final position for each axis"
parameter q1::Real[nout] = fill(1.0, nout)
"Waypoints to traverse; each column is a waypoint (first = start, last = target). Defaults to the q0 -> q1 motion; set it together with nwp to run a multi-waypoint mission"
parameter waypoints::Real[nout, nwp] = hcat(q0, q1)
"Maximum velocity for each axis"
parameter qd_max::Real[nout] = fill(1.0, nout)
"Maximum acceleration for each axis"
parameter qdd_max::Real[nout] = fill(1.0, nout)
"Maximum jerk for each axis"
parameter qddd_max::Real[nout] = fill(10.0, nout)
relations
metadata {
"Dyad": {"icons": {"default": "dyad://MultibodyComponents/KinematicPTPBoundedJerk.svg"}}
}
endFlattened Source
"""
A component emitting a time-optimal point-to-point trajectory with bounded velocity,
acceleration, and jerk, generated using `JerkLimiter` from TrajectoryLimiters.jl.
By default the motion goes from `q0` to `q1`. To traverse a mission of several waypoints,
pass a `waypoints` matrix of size `nout × nwp` whose columns are the successive waypoints
(the first column is the start, the last the target); this overrides `q0`/`q1`. The
motion comes to a full stop at every intermediate waypoint, and each segment between
consecutive waypoints is an independent time-optimal jerk-limited motion, concatenated on
the time axis.
When multiple axes are specified, the per-segment trajectories are by default
time-synchronized so all axes reach the next waypoint at the same time. Time
synchronization does not keep the axis velocities proportional to each other, so the path
traced in output space is in general not a straight line. With
`phase_synchronization = true`, the axes are phase-synchronized: the path is an exact
straight line between consecutive waypoints, at the same time-optimal duration as time
synchronization. This requires per-axis limits that admit the straight-line profile
(always satisfied when all axes share the same limits); otherwise an error is thrown.
The outputs are:
- `q`: Position
- `qd`: Velocity
- `qdd`: Acceleration
- `qddd`: Jerk
"""
external component KinematicPTPBoundedJerk
"Position output for each axis"
q = [RealOutput() for i in 1:nout] {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 960, "y1": 100, "x2": 1060, "y2": 200, "rot": 0}
},
"tags": []
}
}
"Velocity output for each axis"
qd = [RealOutput() for i in 1:nout] {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 960, "y1": 330, "x2": 1060, "y2": 430, "rot": 0}
},
"tags": []
}
}
"Acceleration output for each axis"
qdd = [RealOutput() for i in 1:nout] {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 960, "y1": 590, "x2": 1060, "y2": 690, "rot": 0}
},
"tags": []
}
}
"Jerk output for each axis"
qddd = [RealOutput() for i in 1:nout] {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 960, "y1": 790, "x2": 1060, "y2": 890, "rot": 0}
},
"tags": []
}
}
"Number of output axes"
structural parameter nout::Integer = 1
"Number of waypoints (columns of the waypoints matrix)"
structural parameter nwp::Integer = 2
"Phase-synchronize the axes so the path in output space is a straight line"
structural parameter phase_synchronization::Boolean = false
"Initial position for each axis"
parameter q0::Real[nout] = fill(0.0, nout)
"Final position for each axis"
parameter q1::Real[nout] = fill(1.0, nout)
"Waypoints to traverse; each column is a waypoint (first = start, last = target). Defaults to the q0 -> q1 motion; set it together with nwp to run a multi-waypoint mission"
parameter waypoints::Real[nout, nwp] = hcat(q0, q1)
"Maximum velocity for each axis"
parameter qd_max::Real[nout] = fill(1.0, nout)
"Maximum acceleration for each axis"
parameter qdd_max::Real[nout] = fill(1.0, nout)
"Maximum jerk for each axis"
parameter qddd_max::Real[nout] = fill(10.0, nout)
relations
metadata {
"Dyad": {"icons": {"default": "dyad://MultibodyComponents/KinematicPTPBoundedJerk.svg"}}
}
endTest Cases
No test cases defined.
Related
Examples
Experiments
Analyses