Notes to document my thoughts along the project - sentry5588/two_wheeler GitHub Wiki

2020 12 10

I found out that using RPI 4B to drive the motor directly is not easy. It involves setting run permissions for ROS executable. The hardware PWM channels on RPI also have limitations. It can only apply one base frequency to both GPIO 12, 13, 18, and 19. In order to have a smooth steering, it's necessary to set different frequencies for left and right wheels. Therefore I'll use AD9833 to driver the A4988 motor driver modules. I'll update the motor drive performance in 2 or 3 months after the parts' arrival.

2020 12 08

I've created a ROS package to read MPU6050 data. I've calibrated the sensor for mounting bias. I've also created a complementary filter for the pitch angle.

Complementary Filter for Pitch Angle Estimation

2020 12 04

After mounting the power supply, I've completed the robot build.

2020 01 04

It's been a while. No, I have not give up yet.

Managing lots of applications and functions in Arduino has been a headache. I decided to switch from implementing everything myself on Arduino to ROS on Raspberry Pi. The new setup can save my time on: logging data (use rosbag); wireless communication (either wifi bluetooth) without using HC-05.

2019 07 23

I am about the put things together into the robot frame, I realized there is too many stuff. They hardly fit in.

2019 04 10

MPU6050 Gyroscope calibration

The first method to estimate the robot position is to use the MPU6050 gyro reading only. It's noticed that when the sensor is not moving (on the table), the angular position keeps accumulating. This is due to the gyro reading (angular velocity) is not at 0. It needs calibration.

Calibration Method: Put the MPU6050 gyro on the table (where it's not moving). Record gyro readings in x, y, and z directions for the amount of time (x1 ... x1000, y1 ... y1000, and z1 ... z1000). Find the average offsets x_offset, y_offset, and z_offset. Once data is read from the sensor, subtract the offsets.

x_offset = average(x1, ..., x1000) y_offset = average(y1, ..., y1000) z_offset = average(z1, ..., z1000)

f1