Page 1 of 2

Control strategies for functional electrical stimulation (FES) cycling Public Forum

Posted: Fri Jul 20, 2018 3:23 pm
by admin
Welcome to the Control strategies for functional electrical stimulation (FES) cycling public forum. Feel free to browse or search the topics for helpful information, or post a topic of your own.

Re: Control strategies for functional electrical stimulation (FES) cycling Public Forum

Posted: Sun Apr 07, 2019 7:30 am
by samkazemi
To whom it may concern
I am writing to inquire about getting help, because I am new in Opensim, and without your help, I could not solve my university project. With respect to you and your great file, could you please help me to change the situation of sitting and duration of FES pulse? I look forward to hearing from you
Sincerely

Re: Control strategies for functional electrical stimulation (FES) cycling Public Forum

Posted: Fri Jun 14, 2019 2:09 pm
by anacsousa
Hello Sam,

I did not understand what you mean by "sitting".

About the durantion of the pulse, this is a simulation in which we approximate the FES stimulation as the excitation of the muscle. In OpenSim this excitation goes from 0 to 1 (1 being the maximum force that the muscle generates). Therefore, we do not specifically change pulse width.

We change the excitation in cycling_control.m:

Code: Select all

    % assing excitation to muscles
    for i = 1:length(musclesNames)
        if strcmp(musclesNames{i},'rect_fem_r')
            thisExcitation = Vector(1, quadRight);
        elseif strcmp(musclesNames{i},'vas_int_r')
            thisExcitation = Vector(1, quadRight);
        elseif strcmp(musclesNames{i},'rect_fem_l')
            thisExcitation = Vector(1, quadLeft);
        elseif strcmp(musclesNames{i},'vas_int_l')
            thisExcitation = Vector(1, quadLeft);
		elseif strcmp(musclesNames{i},'hamstrings_l')
            thisExcitation = Vector(1, hamsLeft);		
		elseif strcmp(musclesNames{i},'hamstrings_r')
            thisExcitation = Vector(1, hamsRight);
		elseif strcmp(musclesNames{i},'glut_max_r')
            thisExcitation = Vector(1, glutRight);		
		elseif strcmp(musclesNames{i},'glut_max_l')
            thisExcitation = Vector(1, glutLeft);
        else
            thisExcitation = Vector(1, ZERO);
        end
        % update modelControls with the new values
        if thisExcitation ~= ZERO
            osimModel.updActuators().get(musclesNames{i}).addInControls(thisExcitation, modelControls);
        end
    end
We look the for muscle and add the control signal related to that muscle.

Re: Control strategies for functional electrical stimulation (FES) cycling Public Forum

Posted: Mon Jun 24, 2019 12:30 am
by tarun700
Dear sir/mam,
can you please guide me in step by step how to use or run this model as I am very new in OpenSim.
Thank Regards
Tarun Karak

Re: Control strategies for functional electrical stimulation (FES) cycling Public Forum

Posted: Tue Jun 25, 2019 12:43 pm
by anacsousa
Hello Tarun Karak, the first step is to follow the instructions to script with Matlab available at https://simtk-confluence.stanford.edu:8 ... ith+Matlab.

And after downloading our package, you should follow the steps in README.txt.

In case you have any specific problems, we could look for solutions.

Re: Control strategies for functional electrical stimulation (FES) cycling Public Forum

Posted: Mon Jan 27, 2020 7:57 am
by yanymorales
Hello,
When I open the FES Cycling Model on OpenSim, many parts of the model don't appear and I am receiving messages that say "Couldn 't find file 'femur.vtp'", "Couldn't find file 'l_tibia'",etc. . How do I resolve this?
Kind Regards,
Yasniary Morales

Re: Control strategies for functional electrical stimulation (FES) cycling Public Forum

Posted: Fri Aug 28, 2020 7:35 am
by anacsousa
Hello, Yasniary,

I don't receive notifications about this forum, that is why I did not answer prior.
Those are parts of the model that usually get installed with OpenSim 3.3. I have tested with OpenSim 4.1, but they don't seem to be in the usual place. What I did to open the model, was to copy and paste these parts to the same location of the osim model.

However, I don't think that all functions will work with OpenSim 4.1, there are some differences. So, I suggest using 3.3.

Re: Control strategies for functional electrical stimulation (FES) cycling Public Forum

Posted: Thu Jul 15, 2021 12:39 am
by zakky
Hello, I am university student.

I using this model(FEScycling), thank you.
However, there is something I don't understand.
How do you control the load on the pedals?
For example, if you increase the load on the pedals, it will be harder to cycle.

I use a translator for this.
kind regards.

Re: Control strategies for functional electrical stimulation (FES) cycling Public Forum

Posted: Thu Jul 15, 2021 6:36 pm
by anacsousa
Hi, Yuya Miyazaki!

I'm glad you are using the model.

Your question: "How do you control the load on the pedals?"

1. In CyclingLibrary/cycling_control_v2.m, I first calculate the load in line 150:

Code: Select all

[thisLoad] = gear_load_v2(thisVel,flagLoad,flagMotor,thisTime);
2. I update a vector with this new calculated thisLoad in line 261 (this is an optional step, I only do that for saving all values calculated for later plots):

Code: Select all

controlActionLoad(controlIteration) = thisLoad;
3. The line of code that actually updates the crank actuator is in 307:

Code: Select all

osimModel.updActuators().get('gear_load').addInControls(Vector(1, controlActionLoad(controlIteration)), modelControls);
It gets the gear_load part from the model and adds to the control the values from Vector.
controlIteration is the current iteration value. You can substitute controlActionLoad(controlIteration)) for thisLoad, if you decide to skip step 2.

Cheers!
Ana

Re: Control strategies for functional electrical stimulation (FES) cycling Public Forum

Posted: Sun Jul 18, 2021 11:27 pm
by zakky
Thank you for reply ana.

Does it mean that I can change the value of "gear_load" in the actuator field to control the resistance of the pedal?

I use a translator.
kind regards.