# Development and Validation of a System for Game Control Based on a Force Plate
## 3 Mathematical Model of the System
### System Calibration and Game Control
\right]^{H}\textbf{CoP}, \tag{10}\]  
where the following are true:  
* \({}^{G}x_{CoP}\) is the player's CoP position in the local frame {G} along the \(x\) axis in the \([-100,100]\) range;
* \({}^{G}y_{CoP}\) is the player's CoP position in the local frame {G} along the \(y\) axis in the \([-100,100]\) range;
* \({}^{G}x_{NoP}\) is the factor of the player's CoP position transformation along the \(x\) axis from the local frame {H} into the \([-100,100]\) range of the local frame {G};
* \({}^{G}x_{CoP}\) and \({}^{G}y_{CoP}\) are limited within the \([-100,100]\) range. Based on all this, the linear transformation factor \(\alpha_{x}\) is calculated as follows: \[\alpha_{x}=\frac{100}{\min(\max(-^{H}x_{CoP}),\max(^{H}x_{CoP}))}\] (11) The linear transformation factor \(\alpha_{y}\) is calculated as follows: \[\alpha_{y}=\frac{100}{\min(\max(-^{H}y_{CoP}),\max(^{H}y_{CoP}))}\] (12)  
Figure 5: Searching for the work plane on the force plate and scaling the work plane into the local frame {G}. The denominators in Equations (11) and (12) are the smallest maximum distances of the player's CoP position along the positive and negative \(x\) and \(y\) axes. After finishing the second step of the calibration process, the changes in the player's CoP are scaled into the \([-100,100]\) range along the \(x\) and \(y\) axes. If there is a need to scale the player's CoP position into a different range (such as a range defined by the screen resolution), then Equation (10) can be transformed into a new local frame via a linear transformation. In the third step of the calibration (Step 3 in Figure 4), the player performs impulse half squats on the force plate during 20 s. For each detected half squat, a maximum of the acceleration function of the player's CoM along the \(z\) axis is determined. The acceleration function is calculated from Equation (7) by dividing the whole equation by \(m_{H}\). The result of the third calibration step is a number of local maximums of the CoM acceleration function along the \(z\) axis, with which we can determine the threshold for pressing the SPACE key or clicking the left mouse button. Having completed the described calibration procedure for the game control system, as shown in Figure 4, the next step is defining the conditions under which the pressing of keyboard keys or moving the mouse cursor would be simulated for the purpose of game control. The system is set up in such a way to simulate pressing the UP, DOWN, RIGHT, LEFT, and SPACE keys or to move the mouse cursor and click the left mouse button. Table 1 shows the conditions under which pressing the defined keyboard keys is performed. The individual buttons will be pressed if the player's CoP in the local frame [G] is greater (or rather lower) than the defined threshold along the positive or negative \(x\) and \(y\) axis. Table 1 defines the following thresholds:  
* \(y_{TH}\): the threshold for pressing the UP and DOWN keys;
* \(x_{TH}\): the threshold for pressing the RIGHT and LEFT keys;
* \(a_{TH}\): the threshold for pressing the SPACE key. For example, if the player's CoP position along the \(y\) axis in the local frame [G]\({}^{G}y_{CoP}\) is greater than \(y_{TH}\), then the system will simulate pressing the UP key, and if it is lower, then it will stimulate releasing the UP key. The same \(y_{TH}\) threshold is used for the DOWN key but with a negative sign (minus). The \(x_{TH}\) and \(y_{TH}\) thresholds in Table 1 can be defined empirically through conducted experiments. The \(a_{TH}\) threshold can be defined, as mentioned, by measuring the local maximums of the function of CoM acceleration along the \(z\) axis. The criterion for defining the \(a_{TH}\) threshold can be a mean or median value of all the measured maximums of the function of CoM acceleration along the \(z\) axis.