Benutzer-Werkzeuge

Webseiten-Werkzeuge


abschlussarbeiten:msc:filipcengic:chap05

5 Experimental Simulation

LabView offers different script blocks. Due to debugging reasons, formula node scripts are used. All input/output ports hold standard symbol names in order to make it easy to follow the execution structure. The advantage is that the code is manageable and easier for correcting errors.

Within this section, the previously described (chapter 4 Modelling) continuous motion equation formulas are implemented into a single coding block. The coding block can be subdivided into following main sections:

  1. Predefinition of motion equational constants
  2. Enabling haptics
  3. Integrator
  4. Touchdown Calculation
  5. Leg – Spring Force Computation
  6. 𝑆-𝑅 Flip-Flop module as a trigger

Within the next subchapters, the main coding sections (1-5) will be described into detail.



5.1. Calibration of the Haptic Device Robot

Before recording experimental trials from the haptic device system to the target PC, the robotic assessment tool needs to be calibrated properly. Thanks to the simple, intuitive handling of the software implemented in LabView, calibration is done by a single click.

More information on the topic of calibrating the Hi5 haptic device can be found in recent readings of Imperial College (2017).



Initial Value Set

In accordance with the modelling section 5.1 (Main Variables), following variables are necessary for the simulation (Table 3). Variable names shown in Table 3 are similar to the names set in the LabView implementation script. A sample time of 1 5 millisecond (𝑑𝑡 = 0.0002) is regarded as sufficiently precise for the simulation. For computational reasons, instead of arrays and vectors, scalars are used.

Table 3: Initial values for the simulation model



It might be confusing, that the unit [𝑚] stands for meter, instead the symbol „𝑚” stands for the point mass. Please consider this, while continuing to read.

5.3. Predefined Constants

As already described in the modelling section (chapter 4), certain initial values need to be predefined before simulation starts (Table 3). These initial conditions are set as global variables within the simulation environment and are accessible in real-time during the simulation.


Figure 10: Declared constants at the beginning of the script



As it can be seen in Fig. 10, all constant variables, which are not input parameters, need to be declared before the LabView node script is executed. Since the mass 𝑚 (Fig. 10, line 2) is globally defined (i.e. global variable), there is no declaration. The declaration type float means floating point number. Almost all variables within the upper code are of this type, beside the leg rest length parameter 𝐿0, which can be an integer (abbr. int) as well. Therefore, the value 1 has been chosen (4.1 Main Variables).

5.4. Enabling Haptics

Since the current position of the calibrated haptic device robot (section 5.1 Calibration of the haptic device robot) is fed as an input parameter to the main formula node system block, a switch determines the experimental mode. Concerning the SLIP model approach, the following two experimental modes (1, 2) have been introduced:

  1. External force application to the CoM
  2. Changing the spring stiffness 𝑘

By using a case structure at upper hierarchical level of the software implementation (parental code), the two parameters 𝑒𝑛𝑎𝑏𝑙𝑒𝐾 and 𝑒𝑛𝑎𝑏𝑙𝑒𝐹_𝑒𝑥𝑡 are set to the values 0 or 1. In case that first and third if-statements down below are true (Fig. 11; lines 1, 3, 5), no experimental mode is selected, which means that the SLIP model runs without external manipulation changes via haptic device control.

Figure 11: Haptic switch for force application / spring stiffness manipulation



Basically, the two parameters 𝑑𝑒𝑙𝑡𝑎𝐾 and 𝐹_𝑒𝑥𝑡 are proportional to the recorded position of the robotic assessment handle. Due to the widely changing numbers for the spring stiffness (22.500 ±), the variable 𝑑𝑒𝑙𝑡𝑎𝐾 needs a scaling factor of 1000 is needed (Fig. 13, line 4). Otherwise the external manipulation via the influence of haptic control design would be unremarkably small. Incrementing and decrementing the leg spring stiffness 𝑘 by values of 1000 𝑁/𝑚 leads to major influences with respect to the running pattern of the SLIP model.



5.5. Integrator

The integrator forms the core of each iteration step within the LabView model and it is used to calculate the current position (𝑥, 𝑦) and velocity (𝑣𝑥, 𝑣𝑦). Both, the starting speed and the starting position, as well as the gravitational acceleration 𝑔 are required as input parameters. These input parameters are used for the initial calculation and all subsequent integrations, respectively.

