Home Questions Force perturbations

Force perturbations

Xin Li asked 5 years ago
I am programming a task with force perturbations, and I'm modeling it off the demo on the website. When building, it throws an error saying 'Size mismatch (size [1x1] ~= size [1x4]). The size to the left is the size of the left-hand side of the assignment. Function 'KINARM_EP_Apply_Loads/Force_Cap' (#443.70.71), line 4, column 1: "y"'. I was able to make this work by breaking the link and changing the line to y=zeros(size(u)), but I find it strange that the original doesn't work. I also tried building the downloaded demo on my machine for a sanity check, and the same error message appeared. I'm wondering if you can reproduce the issue on your end, and if there's a better solution. Thanks.
Xin Li replied 5 years ago

Update: after building the model, I realized that no forces were being applied. Using a scope to look at the force output from the Constant_Loads_EP block, it looks like forces are being generated appropriately, but they are not being applied to the robot. I assume it’s because the Apply_Loads block is not working properly. Any suggestions?

3 Answers
Koloman Varady Staff answered 5 years ago
Hi Xin Li, The block should work and shouldn't be unlinked - it is the block that creates the torque commands to the robots. Are you inputting a 1x4 vector into the block? Cheers, Koloman
Koloman Varady Staff answered 5 years ago
Hi Xin, I'm able to rebuild the task here. I'm not sure how y wouldn't be size 1x4. Things I would suggest -restart MATLAB -clean out the intermediary build files (everything but the model file and the .dtp files) -reinstall the TDK Cheers, Koloman
Xin Li replied 5 years ago

Cleaning out the build files worked. Thanks!

Koloman Varady Staff replied 5 years ago


Xin Li answered 5 years ago
Hi Koloman, I believe I am inputting a 1x4 vector into the block, which is the u variable in the KINARM_EP_Apply_Loads/Force_Cap. The error message is referring to line 4 of the Force_Cap function, which says y=u. It is reporting that y is 1x1, where as u is 1x4, causing a dimension mismatch. The error message appears when the link is not broken, and the program would't build. I also could not build the demo - same error message.