Skip to content

qooiprww/mecanum-wheel-Robot-PID-control

Repository files navigation

mecanum-wheel-Robot-PID-control

Arduino Uno, motor control shield L293D, MPU-9250 sensor mudule, 4 * JGA25-370 motor, jumper wires, 4*dumpers & 3s lipo are used in the actual project.

MPU-9250 sensor setup on Raspberry Pi 3B
MPU-9250 sensor setup on Arduino Uno

MPU-9250 sensor setup on Raspberry Pi 3B

1. Build the connection

Connect SCL & SDA pin to pin5 & pin3 of Raspberry Pi, then connect Vcc & Ground pin to the 3.3V power pin(pin1) & Ground pin of Raspberry Pi
connection

2. Setup the Raspberry Pi

First we set up a folder for the project in the /home/pi directory and get the i2c tools installed

mkdir jbc
cd jbc
mkdir scripts
sudo apt-get install i2c-tools

Click the Menu in the top Left Corner, go to Prefrences->Raspberry Pi Configuration->Interfaces and enable i2c (this will require a reboot).

3. Setup the environment

sudo i2cdetect -y 1

If the number 68 is in the grid that displays, mpu is detected.
Then install cmake for building the sensor's library

sudo apt-get install cmake

Install python to setup the develop environment

sudo apt-get install python-dev

Install Octave to calibrate the sensor

sudo apt-get install octave

Next, get the RTIMULib Library from Github

git clone https://github.com/richards-tech/RTIMULib2.git
cd RTIMULib2/Linux/RTIMULibCal
make -j4
sudo make install

The last thing is to setup our working directory

cp -r /home/pi/jbc/RTIMULib2/RTEllipsoidFit/ /home/pi/jbc/

4. Calibrating the MPU-9250 on the Raspberry Pi

Change to the RTEllipsoidFit folder and run RTIMULibCal:

cd /home/pi/jbc/RTEllipsoidFit/
RTIMULibCal

Then follow the instructions to calibrate the sensor.
After finished, copy the sonser data file to our working dictionary

cp RTIMULib.ini /home/pi/jbc/scripts/

5. Copy the script

Download the imu2.py file and place it under scripts folder

MPU-9250 sensor setup on Arduino Uno

1. Build the connection

Connect SCL & SDA pin to A5 & A4 of Arduino Uno, then connect Vcc & Ground pin to the 3.3V power pin(pin1) & Ground pin of Arduino Uno
connection

2. Download & install Arduino Librarys

Download library zip files from the Arduino_Library.
Unpack the folders and paste them to the library folder under Arduino root directory.

3. Copy the script

Download the mecanum.ino file and load it onto Arduino Uno.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published