Skip to content
Discussion options

You must be logged in to vote

No worries! Found it. It's step 3: the coefficients you copied are the ones MATLAB prints, which are rounded to 4 significant digits. That matters a lot here, because the integral part of the controller is the tiny difference between those numbers.

For a backward-Euler PID over z² - z, the exact numerator is

(Kp + Ki*Ts + Kd/Ts) z²  -  (Kp + 2*Kd/Ts) z  +  Kd/Ts
= 7.26075 z² - 13.979 z + 6.72

The coefficients sum to Ki*Ts = 0.00175. That's the integral gain. The printed 7.257 - 13.97 + 6.717 sums to 0.004, so the controller you ran in MuJoCo has more than twice the integral gain, and Kp/Kd are a bit off as well.

I ran both through the exact discretized motor and through MuJoCo 4.0 with y…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@wjnorton
Comment options

@tw4
Comment options

Answer selected by wjnorton
@wjnorton
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants