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

Functional Electrical Stimulation Cycling (FES Cycling) is a rehabilitation technique that allows a spinal cord injured (SCI) volunteer to ride a bicycle contracting his/her muscles. This project provides a model and several scripts to test and develop th
User avatar
Ana de Sousa
Posts: 67
Joined: Thu Apr 07, 2016 4:21 pm

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

Post by Ana de Sousa » Wed Jul 21, 2021 4:31 pm

No worries! Glad to help.

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

Yes, you can control the resistance of cycling (or cycling pedal, I don't know if that is what you mean).
No, it is not on the pedals, but on the crank (I just wanted to clarify the location).

User avatar
Yuya Miyazaki
Posts: 16
Joined: Tue May 11, 2021 8:45 pm

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

Post by Yuya Miyazaki » Sun Jul 25, 2021 8:15 pm

Thank you for reply ana.

We are looking into the effects of gear loading on rehabilitation.
What is "torque_is_global"? How does it affect the system?

I use a translator.
kind regards.

User avatar
Ana de Sousa
Posts: 67
Joined: Thu Apr 07, 2016 4:21 pm

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

Post by Ana de Sousa » Tue Jul 27, 2021 3:38 pm

Where is the variable "torque_is_global"?

User avatar
Yuya Miyazaki
Posts: 16
Joined: Tue May 11, 2021 8:45 pm

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

Post by Yuya Miyazaki » Wed Jul 28, 2021 10:39 pm

Thank you for reply ana.

"torque_is_global" is located on line 3750 of "FesCyclingmodel.osim".
Also, does the "axis" in line 3752 represent the direction of the force?

Thank you for replying so many times.

Kind regards.

User avatar
Ana de Sousa
Posts: 67
Joined: Thu Apr 07, 2016 4:21 pm

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

Post by Ana de Sousa » Thu Jul 29, 2021 4:41 pm

That is the final opensim model that will be used by opensim. It follows a specific structure that you can see here:
https://simtk.org/api_docs/opensim/api_ ... uator.html

You can directly edit the .osim file, but I created using other functions from the API, as you can see here:
https://github.com/anacsousa1/opensim-f ... Orthosis.m

The createModel_passiveOrthosis.m loads the basic model 'FESCyclingModel.osim', creates a torque called 'gear', and applies it on the model and then prints the model that will be used.

I suggest further reading on this topic, there is a tutorial about it:
https://simtk-confluence.stanford.edu/d ... +in+Matlab

User avatar
Rufaida Hussain
Posts: 2
Joined: Wed Jul 28, 2010 1:08 pm

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

Post by Rufaida Hussain » Sat Jun 04, 2022 11:54 am

Dear all
I am trying to run the RUNME_BB matlab file. I am using opensim 4.3 and matlab 2021a
But I faced the following error
Unrecognized function or variable 'getStateValues'.

Error in cycling_control_v2 (line 65)
thisStateArray = osimModel.getStateValues(osimState);

Error in OpenSimPlantFunction (line 83)
controlVector = controlsFuncHandle(osimModel,osimState);

Error in
IntegrateOpenSimPlant>@(t,x)OpenSimPlantFunction(t,x,controlsFuncHandle,osimModel,osimState)
(line 101)
plantHandle = @(t,x) OpenSimPlantFunction(t, x, controlsFuncHandle,
osimModel, osimState);

Error in odearguments (line 90)
f0 = feval(ode,t0,y0,args{:}); % ODE15I sets args{1} to yp0.

Error in ode15s (line 152)
odearguments(FcnHandlesUsed, solver_name, ode, tspan, y0, options,
varargin);

Error in IntegrateOpenSimPlant (line 106)
[T, Y] = integratorFunc(plantHandle, timeSpan, InitStates, ...

Error in cycling_script (line 163)
motionData = IntegrateOpenSimPlant(cyclingModel, controlFunctionHandle,
timeSpan, ...

Error in RUNME_BB (line 44)
cycling_script;

Kindly How could I solve this problem

User avatar
Ana de Sousa
Posts: 67
Joined: Thu Apr 07, 2016 4:21 pm

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

Post by Ana de Sousa » Tue Jun 13, 2023 6:48 am

Hi Rufaida Hussain, this is probably due to your OpenSim version. This version only works for OpenSim 3.3

POST REPLY