Swerve 2021 Pt3: Control PCB
I had alluded earlier in the year that I would likely lay out a board to replace the spaghetti mess of wire and nucleo on my printed swerve and it finally happened.
I noticed that when the motors were being driven, the IMU would randomly stop working and only report 0 angle, which obviously did not work for headless/field-centric mode.
I figured this was due to the I2C being run over wires near the module power lines (something I couldn’t change with the noodle/spaghetti wire mess above) and so I whipped up a control board that used the same STM32F446 from the Nucleo (in fact due to the IC shortage we’re experiencing right now, I actually just desoldered the F446 from the Nucleo!). No code change necessary (besides the addition of more status LEDs).
I also handle power distribution through this board and so the power lines run along the perimeter of the board to avoid noise issues. Unfortunately this was my first time laying out a switching regulator and I designed the regulator circuit with an 0805 inductor in mind. Unfortunately the inductor I chose has too small of a saturation current and I can’t get a better inductor in the 0805 package rendering the switching regulator useless. Luckily I had fears of this and broke out some pins where I could just solder the output of a BEC and so I left the switching regulator unpopulated. No worries but lesson learned!
I also got rid of the silly Battlebots style switch and replaced it with a nice Amazon toggle switch.
As an added bonus, in the event that I wanted to add additional functionality to the robot, I included a CAN transceiver, and broke out a set of SPI pins, and some generic IO pins. There’re als some XT30s for powering logic or power for an additional subsystem. We’ll see what I add in the future but I’m glad that now the drivetrain works as well as it can! I’d call this printed swerve done until I decide to strap something else on top haha.