Skip to content

Governing Equations

jacobkingery edited this page Dec 18, 2015 · 5 revisions

FINAL SYSTEM

VIDEO: MATHEMATICAL SIMULATION

VIDEO: GAZEBO SIMULATION

PROCESS

After choosing this project and beginning to work on it, we came across a very useful paper by Lorenzo Sabattini, Cristian Secchi, and Cesare Fantuzzi titled Arbitrarily shaped formations of mobile robots: artificial potential fields and coordinate transformation. In this paper, they did exactly what our project was aiming to do: make robots form polygons. So instead of reinventing the wheel, we decided to investigate and use the algorithm described in the paper. The general concept is that the robots are attracted to a centroid, but repelled by other robots. When these forces are balanced, the robots will be arranged in a polygon formation.

The equation for the acceleration of robot i is given by the following equation:

acceleration equation

xi is the position of robot i in the xy-plane, n is the number of robots, and kb is a tunable constant.

The fci term is the attractive force between the centroid and robot i and is defined as the following:

robot-centroid force

dci is the distance between robot i and the centroid, R is the set radius of the formation, and kc is a tunable constant.

The summation term is all of the repulsive forces between robot i and each other robot. faij is defined as the following:

robot-robot force

robot spacing

dij is the distance between robot i and robot j and ka is a tunable constant.

With the help of Paul, we were able to distill these down into equations for the x and y components of acceleration for each robot. To verify that this worked, we created a mathematical simulation and visualized the results using matplotlib (see image below).

mathematical simulation

Unfortunately, there are some assumptions made in these equations that do not hold true for our real-world system. Most notably is that the equations assume that the robots can translate freely in the xy-plane, but this is not the case for the differential drive Neatos.

In order to move the Neatos, we needed to set a linear velocity and an angular velocity. First, we use the calculated acceleration to update the previous net velocity using the time between calculations as the timestep. We set a maximum velocity of 0.1 m/s for the x and y components of the net velocity to prevent the Neatos from driving too quickly. Then, we convert the net velocity into linear and angular velocities by setting the linear velocity proportional (k=1) to the component of the net velocity that is aligned with the robot’s orientation and the angular velocity proportional (k=1) to the component of the net velocity that is perpendicular to the robot’s orientation (see image below).

forward force

Additionally, to prevent the Neatos from driving backwards (a potential hazard to the delicate USB port), we detect when the net velocity points behind the robot, set the linear velocity to 0, and increase the angular velocity to get the robot turned around (see image below).

backward force