The project is heavily incomplete, and due to chip shortage, will not be complete in the near future. However, the project is not abandoned, and work will continuously be done.
Story:"And the 32U4 don't have enough interrupts, so I will definitely need the SAMD21 at some point..."What do you mean by "Expected 27-Mar-2023"?
[insert picture]
What about... Yeah what about Digikey? Does anyone have any leftover stock I can get to?
[insert picture]. caption: ".. 0 in stock. I guess that's all I need to know."
So! No chip for you. Big deal. But there are Arduino Zeros, so I am probably just going to grab one. I wanted one anyway.
Oh right. The story.
When I decided to buy KSP and give it a try (no regret; tons of fun), I noticed that the game supports a thing called "6-dof input device".
That pulled me in. What is this "6-dof input device" thing? What does it look like? What else can I use it for?
By definition, it's a device that collects 3D movement and give it to the computer. The 6 Degree Of Movement, technically, refer to the 3 axes that an object can move in: forward/backward(X-axis), left/right(Y-axis), and up/down(Z-axis). The other 3 is the rotation along the 3-axis: Roll (Rotation-X), Pitch (Rotation-Y), and Yaw (Rotation-Z).
Since such a controller can capture motion in all 3 axes, it can be used to control/manipulate virtual 3D objects, like in CAD and in games. Basically, a VR controller, except it's for the more down-to-earth Desktop work and play.
So that's the principle. But first, a little bit of background.
6-dof input devices are not new. Every single VR controller is technically a 6-dof input device, there is the 3DConnecxion that make an array of 3D input devices, and you have the other Hackaday starter-founder person that went ahead and commercialized his idea into a product. However, the common theme among them is their use of Joysticks.
Joysticks are not necessarily bad -- they are a very user-friendly way of gathering input. Simply put your thumb on the stick's head, move it in the direction you wanted to input, and release it when you no longer wish for movement. The problem is the way the input is gathered: since the stick have a finite amount of movement, it then is impossible to represent the stick's movement (from its original position) as displacement, but instead as acceleration. This seems fine, until you have to consider the use cases of such devices -- CAD, design, and simulation, the reason for the pursuit of such a device in the first place.
This is what I asked myself: "Imagine scrolling through a big spreadsheet, or website. Which one make more sense, a scrolling wheel, or a joystick?"
___
But first, we must develop the code/firmware so the microcontroller can appear to the computer as such a device. To do that we have to look up what USB report it must send.
[insert picture from USB org documentation]
It does list the various different data values for the different fields of the USB descriptor, but its less useful if you are making a descriptor from scratch since it does not actually list the values of the descriptor headers in the first place.
Fortunately, I am able to get access to both a working USB Joystick library, as well as a working 6-dof input device -- the 3DConnexion SpaceMouse (wireless).
Some "sniffing" with USBLyzer reveal some interesting secrets
[insert USBLyzer picture]
although I am able to modify the code to "simulate" a "HID compliant Input Device", I cannot get any applications to "grab" the data and turn it into something useful.
I suspect it's a driver thing, since the space mouse by and of itself (without the drivers) also did nothing in those applications. In that case, I will have to make a driver. Which can go from being reasonably simple to being an absolute brain-exploder.
___
Now onto hardware.
Getting a ball to roll in all 3 axis(es) is slightly more challenging than one might expect. Some serious over-engineering must be performed in order to allow the ball to roll along (a series of roller-on-top-of-rollers). Or we can just put in a scroll-ring-esque thing so people can spin it to input the 3rd axis. Or we can use Teflon pads and optical sensors. Since optical sensors do not rely on physical contact with the ball to work, the ball can just slide around, where the friction of the surfaces is minimized with teflon pads. However, I much prefered a mechanical design as my original intended for.
The rollers are to be arranged in a triangular configuration, where the three rollers are spaced 120 degrees apart. Another set of rollers offset by 60 degrees are used to make the enclosure.
The ball is as simple as a rubber bouncy ball from Walmart. It is large and round, -- perfect for crude 3D printed prototypes where tolerance is loose. However the ball have a lot of friction and prevents smooth rolling (at the moment). Perhaps a ball made from another material will perform better, but in either case there need to be some form of support or fixture for the rollers so they will stay in place.
The movement of the wheels are read with optical encoders, consider that over the lifespan of the device the wheel will undergo many, many rotations and mechanical encoders will likely fail very short into usage. The roller consists of a disk with gaps along the edges, connected together to the wheel via a shaft, which is then fitted into the base with two rollers on either end. Two photo-interrupters detect the different times of when an air gap is at either photointerrupter to track its movement.
___
Assembly:You need a base plate, a top plate, two optical rollers as well as optical encoders, and four bushings, as well as 4x 5mm M2 standoffs for the optical encoders, and numerous M3 screws to secure the top plate to the lower plate. You will also need M2 screws to hold the "bushings" in place.
You do not have to use metric fasteners -- there is no threads in the prints so you can use any fastener (with matching nuts), as long as they fit.
The bearings used in this project are 5x11x4mm bearings used in RC car transmissions. Alternatively, you can 3D print cylinders (or tubes?) of said dimensions.
The design should allow for balls of various diameters, but it is designed and tested with a 2.25 inch.
Comments
Please log in or sign up to comment.