This page describes the position control of the robot. The content in this page is the same with the appendix of our CHI’24 paper.
The robot receives the subgoal (target) position from the host computer via RF communication and moves to follow it. It is desirable for the robot to follow a smooth path to the subgoal position. In controlling wheeled robots, using a Bézier, spline, or cross-oid curve as the path is common. This curve passes through the current and subgoal positions to avoid sudden changes in angular velocity. However, due to the limited computational resources of the robot's microcontroller, it has been difficult to implement control that sequentially calculates and follows these curves. On the other hand, since the robot can get its absolute position information with the projection-based method, and the subgoal position is updated by the host computer every 100 ms, the distance between the current position and the subgoal position is considered to be close, and we thought that sudden changes in angular velocity would be rare even on a path connecting these two points by a straight line. Thus, we implemented a control model that follows the straight path.
Fig. 4-1 Concept of robot control model for following goal position.
The concept of the control model is shown in Fig. 4-1. Let $P_0 (x_0, y_0)$ be the robot's initial position at time $t = 0$ given the subgoal (target) position and $P_G (x_G, y_G)$ the subgoal position. Next, define $\overrightarrow{P_0 P_G}$ as the vector connecting points $P_0$ and $P_G$, with $L$ ($L = L_0$ at $t = 0$) as the distance between them, and $\theta$ ($\theta=\theta_0$ at $t = 0$) as the angle between the robot's direction of motion and the vector $\overrightarrow{P_0 P_G}$. (Counterclockwise is defined as positive.) In this case, the following law controls the velocities $V_l$ and $V_r$ of the robot's left and right motors.
$$ V_l = V - \Delta V\\ V_r = V + \Delta V\\ V = K_L L\\ \Delta V = K_\theta \theta + K_{\dot{\theta}} \dot{\theta}, $$
where $K_L, K_\theta, K_{\dot{\theta}}$ are constants that represent the control gain. Based on the above control law, $\overrightarrow{P_0 P_G}$, the distance $L_n$, and the angle $\theta_n$ are updated from the robot's current position $P_n (x_n, y_n)$ to the subgoal position, and $V_l$ and $V_r$ are calculated and output. However, if this control law is followed, the point $P_G$ is theoretically unreachable and will never fully converge, since $L = 0$ and the velocity will converge to 0 as the robot approaches $P_G$. Therefore, the robot is judged to have converged when it is within a certain distance $\sigma$ from $P_G$, and the robot stops at that point. In addition, the minimum velocities $V_{l,min}$ and $V_{r,min}$ are set for $V_l$ and $V_r$, respectively. The maximum speed of motors $V_{max}$ is determined by the maximum speed value of the slower of the two motors. This is based on the actual measured speeds of the left and right motors as an upper limit. This can be written in the formula as follows:
$$ \begin{equation*} V_l = \begin{cases} V_{l,min} & \text{if $V_l < V_{l,min}$}\\ V_{max} & \text{if $V_l > V_{max}$}\\ V_l & \text{otherwise.} \end{cases} , V_r = \begin{cases} V_{r,min} & \text{if $V_r < V_{r,min}$}\\ V_{max} & \text{if $V_r > V_{max}$}\\ V_r & \text{otherwise.} \end{cases} , V_{max} = \begin{cases} V_{l,max} & \text{if $V_{r,max} \geq V_{l,max}$}\\ V_{r,max} & \text{if $V_{r,max} < V_{l,max}$} \end{cases} , \end{equation*} $$
where $V_{l,max}$ and $V_{r,max}$ are the maximum speed value of left and right motors.
If a new subgoal position $P_G$ is given before convergence, $P_G$ is updated, and the subgoal following continues. Here, the dimension (unit) of the calculated $V_l$ and $V_r$ is [mm/s], but the dimension of the PWM duty of the voltage value, which is a control value that can be input to the motor, is [rpm]. Therefore, the calculated $V_l$ and $V_r$ are converted to the PWM duty value by the following formula:
$$ \begin{equation*} \begin{split} Duty_l &= f( V_l )\\ Duty_r &= g( V_r ), \end{split} \end{equation*} $$
where $Duty_l$ and $Duty_r$ are the PWM values of left and right motors, and $f(x)$ and $g(x)$ are functions corresponding to the PWM value calculated by the robot's calibration mode. We confirmed that this control rule can be used to control the robot to successfully reach the goal position even with a microcontroller with limited computational resources.