https://github.com/stefanbesler/struckig
Full port of pantor ruckig library (Community version) to IEC 61131-3 Structured Text. Online Trajectory Generation. Real-time. Time-optimal. Jerk-constrained.
https://github.com/stefanbesler/struckig
online plc ruckig structured text trajectory twincat
Last synced: about 1 month ago
JSON representation
Full port of pantor ruckig library (Community version) to IEC 61131-3 Structured Text. Online Trajectory Generation. Real-time. Time-optimal. Jerk-constrained.
- Host: GitHub
- URL: https://github.com/stefanbesler/struckig
- Owner: stefanbesler
- License: gpl-3.0
- Created: 2021-06-14T13:21:36.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2026-04-27T13:34:41.000Z (about 1 month ago)
- Last Synced: 2026-04-27T14:26:04.576Z (about 1 month ago)
- Topics: online, plc, ruckig, structured, text, trajectory, twincat
- Language: Python
- Homepage: https://stefanbesler.github.io/struckig/
- Size: 15.2 MB
- Stars: 99
- Watchers: 17
- Forks: 15
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Instantaneous Motion Generation for Robots and Machines.
Port of ruckig to Structured Text, TwinCAT 3.
Read the Documentation:
https://stefanbesler.github.io/struckig/
Struckig ports [pantor/ruckig](https://github.com/pantor/ruckig) to Structured Text and brings open-source online trajectory generation to TwinCAT 3.
It targets deterministic PLC task loops and multi-axis synchronization in machine control scenarios.
Only the Community Version of Ruckig is ported and pro features are not available.
Struckig is dual licensed:
- GPLv3 for open-source usage
- commercial custom license for closed-source usage (contact [stefan@besler.me](mailto:stefan@besler.me))
## Documentation
- Full docs: [stefanbesler.github.io/struckig](https://stefanbesler.github.io/struckig/)
- Installation guide: [User guide installation](https://stefanbesler.github.io/struckig/userguide/installation.html)
- API reference: [API Reference](https://stefanbesler.github.io/struckig/api/Struckig.html)
## Installation
1. Download the latest release from [Releases](https://github.com/stefanbesler/struckig/releases).
2. Add the library to your TwinCAT project.
3. Instantiate `Struckig.Otg` and call `otg()` once per PLC cycle.
For screenshots and TwinCAT step-by-step instructions, use the [installation docs](https://stefanbesler.github.io/struckig/userguide/installation.html).
## Quick example (single axis)
```st
PROGRAM Example
VAR
otg : Struckig.Otg(cycletime:=0.001, dofs:=1) := (
EnableAutoPropagate := TRUE,
Synchronization := SynchronizationType.TimeSync,
MinDuration := 10.0,
MaxVelocity := [2000.0],
MaxAcceleration := [20000.0],
MaxJerk := [800000.0],
CurrentPosition := [0.0],
CurrentVelocity := [0.0],
CurrentAcceleration := [0.0],
TargetPosition := [100.0],
TargetVelocity := [0.0],
TargetAcceleration := [0.0]
);
END_VAR
otg();
```
Map `otg.NewPosition`, `otg.NewVelocity`, and optionally `otg.NewAcceleration` to your axis interface each cycle.
## Extra features
- While the port stays close to upstream, additional behavior can be enabled via feature flags on `Otg` or globally in library parameters.
| Flag | Description |
|------|-------------|
| `SmoothBrake` | In ruckig, reducing `MaxVelocity` below the current velocity triggers a brake ramp to `velocity = 0` before transitioning to the new limit. Enable this flag to bypass that behavior and switch to the new `MaxVelocity` immediately. |
## Development
- CI uses [zkbuild](https://github.com/Zeugwerk/zkbuild-action)
- Docs generation uses [zkdoc](https://github.com/Zeugwerk/zkdoc-action)
- Unit tests can be run with [TcUnit](http://www.tcunit.org/) via `test\Struckig\Struckig_unittest.sln`