[KISEMA-1609] Commutative Operators in Dataflow should have free port constraints
fabianheyer opened this issue · 2 comments
fabianheyer commented
[Issue KISEMA-1609 migrated from JIRA, first reported on 2021-03-23]
In SCCharts dataflow, all simple arithmetic actors such as +, *, &, etc. which are commutative should have free port constraints to allow the layout to avoid some edge crossings. See the SCChart below and the attached image for an example where this could yield a diagram with at least two less edge crossings.
@ClocksUseSD
scchart RollingBall {
output float accel // output acceleration change
input float targetV = 10 // target velocity input
input float currentV = 0 // current velocity input
input float Kp, Ki, Kd // PID calibration variables input
input float dT = 0 // delta Time input
float prevError = 0 // error in the previous tick
float error = 0// divergence from the target velocity
float P, I, D // internal variables for PID calculation
clock t = 0 // clock for real time calculation
dataflow:
prevError = error
error = targetV - currentV
P = Kp * error
I += error * t
D = (currentV - prevError)/t
accel = P + Ki * I + Kd* D
}
Skgland commented
@fabianheyer is it intentional that the attached image has not been migrated?
fabianheyer commented
@Skgland It's included now, thanks for the heads-up.