Team 1690 is proud to present our 2019 offseason swerve drive project!
We started to work on this project in the summer, right after we came back from IRI, and after a lot of tweaks to the design and code, we’re quite pleased with the result.
The module’s design was heavily inspired by Swerve Drive Specialties’ Mark 1 module, with some changes to better suit our requirements.
Our field centric swerve code was all made from scratch and implements a lot of tricks that make driving the robot very easy and intuitive.
Link to reveal video: https://www.youtube.com/watch?v=wCakzMfRPKs
A NEO motor is used to drive the module, while a 775pro is used to steer. We chose a 775pro because we wanted to use a Talon SRX + Absolute encoder for azimuth control and to run the entire control loop on the motor controller, which is impossible with a NEO.
The two bevel gears were custom machined on a 5 axis CNC Mill: The large one is made out of aluminum with a Teflon-infused anodize coating, and is combined with the wheel itself. The smaller one is made out of brass. We chose to custom machine them because, for our current manufacturing resources, it was the same effort as purchasing gears off the shelf and milling a pattern into them, and this option saves a lot of weight (around 300g for each module). So far, the gears work great even after almost two months of non-stop use.
A US Digital MA3 Absolute encoder (12 bit PWM output) is used to sense module rotation, and while we planned to use an incremental encoder to measure wheel speed(which was connected to the NEO shaft with a small timing belt), we removed it later because the NEO’s internal encoder was enough for our needs.
Both motor controllers are mounted to the module itself, which allows easy wiring and replaceability for easy maintenance.
The 4 modules were connected to a chassis for testing. the overall weight of the chassis with all modules mounted to it + electronics was 17.5kg(38.5 lbs), we then added 5 batteries to reach a weight of 101 lbs.
Our software team decided to write the code for the swerve drive entirely from scratch.
The core of the algorithm receives a velocity vector in the field coordinate system, and a requested rotational velocity and controls the 4 modules accordingly. This same algorithm is used both in teleop driving and in autonomous (following a trajectory generated by a dedicated swerve motion profile generator we wrote).
Both in autonomous driving and teleop, we incorporated vision control that smoothly guides the robot towards vision targets.
To allow the robot to reach it’s physical limitations without skidding, tipping over or requesting more than 100% of the motor power, we designed 3 layers of acceleration limits:
- Omni-directional, for skidding
- Separate limits for each robot axis
- Forward / Reverse limit that is a function of the robot’s actual velocity
To prevent a module’s rotation when reversing, whenever a module “wants” to turn more than 90 degrees in one cycle, we reverse the wheel’s rotation and rotate the module in the shorter path to 180-wanted_angle instead.
One nice feature of our motion profile generator is that it optimizes the rotation of the robot along the path, to reach the desired angle to the target in the minimal time. As can be seen in the autonomous driving videos, the robot continuously and smoothly rotates along the path to reach the vision target in the right orientation and then the vision control algorithm gradually takes over.
A Video of the swerve drive running an autonomous path with integrated vision control:
Showcasing the vision control; in the clip, we ran a path but forgot to not use vision correction at the end of it. the robot immediately shoots itself toward the target.
A video of our driver practicing with the swerve drive, cycling between targets and around obstacles.
A video of our driver practicing defense jukes against our 2019 robot (note the distance from the tires to the wall is only 1.8m, 2/3 of the distance from rocket to cargo ship)