Forum Replies Created
-
AuthorPosts
-
eaparraBlocked
– Should be 5.5273 rad/s and -0.398 m.
– Given by SOFA are 15.5195 rad/s and -0.0314 m.Correction.
Thanks.
eaparraBlockedHello @hugo.
Taking into account the values and physical dimensions, the natural frequency and maximun deflection:
– Should be 5.5273 rad/s and –0.398 m.
– Given by SOFA are 15.5195 rad/s and 0.0314 m.Thank for your help and I’m looking forward hearing you.
Best wishes,
E. Andres Parra R.
eaparraBlockedHi @hugo and @guillaumeparan.
Finally, I could control the torque to control de angle. I used a PID controller and the simulation runs very good, working with zmq sofaCommunication.
I update the last changes, if you want to see it.https://github.com/eaparra01/Femur_Movement
Thank you so much for your help.
3 November 2021 at 15:26 in reply to: Control actuators and receive sensor variables of scene .scn #20734eaparraBlockedHi @hugo.
Finally, I could control the torque to control de angle. I used a PID controller and the simulation runs very good.
I update the last changes, if you want to see it.Thank you so much for your help, and if you like, you could mark this support topic as resolved.
eaparraBlockedHi @hugo.
Thank you very much for your help, I no longer have the annoying vibration due to the change in tolerance that you told me. <GenericConstraintSolver tolerance=”1e-8″ maxIterations=”1000″/>.
But, taking into account the physical variables, which I told you in REPLY # 20647, the natural frequency continues without being the same as the one with the experimental and calculated data.
One of the method I use to calculate the natural frequencies is the Model Superposition method, which one has good results and I compared the values with the Abaqus Software and it is fine.
For that, I added a Model_Superpostion.m that, taking the physical properties of the beam calculate the frequencies. And to be able to compare SOFA data, I added a formulation, Frequency_Spectrum.m, that taking the displacement and time, calculate the frequency spectrum, so that, the frequencies.For example, In Example_1_Beam.scn I take the data usign <Monitor template=”Rigid3d” name=”Beam_Alone_Movement_Point_10″ listening=”1″ indices=”10″ showPositions=”1″ PositionsColor=”1 1 0 1″ ExportPositions=”true”/>. I calculate the frequency usign Frequency_Spectrum.m and compare with teh data from Model_Superpostion.m, and they are totally different.
I hope with this information we could find out why the frequencies are no the same, I don’t know if the radius have to be changing taking into account the inertia area?
Thank for your help and I’m looking forward hearing you.
20 October 2021 at 15:25 in reply to: Control actuators and receive sensor variables of scene .scn #20669eaparraBlockedHi @hugo.
I’ve been looking for some functions that could help me control the rotation of the joint.
I saw that LinearMovementConstraint function could help but I can’t find good information of how to use it.
The examples that you have shows some features but not explain some characteristics like keyTime, keyMovements, prevM, and so on.
I would like to know if the keyTime is the number of key frame it uses to do a movement or it is the number of frame does the movement? and could it make a movement without speficy the keyTimes?Thank you for you help I’m looking forward to hearing from you.
eaparraBlockedHi @hugo.
Since the last time I sent you the message I have made some improvements to the code. Using the latest version of SOFA the annoying vibration was minor but it continued. So to solve the problem I used several BilateralInteractionContranstraint and that helps me to minimize the vibration.
I could see that the problem, perhaps, is the solver, because when I started to modify the SOFA showed warnings of the threshold values and by modifying it, the vibration increased or decreased.
Taking into account that you told to me about the values parameters and units I used the International Sistem of Units. So:
– The weight of the beam is 0.896 Kg.
– Length of 0.732 m, height 0.00302 m and width of 0.015 m.
– It is made of aluminium, so the young’s module is 70e9 N/m2.
– And the mass at the end of the beam weighs 0.58 kg.The vibration could see more easy in Example_2_Beam strong>https://github.com/eaparra01/Example_Beam/blob/main/Example_2_Beam.scn. This simulation has the two masses, hip and knee masses, and the femur between of them.
Also, if you want it, you can see the process I followed to develop the final legged robot in this link https://github.com/eaparra01/Example_Beam.
Thanks for your help and I’m looking forward to hearing from you.
19 October 2021 at 09:00 in reply to: Control actuators and receive sensor variables of scene .scn #20651eaparraBlockedHi @Hugo.
Following the solution I used in https://www.sofa-framework.org/community/forum/topic/beamfemforcefield-setting/, that using multiple BilateralInteractionConstraint avoid vibration a little bit, but the vibration continuous. I continued working with the Communication plugin that you and your fellow suggest me https://www.sofa-framework.org/community/forum/topic/input-and-output-in-sofa-scn-file/.
Taking into account the code that I shared with you https://github.com/eaparra01/Femur_Movement, I modified both codes, .scn and c ++, which help me to control and take the values of the positions of the masses with a refresh rate of 1000, 1ms.
But you mention the Controller (C ++ class) that can help me, it would be great if you could send me the link that explains how to work with this class.
Although, continuing with the Communication plugin, which is working well so far, I would like to know if SOFA has an actuation function that allows me to give it an angle and that it goes to that angle without using the ConstantForceField function.
Thank you for you help I’m looking forward to hearing from you.
eaparraBlockedHi @hugo.
I’ve been waiting your response, due that I can’t progress in the SOFA simulation.
Please response because I have to understand that.
Thanks
eaparraBlockedHi @hugo and @guillaumeparan.
Finally, I could take and send the values of the SOFA simulation in .scn, using ZMQ protocol and the Communication plugin that @guillaumeparan said to me.
Using SOFA v21.06 over Ubunto 20.04.3 LTS and installing libzmq3-dev I just had to comment using sofa::helper::vector in the ServerCommunication.h file.
But I have a drawback, when I simulate the scene a vibration appears that I didn’t model. I’m simulating the beam with a mass at the end free, later I attach a Femur with a mass. But I don’t know why the Femur vibrates and modifies the simulation, given a noise that affects the results.
This is the link of the repository https://github.com/eaparra01/Femur_Movement.git.
Thank you very much for your help and I am attentive to your response.
eaparraBlockedHi @hugo and @guillaumeparan.
Until which version of SOFA the Communication plugin can work well?
Thank you very much for you help.
Best,
eaparraBlockedHi @guillaumeparan.
Some time ago I wrote to know a way to communicate and be able to send and receive data, and thus achieve control of the simulated systems in SOFA.
You sent to me a link with a specifications of a various way to communicate https://github.com/sofa-framework/Communication. I’ve read the information again, and I wanna know if you have been updating the Communication Plugin.
Reading, I noticed that the communication rate is 2hz (aka 500ms). So, II would like to know if the transmission rate has increased or if it continues at 2hz.Thank you very much for you help.
Best,
eaparraBlockedHi @Hugo.
Excuse me.
I had to make a few changes and modify the github.
Therefore to continue with the topic the new link is https://github.com/eaparra01/Example_Beam/blob/main/Example_1_Beam.scn.Thanks for the help.
eaparraBlockedCould you be kind enough to give us one example of the MultiTagAnimationLoop.
I have the problem that when I simulate the scene in .xml the constraints I specifed with FreeMotionAnimationLoop work fine. But when I limit the movement, putting a floor, this one doesn’t work, allowing the object to fall.
And I think, maybe using the MultiTagAnimationLoop helps me to specify the differens constraints I’m using.
Thanks for your help.
eaparraBlockedHi @hugo.
Recently, I have been modifying the github I sent to you before, the post #20253.
So, to continue with the topic the new link ishttps://github.com/eaparra01/Example_Beam/blob/master/Example_1_Beam.scn.
If you would have some question about the code, tell me please. I’m waiting for what you say to me.
Thanks for the help.
eaparraBlockedHi @hugo.
Recently, I have been modifying the github I sent to you before, the post #20253.
So, to continue with the topic the new link ishttps://github.com/eaparra01/Example_Beam/blob/master/Example_1_Beam.scn.
If you would have some question about the code, tell me please. I’m waiting for what you say to me.
Thanks for the help.
eaparraBlockedHi @Coco and @Hugo.
I would like to know if it is possible using C++ or pyhton that controls de variables of the xml scene?
I have been making a scene in xml “.scn” but I want to change some variables, for instance in ConstantForceField <ConstantForceField indices=”0″ forces=”0 0 0 0 X 0 0″ printLog=”true”/> and I would like to change X in the simulation.Thanks for the help.
eaparraBlockedHi @Hugo
Thanks for your answer.
Taking into account the example you sent to me and checking the units. I used the BeamFEMForceField.scn example to create a simulation of the cantilever beam with fixed-free configuration, with the particularity that a mass of 0.58 kilograms is attached to the free end. As well I entered the units, being these in meters and kilograms, therefore, the Young’s module of the beam in GPa, as you said. And taking into account the same length unit I set the radius in the BeamFEMForceField as you can seen <BeamFEMForceField name=”FEM” radius=”0.00465″ youngModulus=”70000000000″ poissonRatio=”0.33″/>.
Using the Monitor <Monitor template=”Rigid3d” name=”Beam_Alone_Movement” listening=”1″ indices=”10″ showPositions=”1″ PositionsColor=”1 1 0 1″ ExportPositions=”true”/>. I recorded the position of the free end with mass of the beam. With this data I analyzed the behavior of the beam, check its static displacement when it tends to rest, and by means of a frequency analysis see what its fundamental frequency.
But when comparing this data with those obtained with the real cantilever beam and with the calculations I made, they are totally different, so I started to modify the radius property trying to bring the real behavior closer to the simulation, but when I did that the natural frequency is closer but the its static displacemente changes so much.
I have just uploaded the code on github, so you could check it.
https://github.com/eaparra01/Example_Beam.git
Thanks for the help and I am waiting for what you tell me to be able to implement the improvements.
eaparraBlockedHi @Hugo.
Yes, I’m simulating a cantilever beam but with some features.
I took the ArticulatedSystemMapping just an example because it had the BeamFEMForceField property, but actually I want to understand how BeamFEMForceField works, how I said to you it has a young’s modelus, poisson ratio and radius.Althought when I set the values, for example aluminum properties radius=”0.0085″ youngModulus=”70e9″ poissonRatio=”0.33″, the simulation is totally different like the real one. And I don’t know if I have to use the GPa or Psi units and I don’t understand how I could set the radius values because it changes some much more the behavior of the beam in the simulation, and I would like to know which reference you take into account when set the radius value.
Thanks for the help and I am waiting for what you tell me.
eaparraBlockedHi @Hugo,
Now, I’m working with the v20.12.02 version.
When I executed the CMake checking the SofaPython3, it showed me an error. After that, I updated the libraries, but the error continues.So, what would you recommend me to do?
Thank you very much for you help and I’m attentive to your response.
Greetings.
eaparraBlockedHi @Hugo
Don’t worry.
Now I understand that I can use python3 to program a simulation and communicate, output/input values, from SOFA.But the problem now is that I can’t configure the SofaPytho3 plugin. Follow the instruccions from https://sofapython3.readthedocs.io/en/latest/menu/install.html# the CMake doesn’t recognize the python3.7.
I update the python, pynbin11, cmake and numpy. But when I uncheck python and I ckeck python3 plugin the cmake popup a windows error.
At the end, I follow out-of-tree build but I don’t understand how I can execute the cmake example.Instructions I made:
### In-tree build
Add this directory path inCMAKE_EXTERNAL_DIRECTORIES
.NB: This plugin cannot be build through in-build process when the old SofaPython plugin is activated. To have both SofaPython3 and SofaPython you need to use out-of-tree build.
### Out-of-tree build — I don’t understand what I have to put in cmake and make -j12
This plugin should compile with out-of-tree builds.
You might need to add the Sofa’s installation path to the CMake prefix path. If you compiled Sofa in directory _$SOFA_ROOT/build_, consider doing an install step (make install, ninja install, etc.) and adding this installation path (examplecmake -DCMAKE_PREFIX_PATH=$SOFA_ROOT/build/install/lib/cmake ..
).### Changing the python path — This is after the Python3 plugin is accepted?
The compilation of SofaPython3 plugin and bindings are tied to the python core library found during the CMake stage.
To change the python version used for the compilation, you can either:
1. Provide the python executable path withPython_EXECUTABLE
cmake -DPython_EXECUTABLE=/usr/local/bin/python3 ..
2. Provide the python root path withPython_ROOT_DIR
cmake -DPython_ROOT_DIR=/usr/local ..
Thank you very much for your valuable help and I’m attentive to your response.
Greetings.
eaparraBlockedHi @Hugo
It is great that python that the v20.12(.01) allows to use native python environment.
But my question is if I can output or input values in SOFA. For example, take the position values from my simulation and send them to another program. And since I do not have the plugin for .scn, in the latest version of SOFA, I wanted to know if with python I can obtain these output/input values over SOFA.TThank you very much for your valuable help and I’m attentive to your response.
Greetings.
eaparraBlockedAnd one more thing, sorry bother you.
When you sent me the link git clone -b sofaCommunication https://github.com/SofaDefrost/sofa, this is the src or the plugin.
Because I’ve tried to find the sofaCommunication plugin but I haven’t found it.Thank you.
Greetings.
eaparraBlockedHi @Hugo
Thanks for you help.
ue
But if I work with the V20.xx version and use python to program the scene, Could I stablish the communication outside the SOFA using this language or I must use the plugin?.Thank you very much for you help and I’m attentive to your response.
Greetings.
eaparraBlockedHi @Guillaume
Thank you for you help.
I have some questions, the plugin you suggested to me, I don’t know where I can clone?
and I dont know where I can find the example.
I also read that I could use two protocols, OSC and ZMQ , so I don’t if you suggest to me to use one of this, but I don’t know how connect with our simulation because I want to use .scn format but this protocols are explained in java or python.Sorry for me inexperience, I’m a little confused with the information.
Again, thank you very much for you help and I’m attentive to your response.
Greetings.
-
AuthorPosts