This an improved version of separate swerve drive that is described below. This swerve drive has two "pods" that each have a wheel that can be oriented towards any angle.
This allows the robot to drive in any direction and rotate while doing so. To accomplish this, the robot uses inverse kinematics to figure out the exact angle and speed each wheel should be at to correctly drive.
Then, I used a PID loop to determine how quickly to rotate the module. Once the module in rotate to the correct place, a regression model is used to translate the desired velocity to a PWM value.
This version of the robot had many advantages over the old one. The coaxial drive made programming simpler since turning and driving used two separate motors. The cutdown of 2 Arduino Megas +1 ESP32 to just one ESP32 eliminated the need for communication between boards. I also planned out the wiring better this time, since I knew exactly what I needed.
PARTS:
Controller: 1x ESP32, 1x XBOX Bluetooth controller
Motors: 2x CQ Robot DC Gearmotor 30:1 2x CQ Robot DC Gearmotor 43.8:1
Battery: 1x 20V DeWalt Drill Battery 1x DeWalt Drill Battery Adapter.
Additional Parts: 2x 3d Printed Swerve Modules + Necessary Bearings (NOTE: 1 large X-contact bearing 3"OD 2.5"ID is used which fits the wheel module inside it)
Swerve is the dominant drivetrain used by FIRST robotics teams, of which I am apart of. This got me interested into how the drivetrain works, leading me to try and create something similar.
This is a differential drive, meaning it uses the sum and difference of the two motors to either rotate, drive, or both. There is also a coaxial drive that accomplishes the same goal but has separate motors for rotation and driving. I decided on a differential drive because there were printable models publicly available, the one I used was designed by Mark Sommers.
The robot communicates via Bluetooth using the ESPNOW protocol, with one ESP32 on the robot, and another connected to joysticks.
Once I got far enough into the project, I realized that what had was imprecise, difficult to control and simply not good enough, this led me to do a complete teardown, and build back from the ground up, designing my own coaxial swerve modules.
PARTS:
Controller: 2x Arduino Atmega, 2x ESP 32
Motors: 2x CQ Robot DC Gearmotor 30:1 2x CQ Robot DC Gearmotor 43.8:1
Motor Controller: 2x DROK L298 12V Dual H-Bridge Motor Speed Controller
Battery: 1x 20V DeWalt Drill Battery 1x DeWalt Drill Battery Adapter.
Additional Parts: 2x 3d Printed Swerve Modules + Necessary Bearings
By changing the velocities of the three wheels the robot is able to move in any direction while rotating, regardless of orientation. This project introduced me to Arduino, teaching me how to use C++, vector math, and wiring
Although a good first project, it was riddled with issues the motors were imprecise, the battery pack was large and clunky, and the wiring was very messy.
PARTS:
Controller: 1x Arduino Atmega
Motors: 3x TT Motor dual DC 3-6V 1:48
Motor Controller: 2x HiLetgo L298N Dual H-Bridge
Battery: 6x AA rechargeable batteries
Additional Parts: 1x Antenna + 1x Remote Control (not pictured)