auto-examples
auto-examples copied to clipboard
Integrating the adjustment in the PID example?
In the PID example, there's a line (https://github.com/mstksg/auto-examples/blob/master/src/Recursive.hs#L103):
control <- sumFromD c0 -< adjustment
I get why one would delay a signal in the recursive setting, but I don't think a PID should integrate adjustment in the first place.
Shouldn't it just be:
...
let control = kp * err
+ ki * cumulativeSum
+ kd * fromMaybe 0 changes
response <- blackbox -< control
id -< response
Ah, I read the code before the readme. But I still don't get why sumFromD is the same as system . delay
currResponse <- system . delay c0 -< control