MAE501 Independent Study

  • 608 views
Uploaded on

Independent study : A Matlab AnyBody interface to compute torque requirements for Assisting and Resisting modes for a leg exoskeleton helping perform a leg curl.

Independent study : A Matlab AnyBody interface to compute torque requirements for Assisting and Resisting modes for a leg exoskeleton helping perform a leg curl.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
608
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
0
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Exoskeleton analysis
    for Knee Joint
    Submitted for
    MAE501 KRO
    Under guidance of Dr. V. Krovi
    By
    Hrishi Shah &
    Anirudh Shiwaswamy
    DATE @ " M/d/yyyy" 5/8/2009
    Acknowledgement
    We would like to express our sincerest gratitude to our advisor Dr. Venkat Krovi for giving us an opportunity to work on this topic. The project would not have been possible without his continuing guidance and his wealth of knowledge. We would also like to acknowledge Srikanth Kannan and Madusudan S Narayanan for providing us with a good background for this independent study. We would also like to thank all the ARMLAB members for giving feedbacks during the presentations. Finally we would like to thank our friends and parents for their constant and encouraging motivation.
    Table of Contents
    TOC o " 1-3" h z u Acknowledgement PAGEREF _Toc229483654 h 2
    Table of Equations PAGEREF _Toc229483655 h 4
    1.Introduction PAGEREF _Toc229483656 h 5
    1.1.Motivation PAGEREF _Toc229483657 h 5
    2.Background PAGEREF _Toc229483658 h 7
    2.1.Curve Fitting PAGEREF _Toc229483659 h 7
    2.1.1.Approximation Method PAGEREF _Toc229483660 h 7
    2.1.2.Interpolation Method PAGEREF _Toc229483661 h 8
    3.Computational Tools PAGEREF _Toc229483662 h 10
    3.1 AnyBody modeling software PAGEREF _Toc229483663 h 10
    3.1.1 Leg Model Creation PAGEREF _Toc229483664 h 12
    3.1.2 Exoskeleton Model Creation PAGEREF _Toc229483665 h 13
    3.2 MATLAB PAGEREF _Toc229483666 h 16
    3.2.1 Torque profile evaluation and virtual validation using MATLAB PAGEREF _Toc229483667 h 16
    3.2.2 GUI Implementation in MATLAB PAGEREF _Toc229483668 h 17
    4.Sensitivity Analyses PAGEREF _Toc229483669 h 27
    a.Foot Load PAGEREF _Toc229483670 h 28
    b.Body Mass PAGEREF _Toc229483671 h 28
    c.Start Angle PAGEREF _Toc229483672 h 29
    d.Simulation Time PAGEREF _Toc229483673 h 30
    5.Conclusion PAGEREF _Toc229483674 h 31
    5.Future Scope PAGEREF _Toc229483679 h 31
    References PAGEREF _Toc229483680 h 33
    TOC h z c " Figure"
    Figure 1 - AnyBody Software Main Interface PAGEREF _Toc229483681 h 10
    Figure 2 – Leg Model in AnyBody PAGEREF _Toc229483682 h 12
    Figure 3 – Exo-skeleton Model in AnyBody PAGEREF _Toc229483683 h 13
    Figure 4 - Forces and Torques in Models PAGEREF _Toc229483684 h 15
    Figure 5 – Main MATLAB-AnBody Interface PAGEREF _Toc229483685 h 18
    Figure 6 – On First Calibration PAGEREF _Toc229483686 h 19
    Figure 7 – Viewing Force Difference PAGEREF _Toc229483687 h 21
    Figure 8 – On change to Exo-skeleton Mode PAGEREF _Toc229483688 h 22
    Figure 9- On Animation of Exo-skeleton PAGEREF _Toc229483689 h 23
    Figure 10 - On Animation of Leg PAGEREF _Toc229483690 h 24
    Figure 11 – Final Muscle Force Profile during Calibration PAGEREF _Toc229483691 h 25
    Figure 12 - Viewing important muscle forces on Interface PAGEREF _Toc229483692 h 26
    Figure 13 - Iteration and max-error history after calibration with approximate profile PAGEREF _Toc229483693 h 27
    Figure 14 - Iteration and max-error history after calibration with exact profile PAGEREF _Toc229483694 h 27
    Figure 15 - Foot Load Sensitivity PAGEREF _Toc229483695 h 28
    Figure 16 - Body Mass Sensitivity PAGEREF _Toc229483696 h 29
    Figure 17 - Start Angle Sensitivity PAGEREF _Toc229483697 h 30
    Figure 18 - Simulation Time Sensitivity PAGEREF _Toc229483698 h 31
    Table of Equations
    TOC h z c " Equation" Equation 1 PAGEREF _Toc229483699 h 7
    Equation 2 PAGEREF _Toc229483700 h 7
    Equation 3 PAGEREF _Toc229483701 h 7
    Equation 4 PAGEREF _Toc229483702 h 8
    Equation 5 PAGEREF _Toc229483703 h 8
    Equation 6 PAGEREF _Toc229483704 h 8
    Equation 7 PAGEREF _Toc229483705 h 9
    Equation 8 PAGEREF _Toc229483706 h 11
    Equation 9 PAGEREF _Toc229483707 h 11
    Equation 10 PAGEREF _Toc229483708 h 17
    Equation 11 – Typical Parameters for sensitivity analyses PAGEREF _Toc229483709 h 28
    Introduction
    In broad, the objective of the project is to “prove that an exoskeleton can reduce load on the human”. One practical application would be to replace exercising equipment for the rehabilitation of a physically disabled patient trying to regain lost functionality. We investigate in this study, a small subset of the whole exoskeleton design problem, namely the knee joint of the exoskeleton. The purpose would be to develop a theoretical hypothesis that an exoskeleton at the knee would be able to replace the actual exercise done by the patient and prove it using simulation.
    The simulation was done by developing a leg model in AnyBody, a bio-modeling software. The muscle forces experienced while undergoing a normal weight lifting exercise using the leg were calculated and plotted for the main load carrying muscles of the leg for various values of exercise loads. For simplicity, the thigh was grounded at horizontal position and the knee was the only joint that was allowed motion. Then, an iterative analysis was carried out (using MATLAB/AnyBody interface) to find out a torque profile for the exoskeleton motor positioned at the knee joint in order to obtain muscle forces similar to those achieved without the exoskeleton. Each iteration involved the sampling of certain uniformly spaced points and interpolation between these points to obtain a continuous torque profile for the exoskeleton motor. This would then be used to drive the motor to get the inputs for the next iteration. To make the simulation realistic, an exoskeleton was developed in Pro-E and imported to the Leg model in AnyBody as a Stereo Lithography (STL) file, which then replaced the actual segments for easy viewing.
    To run iterative analysis, AnyBody was coupled with MATLAB and the whole process was simplified for future use by creating a simple GUI in MATLAB. As AnyBody and MATLAB were the key tools in the development of this project, a part of the study was dedicated to developing a fair understanding of both these software.
    Motivation
    In recent times, there has been an increased need for development of automated systems for tasks that are either too mundane, or for those to be done in dangerous environments (like battlefields), or even those wherein a high level of accuracy is required (like in a microsurgery). Due to this, there has been increasing interest in the research of exoskeletons for applications in most of the above mentioned areas. An exoskeleton defined as a powered mobile machine consisting primarily of a skeleton-like framework worn by a person and a power supply that supplies at least part of the activation-energy for limb movement. Uses of an exoskeleton are manifold, ranging from assisting a soldier in carrying heavy loads and serving as armor in the battle field to supporting and helping rehabilitate temporarily or permanently physically disabled patients to helping in rescue operations in dangerous situations such as building crumble sites or chemically hazardous situations.
    The augmentation of human effort is achieved in two ways. The first method is augmentation of a known human movement, a typical application of which would be to help regain functionality for a disabled limb. For this, the exoskeleton moves in a preprogrammed motion. The second method involves finding the intended movement by the human in real-time using force sensors and simulating that movement in the exoskeleton using right amounts of forces and torques in the actuators and motors respectively. This is not very easy since the exoskeleton is generally capable of exerting enough force to cause severe damage to the subject if the forces/moments are wrongly applied. Other factors like the exoskeleton’s self weight, inertia etc. make the entire process much more complicated.
    Background
    Curve Fitting
    Given a set of data points (xi,yi), we need to find a curve that best fits the data. This can be achieved either by Least squares approximation method or by interpolation method. The main difference between the two methods is, in approximation method the curve doesn’t necessarily need to pass through all of the given data points but in interpolation method, it is necessary for the curve to pass through the given points. In the following pages, the above two methods are discussed in some detail and the corresponding MATLAB functions are also listed.
    Approximation Method
    Least squares approximation method or regression analysis, finds the polynomial of degree m that best fits the given set of data by minimizing the sum of squared distance of the data points to the approximating curve [3].
    Suppose the data points are (x1, y1), (x2, y2)... (xn, yn) where x is the independent variable and y is the dependent variable. The fitting curve P(x) has the deviation (error) d from each data point, given by, d1=y1‐P(x1,) d2=y2‐P(x2),…..,dn=yn‐P(xn) . According to the method of least squares, the best fitting curve should satisfy the following condition
    π=d12+d22+…+dn2=t=1ndt2=t=1n[yt-fxt]2
    Equation 1
    And the least squares polynomial of degree m of the form
    Pm=c1+c2x+c3x2+…+cmxm-1+cm+1xm
    Equation 2
    that fits the n data points is obtained by solving the following set of linear equations for the (m+1) coefficients {c1,c2,…….,cm,cm+1}
    ni=1nxii=1nxi2⋯i=1nximi=1nxii=1nxi2i=1nxi3⋯i=1nxim+1i=1nxi2i=1nxi3i=1nxi4⋯i=1nxim+2⋮⋮⋮⋱⋮i=1nximi=1nxim+1i=1nxim+2⋯i=1nxi2mc1c2c3⋮cm+1=i=1n1yii=1nxiyii=1nxi2yi⋮i=1nximyi
    Equation 3
    If we have more than n + 1 constraints (n being the degree of the polynomial), we can still run the polynomial curve through those constraints but an exact fit to all the constraints is not certain.
    In MATLAB the polyfit (x,y,n) finds the coefficients of a polynomial p(x) of degree n that fits the data, in a least squares sense by solving Vandermonde Matrix.
    Interpolation Method
    It is the method of finding new data points between two existing data points [4]. In mathematical terms, given a sequence of n distinct data points (x ,yk) , we are looking for a function f so that
    f(xk)=yk , k=1,….,n
    Equation 4
    where f is known as the interpolant for the given set of data points. Piecewise constant interpolation, linear interpolation, polynomial interpolation and spline interpolation are some of the common interpolation methods. Due to relatively high interpolation errors piecewise constant interpolation and linear interpolation method are not preferred.
    Piecewise Approximation
    The piecewise interpolation is an approximation by different polynomials of lower degree(linear or quadratic interpolation) in different parts of intervals [a,b]; Linear interpolation is only appropriate when the mapping between screen space x,y and the attribute is affine.
    Given y=f(x) with y(x0)=y0 and y(x1)=y1, the Lagrange polynomial becomes
    P1x= y0x-x1x0-x1+y1x-x0x1-x0=y0+y1-y0x1-x0(x-x0)
    Equation 5
    For quadratic interpolation, given y=f(x) and values y1,y2,y3 at x1,x2,x3; the interpolating Lagrange polynomial is
    P1x= y0x-x1(x-x2)x0-x1(x0-x2)+y1x-x0(x-x2)(x1-x0)(x1-x2)+y2x-x0(x-x1)x2-x0(x2-x1)
    Equation 6
    Polynomial Interpolation
    In Polynomial interpolation, given n data points, we can find exactly one polynomial of degree at most n-1 going through all data points. Also the interpolation error is proportional to the distance between the data points to the power n. Some of the disadvantages of polynomial interpolation are its computationally expensive and the interpolation function tends to oscillate towards the end points for higher degree polynomials, which is known as Runge phenomena.
    For a polynomial function, increasing the higher order makes the curve more accurate to the real curve during interpolation. But as shown in the figure, there will be oscillations. Therefore, we use piece wise approximation to minimize the oscillations.
    Spline Interpolation
    All the above problems can be overcome using spline interpolation. A spline is a piece wise polynomial function. For a given set of k data points (t0, t1, t2 …. tk-1) piece wise polynomial functions Si are formed between consecutive knots [titi+1].
    Sk=Pk-1(t), tk-2Equation SEQ Equation * ARABIC 7
    The given k points ti are called knots. If the knots are equidistantly distributed in the interval [tk tk-1], the spline is uniform, otherwise it is non-uniform. The degree of spline St is the maximum degree of its polynomials P(t) and for its cubic spline the degree of the polynomial will be 3. Connection between the knots is defined as by smoothness properties and for cubic splines the function, its derivative and its second derivative are continuous at the interpolation nodes. Natural cubic spline is smoothest of all the possible interpolating curves since it minimizes the integral of the square of second derivative.
    In MATLAB, a cubic spline can be created by using any of the following commands:
    yi=spline(x,Y,xi) – this gives the values at xl for the given set of data points x and Y.
    yi=interp1(x,Y,xi,’spline’) – this interpolation command also gives the same output.
    In AnyBody Software, a spline can be obtained by using an AnyFunInterpol function.
    AnyFunInterpol moment = {
    Type=Bspline;
    BsplineOrder = 3;
    FileName = " Moment.txt" ; //Name of file containing knot values.
    };
    An advantage of using splines is that it utilizes lower order polynomials to produce globally smooth interpolant, simultaneously avoiding the computational disadvantages of higher degree polynomials.
    However, this sort of interpolation is unsuitable for computer graphics since computer graphics requires that a change in one part of the spline should have little or no change in the rest of the curve.
    Computational Tools
    3.1 AnyBody modeling software
    This musculoskeletal modeling software [23] was developed as part of the “The AnyBody Project” at Aalborg University in Denmark. The software was developed to parametrically analyze detailed musculoskeletal systems of both humans and animals.
    Figure 2-20 shows a picture of a musculoskeletal simulation performed within AnyBody. AnyBody is a script based analysis program such that writing code is necessary to develop the musculoskeletal system models. It uses its own scripting language, AnyScript, which is an object-oriented language similar to C++ or Java Script. This software also has the capability to perform analyses on complex musculoskeletal models. This complexity encompasses the model geometry, the number of muscles, dynamic changes in muscles position, and of degrees of freedom of the system. Within the program musculoskeletal and physiological properties such as muscle forces, joint reactions, metabolism, mechanical work, and efficiency can be examined for a given system. Several musculoskeletal system simulations have been performed using this software and example simulations can be seen on the AnyBody website (anybody.auc.dk).
    Inverse dynamics analysis (IDA) can be thought as the main process of calculating muscles forces within AnyBody Modeling Software system. Given the motion to the musculoskeletal model, muscle and reaction forces are calculated by setting up the equations of motion. Problems pertaining to static indeterminacy, limitations on the maximum muscle forces need to be resolved before the analysis. Since there are more muscles than the degree of freedom, redundancy posed by the system indicates that there is no unique solution to the inverse dynamics problem.
    Figure 1 - AnyBody Software Main Interface
    While performing a body motion the muscles collaborate according to some rational criteria. These criteria when combined with the fact that muscles can only pull and not push results in a unique recruitment pattern. This suggested that the central nervous system applies some sort of optimality criteria to determine the muscle activation order. If such an optimal criterion is combined with the equilibrium equations, we can have unique solution for the problem. The basic optimality assumption is that “the body attempts to use its muscles in such a way that fatigue is postponed as far as possible”. Hence, in our optimization problem we would minimize the maximum muscle activity subject to equilibrium constraints and positive muscle force constraint. Hence, the optimization problem for calculating the muscle forces can be mathematically written as:
    Minimize :V= i=1nFM,iNip
    Subject to:
    Cf=d
    FM,I ≥ 0 : i=1,…,n
    Equation 8
    Various forms of this optimization problem may be created raising the power of the individual muscle activity to a polynomial power, ‘p’. With increasing value of ‘p’, the criteria tend to distribute the relative load evenly between the muscles.
    The min/max-objective function is non-differentiable and therefore appears to complicate the practical solution of the optimization problem. However, by using bound formulation, which is widely used and well tested in the field of optimum engineering design, we can easily solve the min/max problems. By introducing a new artificial variable β and an artificial criterion function B(β) and the new criterion can be a monotonic function of β. By choosing the B(β) = β we can reformulate the above problem as:
    Minimize :β,
    Subject to: Cf=d
    FM,I ≥ 0 : i=1,…,n
    FM,iNi≤β;iϵ{1,…n}
    Equation 9
    In the min/max optimization problem, we are looking at the muscle recruitment that balances the exterior loads and minimizes the largest relative load on any muscle in the system, hereby positioning fatigue of the muscle as far as possible. This is the approach used within the AnyBody software.
    In addition to the main software, AnyBody has a command prompt executable named AnyBodyCon that allows one to load models and perform actions such as inverse dynamic analysis. This utility can run the required analysis without actually opening the software and going through the GUI. Hence, it is used to interface AnyBody software with other software such as MATLAB.
    3.1.1 Leg Model Creation
    The first step was to create a model that would emulate the functioning of a normal leg while doing various exercises. The Leg model from AnyBody repository was taken as the starting point for this model. Since only the knee joint was of sequence in the study, the model was reduced to one with only two segments by doing the following:
    • All nodes were transferred from the Pelvis segment to the Thigh segment (named UpperLeg in the model) and from the Foot segment to the Shank segment(named LowerLeg in the model).
    • 2. The grounding was removed from the Pelvis segment and provided at the Hip joint. The whole UpperLeg was grounded effectively by providing a revolute joint at the hip and providing it zero velocity.
    • 3. The muscle definitions were changed so as to now connect through nodes on the UpperLeg and LowerLeg instead of the Pelvis and the Foot respectively. The extra muscles that do not participate in the knee motion were deleted.
    • 4. The Pelvis and Foot segments were completely eliminated from the model.
    The model thus developed is shown in Fig. 2.
    Figure 2 – Leg Model in AnyBody
    Now the model was provided with a vertical load at the Foot-Shank joint and ran with a constant velocity from a Starting Angle to and Ending Angle to get a muscle force profile.
    This muscle force profile was then written to an external .txt file to allow for access to these profiles outside AnyBody software.
    3.1.2 Exoskeleton Model Creation
    To create the exoskeleton model, the Leg model discussed above was taken as the starting point. The next part involved adding two segments named UpperExo and LowerExo to represent the upper and lower parts of the leg part of the exoskeleton and place appropriate joints and drivers so that the exoskeleton could drive the leg.
    Figure 3 – Exo-skeleton Model in AnyBody
    The resulting model is as shown in REF _Ref222947051 h Figure 3. It was done by the following steps:
    • Two segments identical to the Leg segments were added and displaced a distance of 0.06m from the Leg segments.
    • 5. Two nodes were added to each of the original Leg segments at their extremeties and 0.06m away along the axis of rotation of the knee.
    • 6. The exoskeleton segments were “frozen” with respect to the leg segments at the Hip joint and Foot-Shank joint by providing zero velocity revolute joints.
    • 7. The Exo-Knee joint was created between the Lower-Exo and Upper-Exo and the Knee joint in the actual Leg was removed to prevent the model from having more degrees of freedom than the constraints in the system.
    • 8. The Exo-Knee joint was driven by a cubic spline interpolation using a function AnyFunInterPol that took the knot points data from a file ‘moment.txt’.
    • 9. The segments were drawn in an easy to see way using the AnyDrawSTL command in AnyBody to replace the segments. The STL (Stereo Lithography) files themselves were made using Pro-E software.
    • 10. The application of the force at the Shank-Foot joint is now decided based on the application to be emulated by the Exo-skeleton.
    • 11. Exoskeleton Application: The exoskeleton is required to provide assistance to the human leg for lifting of a heavy weight and hence the vertical force at the ankle joint is included in the Exo-skeleton model.
    • 12. Rehabilitation/Exercise Application: The exoskeleton in required to emulate the effect of a mass attached to the ankle joint by providing an equivalent moment Hence, the actual force is not required.
    • 13. LEG MODELEXO MODELEXERCISE MODEEXO-SKELETON MODELEGEXO-SKELETONLEGEND FORCES BALANCED BY MUSCLES FORCES BALANCED BY TORQUE FORCES BALANCED BY REACTION REACTION FORCES EXO-MOTOR TORQUESIMILAR NODES INDICATING FIXED JOINTSMLegMLegMExoMExoMMLegMM
    Figure 4 - Forces and Torques in Models
    3.2 MATLAB
    MATLAB is a numerical computing environment and programming language. MATLAB allows easy matrix manipulation, plotting of functions and data, implementation of algorithms, creation of user interfaces, and interfacing with programs in other languages. Although it is numeric only, an optional toolbox uses the MuPAD symbolic engine, allowing access to computer algebra capabilities. An additional package, Simulink, adds graphical multi-domain simulation and Model-Based Design for dynamic and embedded systems.
    3.2.1 Torque profile evaluation and virtual validation using MATLAB
    In our study, MATLAB performed the following steps:
    • Get system parameters like mass attached to the foot, body weight, simulation time etc. from the user.
    • 14. Update AnyBody model files (for both Leg model and Exo-skeleton model) with the new parameters.
    • 15. Find an appropriate torque profile to be applied to the exo-skeleton knee so depending upon the application selected (whether exo-skeleton or exercise mode).
    • 16. Run the AnyBody analysis using ‘AnyBodyCon’ executable.
    • 17. Read the results from the AnyBody output files and display them on screen.
    • 18. Modify the torque profile depending upon the deviation of the muscle forces from the expected muscle forces.
    • 19. Update the muscle profile in the AnyBody Model file.
    • 20. Repeat steps d through g till either the expected muscle profile is achieved or the model diverges and muscle forces exceed admissible muscle forces.
    The main input parameters for the calibration are:
    • Foot Mass: The Mass, in kg, to be attached at the Foot joint to provide a constant force in the downward direction. It is converted to N and written to the y-component of the applied force in the Leg model.
    • 21. Simulation Time: The total time of the movement in seconds. It is written to the ‘tEnd’ parameter in both the models.
    • 22. Body-Weight: It is written to both the models and the weights of the Leg as well as the Exoskeleton are directly proportional to this parameter.
    • 23. Start Angle: The angle, in degrees, at which the Exercise should start.
    • 24. End Angle: The angle, in degrees, at which the Exercise should culminate.
    • 25. Number of Steps: The number of intermediate positions to be considered in inverse dynamic analysis. It is written as the parameter ‘nStep’ in both the models.
    Upon starting a calibration, the approximate muscle profile for the Exercise model is calculated as:
    Mα=-MgL+MExogL2*sinαfor Exercise Mode
    Mα=-MgL+MExogL2+MLeggL2*sinαfor Exo-skeleton Mode
    Where M = Foot Mass (kg)
    L=length of shank segment and also of lower exoskeleton segment
    MLeg = mass of shank segment. Proportional to Body weight
    MExo = mass of lower exo-skeleton segment. Same as shank segment.
    nStep, N
    α = angle that increases from Start Angle to End Angle in ‘nStep’ steps.
    g = acceleration due to gravity
    Next, the model files are written with the appropriate parameters, following which AnyBodyCon executable is called to update the model results with the latest models created with updated parameters.
    Next, the muscle with the highest magnitude of muscle force is selected and the moment profile is corrected as:
    ΔM(i)=penalty*MuscleForce(i)
    Equation 10
    where i goes from 1 to nStep+1
    MuscleForce is the Muscle Force vector for the muscle with maximum magnitude of muscle force
    Penalty = ±0.05 depending on whether the muscle with the maximum magnitude of muscle force works during expansion or contraction.
    This corrected muscle profile is then written to the moment file for the Anyody model and AnyBodyCon is run again.
    The process is repeated till the maximum error is either less than unity (in which case the model has converged) or greater than 1000 (in which case the model has diverged and calibration in unsuccessful using this method). It was observed that convergence was obtained for all ranges of parameters allowable in the GUI.
    Once the calibration is over, the success of the calibration is indicated on a GUI indicator, the muscle profile is plotted on the Muscle Force Graph and the Exo-Knee Moment Profile is plotted on the Torque Graph. Also, a history of the magnitudes of maximum muscle forces during each of the iterations is displayed.
    3.2.2 GUI Implementation in MATLAB
    A GUI was created in MATLAB to simplify the process of parameter changes and result viewing. It was created using the GUIDE (Graphical User Interface Design Environment). The UI controls were placed as shown in Fig .1. User inputs were captured using UI controls and corresponding actions were implemented using UI callbacks.
    The various entities used in this GUI were:
    • Axes: Used to plot graphs (eg. Muscle force graph or Knee Torque graph).
    • 26. Push Button: Used to capture user inputs for performing certain actions (eg. To start calibration).
    • 27. Pop-Up Menu: Used to toggle between a fixed set of available options (eg. Choice of display of muscle forces corresponding to Leg Model, Exoskeleton model or a difference between the two).
    • 28. Check-Box: Used to toggle variables that have only two states (eg. Whether a muscle force is to be plotted on the graph or not).
    • 29. Sliders and Edit Boxes: To capture user input of variables within certain ranges. While the sliders have inbuilt capability of limiting an input, the Edit Boxes had to be explicitly programmed to have this feature. Variables such as the Foot Load, Simulation Time etc. were captured in this way.
    • 30. Static Text: Used solely for displaying information without any input.
    One important function in MATLAB GUI programming is the handles function. GUIDE creates a handles structure that contains the handles of all the objects in the figure. UI Components can be accessed through handles by their ‘Tag’ property. Also GUIDE creates and maintains the handles structure as GUI data. Since ‘handles’ is passed as an input to all callbacks, the data can be easily shared between the callbacks.
    Figure 5 – Main MATLAB-AnBody Interface
    There are two plots in the GUI:
    • Muscle Force Graph: It plots the muscle forces of the Leg Model or Exoskeleton model or the difference of the two as indicated by the Pop-Up menu.
    • 31. Torque Graph: It plots the Torque profile required at the Exoskeleton Knee for the required effect.
    There are two pop-up menus in the GUI:
    • Display Mode: This menu allows the user to select between plotting the muscle forces for the Leg Model, Exoskeleton Model or the difference between the two.
    • 32. Solution Mode: This menu allows the user to select between the exercise mode and the Exoskeleton mode. The exercise mode is programmed equalize the muscle forces in both models while the Exoskeleton mode is programmed to neutralize muscle forces in the exoskeleton model.
    There is a checkbox corresponding to each muscle employed in the model to toggle that muscle’s force display in the Muscle force graph.
    There is a Re-Calibrate Button to initiate the Calibration sequence. It also has a Calibration Status indicator that is green if the previous calibration was successful, yellow if a calibration is underway and red if the previous calibration was unsuccessful.
    Figure 6 – On First Calibration
    The following parameters were set for the initial calibration.
    Foot Load = 5.3kgSimulation Time = 4.3sBody Mass=66.1kgStart Angle = -25。End Angle = 53。Solution Mode = Exercise
    This implies that the Leg is performing an exercise by attaching a load of 5.3kg at the ankle and the stroke is from -25 degrees to 53 degrees(with respect to the vertical position of the lower leg). This exercise is performed in 4.3 seconds and the body mass is 66.1kg.
    The body mass is important since it determines the mass of the leg(which is equal to the mass of the corresponding exo-ekeleton segment) and finally affects the moment needed to neutralize it.
    The left part of the figure shows the forces developed by the various muscles in the leg as the stroke advances. This can be changed to show the muscle forces in the Exo-skeleton model as well as the difference by changing the Display Mode(currently set as Leg Model).
    As can be expected, some of the muscles are active till the leg reaches the vertical position and others kick in once the vertical position is passed. This means that the muscles active in the former part of the stroke are aiding in the ???
    The right part of the figure shows the muscle profile that has to be applied to the motor at the knee joint of the exo-skeleton in order to equate the muscle forces in the Leg model with the downward force and those in the Exo-model without the force applied. This implies that the motor will now emulate the effect of having a mass of 5.3kg tied to the Leg at the ankle without the load being actually applied. This sort of force distribution is because of the selection of Exercise mode as the Solution mode. It can be used to design an Exo-skeleton for rehabilitation purposes.
    The motor torque at the initial point can be calculated as;
    MInitial=MLower*L2-M*L*g*sin-25*pi180= 6.465Nm
    where mass of lower leg=mass of lower exo=
    MLower=0.045*MBody=0.045*66.1=2.9745kg
    Mass hung at ankle, M=5.3kg
    length of lower leg=length of lower exo=L=.409m
    Final point motor torque is
    MFinal=MLower*L2-M*L*g*sin53*pi180= -12.2174Nm
    As we can see, the actual motor torque values are in close accordance with the expected values.
    Figure 7 – Viewing Force Difference
    Figure 7 showcases the same calibration as in Figure 6 but now plots the difference of the muscle forces felt in both the models. As can be seen, the differences in muscle forces are reduced to almost zero. This implies that the calibration was successful in emulating the effect of an actual exercise using an exoskeleton.
    Figure 8 – On change to Exo-skeleton Mode
    Now we change the solution mode to exoskeleton mode. In this case, we actually apply a load equal to the Foot Load at the Ankle of the Leg and calibrate so as to reduce the muscle forces of the Leg in the Exo-model to a miminum. As can be seen, the muscle forces of the Exo-model are reduced to an exact zero. This implies that the calibration was perfect in nullifying the external forces and moments to make the movement ‘effortless’.
    Calculating the moments as earlier,
    MInitial=MLower*L2+MLower*L2+M*L*g*sin-25*pi180= -14.03Nm
    MFinal=MLower*L2+MLower*L2+M*L*g*sin53*pi180= 26.514Nm
    The extra term in this case corresponds to the weight of the Lower Leg that now needs to be compensated for too, since the muscles need to be ‘effortless’. Also, the sign of the M*L term has changed because the motor now needs to neutralize an existing force of M*g rather than emulating it when it does not exist.
    Again, the actual moment profile is a close match to the expected one.
    This type of calibration can now be used to design an exo-skeleton for the Leg.
    Figure 9- On Animation of Exo-skeleton
    Figure 10 - On Animation of Leg
    Figures 9 and 10 are a depiction of the actual stroke made by the leg. This animation is triggered by hitting the ‘Animation’ Button in the top right corner of the GUI. Since the Display mode is Exo-model, the exo-skeleton model is displayed while carrying out the stroke. It is programmed to extract the relevant frames from an AVI file that has frames for angles ranging from -40 degrees to 90 degrees (the whole allowable range of angles). The frames are then played at such a speed so as to make the stroke time equal to the Simulation Time.
    Figure 11 – Final Muscle Force Profile during Calibration
    Figure 13 shows the Muscle Force differences after the calibration is over. Since there weren’t any significant muscle force differences to begin with, the change in the torque profile is not substantial. This implies that our initial approximation was quite accurate. However, since the maximum value of the differences has gone to less the 0.02N, we can say that the calibration was successful.
    Figure 12 - Viewing important muscle forces on Interface
    In order to display the model muscle wise, we can deselect the unimportant muscles in the central area of the GUI and display only the ones that are important. However, this option does not remove the deselected muscles from the actual models.
    Figure 13 - Iteration and max-error history after calibration with approximate profile
    Figure 14 - Iteration and max-error history after calibration with exact profile
    Figure 13 shows the muscle force magnitude as it decreases from the initial value of about 9N to a final value of about 0.9N. As can be seen, there is a really good convergence obtained by the method employed. However, as seen in Figure 14, by applying a correctly calculated Torque Profile in the first go, we can have an acceptable answer without any iterative procedures. Muscle force magnitude is calculated as the maximum magnitude of the difference in the muscle force exhibited by any muscle in the model. Different muscles have the maximum magnitude during different iterations. Hence, the program considers the muscle with the maximum muscle force magnitude while applying corrections to the Muscle Force Profile (Eqn 10).
    Sensitivity Analyses
    In this section, we try to ascertain how changes in various parameters affect the muscle forces. We start with a typical set of parameters as:
    Foot Load = 7kg.Body Mass = 75kg.Start Angle = -40◦End Angle = 90◦Simulation Time = 6.5sNumber of Steps = 65Mode = Exercise Mode
    Equation 11 – Typical Parameters for sensitivity analyses
    We then change the parameters one by one and observe changes in the Vasti Muscle. This procedure is intended to provide a better understanding of the system and also validate the formulation.
    Foot Load
    When we change the foot load from 0 through 10kg, it has a substantial effect on the muscle forces. This is expected since the main contributing term in the equation.
    Figure 15 - Foot Load Sensitivity
    Body Mass
    Next, we try to change the Body mass from 50 through 100kg. As expected, the change in muscle forces is not significant. This is helpful in the sense that the same calibration can be used for people with a variety of body masses without enduring a considerable downfall in performance.
    Figure 16 - Body Mass Sensitivity
    Start Angle
    Next, we try to change the starting angle and compare the muscle forces at an angular position for different start angles. It has no effect on the muscle forces. We can infer that the starting condition of the exo-skeleton is immaterial although the zero reference needs to be correct.
    Figure 17 - Start Angle Sensitivity
    Simulation Time
    Finally, we try to vary the simulation time to see if longer durations of a stroke can increase muscle forces. As expected, the muscle forces at an angular position are constant for a variety of stroke times (or Simulation Times).
    Figure 18 - Simulation Time Sensitivity
    Conclusion
    A brief study was made on the muscle forces developed in the human leg by creating a simplified model of the leg and analyzing it using AnyBody. The effect of an exo-skeleton on the muscle forces in the leg was also studied by providing the appropriate segments and torques. Two different applications, the exercise mode for rehabilitation and the Exo-skeleton mode for actual exo-skeleton design, were successfully studied and developed. Then, using MATLAB, the analysis process was automated by writing AnyBody files with desired parameters and analyzing them externally (without AnyBody) using AnyBodyCon. A program was developed for converging to the required torque profile using penalty function. Finally, a MATLAB GUI was developed to automate the entire design process and also for ease of access of data.
    The results obtained were found to be quite satisfactory for this simple model.
    Future Scope
    Similar models may be developed for other parts of the body. The starting point could be the Hand model since it closely correlates to the Leg as far as joints are concerned. Also, the simulation may be made more realistic by applying real-time movement data to the knee-joint in the Leg model by using Motion-capture for a full range of parameters.
    Another approach may involve the use of fmincon function in MATLAB to optimize the muscle force profile for higher end models, whose direct analysis and approximation could be more complex than in this simple example.
    The final part could be the similar analysis of a full scale exo-skeleton model in the exo-skeleton mode and automation of the process similar to this case.
    To provide reasonably accurate data for driving the Leg model in AnyBody, an actual exercise can be done with the simulated conditions and the motion of the leg captured using Motion Capture System. For example, a SIMI motion capture system can be used with three cameras for this purpose.
    References
    1) “CONVERSION OF POINT CLOUD DATA INTO 3-D MODELS”, Karthikeyan Senthilnathan & Chen Lin, Independent Study Report, Mechanical and Aerospace Engineering, SUNY Buffalo.
    2) AnyBody Reference Manual, AnyBody Technology – www.anybodytech.com
    3) “ANALYSIS OF PARALLEL MANIPULATOR ARCHITECTURES FOR USE IN MASTICATORY MOTION CASE STUDIES”, Madusudanan Sathia Narayanan, M.S. Thesis, Mechanical and Aerospace Engineering, SUNY Buffalo
    4) “MUSCULOSKELETAL MODELING OF SMILODON FATALIS FOR VIRTUAL FUNCTIONAL PERFORMANCE TESTING”, Kiran S Konakanchi, M.S. Project Report, Mechanical and Aerospace Engineering, SUNY Buffalo
    5) http://en.wikipedia.org/wiki/Interpolation
    6) http://en.wikipedia.org/wiki/Spline_(mathematics)
    7) http://tech.groups.yahoo.com/group/anyscript/ - AnyScript Support Group