Page 1 of 1

Help me with my FES simulation

Posted: Fri Jul 28, 2023 8:24 am
by yokoya0225
I am a 22 year old Japanese graduate student doing research on FES (Functional Electrical Stimulation).
Currently, I would like to perform a model simulation of FES on an OpenSim model ("arm26.osim" is the one I am currently using for trial purposes) using Python.
So, I have created the program shown in the attached file and have a few questions and problems.
They are listed below.

A: For about 2 seconds after the simulation starts, the activation value of the biceps muscle to be controlled takes a negative value.
B: Despite the negative value of the activation as described in A, the elbow joint angle is increasing as desired. (However, you can also see a momentary decrease in the middle.)

Here is a brief description of the program
-Python is version 3.8.10, OpenSim is version 4.4, and the musculoskeletal model is arm26.osim, which is provided as standard.
-The attached program simulates elbow joint angle control with fes by providing biceps brachii (long head and short head) with an excitation that ramps up from a minimum value of 0 to a maximum value of 1 over 20 seconds as an input.
-The same value is given to the long head and short head of the triceps brachii muscle, respectively. In other words, the two muscles are treated as a single biceps muscle.
-The "reference_value" function is used to set the target angle for PID control in the future. It is currently meaningless and can be ignored. The same applies to "AngleError.
-The reason I did not use Matlab is that when I tried to run a simulation longer than 20 seconds in Matlab, it would take more than 1 second to calculate the integral. the integral calculation took more than 1 hour in some cases. However, the above problems A and B did not occur in the case of simulations using Matlab.
https://simtk-confluence.stanford.edu:8 ... d=28777060
Also, for the FES simulation, I referred to the pioneers at the following link
https://simtk.org/frs/?group_id=1553

The output graphs are attached along with the source code.
I am very sorry for my poor English and writing.
I would like to ask the experts to please provide me with answers to my questions and remedies for improvement.
fes_simulation.zip
(139.5 KiB) Downloaded 18 times