Troubleshooting
Common issues when integrating Struckig in PLC projects.
TrajectoryState.Error right after start
Likely causes:
- negative or zero limits where positive limits are required
- inconsistent vector size for configured DoFs
- impossible target state for active constraints
What to check:
- all
Max*limits are sensible and positive - each array has exactly
dofsentries - current and target state values are in consistent units
- inspect
ErrorCode()in addition toErrorMessage()
Zero limits conflict errors
Likely causes:
- one or more axes use zero acceleration or jerk limits while target states still require constrained motion
- synchronization forces coupling with another DoF that cannot satisfy zero-limit constraints
What to check:
- avoid mixing zero limits with aggressive target velocity/acceleration requests
- test with
SynchronizationType.Noneto isolate per-axis feasibility - reintroduce synchronization after each axis is individually valid
Motion looks too slow or too fast
Likely causes:
cycletimedoes not match actual task period- unit mismatch (
mmvsm,degvsrad)
What to check:
- task period in TwinCAT and
cycletimeare equal - velocity, acceleration, jerk are scaled to your position unit
Never reaches Idle
Likely causes:
- target is overwritten each cycle by other logic
- external sequence logic modifies
Current*continuously
What to check:
- write targets at state boundaries, not continuously
- avoid changing
CurrentPosition/Velocity/Accelerationduring active segments unless intentional - verify whether target velocity or target acceleration is intentionally non-zero
Axis movement is jerky
Likely causes:
- jerk limits too high for mechanics
- output updates are not applied every cycle
- drive interpolation mode mismatch
What to check:
- reduce
MaxJerkand test again - ensure cyclic setpoint mapping runs unconditionally
- validate axis mode and interpolation settings
- consider
DiscretizationType.Discretefor cycle-aligned durations
Unexpected path shape in multi-axis motion
Likely causes:
- synchronization mode does not match path intent
- constraints differ strongly between axes
What to check:
- try
SynchronizationType.Phasefor geometric path consistency - align relative limits between axes where possible
- avoid partial per-DoF overrides unless required
Validation passes, but runtime still errors
Likely causes:
- parameters changed between
ValidateInputandotg()call - external logic writes NaN or invalid numbers during runtime
What to check:
- keep setpoint update and
otg()call in the same deterministic code region - guard external writes and sanitize values
- log parameter snapshots on transition edges
Diagnostic workflow
- log
StateandErrorMessage()when errors occur - log current and target vectors at segment entry
- verify cycle time, units, and limit ranges
- reduce complexity to a 1-axis move, then scale back up