MapleSim Questions and Posts

These are Posts and Questions associated with the product, MapleSim

Hi

I am trying to implement normally distributed noise into a maplesim simulation. I thought this would be done most easily thru adding a modelica custom component. There are some examples to go on on the web however Modelica are not really good at explaining there implementation. 

The code for my implemented block can be seen below. 

 

model Noise2
    import MBI = Modelica.Blocks.Interfaces;
    import MBN = Modelica.Blocks.Noise;
    import MMD = Modelica.Math.Distributions.Uniform;
    
    output MBI.RealOutput out annotation (Placement(transformation(extent={{100,-10},{120,10}}))); 

    inner Modelica.Blocks.Noise.GlobalSeed globalSeed(fixedSeed=42);
    
    MBN.NormalNoise generator(samplePeriod=0.1,distribution=MMD.density(0, -1, 1));

    
    Real y(useGlobalSeed=true, useAutomaticLocalSeed = false, fixedLocalSeed=false, startTime = 0);
    
equation
    out = generator.y;
end Noise2;

 

However this results in the following error

Argument 1 must have integer[4] data type

 

Due to my inexperience with Modelica, I don't even know were to start searching for the error. So I turn to this wonderful community in my hour of need, How do I implement normal distributed noise in maplesim?

Mvh

Eric Ragnarsson

Hi

I have created a robot ar with p starting position X, Y, Z and a spring that connects to the robot end effector with a spring that is L long. I have exported this simulink model to an FMU inorder to use it in python. 

Is it posible to change the value of X, Y, Z and L using pyfmi before using it in pythuon and if it is, then how?

 

Thanks again for youre time and help. I know that this is not exaclyt inside the expertise of this fine comunity but have no were else to go.

Eric R

Hi Everyone,

First time asking a question on this website. I am a bit confused about an error I am getting in a pretty straightforward simulation I am trying to generate. It is part of an overall State Machine I am working on but I have isolated the issue to the Angle Sensor and have simplified the issue to ask my question. The issue is as follows:

When simulating the To_Box_5_error.msim file I get the following error

Preparing for integration......
Generating code (derivatives)
(in MapleSim:-CreateDataRecord) internal error occurred during simulation: check console on verbose for more details (5.508s)

This file consits of the angle sensor feeding back to the two <= blocks.

However when simulating the To_Box_5_works.msim file the simulation completes without issue. The difference in the second file is that I feed back the angle sensor value to only one <= block while the second I ijust feed in a constant.

Why would feeding back the same signal to both of these blocks not complete the simulation? The error does not occur for the position sensors that are also in the model.

Any suggestions would be greatly appreciated.

Mike

I would like to use a template in Maple to create a sampled data custom component to mimic a digital controller in order to study the effects of the non-linear features of the controller.  Is it possible to do this in Maple using a template?

Hi

I have created an model of a UR5e robot complete with mass and inertia however I have a problem with implementing the viscus friction. I have the viscus friction values for each of the joints calculated from another program, I just need to implement them.

 

Mvh

Eric Ragnarsson

We have just released updates to Maple and MapleSim.

Maple 2020.2 includes corrections and improvements to printing and export to PDF, support for macOS 11.0, more MATLAB connectivity, resolves issues with the installation of the Maplesoft Physics Updates, and more.  We recommend that all Maple 2020 users install these updates.

This update is available through Tools>Check for Updates in Maple, and is also available from our website on the Maple 2020.2 download page, where you can also find more details.

If you are also a MapleSim user, this Maple update will be installed automatically when you update your MapleSim installation to the newly released MapleSim 2020.2. The MapleSim update also includes many updates to MapleSim, the MapleSim CAD Toolbox, specialized MapleSim libraries, MapleSim connectivity tools, and MapleSim Insight.  You will find details about new features and improvements, as well as instructions on obtaining the update, on the MapleSim 2020.2 page.

Hi

I have constructed a model of an UR5e in maplesim with the hop to be able to test my controller writen in python on it. 

I hope to be able from the model to

  • Enter a tourqvalue for the joints.
  • Extract joint angles, joint velocitys as well as the forces and tourqes that affects the end effector.
  • (If posible) visualize the sumulated robot arm so I can se that the motion reflects that of the real robot arm.

the simulated robot arm 

The question is how to best do this in a semi realtime way?

I have been looking into generating a FMU but if there are other ways to do this, then I am open to ides. 

The contorller is based on a haptic algoritm for connecting two robot arms and I will only get one robot arm due to prise and space constraints.

This means that I will reseave realtime information from the real robot arm into my python controller that then i supose to take inforamtion from the simulated arm and with information from both arms calculate the tourqe values for both arms joints. 

 

Thanks in advance for all youre help

Eric Ragnarsson

Hi

