It's been an eventful month for this project... after getting off vacation I ran into a bunch of problems, but made a bunch of solutions.
TLDR: The prototype design sucks, so I made a simulator, adjusted part choice and configuration, added AI (the good kind). Details later. Please take the 1-minute survey.
The Bad News
- The prototype PCBs got lost in the mail. So I couldn't actually test the design.
- Wouldn't have mattered much anyway, that design had a LOT of flaws.
- Turns out, the current idea of using a radial magnet only provides 5DOF reliably. We will need to use a Halbach array of magnets instead to get full 6DOF. (5 magnets)
- The ideal size for magnets for this design is 7x7x7mm cubes, which is not commonly produced.
- The current choice of sensor is actually really noisy.
- This probably needs 4 sensors, not just 3.
- The usual method for estimating position and rotation from the sensors is too slow to run on a microcontroller.
The Good News
- PCBWay has graciously offered to send some free PCBs for prototyping, no strings attached.
- I was able to build a simulator for optimizing & validating sensor and magnet designs.
- Previous version didn't work well in simulation, due to aforementioned single-magnet 5DOF issue. I have created a design which works very well in simulations. More accurate. In theory.
- We can get a MUCH better sensor for around the same price (TMAG5273). This has much less noise, more sensitivity, and includes a built-in averaging function. There's an even better version (TMAG5170) but it's 3x as expensive. We'll see if that's needed when I make the prototype.
- Custom sizes of magnets can be purchased from Alibaba. The Halbach array with custom magnets is actually cheaper than the 2 radial magnets... in bulk.
- It's actually pretty easy to train a neural net to be about as accurate as the conventional solver, and it's faster. I'll make another log with more detail later.
- PCBA services are extremely cost-effective... in bulk. While it still is possible to create a hand-solderable version, there are a few pretty small/difficult components. It's very likely the version you will buy will only have the SuperMini board hand-soldered on. Maybe the buttons too. The rest will be professionally assembled at the PCB factory.
- I am going to try and design this to be 100% 3D printed, no screws. Should be possible.
I will create another update soon with more details on the simulator and neural net. Short version is, it uses MagPyLib and PyTorch to train a 36k parameter neural net to solve for position and rotation given readings from 4 sensors. It uses LiteRT (Tensorflow Lite) to run this on the NRF52840. The current setup is accurate to about 0.4mm and 2 degrees on average, without denoising.
Here's a preview of the simulation visualization (using the neural net):
Important: Take the 1 Minute Survey
As I mentioned previously, this is actually pretty affordable, in bulk. Magnets for each board are about $1, NRF52840 board for $3, and the PCBA services can be less than $10. So we're still on track for the <$20 goal.
HOWEVER, it's only cheap if I can order a bunch of them at once. Of course, this isn't the case for the prototypes, but once the design is finalized I will want to know how many of them to buy. Especially the magnets, as apparently they have a very long lead time (probably due to Chinese holiday soon). If I end up with 400 extra magnets, that'll kinda suck for me. If demand is stronger than I thought and I run out, that'll suck for you. As a college student, pulling the trigger to buy $100 in oddly sized magnets is not something I can do recklessly, so take the survey!
Also, apparently the Magmouse name is taken, by a mouse with a magnet at the bottom, go figure... suggest names in the survey.
https://forms.gle/YADcYZhiaJF6HaDy9
Thank you.
Benjamin G.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.
Thought I'd post my answers to some of the questions you asked here.
Q: Can't you buy the PCB with the NRF52840 already soldered on?
A: Yes, but this is expensive and prone to errors. The ProMicro board is about $3, and that includes everything needed to support the chip (voltage regulator, battery charger, antenna, crystals, passives, etc), and it's a proven design. Buying JUST the chip from a distributor or PCBA service is $5-6, without the cost of supporting components and time required to design and test it. This would make it significantly more expensive and prone to design flaws, for saving about 5-10 minutes of soldering work. Maybe worth it if I sell a lot of these, but not otherwise.
Q: Can't you just copy the SpaceMouse and use IR LEDs/photodiodes?
A: I don't have a SpaceMouse to tear apart. From what I was able to find online, it needs some plastic parts to align the light properly, and I'm concerned that 3D printing might not be precise enough for that. It would also require 2 PCBs, and at least 1 mounted to the knob. It's probably possible, but I don't want to get sued for copying that. They have a patent on the optical mechanism (US8243024B2).
Q: More details on the design & process?
A: I want to make sure anything I post is high-quality and easy to understand, but I am also very busy with college, so this may take a little more time. Rest assured, I will try to keep you updated as things progress. The next steps are something like this:
1. Finalize the current PCB design and get it fabricated
2. Release the simulation code
3. Finish the 3D printed design
4. Assemble and test the prototype
5. Firmware development
Finally, I'd like to thank you for all the encouraging words. See you soon!
Are you sure? yes | no