Technically it is sufficient to use five lines of code, in order to estimate the approximated velocities and positions numerically. As there is no horizontal force, resp. acceleration, acting against the CoM, the second line of code doesn’t need to be considered any further. In contrast, there is the gravitational acceleration 𝑔 acting permanently on the point mass. Hence, gravitation must be subtracted from the current point mass acceleration (Fig. 12, line 3). Taking the difference in acceleration (𝑎_𝑑𝑖𝑓𝑓1, 𝑎_𝑑𝑖𝑓𝑓2) and multiplying it with the sample rate 𝑑𝑡 during each iteration step, velocity can be calculated. Within the lines 8-9 (for CoM velocity) and 10-11 (for CoM position), the numerical Euler integration approach is used (double integration). Globally defined variables (5.2 Initial Value Set) are used as input/output port values.

Figure 12: SLIP System Integrator



Within the lines 5-6 the current leg axis angle 𝛼 is calculated, which is the angle between the leg axis and the ground line. In order to calculate the angle 𝛼, LabView-intern function atan2 is used, which is the arctangent function with two arguments (SIM1).


$$ 𝑎𝑙𝑝h𝑎 = 𝑎𝑡𝑎𝑛2( 𝑦, ( 𝑎𝑏𝑠(𝑡𝑑_𝑝𝑜𝑠𝑥 - 𝑥)) ) \ \ \ \ \ (SIM1) $$


As first argument, the position 𝑦 of the CoM is needed. The second argument is the absolute value of the difference between the cumulated touchdown 𝑥-coordinate (𝑡𝑑_𝑝𝑜𝑠𝑥) and the current point mass 𝑥-position. According to the laws of trigonometry, the difference (𝑡𝑑_𝑝𝑜𝑠𝑥 – 𝑥) decreases within each iteration step, while the current angle 𝑎𝑙𝑝h𝑎 increases.

In line 4, the current leg length 𝑐𝑢𝑟𝑟_𝑙𝑒𝑛𝑔𝑡h is compared to the leg rest length 𝐿0. If the current length is smaller, this means that the virtual representation of the human leg gets compressed while descending, i.e. the SLIP running model is in stance phase. The following two lines 5-6 are embraced by the if-clause, updating the point mass acceleration values in 𝑥- and 𝑦-direction with respect to the first experimental mode (5.4 Enabling Haptics). The first mode deals with haptic device interaction by applying an external force 𝐹_𝑒𝑥𝑡 to the SLIP system.

In order that the integrator is able to calculate the velocity and position values for each iteration step, it needs to be defined, when a step is completed and when a new iteration begins. For this purpose, the landing heights must be calculated (chapter 5.6 Touchdown Calculation).


5.6. Touchdown Calculation

Since the integration part (5.5 Integrator) of the formula node block is responsible for the position calculation of the point mass, further calculations need to be made in order to compute the landing heights of the point mass or the touchdown position of the foot.

The position of the foot 𝑡𝑑_𝑝𝑜𝑠𝑥 is required when computing locomotion dynamics during ground contact phase (i.e. stance phase) as well as for the generation of spring force (5.8 Spring Force). As described in section 4.3 (Touchdown calculation), at the beginning of the touchdown calculation, the CoM landing heights need to be determined (Fig. 13, line 1-2). For estimating landing height, the inclination angle α of the foot between the functional leg axis and the ground line, as well as the initial spring length ($L_0$) are needed as input parameters. These two parameters are predefined as initial conditions (chapter 5.2 Initial Value Set) and assumed to be constant for each touchdown. The first line in the code (Fig. 13, line 1) specifies the local 𝑥-coordinate of the virtual representation of the human foot. In order to estimate the landing height, trigonometric functions are used. Since the result is a multiplication of constants ($𝐿_0$,$\alpha_0$), the main result is constant as well. In every iteration loop, the difference ($𝑦_{diff}$) between the current height of the point mass and its initial height at the beginning of each touchdown, is calculated (line 3). This value is compared to the calculated value of the previous iteration. If the difference is negative, the system knows, that the SLIP is falling. In line 6, a redundant check by the S-R Flip-Flop is processed to see, whether the model is still running properly.

Figure 13: Calculation of the foot position during stance phase



If there is a transitional touchdown event within an iteration loop, the global values for the foot 𝑥-/𝑦-coordinates get updated.

5.7. Spring Force Computation

