Skip to content

Ahellrigel33/MiniSwerveDrive

Repository files navigation

Mini Swerve Drive

Project by Andrew Hellrigel and Ryan Chen

A swerve drive is a 4 wheeled robot where each wheel can be independently driven and steered. This allows the robot to be able to translate in any direction while also being able to rotate at the same time. We built a simple swerve drive robot using stepper motors as the steering motors and 550 DC motors as the drive motors for each module. Via wifi with an ESP8266, it connects to a computer that is running a python script to read an XBOX controller input and then send the commands.

View a video of the swerve drive

Swerve Drive Assembly

mini_swerve_drive_pic

Mechanical Design

CAD Model

View the CAD Model on OnShape

Frame with One Module

Frame

Single Swerve Module

SwerveModule

Parts Needed

For the mechanical assembly, most of the parts can be 3D printed from the files located in the OnShape CAD model. However, there are a few extra parts that are needed as shown below.

Additionally, some metric and standard hardware is needed for assembly (mostly M3, M4, and 6-32 screws and nuts are used)

Electrical Design

The electrical design works with an MBED LPC1768 microcontroller as the main controller for the drivetrain. The MBED connects to 4 motor controllers, 4 stepper motor controllers, and a bluetooth module. For power, a 3S lipo battery and a 5V buck converter are used. To simplify the wiring to the motor controller, a hex inverter is used. All of these parts can be found below. An XBOX controller is used to be able to drive the robot.

Parts Needed

550DCMotor

BTS7960MotorDriver

StepperMotor

drv8825

ESP8266

HexInverter

5VBuckRegulator

3SLipo

XBOX Controller

Schematic

Below is a wiring diagram of how to make all of the connections needed for this project to work.

Wiring Diagram

Swerve Wiring Diagram drawio

Software Design

The software to control the swerve drive robot is made up of two parts. First, there is a python script that takes controller inputs from the XBOX controller and converts the data to be sent over Wi-Fi to the ESP8266 connected to the MBED. Secondly, the MBED reads the incoming data over a serial port and does the math to convert joystick inputs into wheel positions and speeds. The inverse kinematics math that needs to be performed can be found from this whitepaper. Once the appropriate wheel positions and speeds are calculated, those commands can be sent out to the appropriate motor drivers and stepper motor drivers. Custom libraries for these motor drivers were designed to be able to accept these specific inputs.

High Level Software Flow

high_level_software_overview

Swerve Drive Inverse Kinematics

SwerveInverseKinematics

ESP8266 Software

All of the ESP8266 software used for this project can be found at the link below.

The ESP8266 should be flashed using Arduino IDE. Follow these instructions to download the library to use ESP8266 through the Arduino IDE.

In the esp8266_setup.ino file, replace the network name/password strings with the network that your computer will be connected to.

MBed Software

All of the mbed software used for this project can be found at the link below.

Python Software

All of the python software used for this project can be found at the link below.

In the python code, replace the existing IP address for ESP8266 with the IP address outputted by the ESP8266 on the Arduino Serial Monitor.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published