Question: Is it possible to have an matrix as an output from a custom component?

Hi

I am trying to implement a controler for a 6dof robot. This requires a number of matrixis one among them is the mass matrix.

I have the matrix equation from using the multibody analysis tool and was thinking to use this matrix equation to construct a custom componet that takes the angels of the robot joints as inputs and have the 6 x 6 mass matrix as an output.

However when I complete the component generation am I greeted with this error message.

(in MapleSim:-Modelica:-PrintModel) unable to print Matrix(6, 6, {(1, 1) = ((1/5000)*(5000*`msim/RNAME`(_msim_End_effector_M)+5000*`msim/RNAME`(_msim_Wrist_2_M)+2500)*(`msim/RNAME`(_msim_Wrist_1_H)+`msim/RNAME`(_msim_Wrist_2_H))*`msim/RNAME`(_msim_Upper_Arm_H)*cos(`msim/RNAME`(_msim_R3_theta))-(1/5000)*(5000*`msim/RNAME`(_msim_End_effector_M)*(`msim/RNAME`(_msim_End_effector_H)+`msim/RNAME`(_msim_Wrist_2_W))+5000*`msim/RNAME`(_msim_End_effector_H)+2500*`msim/RNAME`(_msim_Wrist_2_W))*sin(`msim/RNAME`(_msim_R5_theta))*`msim/RNAME`(_msim_Upper_Arm_H)*sin(`msim/RNAME`(_msim_R3_theta))+(1/5000)*(5000*`msim/RNAME`(_msim_End_e ... NAME`(_msim_Wrist_1_M)+(1/8)*`msim/RNAME`(_msim_Wrist_1_W)^2+7/10000})

Error in Component btnGenComponent with caption "Generate MapleSim Component

 

Most of it is just fragments of the (1,1) equations but what I take away from it is that it complains on a missmach between the 6 X 6 matrix and the output port. 

After researching the question, however, I have not managed to find a good answer to this so I ask this wonderful forum for help.

Is it posible to have a matrix as an output from a custom component? If it is then how?

Mvh

Eric Ragnarsson

Please Wait...