You are browsing as a guest. Sign up (or log in) to start making projects!

joshua_r

@joshua_r

Joined June 3rd, 2026

  • 21Devlogs
  • 2Projects
  • 1Ships
  • 15Votes
Ship Pending review

3D printed coaxial swerve drive! This was heavily inspired by FRC swerves and it really fun to make.
Designing and everything hardware related was honestly pretty easy, but wiring was a pain. Each brushless motor driver needed 3 pwm pins on the same hardware timer and on nucleos, some of the pins serve multiple uses, creating some problems for me. Also there were a lot of times that things that seemed like software issues were actually wiring issues, like when the adafruit motor shield stopped working because its i2c connection was tied to pins A4 and A5.
Overall, this was the most technologically advanced project I have ever made, partly because I was using a new microcontroller (stm32 nucleo) but also because I had to understand the math involved in driving a swerve correctly. Not to mention I was also running 4 brushless motors and 4 separate PIDs. It was really fun to build and I would definitely do it again given the opportunity. Maybe even a differential swerve next time?

  • 14 devlogs
  • 49h build
Video of Project → See source code →
Open comments for this post

11h 19m 54s logged

Done! 🎉

I finished making all the things for the github like the wiring diagram and demo video. Fixed all issues with field relative control, my original math was incorrect. Also one of the modules wasn’t rotating correctly but it turns out it was just the magnet came loose.

Will be submitting to Outpost soon!

Demo video link: https://www.youtube.com/watch?v=bPC4PA_9ZH0

0
0
13
Open comments for this post

5h 4m 15s logged

First Movements
Tested full motion for the first time woohoo! 🎉🎊

Things surprisingly worked alright, the kinematics for the rotation while strafing is still a bit off but translation by itself works great. Also the wheels have very little traction so I’ll have to increase that somehow.

Additionally, field centric control on the joystick works really well, so up on the joystick means up in real life relative to the start heading and regardless of the rotation of the robot.

Things Left to Do on Hardware

  • Add traction to the wheels

Things Left to Do on Software

  • Fix swerve kinematics for rotation
1
0
10
Open comments for this post

11h 33m 13s logged

Integration Pain
I got all the subsystems working separately but the extremely fun part of integrating them all together was the first time I truly understood why engineers hate integration. There were a plethora of pin conflicts underlying the hardware since many of the pins on the nucleo serve multiple purposes.
One example of this was the adafruit motor shield’s i2c bus interfering with the front left drive motor’s FOC math since PB8 and PB9 are connected to the sda and scl pins on the Arduino headers of the nucleo. As you can see from the extremely janky wiring in the photo, just connecting the shield so it gets power on the other side of headers and manually connecting the shield to a separate i2c bus using jumper wires, I was able to finally make all the subsystems work together.
This was just one example of the many problems that arose, hence why there are almost 12 hours being logged in this post, but this project is finally on the last stretch. I did also make a lot of other progress like confirming the swerve kinematics work along with the flysky controller for inputs :)

Things Left to Do on Hardware

  • Cut off the sda and scl pins on the motor shield and solder a jumper wire to the new i2c bus

Things Left to Do on Software

  • Tune the pid for FR, BR, and BL turn motors
  • Integrate offsets into the steering angle for the motors
  • Integrate the MPU6050 readings for field oriented swerve control
0
0
8
Open comments for this post

48m logged

Finished New Mounting
I used some old kite string I found which should be a lot stronger than the old thread I was using. Tomorrow I can start testing code again :)

0
0
12
Open comments for this post

3h 3m 46s logged

