geez0x1 / CompliantJointToolbox

Compliant Joint Toolbox (CJT) for MATLAB and Simulink
GNU General Public License v3.0
37 stars 14 forks source link

Nonlinear torques are not added in the right way in the state-space structure #35

Closed VishnuDevA7 closed 7 years ago

VishnuDevA7 commented 7 years ago

The torques from the nonlinear model has to be multiplied with a suitable gain matrix in order to be added to the states

geez0x1 commented 7 years ago

Nice find :) Fixed in 40d092765bcdc5090b6f07a8eecda801c9a2974c by (ab)using the B matrix inside the block (which saves generating a properly-dimensioned matrix):

B(:,1) / (k_t * n)

geez0x1 commented 7 years ago

I just realised my fix is incomplete. Let me work on it some more.

geez0x1 commented 7 years ago

Correct fix in 07557ad. Building B_nonlinear in the block mask as follows: B_nonlinear = [zeros([size(I,1),1]); 1./diag(I)]; which changes size depending on the size of I and thus on the chosen model.

geez0x1 commented 7 years ago

@VishnuDevA7 Can you confirm this is fixed for you?

VishnuDevA7 commented 7 years ago

Yes, its fixed :)