Certain values, such as the CoM position and velocity can be derived from the leg function. The mechanical function of the involved biological elements in the human leg (bones, muscles, tendons, connective tissue, sensory-motor system, etc.) can be represented by a spring, which is acting across the leg axis (Fig. 14). According to Newton’s 3rd law, the respective ground reaction force ($F_{GROUND}$, big red arrow) is equivalent to the force exerted by the leg muscles. In contrast to the ground reaction force, which applies during stance phase, the gravitational force ($𝐹_G$) permanently acts on the point mass. As mentioned in the previous section 5.6 (Touchdown Calculation), the ground reaction force ($F_{GROUND}$) is subdivided into a horizontal (𝑥-direction) and a vertical (𝑦-direction) partial force. By adding these two force vectors, the resultant force $𝐹_G$ can be estimated. Modifying the resultant force 𝐹_\7ê^5 can be treated as if applying an external force to the point mass (experimental mode 1), with the exception that the externally applied force 𝐹zRë acts in positive 𝑥-direction, i.e. in the direction of running. Both, $𝐹_{GROUND}$ and $𝐹_{ext}$ can be subdivided into a horizontal and a vertical component.

Figure 14: Ground Reaction Force (GRF) and Gravitation



In order to calculate the produced spring force generated through ground reaction, certain trigger variables (e.g. 𝑆-value in Fig. 15, line 10) need to be activated. For the calculation of the current leg length 𝐿 the horizontal distance in 𝑥-direction of locomotion between the CoM and the touchdown position is needed (line 1). Since the value 𝑡𝑑_𝑝𝑜𝑠𝑦 holds the value 0 during stance phase, the point mass height can be described by the 𝑦- value of the CoM (line 2). According to Pythagorean theorem (chapter 4.2, ME6), the SLIP representation of the human leg (hypotenuse) forms a triangle with the ground line and the virtual orthogonal line connected to the CoM. The Euclidean distance of the two cathetes is squared, summed up and afterwards the square root is taken (Fig. 15, line 3).

As part of this thesis, experimental trials are based on the human-in-the-loop (HITL) approach. Therefore, the stiffness factor 𝑘 might change during the real-time simulation, depending on the position scalar 𝑑𝑒𝑙𝑡𝑎𝐾 fed into the system controller (DAQ). The vector values are controlled by the robotic assessment handle (line 4). This tool can be regarded as a joystick, which is able to apply external forces or change the spring stiffness value in real-time, respectively.

[ Figure 15: Estimating leg (de-/)compression phase]


After the spring stiffness factor 𝑘 gets updated, the de-/compression state of the virtual leg is determined. Further information and descriptions about running phases during a locomotion cycle is provided in Fig. 2.

Regarding line 5 (Fig. 15), the variable 𝑑𝑖𝑓𝑓_𝑘 is declared and assigned to a certain value. If the variable 𝑑𝑖𝑓𝑓_𝑘 becomes negative, the current leg length (𝑐𝑢𝑟𝑟_𝑙𝑒𝑛𝑔𝑡h) is greater than 1 𝑚 (= leg rest length 𝐿0). In line 6 of Fig. 15, the 𝑆-value of the 𝑆-𝑅 Flip-Flop module is set to 0. The 𝑆-value only turns to 1, if a take-off is estimated. Whether there is a take-off is checked in the following if-clause (lines 7-11). The previously declared and assigned 𝑑𝑖𝑓𝑓_𝑘 variable (line 5) is compared to value 0. If the current variable value is equal or less than 0, and the value – set one iteration step before – was equal or greater than 0, the 𝑆-variable switches to 1. This happens once within each running cycle. The last three lines serve to check, whether the SLIP running model is in flight phase (𝑑𝑖𝑓𝑓_𝑘 < 0). During this phase, the 𝑑𝑖𝑓𝑓_𝑘 value is set to 0, because the current leg length 𝐿 cannot exceed the leg rest length 𝐿0.

In order to calculate the resulting spring force (𝑓_𝑠𝑝𝑟𝑖𝑛𝑔𝑥, 𝑓_𝑠𝑝𝑟𝑖𝑛𝑔𝑦) and the acceleration, the values 𝑑𝑖𝑓𝑓_𝑘 (defined in line 5, Fig. 15) and 𝑑𝑖𝑓𝑓𝑥/𝑑𝑖𝑓𝑓𝑦 (defined in line 1-2, Fig. 15) are multiplied (SIM2-3). The acceleration (𝑎𝑥, 𝑎𝑦) of the point mass can be retrieved by dividing the spring force (𝑥- and 𝑦-component) by the constant mass 𝑚, which is set to 80 𝑘𝑔. This value doesn’t change during the simulation (SIM4-5).