Side Quest
The adafruit motor shield v2 that I am using to control the n20 motors suddenly stopped working today. After a long struggle, I managed to trace it back to the A4 and A5 pins being attached to the nucelo alongside the dedicated SDA and SCL pins. Since SDA and SCL are tied to A4 and A5 on normal arduinos but seemingly not on nucelos, simply removing those pins fixed all issues. A very unsatisfying end to a 3 hour struggle :(

I did mange to test out the front left module, and spent some time tuning the azimuth pid.

Things Left to Do on Hardware

  • Wire management

Things Left to Do on Software

  • Test the rest of the hardware (FR, BR, and BL modules, radio communication, and gyro).
  • Program the rest of the swerveKinematics.cpp file
  • Program mpu6050 gyro
  • Program in controls from the inputs from the flysky controller
0
0
7
Open comments for this post

3h 14m 2s logged

Finished Wiring
As you can tell by this extremely beautiful cable management and totally not messy arrangement of wires, I should have probably made a pcb for this (Maybe I will later).

Things Left to Do on Hardware

  • Wire management

Things Left to Do on Software

  • Test all hardware individually to isolate any potential wiring issues
  • Program the rest of the swerveKinematics.cpp file
  • Program in controls from the inputs from the flysky controller
0
0
7
Open comments for this post

6h 0m 54s logged

Swerve Drivebase update
Cut out bellypan out of scrap board because creating large panels isn’t really suited for 3d printing and I can drill new holes into this material easily for mounting electronics. Mounted the majority of the electronics as well.

On the software side I got radio communication working and created a new .h and .cpp file for implementing radio control into the main program.

Things Left to Do on Hardware

  • Attach radio receiver and battery
  • Wire all components together
  • Resolder the wires on one of the n20 motors (bad connection the first time lol).

Things Left to Do on Software

  • Program the rest of the swerveKinematics.cpp file
  • Program in controls from the inputs from the flysky controller
0
0
5
Open comments for this post

8h 32m 29s logged

Finished Drive Base
Got all the modules built and attached. Some modules are a little bit stiff so if that hinders the motors I’ll need to change some clearances, but I think its minimal enough to where it won’t matter.

Things Left to Do on Hardware

  • Build and attach bellypan for electronics
  • Mount electronics to bellypan
  • Wire everything up

Things Left to Do on Software

  • Test radio communication from fs-ia6B receiver to nucleo
  • Program commands in based on controller input
  • Program swerve kinematics in using the custom angle control and drive control functions already created
0
0
4
Open comments for this post

2h 51m 34s logged

Swerve azimuth control

Got PID working for one module, though it probably still needs to be tuned. Also I need to figure out the logic for wrapping around since the encoder measures values from 0-1023 which I have mapped to 0 to 360, but after 360 it goes back to 0 which complicates the logic a bit. I also need to implement the logic for the swerve just switching the wheel rotation direction rather than rotate the entire module 180 degrees whenever it can. Realistically, the module should only ever rotate a max of 90 degrees from one input to the next

0
0
9
Open comments for this post

2h 46m 52s logged

First Working Moments before failure

The wall bot was successfully working and drew some very basic shapes like squares moments before the tether suddenly snapped and it succumed to the laws of physics. 🫠

The picture is of it working about half a second before it snapped

Things to do:

  • Get stronger string
  • Program a method to command the bot to any coordinate on the whiteboard rather than manually programming individual steps
1
0
13
Open comments for this post

2h 13m 44s logged

Finished wiring (wire management was a pain as always)
Finished printing the whiteboard mounts for the string
Started programming!

0
0
9
Open comments for this post

2h 52m 35s logged

Tested all hardware for the swerve drive. The latest version of SimpleFOC (2.4.0) doesn’t work for some reason but the previous version (2.3.5) works perfectly fine. The as5600 encoders work great and track the rotation of the module nicely. I also made a few design changes to make assembly easier which includes changing the design of the encoder column support and the design of the standoffs.

0
0
8
Open comments for this post

24m 53s logged

Redesigned pen holder to hold the tip of the marker at the correct depth when deployed.

Things to do:

  • Design spools
  • Design corner mounts for the whiteboard to hold the string
  • Program!
0
0
11
Open comments for this post

2h 26m 56s logged

Swerve module v1 assembled! The gears mesh nicely and the entire system has a lot less friction than I thought it would :)

Things needed to do in terms of design:

  • Design support for the shaft that holds the central drive gear column since right now its cantilevered.
  • Redesign standoffs because the current design breaks too easily
  • Design encoder for brushless drive motor so FOC can be used
0
0
10
Open comments for this post

2h 25m 14s logged

Finished soldering wires to the motors and header pins to the encoders. Got stm32 nucleo 64 f411re working with platformio ready for programming along with the motor shield to control everything!

0
0
13
Open comments for this post

57m 51s logged

first assembly of the wall bot done in real life! Many modifications are needed, mostly regarding clearances, but the entire pen holder needs to be redesigned because it holds the pen to close to the bottom of the bot right now

0
0
96
Open comments for this post

59m 59s logged

The main gantry is done except for the pen lifting mechanism. The spools for the rope still need to be designed as well as the mounts for the end of the rope.

0
0
17
Loading more…

Followers

Loading…