| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
S7RTT is a lightweight, high-performance C++/C/Python/ST library designed for generating 7-segment S-curve motion profiles (jerk-limited trajectories).
While conceptually similar to the renowned Ruckig library, S7RTT is specifically optimized for single-axis applications, offering a streamlined alternative for embedded systems and real-time control loops where low latency and deterministic execution are paramount.
S7RTT provides a robust solution for time-optimal trajectory generation with the following capabilities:
S7RTT is not intended to replace Ruckig for multi-DOF cases, but it offers distinct advantages in single-axis scenarios:





################################################################################ Test in normal operation (vmax is 1000.0, amax is 10000.0, jmax is 100000.0) ################################################################################ Total Tests: 100000 ---------------------------------------- CATEGORY | S7RTT | RUCKIG ---------------------------------------- Plan Failures | 0 | 0 Sim Acc Failures | 0 | 0 ---------------------------------------- Faster Count | 3953 | 0 Draws | 96047 | 96047 ################################################################################ ################################################################################ Test in extreme cases (random vmax in [10,1000], amax in [10,10000], jmax in [10,10000]) ################################################################################ Total Tests: 100000 ---------------------------------------- CATEGORY | S7RTT | RUCKIG ---------------------------------------- Plan Failures | 0 | 13 Sim Acc Failures | 2 | 13 ---------------------------------------- Faster Count | 9039 | 1 Draws | 90934 | 90934 ################################################################################
Benchmarks conducted on C++ platforms evaluate the performance of S7RTT compared to Ruckig:
(Measure cycle time compare in Preempt_RT Linux, The unit is nanoseconds)

The core challenge of S-curve generation is calculating a time-optimal trajectory from an arbitrary initial state ($P_0, V_0, A_0 \neq 0$) to a target state. Since motion can be interrupted at any moment, the solver must handle non-zero initial acceleration without simply forcing it to zero first.
S7RTT differentiates itself from other solvers through its numerical approach:
Analytical Complexity: Libraries like Ruckig or TwinCAT typically solve cubic or quartic equations (using Cardano, Ferrari, or Newton methods) for exact roots. However, at specific boundary conditions—particularly when the target velocity is non-zero—these analytical methods can hit singularities. This often forces a fallback to bisection search.
Brent’s Method & Heuristics: Instead of relying solely on analytical root-finding, S7RTT employs trajectory extrapolation combined with Brent’s method for iterative approximation.
Usage Recommendations: To maximize performance, the algorithm is designed for a "Plan Once, Sample Many" workflow. Users are advised to call plan() only when the target changes, and use at_time() for per-cycle updates, rather than re-planning every cycle. However, immediate interruption with new parameters is fully supported.
S7RTT aims to provide a simple, fast, and reliable trajectory generator for single-axis motion control tasks. By simplifying the problem space (fixing target acceleration to zero), it achieves extremely high performance and code simplicity.
Special thanks to Gemini 3 Pro for the assistance in the development and optimization of this library.
| Back | FazBrowse Home | New Git URL |