$$ 𝑓𝑙𝑜𝑎𝑡 𝑓_𝑠𝑝𝑟𝑖𝑛𝑔𝑥 = 𝑑𝑖𝑓𝑓_𝑘 ∗ 𝑑𝑖𝑓𝑓𝑥; \ \ \ \ \ (SIM2) $$
$$ 𝑓𝑙𝑜𝑎𝑡 𝑓_𝑠𝑝𝑟𝑖𝑛𝑔𝑦 = 𝑑𝑖𝑓𝑓_𝑘 ∗ 𝑑𝑖𝑓𝑓𝑦; \ \ \ \ \ (SIM3) $$

$$ 𝑓𝑙𝑜𝑎𝑡𝑎𝑥 = 𝑓_𝑠𝑝𝑟𝑖𝑛𝑔𝑥/𝑚; \ \ \ \ \ (SIM4) $$
$$ 𝑓𝑙𝑜𝑎𝑡𝑎𝑦 = 𝑓_𝑠𝑝𝑟𝑖𝑛𝑔𝑦/𝑚; \ \ \ \ \ (SIM5) $$

At the end of each simulation step, the acceleration values (𝑎𝑥, 𝑎𝑦) are fed as new input parameters to the next iteration. This process keeps on continuing until the simulation terminates. The simulation terminates either manually, or if the SLIP running model gets unstable and falls down to the ground line. More information about termination conditions can be found in chapter 4.4 (Termination Conditions).


5.8. S-R Flip-Flop Module

For triggering transitional events, such as the determination of a touchdown (of the SLIP running model) or take-off, respectively, a S-R Flip-Flop module has been implemented. Generally, S-R Flip-Flip modules are used in many sequential logic circuits. Two inter- connected logic gates form the basics of this circuit, whose output has two states. When the circuit is triggered into either one of these states by a suitable input pulse, it will save that state until it is changed by a further input pulse, or until power is removed.

Figure 16: S-R Flip-Flop module for transitional event triggering



With respect to Fig. 16, the described 𝑆-𝑅 Flip-Flop module has been implemented by using a fourfold if-clause. First and last case are redundant and appear for the sake of completeness within the if-clause. The parameters 𝑆 and 𝑅 are trigger variables, one for the estimation of the take-off (𝑆) and another for determination of the touchdown transitional event (𝑅). Generally, before processing the 𝑆-𝑅 Flip-Flop module block, the variable 𝑎𝑙𝑙𝑜𝑤_𝑡𝑑𝐿𝑎𝑠𝑡 should be reset to value 0 (𝑎𝑙𝑙𝑜𝑤_𝑡𝑑𝐿𝑎𝑠𝑡 = 0). Consecutively, the main coding part is in lines 5-6 (Fig. 16), where a take-off has been estimated and the variable value of 𝑎𝑙𝑙𝑜𝑤_𝑡𝑑𝐿𝑎𝑠𝑡 switches from 0 to 1.

Since the Flip-Flop coding block is usually designed to save variable states, the variable value of 𝑎𝑙𝑙𝑜𝑤_𝑡𝑑𝐿𝑎𝑠𝑡 is fed as input parameter to the variable 𝑎𝑙𝑙𝑜𝑤_𝑡𝑑 of the upcoming iteration step. In this case, the previously computed value (in one iteration step before) of 𝑎𝑙𝑙𝑜𝑤_𝑡𝑑 is used. Logically, the 𝑆-𝑅 Flip-Flop module aims to switch values for the variable 𝑎𝑙𝑙𝑜𝑤_𝑡𝑑 from 0 to 1 and vice versa. Setting 𝑎𝑙𝑙𝑜𝑤_𝑡𝑑 = 1 occurs one iteration after a take-off has been determined by the SLIP running system. This value is kept at 1, until a touchdown is estimated. There is again a delay of 1 iteration, because the 𝑆-𝑅 Flip- Flop module block only computes previously calculated variables.


indexmenu_n_50

abschlussarbeiten/msc/filipcengic/chap05.txt · Zuletzt geändert: 28.11.2022 00:58 von 127.0.0.1


Warning: Undefined variable $orig_id in /is/htdocs/wp1019470_OPI92FFHXV/www/wikiLehre/lib/plugins/openas/action.php on line 232