elodin-sys / elodin

Physics simulation software for space + aerospace
https://elodin.systems
417 stars 13 forks source link

rate pid derivative filter applied to i_prev #18

Closed magate closed 2 months ago

magate commented 2 months ago

https://github.com/elodin-sys/elodin/blob/a92068cb82972bbbe84a1633d4602ca3c8ed52ea/examples/drone/control.py#L223

Is this correct? The filter is being applied from the previous integral error to the new derivative value?

At first glance I think this needs a comment as it is not what I would expect.

akhilles commented 2 months ago

Ah, no. That's definitely a bug. It should be d_prev. Thanks for catching this. It effectively caused the integral gain to amplified and the derivative gain to be suppressed.

akhilles commented 2 months ago

Fixed in https://github.com/elodin-sys/elodin/commit/afb1a0a77a6c71d06d9265a331b4e4c60ecf1f6b.