I am trying to implement a maplesim block that takes two vectors as input and a 6x6 matrix as an output. I alrady got help with how to implement the inputs and the outputs however it was for an one input one output system.

The current code is the following

However this results in both inputs being placed ontop of each other

Do anybody know how to change the position of the two inputs so that they are not on top of each other?

Mvh
Eric Ragnarsson

Hi

I am trying to construct a controler for a UR5e robot, I have a simulation of the robot in maplesim and have started to look for a way to use multibody analysis to provide me with the Jacobian. However it only provieds the constraint Jacobian and as I have no position constraints on the robot, it returns nothing.

I then came across 

Link: https://www.youtube.com/watch?v=d3xJge_09E0&t=374s

However it is old and does not exactly say how to do it.

So I thought I should ask this wonderful comunity if they have an recomended way to construct the Jacobian from a maplesimmodel? I am still a beginner at maplesim and maple so any help is appreciated.

 

With thanks for helping me

Eric Ragnarsson

 

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

Hi

I am trying to create a simulation of a UR5e, I have added a spring dampening systen in order to simulate the imput of external forces and torques. However I get a strange error for which I could not find an awnser for on the web.

The closest was 

https://www.mapleprimes.com/questions/203860-Compile-Maplesim-Model-To-Ccode

However it is quite old and not entirely a match. 

I get the following output

More information

Maplesim 2020

64 bit version

Windows 10

RAM - 16 GB

Do anybody know a solution for this?

Mvh

Eric Ragnarsson

 

Hi,

I'm new to Maplesim and Maple. I've modeled a planar slider-crank mechanism in Maplesim and it works.

Now I want to extract the equations of motion (DAE) for further analysis. From 'Template' --> 'Worksheet', I used A:-GetEquations() to try to get the DAE. However, the equations are too long and not shown. Moreover, I don't know what coordinates Maplesim used to generated those 'unseen' equations. Here are the equations that can be hand-derived:

where I and m represent inertia and mass respectively. Theta, beta and s are the chosen generalized coordiantes, s_theta is sin(theta), c_theta is cos(theta)s_beta is sin(beta), c_beta is cos(beta). Rx and Ry are lagrange multipliers representing the reaction force in the pin between the crank and the connecting rod.

How can I generate such DAEs using Maplesim? Thank you very much.

In the present work we are going to demonstrate the importance of the study of vector analysis, with modeling and simulation criteria, using the MapleSim scientific software from MapleSoft. Nowadays, the majority of higher education centers direct their teaching of vector analysis in an abstract way and there are few or no teachers who carry out applications using modeling and simulation. (In spanish)

IPN_CICATA_2020.pdf

Expo_MapleSim_CICATA.zip

 

Dear Community,

I would like to have an inverse interpolation with a 2D lookup table in MapleSim. The usual 2D lookup interpolation has u1 column values, and u2 row values, and a corresponding   y   table values, i.e. y = f(u1,u2). Now I would like to go the reverse way. Suppose I know y, and u2, and I would like to get u1. How can I implement this in MapleSim? An additional information is, that the 3D surface represented by the f(u1, u2) function is a smooth, slightly curved, monotonically sloping surface, so to any  y  value a unique pair of u1 and u2 values belong.

 

With my specific data, which are attached in the TestVLP.xlsx file:

 

  • u2 values are: 1st row, cells 2 .. 14
  • u1 values are  1st column, rows 2 .. 11
  • tabulated values are all the rest, i.e. from cell(2,2) .. cell(11,14)

 

Now for my case:

 

  • u2 = 42000.0
  • y   = 94.5614

 

How much is u1? I know the correct answer from elsewhere, it should be something very close to u1 ~ 85. This  y  value is in the rectangle bordered by columns 7 .. 8  and rows 5 .. 6 in the Excel file.

 

So my question is how do I correctly implement this in MapleSim? As visible from the attached TestInverse2DInterpolation.msim file I tried to do it with an Inverse Block Constraints component and a horizontally flipped 2D Lookup Table (VLP) and Constants for y and u2, but upon running MapleSim I get an error message that no solution is found, although the solution is relatively easy and straightforward. May I ask you to have a look at it, what can be the problem here, what do I do wrong? I’m using MapleSim 2019.2.

 

Your kind help is appreciated in advance

best regards

 

Andras

TestInverse2DInterpolation.msim

TestVLP.xlsx

Hi all,

I am new to maplesim and trying to learn it.

While simulation of the battery operated 4 wheeled driven electric vehicle 

it tells can't find solution.

 

 

Same time if i connect a fixed reference all four wheels are running (same place) but not moving since the frame fixed.

 

HELP ME TO SOLVE THIS.

 

thank you..

 

1 2 3 4 5 6 7 Last Page 1 of 35