I got asked through an online acquitance whether I could help out with an Arduino/3D printing project. Well, I have some experience with 3D printing, and while I hadn't played with Arduinos that kind of device is pretty much in my professional wheelhouse so why not. The project was JoytoJoy. In short, it's a small set of electronics to give a create a basic 2 axis joystick, and then printing a 3D form for it. The joystick can interface to a PC as a usb device, or can be plugged into an xbox adaptive controller for console use. The basic design has 2 buttons, but one is to reset the joystick position in case it drifts, and the other was unassigned by default, but it's not a full controller.
So, away we go. The directions online are pretty clear, I'll just call out a few things that can trip you up. First, the PCB ordering was pretty smooth, total time from order to delivery was about 15 calendar days (usps). It looks like most of these fab sites will give you beginner coupons to make the PCB cost be practically 0, and make it back on what is still a reasonable shipping cost. It was 9 bucks for 5 boards. I took the time to order the rest of the components, including the MPU6050 chips from china off ebay, those took about the same lead time. I bought a few extra to use as soldering practice since I haven't done any in a while. The problem for future creators is the PCB is designed for an arduino tinket M0, and it looks like that has reached EOL. There's no big deal in switching to a new chip, but you'll need to redo the circuit board. There were still a few trinket M0s on ebay in April 2023, but I mean a few.
The one intelligent thing I did here was to print the shell during this process, and send it off for a test fit, since the end user was several states away. Doing so I discovered that the print didn't fit at all, which I traced down to my printer's flow setting being about 15% too high. All that extra filament was forcing the holes to be too small. But since I did this while I was waiting for electronics, I managed to figure it out and make some shells that fit without wasting too much time. The quantum wheelchair uses a 6.4mm hole, or more likely 1/4", so to test the fit I realized afterwards I can just stick it on a 1/4" drill bit.
The electronics assembly was straightforward, and I can report my soldering is still terrible. But good enough. After soldering the headers to the chips, I created the circuit on a breadboard and plugged it into the PC to work on the software loading. That way in case I discovered my soldering was bad it would still be pretty easy to fix.
And of course, that's where I made my first critical mistake. With the latest arduino IDE, there are 2 ways to load a software library, of which you need 2 for this project. The first, and easiest, is to search in the list of bundled libraries and click add. The second which is almost as easy, is to download the files, and then import it, the IDE does the right thing and moves the files where it needs them. Do the latter. The problem which I diagnosed after several hours, is the Tokn library available in the IDE by default is actually out of date, and contains a critical bug that screws up the gyro position reading. Oops. After essentially reimplementing it to try and diagnose it, I realized the version in github pointed to by the project was different, and that version works perfectly.
With that out of the way everything worked perfectly. So, off to solder the components to the PCB and do a final test.
The soldering to the PCB went fine, though I clipped one pin a bit close and needed to touch up the solder afterwards. Things still worked fine. When I went to mount it in the shell I ran into a few problems though. The first, and more minor, was the screw holes were just too small, even with my extrusion settings fixed. The second was that the USB port was too low. I'm guessing my crappy soldering/trimming lead to the board not sitting as flush as normal since the header wasn't perfectly attached.
It took me a few minutes, but then I realized that's actually really easy to fix in tinkercad. The port is just a hole in the shell. So what you do is duplicate the shell, cover that hole you want with a solid patch that goes from inner wall to outer wall but is otherwise inside the model, and then invert the model from solid to hole! Voila, the exact shape of the cutout in an object you can move around. So just fill the original hole, and then move this new shape up a millimeter and invert it back into a hole. tinkercad link
So, I went a bit extra in the end and added a customized nameplate. I also struggle with Y axis inversion and couldn't figure out which way windows expects a non-inverted Y axis to move, so I added some quick arduino code to use the second button to invert the Y axis when pressed. I'll post the modification later, but it's pretty trivial. Yikes I can see layer lines on the top of that surface, I clearly needed better ironing settings. Oh well. Updated Joystick Sketch