# Odometry and Robot Hub

A project log for Mini Cube Robot

A small 5x5cm Cube Robot with differential two wheel drive. Modular design with a simple and cheap base.

NotBlackMagic 03/11/2022 at 09:240 Comments

After implementing the motor drive controller it was time to implement movement feedback of the robot, calculating its position and rotation based on wheel rotations, this is, the odometry of the robot. Because this is a differential drive robot it is over constrained, it can only move in two axis: forward translation and the yaw rotation. The forward movement speed is simply calculated by the average wheel speeds, in mm/s:

And the rotation rate, in rad/s, is calculated with the following formula, where Spacing is the distance between the two wheels in mm:

Now these values are in the robots local reference frame and have to be converted into a global reference frame that is stationary. With the robot moving on the same plane (XY plane) as the global reference frame, the yaw rotation is the same in both and only the forward translation must be converted into its X and Y translation in the global frame:

Both the yaw rotation speed and X and Y translation speed must be integrated over time to get the actual position and rotation of the robot. These values are then sent to the PC where they are used to update the robots position and to draw its movement path:

The above image is from the Robot Hub that is also being developed, using the Unity game engine and  is also available on GitHub:

https://github.com/NotBlackMagic/MiniCubeRobot-Hub

Also, the newly developed prototype board for the Mini Cube Robot has arrived and it looks and fits very well on the robot:

Together with the prototype board, a test module for the VL53L5CX LiDAR sensor from STM was also ordered. This small and "cheap" LiDAR sensor can output a 8x8 range matrix with range of up to 400cm. Looks very interesting to use as a simple range finder and/or LiDAR for the Mini Cube Robot! Already working on testing it, with progress being published to Twitter.

The updated firmware with the odometry is available on GitHub and some more information odometry and the reference frames are as always available on the website.